[
  {
    "path": ".gitattributes",
    "content": ".gitignore      export-ignore\n.gitattributes   export-ignore\n"
  },
  {
    "path": ".gitignore",
    "content": "build\n*.kdev4\n.kdev4\n*~\n*.log\n*.pyc\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "include(cmake/Macros/icecc.cmake) # this must be the first line!\n\nproject(pysidebindings)\n\ncmake_minimum_required(VERSION 2.6)\nset(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Macros/\n                      ${CMAKE_MODULE_PATH})\nfind_package(Shiboken 1.2.0 REQUIRED)\nfind_package(Qt4 4.5.0 REQUIRED)\nfind_file(GL_H \"gl.h\" PATH_SUFFIXES \"GL\")\ninclude(FindQt4Extra)\n\nset(XVFB_EXEC \"\")\noption(USE_XVFB \"Uses xvfb-run with the unit tests to avoid QtGui tests popping windows on the screen.\" FALSE)\nif(USE_XVFB)\n    find_program(XVFB_RUN NAMES xvfb-run)\n    if (NOT ${XVFB_RUN} MATCHES \"XVFB_RUN-NOTFOUND\")\n        set(XVFB_EXEC ${XVFB_RUN} -a)\n        message(STATUS \"Using xvfb-run to perform QtGui tests.\")\n    endif()\nendif()\n\noption(BUILD_TESTS \"Build tests.\" TRUE)\noption(ENABLE_VERSION_SUFFIX \"Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous.\" FALSE)\nset(LIB_SUFFIX \"\" CACHE STRING \"Define suffix of directory name (32/64)\" )\nset(LIB_INSTALL_DIR \"${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\" CACHE PATH \"The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})\" FORCE)\nif(CMAKE_HOST_APPLE)\n    set(ALTERNATIVE_QT_INCLUDE_DIR \"\" CACHE PATH \"The Alternative value to QT_INCLUDE_DIR. Necessary to fix bug on cmake 2.8 MACOS users\")\nendif()\n\nif(MSVC)\n    set(CMAKE_CXX_FLAGS \"/Zc:wchar_t- /GR /EHsc /DNOCOLOR /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS\")\nelse()\n    if(CMAKE_HOST_UNIX AND NOT CYGWIN)\n        set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden -Wno-strict-aliasing\")\n    endif()\n    set(CMAKE_CXX_FLAGS_DEBUG \"-g\")\n    option(ENABLE_GCC_OPTIMIZATION \"Enable specific GCC flags to optimization library size and performance. Only available on Release Mode\" 0)\n    if(ENABLE_GCC_OPTIMIZATION)\n        set(CMAKE_BUILD_TYPE Release)\n        set(CMAKE_CXX_FLAGS_RELEASE \"-DNDEBUG -Os -Wl,-O1\")\n        if(NOT CMAKE_HOST_APPLE)\n            set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -Wl,--hash-style=gnu\")\n        endif()\n    endif()\n\n    if(CMAKE_HOST_APPLE)\n        if (NOT QT_INCLUDE_DIR)\n            set(QT_INCLUDE_DIR \"/Library/Frameworks\")\n        endif()\n        if(ALTERNATIVE_QT_INCLUDE_DIR)\n            set(QT_INCLUDE_DIR ${ALTERNATIVE_QT_INCLUDE_DIR})\n        endif()\n        string(REPLACE \" \" \":\" QT_INCLUDE_DIR ${QT_INCLUDE_DIR})\n    endif()\nendif()\n\nif(NOT CMAKE_BUILD_TYPE)\n    set(CMAKE_BUILD_TYPE ${SHIBOKEN_BUILD_TYPE})\nendif()\n\nset(BINDING_NAME PySide)\nset(BINDING_API_MAJOR_VERSION \"1\")\nset(BINDING_API_MINOR_VERSION \"2\")\nset(BINDING_API_MICRO_VERSION \"4\")\nset(BINDING_API_RELEASE_LEVEL \"final\") # alpha, beta, rc, or final\nset(BINDING_API_SERIAL 0) # leave as 0 when release level is final\nset(BINDING_API_VERSION \"${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}\" CACHE STRING \"PySide version\" FORCE)\nif (BINDING_API_RELEASE_LEVEL STREQUAL \"final\")\n    set(BINDING_API_VERSION_FULL \"${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}\"\n        CACHE STRING \"PySide version [full]\" FORCE)\nelse()\n    set(BINDING_API_VERSION_FULL \"${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}~${BINDING_API_RELEASE_LEVEL}${BINDING_API_SERIAL}\"\n        CACHE STRING \"PySide version [full]\" FORCE)\nendif()\nset(PYSIDE_QT_VERSION \"${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}\" CACHE STRING \"Qt version used to compile PySide\" FORCE)\nif(ENABLE_VERSION_SUFFIX)\n      set(pyside_SUFFIX \"-${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}\")\nendif()\n\ninclude(${QT_USE_FILE})\nif (${QTVERSION} VERSION_LESS 4.5.0)\n    message(FATAL_ERROR \"You need Qt4.5, found ${QTVERSION}.\")\nendif()\n\n# Configure OS support\nset(ENABLE_X11 \"0\")\nset(ENABLE_MAC \"0\")\nset(ENABLE_WIN \"0\")\nset(ENABLE_SIMULATOR \"0\")\nif(Q_WS_X11)\n    set(ENABLE_X11 \"1\")\n    if(Q_WS_MAEMO_5)\n        set(AUTO_OS \"maemo\")\n    else()\n        set(AUTO_OS \"x11\")\n    endif()\nelseif(Q_WS_MAC)\n    set(ENABLE_MAC \"1\")\n    set(AUTO_OS \"mac\")\nelseif(Q_WS_WIN)\n    set(ENABLE_WIN \"1\")\n    set(AUTO_OS \"win\")\nelseif(Q_WS_SIMULATOR)\n    set(ENABLE_SIMULATOR \"1\")\n    set(AUTO_OS \"simulator\")\nelse()\n    message(FATAL_ERROR \"OS not supported\")\nendif()\nmessage(STATUS \"Detected OS: ${AUTO_OS}\")\n\nif (WIN32)\n    set(PATH_SEP \"\\;\")\nelse()\n    set(PATH_SEP \":\")\nendif()\n\n# Define supported Qt Version\nset(SUPPORTED_QT_VERSION \"${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}\")\n\nset(BINDING_VERSION ${BINDING_API_VERSION}.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR})\n\n# uninstall target\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake\"\n               \"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake\"\n               IMMEDIATE @ONLY)\nadd_custom_target(uninstall \"${CMAKE_COMMAND}\"\n                  -P \"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake\")\n\n\nset(ARCHIVE_NAME pyside-qt${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}+${BINDING_API_VERSION_FULL})\nadd_custom_target(dist\n    COMMAND mkdir -p \"${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}\" &&\n            git log > \"${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}/ChangeLog\" &&\n            git archive --prefix=${ARCHIVE_NAME}/ HEAD --format=tar --output=\"${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar\" &&\n            tar -C \"${CMAKE_BINARY_DIR}\" --owner=root --group=root -r \"${ARCHIVE_NAME}/ChangeLog\" -f \"${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar\" &&\n            bzip2 -f9 \"${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar\" &&\n            echo \"Source package created at ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.bz2.\\n\"\n    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})\n\nif (NOT SITE_PACKAGE)\n    execute_process(\n        COMMAND ${SHIBOKEN_PYTHON_INTERPRETER} -c \"from distutils import sysconfig; \\\\\n            print(sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}'))\"\n        OUTPUT_VARIABLE SITE_PACKAGE\n        OUTPUT_STRIP_TRAILING_WHITESPACE)\n    if (NOT SITE_PACKAGE)\n        message(FATAL_ERROR \"Could not detect Python module installation directory.\")\n    elseif (APPLE)\n        message(STATUS \"!!! The generated bindings will be installed on ${SITE_PACKAGE}, is it right!?\")\n    endif()\nendif()\n\nset(GENERATOR_EXTRA_FLAGS --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero)\nif(WIN32 OR DEFINED AVOID_PROTECTED_HACK)\n    message(STATUS \"PySide will be generated avoiding the protected hack!\")\n    set(GENERATOR_EXTRA_FLAGS ${GENERATOR_EXTRA_FLAGS} --avoid-protected-hack)\n    add_definitions(-DAVOID_PROTECTED_HACK)\nelse()\n    message(STATUS \"PySide will be generated using the protected hack!\")\nendif()\n\nadd_subdirectory(libpyside)\nif(QT_QTUITOOLS_FOUND AND QT_QTDESIGNER_FOUND)\n    add_subdirectory(plugins)\nendif()\n# project directories\nadd_subdirectory(PySide)\nif (BUILD_TESTS)\n    enable_testing()\n    add_subdirectory(tests)\nendif ()\n\nfind_program(DOT_EXEC dot)\nif (QT_SRC_DIR AND DOT_EXEC)\n    add_subdirectory(doc)\nelse ()\n    message(STATUS \"QT_SRC_DIR variable not set or graphviz not found, apidoc generation targets disabled.\")\nendif()\n"
  },
  {
    "path": "COPYING",
    "content": "GNU LESSER GENERAL PUBLIC LICENSE\n               Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n                Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\n          GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n\n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n                NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n             END OF TERMS AND CONDITIONS\n\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\n"
  },
  {
    "path": "PySide/CMakeLists.txt",
    "content": "project(pyside)\n\ninclude(PySideModules)\n\n# Configure include based on platform\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/global.h.in\"\n               \"${CMAKE_CURRENT_BINARY_DIR}/pyside_global.h\" @ONLY)\n\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in\"\n               \"${CMAKE_CURRENT_BINARY_DIR}/__init__.py\" @ONLY)\n\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/_utils.py.in\"\n               \"${CMAKE_CURRENT_BINARY_DIR}/_utils.py\" @ONLY)\n\nHAS_QT_MODULE(QT_QTCORE_FOUND QtCore)\nHAS_QT_MODULE(QT_QTGUI_FOUND QtGui)\nHAS_QT_MODULE(QT_QTNETWORK_FOUND QtNetwork)\nHAS_QT_MODULE(QT_QTWEBKIT_FOUND QtWebKit)\nHAS_QT_MODULE(QT_QTSVG_FOUND QtSvg)\nHAS_QT_MODULE(QT_QTXML_FOUND QtXml)\nHAS_QT_MODULE(QT_QTTEST_FOUND QtTest)\nHAS_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)\nHAS_QT_MODULE(QT_QTSQL_FOUND QtSql)\nif(QT_QTDESIGNER_FOUND)\n    HAS_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)\nendif()\nHAS_QT_MODULE(QT_QTHELP_FOUND QtHelp)\nHAS_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)\nHAS_QT_MODULE(QT_QTMAEMO5_FOUND QtMaemo5)\nHAS_QT_MODULE(QT_QTSCRIPT_FOUND QtScript)\nHAS_QT_MODULE(QT_QTSCRIPTTOOLS_FOUND QtScriptTools)\nHAS_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia)\nHAS_QT_MODULE(QT_PHONON_FOUND phonon)\nHAS_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)\n\n# install\ninstall(FILES \"${CMAKE_CURRENT_BINARY_DIR}/__init__.py\"\n        DESTINATION \"${SITE_PACKAGE}/${BINDING_NAME}${pyside_SUFFIX}\")\ninstall(FILES ${CMAKE_CURRENT_BINARY_DIR}/_utils.py\n        DESTINATION \"${SITE_PACKAGE}/${BINDING_NAME}${pyside_SUFFIX}\")\ninstall(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_templates.xml\n        DESTINATION share/PySide${pyside_SUFFIX}/typesystems)\ninstall(FILES ${CMAKE_CURRENT_BINARY_DIR}/pyside_global.h\n        DESTINATION include/${BINDING_NAME}${pyside_SUFFIX})\n\n"
  },
  {
    "path": "PySide/QtCore/CMakeLists.txt",
    "content": "project(QtCore)\n\nset(QtCore_gluecode \"${CMAKE_CURRENT_SOURCE_DIR}/glue/qeasingcurve_glue.cpp\")\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)\n    set (QtCore_46_SRC )\nelse()\n    set(QtCore_46_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qeasingcurve_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qabstractanimation_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qabstractstate_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qabstracttransition_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qanimationgroup_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qeventtransition_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qfinalstate_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qhistorystate_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qmargins_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qparallelanimationgroup_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qpauseanimation_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qprocessenvironment_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qpropertyanimation_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qsequentialanimationgroup_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qsignaltransition_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qstate_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qstatemachine_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qstatemachine_signalevent_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qstatemachine_wrappedevent_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qvariantanimation_wrapper.cpp\n    )\nendif()\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 7)\n    set (QtCore_47_SRC )\nelse()\n    set(QtCore_47_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qelapsedtimer_wrapper.cpp\n    )\nendif()\n\nif(ENABLE_WIN)\n    set(SPECIFIC_OS_FILES\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/msg_wrapper.cpp\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/point_wrapper.cpp\n    )\nelse()\n    set(SPECIFIC_OS_FILES \"\")\nendif()\n\nset(QtCore_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstracteventdispatcher_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstractfileengine_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstractfileenginehandler_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstractfileengineiterator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstractitemmodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstractlistmodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstracttablemodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbasictimer_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbitarray_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbuffer_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbytearray_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qbytearraymatcher_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qchildevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qcoreapplication_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qcryptographichash_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qdatastream_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qdate_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qdatetime_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qdir_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qdiriterator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qdynamicpropertychangeevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qeventloop_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfactoryinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfile_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfileinfo_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfilesystemwatcher_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfsfileengine_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qgenericargument_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qgenericreturnargument_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qiodevice_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qlibraryinfo_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qline_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qlinef_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qlocale_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaclassinfo_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaenum_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaproperty_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetamethod_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmetaobject_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmimedata_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmodelindex_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmutex_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qmutexlocker_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qobject_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qpersistentmodelindex_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qpluginloader_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qpoint_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qpointf_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qprocess_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qreadlocker_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qreadwritelock_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qrect_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qrectf_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qregexp_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qresource_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qrunnable_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsemaphore_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsettings_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsignalmapper_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsize_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsizef_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsocketnotifier_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsysinfo_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsystemlocale_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qsystemsemaphore_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qt_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtconcurrent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtcore_module_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtemporaryfile_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtextboundaryfinder_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtextcodec_converterstate_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtextcodec_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtextdecoder_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtextencoder_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtextstream_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtextstreammanipulator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qthread_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qthreadpool_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtime_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtimeline_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtimer_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtimerevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qtranslator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qurl_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/quuid_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qwaitcondition_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qwritelocker_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamattribute_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamattributes_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamentitydeclaration_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamentityresolver_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamnamespacedeclaration_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamnotationdeclaration_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamreader_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamwriter_wrapper.cpp\n${QtCore_46_SRC}\n${QtCore_47_SRC}\n${SPECIFIC_OS_FILES}\n)\n\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/typesystem_core.xml.in\"\n               \"${CMAKE_CURRENT_BINARY_DIR}/typesystem_core.xml\" @ONLY)\n\nset(QtCore_typesystem_path \"${QtCore_SOURCE_DIR}\")\n\nset(QtCore_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}\n                        ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/\n                        ${QT_INCLUDE_DIR}\n                        ${SHIBOKEN_INCLUDE_DIR}\n                        ${libpyside_SOURCE_DIR}\n                        ${SHIBOKEN_PYTHON_INCLUDE_DIR})\nset(QtCore_libraries  pyside\n                      ${SHIBOKEN_PYTHON_LIBRARIES}\n                      ${SHIBOKEN_LIBRARY}\n                      ${QT_QTCORE_LIBRARY})\n\ncreate_pyside_module(QtCore\n                     QtCore_include_dirs\n                     QtCore_libraries\n                     \"\"\n                     QtCore_typesystem_path\n                     QtCore_SRC\n                     QtCore_gluecode\n                     ${CMAKE_CURRENT_BINARY_DIR}/typesystem_core.xml)\n"
  },
  {
    "path": "PySide/QtCore/glue/qbytearray_bufferprotocol.cpp",
    "content": "\n#if PY_VERSION_HEX < 0x03000000\n\n// QByteArray buffer protocol functions\n// see: http://www.python.org/dev/peps/pep-3118/\n\nextern \"C\" {\n\nstatic Py_ssize_t SbkQByteArray_segcountproc(PyObject* self, Py_ssize_t* lenp)\n{\n    if (lenp)\n        *lenp = self->ob_type->tp_as_sequence->sq_length(self);\n    return 1;\n}\n\nstatic Py_ssize_t SbkQByteArray_readbufferproc(PyObject* self, Py_ssize_t segment, void** ptrptr)\n{\n    if (segment || !Shiboken::Object::isValid(self))\n        return -1;\n\n    QByteArray* cppSelf = %CONVERTTOCPP[QByteArray*](self);\n    *ptrptr = reinterpret_cast<void*>(cppSelf->data());\n    return cppSelf->size();\n}\n\nPyBufferProcs SbkQByteArrayBufferProc = {\n    /*bf_getreadbuffer*/  &SbkQByteArray_readbufferproc,\n    /*bf_getwritebuffer*/ (writebufferproc) &SbkQByteArray_readbufferproc,\n    /*bf_getsegcount*/    &SbkQByteArray_segcountproc,\n    /*bf_getcharbuffer*/  (charbufferproc) &SbkQByteArray_readbufferproc\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "PySide/QtCore/glue/qcoreapplication_init.cpp",
    "content": "// Global variables used to store argc and argv values\nstatic int QCoreApplicationArgCount;\nstatic char** QCoreApplicationArgValues;\n\nvoid QCoreApplication_constructor(PyObject* self, PyObject* args, QCoreApplicationWrapper** cptr)\n{\n    if (QCoreApplication::instance()) {\n        PyErr_SetString(PyExc_RuntimeError, \"A QCoreApplication instance already exists.\");\n        return;\n    }\n\n    int numArgs = PyTuple_GET_SIZE(args);\n    if (numArgs != 1\n        || !Shiboken::sequenceToArgcArgv(PyTuple_GET_ITEM(args, 0), &QCoreApplicationArgCount, &QCoreApplicationArgValues, \"PySideApp\")) {\n        PyErr_BadArgument();\n        return;\n    }\n\n    *cptr = new QCoreApplicationWrapper(QCoreApplicationArgCount, QCoreApplicationArgValues);\n\n    Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));\n    PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);\n    Py_INCREF(self);\n}\n"
  },
  {
    "path": "PySide/QtCore/glue/qeasingcurve_glue.cpp",
    "content": "#include <Python.h>\n#include <shiboken.h>\n#include <pysideweakref.h>\n#include <QEasingCurve>\n\n#include \"glue/qeasingcurve_glue.h\"\n\n#define __ECF_ATT_NAME__        \"__ecf__\"\n#define MAX_CUSTOM_FUNCTIONS    10\n\nstatic void deleteData(void* data);\n\nstruct CustomFunctionsData\n{\n    static CustomFunctionsData m_list[MAX_CUSTOM_FUNCTIONS];\n\n    PySideEasingCurveFunctor* m_obj;\n    QEasingCurve::EasingFunction m_func;\n};\n\nCustomFunctionsData CustomFunctionsData::m_list[MAX_CUSTOM_FUNCTIONS];\n\ntemplate<int N>\nstruct CustomFunctions\n{\n    static void init()\n    {\n        CustomFunctionsData data;\n        data.m_obj = 0;\n        data.m_func = &CustomFunctions<N>::callback;\n        CustomFunctionsData::m_list[N] = data;\n\n        CustomFunctions<N-1>::init();\n    }\n\n    static qreal callback(qreal v)\n    {\n        return (*CustomFunctionsData::m_list[N].m_obj)(v);\n    }\n};\n\ntemplate<>\nstruct CustomFunctions<0>\n{\n    static void init()\n    {\n        CustomFunctionsData data;\n        data.m_obj = 0;\n        data.m_func = &CustomFunctions<0>::callback;\n        CustomFunctionsData::m_list[0] = data;\n    }\n\n    static qreal callback(qreal v)\n    {\n        return (*CustomFunctionsData::m_list[0].m_obj)(v);\n    }\n};\n\nvoid deleteData(void* data)\n{\n    delete (PySideEasingCurveFunctor*)(data);\n}\n\nvoid PySideEasingCurveFunctor::init()\n{\n    CustomFunctions<MAX_CUSTOM_FUNCTIONS-1>::init();\n}\n\nQEasingCurve::EasingFunction PySideEasingCurveFunctor::createCustomFuntion(PyObject* parent, PyObject* pyFunc)\n{\n    for(int i=0; i < MAX_CUSTOM_FUNCTIONS; i++) {\n        CustomFunctionsData& data = CustomFunctionsData::m_list[i];\n        if (data.m_obj == 0) {\n            data.m_obj = new PySideEasingCurveFunctor(i, parent, pyFunc);\n            return data.m_func;\n        }\n    }\n    //PyErr_Format(PyExc_RuntimeError, \"PySide only supports %d custom functions simultaneously.\", MAX_CUSTOM_FUNCTIONS);\n    return 0;\n}\n\nPySideEasingCurveFunctor::~PySideEasingCurveFunctor()\n{\n\n    CustomFunctionsData::m_list[m_index].m_obj = 0;\n    PyObject_SetAttrString(m_parent, __ECF_ATT_NAME__, Py_None);\n}\n\nqreal PySideEasingCurveFunctor::operator()(qreal progress)\n{\n    Shiboken::GilState state;\n    PyObject* args = Py_BuildValue(\"(f)\", progress);\n    PyObject* result = PyObject_CallObject(m_func, args);\n    qreal cppResult = 0.0;\n    if (result) {\n        Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), result, &cppResult);\n        Py_DECREF(result);\n    }\n    Py_DECREF(args);\n    return cppResult;\n}\n\nPyObject* PySideEasingCurveFunctor::callable()\n{\n    Py_INCREF(m_func);\n    return m_func;\n}\n\nPyObject* PySideEasingCurveFunctor::callable(PyObject* parent)\n{\n    return PyObject_GetAttrString(parent, __ECF_ATT_NAME__);\n}\n\nPySideEasingCurveFunctor::PySideEasingCurveFunctor(int index, PyObject* parent, PyObject* pyFunc)\n    : m_parent(parent), m_func(pyFunc), m_index(index)\n{\n    PyObject_SetAttrString(m_parent, __ECF_ATT_NAME__, m_func);\n    PySide::WeakRef::create(m_parent, deleteData, this);\n}\n\n"
  },
  {
    "path": "PySide/QtCore/glue/qeasingcurve_glue.h",
    "content": "#ifndef __QEASINGCURVE_GLUE__\n#define __QEASINGCURVE_GLUE__ \n\n#include <Python.h>\n#include <QEasingCurve>\n\nclass PySideEasingCurveFunctor\n{\n    public:\n        static void init();\n        static QEasingCurve::EasingFunction createCustomFuntion(PyObject* parent, PyObject* pyFunc);\n\n        qreal operator()(qreal progress);\n\n        PyObject* callable(); //Return New reference \n        static PyObject* callable(PyObject* parent); //Return New reference \n\n        ~PySideEasingCurveFunctor();\n    private:\n        PyObject* m_parent;\n        PyObject* m_func;\n        int m_index;\n\n        PySideEasingCurveFunctor(int index, PyObject* parent, PyObject *pyFunc);\n};\n\n#endif\n"
  },
  {
    "path": "PySide/QtCore/glue/qobject_connect.cpp",
    "content": "static bool isDecorator(PyObject* method, PyObject* self)\n{\n    Shiboken::AutoDecRef methodName(PyObject_GetAttrString(method, \"__name__\"));\n    if (!PyObject_HasAttr(self, methodName))\n        return true;\n    Shiboken::AutoDecRef otherMethod(PyObject_GetAttr(self, methodName));\n    return reinterpret_cast<PyMethodObject*>(otherMethod.object())->im_func != \\\n           reinterpret_cast<PyMethodObject*>(method)->im_func;\n}\n\nstatic bool getReceiver(QObject *source, const char* signal, PyObject* callback, QObject** receiver, PyObject** self, QByteArray* callbackSig)\n{\n    bool forceGlobalReceiver = false;\n    if (PyMethod_Check(callback)) {\n        *self = PyMethod_GET_SELF(callback);\n        if (%CHECKTYPE[QObject*](*self))\n            *receiver = %CONVERTTOCPP[QObject*](*self);\n        forceGlobalReceiver = isDecorator(callback, *self);\n    } else if (PyCFunction_Check(callback)) {\n        *self = PyCFunction_GET_SELF(callback);\n        if (*self && %CHECKTYPE[QObject*](*self))\n            *receiver = %CONVERTTOCPP[QObject*](*self);\n    } else if (PyCallable_Check(callback)) {\n        // Ok, just a callable object\n        *receiver = 0;\n        *self = 0;\n    }\n\n    bool usingGlobalReceiver = !*receiver || forceGlobalReceiver;\n\n    // Check if this callback is a overwrite of a non-virtual Qt slot.\n    if (!usingGlobalReceiver && receiver && self) {\n        *callbackSig = PySide::Signal::getCallbackSignature(signal, *receiver, callback, usingGlobalReceiver).toAscii();\n        const QMetaObject* metaObject = (*receiver)->metaObject();\n        int slotIndex = metaObject->indexOfSlot(callbackSig->constData());\n        if (slotIndex != -1 && slotIndex < metaObject->methodOffset() && PyMethod_Check(callback))\n            usingGlobalReceiver = true;\n    }\n\n    if (usingGlobalReceiver) {\n        PySide::SignalManager& signalManager = PySide::SignalManager::instance();\n        *receiver = signalManager.globalReceiver(source, callback);\n        *callbackSig = PySide::Signal::getCallbackSignature(signal, *receiver, callback, usingGlobalReceiver).toAscii();\n    }\n\n    return usingGlobalReceiver;\n}\n\nstatic bool qobjectConnect(QObject* source, const char* signal, QObject* receiver, const char* slot, Qt::ConnectionType type)\n{\n    if (!signal || !slot)\n        return false;\n\n    if (!PySide::Signal::checkQtSignal(signal))\n        return false;\n    signal++;\n\n    if (!PySide::SignalManager::registerMetaMethod(source, signal, QMetaMethod::Signal))\n        return false;\n\n    bool isSignal = PySide::Signal::isQtSignal(slot);\n    slot++;\n    PySide::SignalManager::registerMetaMethod(receiver, slot, isSignal ? QMetaMethod::Signal : QMetaMethod::Slot);\n    bool connected;\n    Py_BEGIN_ALLOW_THREADS\n    connected = QObject::connect(source, signal - 1, receiver, slot - 1, type);\n    Py_END_ALLOW_THREADS\n    return connected;\n}\n\nstatic bool qobjectConnectCallback(QObject* source, const char* signal, PyObject* callback, Qt::ConnectionType type)\n{\n    if (!signal || !PySide::Signal::checkQtSignal(signal))\n        return false;\n    signal++;\n\n    int signalIndex = PySide::SignalManager::registerMetaMethodGetIndex(source, signal, QMetaMethod::Signal);\n    if (signalIndex == -1)\n        return false;\n\n    PySide::SignalManager& signalManager = PySide::SignalManager::instance();\n\n    // Extract receiver from callback\n    QObject* receiver = 0;\n    PyObject* self = 0;\n    QByteArray callbackSig;\n    bool usingGlobalReceiver = getReceiver(source, signal, callback, &receiver, &self, &callbackSig);\n    if (receiver == 0 && self == 0)\n        return false;\n\n    const QMetaObject* metaObject = receiver->metaObject();\n    const char* slot = callbackSig.constData();\n    int slotIndex = metaObject->indexOfSlot(slot);\n\n    if (slotIndex == -1) {\n        if (!usingGlobalReceiver && self && !Shiboken::Object::hasCppWrapper((SbkObject*)self)) {\n            qWarning() << \"You can't add dynamic slots on an object originated from C++.\";\n            if (usingGlobalReceiver)\n                signalManager.releaseGlobalReceiver(source, receiver);\n\n            return false;\n        }\n\n        if (usingGlobalReceiver)\n            slotIndex = signalManager.globalReceiverSlotIndex(receiver, slot);\n        else\n            slotIndex = PySide::SignalManager::registerMetaMethodGetIndex(receiver, slot, QMetaMethod::Slot);\n\n        if (slotIndex == -1) {\n            if (usingGlobalReceiver)\n                signalManager.releaseGlobalReceiver(source, receiver);\n\n            return false;\n        }\n    }\n    bool connected;\n    Py_BEGIN_ALLOW_THREADS\n    connected = QMetaObject::connect(source, signalIndex, receiver, slotIndex, type);\n    Py_END_ALLOW_THREADS\n    if (connected) {\n        if (usingGlobalReceiver)\n            signalManager.notifyGlobalReceiver(receiver);\n        #ifndef AVOID_PROTECTED_HACK\n            source->connectNotify(signal - 1);\n        #else\n            // Need to cast to QObjectWrapper* and call the public version of\n            // connectNotify when avoiding the protected hack.\n            reinterpret_cast<QObjectWrapper*>(source)->connectNotify(signal - 1);\n        #endif\n\n        return true;\n    }\n\n    if (usingGlobalReceiver)\n        signalManager.releaseGlobalReceiver(source, receiver);\n\n    return false;\n}\n\n\nstatic bool qobjectDisconnectCallback(QObject* source, const char* signal, PyObject* callback)\n{\n    if (!PySide::Signal::checkQtSignal(signal))\n        return false;\n\n    PySide::SignalManager& signalManager = PySide::SignalManager::instance();\n\n    // Extract receiver from callback\n    QObject* receiver = 0;\n    PyObject* self = 0;\n    QByteArray callbackSig;\n    bool usingGlobalReceiver = getReceiver(NULL, signal, callback, &receiver, &self, &callbackSig);\n    if (receiver == 0 && self == 0)\n        return false;\n\n    const QMetaObject* metaObject = receiver->metaObject();\n    int signalIndex = source->metaObject()->indexOfSignal(++signal);\n    int slotIndex = -1;\n\n    slotIndex = metaObject->indexOfSlot(callbackSig);\n\n    bool disconnected;\n    Py_BEGIN_ALLOW_THREADS\n    disconnected = QMetaObject::disconnectOne(source, signalIndex, receiver, slotIndex);\n    Py_END_ALLOW_THREADS\n\n    if (disconnected) {\n        if (usingGlobalReceiver)\n            signalManager.releaseGlobalReceiver(source, receiver);\n\n        #ifndef AVOID_PROTECTED_HACK\n            source->disconnectNotify(callbackSig);\n        #else\n            // Need to cast to QObjectWrapper* and call the public version of\n            // connectNotify when avoiding the protected hack.\n            reinterpret_cast<QObjectWrapper*>(source)->disconnectNotify(callbackSig);\n        #endif\n        return true;\n    }\n    return false;\n}\n"
  },
  {
    "path": "PySide/QtCore/glue/qobject_findchild.cpp",
    "content": "static QObject* _findChildHelper(const QObject* parent, const QString& name, PyTypeObject* desiredType)\n{\n    foreach(QObject* child, parent->children()) {\n        Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));\n        if (PyType_IsSubtype(pyChild->ob_type, desiredType)\n            && (name.isNull() || name == child->objectName())) {\n            return child;\n        }\n    }\n\n    QObject* obj;\n    foreach(QObject* child, parent->children()) {\n        obj = _findChildHelper(child, name, desiredType);\n        if (obj)\n            return obj;\n    }\n    return 0;\n}\n\nstatic inline bool _findChildrenComparator(const QObject*& child, const QRegExp& name)\n{\n    return name.indexIn(child->objectName()) != -1;\n}\n\nstatic inline bool _findChildrenComparator(const QObject*& child, const QString& name)\n{\n    return name.isNull() || name == child->objectName();\n}\n\ntemplate<typename T>\nstatic void _findChildrenHelper(const QObject* parent, const T& name, PyTypeObject* desiredType, PyObject* result)\n{\n    foreach(const QObject* child, parent->children()) {\n        Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));\n        if (PyType_IsSubtype(pyChild->ob_type, desiredType) && _findChildrenComparator(child, name))\n            PyList_Append(result, pyChild);\n        _findChildrenHelper(child, name, desiredType, result);\n    }\n}\n"
  },
  {
    "path": "PySide/QtCore/typesystem_core.xml.in",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtCore\">\n    <load-typesystem name=\"typesystem_core_@AUTO_OS@.xml\" generate=\"yes\"/>\n    <load-typesystem name=\"typesystem_core_common.xml\" generate=\"yes\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtCore/typesystem_core_common.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtCore\">\n    <load-typesystem name=\"typesystem_templates.xml\" generate=\"no\"/>\n\n    <custom-type name=\"str\" />\n    <custom-type name=\"PyBytes\" />\n    <custom-type name=\"PyCallable\" />\n    <custom-type name=\"PyObject\" />\n    <custom-type name=\"PySequence\" />\n    <custom-type name=\"PyTypeObject\" />\n    <custom-type name=\"PyUnicode\" />\n    <custom-type name=\"list of QAbstractAnimation\" />\n    <custom-type name=\"list of QAbstractState\" />\n\n    <function signature=\"qAcos(qreal)\" />\n    <function signature=\"qAsin(qreal)\" since=\"4.6\" />\n    <function signature=\"qAtan(qreal)\" since=\"4.6\" />\n    <function signature=\"qAtan2(qreal,qreal)\" since=\"4.6\" />\n    <function signature=\"qChecksum(const char*,uint)\" />\n    <function signature=\"qExp(qreal)\" since=\"4.6\" />\n    <function signature=\"qFabs(qreal)\" since=\"4.6\" />\n    <function signature=\"qFastCos(qreal)\" since=\"4.6\"/>\n    <function signature=\"qFastSin(qreal)\" since=\"4.6\" />\n    <function signature=\"qFuzzyCompare(double,double)\" />\n    <function signature=\"qFuzzyIsNull(double)\" since=\"4.6\" />\n    <function signature=\"qIsFinite(double)\" />\n    <function signature=\"qIsInf(double)\" />\n    <function signature=\"qIsNaN(double)\" />\n    <function signature=\"qIsNull(double)\" />\n    <function signature=\"qRound(qreal)\" />\n    <function signature=\"qTan(qreal)\" since=\"4.6\" />\n    <function signature=\"qtTrId(const char *, int)\" since=\"4.6\" />\n    <function signature=\"qVersion()\" />\n    <function signature=\"qrand()\" />\n    <function signature=\"qsrand(uint)\" />\n\n    <template name=\"use_stream_for_format_security\">\n        // Uses the stream version for security reasons\n        // see gcc man page at -Wformat-security\n        %FUNCTION_NAME() &lt;&lt; %1;\n    </template>\n\n    <add-function signature=\"qDebug(const char*)\">\n        <inject-code>\n            <insert-template name=\"use_stream_for_format_security\" />\n        </inject-code>\n    </add-function>\n    <add-function signature=\"qCritical(const char*)\">\n        <inject-code>\n            <insert-template name=\"use_stream_for_format_security\" />\n        </inject-code>\n    </add-function>\n    <add-function signature=\"qFatal(const char*)\">\n        <inject-code>\n            // qFatal doesn't have a stream version, so we do a\n            // qWarning call followed by a qFatal() call using a\n            // literal.\n            qWarning() &lt;&lt; %1;\n            qFatal(\"[A qFatal() call was made from Python code]\");\n        </inject-code>\n    </add-function>\n    <add-function signature=\"qWarning(const char*)\">\n        <inject-code>\n            <insert-template name=\"use_stream_for_format_security\" />\n        </inject-code>\n    </add-function>\n\n    <!-- TODO: We do not support void* or const void* as arg -->\n    <rejection class=\"QMetaObject\" function-name=\"activate\"/>\n    <rejection class=\"QMetaObject\" function-name=\"metacall\"/>\n    <rejection class=\"QMetaObject\" function-name=\"static_metacall\"/>\n    <!-- TODO: Support to addGuard(QObject**) -->\n    <rejection class=\"QMetaObject\" function-name=\"addGuard\"/>\n    <rejection class=\"QMetaObject\" function-name=\"changeGuard\"/>\n    <rejection class=\"QMetaObject\" function-name=\"removeGuard\"/>\n\n  <rejection class=\"QChildEvent\" field-name=\"c\"/>\n  <rejection class=\"QTimerEvent\" field-name=\"id\"/>\n  <rejection class=\"QEvent\" field-name=\"t\"/>\n  <rejection class=\"*\" function-name=\"tr\" />\n  <rejection class=\"*\" function-name=\"trUtf8\" />\n  <rejection class=\"*\" function-name=\"qt_metacast\" />\n  <!-- From Qt4.6 -->\n  <rejection class=\"*\" field-name=\"d_ptr\"/>\n  <rejection class=\"*\" field-name=\"staticQtMetaObject\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid\"/>\n  <rejection class=\"*\" function-name=\"qGetPtrHelper\"/>\n  <rejection class=\"*\" function-name=\"q_check_ptr\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QTextCodecFactoryInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QFactoryInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qRegisterAnimationInterpolator\"/>\n  <rejection class=\"*\" function-name=\"qvariant_cast&lt;QVariant&gt;\"/>\n  <rejection class=\"*\" function-name=\"qVariantSetValue&lt;QVariant&gt;\"/>\n  <rejection class=\"*\" function-name=\"qReallocAligned\"/>\n  <rejection class=\"*\" function-name=\"qMallocAligned\"/>\n  <rejection class=\"*\" function-name=\"qFreeAligned\"/>\n  <rejection class=\"QMetaMethod\" enum-name=\"Attributes\" />\n\n  <enum-type name=\"QtValidLicenseForOpenVGModule\"/>\n  <enum-type name=\"QtValidLicenseForMultimediaModule\"/>\n  <enum-type name=\"QtValidLicenseForDeclarativeModule\" />\n  <!-- From Qt4.6 ^^^ -->\n\n\n  <enum-type name=\"QtMsgType\"/>\n\n  <primitive-type name=\"qint8\"/>\n  <primitive-type name=\"qint16\"/>\n  <primitive-type name=\"qint32\"/>\n  <primitive-type name=\"quint8\"/>\n  <primitive-type name=\"quint16\"/>\n  <primitive-type name=\"quint32\"/>\n  <primitive-type name=\"quint64\"/>\n  <primitive-type name=\"bool\"/>\n  <primitive-type name=\"double\"/>\n  <primitive-type name=\"qreal\"/>\n  <primitive-type name=\"float\"/>\n  <primitive-type name=\"qint64\"/>\n  <primitive-type name=\"unsigned long long\"/>\n  <primitive-type name=\"long long\"/>\n  <primitive-type name=\"qlonglong\" target-lang-api-name=\"PyLong\" />\n  <primitive-type name=\"qulonglong\" target-lang-api-name=\"PyLong\" />\n  <primitive-type name=\"short\"/>\n  <primitive-type name=\"signed short\"/>\n  <primitive-type name=\"signed short int\"/>\n  <primitive-type name=\"ushort\" target-lang-api-name=\"PyInt\" />\n  <primitive-type name=\"unsigned short int\" />\n  <primitive-type name=\"unsigned short\"/>\n  <primitive-type name=\"char\"/>\n  <primitive-type name=\"signed char\"/>\n  <primitive-type name=\"uchar\"/>\n  <primitive-type name=\"unsigned char\"/>\n  <primitive-type name=\"int\"/>\n  <primitive-type name=\"signed int\"/>\n  <primitive-type name=\"uint\"/>\n  <primitive-type name=\"ulong\"/>\n  <primitive-type name=\"unsigned int\"/>\n  <primitive-type name=\"signed long\"/>\n  <primitive-type name=\"signed long int\"/>\n  <primitive-type name=\"long\"/>\n  <primitive-type name=\"unsigned long int\" />\n  <primitive-type name=\"unsigned long\">\n    <!-- FIXME APIExtractor or shiboken do not support multiple includes by primitive type -->\n    <include file-name=\"signalmanager.h\" location=\"global\"/>\n  </primitive-type>\n  <primitive-type name=\"QBool\" target-lang-api-name=\"PyBool\">\n    <conversion-rule>\n        <native-to-target>\n        return PyBool_FromLong((bool)%in);\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyBool\">\n            %out = %OUTTYPE(%in == Py_True);\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n    <!-- FIXME This is a workaround to include some headers needed by some includes (nothing to do with QBool) -->\n    <include file-name=\"QtConcurrentFilter\" location=\"global\"/>\n  </primitive-type>\n\n  <inject-code class=\"native\" position=\"beginning\">\n    bool py2kStrCheck(PyObject* obj)\n    {\n    #ifdef IS_PY3K\n        return false;\n    #else\n        return PyString_Check(obj);\n    #endif\n    }\n  </inject-code>\n\n  <primitive-type name=\"QString\" target-lang-api-name=\"PyUnicode\">\n    <include file-name=\"QString\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n        const int N = %in.length();\n        wchar_t* str = new wchar_t[N];\n        %in.toWCharArray(str);\n        PyObject* %out = PyUnicode_FromWideChar(str, N);\n        delete[] str;\n        return %out;\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyUnicode\">\n            Py_UNICODE* unicode = PyUnicode_AS_UNICODE(%in);\n            #if defined(Py_UNICODE_WIDE)\n            // cast as Py_UNICODE can be a different type\n            %out = QString::fromUcs4((const uint*)unicode);\n            #else\n            %out = QString::fromUtf16((const ushort*)unicode, PyUnicode_GET_SIZE(%in));\n            #endif\n            </add-conversion>\n            <add-conversion type=\"PyString\" check=\"py2kStrCheck(%in)\">\n            #ifndef IS_PY3K\n            const char* str = %CONVERTTOCPP[const char*](%in);\n            %out = %OUTTYPE(str);\n            #endif\n            </add-conversion>\n            <add-conversion type=\"Py_None\">\n            %out = %OUTTYPE();\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </primitive-type>\n\n  <primitive-type name=\"QStringRef\">\n    <conversion-rule>\n        <native-to-target>\n        const int N = %in.toString().length();\n        wchar_t* str = new wchar_t[N];\n        %in.toString().toWCharArray(str);\n        PyObject* %out = PyUnicode_FromWideChar(str, N);\n        delete[] str;\n        return %out;\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyObject\" check=\"Shiboken::String::check(%in) || %in == Py_None\">\n            %out = %OUTTYPE();\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </primitive-type>\n  <primitive-type name=\"QChar\">\n    <conversion-rule>\n        <native-to-target>\n        wchar_t c = (wchar_t)%in.unicode();\n        return PyUnicode_FromWideChar(&amp;c, 1);\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyString\" check=\"Shiboken::String::checkChar(%in)\">\n            char c = %CONVERTTOCPP[char](%in);\n            %out = %OUTTYPE(c);\n            </add-conversion>\n            <add-conversion type=\"PyInt\">\n            int i = %CONVERTTOCPP[int](%in);\n            %out = %OUTTYPE(i);\n            </add-conversion>\n            <add-conversion type=\"Py_None\">\n            %out = %OUTTYPE();\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </primitive-type>\n\n  <primitive-type name=\"QVariant\" target-lang-api-name=\"PyObject\">\n    <include file-name=\"typeresolver.h\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n        if (!%in.isValid())\n            Py_RETURN_NONE;\n\n        if (qstrcmp(%in.typeName(), \"QVariantList\") == 0) {\n            QList&lt;QVariant&gt; var = %in.value&lt;QVariantList&gt;();\n            return %CONVERTTOPYTHON[QList&lt;QVariant&gt;](var);\n        }\n\n        if (qstrcmp(%in.typeName(), \"QStringList\") == 0) {\n            QStringList var = %in.value&lt;QStringList&gt;();\n            return %CONVERTTOPYTHON[QList&lt;QString&gt;](var);\n        }\n\n        if (qstrcmp(%in.typeName(), \"QVariantMap\") == 0) {\n            QMap&lt;QString, QVariant&gt; var = %in.value&lt;QVariantMap&gt;();\n            return %CONVERTTOPYTHON[QMap&lt;QString, QVariant&gt;](var);\n        }\n\n        Shiboken::Conversions::SpecificConverter converter(cppInRef.typeName());\n        if (converter) {\n           void* ptr = cppInRef.data();\n           return converter.toPython(ptr);\n        }\n        PyErr_Format(PyExc_RuntimeError, \"Can't find converter for '%s'.\", %in.typeName());\n        return 0;\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyBool\">\n            %out = %OUTTYPE(%in == Py_True);\n            </add-conversion>\n            <add-conversion type=\"Py_None\">\n            %out = %OUTTYPE();\n            </add-conversion>\n            <add-conversion type=\"QString\" check=\"Shiboken::String::check(%in)\">\n            QString in = %CONVERTTOCPP[QString](%in);\n            %out = %OUTTYPE(in);\n            </add-conversion>\n            <add-conversion type=\"QByteArray\">\n            QByteArray in = %CONVERTTOCPP[QByteArray](%in);\n            %out = %OUTTYPE(in);\n            </add-conversion>\n            <add-conversion type=\"PyFloat\" check=\"PyFloat_CheckExact(%in)\">\n            double in = %CONVERTTOCPP[double](%in);\n            %out = %OUTTYPE(in);\n            </add-conversion>\n            <add-conversion type=\"PyInt\">\n            int in = %CONVERTTOCPP[int](%in);\n            %out = %OUTTYPE(in);\n            </add-conversion>\n            <add-conversion type=\"PyLong\" check=\"PyLong_CheckExact(%in)\">\n            qlonglong in = %CONVERTTOCPP[qlonglong](%in);\n            %out = %OUTTYPE(in);\n            </add-conversion>\n            <add-conversion type=\"SbkEnumType\">\n            int in = %CONVERTTOCPP[int](%in);\n            %out = %OUTTYPE(in);\n            </add-conversion>\n            <add-conversion type=\"SbkObject\">\n            // a class supported by QVariant?\n            int typeCode;\n            const char* typeName = QVariant_resolveMetaType(%in->ob_type, &amp;typeCode);\n            if (!typeCode || !typeName)\n                return;\n            QVariant var(typeCode, (void*)0);\n            Shiboken::Conversions::SpecificConverter converter(typeName);\n            converter.toCpp(pyIn, var.data());\n            %out = var;\n            </add-conversion>\n            <add-conversion type=\"PyDict\">\n            QVariant ret = QVariant_convertToVariantMap(%in);\n            %out = ret.isValid() ? ret : QVariant::fromValue&lt;PySide::PyObjectWrapper&gt;(%in);\n            </add-conversion>\n            <add-conversion type=\"PySequence\">\n            %out = QVariant_convertToVariantList(%in);\n            </add-conversion>\n            <add-conversion type=\"PyObject\">\n            // Is a shiboken type not known by Qt\n            %out = QVariant::fromValue&lt;PySide::PyObjectWrapper&gt;(%in);\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </primitive-type>\n    <inject-code class=\"native\" position=\"beginning\">\n    static const char* QVariant_resolveMetaType(PyTypeObject* type, int* typeId)\n    {\n        if (PyObject_TypeCheck(type, &amp;SbkObjectType_Type)) {\n            SbkObjectType* sbkType = (SbkObjectType*)type;\n            const char* typeName = Shiboken::ObjectType::getOriginalName(sbkType);\n            if (!typeName)\n                return 0;\n            bool valueType = '*' != typeName[qstrlen(typeName) - 1];\n            // Do not convert user type of value\n            if (valueType &amp;&mp; Shiboken::ObjectType::isUserType(type))\n                return 0;\n            int obTypeId = QMetaType::type(typeName);\n            if (obTypeId) {\n                *typeId = obTypeId;\n                return typeName;\n            }\n            // Do not resolve types to value type\n            if (valueType)\n                return 0;\n            // find in base types\n            if (type->tp_base) {\n                return QVariant_resolveMetaType(type->tp_base, typeId);\n            } else if (type->tp_bases) {\n                for(int i = 0; i &lt; PyTuple_GET_SIZE(type->tp_bases); ++i) {\n                    const char* derivedName = QVariant_resolveMetaType((PyTypeObject*)PyTuple_GET_ITEM(type->tp_bases, i), typeId);\n                    if (derivedName)\n                        return derivedName;\n                }\n            }\n        }\n        *typeId = 0;\n        return 0;\n    }\n    static QVariant QVariant_convertToValueList(PyObject* list)\n    {\n        if (PySequence_Size(list) &lt; 1)\n            return QVariant();\n        Shiboken::AutoDecRef element(PySequence_GetItem(list, 0));\n        int typeId;\n        const char* typeName = QVariant_resolveMetaType(element.cast&lt;PyTypeObject*&gt;(), &amp;typeId);\n        if (typeName) {\n            QByteArray listTypeName(\"QList&lt;\");\n            listTypeName += typeName;\n            listTypeName += '>';\n            typeId = QMetaType::type(listTypeName);\n            if (typeId &gt; 0) {\n                Shiboken::Conversions::SpecificConverter converter(listTypeName);\n                if (converter) {\n                    QVariant var(typeId, (void*)0);\n                    converter.toCpp(list, &amp;var);\n                    return var;\n                }\n                qWarning() &lt;&lt; \"Type converter for :\" &lt;&lt; listTypeName &lt;&lt; \"not registered.\";\n            }\n        }\n        return QVariant();\n    }\n    static bool QVariant_isStringList(PyObject *list)\n    {\n        bool allString = true;\n        Shiboken::AutoDecRef fast(PySequence_Fast(list, \"Failed to convert QVariantList\"));\n        Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());\n        for(int i = 0; i &lt; size; ++i) {\n            PyObject* item = PySequence_Fast_GET_ITEM(fast.object(), i);\n            if (!%CHECKTYPE[QString](item)) {\n                allString = false;\n                break;\n            }\n        }\n        return allString;\n    }\n    static QVariant QVariant_convertToVariantMap(PyObject* map)\n    {\n        Py_ssize_t pos = 0;\n        Shiboken::AutoDecRef keys(PyDict_Keys(map));\n        if (!QVariant_isStringList(keys))\n            return QVariant();\n        PyObject* key;\n        PyObject* value;\n        QMap&lt;QString,QVariant&gt; ret;\n        while (PyDict_Next(map, &amp;pos, &amp;key, &amp;value)) {\n            QString cppKey = %CONVERTTOCPP[QString](key);\n            QVariant cppValue = %CONVERTTOCPP[QVariant](value);\n            ret.insert(cppKey, cppValue);\n        }\n        return QVariant(ret);\n    }\n    static QVariant QVariant_convertToVariantList(PyObject* list)\n    {\n        if (QVariant_isStringList(list)) {\n            QList&lt;QString &gt; lst = %CONVERTTOCPP[QList&lt;QString&gt;](list);\n            return QVariant(QStringList(lst));\n        }\n        QVariant valueList = QVariant_convertToValueList(list);\n        if (valueList.isValid())\n            return valueList;\n        QList&lt;QVariant&gt; lst;\n        Shiboken::AutoDecRef fast(PySequence_Fast(list, \"Failed to convert QVariantList\"));\n        Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());\n        for (int i = 0; i &lt; size; ++i) {\n            PyObject* pyItem = PySequence_Fast_GET_ITEM(fast.object(), i);\n            QVariant item = %CONVERTTOCPP[QVariant](pyItem);\n            lst.append(item);\n        }\n        return QVariant(lst);\n    }\n    </inject-code>\n\n  <primitive-type name=\"QVariant::Type\" default-constructor=\"QVariant::Invalid\">\n    <conversion-rule>\n        <native-to-target>\n        const char* typeName = QVariant::typeToName(%in);\n        PyObject* %out;\n        PyTypeObject* pyType = 0;\n        if (typeName)\n            pyType = Shiboken::Conversions::getPythonTypeObject(typeName);\n        %out = pyType ? ((PyObject*)pyType) : Py_None;\n        Py_INCREF(%out);\n        return %out;\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"Py_None\">\n            %out = QVariant::Invalid;\n            </add-conversion>\n            <add-conversion type=\"PyTypeObject\">\n            const char* typeName;\n            if (Shiboken::String::checkType((PyTypeObject*)%in))\n                typeName = \"QString\";\n            else if (%in == (PyObject*)&amp;PyFloat_Type)\n                typeName = \"double\"; // float is a UserType in QVariant.\n            else if (%in == (PyObject*)&amp;PyLong_Type)\n                typeName = \"int\";    // long is a UserType in QVariant.\n            else if (%in->ob_type == &amp;SbkObjectType_Type)\n                typeName = Shiboken::ObjectType::getOriginalName((SbkObjectType*)%in);\n            else\n                typeName = ((PyTypeObject*)%in)->tp_name;\n            %out = QVariant::nameToType(typeName);\n            </add-conversion>\n            <add-conversion type=\"PyString\" check=\"Shiboken::String::check(%in)\">\n            %out = QVariant::nameToType(Shiboken::String::toCString(%in));\n            </add-conversion>\n            <add-conversion type=\"PyDict\" check=\"PyDict_Check(%in) &amp;&amp; QVariantType_checkAllStringKeys(%in)\">\n            %out = QVariant::nameToType(\"QVariantMap\");\n            </add-conversion>\n            <add-conversion type=\"PySequence\">\n            const char* typeName;\n            if (QVariantType_isStringList(%in))\n                typeName = \"QStringList\";\n            else\n                typeName = \"QVariantList\";\n            %out = QVariant::nameToType(typeName);\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </primitive-type>\n\n  <primitive-type name=\"QVariantMap\" target-lang-api-name=\"PyDict\"/>\n  <inject-code class=\"target\" position=\"end\">\n  Shiboken::Conversions::registerConverterName(SbkPySide_QtCoreTypeConverters[SBK_QTCORE_QMAP_QSTRING_QVARIANT_IDX], \"QVariantMap\");\n  </inject-code>\n\n  <inject-code class=\"native\" position=\"beginning\">\n  static bool QVariantType_isStringList(PyObject* list)\n  {\n      bool allString = true;\n      Shiboken::AutoDecRef fast(PySequence_Fast(list, \"Failed to convert QVariantList\"));\n      Py_ssize_t size = PySequence_Fast_GET_SIZE(fast.object());\n      for(int i=0; i &lt; size; i++) {\n          PyObject* item = PySequence_Fast_GET_ITEM(fast.object(), i);\n          if (!%CHECKTYPE[QString](item)) {\n              allString = false;\n              break;\n          }\n      }\n      return allString;\n  }\n  static bool QVariantType_checkAllStringKeys(PyObject* dict)\n  {\n      Shiboken::AutoDecRef keys(PyDict_Keys(dict));\n      return QVariantType_isStringList(keys);\n  }\n  </inject-code>\n\n  <primitive-type name=\"QStringList\">\n    <include file-name=\"QStringList\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cpplist_to_pylist_conversion\">\n                <replace from=\"%INTYPE_0\" to=\"QString\" />\n            </insert-template>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n                <insert-template name=\"pyseq_to_cpplist_conversion\">\n                    <replace from=\"%OUTTYPE_0\" to=\"QString\" />\n                </insert-template>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </primitive-type>\n\n  <primitive-type name=\"QModelIndexList\">\n    <include file-name=\"qabstractitemmodel.h\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cpplist_to_pylist_conversion\">\n                <replace from=\"%INTYPE_0\" to=\"QModelIndex\" />\n            </insert-template>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n                <insert-template name=\"pyseq_to_cpplist_conversion\">\n                    <replace from=\"%OUTTYPE_0\" to=\"QModelIndex\" />\n                </insert-template>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </primitive-type>\n\n  <container-type name=\"QSet\" type=\"set\">\n    <include file-name=\"QSet\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cpplist_to_pylist_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n                <insert-template name=\"pyseq_to_cpplist_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n\n  <container-type name=\"QList\" type=\"list\">\n    <include file-name=\"QList\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cpplist_to_pylist_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n                <insert-template name=\"pyseq_to_cpplist_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n\n  <container-type name=\"QVector\" type=\"vector\">\n    <include file-name=\"QVector\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cppvector_to_pylist_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n                <insert-template name=\"pyseq_to_cppvector_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n\n  </container-type>\n\n  <container-type name=\"QStack\" type=\"stack\">\n    <include file-name=\"QStack\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cpplist_to_pylist_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n                <insert-template name=\"pyseq_to_cpplist_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n\n  <container-type name=\"QQueue\" type=\"queue\">\n    <include file-name=\"QQueue\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cpplist_to_pylist_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n                <insert-template name=\"pyseq_to_cpplist_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n\n  <container-type name=\"QLinkedList\" type=\"linked-list\">\n    <include file-name=\"QLinkedList\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cpplist_to_pylist_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n                <insert-template name=\"pyseq_to_cpplist_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n\n  <template name=\"cppmap_to_pymap_conversion\">\n    PyObject* %out = PyDict_New();\n    %INTYPE::const_iterator it = %in.begin();\n    for (; it != %in.end(); ++it) {\n        %INTYPE_0 key = it.key();\n        %INTYPE_1 value = it.value();\n        PyObject* pyKey = %CONVERTTOPYTHON[%INTYPE_0](key);\n        PyObject* pyValue = %CONVERTTOPYTHON[%INTYPE_1](value);\n        PyDict_SetItem(%out, pyKey, pyValue);\n        Py_DECREF(pyKey);\n        Py_DECREF(pyValue);\n    }\n    return %out;\n  </template>\n  <template name=\"pydict_to_cppmap_conversion\">\n    PyObject* key;\n    PyObject* value;\n    Py_ssize_t pos = 0;\n    while (PyDict_Next(%in, &amp;pos, &amp;key, &amp;value)) {\n        %OUTTYPE_0 cppKey = %CONVERTTOCPP[%OUTTYPE_0](key);\n        %OUTTYPE_1 cppValue = %CONVERTTOCPP[%OUTTYPE_1](value);\n        %out.insert(cppKey, cppValue);\n    }\n  </template>\n\n  <container-type name=\"QHash\" type=\"hash\">\n    <include file-name=\"QHash\" location=\"global\"/>\n    <include file-name=\"pysideconversions.h\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cppmap_to_pymap_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyDict\">\n                <insert-template name=\"pydict_to_cppmap_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n  <container-type name=\"QMap\" type=\"map\">\n    <include file-name=\"QMap\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cppmap_to_pymap_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyDict\">\n                <insert-template name=\"pydict_to_cppmap_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n  <container-type name=\"QMultiMap\" type=\"multi-map\">\n    <include file-name=\"QMultiMap\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n            <insert-template name=\"cppmap_to_pymap_conversion\"/>\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyDict\">\n                <insert-template name=\"pydict_to_cppmap_conversion\"/>\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n\n  <container-type name=\"QPair\" type=\"pair\">\n    <include file-name=\"QPair\" location=\"global\"/>\n    <conversion-rule>\n        <native-to-target>\n        PyObject* %out = PyTuple_New(2);\n        PyTuple_SET_ITEM(%out, 0, %CONVERTTOPYTHON[%INTYPE_0](%in.first));\n        PyTuple_SET_ITEM(%out, 1, %CONVERTTOPYTHON[%INTYPE_1](%in.second));\n        return %out;\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PySequence\">\n            %out.first = %CONVERTTOCPP[%OUTTYPE_0](PySequence_Fast_GET_ITEM(%in, 0));\n            %out.second = %CONVERTTOCPP[%OUTTYPE_1](PySequence_Fast_GET_ITEM(%in, 1));\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </container-type>\n\n  <rejection class=\"*\" function-name=\"d_func\"/>\n  <rejection class=\"*\" function-name=\"data_ptr\"/>\n  <rejection class=\"*\" function-name=\"detach\"/>\n  <rejection class=\"*\" function-name=\"isDetached\"/>\n  <rejection class=\"*\" field-name=\"d_ptr\"/>\n  <rejection class=\"*\" field-name=\"d\"/>\n  <rejection class=\"*\" field-name=\"staticMetaObject\"/>\n  <!-- not support array in property -->\n  <rejection class=\"QTextCodec::ConverterState\" field-name=\"state_data\"/>\n  <rejection class=\"QUuid\" field-name=\"data1\"/>\n  <rejection class=\"QUuid\" field-name=\"data2\"/>\n  <rejection class=\"QUuid\" field-name=\"data3\"/>\n  <rejection class=\"QUuid\" field-name=\"data4\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForTestModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForDBusModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForSqlModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForOpenGLModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForScriptToolsModule\"/>\n  <rejection class=\"\" enum-name=\"__codecvt_result\"/>\n  <rejection class=\"\" enum-name=\"enum_1\"/>\n  <rejection class=\"\" enum-name=\"enum_2\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForXmlModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForXmlPatternsModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForActiveQtModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForCoreModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForQt3SupportLightModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForQt3SupportModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForNetworkModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForSvgModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForGuiModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForScriptModule\"/>\n  <rejection class=\"\" enum-name=\"QtValidLicenseForHelpModule\"/>\n  <rejection class=\"QtConcurrent\" enum-name=\"enum_1\"/>\n  <rejection class=\"QAbstractEventDispatcher\" function-name=\"filterEvent\"/>\n  <rejection class=\"QAbstractEventDispatcher\" function-name=\"setEventFilter\"/>\n  <!-- Internal -->\n  <rejection class=\"QAbstractFileEngine\" function-name=\"endEntryList\"/>\n  <rejection class=\"QAbstractFileEngine\" function-name=\"extension\"/>\n  <rejection class=\"QCoreApplication\" function-name=\"compressEvent\"/>\n  <rejection class=\"QCoreApplication\" function-name=\"eventFilter\"/>\n  <rejection class=\"QCoreApplication\" function-name=\"filterEvent\"/>\n  <rejection class=\"QCoreApplication\" function-name=\"setEventFilter\"/>\n  <rejection class=\"QFile\" function-name=\"setDecodingFunction\"/>\n  <rejection class=\"QFile\" function-name=\"setEncodingFunction\"/>\n  <rejection class=\"QRegion\" function-name=\"cleanUp\"/>\n  <rejection class=\"QSettings\" function-name=\"registerFormat\"/>\n  <rejection class=\"QAbstractFileEngineIterator\" function-name=\"entryInfo\"/>\n  <rejection class=\"QAbstractFileEngineIterator\" enum-name=\"EntryInfoType\"/>\n  <namespace-type name=\"Qt\">\n    <enum-type name=\"AlignmentFlag\" flags=\"Alignment\" />\n    <enum-type name=\"AnchorAttribute\"/>\n    <enum-type name=\"AnchorPoint\" since=\"4.6\" />\n    <enum-type name=\"ApplicationAttribute\"/>\n    <enum-type name=\"ArrowType\"/>\n    <enum-type name=\"AspectRatioMode\"/>\n    <enum-type name=\"Axis\"/>\n    <enum-type name=\"BGMode\"/>\n    <enum-type name=\"BrushStyle\"/>\n    <enum-type name=\"CaseSensitivity\"/>\n    <enum-type name=\"CheckState\"/>\n    <enum-type name=\"ClipOperation\"/>\n    <enum-type name=\"ConnectionType\"/>\n    <enum-type name=\"ContextMenuPolicy\"/>\n    <enum-type name=\"CoordinateSystem\" since=\"4.6\"/>\n    <enum-type name=\"Corner\"/>\n    <enum-type name=\"CursorShape\" />\n    <enum-type name=\"DateFormat\" />\n    <enum-type name=\"DayOfWeek\"/>\n    <enum-type name=\"DockWidgetArea\" flags=\"DockWidgetAreas\" />\n    <enum-type name=\"DockWidgetAreaSizes\"/>\n    <enum-type name=\"DropAction\" flags=\"DropActions\"/>\n    <enum-type name=\"EventPriority\"/>\n    <enum-type name=\"FillRule\"/>\n    <enum-type name=\"FocusPolicy\"/>\n    <enum-type name=\"FocusReason\"/>\n    <enum-type name=\"GestureFlag\" flags=\"GestureFlags\" since=\"4.6\"/>\n    <enum-type name=\"GestureState\" since=\"4.6\"/>\n    <enum-type name=\"GestureType\" since=\"4.6\"/>\n    <enum-type name=\"GlobalColor\"/>\n    <enum-type name=\"HitTestAccuracy\"/>\n    <enum-type name=\"ImageConversionFlag\" flags=\"ImageConversionFlags\" />\n    <enum-type name=\"InputMethodHint\" flags=\"InputMethodHints\" since=\"4.6\"/>\n    <enum-type name=\"InputMethodQuery\"/>\n    <enum-type name=\"ItemDataRole\" force-integer=\"yes\" />\n    <enum-type name=\"ItemFlag\" flags=\"ItemFlags\"/>\n    <enum-type name=\"ItemSelectionMode\"/>\n    <enum-type name=\"Key\" />\n    <enum-type name=\"KeyboardModifier\" flags=\"KeyboardModifiers\"/>\n    <enum-type name=\"LayoutDirection\"/>\n    <enum-type name=\"MaskMode\"/>\n    <enum-type name=\"MatchFlag\" flags=\"MatchFlags\"/>\n    <enum-type name=\"Modifier\"/>\n    <enum-type name=\"MouseButton\" flags=\"MouseButtons\"/>\n    <enum-type name=\"NavigationMode\" since=\"4.6\"/>\n    <enum-type name=\"Orientation\" flags=\"Orientations\"/>\n    <enum-type name=\"PenCapStyle\"/>\n    <enum-type name=\"PenJoinStyle\"/>\n    <enum-type name=\"PenStyle\"/>\n    <enum-type name=\"ScrollBarPolicy\"/>\n    <enum-type name=\"ShortcutContext\"/>\n    <enum-type name=\"SizeHint\"/>\n    <enum-type name=\"SizeMode\"/>\n    <enum-type name=\"SortOrder\"/>\n    <enum-type name=\"TextElideMode\"/>\n    <enum-type name=\"TextFlag\"/>\n    <enum-type name=\"TextFormat\"/>\n    <enum-type name=\"TextInteractionFlag\" flags=\"TextInteractionFlags\"/>\n    <enum-type name=\"TileRule\" since=\"4.6\"/>\n    <enum-type name=\"TimeSpec\"/>\n    <enum-type name=\"ToolBarArea\" flags=\"ToolBarAreas\" />\n    <enum-type name=\"ToolBarAreaSizes\"/>\n    <enum-type name=\"ToolButtonStyle\"/>\n    <enum-type name=\"TouchPointState\" since=\"4.6\"/>\n    <enum-type name=\"TransformationMode\"/>\n    <enum-type name=\"UIEffect\"/>\n    <enum-type name=\"WhiteSpaceMode\" />\n    <enum-type name=\"WidgetAttribute\" />\n    <enum-type name=\"WindowFrameSection\"/>\n    <enum-type name=\"WindowModality\"/>\n    <enum-type name=\"WindowState\" flags=\"WindowStates\"/>\n    <enum-type name=\"WindowType\" flags=\"WindowFlags\"/>\n    <enum-type name=\"CursorMoveStyle\" since=\"4.8\" revision=\"4800\"/>\n\n   <!--### These functions are part of QtGui, not QtCore -->\n    <modify-function signature=\"codecForHtml(const QByteArray &amp;)\" remove=\"all\"/>\n    <modify-function signature=\"mightBeRichText(const QString &amp;)\" remove=\"all\"/>\n    <modify-function signature=\"escape(const QString&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"convertFromPlainText(const QString &amp;, Qt::WhiteSpaceMode)\" remove=\"all\"/>\n    <!--### -->\n    <extra-includes>\n      <include file-name=\"QTextDocument\" location=\"global\"/>\n    </extra-includes>\n  </namespace-type>\n\n  <add-function signature=\"qAbs(double)\" return-type=\"double\">\n    <inject-code class=\"target\" position=\"beginning\">\n    double _abs = qAbs(%1);\n    %PYARG_0 = %CONVERTTOPYTHON[double](_abs);\n    </inject-code>\n  </add-function>\n\n  <inject-code class=\"native\" position=\"beginning\">\n    namespace PySide {\n    static QStack&lt;PyObject*&gt; globalPostRoutineFunctions;\n    void globalPostRoutineCallback()\n    {\n        foreach(PyObject* callback, globalPostRoutineFunctions) {\n            Shiboken::AutoDecRef result(PyObject_CallObject(callback, NULL));\n            Py_DECREF(callback);\n        }\n        globalPostRoutineFunctions.clear();\n    }\n    void addPostRoutine(PyObject* callback)\n    {\n        if (PyCallable_Check(callback)) {\n            globalPostRoutineFunctions &lt;&lt; callback;\n            Py_INCREF(callback);\n        } else {\n            PyErr_SetString(PyExc_TypeError, \"qAddPostRoutine: The argument must be a callable object.\");\n        }\n    }\n    } // namespace\n  </inject-code>\n  <add-function signature=\"qAddPostRoutine(PyObject*)\">\n    <inject-code class=\"target\" position=\"beginning\">\n        PySide::addPostRoutine(%1);\n    </inject-code>\n  </add-function>\n  <inject-code class=\"target\" position=\"end\">\n    qAddPostRoutine(PySide::globalPostRoutineCallback);\n  </inject-code>\n\n  <inject-code class=\"target\" position=\"end\">\n  QList&lt;QByteArray&gt; version = QByteArray(qVersion()).split('.');\n  PyObject* pyQtVersion = PyTuple_New(3);\n  for (int i = 0; i &lt; 3; ++i)\n      PyTuple_SET_ITEM(pyQtVersion, i, PyInt_FromLong(version[i].toInt()));\n  PyModule_AddObject(module, \"__version_info__\", pyQtVersion);\n  PyModule_AddStringConstant(module, \"__version__\", qVersion());\n  </inject-code>\n\n  <inject-code class=\"target\" position=\"end\">\n    { // Avoid name clash\n        Shiboken::AutoDecRef regFunc((PyObject*)NULL);\n        Shiboken::AutoDecRef atexit(Shiboken::Module::import(\"atexit\"));\n        if (atexit.isNull()) {\n            qWarning() &lt;&lt; \"Module atexit not found for registering __moduleShutdown\";\n            PyErr_Clear();\n        }else{\n            regFunc = PyObject_GetAttrString(atexit, \"register\");\n            if (regFunc.isNull()) {\n                qWarning() &lt;&lt; \"Function atexit.register not found for registering __moduleShutdown\";\n                PyErr_Clear();\n            }\n        }\n        if (!atexit.isNull() &amp;&amp; !regFunc.isNull()){\n            PyObject* shutDownFunc = PyObject_GetAttrString(module, \"__moduleShutdown\");\n            Shiboken::AutoDecRef args(PyTuple_New(1));\n            PyTuple_SET_ITEM(args, 0, shutDownFunc);\n            Shiboken::AutoDecRef retval(PyObject_Call(regFunc, args, 0));\n            Q_ASSERT(!retval.isNull());\n        }\n    }\n  </inject-code>\n\n  <add-function signature=\"__moduleShutdown()\">\n      <inject-code class=\"target\" position=\"beginning\">\n        PySide::runCleanupFunctions();\n    </inject-code>\n  </add-function>\n\n  <!--signal/slot-->\n  <inject-code class=\"target\" position=\"end\">\n    Shiboken::Conversions::registerConverterName(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], \"unicode\");\n    Shiboken::Conversions::registerConverterName(SbkPySide_QtCoreTypeConverters[SBK_QSTRING_IDX], \"str\");\n    Shiboken::Conversions::registerConverterName(SbkPySide_QtCoreTypeConverters[SBK_QTCORE_QLIST_QVARIANT_IDX], \"QVariantList\");\n\n    PySide::init(module);\n    Py_AtExit(QtCoreModuleExit);\n  </inject-code>\n  <inject-code class=\"native\" position=\"beginning\">\n    #include &lt;pyside.h&gt;\n  </inject-code>\n\n  <inject-code class=\"native\" position=\"beginning\">\n    // Define a global variable to handle qInstallMsgHandler callback\n    static PyObject* qtmsghandler = 0;\n\n    static void msgHandlerCallback(QtMsgType type, const char* msg)\n    {\n        Shiboken::GilState state;\n        Shiboken::AutoDecRef arglist(PyTuple_New(2));\n        PyTuple_SET_ITEM(arglist, 0, %CONVERTTOPYTHON[QtMsgType](type));\n        PyTuple_SET_ITEM(arglist, 1, %CONVERTTOPYTHON[const char*](msg));\n        Shiboken::AutoDecRef ret(PyObject_CallObject(qtmsghandler, arglist));\n    }\n    static void QtCoreModuleExit()\n    {\n        PySide::SignalManager::instance().clear();\n    }\n  </inject-code>\n  <add-function signature=\"qInstallMsgHandler(PyObject)\" return-type=\"PyObject\">\n    <inject-code class=\"target\" position=\"beginning\">\n      if (%PYARG_1 == Py_None) {\n        qInstallMsgHandler(0);\n        %PYARG_0 = qtmsghandler ? qtmsghandler : Py_None;\n        qtmsghandler = 0;\n      } else if (!PyCallable_Check(%PYARG_1)) {\n        PyErr_SetString(PyExc_TypeError, \"parameter must be callable\");\n      } else {\n        %PYARG_0 = qtmsghandler ? qtmsghandler : Py_None;\n        Py_INCREF(%PYARG_1);\n        qtmsghandler = %PYARG_1;\n        qInstallMsgHandler(msgHandlerCallback);\n      }\n\n      if (%PYARG_0 == Py_None)\n        Py_INCREF(%PYARG_0);\n\n    </inject-code>\n  </add-function>\n\n  <value-type name=\"QElapsedTimer\" since=\"4.7\">\n    <enum-type name=\"ClockType\" since=\"4.7\"/>\n  </value-type>\n\n  <object-type name=\"QAbstractTableModel\" polymorphic-id-expression=\"qobject_cast&lt;QAbstractTableModel*&gt;(%1)\">\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <value-type name=\"QLine\" hash-function=\"PySide::hash\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%i, %i, %i, %i\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"iiii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <inject-code class=\"native\" position=\"beginning\">\n      namespace PySide {\n          template&lt;&gt; inline uint hash(const QLine&amp; v) {\n              return qHash(qMakePair(qMakePair(v.x1(), v.y1()), qMakePair(v.x2(), v.y2())));\n          }\n      };\n    </inject-code>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"iiii\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n  </value-type>\n  <value-type name=\"QLineF\">\n    <enum-type name=\"IntersectType\" />\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f, %f, %f\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"dddd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"dddd\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.x1(), %CPPSELF.y1(), %CPPSELF.x2(), %CPPSELF.y2()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"intersect(QLineF, QPointF*)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(intersectType, intersectionPoint)\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        QPointF p;\n        %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;p);\n        %PYARG_0 = PyTuple_New(2);\n        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));\n        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QPointF](p));\n        </inject-code>\n    </modify-function>\n  </value-type>\n  <object-type name=\"QResource\">\n    <modify-function signature=\"data()const\">\n        <inject-documentation format=\"target\">\n            Returns a read only buffer object pointing to the segment of data that this resource represents. If the resource is compressed the data returns is compressed and qUncompress() must be used to access the data. If the resource is a directory None is returned.\n        </inject-documentation>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <inject-code>\n            const void* d = %CPPSELF.%FUNCTION_NAME();\n            if (d) {\n                %PYARG_0 = Shiboken::Buffer::newObject(d, %CPPSELF.size());\n            } else {\n                Py_INCREF(Py_None);\n                %PYARG_0 = Py_None;\n            }\n        </inject-code>\n    </modify-function>\n    <template name=\"QResource_registerResource\">\n    uchar* ptr = (uchar*) Shiboken::Buffer::getPointer(%PYARG_1);\n    %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(const_cast&lt;const uchar*>(ptr), %2);\n    %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n    </template>\n\n    <modify-function signature=\"unregisterResource(const uchar*, const QString&amp;)\" rename=\"unregisterResourceData\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"PyBuffer\"/>\n      </modify-argument>\n      <inject-code>\n        <insert-template name=\"QResource_registerResource\" />\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"registerResource(const uchar*, const QString&amp;)\" rename=\"registerResourceData\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"PyBuffer\"/>\n      </modify-argument>\n      <inject-code>\n        <insert-template name=\"QResource_registerResource\" />\n      </inject-code>\n    </modify-function>\n  </object-type>\n\n  <value-type name=\"QBasicTimer\"/>\n  <value-type name=\"QByteArrayMatcher\"/>\n  <value-type name=\"QDate\" hash-function=\"PySide::hash\" >\n    <template name=\"pydatetime_importandcheck_function\">\n    #ifdef IS_PY3K\n    #define PySideDateTime_IMPORT PyDateTime_IMPORT\n    #else\n    #define PySideDateTime_IMPORT \\\n                (PyDateTimeAPI = (PyDateTime_CAPI*) PyCObject_Import((char*)\"datetime\", \\\n                                                                 (char*)\"datetime_CAPI\"))\n    #endif\n    static bool PyDateTime_ImportAndCheck(PyObject* pyIn) {\n        if (!PyDateTimeAPI) PySideDateTime_IMPORT;\n        return $DATETIMETYPE_Check(pyIn);\n    }\n    </template>\n    <inject-code class=\"native\" position=\"beginning\">\n        <insert-template name=\"pydatetime_importandcheck_function\">\n            <replace from=\"$DATETIMETYPE\" to=\"PyDate\" />\n        </insert-template>\n    </inject-code>\n    <conversion-rule>\n        <target-to-native>\n            <add-conversion type=\"Py_None\">\n            %out = %OUTTYPE();\n            </add-conversion>\n            <add-conversion type=\"PyDate\" check=\"PyDateTime_ImportAndCheck(%in)\">\n            int day = PyDateTime_GET_DAY(%in);\n            int month = PyDateTime_GET_MONTH(%in);\n            int year = PyDateTime_GET_YEAR(%in);\n            %out = %OUTTYPE(year, month, day);\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n    <extra-includes>\n      <include file-name=\"datetime.h\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"MonthNameType\"/>\n    <add-function signature=\"__repr__\" return-type=\"PyObject\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%i, %i, %i\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"iii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"toPython()\" return-type=\"PyObject\">\n        <inject-code class=\"target\" position=\"beginning\">\n        if (!PyDateTimeAPI) PySideDateTime_IMPORT;\n        %PYARG_0 = PyDate_FromDate(%CPPSELF.year(), %CPPSELF.month(), %CPPSELF.day());\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"getDate(int*,int*,int*)\" >\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(year, month, day)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        int year, month, day;\n        %BEGIN_ALLOW_THREADS\n        %CPPSELF.%FUNCTION_NAME(&amp;year, &amp;month, &amp;day);\n        %END_ALLOW_THREADS\n        %PYARG_0 = PyTuple_New(3);\n        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](year));\n        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](month));\n        PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](day));\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"weekNumber(int*)const\" >\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(week, yearNumber)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        int yearNumber;\n        %BEGIN_ALLOW_THREADS\n        int week = %CPPSELF.%FUNCTION_NAME(&amp;yearNumber);\n        %END_ALLOW_THREADS\n        %PYARG_0 = PyTuple_New(2);\n        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](week));\n        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](yearNumber));\n        </inject-code>\n    </modify-function>\n    <!-- This function isn't part of Qt public API -->\n    <modify-function signature=\"julianToGregorian(uint,int&amp;,int&amp;,int&amp;)\" remove=\"all\"/>\n  </value-type>\n  <value-type name=\"QDateTime\" hash-function=\"PySide::hash\">\n    <inject-code class=\"native\" position=\"beginning\">\n        <insert-template name=\"pydatetime_importandcheck_function\">\n            <replace from=\"$DATETIMETYPE\" to=\"PyDateTime\" />\n        </insert-template>\n    </inject-code>\n    <conversion-rule>\n        <target-to-native>\n            <add-conversion type=\"Py_None\">\n            %out = %OUTTYPE();\n            </add-conversion>\n            <add-conversion type=\"PyDateTime\" check=\"PyDateTime_ImportAndCheck(%in)\">\n            int day = PyDateTime_GET_DAY(%in);\n            int month = PyDateTime_GET_MONTH(%in);\n            int year = PyDateTime_GET_YEAR(%in);\n            int hour = PyDateTime_DATE_GET_HOUR(%in);\n            int min = PyDateTime_DATE_GET_MINUTE(%in);\n            int sec = PyDateTime_DATE_GET_SECOND(%in);\n            int usec = PyDateTime_DATE_GET_MICROSECOND(%in);\n            %out = %OUTTYPE(QDate(year, month, day), QTime(hour, min, sec, usec/1000));\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n    <extra-includes>\n      <include file-name=\"datetime.h\" location=\"global\"/>\n    </extra-includes>\n    <!-- Somewhat internal constructor used to pickle QDateTime -->\n    <add-function signature=\"QDateTime(int, int, int, int, int, int, int, int)\">\n        <modify-argument index=\"8\">\n          <replace-default-expression with=\"Qt::LocalTime\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            QDate date(%1, %2, %3);\n            QTime time(%4, %5, %6, %7);\n            %0 = new %TYPE(date, time, Qt::TimeSpec(%8));\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QDateTime(int, int, int, int, int, int)\">\n        <inject-code class=\"target\" position=\"beginning\">\n            QDate date(%1, %2, %3);\n            QTime time(%4, %5, %6);\n            %0 = new %TYPE(date, time);\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%i, %i, %i, %i, %i, %i, %i, %i\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.date().year(), %CPPSELF.date().month(), %CPPSELF.date().day(), %CPPSELF.time().hour(), %CPPSELF.time().minute(), %CPPSELF.time().second(), %CPPSELF.time().msec(), (int)%CPPSELF.timeSpec()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"iiiiiiii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.date().year(), %CPPSELF.date().month(), %CPPSELF.date().day(), %CPPSELF.time().hour(), %CPPSELF.time().minute(), %CPPSELF.time().second(), %CPPSELF.time().msec(), (int)%CPPSELF.timeSpec()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"toPython()\" return-type=\"PyObject\">\n        <inject-code class=\"target\" position=\"beginning\">\n        QDate date = %CPPSELF.date();\n        QTime time = %CPPSELF.time();\n        if (!PyDateTimeAPI) PySideDateTime_IMPORT;\n        %PYARG_0 = PyDateTime_FromDateAndTime(date.year(), date.month(), date.day(), time.hour(), time.minute(), time.second(), time.msec()*1000);\n        </inject-code>\n    </add-function>\n  </value-type>\n  <value-type name=\"QDir\">\n    <enum-type name=\"Filter\" flags=\"Filters\"/>\n    <enum-type name=\"SortFlag\" flags=\"SortFlags\" />\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"s\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"qPrintable(%CPPSELF.path())\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n  </value-type>\n\n  <value-type name=\"QPoint\" hash-function=\"PySide::hash\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%i, %i\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"ii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <inject-code class=\"native\" position=\"beginning\">\n      namespace PySide {\n          template&lt;&gt; inline uint hash(const QPoint&amp; v) {\n              return qHash(qMakePair(v.x(), v.y()));\n          }\n      };\n    </inject-code>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"ii\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <!--### Functions removed because they return references to Python imutable objects -->\n    <modify-function signature=\"rx()\" remove=\"all\"/>\n    <modify-function signature=\"ry()\" remove=\"all\"/>\n    <!--### -->\n  </value-type>\n  <value-type name=\"QPointF\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"dd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"dd\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <!--### Functions removed because they return references to Python imutable objects -->\n    <modify-function signature=\"rx()\" remove=\"all\"/>\n    <modify-function signature=\"ry()\" remove=\"all\"/>\n    <!--### -->\n  </value-type>\n  <value-type name=\"QRect\" hash-function=\"PySide::hash\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%i, %i, %i, %i\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"iiii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <inject-code class=\"native\" position=\"beginning\">\n      namespace PySide {\n          template&lt;&gt; inline uint hash(const QRect&amp; v) {\n              return qHash(qMakePair(qMakePair(v.x(), v.y()), qMakePair(v.width(), v.height())));\n          }\n      };\n    </inject-code>\n\n    <modify-function signature=\"getCoords(int*,int*,int*,int*)const\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code class=\"target\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getRect(int*,int*,int*,int*)const\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code class=\"target\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QRectF\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f, %f, %f\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n   <!--\n         FIXME These functions return qreal. Will convert to double (format\n         string) mess things up in other architectures?\n    -->\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"dddd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.width(), %CPPSELF.height()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"getCoords(qreal*,qreal*,qreal*,qreal*)const\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code class=\"target\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getRect(qreal*,qreal*,qreal*,qreal*)const\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code class=\"target\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QSize\" hash-function=\"PySide::hash\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%i, %i\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.width(), %CPPSELF.height()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"ii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.width(), %CPPSELF.height()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <inject-code class=\"native\" position=\"beginning\">\n      namespace PySide {\n          template&lt;&gt; inline uint hash(const QSize&amp; v) {\n              return qHash(qMakePair(v.width(), v.height()));\n          }\n      };\n    </inject-code>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"ii\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.width(), %CPPSELF.height()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <!--### Functions removed because they return references to Python imutable objects -->\n    <modify-function signature=\"rheight()\" remove=\"all\"/>\n    <modify-function signature=\"rwidth()\" remove=\"all\"/>\n    <!--### -->\n  </value-type>\n  <value-type name=\"QSizeF\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.width(), %CPPSELF.height()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"dd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.width(), %CPPSELF.height()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"dd\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.width(), %CPPSELF.height()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <!--### Functions removed because they return references to Python imutable objects -->\n    <modify-function signature=\"rheight()\" remove=\"all\" />\n    <modify-function signature=\"rwidth()\" remove=\"all\" />\n    <!--### -->\n  </value-type>\n\n  <value-type name=\"QTime\" hash-function=\"PySide::hash\">\n    <inject-code class=\"native\" position=\"beginning\">\n        <insert-template name=\"pydatetime_importandcheck_function\">\n            <replace from=\"$DATETIMETYPE\" to=\"PyTime\" />\n        </insert-template>\n    </inject-code>\n    <conversion-rule>\n        <target-to-native>\n            <add-conversion type=\"Py_None\">\n            %out = %OUTTYPE();\n            </add-conversion>\n            <add-conversion type=\"PyTime\" check=\"PyDateTime_ImportAndCheck(%in)\">\n            int hour = PyDateTime_TIME_GET_HOUR(%in);\n            int min = PyDateTime_TIME_GET_MINUTE(%in);\n            int sec = PyDateTime_TIME_GET_SECOND(%in);\n            int usec = PyDateTime_TIME_GET_MICROSECOND(%in);\n            %out = %OUTTYPE(hour, min, sec, usec/1000);\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n\n    <extra-includes>\n      <include file-name=\"datetime.h\" location=\"global\"/>\n    </extra-includes>\n\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%i, %i, %i, %i\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"iiii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"toPython()\" return-type=\"PyObject\">\n        <inject-code class=\"target\" position=\"beginning\">\n        if (!PyDateTimeAPI) PySideDateTime_IMPORT;\n        %PYARG_0 = PyTime_FromTime(%CPPSELF.hour(), %CPPSELF.minute(), %CPPSELF.second(), %CPPSELF.msec()*1000);\n        </inject-code>\n    </add-function>\n  </value-type>\n  <value-type name=\"QPersistentModelIndex\" hash-function=\"qHash\">\n    <modify-function signature=\"internalPointer()const\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"return_internal_pointer\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"operator const QModelIndex&amp;()const\">\n        <modify-argument index=\"return\">\n            <parent index=\"this\" action=\"add\"/>\n        </modify-argument>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QUuid\">\n    <enum-type name=\"Variant\"/>\n    <enum-type name=\"Version\"/>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"'%s'\" />\n               <replace from=\"%REPR_ARGS\" to=\"qPrintable(%CPPSELF.toString())\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"s\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"qPrintable(%CPPSELF.toString())\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n  </value-type>\n\n  <value-type name=\"QLocale\">\n    <enum-type name=\"Country\" />\n    <enum-type name=\"FormatType\"/>\n    <enum-type name=\"Language\" />\n    <enum-type name=\"MeasurementSystem\"/>\n    <enum-type name=\"NumberOption\" flags=\"NumberOptions\"/>\n    <enum-type name=\"Script\" since=\"4.8\" revision=\"4800\"/>\n    <enum-type name=\"CurrencySymbolFormat\" since=\"4.8\" revision=\"4800\"/>\n    <enum-type name=\"QuotationStyle\" since=\"4.8\" revision=\"4800\"/>\n    <!--### All those C++ number types have the same representation in Python -->\n    <modify-function signature=\"toString(qulonglong) const\" remove=\"all\"/>\n    <modify-function signature=\"toString(ushort) const\" remove=\"all\"/>\n    <modify-function signature=\"toString(unsigned int) const\" remove=\"all\"/>\n    <!--### -->\n    <extra-includes>\n      <include file-name=\"QDate\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"toTime(QString, QLocale::FormatType)const\">\n        <modify-argument index=\"2\">\n            <rename to=\"format\" />\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"toDate(QString, QLocale::FormatType)const\">\n        <modify-argument index=\"2\">\n            <rename to=\"format\" />\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"toUInt(QString,bool*,int)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n            <remove-default-expression />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(int, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_arg,bool*,arg\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"toULongLong(QString,bool*,int)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n            <remove-default-expression />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(int, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_arg,bool*,arg\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"toDouble(QString,bool*)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n            <remove-default-expression />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(float, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_args,bool*\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"toFloat(QString,bool*)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n            <remove-default-expression />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(float, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_args,bool*\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"toInt(QString,bool*,int)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(int, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_arg,bool*,arg\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"toLongLong(QString,bool*,int)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(int, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_arg,bool*,arg\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"toShort(QString,bool*,int)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(int, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_arg,bool*,arg\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"toUShort(QString,bool*,int)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(int, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_arg,bool*,arg\" />\n        </inject-code>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QBitArray\" hash-function=\"qHash\" >\n    <add-function signature=\"__len__\">\n        <inject-code class=\"target\" position=\"beginning\">\n            return %CPPSELF.size();\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__getitem__\">\n        <inject-code class=\"target\" position=\"beginning\">\n        if (_i &lt; 0 || _i >= %CPPSELF.size()) {\n            PyErr_SetString(PyExc_IndexError, \"index out of bounds\");\n            return 0;\n        }\n        bool ret = %CPPSELF.at(_i);\n        return %CONVERTTOPYTHON[bool](ret);\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__setitem__\">\n        <inject-code class=\"target\" position=\"beginning\">\n            PyObject* args = Py_BuildValue(\"(iiO)\", _i, 1, _value);\n            PyObject* result = Sbk_QBitArrayFunc_setBit(self, args);\n            Py_DECREF(args);\n            Py_XDECREF(result);\n            return !result ? -1 : 0;\n        </inject-code>\n    </add-function>\n  </value-type>\n  <!-- QReadWriteLock does not have a copy ctor! -->\n  <object-type name=\"QReadWriteLock\">\n    <enum-type name=\"RecursionMode\"/>\n    <modify-function signature=\"lockForRead()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"tryLockForRead(int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"lockForWrite()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"tryLockForWrite(int)\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QReadLocker\">\n    <modify-function signature=\"QReadLocker(QReadWriteLock*)\">\n        <modify-argument index=\"1\">\n            <reference-count action=\"set\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"relock()\" allow-thread=\"yes\" />\n    <add-function signature=\"__enter__()\" />\n    <add-function signature=\"__exit__(PyObject*, PyObject*, PyObject*)\">\n        <inject-code>\n            %CPPSELF.unlock();\n        </inject-code>\n    </add-function>\n  </object-type>\n  <object-type name=\"QWriteLocker\">\n    <modify-function signature=\"QWriteLocker(QReadWriteLock*)\">\n        <modify-argument index=\"1\">\n            <reference-count action=\"set\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"relock()\" allow-thread=\"yes\" />\n    <add-function signature=\"__enter__()\" />\n    <add-function signature=\"__exit__(PyObject*, PyObject*, PyObject*)\">\n        <inject-code>\n            %CPPSELF.unlock();\n        </inject-code>\n    </add-function>\n  </object-type>\n  <object-type name=\"QDirIterator\">\n    <enum-type name=\"IteratorFlag\" flags=\"IteratorFlags\"/>\n  </object-type>\n  <object-type name=\"QThread\">\n    <enum-type name=\"Priority\"/>\n    <modify-function signature=\"run()\" thread=\"yes\" />\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\" />\n    <modify-function signature=\"msleep(unsigned long)\" allow-thread=\"yes\" />\n    <modify-function signature=\"sleep(unsigned long)\" allow-thread=\"yes\" />\n    <modify-function signature=\"usleep(unsigned long)\" allow-thread=\"yes\" />\n    <modify-function signature=\"wait(unsigned long)\" allow-thread=\"yes\" />\n    <modify-function signature=\"start(QThread::Priority)\" allow-thread=\"yes\">\n      <modify-argument index=\"1\">\n        <rename to=\"priority\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"exit(int)\" allow-thread=\"yes\" />\n  </object-type>\n  <object-type name=\"QAbstractFileEngineIterator\"/>\n  <object-type name=\"QAbstractItemModel\">\n    <!-- This function was replaced by a added function -->\n    <modify-function signature=\"createIndex(int, int, void*) const\" remove=\"all\"/>\n    <!-- This function is the same as createIndex(int, int, int) const -->\n    <modify-function signature=\"createIndex(int,int, quint32)const\" remove=\"all\" />\n    <modify-function signature=\"createIndex(int, int, int)const\">\n        <modify-argument index=\"3\">\n            <replace-default-expression with=\"0\" />\n        </modify-argument>\n    </modify-function>\n    <add-function signature=\"createIndex(int, int, PyObject*)const\" return-type=\"QModelIndex\">\n        <modify-argument index=\"1\">\n            <rename to=\"row\"/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <rename to=\"column\"/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <rename to=\"ptr\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, %PYARG_3);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n        <inject-documentation mode=\"append\" format=\"target\">\n            Creates a model index for the given row and column with the internal pointer ptr.\n            When using a QSortFilterProxyModel, its indexes have their own internal pointer. It is not advisable to access this internal pointer outside of the model. Use the data() function instead.\n            This function provides a consistent interface that model subclasses must use to create model indexes.\n\n            .. warning:: Because of some Qt/Python itegration rules, the ptr argument do not get the reference incremented during the QModelIndex life time. So it is necessary to keep the object used on ptr argument alive during the whole process. Do not destroy the object if you are not sure about that.\n        </inject-documentation>\n    </add-function>\n    <modify-function signature=\"mimeData(QModelIndexList) const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"native\" owner=\"c++\"/>\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"data(const QModelIndex&amp;,int) const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"native\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <!-- QObject is created manually -->\n  <object-type name=\"QObject\">\n    <extra-includes>\n      <include file-name=\"QThread\" location=\"global\"/>\n      <include file-name=\"QCoreApplication\" location=\"global\"/>\n      <include file-name=\"signalmanager.h\" location=\"local\" />\n    </extra-includes>\n    <modify-function signature=\"metaObject() const\">\n      <inject-code class=\"target\" position=\"beginning\">\n        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME();\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n      </inject-code>\n      <modify-argument index=\"return\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"deleteLater()\">\n      <modify-argument index=\"this\">\n        <define-ownership owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n    <!-- Invalidate-after-use stuff -->\n    <modify-function signature=\"childEvent(QChildEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"customEvent(QEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"event(QEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"eventFilter(QObject*,QEvent*)\">\n        <modify-argument index=\"2\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"timerEvent(QTimerEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <!-- End of Invalidate-after-use fix -->\n    <modify-function signature=\"parent() const\">\n      <modify-argument index=\"this\">\n        <parent index=\"return\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setParent(QObject*)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"connect(const QObject*, const char*, const char *, Qt::ConnectionType) const\">\n        <modify-argument index=\"4\">\n            <rename to=\"type\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\" file=\"\">\n        // %FUNCTION_NAME() - disable generation of function call.\n        %RETURN_TYPE %0 = qobjectConnect(%1, %2, %CPPSELF, %3, %4);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"connect(const QObject*, const char*, const QObject*, const char *, Qt::ConnectionType)\">\n        <modify-argument index=\"5\">\n            <rename to=\"type\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\" file=\"\">\n        // %FUNCTION_NAME() - disable generation of function call.\n        %RETURN_TYPE %0 = qobjectConnect(%1, %2, %3, %4, %5);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </modify-function>\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qobject_connect.cpp\" />\n    <add-function signature=\"connect(const QObject*, const char*, PyCallable*, Qt::ConnectionType)\" return-type=\"bool\" static=\"yes\">\n        <modify-argument index=\"4\">\n            <rename to=\"type\"/>\n            <replace-default-expression with=\"Qt::AutoConnection\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        // %FUNCTION_NAME() - disable generation of function call.\n        %RETURN_TYPE %0 = qobjectConnectCallback(%1, %2, %PYARG_3, %4);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </add-function>\n    <!-- static version -->\n    <add-function signature=\"connect(const char*, PyCallable*, Qt::ConnectionType)\" return-type=\"bool\">\n        <modify-argument index=\"3\">\n            <rename to=\"type\"/>\n            <replace-default-expression with=\"Qt::AutoConnection\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        // %FUNCTION_NAME() - disable generation of function call.\n        %RETURN_TYPE %0 = qobjectConnectCallback(%CPPSELF, %1, %PYARG_2, %3);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </add-function>\n    <add-function signature=\"connect(const char*, const QObject*, const char *, Qt::ConnectionType)\" return-type=\"bool\">\n        <modify-argument index=\"4\">\n            <rename to=\"type\"/>\n            <replace-default-expression with=\"Qt::AutoConnection\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        // %FUNCTION_NAME() - disable generation of function call.\n        %RETURN_TYPE %0 = qobjectConnect(%CPPSELF, %1, %2, %3, %4);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </add-function>\n    <add-function signature=\"emit(const char*, ...)\" return-type=\"bool\">\n        <inject-code class=\"target\" position=\"beginning\">\n        %RETURN_TYPE %0 = PySide::SignalManager::instance().emitSignal(%CPPSELF, %1, %PYARG_2);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </add-function>\n    <add-function signature=\"disconnect(const char *, PyCallable*)\" return-type=\"bool\">\n         <inject-code class=\"target\" position=\"beginning\">\n        // %FUNCTION_NAME() - disable generation of function call.\n        %RETURN_TYPE %0 = qobjectDisconnectCallback(%CPPSELF, %1, %2);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </add-function>\n    <add-function signature=\"disconnect(const QObject*, const char*, PyCallable*)\" return-type=\"bool\" static=\"yes\">\n         <inject-code class=\"target\" position=\"beginning\">\n        // %FUNCTION_NAME() - disable generation of function call.\n        %RETURN_TYPE %0 = qobjectDisconnectCallback(%1, %2, %3);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </add-function>\n    <inject-code class=\"native\" file=\"glue/qobject_findchild.cpp\"/>\n    <add-function signature=\"findChild(PyTypeObject*, const QString&amp;)\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n        QObject* child = _findChildHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1);\n        %PYARG_0 = %CONVERTTOPYTHON[QObject*](child);\n        </inject-code>\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n          <replace-default-expression with=\"QString()\" />\n      </modify-argument>\n    </add-function>\n    <add-function signature=\"findChildren(PyTypeObject*, const QString&amp;)\" return-type=\"PySequence*\" >\n        <inject-code class=\"target\" position=\"beginning\">\n            %PYARG_0 = PyList_New(0);\n            _findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0);\n        </inject-code>\n        <modify-argument index=\"return\">\n            <parent index=\"this\" action=\"add\"/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <replace-default-expression with=\"QString()\" />\n        </modify-argument>\n    </add-function>\n    <add-function signature=\"findChildren(PyTypeObject*, const QRegExp&amp;)\" return-type=\"PySequence*\" >\n        <inject-code class=\"target\" position=\"beginning\">\n            %PYARG_0 = PyList_New(0);\n            _findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0);\n        </inject-code>\n        <modify-argument index=\"return\">\n            <parent index=\"this\" action=\"add\"/>\n        </modify-argument>\n    </add-function>\n\n    <add-function signature=\"tr(const char *, const char *, int)\" return-type=\"QString\">\n        <modify-argument index=\"2\">\n          <replace-default-expression with=\"0\"/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n          <replace-default-expression with=\"-1\"/>\n        </modify-argument>\n\n        <inject-code class=\"target\" position=\"beginning\">\n            QString result;\n            if (QCoreApplication::instance()) {\n                PyObject *klass = PyObject_GetAttrString(%PYSELF, \"__class__\");\n                PyObject *cname = PyObject_GetAttrString(klass, \"__name__\");\n                result = QString(QCoreApplication::instance()->translate(Shiboken::String::toCString(cname), %1, %2, QCoreApplication::CodecForTr, %3));\n\n                Py_DECREF(klass);\n                Py_DECREF(cname);\n            } else {\n                result = QString(QString::fromLatin1(%1));\n            }\n            %PYARG_0 = %CONVERTTOPYTHON[QString](result);\n        </inject-code>\n    </add-function>\n\n    <template name=\"translate_utf8\">\n    if (QCoreApplication::instance()) {\n        Shiboken::AutoDecRef klass(PyObject_GetAttrString(%PYSELF, \"__class__\"));\n        Shiboken::AutoDecRef cname(PyObject_GetAttrString(klass, \"__name__\"));\n        $DEFINE_SECOND_VAR\n        QString result = QCoreApplication::instance()->translate(Shiboken::String::toCString(cname.object()), $SECOND_VAR, %2, QCoreApplication::UnicodeUTF8, %3);\n        %PYARG_0 = %CONVERTTOPYTHON[QString](result);\n    } else {\n        Py_INCREF(%PYARG_1);\n        %PYARG_0 = %PYARG_1;\n    }\n    </template>\n    <add-function signature=\"trUtf8(const char *, const char *, int)\" return-type=\"QString\">\n        <modify-argument index=\"2\">\n          <replace-default-expression with=\"0\"/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n          <replace-default-expression with=\"-1\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"translate_utf8\">\n                <replace from=\"$DEFINE_SECOND_VAR\" to=\"\" />\n                <replace from=\"$SECOND_VAR\" to=\"%1\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"trUtf8(PyUnicode, const char *, int)\" return-type=\"QString\">\n        <modify-argument index=\"2\">\n          <replace-default-expression with=\"0\"/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n          <replace-default-expression with=\"-1\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"translate_utf8\">\n                <replace from=\"$DEFINE_SECOND_VAR\" to=\"Shiboken::AutoDecRef str(PyUnicode_AsUTF8String(%1));\" />\n                <replace from=\"$SECOND_VAR\" to=\"Shiboken::String::toCString(str.object())\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n   <modify-function signature=\"receivers(const char*) const\">\n     <inject-code class=\"target\" position=\"beginning\">\n       // Avoid return +1 because SignalManager connect to \"destroyed()\" signal to control object timelife\n       int ret = %CPPSELF.%FUNCTION_NAME(%1);\n       if (ret > 0 &amp;&amp; ((strcmp(%1, SIGNAL(destroyed())) == 0) || (strcmp(%1, SIGNAL(destroyed(QObject*))) == 0)))\n       ret -= PySide::SignalManager::instance().countConnectionsWith(%CPPSELF);\n\n       %PYARG_0 = %CONVERTTOPYTHON[int](ret);\n     </inject-code>\n   </modify-function>\n\n   <modify-function signature=\"destroyed(QObject*)\">\n     <modify-argument index=\"1\">\n       <rename to=\"object\"/>\n     </modify-argument>\n   </modify-function>\n\n   <modify-function signature=\"sender() const\">\n      <modify-argument index=\"return\">\n         <define-ownership owner=\"default\"/>\n      </modify-argument>\n  </modify-function>\n\n   <!-- This is not supported due the lack of information durring the call with no arguments,  this can cause a memory leak -->\n   <modify-function signature=\"disconnect(const char*, const QObject *, const char *)\">\n       <modify-argument index=\"1\">\n           <remove-default-expression />\n       </modify-argument>\n       <modify-argument index=\"2\">\n           <remove-default-expression />\n       </modify-argument>\n       <modify-argument index=\"3\">\n           <remove-default-expression />\n       </modify-argument>\n   </modify-function>\n  </object-type>\n  <object-type name=\"QAbstractListModel\" polymorphic-id-expression=\"qobject_cast&lt;QAbstractListModel*&gt;(%1)\">\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <value-type name=\"QUrl\" hash-function=\"PySide::hash\">\n    <enum-type name=\"FormattingOption\" flags=\"FormattingOptions\"/>\n    <enum-type name=\"ParsingMode\"/>\n    <modify-documentation xpath='description/para[3]'>\n        &lt;para>URLs can be represented in two forms: encoded or unencoded. The unencoded representation is suitable for showing to users, but the encoded representation is typically what you would send to a web server. For example, the unencoded URL &quot;http://bühler.example.com&quot; would be sent to the server as &quot;http://xn--bhler-kva.example.com/List%20of%20applicants.xml&quot;.&lt;/para>\n    </modify-documentation>\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n    </extra-includes>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"'%s'\" />\n               <replace from=\"%REPR_ARGS\" to=\"qPrintable(%CPPSELF.toString())\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"s\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"qPrintable(%CPPSELF.toString())\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n  </value-type>\n  <value-type name=\"QRegExp\">\n    <enum-type name=\"CaretMode\"/>\n    <enum-type name=\"PatternSyntax\"/>\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n    </extra-includes>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"'%s', %i, %i\" />\n               <replace from=\"%REPR_ARGS\" to=\"qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"sii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"qPrintable(%CPPSELF.pattern()), (int)%CPPSELF.caseSensitivity(), (int)%CPPSELF.patternSyntax()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"replace(QString, QString)\" return-type=\"QString\">\n        <modify-argument index=\"1\">\n            <rename to=\"sourceString\"/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <rename to=\"after\"/>\n        </modify-argument>\n        <inject-documentation format=\"target\" mode=\"append\">\n        Replaces every occurrence of the regular expression in *sourceString* with *after*.\n        Returns a new Python string with the modified contents. For example:\n\n        ::\n\n            s = \"Banana\"\n            re = QRegExp(\"a[mn]\")\n            s = re.replace(s, \"ox\")\n            # s == \"Boxoxa\"\n\n\n        For regular expressions containing capturing parentheses, occurrences of \\1, \\2, ..., in *after*\n        are replaced with rx.cap(1), cap(2), ...\n\n        ::\n\n            t = \"A &lt;i>bon mot&lt;/i>.\"\n            re = QRegExp(\"&lt;i>([^&lt;]*)&lt;/i>\")\n            t = re.replace(t, \"\\\\emph{\\\\1}\")\n            # t == \"A \\\\emph{bon mot}.\"\n\n        </inject-documentation>\n        <inject-code class=\"target\" position=\"beginning\">\n        %1.replace(*%CPPSELF, %2);\n        %PYARG_0 = %CONVERTTOPYTHON[QString](%1);\n        </inject-code>\n    </add-function>\n  </value-type>\n  <value-type name=\"QFileInfo\">\n    <extra-includes>\n      <include file-name=\"QDateTime\" location=\"global\"/>\n      <include file-name=\"QDir\" location=\"global\"/>\n    </extra-includes>\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"s\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"qPrintable(%CPPSELF.filePath())\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n  </value-type>\n  <value-type name=\"QByteArray\" hash-function=\"qHash\">\n    <conversion-rule>\n        <target-to-native>\n            <add-conversion type=\"Py_None\">\n            %out = %OUTTYPE();\n            </add-conversion>\n            <add-conversion type=\"PyString\" check=\"Shiboken::String::check(%in)\">\n            %out = %OUTTYPE(Shiboken::String::toCString(%in), Shiboken::String::len(%in));\n            </add-conversion>\n            <add-conversion type=\"PyBytes\">\n            #ifdef IS_PY3K\n            %out = %OUTTYPE(PyBytes_AS_STRING(%in), PyBytes_GET_SIZE(%in));\n            #endif\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n\n    <extra-includes>\n      <include file-name=\"QNoImplicitBoolCast\" location=\"global\"/>\n    </extra-includes>\n\n    <!-- ### These overloads must be removed accept strings with \\x00 in their contents -->\n    <modify-function signature=\"append(const char*,int)\" remove=\"all\" />\n    <modify-function signature=\"append(const char*)\" remove=\"all\" />\n    <modify-function signature=\"append(QString)\" remove=\"all\" />\n    <modify-function signature=\"contains(const char*)const\" remove=\"all\" />\n    <modify-function signature=\"count(const char*)const\" remove=\"all\" />\n    <modify-function signature=\"endsWith(const char*)const\" remove=\"all\" />\n    <modify-function signature=\"indexOf(const char*,int)const\" remove=\"all\" />\n    <modify-function signature=\"indexOf(char,int)const\" remove=\"all\" />\n    <modify-function signature=\"indexOf(QString,int)const\" remove=\"all\" />\n    <modify-function signature=\"insert(int,const char*)\" remove=\"all\" />\n    <modify-function signature=\"insert(int,char)\" remove=\"all\" />\n    <modify-function signature=\"insert(int,const char*,int)\" since=\"4.6\" remove=\"all\" />\n    <modify-function signature=\"insert(int,QString)\" remove=\"all\" />\n    <modify-function signature=\"lastIndexOf(const char*,int)const\" remove=\"all\" />\n    <modify-function signature=\"lastIndexOf(QString,int)const\" remove=\"all\" />\n    <modify-function signature=\"lastIndexOf(char,int)const\" remove=\"all\" />\n    <modify-function signature=\"prepend(const char*)\" remove=\"all\" />\n    <modify-function signature=\"prepend(const char*,int)\" since=\"4.6\" remove=\"all\" />\n    <modify-function signature=\"replace(QByteArray,const char*)\" remove=\"all\" />\n    <modify-function signature=\"replace(const char*,int,const char*,int)\" remove=\"all\"/>\n    <modify-function signature=\"replace(QString,const char*)\" remove=\"all\" />\n    <modify-function signature=\"replace(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"replace(const char*,const char*)\" remove=\"all\" />\n    <modify-function signature=\"replace(int,int,const char*)\" remove=\"all\" />\n    <modify-function signature=\"replace(int,int,const char*,int)\" since=\"4.6\" remove=\"all\" />\n    <modify-function signature=\"replace(char,const char*)\" remove=\"all\" />\n    <modify-function signature=\"replace(char,QString)\" remove=\"all\" />\n    <modify-function signature=\"startsWith(const char*)const\" remove=\"all\" />\n    <modify-function signature=\"operator==(QString)const\" remove=\"all\" />\n    <modify-function signature=\"operator==(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator==(QByteArray, const char*)\" remove=\"all\" />\n    <modify-function signature=\"operator>(QString)const\" remove=\"all\" />\n    <modify-function signature=\"operator>(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator>(QByteArray,const char*)\" remove=\"all\" />\n    <modify-function signature=\"operator>=(QString)const\" remove=\"all\" />\n    <modify-function signature=\"operator>=(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator>=(QByteArray,const char*)\" remove=\"all\" />\n    <modify-function signature=\"operator&lt;(QString)const\" remove=\"all\" />\n    <modify-function signature=\"operator&lt;(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator&lt;=(QString)const\" remove=\"all\" />\n    <modify-function signature=\"operator&lt;=(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator&lt;=(QByteArray,const char*)\" remove=\"all\" />\n    <modify-function signature=\"operator!=(QString)const\" remove=\"all\" />\n    <modify-function signature=\"operator!=(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator!=(QByteArray,const char*)\" remove=\"all\" />\n    <modify-function signature=\"operator+=(QString)\" remove=\"all\" />\n    <modify-function signature=\"operator+=(const char*)\" remove=\"all\" />\n    <modify-function signature=\"operator+(QByteArray,const char*)\" remove=\"all\" />\n    <modify-function signature=\"operator+(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator+(QByteArray,const char*)\" remove=\"all\" />\n    <modify-function signature=\"operator+(QString,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator+(QByteArray,QString)\" remove=\"all\" />\n    <add-function signature=\"operator+(PyUnicode)\">\n        <inject-code>\n            Shiboken::AutoDecRef str(PyUnicode_AsASCIIString(%PYARG_1));\n            if (!str.isNull()) {\n                QByteArray b(PyBytes_AS_STRING(str.object()), PyBytes_GET_SIZE (str.object()));\n                b.prepend(*%CPPSELF);\n                %PYARG_0 = %CONVERTTOPYTHON[QByteArray](b);\n            }\n        </inject-code>\n    </add-function>\n    <add-function signature=\"operator+(PyUnicode, QByteArray)\">\n        <inject-code>\n            Shiboken::AutoDecRef str(PyUnicode_AsASCIIString(%PYARG_1));\n            if (!str.isNull()) {\n                QByteArray b(PyBytes_AS_STRING(str.object()), PyBytes_GET_SIZE(str.object()));\n                b.append(*%CPPSELF);\n                %PYARG_0 = %CONVERTTOPYTHON[QByteArray](b);\n            }\n        </inject-code>\n    </add-function>\n    <add-function signature=\"operator+(PyBytes, QByteArray)\">\n        <inject-code>\n        QByteArray ba = QByteArray(PyBytes_AS_STRING(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1)) + *%CPPSELF;\n        %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);\n        </inject-code>\n    </add-function>\n    <!-- ### -->\n\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            QByteArray b(((PyObject*)%PYSELF)->ob_type->tp_name);\n            PyObject* aux = Shiboken::String::fromStringAndSize(%CPPSELF.constData(), %CPPSELF.size());\n            if (PyUnicode_CheckExact(aux)) {\n                PyObject* tmp = PyUnicode_AsASCIIString(aux);\n                Py_DECREF(aux);\n                aux = tmp;\n            }\n            b += \"('\";\n            b += QByteArray(PyBytes_AS_STRING(aux), PyBytes_GET_SIZE(aux));\n            b += \"')\";\n            %PYARG_0 = Shiboken::String::fromStringAndSize(b.constData(), b.size());\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n                <replace from=\"%REDUCE_FORMAT\" to=\"N\" />\n                <replace from=\"%REDUCE_ARGS\" to=\"PyBytes_FromStringAndSize(%CPPSELF.constData(), %CPPSELF.size())\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"QByteArray(const char *)\">\n        <!-- Keep \\x00 bytes passed in python strings -->\n        <inject-code class=\"target\" position=\"beginning\">\n            if (PyBytes_Check(%PYARG_1)) {\n                %0 = new QByteArray(PyBytes_AsString(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1));\n            } else if (PyUnicode_CheckExact(%PYARG_1)) {\n                Shiboken::AutoDecRef data(PyUnicode_AsASCIIString(%PYARG_1));\n                %0 = new QByteArray(PyBytes_AsString(data.object()), PyBytes_GET_SIZE(data.object()));\n            } else if (Shiboken::String::check(%PYARG_1)) {\n                %0 = new QByteArray(Shiboken::String::toCString(%PYARG_1), Shiboken::String::len(%PYARG_1));\n            }\n        </inject-code>\n    </modify-function>\n    <!-- buffer protocol -->\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qbytearray_bufferprotocol.cpp\" />\n    <inject-code class=\"target\" position=\"end\">\n        #if PY_VERSION_HEX &lt; 0x03000000\n            Shiboken::SbkType&lt;QByteArray>()->tp_as_buffer = &amp;SbkQByteArrayBufferProc;\n            Shiboken::SbkType&lt;QByteArray>()->tp_flags |= Py_TPFLAGS_HAVE_GETCHARBUFFER;\n        #endif\n    </inject-code>\n\n   <modify-function signature=\"data()\">\n       <inject-code class=\"target\" position=\"beginning\">\n           %PYARG_0 = PyBytes_FromStringAndSize(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.size());\n       </inject-code>\n   </modify-function>\n\n    <!-- removed functions -->\n    <!--### Functions removed because they return STL-like iterators -->\n    <modify-function signature=\"begin()\" remove=\"all\"/>\n    <modify-function signature=\"begin()const\" remove=\"all\"/>\n    <modify-function signature=\"constBegin()const\" remove=\"all\"/>\n    <modify-function signature=\"constData()const\" remove=\"all\"/>\n    <modify-function signature=\"constEnd()const\" remove=\"all\"/>\n    <modify-function signature=\"end()\" remove=\"all\"/>\n    <modify-function signature=\"end()const\" remove=\"all\"/>\n    <!--### -->\n\n    <!--### Functions removed because they provide useless overloads from Python point of view -->\n    <modify-function signature=\"number(uint,int)\" remove=\"all\"/>\n    <modify-function signature=\"number(qulonglong,int)\" remove=\"all\"/>\n    <modify-function signature=\"operator+=(const char*)\" remove=\"all\"/>\n    <modify-function signature=\"operator==(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator!=(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator&lt;(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator&lt;=(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator>(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator>=(const char*,QByteArray)\" remove=\"all\" />\n    <modify-function signature=\"operator[](int)const\" remove=\"all\"/>\n    <modify-function signature=\"operator[](uint)const\" remove=\"all\"/>\n    <!-- Those types have the same representation in Python, an overload would be useless. -->\n    <modify-function signature=\"setNum(uint,int)\" remove=\"all\"/>\n    <modify-function signature=\"setNum(ushort,int)\" remove=\"all\"/>\n    <modify-function signature=\"setNum(float,char,int)\" remove=\"all\"/>\n    <modify-function signature=\"setNum(short,int)\" remove=\"all\"/>\n    <modify-function signature=\"setNum(qulonglong,int)\" remove=\"all\"/>\n\n    <!--### -->\n\n    <modify-function signature=\"operator const char *()const\" remove=\"all\"/>\n    <modify-function signature=\"operator const void *()const\" remove=\"all\"/>\n\n    <!--### STL compatibility functions not supported by PySide -->\n    <modify-function signature=\"push_back(char)\" remove=\"all\"/>\n    <modify-function signature=\"push_back(const QByteArray&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"push_back(const char*)\" remove=\"all\"/>\n    <modify-function signature=\"push_front(char)\" remove=\"all\"/>\n    <modify-function signature=\"push_front(const QByteArray&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"push_front(const char*)\" remove=\"all\"/>\n    <!--### -->\n\n    <modify-function signature=\"toLong(bool*, int) const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"toLongLong(bool*, int) const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"toShort(bool*, int) const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"toUInt(bool*, int) const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"toULong(bool*, int) const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"toULongLong(bool*, int) const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"toInt(bool*,int)const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"toUShort(bool*,int)const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <!-- QByteArray(const char *) do the job of this constructor -->\n    <modify-function signature=\"QByteArray(const char*,int)\" remove=\"all\"/>\n    <modify-function signature=\"fromRawData(const char*,int)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PyBytes\"/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code class=\"target\">\n        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(PyBytes_AsString(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1));\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"toDouble(bool*)const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"toFloat(bool*)const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*\"/>\n      </inject-code>\n    </modify-function>\n    <add-function signature=\"__str__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            %PYARG_0 = Shiboken::String::fromStringAndSize(%CPPSELF.constData(), %CPPSELF.size());\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__len__\">\n        <inject-code class=\"target\" position=\"beginning\">\n            return %CPPSELF.count();\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__getitem__\">\n        <inject-code class=\"target\" position=\"beginning\">\n                if (_i &lt; 0 || _i >= %CPPSELF.size()) {\n                    PyErr_SetString(PyExc_IndexError, \"index out of bounds\");\n                    return 0;\n                } else {\n                    char res[2];\n                    res[0] = %CPPSELF.at(_i);\n                    res[1] = 0;\n                    return PyBytes_FromStringAndSize(res, 1);\n                }\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__setitem__\">\n        <inject-code class=\"target\" position=\"beginning\">\n                %CPPSELF.remove(_i, 1);\n                PyObject* args = Py_BuildValue(\"(nO)\", _i, _value);\n                PyObject* result = Sbk_QByteArrayFunc_insert(self, args);\n                Py_DECREF(args);\n                Py_XDECREF(result);\n                return !result ? -1 : 0;\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__getslice__\">\n        <inject-code class=\"target\" position=\"beginning\">\n            Py_ssize_t max = %CPPSELF.count();\n            _i1 = qBound(Py_ssize_t(0), _i1, max);\n            _i2 = qBound(Py_ssize_t(0), _i2, max);\n            QByteArray ba;\n            if (_i1 &lt; _i2)\n                ba = %CPPSELF.mid(_i1, _i2 - _i1);\n            return %CONVERTTOPYTHON[QByteArray](ba);\n        </inject-code>\n    </add-function>\n  </value-type>\n  <value-type name=\"QTextBoundaryFinder\">\n    <enum-type name=\"BoundaryReason\" flags=\"BoundaryReasons\"/>\n    <enum-type name=\"BoundaryType\"/>\n    <!-- There's no QChar in PySide -->\n    <modify-function signature=\"QTextBoundaryFinder(QTextBoundaryFinder::BoundaryType,const QChar*,int,unsigned char*,int)\" remove=\"all\"/>\n  </value-type>\n  <object-type name=\"QXmlStreamEntityResolver\"/>\n  <object-type name=\"QAbstractEventDispatcher\">\n    <extra-includes>\n      <include file-name=\"QPair\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>)\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QEventLoop\">\n      <enum-type name=\"ProcessEventsFlag\" flags=\"ProcessEventsFlags\"/>\n      <modify-function signature=\"exec(QFlags&lt;QEventLoop::ProcessEventsFlag>)\" rename=\"exec_\" allow-thread=\"yes\" />\n      <modify-function signature=\"processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>)\" allow-thread=\"yes\" />\n      <modify-function signature=\"processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag>, int)\" allow-thread=\"yes\" />\n  </object-type>\n  <object-type name=\"QFile\">\n    <enum-type name=\"FileError\"/>\n    <enum-type name=\"MemoryMapFlags\"/>\n    <enum-type name=\"Permission\" flags=\"Permissions\"/>\n    <enum-type name=\"FileHandleFlag\" flags=\"FileHandleFlags\" since=\"4.8\" revision=\"4800\"/>\n    <extra-includes>\n      <include file-name=\"QAbstractFileEngine\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"unmap(uchar*)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PyBuffer\"/>\n        </modify-argument>\n        <inject-code>\n        uchar* ptr = (uchar*) Shiboken::Buffer::getPointer(%PYARG_1);\n        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ptr);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"map(qint64,qint64,QFile::MemoryMapFlags)\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\"/>\n        </modify-argument>\n        <inject-code>\n            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1, %2, %3), %2, Shiboken::Buffer::ReadWrite);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"remove()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"remove(const QString&amp;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"rename(const QString&amp;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"rename(const QString&amp;, const QString&amp;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"link(const QString&amp;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"link(const QString&amp;, const QString&amp;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"copy(const QString&amp;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"copy(const QString&amp;, const QString&amp;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"flush()\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QIODevice\">\n    <enum-type name=\"OpenModeFlag\" flags=\"OpenMode\"/>\n    <modify-function signature=\"open(QFlags&lt;QIODevice::OpenModeFlag>)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"close()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"seek(qint64)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"readAll()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"peek(qint64)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"write(const QByteArray&amp;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"waitForReadyRead(int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"waitForBytesWritten(int)\" allow-thread=\"yes\"/>\n    <!-- ### peek(qint64) do the job -->\n    <modify-function signature=\"peek(char*, qint64)\" remove=\"all\"/>\n    <!-- ### read(qint64) do the job -->\n    <modify-function signature=\"read(char*, qint64)\" remove=\"all\"/>\n    <!-- ### readLine(qint64) do the job -->\n    <modify-function signature=\"readLine(char*, qint64)\" remove=\"all\"/>\n    <!-- ### write(str) do the job -->\n    <modify-function signature=\"write(const char*, qint64)\" remove=\"all\"/>\n    <modify-function signature=\"write(const char*)\" remove=\"all\"/>\n    <modify-function signature=\"getChar(char*)\">\n        <modify-argument index=\"1\">\n            <remove-argument />\n            <remove-default-expression />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_char*\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"readData(char*, qint64)\">\n        <inject-code class=\"target\">\n            QByteArray ba;\n            ba.resize(%2);\n            %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size());\n            %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);\n        </inject-code>\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\"/>\n            <conversion-rule class=\"native\">\n                %RETURN_TYPE %out;\n                if (PyBytes_Check(%PYARG_0)) {\n                    %out = PyBytes_GET_SIZE((PyObject*)%PYARG_0);\n                    memcpy(%1, PyBytes_AS_STRING((PyObject*)%PYARG_0), %out);\n                } else if (Shiboken::String::check(%PYARG_0)) {\n                    %out = Shiboken::String::len((PyObject*)%PYARG_0);\n                    memcpy(%1, Shiboken::String::toCString((PyObject*)%PYARG_0), %out);\n                }\n            </conversion-rule>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"readLineData(char*, qint64)\">\n        <inject-code class=\"target\">\n            QByteArray ba;\n            ba.resize(%2);\n            %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size());\n            %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);\n        </inject-code>\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\"/>\n            <conversion-rule class=\"native\">\n                %RETURN_TYPE %out;\n                if (!PyBytes_Check(%PYARG_0)) {\n                    %out = -1;\n                } else {\n                    %out = PyBytes_GET_SIZE((PyObject*)%PYARG_0);\n                    memcpy(%1, PyBytes_AS_STRING((PyObject*)%PYARG_0), %out);\n                }\n            </conversion-rule>\n        </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QCryptographicHash\">\n    <enum-type name=\"Algorithm\"/>\n    <modify-function signature=\"addData(const char*,int)\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code>\n            %CPPSELF.%FUNCTION_NAME(Shiboken::String::toCString(%PYARG_1), Shiboken::String::len(%PYARG_1));\n        </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QLibraryInfo\">\n    <enum-type name=\"LibraryLocation\"/>\n  </object-type>\n  <object-type name=\"QMutexLocker\" copyable=\"no\">\n    <modify-function signature=\"QMutexLocker(QMutex*)\" allow-thread=\"yes\">\n        <modify-argument index=\"1\">\n            <reference-count action=\"set\" variable-name=\"mutex()const0\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"relock()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"mutex() const\">\n      <modify-argument index=\"return\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <add-function signature=\"__enter__()\" />\n    <add-function signature=\"__exit__(PyObject*, PyObject*, PyObject*)\">\n        <inject-code>\n            %CPPSELF.unlock();\n        </inject-code>\n    </add-function>\n  </object-type>\n\n  <object-type name=\"QMutex\">\n    <enum-type name=\"RecursionMode\"/>\n    <modify-function signature=\"lock()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"tryLock(int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"tryLock()\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QSemaphore\">\n    <modify-function signature=\"acquire(int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"tryAcquire(int, int)\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QSocketNotifier\">\n    <enum-type name=\"Type\"/>\n    <add-function signature=\"QSocketNotifier(PyObject*, QSocketNotifier::Type, QObject*)\">\n        <modify-argument index=\"3\">\n            <replace-default-expression with=\"0\" />\n            <rename to=\"parent\" />\n        </modify-argument>\n        <inject-code>\n        Shiboken::AutoDecRef fileNo(PyObject_GetAttrString(%PYARG_1, \"fileno\"));\n        if (!fileNo.isNull()) {\n            Shiboken::AutoDecRef fileNoValue(PyObject_CallObject(fileNo, 0));\n            if (%CHECKTYPE[int](fileNoValue)) {\n                int cppFileNoValue = %CONVERTTOCPP[int](fileNoValue);\n                %0 = new %TYPE(cppFileNoValue, %2, %3);\n            }\n        }\n        </inject-code>\n    </add-function>\n  </object-type>\n  <object-type name=\"QSystemLocale\">\n    <enum-type name=\"QueryType\"/>\n  </object-type>\n  <object-type name=\"QSysInfo\">\n    <enum-type name=\"Endian\"/>\n    <enum-type name=\"Sizes\"/>\n  </object-type>\n  <object-type name=\"QTemporaryFile\">\n    <extra-includes>\n      <include file-name=\"QAbstractFileEngine\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"createLocalFile(const QString&amp;)\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QMimeData\">\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QUrl\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QTextCodec\">\n    <enum-type name=\"ConversionFlag\" flags=\"ConversionFlags\"/>\n\n    <object-type name=\"ConverterState\">\n      <include file-name=\"QTextCodec\" location=\"global\"/>\n      <modify-function signature=\"ConverterState(QFlags&lt;QTextCodec::ConversionFlag&gt;)\">\n        <modify-argument index=\"1\">\n          <replace-default-expression with=\"QTextCodec::DefaultConversion\"/>\n        </modify-argument>\n      </modify-function>\n    </object-type>\n\n    <modify-function signature=\"setCodecForTr(QTextCodec*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCodecForCStrings(QTextCodec*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCodecForLocale(QTextCodec*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!-- fromUnicode(QString) does the job -->\n    <modify-function signature=\"fromUnicode(const QChar*,int,QTextCodec::ConverterState*)const\" remove=\"all\" />\n    <modify-function signature=\"convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const\" remove=\"all\" />\n  </object-type>\n  <object-type name=\"QTextDecoder\">\n    <!-- ### toUnicode(QByteArray) to the job -->\n    <modify-function signature=\"toUnicode(const char*,int)\" remove=\"all\" />\n    <modify-function signature=\"toUnicode(QString*,const char*,int)\" remove=\"all\" />\n    <!-- ### -->\n  </object-type>\n  <object-type name=\"QTextEncoder\">\n    <!-- fromUnicode(QString) does the job -->\n    <modify-function signature=\"fromUnicode(const QChar*,int)\" remove=\"all\" />\n  </object-type>\n  <object-type name=\"QTimeLine\">\n    <enum-type name=\"CurveShape\"/>\n    <enum-type name=\"Direction\"/>\n    <enum-type name=\"State\"/>\n  </object-type>\n  <object-type name=\"QTranslator\">\n    <modify-function signature=\"load(const uchar*, int)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PyBuffer\" />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code>\n        Py_ssize_t size;\n        uchar* ptr = (uchar*) Shiboken::Buffer::getPointer(%PYARG_1, &amp;size);\n        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(const_cast&lt;const uchar*>(ptr), size);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QWaitCondition\">\n    <modify-function signature=\"wait(QMutex*, unsigned long)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"wait(QReadWriteLock*, unsigned long)\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QFileSystemWatcher\">\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QBuffer\">\n    <!-- ### setData(QByteArray) do the job -->\n    <modify-function signature=\"setData(const char*,int)\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QTimer\">\n    <modify-function signature=\"singleShot(int,QObject*,const char*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        // %FUNCTION_NAME() - disable generation of c++ function call\n        (void) %2; // remove warning about unused variable\n        Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));\n        PyObject* pyTimer = Shiboken::SbkType&lt;QTimer>()->tp_new(Shiboken::SbkType&lt;QTimer>(), emptyTuple, 0);\n        Shiboken::SbkType&lt;QTimer>()->tp_init(pyTimer, emptyTuple, 0);\n\n        QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);\n        Shiboken::AutoDecRef result(\n            PyObject_CallMethod(pyTimer,\n                                const_cast&lt;char*>(\"connect\"),\n                                const_cast&lt;char*>(\"OsOs\"),\n                                pyTimer,\n                                SIGNAL(timeout()),\n                                %PYARG_2,\n                                %3)\n        );\n        Shiboken::Object::releaseOwnership((SbkObject*)pyTimer);\n        Py_XDECREF(pyTimer);\n        timer->setSingleShot(true);\n        timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));\n        timer->start(%1);\n      </inject-code>\n    </modify-function>\n    <add-function signature=\"singleShot(int, PyCallable*)\" static=\"yes\">\n        <inject-code class=\"target\" position=\"beginning\">\n        // %FUNCTION_NAME() - disable generation of c++ function call\n        Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));\n        PyObject *pyTimer = Shiboken::SbkType&lt;QTimer>()->tp_new(Shiboken::SbkType&lt;QTimer>(), emptyTuple, 0);\n        Shiboken::SbkType&lt;QTimer>()->tp_init(pyTimer, emptyTuple, 0);\n        QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);\n        timer->setSingleShot(true);\n\n        if (PyObject_TypeCheck(%2, &amp;PySideSignalInstanceType)) {\n            PySideSignalInstance* signalInstance = reinterpret_cast&lt;PySideSignalInstance*&gt;(%2);\n            Shiboken::AutoDecRef signalSignature(Shiboken::String::fromFormat(\"2%s\", PySide::Signal::getSignature(signalInstance)));\n            Shiboken::AutoDecRef result(\n                PyObject_CallMethod(pyTimer,\n                                    const_cast&lt;char*>(\"connect\"),\n                                    const_cast&lt;char*>(\"OsOO\"),\n                                    pyTimer,\n                                    SIGNAL(timeout()),\n                                    PySide::Signal::getObject(signalInstance),\n                                    signalSignature.object())\n            );\n        } else {\n            Shiboken::AutoDecRef result(\n                PyObject_CallMethod(pyTimer,\n                                    const_cast&lt;char*>(\"connect\"),\n                                    const_cast&lt;char*>(\"OsO\"),\n                                    pyTimer,\n                                    SIGNAL(timeout()),\n                                    %PYARG_2)\n            );\n        }\n\n        timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()), Qt::DirectConnection);\n        Shiboken::Object::releaseOwnership((SbkObject*)pyTimer);\n        Py_XDECREF(pyTimer);\n        timer->start(%1);\n        </inject-code>\n    </add-function>\n  </object-type>\n  <object-type name=\"QAbstractFileEngineHandler\">\n      <modify-function signature=\"create(const QString&map;)const\">\n        <modify-argument index=\"return\">\n            <define-ownership owner=\"c++\"/>\n        </modify-argument>\n      </modify-function>\n  </object-type>\n  <!-- <object-type name=\"QAbstractFileEngine::MapExtensionOption\" /> -->\n  <!-- <object-type name=\"QAbstractFileEngine::MapExtensionReturn\" /> -->\n  <!-- <object-type name=\"QAbstractFileEngine::UnMapExtensionOption\" /> -->\n  <object-type name=\"QAbstractFileEngine\">\n    <enum-type name=\"Extension\" extensible=\"yes\"/>\n    <enum-type name=\"FileFlag\" flags=\"FileFlags\"/>\n    <enum-type name=\"FileName\"/>\n    <enum-type name=\"FileOwner\"/>\n    <enum-type name=\"FileTime\"/>\n    <extra-includes>\n      <include file-name=\"QDateTime\" location=\"global\"/>\n    </extra-includes>\n\n    <modify-function signature=\"open(QFlags&lt;QIODevice::OpenModeFlag>)\" allow-thread=\"yes\" />\n    <modify-function signature=\"close()\" allow-thread=\"yes\" />\n    <modify-function signature=\"flush()\" allow-thread=\"yes\" />\n    <modify-function signature=\"seek(qint64)\" allow-thread=\"yes\" />\n    <modify-function signature=\"remove()\" allow-thread=\"yes\" />\n    <modify-function signature=\"copy(const QString&amp;)\" allow-thread=\"yes\" />\n    <modify-function signature=\"rename(const QString&amp;)\" allow-thread=\"yes\" />\n    <modify-function signature=\"link(const QString&amp;)\" allow-thread=\"yes\" />\n    <modify-function signature=\"mkdir(const QString&amp;, bool)const\" allow-thread=\"yes\" />\n    <modify-function signature=\"rmdir(const QString&amp;, bool)const\" allow-thread=\"yes\" />\n    <modify-function signature=\"write(const char*, qint64)\" allow-thread=\"yes\" />\n\n    <modify-function signature=\"beginEntryList(QFlags&lt;QDir::Filter>,const QStringList&amp;)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"native\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"unmap(uchar*)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PyBuffer\"/>\n        </modify-argument>\n        <inject-code>\n        uchar* ptr = (uchar*)Shiboken::Buffer::getPointer(%PYARG_1);\n        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ptr);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"map(qint64,qint64,QFile::MemoryMapFlags)\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\"/>\n        </modify-argument>\n        <inject-code>\n            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1, %2, %3), %2, Shiboken::Buffer::ReadWrite);\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"read(char*, qint64)\" allow-thread=\"yes\">\n        <inject-code class=\"target\">\n            QByteArray ba;\n            ba.resize(%2);\n            %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size());\n            %PYARG_0 = PyBytes_FromStringAndSize(ba.constData(), ba.size());\n        </inject-code>\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\"/>\n            <conversion-rule class=\"native\">\n                %RETURN_TYPE %out;\n                if (!Shiboken::String::check(%PYARG_0)) {\n                    %out = -1;\n                } else {\n                    %out = PyBytes_GET_SIZE((PyObject*)%PYARG_0);\n                    memcpy(%1, PyBytes_AS_STRING((PyObject*)%PYARG_0), %out);\n                }\n            </conversion-rule>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"readLine(char*, qint64)\" allow-thread=\"yes\">\n        <inject-code class=\"target\">\n            QByteArray ba;\n            ba.resize(%2);\n            %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size());\n            %PYARG_0 = PyBytes_FromStringAndSize(ba.constData(), ba.size());\n        </inject-code>\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\"/>\n            <conversion-rule class=\"native\">\n                %RETURN_TYPE %out;\n                if (!Shiboken::String::check(%PYARG_0)) {\n                    %out = -1;\n                } else {\n                    %out = PyBytes_GET_SIZE((PyObject*)%PYARG_0);\n                    memcpy(%1, PyBytes_AS_STRING((PyObject*)%PYARG_0), %out);\n                }\n            </conversion-rule>\n        </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QProcess\">\n    <enum-type name=\"ExitStatus\"/>\n    <enum-type name=\"ProcessChannel\"/>\n    <enum-type name=\"ProcessChannelMode\"/>\n    <enum-type name=\"ProcessError\"/>\n    <enum-type name=\"ProcessState\"/>\n\n    <modify-function signature=\"waitForStarted(int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"waitForBytesWritten(int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"waitForFinished(int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"readAllStandardOutput()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"readAllStandardError()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"execute(QString, QStringList)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"execute(QString)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"startDetached(QString,QStringList,QString,qint64*)\">\n        <modify-argument index=\"4\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(retval, pid)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        qint64 pid;\n        %RETURN_TYPE retval = %TYPE::%FUNCTION_NAME(%1, %2, %3, &amp;pid);\n        %PYARG_0 = PyTuple_New(2);\n        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval));\n        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[qint64](pid));\n        </inject-code>\n    </modify-function>\n    <!-- Function removed because on windows it returns a win32 specific structure -->\n    <modify-function signature=\"pid()const\" remove=\"all\" />\n    <add-function signature=\"pid()\" return-type=\"long\">\n        <inject-code>\n            long result;\n            #ifdef WIN32\n                _PROCESS_INFORMATION* procInfo = %CPPSELF.%FUNCTION_NAME();\n                result = procInfo ? procInfo->dwProcessId : 0;\n            #else\n                result = %CPPSELF.%FUNCTION_NAME();\n            #endif\n            %PYARG_0 = %CONVERTTOPYTHON[long](result);\n        </inject-code>\n    </add-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"setReadChannelMode(QProcess::ProcessChannelMode)\" remove=\"all\"/>\n    <modify-function signature=\"readChannelMode()const\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n  <object-type name=\"QSignalMapper\" />\n\n  <object-type name=\"QCoreApplication\">\n    <enum-type name=\"Encoding\" />\n    <enum-type identified-by-value=\"ApplicationFlags\" since=\"4.8\" revision=\"4800\"/>\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QTranslator\" location=\"global\"/>\n    </extra-includes>\n    <!-- constructor documentation -->\n    <inject-documentation format=\"target\" mode=\"append\">\n.. class:: QCoreApplication(args)\n\n    Constructs a Qt kernel application. Kernel applications are applications\n    without a graphical user interface. These type of applications are used\n    at the console or as server processes.\n\n    The *args* argument is processed by the application, and made available\n    in a more convenient form by the :meth:`~QCoreApplication.arguments()`\n    method.\n    </inject-documentation>\n    <add-function signature=\"QCoreApplication(PySequence)\">\n        <inject-code>\n            QCoreApplication_constructor(%PYSELF, args, &amp;%0);\n        </inject-code>\n    </add-function>\n    <!-- blocking functions -->\n    <modify-function signature=\"processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;, int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"processEvents(QFlags&lt;QEventLoop::ProcessEventsFlag&gt;)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"flush()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"sendEvent(QObject*, QEvent*)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"sendPostedEvents(QObject*, int)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"sendPostedEvents()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"instance()\">\n      <inject-code class=\"target\">\n        QCoreApplication* app = QCoreApplication::instance();\n        PyObject* pyApp = Py_None;\n        if (app) {\n            pyApp = reinterpret_cast&lt;PyObject*&gt;(Shiboken::BindingManager::instance().retrieveWrapper(app));\n            if (!pyApp)\n                pyApp = %CONVERTTOPYTHON[QCoreApplication*](app); // this will keep app live after python exit (extra ref)\n        }\n        %PYARG_0 = pyApp;\n        Py_XINCREF(%PYARG_0);\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\"/>\n    <!-- ### Obsolete -->\n    <modify-function signature=\"argc()\" remove=\"all\"/>\n    <modify-function signature=\"argv()\" remove=\"all\"/>\n    <!-- ### -->\n    <modify-function signature=\"notify(QObject*,QEvent*)\" allow-thread=\"yes\">\n      <modify-argument index=\"2\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"QCoreApplication(int &amp;, char  **)\" access=\"private\"/>\n    <inject-code class=\"native\" file=\"glue/qcoreapplication_init.cpp\" position=\"beginning\" />\n    <modify-function signature=\"postEvent(QObject*,QEvent*)\">\n      <modify-argument index=\"2\">\n        <define-ownership owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"postEvent(QObject*,QEvent*, int)\">\n      <modify-argument index=\"2\">\n        <define-ownership owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"winEventFilter(MSG*, long*)\">\n      <modify-argument index=\"2\">\n        <remove-argument />\n        <conversion-rule class=\"native\">\n            long *%out = new long;\n            %out = 0;\n        </conversion-rule>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"PyObject\"/>\n        <conversion-rule class=\"native\">\n            %RETURN_TYPE %out = false;\n            if (PySequence_Check(%PYARG_0) &amp;&amp; (PySequence_Size(%PYARG_0) == 2)) {\n                Shiboken::AutoDecRef pyResult(PySequence_GetItem(%PYARG_0, 0));\n                %out = %CONVERTTOCPP[bool](pyResult);\n            }\n        </conversion-rule>\n      </modify-argument>\n      <inject-code position=\"end\">\n      %PYARG_0 = PyTuple_New(2);\n      PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));\n      PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[long](*result_out));\n      delete result_out;\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QSettings\">\n    <enum-type name=\"Format\"/>\n    <enum-type name=\"Scope\"/>\n    <enum-type name=\"Status\"/>\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n    </extra-includes>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"setSystemIniPath(const QString&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"setUserIniPath(const QString&amp;)\" remove=\"all\"/>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"iniCodec()const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"value(const QString&amp;, const QVariant&amp;)const\">\n        <inject-documentation mode=\"append\" format=\"target\">\n            .. warning:: QSettings.value can return different types (QVariant types) depending on the platform it's running on, so the safest way to use it is always casting the result to the desired type, e.g.: int(settings.value(\"myKey\"))\n        </inject-documentation>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QEvent\"  polymorphic-id-expression=\"%1-&gt;type() == QEvent::None\">\n    <enum-type name=\"Type\" extensible=\"yes\" />\n  </object-type>\n  <object-type name=\"QChildEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::ChildAdded || %1-&gt;type() == QEvent::ChildPolished || %1-&gt;type() == QEvent::ChildRemoved\">\n    <modify-field name=\"c\" read=\"false\" write=\"false\"/>\n    <modify-function signature=\"child() const\">\n      <modify-argument index=\"return\">\n         <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTimerEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Timer\" />\n  <object-type name=\"QDynamicPropertyChangeEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::DynamicPropertyChange\" />\n\n  <template name=\"stream_read_method\">\n      %RETURN_TYPE _cpp_result;\n      (*%CPPSELF) &gt;&gt; _cpp_result;\n      %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](_cpp_result);\n  </template>\n\n  <template name=\"stream_write_method\">\n      (*%CPPSELF) &lt;&lt; %1;\n  </template>\n\n  <object-type name=\"QDataStream\" stream=\"yes\">\n    <enum-type name=\"FloatingPointPrecision\" since=\"4.6\"/>\n    <enum-type name=\"Status\"/>\n    <enum-type name=\"Version\"/>\n    <enum-type name=\"ByteOrder\"/>\n    <extra-includes>\n      <include file-name=\"QtCore/QtCore\" location=\"global\"/>\n    </extra-includes>\n\n    <modify-function signature=\"setDevice(QIODevice*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <!-- ### Replaced by write<TYPE> methods -->\n    <modify-function signature=\"operator&gt;&gt;(qint8&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(bool&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(quint8&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(qint16&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(quint16&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(qint32&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(quint32&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(qint64&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(quint64&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(float&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(double&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(char*&amp;)\" remove=\"all\"/>\n    <!-- ### -->\n\n    <!-- ### Replaced by read<TYPE> methods -->\n    <modify-function signature=\"operator&lt;&lt;(qint8)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(bool)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(quint8)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(qint16)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(quint16)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(qint32)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(quint32)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(qint64)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(quint64)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(float)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(double)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(const char*)\" remove=\"all\"/>\n    <!-- ### -->\n    <add-function signature=\"operator&lt;&lt;(const QString&amp;)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeQString(const QString&amp;)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readQString()\" return-type=\"QString\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeQChar(const QChar&amp;)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readQChar()\" return-type=\"QChar\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeQStringList(const QStringList&amp;)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readQStringList()\" return-type=\"QStringList\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeQVariant(const QVariant&amp;)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readQVariant()\" return-type=\"QVariant\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"readRawData(char*,int)\">\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code class=\"target\">\n            QByteArray data;\n            data.resize(%2);\n            int result = %CPPSELF.%FUNCTION_NAME(data.data(), data.size());\n            if (result == -1) {\n                Py_INCREF(Py_None);\n                %PYARG_0 = Py_None;\n            } else {\n                %PYARG_0 = PyBytes_FromStringAndSize(data.data(), result);\n            }\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"writeRawData(const char*,int)\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code class=\"target\">\n            int r = %CPPSELF.%FUNCTION_NAME(%1, Shiboken::String::len(%PYARG_1));\n            %PYARG_0 = %CONVERTTOPYTHON[int](r);\n        </inject-code>\n    </modify-function>\n\n    <!-- Extra functions for primitive type handling -->\n    <add-function signature=\"readBool()\" return-type=\"bool\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readInt8()\" return-type=\"qint8\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readUInt8()\" return-type=\"quint8\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readUInt16()\" return-type=\"quint16\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readInt16()\" return-type=\"qint16\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readInt32()\" return-type=\"qint32\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readUInt32()\" return-type=\"quint32\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readInt64()\" return-type=\"qint64\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readUInt64()\" return-type=\"quint64\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readFloat()\" return-type=\"float\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readDouble()\" return-type=\"qreal\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"readString()\" return-type=\"QString\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_read_method\"/>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"writeBool(bool)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeInt8(qint8)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeUInt8(quint8)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeUInt16(quint16)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeInt16(qint16)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeInt32(qint32)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeUInt32(quint32)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeInt64(qint64)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeUInt64(quint64)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeFloat(float)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeDouble(qreal)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"writeString(QString)\">\n        <inject-code class=\"target\" position=\"end\">\n            <insert-template name=\"stream_write_method\"/>\n        </inject-code>\n    </add-function>\n\n    <!-- ### deprecated method -->\n    <modify-function signature=\"readBytes(char*&amp;,uint&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"writeBytes(const char*,uint)\" remove=\"all\" />\n  </object-type>\n  <object-type name=\"QFSFileEngine\">\n    <extra-includes>\n      <include file-name=\"QDateTime\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <value-type name=\"QTextStreamManipulator\" default-constructor=\"QTextStreamManipulator(0, 0)\">\n    <modify-function signature=\"exec(QTextStream &amp;)\" rename=\"exec_\"/>\n  </value-type>\n  <object-type name=\"QTextStream\" stream=\"yes\">\n    <enum-type name=\"FieldAlignment\"/>\n    <enum-type name=\"NumberFlag\" flags=\"NumberFlags\"/>\n    <enum-type name=\"RealNumberNotation\"/>\n    <enum-type name=\"Status\"/>\n    <!-- Removed because it expect QString to be mutable -->\n    <modify-function signature=\"QTextStream(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)\" remove=\"all\"/>\n    <!-- Removed because we use the non-const version -->\n    <modify-function signature=\"QTextStream(const QByteArray&amp;, QFlags&lt;QIODevice::OpenModeFlag&gt;)\" remove=\"all\"/>\n\n    <!-- Removed because it expect QString to be mutable -->\n    <modify-function signature=\"setString(QString*,QFlags&lt;QIODevice::OpenModeFlag&gt;)\" remove=\"all\"/>\n\n    <modify-function signature=\"operator&lt;&lt;(const void*)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(float)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(qlonglong)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(qulonglong)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(signed short)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(signed int)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(QBool)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(unsigned int)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(unsigned short)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(const char*)\" remove=\"all\"/>\n\n    <modify-function signature=\"operator&gt;&gt;(char*)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(char&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(float&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(double&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(qlonglong&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(qulonglong&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(signed long&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(signed int&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(signed short&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(unsigned long&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(unsigned int&amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&gt;&gt;(unsigned short&amp;)\" remove=\"all\"/>\n    <!-- Removed because it expect QChar to be mutable -->\n    <modify-function signature=\"operator&gt;&gt;(QChar&amp;)\" remove=\"all\"/>\n    <!-- Removed because it expect QString to be mutable -->\n    <modify-function signature=\"operator&gt;&gt;(QString&amp;)\" remove=\"all\"/>\n\n    <modify-function signature=\"string()const\">\n      <modify-argument index=\"return\">\n        <!--<replace-type modified-type=\"QString\" />-->\n        <conversion-rule class=\"target\">\n        QString&amp; res = *%0;\n        %PYARG_0 = %CONVERTTOPYTHON[QString](res);\n        </conversion-rule>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"flush()\" allow-thread=\"yes\"/>\n    <modify-function signature=\"read(qint64)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"readLine(qint64)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"readAll()\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QSystemSemaphore\">\n    <enum-type name=\"AccessMode\"/>\n    <enum-type name=\"SystemSemaphoreError\"/>\n  </object-type>\n  <namespace-type name=\"QtConcurrent\" target-type=\"class\">\n    <enum-type name=\"ReduceOption\" flags=\"ReduceOptions\"/>\n    <extra-includes>\n      <include file-name=\"qtconcurrentreducekernel.h\" location=\"global\"/>\n      <include file-name=\"qtconcurrentthreadengine.h\" location=\"global\"/>\n    </extra-includes>\n  </namespace-type>\n  <object-type name=\"QThreadPool\">\n    <modify-function signature=\"start(QRunnable*, int)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"tryStart(QRunnable*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"globalInstance()\" >\n      <inject-code position=\"end\">\n        Shiboken::Object::releaseOwnership(%PYARG_0);\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <value-type name=\"QXmlStreamAttribute\"/>\n  <value-type name=\"QXmlStreamAttributes\">\n    <modify-function signature=\"push_back(QXmlStreamAttribute)\" remove=\"all\"/>\n    <modify-function signature=\"pop_back()\" remove=\"all\"/>\n    <modify-function signature=\"push_front(QXmlStreamAttribute)\" remove=\"all\"/>\n    <modify-function signature=\"pop_front()\" remove=\"all\"/>\n    <modify-function signature=\"toList() const\" remove=\"all\"/>\n    <modify-function signature=\"fromList(const QList&lt;QXmlStreamAttribute&gt; &amp;)\" remove=\"all\"/>\n    <modify-function signature=\"operator+=(QVector&lt;QXmlStreamAttribute&gt;)\" remove=\"all\" />\n  </value-type>\n  <value-type name=\"QXmlStreamNamespaceDeclaration\"/>\n  <value-type name=\"QXmlStreamNotationDeclaration\"/>\n  <value-type name=\"QXmlStreamEntityDeclaration\"/>\n  <object-type name=\"QXmlStreamReader\">\n    <enum-type name=\"Error\"/>\n    <enum-type name=\"TokenType\"/>\n    <enum-type name=\"ReadElementTextBehaviour\" since=\"4.6\"/>\n  </object-type>\n  <object-type name=\"QXmlStreamWriter\">\n    <!-- Removed because it expect QString to be mutable -->\n    <modify-function signature=\"QXmlStreamWriter(QString *)\" remove=\"all\" />\n    <modify-function signature=\"codec()const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <value-type name=\"QModelIndex\" hash-function=\"qHash\">\n    <modify-function signature=\"internalPointer()const\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"return_internal_pointer\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"model()const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </value-type>\n\n  <value-type name=\"QGenericArgument\">\n    <include file-name=\"qobjectdefs.h\" location=\"global\" />\n  </value-type>\n\n  <value-type name=\"QGenericReturnArgument\">\n    <include file-name=\"qobjectdefs.h\" location=\"global\" />\n  </value-type>\n\n  <value-type name=\"QMetaMethod\">\n    <enum-type name=\"Access\"/>\n    <enum-type name=\"MethodType\"/>\n    <!-- This isn't part of Qt public API -->\n    <modify-function signature=\"attributes()const\" remove=\"all\" />\n  </value-type>\n  <object-type name=\"QMetaObject\">\n    <enum-type name=\"Call\"/>\n    <include file-name=\"qobjectdefs.h\" location=\"global\" />\n    <!-- This isn't part of Qt public API -->\n    <modify-function signature=\"connect(const QObject*, int, const QObject*, int, int, int*)\" remove=\"all\" />\n  </object-type>\n  <value-type name=\"QMetaProperty\" >\n    <!-- This isn't part of Qt public API -->\n    <modify-function signature=\"enclosingMetaObject()const\" remove=\"all\" />\n  </value-type>\n  <value-type name=\"QMetaClassInfo\">\n    <!-- This isn't part of Qt public API -->\n    <modify-function signature=\"enclosingMetaObject()const\" remove=\"all\" />\n  </value-type>\n  <value-type name=\"QMetaEnum\">\n    <!-- This isn't part of Qt public API -->\n    <modify-function signature=\"enclosingMetaObject()const\" remove=\"all\" />\n  </value-type>\n  <!-- From Qt4.6 -->\n  <object-type name=\"QAbstractAnimation\" since=\"4.6\">\n    <enum-type name=\"DeletionPolicy\"/>\n    <enum-type name=\"Direction\"/>\n    <enum-type name=\"State\"/>\n  </object-type>\n\n  <object-type name=\"QAbstractState\" since=\"4.6\">\n    <modify-function signature=\"machine() const\">\n        <modify-argument index=\"this\">\n            <parent index=\"return\" action=\"add\"/>\n        </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QAbstractTransition\" since=\"4.6\">\n    <modify-function signature=\"QAbstractTransition(QState*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"addAnimation(QAbstractAnimation*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"removeAnimation(QAbstractAnimation*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setTargetState(QAbstractState*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"targetState() const\">\n      <modify-argument index=\"return\">\n        <reference-count action=\"set\" variable-name=\"setTargetState(QAbstractState*)1\" />\n      </modify-argument>\n    </modify-function>\n\n\n    <modify-function signature=\"targetStates() const\">\n      <modify-argument index=\"return\">\n        <reference-count action=\"set\" variable-name=\"setTargetState(QAbstractState*)1\" />\n      </modify-argument>\n    </modify-function>\n\n\n    <modify-function signature=\"setTargetStates(QList&lt;QAbstractState*&gt;)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\" variable-name=\"setTargetState(QAbstractState*)1\" />\n      </modify-argument>\n    </modify-function>\n\n  </object-type>\n\n  <object-type name=\"QAnimationGroup\" since=\"4.6\">\n    <modify-function signature=\"addAnimation(QAbstractAnimation*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"insertAnimation(int, QAbstractAnimation*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"removeAnimation(QAbstractAnimation*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"takeAnimation(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"clear()\" >\n        <inject-code class=\"target\" position=\"beginning\">\n        for(int counter = 0; counter &lt; %CPPSELF.animationCount(); ++counter ) {\n            QAbstractAnimation* animation = %CPPSELF.animationAt(counter);\n            PyObject* obj = %CONVERTTOPYTHON[QAbstractAnimation*](animation);\n            Shiboken::Object::setParent(NULL, obj);\n            Py_DECREF(obj);\n        }\n        %CPPSELF.clear();\n        </inject-code>\n    </modify-function>\n  </object-type>\n\n  <!-- We will use inject code to implement the function below -->\n  <rejection class=\"QEasingCurve\" function-name=\"setCustomType\" />\n  <rejection class=\"QEasingCurve\" function-name=\"customType\" />\n  <value-type name=\"QEasingCurve\" since=\"4.6\">\n    <extra-includes>\n      <include file-name=\"pysideweakref.h\" location=\"global\"/>\n      <include file-name=\"glue/qeasingcurve_glue.h\" location=\"local\"/>\n    </extra-includes>\n    <inject-code>\n        PySideEasingCurveFunctor::init();\n    </inject-code>\n    <enum-type name=\"Type\" />\n    <add-function signature=\"setCustomType(PyObject*)\">\n      <inject-code>\n        QEasingCurve::EasingFunction func = PySideEasingCurveFunctor::createCustomFuntion(%PYSELF, %PYARG_1);\n        if (func)\n            %CPPSELF.%FUNCTION_NAME(func);\n      </inject-code>\n    </add-function>\n    <add-function signature=\"customType()\" return-type=\"PyObject\">\n      <inject-code>\n        //%FUNCTION_NAME()\n        %PYARG_0 = PySideEasingCurveFunctor::callable(%PYSELF);\n      </inject-code>\n    </add-function>\n  </value-type>\n\n  <object-type name=\"QEventTransition\" since=\"4.6\">\n    <modify-function signature=\"QEventTransition(QState*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"QEventTransition(QObject*, QEvent::Type, QState*)\">\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n  </object-type>\n\n  <object-type name=\"QFinalState\" since=\"4.6\" />\n\n  <object-type name=\"QHistoryState\" since=\"4.6\">\n    <enum-type name=\"HistoryType\" />\n    <modify-documentation xpath='description/code'>\n        &lt;code>machine = QStateMachine()\n\ns1 = new QState()\ns11 = new QState(s1)\ns12 = new QState(s1)\n\ns1h = QHistoryState(s1)\ns1h.setDefaultState(s11)\n\nmachine.addState(s1)\n\ns2 = QState()\nmachine.addState(s2)\n\nbutton = QPushButton()\n# Clicking the button will cause the state machine to enter the child state\n# that s1 was in the last time s1 was exited, or the history state's default\n# state if s1 has never been entered.\ns1.addTransition(button.clicked, s1h)&lt;/code>\n    </modify-documentation>\n  </object-type>\n\n  <value-type name=\"QMargins\" since=\"4.6\"/>\n\n  <object-type name=\"QParallelAnimationGroup\" since=\"4.6\"/>\n\n  <object-type name=\"QPauseAnimation\" since=\"4.6\"/>\n\n  <value-type name=\"QProcessEnvironment\" since=\"4.6\"/>\n\n  <object-type name=\"QPropertyAnimation\" since=\"4.6\"/>\n\n  <object-type name=\"QSequentialAnimationGroup\" since=\"4.6\"/>\n\n  <object-type name=\"QSignalTransition\" since=\"4.6\">\n    <add-function signature=\"QSignalTransition(PyObject*, QState*)\" return-type=\"QSignalTransition*\">\n        <modify-argument index=\"2\">\n            <replace-default-expression with=\"0\" />\n        </modify-argument>\n        <inject-code>\n            if (PyObject_TypeCheck(%1, &amp;PySideSignalInstanceType)) {\n                PyObject* dataSource = PySide::Signal::getObject((PySideSignalInstance*) %PYARG_1);\n                Shiboken::AutoDecRef obType(PyObject_Type(dataSource));\n                QObject* sender = %CONVERTTOCPP[QObject*](dataSource);\n                if (sender) {\n                    const char* dataSignature = PySide::Signal::getSignature((PySideSignalInstance*) %PYARG_1);\n                    QByteArray signature(dataSignature); // Append SIGNAL flag (2)\n                    %0 = new QSignalTransitionWrapper(sender, \"2\" + signature, %2);\n                }\n            }\n        </inject-code>\n    </add-function>\n  </object-type>\n\n  <object-type name=\"QState\" since=\"4.6\">\n    <enum-type name=\"ChildMode\"/>\n    <modify-function signature=\"addTransition(QAbstractTransition*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"addTransition(QObject*, const char*, QAbstractState*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n      QString signalName(%2);\n      if (PySide::SignalManager::registerMetaMethod(%1, signalName.mid(1).toAscii().data(), QMetaMethod::Signal)) {\n          QSignalTransition* %0 = %CPPSELF->addTransition(%1, %2, %3);\n          %PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%0);\n      } else {\n          Py_INCREF(Py_None);\n          %PYARG_0 = Py_None;\n      }\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addTransition(QAbstractState*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <!-- FIXME: the proper signature for this added function would be something like\n         addTransition(PySide.QtCore.Signal, QAbstractState*)\n         but that depends on bug #362. -->\n    <add-function signature=\"addTransition(PyObject*, QAbstractState*)\" return-type=\"QSignalTransition*\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n      // Obviously the label used by the following goto is a very awkward solution,\n      // since it refers to a name very tied to the generator implementation.\n      // Check bug #362 for more information on this\n      // http://bugs.openbossa.org/show_bug.cgi?id=362\n      if (!PyObject_TypeCheck(%1, &amp;PySideSignalInstanceType))\n          goto Sbk_%TYPEFunc_%FUNCTION_NAME_TypeError;\n      PySideSignalInstance* signalInstance = reinterpret_cast&lt;PySideSignalInstance*&gt;(%1);\n      QObject* sender = %CONVERTTOCPP[QObject*](PySide::Signal::getObject(signalInstance));\n      QSignalTransition* %0 = %CPPSELF->%FUNCTION_NAME(sender, PySide::Signal::getSignature(signalInstance), %2);\n      %PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%0);\n      </inject-code>\n    </add-function>\n\n    <modify-function signature=\"removeTransition(QAbstractTransition*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QStateMachine\" since=\"4.6\">\n    <enum-type name=\"Error\"/>\n    <enum-type name=\"EventPriority\"/>\n    <enum-type name=\"RestorePolicy\"/>\n\n    <value-type name=\"SignalEvent\" since=\"4.6\"/>\n    <value-type name=\"WrappedEvent\" since=\"4.6\"/>\n\n    <modify-function signature=\"addState(QAbstractState *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeState(QAbstractState *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n\n    <add-function signature=\"configuration()\" return-type=\"list of QAbstractState\" >\n        <inject-code class=\"target\" position=\"beginning\">\n            %PYARG_0 = PySet_New(0);\n            foreach(QAbstractState* abs_state, %CPPSELF.configuration()) {\n                    Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState*](abs_state));\n                    Shiboken::Object::setParent(self, obj);\n                    PySet_Add(%PYARG_0, obj);\n            }\n        </inject-code>\n    </add-function>\n\n    <!-- Replaced by a added function -->\n    <modify-function signature=\"defaultAnimations() const\" remove=\"all\"/>\n    <add-function signature=\"defaultAnimations()\" return-type=\"list of QAbstractAnimation\" >\n        <inject-code class=\"target\" position=\"beginning\">\n            %PYARG_0 = PyList_New(0);\n            foreach(QAbstractAnimation* abs_anim, %CPPSELF.defaultAnimations()) {\n                    Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation*](abs_anim));\n                    Shiboken::Object::setParent(self, obj);\n                    PyList_Append(%PYARG_0, obj);\n            }\n        </inject-code>\n    </add-function>\n  </object-type>\n\n  <object-type name=\"QVariantAnimation\" since=\"4.6\"/>\n\n  <!-- From Qt4.6 ^^^ -->\n\n  <add-function signature=\"SIGNAL(const char*)\" return-type=\"str\">\n    <inject-code class=\"target\" position=\"beginning\">\n      %PYARG_0 = Shiboken::String::fromFormat(\"2%s\", QMetaObject::normalizedSignature(%1).constData());\n    </inject-code>\n  </add-function>\n\n  <add-function signature=\"SLOT(const char*)\" return-type=\"str\">\n    <inject-code class=\"target\" position=\"beginning\">\n      %PYARG_0 = Shiboken::String::fromFormat(\"1%s\", QMetaObject::normalizedSignature(%1).constData());\n    </inject-code>\n  </add-function>\n\n  <add-function signature=\"QT_TR_NOOP(PyObject)\" return-type=\"PyObject*\">\n    <inject-code class=\"target\" position=\"beginning\">\n      <insert-template name=\"return_argument\"><replace from=\"#\" to=\"1\" /></insert-template>\n    </inject-code>\n  </add-function>\n  <add-function signature=\"QT_TR_NOOP_UTF8(PyObject)\" return-type=\"PyObject*\">\n    <inject-code class=\"target\" position=\"beginning\">\n      <insert-template name=\"return_argument\"><replace from=\"#\" to=\"1\" /></insert-template>\n    </inject-code>\n  </add-function>\n  <add-function signature=\"QT_TRANSLATE_NOOP(PyObject, PyObject)\" return-type=\"PyObject*\">\n    <inject-code class=\"target\" position=\"beginning\">\n      <insert-template name=\"return_argument\"><replace from=\"#\" to=\"2\" /></insert-template>\n    </inject-code>\n  </add-function>\n  <add-function signature=\"QT_TRANSLATE_NOOP3(PyObject, PyObject, PyObject)\" return-type=\"PyObject*\">\n    <inject-code class=\"target\" position=\"beginning\">\n      <insert-template name=\"return_argument\"><replace from=\"#\" to=\"2\" /></insert-template>\n    </inject-code>\n  </add-function>\n  <add-function signature=\"QT_TRANSLATE_NOOP_UTF8(PyObject)\" return-type=\"PyObject*\">\n    <inject-code class=\"target\" position=\"beginning\">\n      <insert-template name=\"return_argument\"><replace from=\"#\" to=\"1\" /></insert-template>\n    </inject-code>\n  </add-function>\n\n  <inject-code class=\"native\" position=\"beginning\">\n    extern bool\n    qRegisterResourceData(int,\n                        const unsigned char *,\n                        const unsigned char *,\n                        const unsigned char *);\n\n    extern bool\n    qUnregisterResourceData(int,\n                            const unsigned char *,\n                            const unsigned char *,\n                            const unsigned char *);\n  </inject-code>\n  <add-function signature=\"qRegisterResourceData(int, PyBytes, PyBytes, PyBytes)\" return-type=\"bool\">\n    <inject-code class=\"target\" position=\"beginning\">\n        %RETURN_TYPE %0 = %FUNCTION_NAME(%1, (uchar*)PyBytes_AS_STRING(%PYARG_2),\n                                             (uchar*)PyBytes_AS_STRING(%PYARG_3),\n                                             (uchar*)PyBytes_AS_STRING(%PYARG_4));\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n    </inject-code>\n  </add-function>\n  <add-function signature=\"qUnregisterResourceData(int, PyBytes, PyBytes, PyBytes)\" return-type=\"bool\">\n    <inject-code class=\"target\" position=\"beginning\">\n        %RETURN_TYPE %0 = %FUNCTION_NAME(%1, (uchar*)PyBytes_AS_STRING(%PYARG_2),\n                                             (uchar*)PyBytes_AS_STRING(%PYARG_3),\n                                             (uchar*)PyBytes_AS_STRING(%PYARG_4));\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n    </inject-code>\n  </add-function>\n\n  <object-type name=\"QFactoryInterface\"/>\n  <object-type name=\"QRunnable\"/>\n\n  <object-type name=\"QPluginLoader\"/>\n\n  <suppress-warning text=\"Unable to decide type of property: 'QLibrary::LoadHints' in class 'QPluginLoader'\" />\n  <suppress-warning text=\"enum '_ISalnum' does not have a type entry or is not an enum\" />\n  <suppress-warning text=\"enum 'Qt::Initialization' does not have a type entry or is not an enum\" />\n  <suppress-warning text=\"visibility of function '*' modified in class '*'\"/>\n  <suppress-warning text=\"hiding of function '*' in class '*'\"/>\n  <suppress-warning text=\"namespace '*' does not have a type entry\"/>\n  <suppress-warning text=\"Shadowing: QObject::parent() const and QAbstractItemModel::parent() const\"/>\n  <suppress-warning text=\"namespace '*' for enum 'QtMsgType' is not declared\"/>\n  <suppress-warning text=\"horribly broken type 'imaxdiv_t'\"/>\n  <suppress-warning text=\"horribly broken type '__off64_t'\"/>\n  <suppress-warning text=\"horribly broken type 'div_t'\"/>\n  <suppress-warning text=\"horribly broken type 'fd_set*'\"/>\n  <suppress-warning text=\"horribly broken type 'ldiv_t'\"/>\n  <suppress-warning text=\"horribly broken type 'lldiv_t'\"/>\n  <suppress-warning text=\"signal '*' in class '*' is overloaded.\"/>\n  <suppress-warning text=\"enum 'enum_3' does not have a type entry or is not an enum\"/>\n  <suppress-warning text=\"Shadowing: QFile::fileName() const and QTemporaryFile::fileName() const\"/>\n  <suppress-warning text=\"unhandled enum value: ~0u in Qt::GestureType\"/>\n  <suppress-warning text=\"unhandled enum value: (sizeof(void*)&lt;&lt;3) in QSysInfo::Sizes\"/>\n  <suppress-warning text=\"unmatched enum ~0u\"/>\n  <suppress-warning text=\"unmatched enum (sizeof(void*)&lt;&lt;3)\"/>\n  <suppress-warning text=\"signature 'setCustomType(float)' for function modification in 'QEasingCurve' not found. Possible candidates: setCustomType(double) in QEasingCurve\"/>\n  <suppress-warning text=\"enum 'enum_4' does not have a type entry or is not an enum\" />\n  <suppress-warning text=\"enum 'enum_5' does not have a type entry or is not an enum\" />\n  <suppress-warning text=\"enum 'FP_NORMAL' does not have a type entry or is not an enum\" />\n  <suppress-warning text=\"Shadowing: *\" />\n  <!-- this enum is defined on Qt global header but only used in QtDeclarative module -->\n  <suppress-warning text=\"enum 'QML_HAS_ATTACHED_PROPERTIES' does not have a type entry or is not an enum\" />\n\n  <!-- this enum is defined on Qt global header but only used in QtGui module -->\n  <suppress-warning text=\"enum 'PM_MessageBoxHeight' does not have a type entry or is not an enum\" />\n\n  <!-- this function only exists on Windows -->\n  <suppress-warning text=\"signature 'winEventFilter(MSG*,long*)' for function modification in 'QCoreApplication' not found. Possible candidates:*\"/>\n\n  <!-- this is necessary to avoid warning on other modules -->\n  <suppress-warning text=\"signature 'operator*(QByteArray,const char*)' for function modification in 'QByteArray' not found. Possible candidates: *\"/>\n  <suppress-warning text=\"signature 'operator+(QByteArray,QString)' for function modification in 'QByteArray' not found. Possible candidates: *\"/>\n\n  <!-- This enum is intenaly used -->\n  <suppress-warning text=\"enum 'PM_CbaIconHeight' does not have a type entry or is not an enum\" />\n\n  <!-- TODO: this need be removed -->\n  <suppress-warning text=\"skipping function '*', unmatched return type '*'\"/>\n  <suppress-warning text=\"skipping function '*', unmatched parameter type '*'\"/>\n\n\n</typesystem>\n"
  },
  {
    "path": "PySide/QtCore/typesystem_core_mac.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtCore\">\n  <primitive-type name=\"Qt::HANDLE\" target-lang-api-name=\"PyObject\" />\n</typesystem>\n"
  },
  {
    "path": "PySide/QtCore/typesystem_core_maemo.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtCore\">\n  <primitive-type name=\"Qt::HANDLE\" target-lang-api-name=\"PyLong\">\n    <!-- FIXME APIExtractor or shiboken do not support multiple includes by primitive type -->\n    <include file-name=\"QTextDocument\" location=\"global\"/>\n  </primitive-type>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtCore/typesystem_core_win.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtCore\">\n  <primitive-type name=\"Qt::HANDLE\" target-lang-api-name=\"PyObject\" />\n  <primitive-type name=\"HWND\">\n      <conversion-rule>\n        <native-to-target>\n        #ifdef IS_PY3K\n        return PyCapsule_New(%in, 0, 0);\n        #else\n        return PyCObject_FromVoidPtr(%in, 0);\n        #endif\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyNone\">\n            %out = 0;\n            </add-conversion>\n            <add-conversion check=\"checkPyCapsuleOrPyCObject(%in)\" type=\"PyObject\">\n            #ifdef IS_PY3K\n            %out = (%OUTTYPE)PyCapsule_GetPointer(%in, 0);\n            #else\n            %out = (%OUTTYPE)PyCObject_AsVoidPtr(%in);\n            #endif\n            </add-conversion>\n        </target-to-native>\n      </conversion-rule>\n  </primitive-type>\n  <inject-code class=\"native\" position=\"beginning\">\n    <insert-template name=\"checkPyCapsuleOrPyCObject_func\"/>\n  </inject-code>\n  <value-type name=\"POINT\">\n      <include file-name=\"wtypes.h\" location=\"global\"/>\n  </value-type>\n  <value-type name=\"MSG\">\n      <include file-name=\"wtypes.h\" location=\"global\"/>\n  </value-type>\n  <suppress-warning text=\"class 'MSG' inherits from unknown base class 'tagMSG'\"/>\n  <suppress-warning text=\"class not found for setup inheritance 'tagMSG'\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtCore/typesystem_core_x11.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtCore\">\n  <primitive-type name=\"Qt::HANDLE\" target-lang-api-name=\"PyLong\">\n    <!-- FIXME APIExtractor or shiboken do not support multiple includes by primitive type -->\n    <include file-name=\"QTextDocument\" location=\"global\"/>\n  </primitive-type>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtDeclarative/CMakeLists.txt",
    "content": "project(QtDeclarative)\n\nset(QtDeclarative_registerType \"${CMAKE_CURRENT_SOURCE_DIR}/pysideqmlregistertype.cpp\")\n\nset(QtDeclarative_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativecomponent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativecontext_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeengine_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeerror_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeexpression_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeextensioninterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeextensionplugin_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeimageprovider_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativelistreference_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativenetworkaccessmanagerfactory_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeparserstatus_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativepropertymap_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativepropertyvaluesource_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeproperty_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativescriptstring_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativeview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qtdeclarative_module_wrapper.cpp\n)\n\nset(QtDeclarative_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtDeclarative_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\n\nset(QtDeclarative_include_dirs  ${CMAKE_CURRENT_SOURCE_DIR}\n                            ${QT_QTCORE_INCLUDE_DIR}\n                            ${QT_QTGUI_INCLUDE_DIR}\n                            ${QT_QTNETWORK_INCLUDE_DIR}\n                            ${QT_QTDECLARATIVE_INCLUDE_DIR}\n                            ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                            ${SHIBOKEN_INCLUDE_DIR}\n                            ${libpyside_SOURCE_DIR}\n                            ${QtGui_BINARY_DIR}/PySide/QtGui/\n                            ${QtCore_BINARY_DIR}/PySide/QtCore/\n                            ${QtNetwork_BINARY_DIR}/PySide/QtNetwork/\n                            ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative)\n\nset(QtDeclarative_libraries   pyside\n                              ${SHIBOKEN_PYTHON_LIBRARIES}\n                              ${QT_QTCORE_LIBRARY}\n                              ${QT_QTGUI_LIBRARY}\n                              ${QT_QTNETWORK_LIBRARY}\n                              ${QT_QTSCRIPT_LIBRARY}\n                              ${QT_QTSVG_LIBRARY}\n                              ${QT_QTSQL_LIBRARY}\n                              ${QT_QTXMLPATTERNS_LIBRARY}\n                              ${QT_QTOPENGL_LIBRARY}\n                              ${QT_QTDECLARATIVE_LIBRARY})\n\nset(QtDeclarative_deps QtGui QtNetwork)\n\ncreate_pyside_module(QtDeclarative\n                     QtDeclarative_include_dirs\n                     QtDeclarative_libraries\n                     QtDeclarative_deps\n                     QtDeclarative_typesystem_path\n                     QtDeclarative_SRC\n                     QtDeclarative_registerType)\n\n"
  },
  {
    "path": "PySide/QtDeclarative/pysideqmlregistertype.cpp",
    "content": "/*\n * This file is part of the Shiboken Python Bindings Generator project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"pysideqmlregistertype.h\"\n// Qt\n#include <QObject>\n#include <QDeclarativeEngine>\n#include <QMutex>\n// shiboken\n#include <typeresolver.h>\n#include <gilstate.h>\n#include <sbkdbg.h>\n// pyside\n#include <pyside.h>\n#include <dynamicqmetaobject.h>\n#include <pysideproperty.h>\n\n// auto generated headers\n#include \"qdeclarativeitem_wrapper.h\"\n#include \"pyside_qtcore_python.h\"\n#include \"pyside_qtdeclarative_python.h\"\n\n#ifndef PYSIDE_MAX_QML_TYPES\n// Maximum number of different types the user cna export to QML using qmlRegisterType.\n#define PYSIDE_MAX_QML_TYPES 50\n#endif\n\n// Forward declarations\nstatic void propListMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Call call, void** args);\n\n\n// All registered python types\nstatic PyObject* pyTypes[PYSIDE_MAX_QML_TYPES];\nstatic void (*createFuncs[PYSIDE_MAX_QML_TYPES])(void*);\n\n// Mutex used to avoid race condition on PySide::nextQObjectMemoryAddr\nstatic QMutex nextQmlElementMutex;\n\ntemplate<int N>\nstruct ElementFactoryBase\n{\n    static void createInto(void* memory)\n    {\n        QMutexLocker locker(&nextQmlElementMutex);\n        PySide::setNextQObjectMemoryAddr(memory);\n        Shiboken::GilState state;\n        PyObject* obj = PyObject_CallObject(pyTypes[N], 0);\n        if (!obj || PyErr_Occurred())\n            PyErr_Print();\n        PySide::setNextQObjectMemoryAddr(0);\n    }\n};\n\ntemplate<int N>\nstruct ElementFactory : ElementFactoryBase<N>\n{\n    static void init()\n    {\n        createFuncs[N] = &ElementFactoryBase<N>::createInto;\n        ElementFactory<N-1>::init();\n    }\n};\n\ntemplate<>\nstruct  ElementFactory<0> : ElementFactoryBase<0>\n{\n    static void init()\n    {\n        createFuncs[0] = &ElementFactoryBase<0>::createInto;\n    }\n};\n\nint PySide::qmlRegisterType(PyObject* pyObj, const char* uri, int versionMajor, int versionMinor, const char* qmlName)\n{\n    using namespace Shiboken;\n\n    static PyTypeObject* qobjectType = Shiboken::Conversions::getPythonTypeObject(\"QObject*\");\n    static PyTypeObject* qdeclarativeType = Shiboken::Conversions::getPythonTypeObject(\"QDeclarativeItem*\");\n    assert(qobjectType);\n    static int nextType = 0;\n\n    if (nextType >= PYSIDE_MAX_QML_TYPES) {\n        PyErr_Format(PyExc_TypeError, \"QML doesn't really like language bindings, so you can only export %d types to QML.\", PYSIDE_MAX_QML_TYPES);\n        return -1;\n    }\n\n    if (!PySequence_Contains(((PyTypeObject*)pyObj)->tp_mro, (PyObject*)qobjectType)) {\n        PyErr_Format(PyExc_TypeError, \"A type inherited from %s expected, got %s.\", qobjectType->tp_name, ((PyTypeObject*)pyObj)->tp_name);\n        return -1;\n    }\n\n    bool isDeclarativeType = PySequence_Contains(((PyTypeObject*)pyObj)->tp_mro, (PyObject*)qdeclarativeType);\n\n    QMetaObject* metaObject = reinterpret_cast<QMetaObject*>(ObjectType::getTypeUserData(reinterpret_cast<SbkObjectType*>(pyObj)));\n    Q_ASSERT(metaObject);\n\n    // Inc ref the type object, don't worry about dec ref them because there's no way to unregister a QML type\n    Py_INCREF(pyObj);\n\n    // All ready... now the ugly code begins... :-)\n    pyTypes[nextType] = pyObj;\n\n    // Init proxy object static meta object\n    QDeclarativePrivate::RegisterType type;\n    type.version = 0;\n    if (isDeclarativeType) {\n        type.typeId = qMetaTypeId<QDeclarativeItem*>();\n        type.listId = qMetaTypeId<QDeclarativeListProperty<QDeclarativeItem> >();\n\n        type.attachedPropertiesFunction = QDeclarativePrivate::attachedPropertiesFunc<QDeclarativeItem>();\n        type.attachedPropertiesMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<QDeclarativeItem>();\n\n        type.parserStatusCast = QDeclarativePrivate::StaticCastSelector<QDeclarativeItem, QDeclarativeParserStatus>::cast();\n        type.valueSourceCast = QDeclarativePrivate::StaticCastSelector<QDeclarativeItem, QDeclarativePropertyValueSource>::cast();\n        type.valueInterceptorCast = QDeclarativePrivate::StaticCastSelector<QDeclarativeItem, QDeclarativePropertyValueInterceptor>::cast();\n    } else {\n        type.typeId = qMetaTypeId<QObject*>();\n        type.listId = qMetaTypeId<QDeclarativeListProperty<QObject> >();\n        type.attachedPropertiesFunction = QDeclarativePrivate::attachedPropertiesFunc<QObject>();\n        type.attachedPropertiesMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<QObject>();\n\n        type.parserStatusCast = QDeclarativePrivate::StaticCastSelector<QObject, QDeclarativeParserStatus>::cast();\n        type.valueSourceCast = QDeclarativePrivate::StaticCastSelector<QObject, QDeclarativePropertyValueSource>::cast();\n        type.valueInterceptorCast = QDeclarativePrivate::StaticCastSelector<QObject, QDeclarativePropertyValueInterceptor>::cast();\n    }\n    type.objectSize = PySide::getSizeOfQObject(reinterpret_cast<SbkObjectType*>(pyObj));\n    type.create = createFuncs[nextType];\n    type.uri = uri;\n    type.versionMajor = versionMajor;\n    type.versionMinor = versionMinor;\n    type.elementName = qmlName;\n    type.metaObject = metaObject;\n\n    type.extensionObjectCreate = 0;\n    type.extensionMetaObject = 0;\n    type.customParser = 0;\n\n    int qmlTypeId = QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);\n    ++nextType;\n    return qmlTypeId;\n}\n\nextern \"C\"\n{\n\n// This is the user data we store in the property.\nstruct DeclarativeListProperty\n{\n    PyTypeObject* type;\n    PyObject* append;\n    PyObject* at;\n    PyObject* clear;\n    PyObject* count;\n};\n\nstatic int propListTpInit(PyObject* self, PyObject* args, PyObject* kwds)\n{\n    static const char *kwlist[] = {\"type\", \"append\", \"at\", \"clear\", \"count\", 0};\n    PySideProperty* pySelf = reinterpret_cast<PySideProperty*>(self);\n    DeclarativeListProperty* data = new DeclarativeListProperty;\n    memset(data, 0, sizeof(DeclarativeListProperty));\n\n    if (!PyArg_ParseTupleAndKeywords(args, kwds,\n                                     \"OO|OOO:QtDeclarative.ListProperty\", (char**) kwlist,\n                                     &data->type,\n                                     &data->append,\n                                     &data->at,\n                                     &data->clear,\n                                     &data->count)) {\n        return 0;\n    }\n    PySide::Property::setMetaCallHandler(pySelf, &propListMetaCall);\n    PySide::Property::setTypeName(pySelf, \"QDeclarativeListProperty<QDeclarativeItem>\");\n    PySide::Property::setUserData(pySelf, data);\n\n    return 1;\n}\n\nvoid propListTpFree(void* self)\n{\n    PySideProperty* pySelf = reinterpret_cast<PySideProperty*>(self);\n    delete reinterpret_cast<DeclarativeListProperty*>(PySide::Property::userData(pySelf));\n    // calls base type constructor\n    Py_TYPE(pySelf)->tp_base->tp_free(self);\n}\n\nPyTypeObject PropertyListType = {\n    PyVarObject_HEAD_INIT(0, 0)\n    \"ListProperty\",            /*tp_name*/\n    sizeof(PySideProperty),    /*tp_basicsize*/\n    0,                         /*tp_itemsize*/\n    0,                         /*tp_dealloc*/\n    0,                         /*tp_print*/\n    0,                         /*tp_getattr*/\n    0,                         /*tp_setattr*/\n    0,                         /*tp_compare*/\n    0,                         /*tp_repr*/\n    0,                         /*tp_as_number*/\n    0,                         /*tp_as_sequence*/\n    0,                         /*tp_as_mapping*/\n    0,                         /*tp_hash */\n    0,                         /*tp_call*/\n    0,                         /*tp_str*/\n    0,                         /*tp_getattro*/\n    0,                         /*tp_setattro*/\n    0,                         /*tp_as_buffer*/\n    Py_TPFLAGS_DEFAULT,        /*tp_flags*/\n    0,                         /*tp_doc */\n    0,                         /*tp_traverse */\n    0,                         /*tp_clear */\n    0,                         /*tp_richcompare */\n    0,                         /*tp_weaklistoffset */\n    0,                         /*tp_iter */\n    0,                         /*tp_iternext */\n    0,                         /*tp_methods */\n    0,                         /*tp_members */\n    0,                         /*tp_getset */\n    &PySidePropertyType,       /*tp_base */\n    0,                         /*tp_dict */\n    0,                         /*tp_descr_get */\n    0,                         /*tp_descr_set */\n    0,                         /*tp_dictoffset */\n    propListTpInit,            /*tp_init */\n    0,                         /*tp_alloc */\n    0,                         /*tp_new */\n    propListTpFree,            /*tp_free */\n    0,                         /*tp_is_gc */\n    0,                         /*tp_bases */\n    0,                         /*tp_mro */\n    0,                         /*tp_cache */\n    0,                         /*tp_subclasses */\n    0,                         /*tp_weaklist */\n    0,                         /*tp_del */\n};\n\n} // extern \"C\"\n\n// Implementation of QDeclarativeListProperty<T>::AppendFunction callback\nvoid propListAppender(QDeclarativeListProperty<QDeclarativeItem>* propList, QDeclarativeItem* item)\n{\n    Shiboken::GilState state;\n\n    Shiboken::AutoDecRef args(PyTuple_New(2));\n    PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));\n    PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtDeclarativeTypes[SBK_QDECLARATIVEITEM_IDX], item));\n\n    DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);\n    Shiboken::AutoDecRef retVal(PyObject_CallObject(data->append, args));\n\n    if (PyErr_Occurred())\n        PyErr_Print();\n}\n\n// Implementation of QDeclarativeListProperty<T>::CountFunction callback\nint propListCount(QDeclarativeListProperty<QDeclarativeItem>* propList)\n{\n    Shiboken::GilState state;\n\n    Shiboken::AutoDecRef args(PyTuple_New(1));\n    PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));\n\n    DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);\n    Shiboken::AutoDecRef retVal(PyObject_CallObject(data->count, args));\n\n    // Check return type\n    int cppResult = 0;\n    PythonToCppFunc pythonToCpp;\n    if (PyErr_Occurred())\n        PyErr_Print();\n    else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<int>(), retVal)))\n        pythonToCpp(retVal, &cppResult);\n    return cppResult;\n}\n\n// Implementation of QDeclarativeListProperty<T>::AtFunction callback\nQDeclarativeItem* propListAt(QDeclarativeListProperty<QDeclarativeItem>* propList, int index)\n{\n    Shiboken::GilState state;\n\n    Shiboken::AutoDecRef args(PyTuple_New(2));\n    PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));\n    PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &index));\n\n    DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);\n    Shiboken::AutoDecRef retVal(PyObject_CallObject(data->at, args));\n\n    QDeclarativeItem* result = 0;\n    if (PyErr_Occurred())\n        PyErr_Print();\n    else if (PyType_IsSubtype(Py_TYPE(retVal), data->type))\n        Shiboken::Conversions::pythonToCppPointer((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QDECLARATIVEITEM_IDX], retVal, &result);\n    return result;\n}\n\n// Implementation of QDeclarativeListProperty<T>::ClearFunction callback\nvoid propListClear(QDeclarativeListProperty<QDeclarativeItem>* propList)\n{\n    Shiboken::GilState state;\n\n    Shiboken::AutoDecRef args(PyTuple_New(1));\n    PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));\n\n    DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);\n    Shiboken::AutoDecRef retVal(PyObject_CallObject(data->clear, args));\n\n    if (PyErr_Occurred())\n        PyErr_Print();\n}\n\n// qt_metacall specialization for ListProperties\nstatic void propListMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Call call, void** args)\n{\n    if (call != QMetaObject::ReadProperty)\n        return;\n\n    DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(PySide::Property::userData(pp));\n    QObject* qobj;\n    Shiboken::Conversions::pythonToCppPointer((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], self, &qobj);\n    QDeclarativeListProperty<QDeclarativeItem> declProp(qobj, data, &propListAppender);\n\n    if (data->count)\n        declProp.count = &propListCount;\n    if (data->at)\n        declProp.at = &propListAt;\n    if (data->clear)\n        declProp.clear = &propListClear;\n\n    // Copy the data to the memory location requested by the meta call\n    void* v = args[0];\n    *reinterpret_cast<QDeclarativeListProperty<QDeclarativeItem>*>(v) = declProp;\n}\n\n\nvoid PySide::initQmlSupport(PyObject* module)\n{\n    ElementFactory<PYSIDE_MAX_QML_TYPES - 1>::init();\n\n    // Export DeclarativeListProperty type\n    if (PyType_Ready(&PropertyListType) < 0)\n        return;\n\n    Py_INCREF((PyObject*)&PropertyListType);\n    PyModule_AddObject(module, PropertyListType.tp_name, (PyObject*)&PropertyListType);\n\n}\n\n\n"
  },
  {
    "path": "PySide/QtDeclarative/pysideqmlregistertype.h",
    "content": "/*\n * This file is part of the Shiboken Python Bindings Generator project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDEQMLREGISTERTYPE_H\n#define PYSIDEQMLREGISTERTYPE_H\n\n#include <Python.h>\n\nstruct SbkObjectType;\n\nnamespace PySide\n{\n\nextern void* nextQmlElementMemoryAddr;\n\n/**\n * Init the QML support doign things like registering QtDeclarative.ListProperty and create the necessary stuff for\n * qmlRegisterType.\n *\n * \\param module QtDeclarative python module\n */\nvoid initQmlSupport(PyObject* module);\n\n/**\n * PySide implementation of qmlRegisterType<T> function.\n *\n * \\param pyObj Python type to be registered.\n * \\param uri QML element uri.\n * \\param versionMajor QML component major version.\n * \\param versionMinor QML component minor version.\n * \\param qmlName QML element name\n * \\return the metatype id of the registered type.\n */\nint qmlRegisterType(PyObject* pyObj, const char* uri, int versionMajor, int versionMinor, const char* qmlName);\n\n}\n\n#endif\n"
  },
  {
    "path": "PySide/QtDeclarative/typesystem_declarative.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtDeclarative\">\n    <load-typesystem name=\"typesystem_core.xml\" generate=\"no\"/>\n    <load-typesystem name=\"typesystem_network.xml\" generate=\"no\"/>\n    <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\"/>\n\n    <add-function signature=\"qmlRegisterType(PyTypeObject, const char*, int, int, const char*)\" return-type=\"int\">\n        <inject-documentation format=\"target\" mode=\"append\">\n            This function registers the Python type in the QML system with the name qmlName, in the library imported from uri having the version number composed from versionMajor and versionMinor.\n            Returns the QML type id.\n\n            For example, this registers a Python class MySliderItem as a QML type named Slider for version 1.0 of a module called \"com.mycompany.qmlcomponents\":\n\n            ::\n\n                qmlRegisterType(MySliderItem, \"com.mycompany.qmlcomponents\", 1, 0, \"Slider\")\n\n            Once this is registered, the type can be used in QML by importing the specified module name and version number:\n\n            ::\n\n                import com.mycompany.qmlcomponents 1.0\n\n                Slider { ... }\n\n            Note that it's perfectly reasonable for a library to register types to older versions than the actual version of the library. Indeed, it is normal for the new library to allow QML written to previous versions to continue to work, even if more advanced versions of some of its types are available.\n        </inject-documentation>\n\n        <inject-code class=\"target\">\n        int %0 = PySide::qmlRegisterType(%ARGUMENT_NAMES);\n        %PYARG_0 = %CONVERTTOPYTHON[int](%0);\n        </inject-code>\n    </add-function>\n\n    <enum-type identified-by-value=\"QML_HAS_ATTACHED_PROPERTIES\" since=\"4.7\">\n        <extra-includes>\n            <include file-name=\"QtDeclarative\" location=\"global\"/>\n            <!-- FIXME The include tag doesn't work on modules -->\n            <include file-name=\"pysideqmlregistertype.h\" location=\"local\"/>\n        </extra-includes>\n    </enum-type>\n\n    <inject-code class=\"target\" position=\"end\">\n    PySide::initQmlSupport(module);\n    </inject-code>\n\n    <object-type name=\"QDeclarativeExtensionInterface\"/>\n    <object-type name=\"QDeclarativeComponent\">\n        <enum-type name=\"Status\"/>\n        <!-- This ctor isn't part of Qt public API -->\n        <modify-function signature=\"QDeclarativeComponent(QObject*)\" remove=\"all\" />\n    </object-type>\n    <object-type name=\"QDeclarativeContext\">\n      <modify-function signature=\"setContextProperty(const QString &amp;, QObject*)\">\n      <inject-code class=\"target\" position=\"end\">\n        QByteArray key(\"%FUNCTION_NAME_\");\n        key.append(%1.toLocal8Bit());\n        Shiboken::Object::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), key.constData(),  %PYARG_2);\n      </inject-code>\n      </modify-function>\n    </object-type>\n\n    <object-type name=\"QDeclarativeEngine\">\n        <enum-type name=\"ObjectOwnership\" />\n        <modify-function signature=\"QDeclarativeEngine(QObject*)\">\n            <modify-argument index=\"1\">\n                <rename to=\"parent\" /> <!-- Qt names this just p -->\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory*)\">\n            <modify-argument index=\"1\">\n                <parent index=\"this\" action=\"add\" />\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"importPlugin(QString,QString,QString*)\">\n            <modify-argument index=\"3\">\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(ok, errorString)\" />\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n            QString errorString;\n            %BEGIN_ALLOW_THREADS\n            %RETURN_TYPE ok_ = %CPPSELF.%FUNCTION_NAME(%1, %2, &amp;errorString);\n            %END_ALLOW_THREADS\n            %PYARG_0 = PyTuple_New(2);\n            PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](ok_));\n            PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QString](errorString));\n            </inject-code>\n        </modify-function>\n    </object-type>\n    <value-type name=\"QDeclarativeError\" />\n    <object-type name=\"QDeclarativeExpression\">\n        <modify-function signature=\"evaluate(bool*)\">\n            <modify-argument index=\"1\">\n                <remove-argument/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"fix_bool*\"/>\n            </inject-code>\n        </modify-function>\n    </object-type>\n    <object-type name=\"QDeclarativeExtensionPlugin\" />\n    <object-type name=\"QDeclarativeImageProvider\">\n        <enum-type name=\"ImageType\" />\n    </object-type>\n    <object-type name=\"QDeclarativeItem\">\n        <extra-includes>\n            <include file-name=\"pysideqmlregistertype.h\" location=\"local\"/>\n        </extra-includes>\n        <enum-type name=\"TransformOrigin\" />\n    </object-type>\n\n    <value-type name=\"QDeclarativeListReference\" />\n    <object-type name=\"QDeclarativeNetworkAccessManagerFactory\" >\n        <modify-function signature=\"create(QObject *)\">\n          <modify-argument index=\"return\">\n            <define-ownership class=\"target\" owner=\"c++\"/>\n          </modify-argument>\n        </modify-function>\n    </object-type>\n    <object-type name=\"QDeclarativeParserStatus\" />\n\n    <value-type name=\"QDeclarativeProperty\">\n        <enum-type name=\"PropertyTypeCategory\" />\n        <enum-type name=\"Type\" />\n    </value-type>\n\n    <object-type name=\"QDeclarativePropertyMap\">\n        <modify-documentation xpath=\"description/code[1]\">&lt;code># create our data\nownerData = QDeclarativePropertyMap()\nownerData.insert(&quot;name&quot;, &quot;John Smith&quot;)\nownerData.insert(&quot;phone&quot;, &quot;555-5555&quot;)\n\n# expose it to the UI layer\nview = QDeclarativeView()\nctxt = view.rootContext()\nctxt.setContextProperty(&quot;owner&quot;, ownerData)\n\nview.setSource(QUrl.fromLocalFile(&quot;main.qml&quot;))\nview.show()&lt;/code></modify-documentation>\n    </object-type>\n    <object-type name=\"QDeclarativePropertyValueSource\" />\n    <value-type name=\"QDeclarativeScriptString\" />\n    <object-type name=\"QDeclarativeView\">\n        <enum-type name=\"ResizeMode\" />\n        <enum-type name=\"Status\" />\n    </object-type>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtGui/CMakeLists.txt",
    "content": "project(QtGui)\n\nif(ENABLE_X11)\n    set(SPECIFIC_OS_FILES\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11info_wrapper.cpp\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11embedcontainer_wrapper.cpp\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11embedwidget_wrapper.cpp\n    )\n\n    if(Q_WS_MAEMO_5)\n        set(SPECIFIC_OS_FILES\n            ${SPECIFIC_OS_FILES}\n            ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractkineticscroller_wrapper.cpp\n        )\n    endif()\nendif()\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)\n    set(QtGui_46_SRC \"\")\nelse()\n    set(QtGui_46_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix2x2_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix2x3_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix2x4_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix3x2_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix3x3_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix3x4_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix4x2_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix4x3_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix4x4_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgesture_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgestureevent_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgesturerecognizer_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsanchor_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsanchorlayout_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsblureffect_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicscolorizeeffect_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsdropshadoweffect_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicseffect_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsobject_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsopacityeffect_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsrotation_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscale_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicstransform_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qkeyeventtransition_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmouseeventtransition_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpangesture_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpinchgesture_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qquaternion_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qswipegesture_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtapandholdgesture_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtapgesture_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtilerules_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtouchevent_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtouchevent_touchpoint_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvector2d_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvector3d_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvector4d_wrapper.cpp\n    )\nendif ()\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 7)\n    set(QtGui_47_SRC \"\")\nelse()\n    set(QtGui_47_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpainter_pixmapfragment_wrapper.cpp\n    )\nendif()\n\nset(QtGui_OPTIONAL_SRC )\nset(QtGui_DROPPED_ENTRIES )\ncheck_qt_class(QtGui QAbstractPageSetupDialog   QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QAbstractPrintDialog       QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QGtkStyle                  QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QPageSetupDialog           QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QPrintDialog               QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QPrintEngine               QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QPrintPreviewDialog        QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QPrintPreviewWidget        QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QPrinter                   QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QPrinterInfo               QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QSessionManager            QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QSizeGrip                  QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QSystemTrayIcon            QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\ncheck_qt_class(QtGui QMacStyle                  QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)\n\nqt4_wrap_cpp(QPYTEXTOBJECT_MOC \"${pyside_SOURCE_DIR}/qpytextobject.h\")\n\nset(QtGui_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractbutton_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractgraphicsshapeitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractitemdelegate_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractitemview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractproxymodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractscrollarea_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractslider_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstractspinbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstracttextdocumentlayout_paintcontext_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstracttextdocumentlayout_selection_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qabstracttextdocumentlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qaccessibleevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qactionevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qactiongroup_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qaction_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qapplication_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qbitmap_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qboxlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qbrush_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qbuttongroup_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcalendarwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcdestyle_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcheckbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcleanlooksstyle_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qclipboard_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qclipboardevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcloseevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcolordialog_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcolor_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcolumnview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcombobox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcommandlinkbutton_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcommonstyle_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcompleter_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qconicalgradient_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcontextmenuevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qcursor_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdatawidgetmapper_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdateedit_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdatetimeedit_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdesktopservices_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdesktopwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdialogbuttonbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdialog_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdial_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdirmodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdockwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdoublespinbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdoublevalidator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdragenterevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdragleaveevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdragmoveevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdrag_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qdropevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qerrormessage_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfiledialog_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfileiconprovider_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfileopenevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfilesystemmodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfocusevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfocusframe_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfontcombobox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfontdatabase_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfontdialog_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfontinfo_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfontmetricsf_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfontmetrics_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qfont_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qformlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qframe_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgradient_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsellipseitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsgridlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsitemanimation_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsitemgroup_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicslayoutitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicslayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicslinearlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicslineitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicspathitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicspixmapitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicspolygonitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsproxywidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsrectitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscenecontextmenuevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscenedragdropevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicssceneevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscenehelpevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscenehoverevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscenemouseevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscenemoveevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicssceneresizeevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscenewheelevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsscene_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicssimpletextitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicstextitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicsview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgraphicswidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgridlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qgroupbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qhboxlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qheaderview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qhelpevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qhideevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qhoverevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qicondragevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qiconenginev2_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qiconengine_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qicon_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qimageiohandler_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qimagereader_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qimage_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qimagewriter_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qinputcontextfactory_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qinputcontext_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qinputdialog_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qinputevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qinputmethodevent_attribute_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qinputmethodevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qintvalidator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qitemdelegate_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qitemeditorcreatorbase_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qitemeditorfactory_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qitemselectionmodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qitemselectionrange_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qitemselection_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qkeyevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qkeysequence_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlabel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlayoutitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlcdnumber_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlineargradient_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlineedit_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlistview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlistwidgetitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qlistwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmainwindow_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmdiarea_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmdisubwindow_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmenubar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmenu_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmessagebox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmotifstyle_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmouseevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmoveevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmovie_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpaintdevice_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpaintenginestate_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpaintengine_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpainterpath_element_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpainterpathstroker_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpainterpath_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpainter_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpaintevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpalette_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpen_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpictureio_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpicture_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpixmapcache_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpixmapcache_key_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpixmap_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qplaintextdocumentlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qplaintextedit_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qplastiquestyle_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpolygonf_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpolygon_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprogressbar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qprogressdialog_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qproxymodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpytextobject_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpushbutton_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qradialgradient_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qradiobutton_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qregexpvalidator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qregion_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qresizeevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qrubberband_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qscrollarea_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qscrollbar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qshortcutevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qshortcut_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qshowevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsizepolicy_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qslider_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsortfilterproxymodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsound_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qspaceritem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qspinbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsplashscreen_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsplitterhandle_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsplitter_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstackedlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstackedwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstandarditemmodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstandarditem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstatusbar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstatustipevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstringlistmodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleditemdelegate_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstylefactory_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstylehintreturnmask_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstylehintreturnvariant_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstylehintreturn_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionbutton_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptioncombobox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptioncomplex_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiondockwidgetv2_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiondockwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionfocusrect_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionframev2_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionframev3_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionframe_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiongraphicsitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiongroupbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionheader_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionmenuitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionprogressbarv2_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionprogressbar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionrubberband_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionsizegrip_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionslider_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionspinbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontabbarbase_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontabbarbasev2_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontabv2_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontabv3_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontabwidgetframe_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontab_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontitlebar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontoolbar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontoolboxv2_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontoolbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptiontoolbutton_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionviewitemv2_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionviewitemv3_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionviewitemv4_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoptionviewitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyleoption_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstylepainter_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qstyle_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qsyntaxhighlighter_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtabbar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtabletevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtableview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtablewidgetitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtablewidgetselectionrange_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtablewidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtabwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextblockformat_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextblockgroup_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextblock_iterator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextblockuserdata_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextblock_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextbrowser_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextcharformat_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextcursor_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextdocumentfragment_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextdocument_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextedit_extraselection_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextedit_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextformat_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextfragment_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextframeformat_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextframe_iterator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextframe_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextimageformat_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextinlineobject_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextlayout_formatrange_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextlength_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextline_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextlistformat_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextlist_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextobjectinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextobject_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextoption_tab_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtextoption_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtexttablecellformat_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtexttablecell_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtexttableformat_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtexttable_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtgui_module_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtimeedit_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtoolbar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtoolbarchangeevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtoolbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtoolbutton_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtooltip_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtransform_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtreeview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtreewidgetitemiterator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtreewidgetitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qtreewidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qundocommand_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qundogroup_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qundostack_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qundoview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvalidator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qvboxlayout_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwhatsthisclickedevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwhatsthis_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwheelevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwidgetaction_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwidgetitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwindowsstyle_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwindowstatechangeevent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwizardpage_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwizard_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qworkspace_wrapper.cpp\n\n${SPECIFIC_OS_FILES}\n${QtGui_46_SRC}\n${QtGui_47_SRC}\n${QtGui_OPTIONAL_SRC}\n)\n\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui.xml.in\"\n               \"${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml\" @ONLY)\n\nset(QtGui_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}\")\n\nset(QtGui_include_dirs  ${CMAKE_CURRENT_SOURCE_DIR}\n                        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/\n                        ${pyside_SOURCE_DIR}\n                        ${QT_INCLUDE_DIR}\n                        ${SHIBOKEN_INCLUDE_DIR}\n                        ${libpyside_SOURCE_DIR}\n                        ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                        ${QtCore_BINARY_DIR}/PySide/QtCore/)\nset(QtGui_libraries   pyside\n                      ${SHIBOKEN_PYTHON_LIBRARIES}\n                      ${SHIBOKEN_LIBRARY}\n                      ${QT_QTGUI_LIBRARY})\nset(QtGui_deps \"QtCore\")\n\ncreate_pyside_module(QtGui\n                     QtGui_include_dirs\n                     QtGui_libraries\n                     QtGui_deps\n                     QtGui_typesystem_path\n                     QtGui_SRC\n                     QPYTEXTOBJECT_MOC\n                     ${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml)\n\ninstall(FILES ${pyside_SOURCE_DIR}/qpytextobject.h DESTINATION include/PySide/QtGui/)\n"
  },
  {
    "path": "PySide/QtGui/glue/qapplication_init.cpp",
    "content": "// Borrowed reference to QtGui module\nextern PyObject* moduleQtGui;\n\nstatic int QApplicationArgCount;\nstatic char** QApplicationArgValues;\nstatic const char QAPP_MACRO[] = \"qApp\";\n\nbool QApplicationConstructorStart(PyObject* argv)\n{\n    if (QApplication::instance()) {\n        PyErr_SetString(PyExc_RuntimeError, \"A QApplication instance already exists.\");\n        return false;\n    }\n\n    return Shiboken::sequenceToArgcArgv(argv, &QApplicationArgCount, &QApplicationArgValues, \"PySideApp\");\n}\n\nvoid QApplicationConstructorEnd(PyObject* self)\n{\n    // Verify if qApp is in main module\n    PyObject* globalsDict = PyEval_GetGlobals();\n    if (globalsDict) {\n        PyObject* qAppObj = PyDict_GetItemString(globalsDict, QAPP_MACRO);\n        if (qAppObj)\n            PyDict_SetItemString(globalsDict, QAPP_MACRO, self);\n    }\n\n    PyObject_SetAttrString(moduleQtGui, QAPP_MACRO, self);\n    PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);\n    Py_INCREF(self);\n}\n\nstatic void QApplicationConstructor(PyObject* self, PyObject* argv, QApplicationWrapper** cptr)\n{\n    if (QApplicationConstructorStart(argv)) {\n        *cptr = new QApplicationWrapper(QApplicationArgCount, QApplicationArgValues);\n        Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));\n        QApplicationConstructorEnd(self);\n    }\n}\n\ntemplate <typename T>\nstatic void QApplicationConstructor(PyObject* self, PyObject* argv, T extraArg, QApplicationWrapper** cptr)\n{\n    if (QApplicationConstructorStart(argv)) {\n        *cptr = new QApplicationWrapper(QApplicationArgCount, QApplicationArgValues, extraArg);\n        Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));\n        QApplicationConstructorEnd(self);\n    }\n}\n"
  },
  {
    "path": "PySide/QtGui/glue/qlayout_help_functions.cpp",
    "content": "void addLayoutOwnership(QLayout* layout, QLayoutItem* item);\nvoid removeLayoutOwnership(QLayout* layout, QWidget* widget);\n\ninline QByteArray retrieveObjectName(PyObject* obj)\n{\n    Shiboken::AutoDecRef objName(PyObject_Str(obj));\n    return Shiboken::String::toCString(objName);\n}\n\ninline void addLayoutOwnership(QLayout* layout, QWidget* widget)\n{\n    //transfer ownership to parent widget\n    QWidget *lw = layout->parentWidget();\n    QWidget *pw = widget->parentWidget();\n\n   Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget));\n\n    //Transfer parent to layout widget\n    if (pw && lw && pw != lw)\n        Shiboken::Object::setParent(0, pyChild);\n\n    if (!lw && !pw) {\n        //keep the reference while the layout is orphan\n        Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](layout));\n        Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);\n    } else {\n        if (!lw)\n            lw = pw;\n        Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](lw));\n        Shiboken::Object::setParent(pyParent, pyChild);\n    }\n}\n\ninline void addLayoutOwnership(QLayout* layout, QLayout* other)\n{\n    //transfer all children widgets from other to layout parent widget\n    QWidget* parent = layout->parentWidget();\n    if (!parent) {\n        //keep the reference while the layout is orphan\n        Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout));\n        Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](other));\n        Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);\n        return;\n    }\n\n    for (int i=0, i_max=other->count(); i < i_max; i++) {\n        QLayoutItem* item = other->itemAt(i);\n        if (PyErr_Occurred() || !item)\n            return;\n        addLayoutOwnership(layout, item);\n    }\n\n    Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout));\n    Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](other));\n    Shiboken::Object::setParent(pyParent, pyChild);\n}\n\ninline void addLayoutOwnership(QLayout* layout, QLayoutItem* item)\n{\n    if (!item)\n        return;\n\n    QWidget* w = item->widget();\n    if (w)\n        addLayoutOwnership(layout, w);\n    else {\n        QLayout* l = item->layout();\n        if (l)\n            addLayoutOwnership(layout, l);\n    }\n\n    Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout));\n    Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayoutItem*](item));\n    Shiboken::Object::setParent(pyParent, pyChild);\n}\n\nstatic void removeWidgetFromLayout(QLayout* layout, QWidget* widget)\n{\n    QWidget* parent = widget->parentWidget();\n\n    if (!parent) {\n        //remove reference on layout\n        Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](layout));\n        Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget));\n        Shiboken::Object::removeReference(reinterpret_cast<SbkObject*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild);\n    } else {\n        //give the ownership to parent\n        Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](parent));\n        Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget));\n        Shiboken::Object::setParent(pyParent, pyChild);\n    }\n}\n\ninline void removeLayoutOwnership(QLayout* layout, QLayoutItem* item)\n{\n    QWidget* w = item->widget();\n    if (w)\n        removeWidgetFromLayout(layout, w);\n    else {\n        QLayout* l = item->layout();\n        if (l)\n            removeLayoutOwnership(layout, l);\n    }\n\n    Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayoutItem*](item));\n    Shiboken::Object::invalidate(pyChild);\n    Shiboken::Object::setParent(0, pyChild);\n}\n\ninline void removeLayoutOwnership(QLayout* layout, QWidget* widget)\n{\n    if (!widget)\n        return;\n\n    for (int i=0, i_max=layout->count(); i < i_max; i++) {\n        QLayoutItem* item = layout->itemAt(i);\n        if (PyErr_Occurred() || !item)\n            return;\n        if (item->widget() == widget)\n            removeLayoutOwnership(layout, item);\n    }\n}\n"
  },
  {
    "path": "PySide/QtGui/glue/qmenu_glue.cpp",
    "content": "inline PyObject* addActionWithPyObject(QMenu* self, const QIcon& icon, const QString& text, PyObject* callback, const QKeySequence& shortcut)\n{\n    QAction* act = new QAction(text, self);\n\n    if (!icon.isNull())\n        act->setIcon(icon);\n\n    if (!shortcut.isEmpty())\n        act->setShortcut(shortcut);\n\n    self->addAction(act);\n\n    PyObject* pyAct = %CONVERTTOPYTHON[QAction*](act);\n    Shiboken::AutoDecRef result(PyObject_CallMethod(pyAct, \"connect\", \"OsO\", pyAct, SIGNAL(triggered()), callback));\n    if (result.isNull()) {\n        Py_DECREF(pyAct);\n        return 0;\n    }\n\n    return pyAct;\n}\n"
  },
  {
    "path": "PySide/QtGui/glue/qmenubar_glue.cpp",
    "content": "inline PyObject*\naddActionWithPyObject(QMenuBar* self, const QString& text, PyObject* callback)\n{\n    QAction* act = new QAction(text, self);\n\n    self->addAction(act);\n\n    PyObject* pyAct = %CONVERTTOPYTHON[QAction*](act);\n    PyObject* result = PyObject_CallMethod(pyAct, \"connect\", \"OsO\", pyAct,\n                                           SIGNAL(triggered(bool)), callback);\n\n    if (result == 0 || result == Py_False) {\n        if (result)\n            Py_DECREF(result);\n        Py_DECREF(pyAct);\n        return 0;\n    }\n\n    return pyAct;\n}\n"
  },
  {
    "path": "PySide/QtGui/glue/qtgui_qapp.cpp",
    "content": "// Init qApp macro to None.\nif (qApp) {\n    PyObject* pyApp = %CONVERTTOPYTHON[QApplication*](qApp);\n    Py_INCREF(pyApp);\n    PyModule_AddObject(module, \"qApp\", pyApp);\n} else {\n    Py_INCREF(Py_None);\n    PyModule_AddObject(module, \"qApp\", Py_None);\n}\nmoduleQtGui = module;\n"
  },
  {
    "path": "PySide/QtGui/glue/qwidget_glue.cpp",
    "content": "static QString retrieveObjectName(PyObject *obj)\n{\n    Shiboken::AutoDecRef objName(PyObject_Str(obj));\n    return QString(Shiboken::String::toCString(objName));\n}\n\n\n/**\n * Tranfer objects ownership from layout to widget\n **/\nstatic inline void qwidgetReparentLayout(QWidget *parent, QLayout *layout)\n{\n    Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](parent));\n\n    for (int i=0; i < layout->count(); i++) {\n        QLayoutItem* item = layout->itemAt(i);\n        if (PyErr_Occurred() || !item)\n            return;\n\n        QWidget* w = item->widget();\n        if (w) {\n            QWidget* pw = w->parentWidget();\n            if (pw != parent) {\n                Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](w));\n                Shiboken::Object::setParent(pyParent, pyChild);\n            }\n        } else {\n            QLayout* l = item->layout();\n            if (l)\n                qwidgetReparentLayout(parent, l);\n        }\n    }\n\n    Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](layout));\n    Shiboken::Object::setParent(pyParent, pyChild);\n    //remove previous references\n    Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);\n}\n\nstatic inline void qwidgetSetLayout(QWidget *self, QLayout *layout)\n{\n    if (!layout || self->layout())\n        return;\n\n    QObject* oldParent = layout->parent();\n    if (oldParent && oldParent != self) {\n        if (oldParent->isWidgetType()) {\n            // remove old parent policy\n            Shiboken::AutoDecRef pyLayout(%CONVERTTOPYTHON[QLayout*](layout));\n            Shiboken::Object::setParent(Py_None, pyLayout);\n        } else {\n            PyErr_Format(PyExc_RuntimeError, \"QWidget::setLayout: Attempting to set QLayout \\\"%s\\\" on %s \\\"%s\\\", when the QLayout already has a parent\",\n                          qPrintable(layout->objectName()), self->metaObject()->className(), qPrintable(self->objectName()));\n            return;\n        }\n    }\n\n    if (oldParent != self) {\n        qwidgetReparentLayout(self, layout);\n        if (PyErr_Occurred())\n            return;\n\n        self->setLayout(layout);\n    }\n}\n"
  },
  {
    "path": "PySide/QtGui/typesystem_gui.xml.in",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtGui\">\n    <load-typesystem name=\"typesystem_core.xml\" generate=\"no\"/>\n    <load-typesystem name=\"typesystem_gui_@AUTO_OS@.xml\" generate=\"yes\"/>\n    <load-typesystem name=\"typesystem_gui_common.xml\" generate=\"yes\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtGui/typesystem_gui_common.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtGui\">\n  <load-typesystem name=\"typesystem_core.xml\" generate=\"no\"/>\n\n  <template name=\"QFontCharFix\">\n    int size = Shiboken::String::len(%PYARG_1);\n    if (size == 1) {\n        const char *str = Shiboken::String::toCString(%PYARG_1);\n        QChar ch(str[0]);\n        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ch);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n    } else {\n        PyErr_SetString(PyExc_TypeError, \"String must have only one character\");\n    }\n  </template>\n\n  <function signature=\"qAlpha(uint)\" />\n  <function signature=\"qBlue(uint)\" />\n  <function signature=\"qGray(int,int,int)\" />\n  <function signature=\"qGray(uint)\" />\n  <function signature=\"qGreen(uint)\" />\n  <function signature=\"qIsGray(uint)\" />\n  <function signature=\"qRed(uint)\" />\n  <function signature=\"qRgb(int,int,int)\" />\n  <function signature=\"qRgba(int,int,int,int)\" />\n  <function signature=\"qFuzzyCompare(QMatrix,QMatrix)\" />\n  <function signature=\"qFuzzyCompare(QTransform,QTransform)\" />\n  <function signature=\"qFuzzyCompare(QQuaternion,QQuaternion)\" />\n  <function signature=\"qFuzzyCompare(QMatrix4x4,QMatrix4x4)\" />\n  <function signature=\"qFuzzyCompare(QVector2D,QVector2D)\" />\n  <function signature=\"qFuzzyCompare(QVector3D,QVector3D)\" />\n  <function signature=\"qFuzzyCompare(QVector4D,QVector4D)\" />\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QStyleFactoryInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QAccessibleFactoryInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QInputContextFactoryInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QGraphicsItem*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QGraphicsLayout*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QAccessibleBridgeFactoryInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QImageIOHandlerFactoryInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QIconEngineFactoryInterfaceV2*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QAccessibleInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QTextObjectInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QGraphicsLayoutItem*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QIconEngineFactoryInterface*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_interface_iid&lt;QPictureFormatInterface*&gt;\"/>\n\n  <rejection class=\"*\" function-name=\"qobject_cast&lt;QGraphicsLayout*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_cast&lt;QGraphicsItem*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_cast&lt;QGraphicsLayoutItem*&gt;\"/>\n  <rejection class=\"*\" function-name=\"qobject_cast&lt;QGraphicsLayoutItem*&gt;\"/>\n\n  <rejection class=\"*\" function-name=\"qGenericMatrixFromMatrix4x4\"/>\n  <rejection class=\"*\" function-name=\"qDrawBorderPixmap\"/>\n  <rejection class=\"*\" function-name=\"qDrawPixmaps\"/>\n  <rejection class=\"*\" function-name=\"qGenericMatrixToMatrix4x4\"/>\n\n  <rejection class=\"*\" function-name=\"d_func\"/>\n  <rejection class=\"*\" field-name=\"d_ptr\"/>\n  <rejection class=\"*\" field-name=\"d\"/>\n\n  <!--\n    Event classes have a lot of non-documented protected fields, those fields\n    are removed from PySide because they are Qt implementation details,\n    besides the fact they are accessible by ordinary event methods.\n    -->\n\n  <rejection class=\"QInputEvent\" field-name=\"modState\"/>\n  <rejection class=\"QInputEvent\" field-name=\"modState\"/>\n\n  <rejection class=\"QMouseEvent\" field-name=\"p\"/>\n  <rejection class=\"QMouseEvent\" field-name=\"g\"/>\n  <rejection class=\"QMouseEvent\" field-name=\"b\"/>\n  <rejection class=\"QMouseEvent\" field-name=\"mouseState\"/>\n\n  <rejection class=\"QHoverEvent\" field-name=\"p\"/>\n  <rejection class=\"QHoverEvent\" field-name=\"op\"/>\n\n  <rejection class=\"QWheelEvent\" field-name=\"p\"/>\n  <rejection class=\"QWheelEvent\" field-name=\"g\"/>\n  <rejection class=\"QWheelEvent\" field-name=\"mouseState\"/>\n  <rejection class=\"QWheelEvent\" field-name=\"o\"/>\n\n  <rejection class=\"QTabletEvent\" field-name=\"mPos\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mGPos\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mHiResGlobalPos\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mDev\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mPointerType\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mXT\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mYT\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mZ\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mPress\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mTangential\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mRot\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mUnique\"/>\n  <rejection class=\"QTabletEvent\" field-name=\"mExtra\"/>\n\n  <rejection class=\"QKeyEvent\" field-name=\"txt\"/>\n  <rejection class=\"QKeyEvent\" field-name=\"k\"/>\n  <rejection class=\"QKeyEvent\" field-name=\"c\"/>\n  <rejection class=\"QKeyEvent\" field-name=\"auto\"/>\n\n  <rejection class=\"QPaintEvent\" field-name=\"m_rect\"/>\n  <rejection class=\"QPaintEvent\" field-name=\"m_region\"/>\n  <rejection class=\"QPaintEvent\" field-name=\"m_erased\"/>\n\n  <rejection class=\"QMoveEvent\" field-name=\"p\"/>\n  <rejection class=\"QMoveEvent\" field-name=\"oldp\"/>\n\n  <rejection class=\"QResizeEvent\" field-name=\"s\"/>\n  <rejection class=\"QResizeEvent\" field-name=\"olds\"/>\n\n  <rejection class=\"QContextMenuEvent\" field-name=\"p\"/>\n  <rejection class=\"QContextMenuEvent\" field-name=\"gp\"/>\n  <rejection class=\"QContextMenuEvent\" field-name=\"reas\"/>\n\n  <rejection class=\"QDropEvent\" field-name=\"p\"/>\n  <rejection class=\"QDropEvent\" field-name=\"mouseState\"/>\n  <rejection class=\"QDropEvent\" field-name=\"modState\"/>\n  <rejection class=\"QDropEvent\" field-name=\"act\"/>\n  <rejection class=\"QDropEvent\" field-name=\"drop_action\"/>\n  <rejection class=\"QDropEvent\" field-name=\"default_action\"/>\n  <rejection class=\"QDropEvent\" field-name=\"mdata\"/>\n  <rejection class=\"QDropEvent\" field-name=\"fmts\"/>\n\n  <rejection class=\"QDragMoveEvent\" field-name=\"rect\"/>\n\n  <rejection class=\"QShortcutEvent\" field-name=\"sequence\"/>\n  <rejection class=\"QShortcutEvent\" field-name=\"ambig\"/>\n  <rejection class=\"QShortcutEvent\" field-name=\"sid\"/>\n\n  <rejection class=\"QTouchEvent\" field-name=\"_widget\"/>\n  <rejection class=\"QTouchEvent\" field-name=\"_deviceType\"/>\n  <rejection class=\"QTouchEvent\" field-name=\"_touchPointStates\"/>\n  <rejection class=\"QTouchEvent\" field-name=\"_touchPoints\"/>\n\n  <rejection class=\"QAbstractTextDocumentLayout::PaintContext\" field-name=\"selections\"/>\n  <rejection class=\"QApplication\" function-name=\"compressEvent\"/>\n  <rejection class=\"QBrush\" function-name=\"cleanUp\"/>\n  <rejection class=\"QFont\" enum-name=\"ResolveProperties\"/>\n  <rejection class=\"QMotifStyle\" field-name=\"focus\"/>\n  <rejection class=\"QPictureIO\" function-name=\"defineIOHandler\"/>\n  <rejection class=\"QPolygon\" function-name=\"putPoints\"/>\n  <rejection class=\"QPolygon\" function-name=\"setPoints\"/>\n  <rejection class=\"QPolygon\" function-name=\"setPoint\"/>\n  <rejection class=\"QPolygon\" function-name=\"points\"/>\n  <rejection class=\"QPolygon\" function-name=\"point\"/>\n  <rejection class=\"QWidget\" function-name=\"create\"/>\n  <rejection class=\"QWidget\" function-name=\"find\"/>\n  <rejection class=\"QWidget\" function-name=\"handle\"/>\n  <rejection class=\"QWidget\" function-name=\"styleChange\"/>\n  <rejection class=\"QWidget\" function-name=\"internalWinId\"/>\n  <rejection class=\"QWidgetItem\" field-name=\"wid\"/>\n  <rejection class=\"QActionGroup\" function-name=\"selected\"/>\n  <rejection class=\"QPaintEngine\" function-name=\"fix_neg_rect\"/>\n  <rejection class=\"*\" enum-name=\"enum_1\"/>\n  <value-type name=\"QTransform\">\n    <enum-type name=\"TransformationType\"/>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f, %f, %f, %f, %f, %f, %f, %f\" />\n               <replace from=\"%REPR_ARGS\"\n                        to=\"%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"ddddddddd\" />\n              <replace from=\"%REDUCE_ARGS\"\n                       to=\"%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m13(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.m23(), %CPPSELF.m31(), %CPPSELF.m32(), %CPPSELF.m33()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <modify-function signature=\"map(qreal,qreal,qreal*,qreal*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_args,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <!-- ### This is just an overload to \"map(qreal,qreal,qreal*,qreal*)const\" and can be discarded in Python -->\n    <modify-function signature=\"map(int,int,int*,int*)const\" remove=\"all\"/>\n    <!-- ### -->\n\n    <modify-function signature=\"inverted(bool*)const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"PyTuple\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*\"/>\n      </inject-code>\n    </modify-function>\n    <add-function signature=\"quadToQuad(QPolygonF&amp;, QPolygonF&amp;)\" return-type=\"PyObject*\" static=\"true\">\n      <inject-code>\n        QTransform _result;\n        if (QTransform::quadToQuad(%1, %2, _result)) {\n            %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);\n        } else {\n            Py_INCREF(Py_None);\n            %PYARG_0 = Py_None;\n        }\n      </inject-code>\n    </add-function>\n    <add-function signature=\"quadToSquare(QPolygonF &amp;)\" return-type=\"PyObject*\" static=\"true\">\n      <inject-code>\n        QTransform _result;\n        if (QTransform::quadToSquare(%1, _result)) {\n            %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);\n        } else {\n            Py_INCREF(Py_None);\n            %PYARG_0 = Py_None;\n        }\n      </inject-code>\n    </add-function>\n\n    <add-function signature=\"squareToQuad(QPolygonF &amp;)\" return-type=\"PyObject*\" static=\"true\">\n      <inject-code>\n        QTransform _result;\n        if (QTransform::squareToQuad(%1, _result)) {\n            %PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);\n        } else {\n            Py_INCREF(Py_None);\n            %PYARG_0 = Py_None;\n        }\n      </inject-code>\n    </add-function>\n\n  </value-type>\n  <object-type name=\"QStyleOption\" polymorphic-id-expression=\"%1-&gt;type == QStyleOption::SO_Default\">\n    <enum-type name=\"OptionType\" extensible=\"yes\"/>\n    <enum-type name=\"StyleOptionType\"/>\n    <enum-type name=\"StyleOptionVersion\"/>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"init(const QWidget*)\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionGraphicsItem\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionGraphicsItem::Type &amp;&amp; %1-&gt;version == QStyleOptionGraphicsItem::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionSizeGrip\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionSizeGrip::Type &amp;&amp; %1-&gt;version == QStyleOptionSizeGrip::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionButton\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionButton::Type &amp;&amp; %1-&gt;version == QStyleOptionButton::Version\">\n      <enum-type name=\"ButtonFeature\" flags=\"ButtonFeatures\"/>\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionComboBox\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionComboBox::Type &amp;&amp; %1-&gt;version == QStyleOptionComboBox::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionComplex\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionComplex::Type &amp;&amp; %1-&gt;version == QStyleOptionComplex::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionDockWidget\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionDockWidget::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidget::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionDockWidgetV2\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionDockWidgetV2::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidgetV2::Version\">\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionFocusRect\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionFocusRect::Type &amp;&amp; %1-&gt;version == QStyleOptionFocusRect::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionFrame\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionFrame::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionFrameV2\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionFrameV2::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV2::Version\">\n      <enum-type name=\"FrameFeature\" flags=\"FrameFeatures\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionFrameV3\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionFrameV3::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV3::Version\">\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionGroupBox\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionGroupBox::Type &amp;&amp; %1-&gt;version == QStyleOptionGroupBox::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionHeader\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionHeader::Type &amp;&amp; %1-&gt;version == QStyleOptionHeader::Version\">\n      <enum-type name=\"SectionPosition\"/>\n      <enum-type name=\"SelectedPosition\"/>\n      <enum-type name=\"SortIndicator\"/>\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionMenuItem\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionMenuItem::Type &amp;&amp; %1-&gt;version == QStyleOptionMenuItem::Version\">\n      <enum-type name=\"CheckType\"/>\n      <enum-type name=\"MenuItemType\"/>\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionProgressBar\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionProgressBar::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBar::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionProgressBarV2\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionProgressBarV2::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBarV2::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionRubberBand\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionRubberBand::Type &amp;&amp; %1-&gt;version == QStyleOptionRubberBand::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionSlider\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionSlider::Type &amp;&amp; %1-&gt;version == QStyleOptionSlider::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionSpinBox\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionSpinBox::Type &amp;&amp; %1-&gt;version == QStyleOptionSpinBox::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionTab\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionTab::Type &amp;&amp; %1-&gt;version == QStyleOptionTab::Version\">\n      <enum-type name=\"CornerWidget\" flags=\"CornerWidgets\"/>\n      <enum-type name=\"SelectedPosition\"/>\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n      <enum-type name=\"TabPosition\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionTabV2\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionTabV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV2::Version\">\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionTabV3\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionTabV3::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV3::Version\">\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionTabBarBase\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionTabBarBase::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBase::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionTabBarBaseV2\" delete-in-main-thread=\"yes\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionTabBarBaseV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBaseV2::Version\">\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionTabWidgetFrame\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionTabWidgetFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrame::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionTitleBar\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionTitleBar::Type &amp;&amp; %1-&gt;version == QStyleOptionTitleBar::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionToolBar\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionToolBar::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBar::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n      <enum-type name=\"ToolBarFeature\" flags=\"ToolBarFeatures\"/>\n      <enum-type name=\"ToolBarPosition\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionToolBox\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionToolBox::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBox::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionToolBoxV2\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionToolBoxV2::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBoxV2::Version\">\n      <enum-type name=\"SelectedPosition\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n      <enum-type name=\"TabPosition\"/>\n  </object-type>\n  <object-type name=\"QStyleOptionToolButton\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionToolButton::Type &amp;&amp; %1-&gt;version == QStyleOptionToolButton::Version\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n      <enum-type name=\"ToolButtonFeature\" flags=\"ToolButtonFeatures\" />\n  </object-type>\n  <value-type name=\"QStyleOptionViewItem\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionViewItem::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItem::Version\">\n      <enum-type name=\"Position\"/>\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </value-type>\n  <value-type name=\"QStyleOptionViewItemV2\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionViewItemV2::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV2::Version\">\n      <enum-type name=\"StyleOptionVersion\"/>\n      <enum-type name=\"ViewItemFeature\" flags=\"ViewItemFeatures\"/>\n  </value-type>\n  <value-type name=\"QStyleOptionViewItemV3\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionViewItemV3::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV3::Version\">\n      <enum-type name=\"StyleOptionVersion\"/>\n  </value-type>\n  <value-type name=\"QStyleOptionViewItemV4\" polymorphic-id-expression=\"%1-&gt;type == QStyleOptionViewItemV4::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV4::Version\" >\n      <enum-type name=\"StyleOptionVersion\"/>\n      <enum-type name=\"ViewItemPosition\"/>\n  </value-type>\n  <value-type name=\"QTextFragment\" />\n  <value-type name=\"QBitmap\" >\n    <modify-function signature=\"fromData(QSize,const uchar*,QImage::Format)\">\n      <modify-argument index=\"2\">\n        <replace-type modified-type=\"PyBuffer\"/>\n      </modify-argument>\n      <inject-code>\n        uchar* buffer = (uchar*) Shiboken::Buffer::getPointer(%PYARG_2);\n        QBitmap %0 = QBitmap::fromData(%1, buffer, %3);\n        %PYARG_0 = %CONVERTTOPYTHON[QBitmap](%0);\n      </inject-code>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QTextInlineObject\" />\n  <value-type name=\"QSizePolicy\">\n      <enum-type name=\"ControlType\" flags=\"ControlTypes\"/>\n      <enum-type name=\"Policy\"/>\n      <enum-type name=\"PolicyFlag\"/>\n  </value-type>\n  <value-type name=\"QTableWidgetSelectionRange\"/>\n  <value-type name=\"QTextDocumentFragment\" />\n  <value-type name=\"QTextOption\">\n      <enum-type name=\"Flag\" flags=\"Flags\"/>\n      <enum-type name=\"TabType\"/>\n      <enum-type name=\"WrapMode\"/>\n      <value-type name=\"Tab\"/>\n  </value-type>\n  <value-type name=\"QTextLine\" >\n    <enum-type name=\"CursorPosition\"/>\n    <enum-type name=\"Edge\"/>\n    <modify-function signature=\"cursorToX(int*,QTextLine::Edge)const\" remove=\"all\" />\n    <modify-function signature=\"cursorToX(int,QTextLine::Edge)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE %0 = %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;%1, %2);\n        %END_ALLOW_THREADS\n        %PYARG_0 = PyTuple_New(2);\n        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));\n        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"xToCursor(qreal,QTextLine::CursorPosition)const\">\n      <modify-argument index=\"2\">\n        <rename to=\"edge\"/>\n      </modify-argument>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QTextTableFormat\" />\n  <value-type name=\"QTextImageFormat\" />\n  <value-type name=\"QTextFrameFormat\" >\n    <enum-type name=\"BorderStyle\"/>\n    <enum-type name=\"Position\"/>\n    <modify-function signature=\"isValid()const\" access=\"non-final\"/>\n  </value-type>\n  <value-type name=\"QTextLength\">\n      <enum-type name=\"Type\"/>\n  </value-type>\n  <value-type name=\"QItemSelectionRange\" hash-function=\"qHash\">\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"intersect(QItemSelectionRange)const\" remove=\"all\"/>\n  </value-type>\n  <value-type name=\"QPainterPath\">\n    <enum-type name=\"ElementType\"/>\n    <value-type name=\"Element\">\n      <modify-field name=\"x\" write=\"false\"/>\n      <modify-field name=\"y\" write=\"false\"/>\n      <modify-field name=\"type\" write=\"false\"/>\n      <include file-name=\"QPainterPath\" location=\"global\"/>\n    </value-type>\n  </value-type>\n  <value-type name=\"QPalette\">\n    <enum-type name=\"ColorGroup\" />\n    <enum-type name=\"ColorRole\" />\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"QPalette(QColor, QColor, QColor, QColor, QColor, QColor, QColor)\" remove=\"all\"/>\n    <modify-function signature=\"background()const\" remove=\"all\"/>\n    <modify-function signature=\"foreground()const\" remove=\"all\"/>\n    <modify-function signature=\"serialNumber()const\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </value-type>\n  <value-type name=\"QKeySequence\">\n    <enum-type name=\"SequenceFormat\"/>\n    <enum-type name=\"SequenceMatch\"/>\n    <enum-type name=\"StandardKey\"/>\n\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%i, %i, %i, %i\" />\n               <replace from=\"%REPR_ARGS\"\n                        to=\"(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"iiii\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <modify-function signature=\"operator[](uint) const\" remove=\"all\"/>\n    <add-function signature=\"__getitem__\">\n        <inject-code class=\"target\" position=\"beginning\">\n            if (_i &lt; 0 || _i >= %CPPSELF.count()) {\n                PyErr_SetString(PyExc_IndexError, \"index out of bounds\");\n                return 0;\n            }\n            int item = (*%CPPSELF)[_i];\n            return %CONVERTTOPYTHON[int](item);\n        </inject-code>\n    </add-function>\n\n    <!-- ### Not necessary due the PySide QVariant conversion rules -->\n    <modify-function signature=\"operator QVariant()const\" remove=\"all\"/>\n    <!-- ### Obsolete -->\n    <modify-function signature=\"operator int()const\" remove=\"all\"/>\n    <modify-function signature=\"operator QString()const\" remove=\"all\"/>\n    <!-- ### End of obsolete section -->\n  </value-type>\n  <value-type name=\"QPicture\" >\n    <modify-function signature=\"load(QIODevice*, const char*)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"load(const QString&amp;, const char*)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"save(QIODevice*, const char*)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"save(const QString&amp;, const char*)\" allow-thread=\"yes\"/>\n    <!-- ### Obsolete in 4.3-->\n    <modify-function signature=\"pictureFormat(QString)\" remove=\"all\" />\n    <modify-function signature=\"inputFormatList()\" remove=\"all\"/>\n    <modify-function signature=\"inputFormats()\" remove=\"all\"/>\n    <modify-function signature=\"outputFormatList()\" remove=\"all\"/>\n    <modify-function signature=\"outputFormats()\" remove=\"all\"/>\n    <!-- ### End of obsolete section -->\n    <!-- See bug 759 -->\n    <modify-function signature=\"data() const\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\"/>\n        </modify-argument>\n        <inject-code>\n            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.data(), %CPPSELF.size());\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"setData(const char*,uint)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PyBuffer\"/>\n            <conversion-rule class=\"target\">\n                PyObject* %out = Shiboken::Buffer::newObject(%in, size);\n            </conversion-rule>\n            <conversion-rule class=\"native\">\n                Py_ssize_t bufferLen;\n                char* %out = (char*) Shiboken::Buffer::getPointer(%PYARG_1, &amp;bufferLen);\n            </conversion-rule>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n            <conversion-rule class=\"native\">\n                uint %out = bufferLen;\n            </conversion-rule>\n        </modify-argument>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QRegion\" >\n    <enum-type name=\"RegionType\"/>\n    <!-- ### Obsolete in 4.3-->\n    <modify-function signature=\"eor(QRegion)const\" remove=\"all\"/>\n    <modify-function signature=\"intersect(QRect)const\" remove=\"all\" />\n    <modify-function signature=\"intersect(QRegion)const\" remove=\"all\" />\n    <modify-function signature=\"subtract(QRegion)const\" remove=\"all\"/>\n    <modify-function signature=\"unite(QRegion)const\" remove=\"all\"/>\n    <modify-function signature=\"unite(QRect)const\" remove=\"all\"/>\n    <!-- ### End of obsolete section -->\n    <!-- ### This operator does not make sense in Python. -->\n    <modify-function signature=\"operator&amp;=(QRegion)\" remove=\"all\"/>\n    <modify-function signature=\"operator&amp;=(QRect)\" remove=\"all\"/>\n    <!-- ### -->\n  </value-type>\n  <value-type name=\"QTextBlock\">\n    <value-type name=\"iterator\" >\n      <include file-name=\"QTextBlock\" location=\"global\"/>\n      <!-- ### These operators where removed because they don't make sense in Python.\n           The iterator methods (__iter__, next) replace this functionality. -->\n      <modify-function signature=\"operator++()\" remove=\"all\"/>\n      <modify-function signature=\"operator--()\" remove=\"all\"/>\n      <!-- ### -->\n      <add-function signature=\"__iter__()\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n          <insert-template name=\"__iter__\" />\n        </inject-code>\n      </add-function>\n      <add-function signature=\"__next__()\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n          <insert-template name=\"__next__\">\n            <replace from=\"%CPPSELF_TYPE\" to=\"QTextBlock::iterator\" />\n          </insert-template>\n        </inject-code>\n      </add-function>\n    </value-type>\n    <add-function signature=\"__iter__()\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n          <insert-template name=\"__iter_parent__\">\n            <replace from=\"%CPPSELF_TYPE\" to=\"QTextBlock::iterator\" />\n          </insert-template>\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"setUserData(QTextBlockUserData*)\">\n        <inject-code class=\"target\" position=\"end\">\n            const QTextDocument* doc = %CPPSELF.document();\n            if (doc) {\n                Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));\n                Shiboken::Object::setParent(pyDocument, %PYARG_1);\n            }\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"userData() const\">\n        <modify-argument index=\"return\">\n            <define-ownership class=\"target\" owner=\"default\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"end\">\n            const QTextDocument* doc = %CPPSELF.document();\n            if (doc) {\n                Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));\n                Shiboken::Object::setParent(pyDocument, %PYARG_0);\n            }\n        </inject-code>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QTextBlockFormat\">\n    <enum-type name=\"LineHeightTypes\" since=\"4.8\" revision=\"4800\"/>\n  </value-type>\n  <value-type name=\"QTextTableCellFormat\" />\n  <value-type name=\"QTextCharFormat\" >\n    <enum-type name=\"UnderlineStyle\"/>\n    <enum-type name=\"VerticalAlignment\"/>\n    <modify-function signature=\"isValid()const\" access=\"non-final\"/>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"anchorName()const\" remove=\"all\"/>\n    <modify-function signature=\"setAnchorName(QString)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </value-type>\n  <value-type name=\"QTextFormat\" >\n    <enum-type name=\"FormatType\"/>\n    <enum-type name=\"ObjectTypes\"/>\n    <enum-type name=\"PageBreakFlag\" flags=\"PageBreakFlags\"/>\n    <enum-type name=\"Property\" />\n    <modify-function signature=\"isValid()const\" access=\"non-final\"/>\n  </value-type>\n  <value-type name=\"QTextListFormat\">\n      <enum-type name=\"Style\"/>\n  </value-type>\n  <value-type name=\"QPolygon\">\n    <extra-includes>\n      <include file-name=\"QMatrix\" location=\"global\"/>\n      <include file-name=\"QTransform\" location=\"global\"/>\n    </extra-includes>\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            PyObject* points = PyList_New(%CPPSELF.count());\n            for (int i = 0, max = %CPPSELF.count(); i &lt; max; ++i){\n                int x, y;\n                %CPPSELF.point(i, &amp;x, &amp;y);\n                QPoint pt = QPoint(x, y);\n                PyList_SET_ITEM(points, i, %CONVERTTOPYTHON[QPoint](pt));\n            }\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"N\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"points\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <!-- ### \"QPolygon(int, const int*)\" is an internal constructor. -->\n    <modify-function signature=\"QPolygon(int, const int *)\" remove=\"all\"/>\n    <!-- ### A QVector parameter, for no defined type, will generate wrong code. -->\n    <modify-function signature=\"operator+=(QVector&lt;QPoint&gt;)\" remove=\"all\"/>\n    <modify-function signature=\"operator&lt;&lt;(QPoint)\">\n        <inject-code>\n            // %FUNCTION_NAME()\n            *%CPPSELF &lt;&lt; %1;\n            %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"operator&lt;&lt;(QVector&lt;QPoint&gt;)\">\n        <inject-code>\n            // %FUNCTION_NAME()\n            *%CPPSELF &lt;&lt; %1;\n            %PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);\n        </inject-code>\n    </modify-function>\n    <!-- ### -->\n  </value-type>\n  <value-type name=\"QPolygonF\">\n    <extra-includes>\n      <include file-name=\"QMatrix\" location=\"global\"/>\n      <include file-name=\"QTransform\" location=\"global\"/>\n    </extra-includes>\n    <!-- ### A QVector parameter, for no defined type, will generate wrong code. -->\n    <modify-function signature=\"operator+=(QVector&lt;QPointF&gt;)\" remove=\"all\"/>\n    <!-- ### See bug 776 -->\n    <modify-function signature=\"operator&lt;&lt;(QPointF)\" remove=\"all\"/>\n    <!-- ### See bug 777 -->\n    <modify-function signature=\"operator&lt;&lt;(QVector&lt;QPointF&gt;)\" remove=\"all\"/>\n    <!-- ### -->\n  </value-type>\n  <value-type name=\"QIcon\" >\n    <enum-type name=\"Mode\"/>\n    <enum-type name=\"State\"/>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"serialNumber()const\" remove=\"all\"/>\n    <modify-function signature=\"QIcon(QIconEngineV2 *)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QIcon(QIconEngine *)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QTreeWidgetItemIterator\" >\n    <modify-function signature=\"QTreeWidgetItemIterator(QTreeWidget *, QFlags&lt;QTreeWidgetItemIterator::IteratorFlag&gt;)\">\n        <modify-argument index=\"this\">\n            <parent index=\"1\" action=\"add\" />\n        </modify-argument>\n    </modify-function>\n\n    <add-function signature=\"__iter__()\" return-type=\"PyObject*\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"__iter__\" />\n      </inject-code>\n    </add-function>\n    <add-function signature=\"__next__()\" return-type=\"PyObject*\">\n      <inject-code class=\"target\" position=\"beginning\">\n      if (**%CPPSELF) {\n          QTreeWidgetItemIterator* %0 = new QTreeWidgetItemIterator((*%CPPSELF)++);\n          %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItemIterator*](%0);\n      }\n      </inject-code>\n    </add-function>\n\n    <add-function signature=\"value()\" return-type=\"QTreeWidgetItem*\">\n        <inject-code>\n        QTreeWidgetItem* %0 = %CPPSELF.operator*();\n        %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%0);\n        Shiboken::Object::releaseOwnership(%PYARG_0);\n        </inject-code>\n    </add-function>\n    <enum-type name=\"IteratorFlag\" flags=\"IteratorFlags\"/>\n    <!-- ### See bug 778 -->\n    <modify-function signature=\"operator++(int)\" remove=\"all\"/>\n    <modify-function signature=\"operator--(int)\" remove=\"all\"/>\n    <modify-function signature=\"operator++()\" remove=\"all\"/>\n    <modify-function signature=\"operator--()\" remove=\"all\"/>\n    <!-- ### Operator* doesn't make sense in Python. -->\n    <modify-function signature=\"operator*()const\" remove=\"all\"/>\n    <!-- ### -->\n  </value-type>\n\n  <template name=\"load_xpm\">\n        Shiboken::AutoDecRef strList(PySequence_Fast(%PYARG_1, \"Invalid sequence.\"));\n        int lineCount = PySequence_Fast_GET_SIZE(strList.object());\n        for (int line = 0; line &lt; lineCount; ++line) {\n            if (!Shiboken::String::check(PySequence_Fast_GET_ITEM(strList.object(), line))) {\n                PyErr_SetString(PyExc_TypeError, \"The argument must be a sequence of strings.\");\n                break;\n            }\n        }\n\n        const char** xpm = (const char**) malloc (lineCount * sizeof(const char**));\n        for (int line = 0; line &lt; lineCount; ++line)\n            xpm[line] = Shiboken::String::toCString(PySequence_Fast_GET_ITEM(strList.object(), line));\n\n        %BEGIN_ALLOW_THREADS\n        %0 = new %TYPE(xpm);\n        %END_ALLOW_THREADS\n\n        free(xpm);\n  </template>\n  <value-type name=\"QPixmap\" >\n    <!--<conversion-rule>-->\n        <!--<target-to-native replace=\"no\">-->\n            <!--<add-conversion type=\"QVariant\" check=\"%CHECKTYPE[QVariant](%in)\">-->\n            <!--QVariant in = %CONVERTTOCPP[QVariant](%in);-->\n            <!--%out = in.value&lt;%OUTTYPE&gt;();-->\n            <!--</add-conversion>-->\n        <!--</target-to-native>-->\n    <!--</conversion-rule>-->\n    <add-function signature=\"QPixmap(const QImage&amp;)\">\n        <modify-argument index=\"1\">\n            <rename to=\"image\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        %0 = new %TYPE(QPixmap::fromImage(%1));\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"QPixmap(const char **)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"load_xpm\" />\n        </inject-code>\n    </modify-function>\n\n    <!-- ### Operator ! doesn't make sense in Python. -->\n    <modify-function signature=\"operator!()const\" remove=\"all\"/>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"serialNumber()const\" remove=\"all\"/>\n    <!-- ### -->\n\n    <modify-function signature=\"loadFromData(const uchar*,uint,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"PyBytes\"/>\n        <conversion-rule class=\"native\">\n          const uchar* %out = reinterpret_cast&lt;const uchar*>(PyBytes_AS_STRING(%PYARG_1));\n        </conversion-rule>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <remove-argument/>\n        <conversion-rule class=\"native\">\n          uint %out = static_cast&lt;uint>(PyBytes_Size(%PYARG_1));\n        </conversion-rule>\n      </modify-argument>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QTextCursor\" >\n    <extra-includes>\n      <include file-name=\"QTextBlock\" location=\"global\"/>\n      <include file-name=\"QTextDocumentFragment\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"MoveMode\"/>\n    <enum-type name=\"MoveOperation\"/>\n    <enum-type name=\"SelectionType\"/>\n    <modify-function signature=\"selectedTableCells(int*,int*,int*,int*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n        <inject-code class=\"native\" position=\"end\">\n            <insert-template name=\"fix_native_return_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"currentFrame()const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertTable(int,int,const QTextTableFormat &amp;)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertTable(int,int)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </value-type>\n\n  <value-type name=\"QItemSelection\" />\n  <value-type name=\"QMatrix\">\n    <extra-includes>\n      <include file-name=\"QPainterPath\" location=\"global\"/>\n    </extra-includes>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f, %f, %f, %f, %f\" />\n               <replace from=\"%REPR_ARGS\"\n                        to=\"%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"dddddd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.m11(), %CPPSELF.m12(), %CPPSELF.m21(), %CPPSELF.m22(), %CPPSELF.dx(), %CPPSELF.dy()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <template name=\"qmatrix_map\">\n    %ARG1_TYPE a, b;\n    %CPPSELF.%FUNCTION_NAME(%1, %2, &amp;a, &amp;b);\n    %PYARG_0 = PyTuple_New(2);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%ARG1_TYPE](a));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](b));\n    </template>\n    <modify-function signature=\"map(int,int,int*,int*)const\">\n        <modify-argument index=\"3\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"qmatrix_map\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"map(qreal,qreal,qreal*,qreal*)const\">\n        <modify-argument index=\"3\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"qmatrix_map\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"inverted(bool*)const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"PyTuple\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*\"/>\n      </inject-code>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QConicalGradient\" polymorphic-id-expression=\"%1-&gt;type() == QGradient::ConicalGradient\" />\n  <value-type name=\"QFontInfo\" />\n  <value-type name=\"QRadialGradient\" polymorphic-id-expression=\"%1-&gt;type() == QGradient::RadialGradient\" />\n  <value-type name=\"QFont\" >\n    <enum-type name=\"Capitalization\"/>\n    <enum-type name=\"SpacingType\"/>\n    <enum-type name=\"Stretch\"/>\n    <enum-type name=\"Style\"/>\n    <enum-type name=\"StyleHint\" />\n    <enum-type name=\"StyleStrategy\"/>\n    <enum-type name=\"Weight\"/>\n    <enum-type name=\"HintingPreference\" since=\"4.8\" revision=\"4800\"/>\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"setStyleHint(QFont::StyleHint, QFont::StyleStrategy)\">\n      <modify-argument index=\"2\">\n        <rename to=\"strategy\"/>\n      </modify-argument>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QTextTableCell\" >\n    <extra-includes>\n      <include file-name=\"QTextCursor\" location=\"global\"/>\n    </extra-includes>\n  </value-type>\n  <value-type name=\"QImage\">\n    <enum-type name=\"Format\"/>\n    <enum-type name=\"InvertMode\"/>\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QMatrix\" location=\"global\"/>\n    </extra-includes>\n\n    <template name=\"qimage_buffer_constructor\">\n        uchar* ptr = (uchar*) Shiboken::Buffer::getPointer(%PYARG_1);\n        %0 = new %TYPE(ptr, %ARGS);\n    </template>\n    <modify-function signature=\"QImage(uchar *,int,int,int,QImage::Format)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PyBuffer\"/>\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"qimage_buffer_constructor\">\n                <replace from=\"%ARGS\" to=\"%2, %3, %4, %5\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"QImage(uchar*,int,int,QImage::Format)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PyBuffer\"/>\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"qimage_buffer_constructor\">\n                <replace from=\"%ARGS\" to=\"%2, %3, %4\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <add-function signature=\"QImage(QString&amp;,int,int,int,QImage::Format)\">\n        <inject-code>\n            <insert-template name=\"qimage_buffer_constructor\">\n                <replace from=\"%ARGS\" to=\"%2, %3, %4, %5\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QImage(QString&amp;,int,int,QImage::Format)\">\n        <inject-code>\n            <insert-template name=\"qimage_buffer_constructor\">\n                <replace from=\"%ARGS\" to=\"%2, %3, %4\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <!-- The non-const versions are already used -->\n    <modify-function signature=\"QImage(const uchar*,int,int,int,QImage::Format)\" remove=\"all\"/>\n    <modify-function signature=\"QImage(const uchar*,int,int,QImage::Format)\" remove=\"all\" />\n    <!-- ### -->\n\n    <modify-function signature=\"QImage(const char**)\">\n        <modify-argument index=\"1\">\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"load_xpm\" />\n        </inject-code>\n    </modify-function>\n    <!-- ### \"QImage(const char*,const char*)\" is just an overload for \"QImage(QString,const char*)\" -->\n    <modify-function signature=\"QImage(const char*,const char*)\" remove=\"all\" />\n    <!-- ### There is already an fromData with a QByteArray type (that is convertible from Python's str) as the first type. -->\n    <modify-function signature=\"fromData(const uchar*,int,const char*)\" remove=\"all\"/>\n    <!-- ### There is already an loadFromData with a QByteArray type (that is convertible from Python's str) as the first type. -->\n    <modify-function signature=\"loadFromData(const uchar*,int,const char*)\" remove=\"all\" />\n\n    <!-- ### Functions removed because we already have overloads using QString -->\n    <modify-function signature=\"setText(const char*,const char*,QString)\" remove=\"all\" />\n    <modify-function signature=\"text(const char*,const char*)const\" remove=\"all\" />\n    <!-- ### -->\n\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"serialNumber()const\" remove=\"all\"/>\n    <modify-function signature=\"textLanguages()const\" remove=\"all\"/>\n    <!--### end of obsolete section -->\n\n    <modify-function signature=\"constBits()const\" since=\"4.7\">\n        <inject-code>\n            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"bits()\">\n        <inject-code>\n            // byteCount() is only available on Qt4.7, so we use bytesPerLine * height\n            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.bytesPerLine() * %CPPSELF.height(), Shiboken::Buffer::ReadWrite);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"constScanLine(int)const\" since=\"4.7\">\n        <inject-code>\n            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine());\n        </inject-code>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"scanLine(int)\">\n        <inject-code>\n            %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine(), Shiboken::Buffer::ReadWrite);\n        </inject-code>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n    </modify-function>\n    <!--\n        Only the non-const version of bits() and scanLine() is exported to Python\n        If the user don't want to detach the QImage data he must use constBits or constScanLine\n        as Python doesn't have the concept of constness.\n    -->\n    <modify-function signature=\"bits()const\" remove=\"all\"/>\n    <modify-function signature=\"scanLine(int)const\" remove=\"all\"/>\n\n    <modify-function signature=\"invertPixels(QImage::InvertMode)\">\n      <modify-argument index=\"1\">\n        <rename to=\"mode\"/>\n      </modify-argument>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QCursor\" >\n    <extra-includes>\n      <include file-name=\"QPixmap\" location=\"global\"/>\n      <include file-name=\"Qt\" location=\"global\"/>\n    </extra-includes>\n  </value-type>\n  <value-type name=\"QFontDatabase\" >\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"WritingSystem\" />\n  </value-type>\n  <value-type name=\"QPen\">\n    <extra-includes>\n      <include file-name=\"QBrush\" location=\"global\"/>\n    </extra-includes>\n  </value-type>\n  <value-type name=\"QBrush\">\n    <extra-includes>\n      <include file-name=\"QPixmap\" location=\"global\"/>\n    </extra-includes>\n  </value-type>\n\n  <template name=\"qcolor_repr\">\n      switch(%CPPSELF.spec()) {\n        case QColor::Rgb:\n        {\n            qreal r, g, b, a;\n            %CPPSELF.getRgbF(&amp;r, &amp;g, &amp;b, &amp;a);\n            QString repr = QString().sprintf(\"PySide.QtGui.QColor.fromRgbF(%.6f, %.6f, %.6f, %.6f)\", r, g, b, a);\n            %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));\n            break;\n        }\n        case QColor::Hsv:\n        {\n            qreal h, s, v, a;\n            %CPPSELF.getHsvF(&amp;h, &amp;s, &amp;v, &amp;a);\n            QString repr = QString().sprintf(\"PySide.QtGui.QColor.fromHsvF(%.6f, %.6f, %.6f, %.6f)\", h, s, v, a);\n            %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));\n            break;\n        }\n        case QColor::Cmyk:\n        {\n            qreal c, m, y, k, a;\n            %CPPSELF.getCmykF(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);\n            QString repr = QString().sprintf(\"PySide.QtGui.QColor.fromCmykF(%.6f, %.6f, %.6f, %.6f, %.6f)\", c, m, y, k, a);\n            %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));\n            break;\n        }\n        #if QT_VERSION >= 0x040600\n        case QColor::Hsl:\n        {\n            qreal h, s, l, a;\n            %CPPSELF.getHslF(&amp;h, &amp;s, &amp;l, &amp;a);\n            QString repr = QString().sprintf(\"PySide.QtGui.QColor.fromHslF(%.6f, %.6f, %.6f, %.6f)\", h, s, l, a);\n            %PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));\n            break;\n        }\n        #endif\n        default:\n        {\n            %PYARG_0 = Shiboken::String::fromCString(\"PySide.QtGui.QColor()\");\n        }\n     }\n  </template>\n  <value-type name=\"QColor\">\n    <enum-type name=\"Spec\"/>\n    <extra-includes>\n      <include file-name=\"QVariant\" location=\"global\"/>\n    </extra-includes>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"qcolor_repr\" />\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__str__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"qcolor_repr\" />\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__setstate__(PyObject*)\" return-type=\"PyObject\">\n        <inject-code>\n            Shiboken::AutoDecRef func(PyObject_GetAttr(%PYSELF, PyTuple_GET_ITEM(%1, 0)));\n            PyObject* args = PyTuple_GET_ITEM(%1, 1);\n            %PYARG_0 = PyObject_Call(func, args, NULL);\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__reduce__\" return-type=\"PyObject\">\n        <inject-code class=\"target\" position=\"beginning\">\n          switch(%CPPSELF.spec()) {\n            case QColor::Rgb:\n            {\n                qreal r, g, b, a;\n                %CPPSELF.getRgbF(&amp;r, &amp;g, &amp;b, &amp;a);\n                %PYARG_0 = Py_BuildValue(\"(ON(s(ffff)))\", Py_TYPE(%PYSELF), PyTuple_New(0), \"setRgbF\", (float)r, (float)g, (float)b, (float)a);\n                break;\n            }\n            case QColor::Hsv:\n            {\n                qreal h, s, v, a;\n                %CPPSELF.getHsvF(&amp;h, &amp;s, &amp;v, &amp;a);\n                %PYARG_0 = Py_BuildValue(\"(ON(s(ffff)))\", Py_TYPE(%PYSELF), PyTuple_New(0), \"setHsvF\", (float)h, (float)s, (float)v, (float)a);\n                break;\n            }\n            case QColor::Cmyk:\n            {\n                qreal c, m, y, k, a;\n                %CPPSELF.getCmykF(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);\n                %PYARG_0 = Py_BuildValue(\"(ON(s(fffff)))\", Py_TYPE(%PYSELF), PyTuple_New(0), \"setCmykF\", (float)c, (float)m, (float)y, (float)k, (float)a);\n                break;\n            }\n            #if QT_VERSION >= 0x040600\n            case QColor::Hsl:\n            {\n                qreal h, s, l, a;\n                %CPPSELF.getHslF(&amp;h, &amp;s, &amp;l, &amp;a);\n                %PYARG_0 = Py_BuildValue(\"(ON(s(ffff)))\", Py_TYPE(%PYSELF), PyTuple_New(0), \"setHslF\", (float)h, (float)s, (float)l, (float)a);\n                break;\n            }\n            #endif\n            default:\n            {\n                %PYARG_0 = Py_BuildValue(\"(N(O))\", PyObject_Type(%PYSELF), Py_None);\n            }\n          }\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject\">\n        <inject-code class=\"target\" position=\"beginning\">\n          switch(%CPPSELF.spec()) {\n          case QColor::Rgb:\n          {\n                int r, g, b, a;\n                %CPPSELF.getRgb(&amp;r, &amp;g, &amp;b, &amp;a);\n                %PYARG_0 = Py_BuildValue(\"iiii\", r, g, b, a);\n                break;\n          }\n          case QColor::Hsv:\n          {\n                int h, s, v, a;\n                %CPPSELF.getHsv(&amp;h, &amp;s, &amp;v, &amp;a);\n                %PYARG_0 = Py_BuildValue(\"iiii\", h, s, v, a);\n                break;\n          }\n          case QColor::Cmyk:\n          {\n                int c, m, y, k, a;\n                %CPPSELF.getCmyk(&amp;c, &amp;m, &amp;y, &amp;k, &amp;a);\n                %PYARG_0 = Py_BuildValue(\"iiiii\", c, m, y, k, a);\n                break;\n          }\n          case QColor::Hsl:\n          {\n                int h, s, l, a;\n                %CPPSELF.getHsl(&amp;h, &amp;s, &amp;l, &amp;a);\n                %PYARG_0 = Py_BuildValue(\"iiii\", h, s, l, a);\n                break;\n          }\n          default:\n          {\n                %PYARG_0 = 0;\n          }\n        }\n        </inject-code>\n    </add-function>\n    <!-- ### \"QColor(QColor::Spec)\" is an internal method. -->\n    <modify-function signature=\"QColor(QColor::Spec)\" remove=\"all\"/>\n    <!-- ### Constructor removed because we already have an overload using QString. -->\n    <modify-function signature=\"QColor(const char*)\" remove=\"all\" />\n    <!-- ### -->\n    <add-function signature=\"QColor(QVariant)\">\n        <inject-code class=\"target\" position=\"beginning\">\n        if (%1.type() == QVariant::Color)\n            %0 = new %TYPE(%1.value&lt;QColor>());\n        else\n            PyErr_SetString(PyExc_TypeError, \"QVariant must be holding a QColor\");\n        </inject-code>\n    </add-function>\n    <!-- get* methods. Inject code -->\n    <modify-function signature=\"getCmyk(int*,int*,int*,int*,int*)\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"5\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getCmykF(qreal*,qreal*,qreal*,qreal*,qreal*)\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"5\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getHsl(int*,int*,int*,int*)const\" since=\"4.6\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getHslF(qreal*,qreal*,qreal*,qreal*)const\" since=\"4.6\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getHsv(int*,int*,int*,int*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getHsvF(qreal*,qreal*,qreal*,qreal*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getRgb(int*,int*,int*,int*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getRgbF(qreal*,qreal*,qreal*,qreal*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"dark(int)const\" remove=\"all\"/>\n    <modify-function signature=\"light(int)const\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </value-type>\n  <value-type name=\"QFontMetricsF\" >\n\n    <modify-function signature=\"boundingRect(QChar)const\" rename=\"boundingRectChar\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"char\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"QFontCharFix\"/>\n     </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"width(QChar)const\" rename=\"widthChar\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"char\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"QFontCharFix\"/>\n     </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"boundingRect(QRectF,int,QString,int,int*)const\">\n      <modify-argument index=\"5\">\n          <replace-type modified-type=\"PyObject\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        int* array = NULL;\n        bool errorOccurred = false;\n\n        if (numArgs == 5) {\n            array = Shiboken::sequenceToIntArray(%PYARG_5, true);\n            if (PyErr_Occurred()) {\n                if (array)\n                    delete []array;\n                errorOccurred = true;\n            }\n        }\n\n        if (!errorOccurred) {\n            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);\n\n            if (array)\n                delete []array;\n\n            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);\n        }\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"size(int,QString,int,int*)const\">\n      <modify-argument index=\"4\">\n          <replace-type modified-type=\"PyObject\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        int* array = NULL;\n        bool errorOccurred = false;\n\n        if (numArgs == 4) {\n            array = Shiboken::sequenceToIntArray(%PYARG_4, true);\n            if (PyErr_Occurred()) {\n                if (array)\n                    delete []array;\n                errorOccurred = true;\n            }\n        }\n\n        if (!errorOccurred) {\n            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);\n\n            if (array)\n                delete []array;\n\n            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);\n        }\n      </inject-code>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QFontMetrics\" >\n\n    <modify-function signature=\"boundingRect(QChar)const\" rename=\"boundingRectChar\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"char\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"QFontCharFix\"/>\n     </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"width(QChar)const\" rename=\"widthChar\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"char\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"QFontCharFix\"/>\n     </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"boundingRect(int,int,int,int,int,QString,int,int*)const\">\n      <modify-argument index=\"8\">\n        <replace-type modified-type=\"PyObject\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        int* array = NULL;\n        bool errorOccurred = false;\n\n        if (numArgs == 8) {\n            array = Shiboken::sequenceToIntArray(%PYARG_8, true);\n            if (PyErr_Occurred()) {\n                if (array)\n                    delete []array;\n                errorOccurred = true;\n            }\n        }\n\n        if (!errorOccurred) {\n            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, array);\n\n            if (array)\n                delete []array;\n\n            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);\n        }\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"boundingRect(QRect,int,QString,int,int*)const\">\n      <modify-argument index=\"5\">\n          <replace-type modified-type=\"PyObject\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        int* array = NULL;\n        bool errorOccurred = false;\n\n        if (numArgs == 5) {\n            array = Shiboken::sequenceToIntArray(%PYARG_5, true);\n            if (PyErr_Occurred()) {\n                if (array)\n                    delete []array;\n                errorOccurred = true;\n            }\n        }\n\n        if (!errorOccurred) {\n            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);\n\n            if (array)\n                delete []array;\n\n            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);\n        }\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"size(int,QString,int,int*)const\">\n      <modify-argument index=\"4\">\n          <replace-type modified-type=\"PyObject\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        int* array = NULL;\n        bool errorOccurred = false;\n\n        if (numArgs == 4) {\n            array = Shiboken::sequenceToIntArray(%PYARG_4, true);\n            if (PyErr_Occurred()) {\n                if (array)\n                    delete []array;\n                errorOccurred = true;\n            }\n        }\n\n        if (!errorOccurred) {\n            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);\n\n            if (array)\n                delete []array;\n\n            %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);\n        }\n\n      </inject-code>\n    </modify-function>\n  </value-type>\n  <value-type name=\"QGradient\" force-abstract=\"yes\" polymorphic-id-expression=\"%1-&gt;type() == QGradient::NoGradient\">\n      <enum-type name=\"CoordinateMode\"/>\n      <enum-type name=\"InterpolationMode\"/>\n      <enum-type name=\"Spread\" lower-bound=\"QGradient.PadSpread\" upper-bound=\"QGradient.RepeatSpread\"/>\n      <enum-type name=\"Type\"/>\n  </value-type>\n  <value-type name=\"QLinearGradient\" polymorphic-id-expression=\"%1-&gt;type() == QGradient::LinearGradient\" />\n  <object-type name=\"QLayoutItem\">\n\n    <modify-function signature=\"widget()\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"layout()\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"spacerItem()\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n\n  </object-type>\n  <object-type name=\"QPaintDevice\">\n      <enum-type name=\"PaintDeviceMetric\"/>\n  </object-type>\n  <object-type name=\"QGraphicsItem\">\n    <enum-type name=\"CacheMode\"/>\n    <enum-type name=\"Extension\"/>\n    <enum-type name=\"GraphicsItemChange\"/>\n    <enum-type name=\"GraphicsItemFlag\" flags=\"GraphicsItemFlags\"/>\n    <enum-type name=\"PanelModality\" since=\"4.6\"/>\n    <inject-code class=\"target\" position=\"end\">\n        PyObject* userTypeConstant =  PyInt_FromLong(QGraphicsItem::UserType);\n        PyDict_SetItemString(Sbk_QGraphicsItem_Type.super.ht_type.tp_dict, \"UserType\", userTypeConstant);\n    </inject-code>\n    <modify-function signature=\"setParentItem(QGraphicsItem *)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <template name=\"scene_return_parenting\">\n    if (%0) {\n        QObject* parent = %0->parent();\n        Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QObject*](parent));\n        Shiboken::Object::setParent(pyParent, %PYARG_0);\n    }\n    </template>\n    <modify-function signature=\"scene() const\">\n        <inject-code position=\"end\">\n            <insert-template name=\"scene_return_parenting\"/>\n        </inject-code>\n        <modify-argument index=\"this\">\n          <parent index=\"return\" action=\"add\"/>\n        </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"parentItem() const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"target\"/>\n      </modify-argument>\n      <modify-argument index=\"this\">\n        <parent index=\"return\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"parentWidget() const\">\n        <modify-argument index=\"this\">\n          <parent index=\"return\" action=\"add\"/>\n        </modify-argument>\n        <modify-argument index=\"return\">\n          <define-ownership class=\"target\" owner=\"default\"/>\n        </modify-argument>\n    </modify-function>\n    <!-- ### Obsolete -->\n    <modify-function signature=\"setMatrix(QMatrix, bool)\" remove=\"all\"/>\n    <modify-function signature=\"paint(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"collidesWithItem(const QGraphicsItem*,Qt::ItemSelectionMode)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"contextMenuEvent(QGraphicsSceneContextMenuEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"dragEnterEvent(QGraphicsSceneDragDropEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"dragLeaveEvent(QGraphicsSceneDragDropEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"dragMoveEvent(QGraphicsSceneDragDropEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"dropEvent(QGraphicsSceneDragDropEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"focusInEvent(QFocusEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"focusOutEvent(QFocusEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"hoverEnterEvent(QGraphicsSceneHoverEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"hoverLeaveEvent(QGraphicsSceneHoverEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"hoverMoveEvent(QGraphicsSceneHoverEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"inputMethodEvent(QInputMethodEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"isBlockedByModalPanel(QGraphicsItem**)const\" since=\"4.6\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"(retval, blockingPanel)\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n      QGraphicsItem *item_ = NULL;\n      %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;item_);\n      %PYARG_0 = PyTuple_New(2);\n      PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));\n      PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem*](item_));\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"itemTransform(const QGraphicsItem*,bool*)const\">\n        <modify-argument index=\"2\">\n            <remove-argument />\n            <remove-default-expression />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"(QTransform, bool ok)\"/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_args,bool*\" />\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"isObscuredBy(const QGraphicsItem*)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"keyPressEvent(QKeyEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"keyReleaseEvent(QKeyEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mouseMoveEvent(QGraphicsSceneMouseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mousePressEvent(QGraphicsSceneMouseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mouseReleaseEvent(QGraphicsSceneMouseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"sceneEvent(QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"sceneEventFilter(QGraphicsItem*,QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n      <modify-argument index=\"2\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"wheelEvent(QGraphicsSceneWheelEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"children()const\" remove=\"all\"/>\n    <modify-function signature=\"matrix()const\" remove=\"all\"/>\n    <modify-function signature=\"resetMatrix()\" remove=\"all\"/>\n    <modify-function signature=\"sceneMatrix()const\" remove=\"all\"/>\n    <modify-function signature=\"setMatrix(QMatrix, bool)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n    <!-- ### These methods are internal on Qt. -->\n    <modify-function signature=\"supportsExtension(QGraphicsItem::Extension)const\" remove=\"all\"/>\n    <modify-function signature=\"setExtension(QGraphicsItem::Extension,QVariant)\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n  <object-type name=\"QAbstractGraphicsShapeItem\"/>\n  <object-type name=\"QAbstractItemView\">\n    <enum-type name=\"CursorAction\"/>\n    <enum-type name=\"DragDropMode\"/>\n    <enum-type name=\"DropIndicatorPosition\"/>\n    <enum-type name=\"EditTrigger\" flags=\"EditTriggers\"/>\n    <enum-type name=\"ScrollHint\"/>\n    <enum-type name=\"ScrollMode\"/>\n    <enum-type name=\"SelectionBehavior\"/>\n    <enum-type name=\"SelectionMode\"/>\n    <enum-type name=\"State\"/>\n    <modify-function signature=\"setModel(QAbstractItemModel*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setSelectionModel(QItemSelectionModel*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItemDelegate(QAbstractItemDelegate*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"viewOptions()const\">\n      <modify-argument index=\"return\">\n        <replace-default-expression with=\"QStyleOptionViewItem()\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"model() const\">\n      <modify-argument index=\"return\">\n        <!-- Defining ownership as \"default\" avoids the object to be automatically\n             set as parent of the returned pointer. -->\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"selectionModel() const\">\n      <modify-argument index=\"return\">\n        <!-- Defining ownership as \"default\" avoids the object to be automatically\n             set as parent of the returned pointer. -->\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setIndexWidget(const QModelIndex &amp;, QWidget *)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"horizontalStepsPerItem()const\" remove=\"all\"/>\n    <modify-function signature=\"setHorizontalStepsPerItem(int)\" remove=\"all\"/>\n    <modify-function signature=\"setVerticalStepsPerItem(int)\" remove=\"all\"/>\n    <modify-function signature=\"verticalStepsPerItem()const\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n    <modify-function signature=\"edit(QModelIndex,QAbstractItemView::EditTrigger,QEvent*)\">\n      <modify-argument index=\"3\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"selectionCommand(QModelIndex,const QEvent*)const\">\n      <modify-argument index=\"2\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QAbstractSlider\">\n    <enum-type name=\"SliderAction\"/>\n    <enum-type name=\"SliderChange\"/>\n  </object-type>\n  <object-type name=\"QAbstractTextDocumentLayout\">\n    <value-type name=\"PaintContext\" >\n      <include file-name=\"QAbstractTextDocumentLayout\" location=\"global\"/>\n    </value-type>\n    <value-type name=\"Selection\" />\n    <modify-function signature=\"setPaintDevice(QPaintDevice*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"draw(QPainter*,QAbstractTextDocumentLayout::PaintContext)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawInlineObject(QPainter*,QRectF,QTextInlineObject,int,QTextFormat)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QPyTextObject\" />\n  <object-type name=\"QActionGroup\">\n    <modify-function signature=\"addAction(QAction*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeAction(QAction*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QCDEStyle\">\n    <modify-function signature=\"standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const\" virtual-slot=\"yes\"/>\n  </object-type>\n  <object-type name=\"QCheckBox\"/>\n  <object-type name=\"QCleanlooksStyle\">\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const\" remove=\"all\"/>\n    <modify-function signature=\"standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const\" virtual-slot=\"yes\"/>\n  </object-type>\n  <object-type name=\"QCommonStyle\">\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"standardPixmap(QStyle::StandardPixmap, const QStyleOption*,const QWidget*)const\" remove=\"all\"/>\n    <modify-function signature=\"standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const\" virtual-slot=\"yes\"/>\n  </object-type>\n  <object-type name=\"QDataWidgetMapper\">\n    <enum-type name=\"SubmitPolicy\"/>\n    <modify-function signature=\"addMapping(QWidget*,int)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addMapping(QWidget*,int,QByteArray)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeMapping(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItemDelegate(QAbstractItemDelegate*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setModel(QAbstractItemModel*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QDateEdit\"/>\n  <object-type name=\"QDesktopServices\">\n      <enum-type name=\"StandardLocation\"/>\n  </object-type>\n  <object-type name=\"QDialog\">\n    <enum-type name=\"DialogCode\"/>\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\"/>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"extension()const\" remove=\"all\"/>\n    <modify-function signature=\"orientation()const\" remove=\"all\"/>\n    <modify-function signature=\"setOrientation(Qt::Orientation)\" remove=\"all\"/>\n    <modify-function signature=\"showExtension(bool)\" remove=\"all\"/>\n    <modify-function signature=\"setExtension(QWidget*)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </object-type>\n  <object-type name=\"QDialogButtonBox\">\n    <enum-type name=\"ButtonLayout\"/>\n    <enum-type name=\"ButtonRole\"/>\n    <enum-type name=\"StandardButton\" flags=\"StandardButtons\" />\n    <modify-function signature=\"addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeButton(QAbstractButton*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QDirModel\" polymorphic-id-expression=\"qobject_cast&lt;QDirModel*&gt;(%1)\">\n    <enum-type name=\"Roles\"/>\n    <!-- ### This reimplementation of \"QObject::parent()\" is used in C++ only\n         when \"using QObject::parent;\" is not available. It's useless in Python. -->\n    <modify-function signature=\"parent()const\" remove=\"all\"/>\n    <modify-function signature=\"setIconProvider(QFileIconProvider*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QDoubleValidator\">\n      <enum-type name=\"Notation\"/>\n  </object-type>\n  <object-type name=\"QFileIconProvider\">\n      <enum-type name=\"IconType\"/>\n  </object-type>\n  <object-type name=\"QWizard\">\n    <enum-type name=\"WizardButton\" />\n    <enum-type name=\"WizardOption\" flags=\"WizardOptions\"/>\n    <enum-type name=\"WizardPixmap\"/>\n    <enum-type name=\"WizardStyle\"/>\n    <modify-function signature=\"addPage(QWizardPage*)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setButton(QWizard::WizardButton,QAbstractButton*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QWizardPage\">\n    <modify-function signature=\"wizard()const\">\n      <modify-argument index=\"this\">\n        <parent index=\"return\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QFocusFrame\">\n    <modify-function signature=\"setWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QFontComboBox\">\n      <enum-type name=\"FontFilter\" flags=\"FontFilters\"/>\n  </object-type>\n  <object-type name=\"QFontDialog\">\n    <enum-type name=\"FontDialogOption\" flags=\"FontDialogOptions\"/>\n    <modify-function signature=\"getFont(bool*,QWidget*)\" allow-thread=\"yes\">\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyTuple\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_bool*,arg\"/>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getFont(bool*,QFont,QWidget*)\" allow-thread=\"yes\">\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyTuple\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_bool*,arg,arg\"/>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getFont(bool*,QFont,QWidget*,QString)\" allow-thread=\"yes\">\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyTuple\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_bool*,arg,arg,arg\"/>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getFont(bool*,QFont,QWidget*,QString,QFlags&lt;QFontDialog::FontDialogOption&gt;)\">\n        <modify-argument index=\"1\">\n            <remove-argument />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyTuple\" />\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_bool*,arg,arg,arg,arg\"/>\n        </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QGraphicsEllipseItem\">\n  </object-type>\n  <object-type name=\"QGraphicsItemAnimation\">\n    <modify-function signature=\"setItem(QGraphicsItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setTimeLine(QTimeLine*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <extra-includes>\n      <include file-name=\"QPair\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QGraphicsItemGroup\"/>\n  <object-type name=\"QGraphicsLineItem\" />\n  <object-type name=\"QGraphicsPathItem\" />\n  <object-type name=\"QGraphicsPixmapItem\">\n      <enum-type name=\"ShapeMode\"/>\n  </object-type>\n  <object-type name=\"QGraphicsPolygonItem\"/>\n  <object-type name=\"QGraphicsRectItem\" />\n  <object-type name=\"QGraphicsSimpleTextItem\" />\n  <object-type name=\"QHBoxLayout\"/>\n  <object-type name=\"QHeaderView\">\n    <enum-type name=\"ResizeMode\" />\n    <modify-function signature=\"paintSection(QPainter*,QRect,int)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QIconEngine\">\n    <modify-function signature=\"paint(QPainter*,QRect,QIcon::Mode,QIcon::State)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QIconEngineV2\">\n    <enum-type name=\"IconEngineHook\"/>\n    <modify-function signature=\"read(QDataStream&amp;)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"write(QDataStream&amp;)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <!-- ### This makes little sense in Python. Could be reassessed later. -->\n    <modify-function signature=\"virtual_hook(int,void*)\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QImageWriter\">\n    <enum-type name=\"ImageWriterError\"/>\n    <modify-function signature=\"setDevice(QIODevice*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"write(const QImage&amp;)\" allow-thread=\"yes\"/>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"description()const\" remove=\"all\"/>\n    <modify-function signature=\"setDescription(QString)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </object-type>\n  <object-type name=\"QInputContextFactory\"/>\n  <object-type name=\"QIntValidator\" />\n  <object-type name=\"QItemDelegate\">\n    <!-- ### \"doLayout(...)\" is an internal method. -->\n    <modify-function signature=\"doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const\" remove=\"all\" />\n    <!-- ### \"selected(QPixmap,QPalette,bool)\" is an internal method. -->\n    <modify-function signature=\"selected(QPixmap,QPalette,bool)const\" remove=\"all\"/>\n    <!-- ### -->\n    <modify-function signature=\"drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawDecoration(QPainter*,QStyleOptionViewItem,QRect,QPixmap)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawDisplay(QPainter*,QStyleOptionViewItem,QRect,QString)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawFocus(QPainter*,QStyleOptionViewItem,QRect)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"setItemEditorFactory(QItemEditorFactory*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QItemEditorCreatorBase\">\n    <modify-function signature=\"createWidget(QWidget *) const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QItemEditorFactory\">\n      <modify-function signature=\"registerEditor(QVariant::Type, QItemEditorCreatorBase *)\">\n      <modify-argument index=\"2\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n      <inject-code>\n        Shiboken::Object::releaseOwnership(%PYARG_2);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"setDefaultFactory(QItemEditorFactory *)\">\n      <modify-argument index=\"1\">\n        <define-ownership owner=\"c++\"/>\n      </modify-argument>\n      <inject-code>\n        //this function is static we need keep ref to default value, to be able to call python virtual functions\n        static PyObject* _defaultValue = 0;\n        %CPPSELF.%FUNCTION_NAME(%1);\n        Py_INCREF(%PYARG_1);\n        if (_defaultValue)\n            Py_DECREF(_defaultValue);\n\n        _defaultValue = %PYARG_1;\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QItemSelectionModel\">\n      <enum-type name=\"SelectionFlag\" flags=\"SelectionFlags\"/>\n  </object-type>\n  <object-type name=\"QListView\">\n      <enum-type name=\"Flow\"/>\n      <enum-type name=\"LayoutMode\"/>\n      <enum-type name=\"Movement\"/>\n      <enum-type name=\"ResizeMode\"/>\n      <enum-type name=\"ViewMode\"/>\n  </object-type>\n  <object-type name=\"QColumnView\">\n    <modify-function signature=\"setPreviewWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QMainWindow\">\n    <enum-type name=\"DockOption\" flags=\"DockOptions\"/>\n    <modify-function signature=\"setCentralWidget(QWidget*)\">\n       <inject-code class=\"target\" position=\"beginning\">\n         <insert-template name=\"replace_child\">\n           <replace from=\"$FUNCTION_GET_OLD\" to=\"centralWidget\" />\n           <replace from=\"$CHILD_TYPE\" to=\"QWidget\" />\n           <replace from=\"$PYARG\" to=\"%PYARG_1\" />\n           <replace from=\"$CPPARG\" to=\"%1\" />\n         </insert-template>\n       </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setMenuBar(QMenuBar*)\">\n       <inject-code class=\"target\" position=\"beginning\">\n         <insert-template name=\"replace_child\">\n           <replace from=\"$FUNCTION_GET_OLD\" to=\"menuBar\" />\n           <replace from=\"$CHILD_TYPE\" to=\"QMenuBar\" />\n           <replace from=\"$PYARG\" to=\"%PYARG_1\" />\n           <replace from=\"$CPPARG\" to=\"%1\" />\n         </insert-template>\n       </inject-code>\n   </modify-function>\n\n   <modify-function signature=\"setMenuWidget(QWidget*)\">\n       <inject-code class=\"target\" position=\"beginning\">\n         <insert-template name=\"replace_child\">\n           <replace from=\"$FUNCTION_GET_OLD\" to=\"menuWidget\" />\n           <replace from=\"$CHILD_TYPE\" to=\"QWidget\" />\n           <replace from=\"$PYARG\" to=\"%PYARG_1\" />\n           <replace from=\"$CPPARG\" to=\"%1\" />\n         </insert-template>\n       </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setStatusBar(QStatusBar*)\">\n       <inject-code class=\"target\" position=\"beginning\">\n         <insert-template name=\"replace_child\">\n           <replace from=\"$FUNCTION_GET_OLD\" to=\"statusBar\" />\n           <replace from=\"$CHILD_TYPE\" to=\"QStatusBar\" />\n           <replace from=\"$PYARG\" to=\"%PYARG_1\" />\n           <replace from=\"$CPPARG\" to=\"%1\" />\n         </insert-template>\n       </inject-code>\n   </modify-function>\n\n   <modify-function signature=\"addDockWidget(Qt::DockWidgetArea, QDockWidget*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addDockWidget(Qt::DockWidgetArea,QDockWidget*,Qt::Orientation)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!-- this fuction is declared when not defined QT_NO_TOOLBA -->\n    <modify-function signature=\"addToolbar(Qt::ToolBarArea, QToolBar*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addToolbar(QToolBar*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addToolbar(const QString&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!--- END QT_NO_TOOLBAR -->\n    <modify-function signature=\"removeDockWidget(QDockWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeToolBar(QToolBar*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeDockWidget(QDockWidget*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n\n  </object-type>\n  <object-type name=\"QMdiArea\">\n    <enum-type name=\"AreaOption\" flags=\"AreaOptions\"/>\n    <enum-type name=\"ViewMode\"/>\n    <enum-type name=\"WindowOrder\"/>\n    <modify-function signature=\"addSubWindow(QWidget*, QFlags&lt;Qt::WindowType&gt;)\" >\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QMdiSubWindow\">\n    <enum-type name=\"SubWindowOption\" flags=\"SubWindowOptions\"/>\n    <modify-function signature=\"setWidget(QWidget*)\" >\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setSystemMenu(QMenu*)\" >\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QMenu\">\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qmenu_glue.cpp\"/>\n\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\" />\n    <modify-function signature=\"exec(const QPoint&amp;, QAction*)\" rename=\"exec_\" allow-thread=\"yes\" />\n    <modify-function signature=\"exec(QList&lt;QAction*>, const QPoint&amp;, QAction*)\" rename=\"exec_\" allow-thread=\"yes\" />\n    <modify-function signature=\"exec(QList&lt;QAction*>, const QPoint&amp;, QAction*, QWidget*)\" rename=\"exec_\" allow-thread=\"yes\" />\n    <modify-function signature=\"addAction(const QString&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addMenu(QMenu*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addMenu(const QString&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addMenu(const QIcon &amp;, const QString &amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertMenu(QAction*,QMenu*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"2\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addMenu(const QString&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addMenu(const QIcon &amp;, const QString &amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!-- ### \"setNoReplayFor(QWidget*)\" is an internal method. -->\n    <modify-function signature=\"setNoReplayFor(QWidget*)\" remove=\"all\" />\n\n    <add-function signature=\"addAction(QString&amp;, PyObject*, QKeySequence&amp;)\">\n      <modify-argument index=\"3\">\n        <replace-default-expression with=\"0\" />\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n\n      <inject-code class=\"target\" position=\"beginning\">\n        %PYARG_0 = addActionWithPyObject(%CPPSELF, QIcon(), %1, %2, %3);\n      </inject-code>\n    </add-function>\n\n    <add-function signature=\"addAction(QIcon&amp;, QString&amp;, PyObject*, QKeySequence&amp;)\">\n      <modify-argument index=\"4\">\n        <replace-default-expression with=\"0\" />\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n\n      <inject-code class=\"target\" position=\"beginning\">\n        %PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2, %3, %4);\n      </inject-code>\n    </add-function>\n\n    <modify-function signature=\"clear()\">\n      <inject-code>\n          Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();\n          PyObject* pyObj;\n          foreach(QAction* act, %CPPSELF.actions()) {\n            if ((pyObj = (PyObject*)bm.retrieveWrapper(act)) != 0) {\n                Py_INCREF(pyObj);\n                Shiboken::Object::setParent(NULL, pyObj);\n                Shiboken::Object::invalidate(pyObj);\n                Py_DECREF(pyObj);\n            }\n          }\n      </inject-code>\n    </modify-function>\n\n  </object-type>\n\n  <object-type name=\"QMenuBar\">\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qmenubar_glue.cpp\"/>\n    <modify-function signature=\"addAction(const QString&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addAction(QString,const QObject*,const char*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <add-function signature=\"addAction(const QString&amp;, PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        %PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2);\n      </inject-code>\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </add-function>\n    <modify-function signature=\"addMenu(QMenu*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addSeparator()\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertMenu(QAction*,QMenu*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"2\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertSeparator(QAction*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"clear()\">\n      <inject-code>\n          foreach(QAction *act, %CPPSELF.actions()) {\n            Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));\n            Shiboken::Object::setParent(NULL, pyAct);\n            Shiboken::Object::invalidate(pyAct);\n          }\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QMotifStyle\">\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const\" remove=\"all\"/>\n    <modify-function signature=\"standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const\" virtual-slot=\"yes\"/>\n  </object-type>\n  <object-type name=\"QPainterPathStroker\" copyable=\"false\"/>\n  <object-type name=\"QPictureIO\">\n    <modify-function signature=\"setIODevice(QIODevice*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QPixmapCache\">\n    <value-type name=\"Key\"/>\n    <add-function signature=\"find(QPixmapCache::Key&amp;)\">\n        <inject-code>\n            QPixmap p;\n            if (%CPPSELF.%FUNCTION_NAME(%1, &amp;p)) {\n                %PYARG_0 = %CONVERTTOPYTHON[QPixmap](p);\n            } else {\n                %PYARG_0 = Py_None;\n                Py_INCREF(%PYARG_0);\n            }\n        </inject-code>\n    </add-function>\n    <!-- ### Obsolete. -->\n    <modify-function signature=\"find(QString,QPixmap&amp;)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </object-type>\n  <object-type name=\"QPlastiqueStyle\">\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const\" remove=\"all\"/>\n    <modify-function signature=\"standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const\" virtual-slot=\"yes\"/>\n    <modify-function signature=\"layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const\" virtual-slot=\"yes\"/>\n  </object-type>\n  <object-type name=\"QProgressBar\">\n      <enum-type name=\"Direction\"/>\n  </object-type>\n  <object-type name=\"QPushButton\" />\n  <object-type name=\"QRegExpValidator\" />\n  <object-type name=\"QScrollArea\">\n    <modify-function signature=\"setWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QShortcut\">\n    <add-function signature=\"QShortcut(QKeySequence&amp;, QWidget*, PyCallable*, Qt::ShortcutContext)\">\n      <modify-argument index=\"4\">\n        <replace-default-expression with=\"Qt::WindowShortcut\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        %0 = new %TYPE(%1, %2);\n      </inject-code>\n      <inject-code class=\"target\" position=\"end\">\n        Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, \"connect\", \"OsO\", %PYSELF, SIGNAL(activated()), %PYARG_3));\n        if (!result.isNull())\n            Shiboken::Object::setParent(%PYARG_2, %PYSELF);\n      </inject-code>\n    </add-function>\n  </object-type>\n  <object-type name=\"QSound\"/>\n  <object-type name=\"QSpacerItem\"/>\n  <object-type name=\"QStandardItem\">\n    <enum-type name=\"ItemType\"/>\n    <modify-function signature=\"operator&lt;(QStandardItem)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"read(QDataStream&amp;)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"write(QDataStream&amp;)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n\n    <modify-function signature=\"appendColumn(const QList&lt;QStandardItem *&gt; &amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"appendRow(const QList&lt;QStandardItem *&gt; &amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"appendRow(QStandardItem *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"appendRows(const QList&lt;QStandardItem *&gt; &amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"insertColumn(int, const QList&lt;QStandardItem *&gt; &amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertRow(int, const QList&lt;QStandardItem *&gt; &amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertRows(int, const QList&lt;QStandardItem *&gt; &amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setChild(int, int, QStandardItem *)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        // Clear parent from the old child\n        QStandardItem* _i = %CPPSELF->child(%1, %2);\n        if (_i) {\n            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);\n            Shiboken::Object::setParent(0, _pyI);\n        }\n      </inject-code>\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setChild(int, QStandardItem *)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        // Clear parent from the old child\n        QStandardItem* _i = %CPPSELF->child(%1);\n        if (_i) {\n            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);\n            Shiboken::Object::setParent(0, _pyI);\n        }\n      </inject-code>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n     <modify-function signature=\"takeChild(int, int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"clone() const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"native\" owner=\"c++\"/>\n        <define-ownership class=\"target\" owner=\"target\"/>\n      </modify-argument>\n    </modify-function>\n\n    <!-- ??? -->\n    <modify-function signature=\"operator&lt;(QStandardItem)const\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QStatusBar\">\n    <modify-function signature=\"addWidget(QWidget*, int)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addPermanentWidget(QWidget*, int)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertWidget(int, QWidget*, int)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertPermanentWidget(int, QWidget*, int)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QStringListModel\"/>\n  <object-type name=\"QStyleFactory\">\n    <modify-function signature=\"create(const QString&amp;)\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"target\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QStyleHintReturn\">\n      <enum-type name=\"HintReturnType\"/>\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleHintReturnVariant\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStyleHintReturnMask\">\n      <enum-type name=\"StyleOptionType\"/>\n      <enum-type name=\"StyleOptionVersion\"/>\n  </object-type>\n  <object-type name=\"QStylePainter\" />\n  <object-type name=\"QSyntaxHighlighter\">\n    <modify-function signature=\"setCurrentBlockUserData(QTextBlockUserData*)\">\n      <modify-argument index=\"1\">\n        <define-ownership class=\"target\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setDocument(QTextDocument*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"document() const\">\n      <modify-argument index=\"this\">\n        <parent index=\"return\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTableView\">\n    <modify-function signature=\"setHorizontalHeader(QHeaderView*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setVerticalHeader(QHeaderView*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"sortByColumn(int)\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QTextBlockGroup\" />\n  <object-type name=\"QTextBlockUserData\" />\n  <object-type name=\"QTextItem\">\n      <enum-type name=\"RenderFlag\" flags=\"RenderFlags\"/>\n  </object-type>\n  <object-type name=\"QTextList\" >\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"isEmpty()const\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QTextObject\"/>\n  <object-type name=\"QTextObjectInterface\" >\n    <modify-function signature=\"drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTimeEdit\"/>\n  <object-type name=\"QToolBox\">\n    <modify-function signature=\"addItem(QWidget*, const QIcon&amp;, const QString&amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addItem(QWidget*, const QString&amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertItem(int, QWidget*, const QIcon&amp;, const QString&amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertItem(int, QWidget*, const QString&amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeItem(int)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        QWidget *_widget = %CPPSELF.widget(%1);\n        if (_widget) {\n            Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));\n            Shiboken::Object::setParent(0, pyWidget);\n        }\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QToolButton\">\n    <enum-type name=\"ToolButtonPopupMode\"/>\n    <modify-function signature=\"setDefaultAction(QAction *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setMenu(QMenu *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QToolTip\"/>\n  <object-type name=\"QTreeView\">\n    <modify-function signature=\"drawBranches(QPainter*,QRect,QModelIndex)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawRow(QPainter*,QStyleOptionViewItem,QModelIndex)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"sortByColumn(int)\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QUndoCommand\">\n    <modify-function signature=\"mergeWith(const QUndoCommand*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QUndoGroup\">\n    <modify-function signature=\"addStack(QUndoStack*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeStack(QUndoStack*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QUndoStack\">\n    <modify-function signature=\"createUndoAction(QObject*, const QString&amp;)const\">\n      <modify-argument index=\"return\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"createRedoAction(QObject*, const QString&amp;)const\">\n      <modify-argument index=\"return\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"push(QUndoCommand*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QUndoView\">\n    <modify-function signature=\"setGroup(QUndoGroup *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setStack(QUndoStack *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QUndoView(QUndoGroup *,QWidget *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QUndoView(QUndoStack *,QWidget *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QVBoxLayout\"/>\n\n  <template name=\"validator_conversionrule\">\n        QValidator::State %out;\n\n        if (PySequence_Check(%PYARG_0)) {\n            Shiboken::AutoDecRef seq(PySequence_Fast(%PYARG_0, 0));\n            int size = PySequence_Fast_GET_SIZE(seq.object());\n\n            if (size > 1) {\n                if (%ISCONVERTIBLE[QString](PySequence_Fast_GET_ITEM(seq.object(), 1)))\n                    %1 = %CONVERTTOCPP[QString](PySequence_Fast_GET_ITEM(seq.object(), 1));\n                else\n                    qWarning(\"%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to unicode.\");\n            }\n\n            if (size > 2) {\n                if (%ISCONVERTIBLE[int](PySequence_Fast_GET_ITEM(seq.object(), 2)))\n                    %2 = %CONVERTTOCPP[int](PySequence_Fast_GET_ITEM(seq.object(), 2));\n                else\n                    qWarning(\"%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to int.\");\n            }\n            %PYARG_0 = PySequence_Fast_GET_ITEM(seq.object(), 0);\n            Py_INCREF(%PYARG_0); // we need to incref, because \"%PYARG_0 = ...\" will decref the tuple and the tuple will be decrefed again at the end of this scope.\n        }\n\n        // check retrun value\n        if (%ISCONVERTIBLE[QValidator::State](%PYARG_0)) {\n            %out = %CONVERTTOCPP[QValidator::State](%PYARG_0);\n        } else {\n            PyErr_Format(PyExc_TypeError, \"Invalid return value in function %s, expected %s, got %s.\",\n                        \"QValidator.validate\",\n                        \"PySide.QtGui.QValidator.State, (PySide.QtGui.QValidator.State,), (PySide.QtGui.QValidator.State, unicode) or (PySide.QtGui.QValidator.State, unicode, int)\",\n                        pyResult->ob_type->tp_name);\n            return QValidator::State();\n        }\n  </template>\n\n  <object-type name=\"QValidator\">\n    <enum-type name=\"State\"/>\n    <modify-function signature=\"fixup(QString &amp;)const\">\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"QString\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"return_QString\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"validate(QString &amp;, int &amp;)const\">\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"PyObject\"/>\n        <conversion-rule class=\"native\">\n            <insert-template name=\"validator_conversionrule\"/>\n        </conversion-rule>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"return_tuple_QValidator_QString_int\"/>\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QWhatsThis\"/>\n  <object-type name=\"QWidgetAction\">\n    <modify-function signature=\"setDefaultWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"releaseWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\" />\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QWidgetItem\" polymorphic-id-expression=\"%1-&gt;widget()\" />\n  <object-type name=\"QWindowsStyle\">\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const\" remove=\"all\"/>\n    <modify-function signature=\"standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const\" virtual-slot=\"yes\"/>\n  </object-type>\n  <object-type name=\"QWorkspace\">\n    <enum-type name=\"WindowOrder\"/>\n    <modify-function signature=\"addWindow(QWidget*, QFlags&lt;Qt::WindowType>)\">\n        <modify-argument index=\"1\">\n            <parent index=\"this\" action=\"add\" />\n        </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QActionEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged\" />\n  <object-type name=\"QClipboardEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Clipboard\"/>\n  <object-type name=\"QCloseEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Close\"/>\n  <object-type name=\"QContextMenuEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::ContextMenu\">\n      <enum-type name=\"Reason\"/>\n  </object-type>\n  <object-type name=\"QDragEnterEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::DragEnter\"/>\n  <object-type name=\"QDragLeaveEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::DragLeave\"/>\n  <object-type name=\"QDragMoveEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::DragMove\" />\n  <object-type name=\"QDropEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Drop\">\n    <modify-function signature=\"source() const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"target\"/>\n      </modify-argument>\n    </modify-function>\n    <!--### Method encodedData(const char*) exists only for Qt3 compatibility. -->\n    <modify-function signature=\"encodedData(const char*)const\" remove=\"all\"/>\n    <!--### Method format(int) exists only for Qt3 compatibility. -->\n    <modify-function signature=\"format(int)const\" remove=\"all\"/>\n    <!--### Method provides(const char*) exists only for Qt3 compatibility. -->\n    <modify-function signature=\"provides(const char*)const\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n  <object-type name=\"QFileOpenEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::FileOpen\" />\n  <object-type name=\"QFocusEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut\" />\n  <object-type name=\"QGraphicsSceneContextMenuEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::GraphicsSceneContextMenu\">\n      <enum-type name=\"Reason\"/>\n  </object-type>\n  <object-type name=\"QGraphicsSceneDragDropEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::GraphicsSceneDragEnter || %1-&gt;type() == QEvent::GraphicsSceneDragLeave || %1-&gt;type() == QEvent::GraphicsSceneDragMove || %1-&gt;type() == QEvent::GraphicsSceneDrop\" >\n    <!-- ### \"setMimeData(const QMimeData*)\" is an internal method. -->\n    <modify-function signature=\"setMimeData(const QMimeData *)\" remove=\"all\"/>\n    <!-- ### \"setSource(QWidget*)\" is an internal method. -->\n    <modify-function signature=\"setSource(QWidget *)\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n  <object-type name=\"QGraphicsSceneEvent\" copyable=\"false\">\n    <!-- ### \"setWidget(QWidget*)\" is an internal method. -->\n    <modify-function signature=\"setWidget(QWidget *)\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QGraphicsSceneMoveEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::GraphicsSceneMove\" />\n  <object-type name=\"QGraphicsSceneResizeEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::GraphicsSceneResize\" />\n  <object-type name=\"QGraphicsSceneHelpEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::GraphicsSceneHelp\" />\n  <object-type name=\"QGraphicsSceneHoverEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove\" />\n  <object-type name=\"QGraphicsSceneMouseEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::GraphicsSceneMouseDoubleClick || %1-&gt;type() == QEvent::GraphicsSceneMouseMove || %1-&gt;type() == QEvent::GraphicsSceneMousePress || %1-&gt;type() == QEvent::GraphicsSceneMouseRelease\"/>\n  <object-type name=\"QGraphicsSceneWheelEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::GraphicsSceneWheel\"/>\n  <object-type name=\"QHelpEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis\"/>\n  <object-type name=\"QHideEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Hide\"/>\n  <object-type name=\"QHoverEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove\"/>\n  <object-type name=\"QIconDragEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::IconDrag\"/>\n\n  <object-type name=\"QInputMethodEvent\" copyable=\"no\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::InputMethod\">\n    <!-- only declare this if ndef QT_NO_INPUTMETHOD -->\n    <enum-type name=\"AttributeType\"/>\n    <value-type name=\"Attribute\">\n      <include file-name=\"QInputMethodEvent\" location=\"global\"/>\n    </value-type>\n    <!-- endif ndef QT_NO_INPUTMETHOD -->\n  </object-type>\n\n  <object-type name=\"QMoveEvent\" copyable = \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Move\" />\n  <object-type name=\"QResizeEvent\" copyable = \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Resize\"/>\n  <object-type name=\"QShortcutEvent\" copyable = \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Shortcut\">\n    <!-- All these have const overloads that are used instead -->\n    <modify-function signature=\"isAmbiguous()\" remove=\"all\"/>\n    <modify-function signature=\"shortcutId()\" remove=\"all\"/>\n    <modify-function signature=\"key()\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n  <object-type name=\"QShowEvent\" copyable= \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Show\"/>\n  <object-type name=\"QStatusTipEvent\" copyable= \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::StatusTip\"/>\n  <object-type name=\"QTabletEvent\" copyable= \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease\">\n      <enum-type name=\"PointerType\"/>\n      <enum-type name=\"TabletDevice\"/>\n  </object-type>\n  <object-type name=\"QToolBarChangeEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::ToolBarChange\"/>\n  <object-type name=\"QWhatsThisClickedEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::WhatsThisClicked\"/>\n  <object-type name=\"QWheelEvent\" copyable= \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Wheel\"/>\n  <object-type name=\"QWindowStateChangeEvent\" copyable=\"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::WindowStateChange\"/>\n  <object-type name=\"QInputEvent\" copyable=\"false\">\n    <modify-function signature=\"modifiers()const\" access=\"non-final\"/>\n  </object-type>\n  <object-type name=\"QKeyEvent\" copyable= \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease || %1-&gt;type() == QEvent::ShortcutOverride\">\n      <add-function signature=\"operator!=(QKeySequence::StandardKey)\">\n          <inject-code class=\"target\">\n          bool ret = !(&amp;%CPPSELF == %1);\n          %PYARG_0 = %CONVERTTOPYTHON[bool](ret);\n          </inject-code>\n      </add-function>\n  </object-type>\n  <object-type name=\"QMouseEvent\" copyable= \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove\"/>\n  <object-type name=\"QPaintEvent\" copyable= \"false\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Paint\"/>\n  <object-type name=\"QAccessibleEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::AccessibilityDescription || %1-&gt;type() == QEvent::AccessibilityHelp\"/>\n  <object-type name=\"QGestureEvent\" polymorphic-id-expression=\"%1-&gt;type() == QEvent::Gesture || %1-&gt;type() == QEvent::GestureOverride\" since=\"4.6\">\n    <modify-function signature=\"activeGestures()const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"canceledGestures()const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"gestures()const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"gesture(Qt::GestureType)const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"widget()const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QAbstractButton\"/>\n  <object-type name=\"QStyle\">\n    <enum-type name=\"ComplexControl\" extensible=\"yes\"/>\n    <enum-type name=\"ContentsType\" extensible=\"yes\"/>\n    <enum-type name=\"ControlElement\" extensible=\"yes\"/>\n    <enum-type name=\"PixelMetric\" extensible=\"yes\" />\n    <enum-type name=\"PrimitiveElement\" extensible=\"yes\" />\n    <enum-type name=\"RequestSoftwareInputPanel\" since=\"4.6\"/>\n    <enum-type name=\"StandardPixmap\" extensible=\"yes\"/>\n    <enum-type name=\"StateFlag\" flags=\"State\"/>\n    <enum-type name=\"StyleHint\" extensible=\"yes\" />\n    <enum-type name=\"SubControl\" flags=\"SubControls\" extensible=\"yes\" force-integer=\"yes\"/>\n    <enum-type name=\"SubElement\" extensible=\"yes\" />\n    <modify-function signature=\"standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const\" virtual-slot=\"yes\"/>\n    <modify-function signature=\"layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const\" virtual-slot=\"yes\"/>\n    <modify-function signature=\"drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const\">\n      <modify-argument index=\"3\" invalidate-after-use=\"yes\"/>\n      <modify-argument index=\"4\">\n        <replace-default-expression with=\"0\"/>\n        <rename to=\"widget\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const\">\n      <modify-argument index=\"3\" invalidate-after-use=\"yes\"/>\n      <modify-argument index=\"4\">\n        <replace-default-expression with=\"0\"/>\n        <rename to=\"widget\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const\">\n      <modify-argument index=\"3\" invalidate-after-use=\"yes\"/>\n      <modify-argument index=\"4\">\n        <replace-default-expression with=\"0\"/>\n        <rename to=\"widget\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"hitTestComplexControl(QStyle::ComplexControl, const QStyleOptionComplex*, const QPoint&amp;, const QWidget*)const\">\n      <modify-argument index=\"4\">\n        <replace-default-expression with=\"0\"/>\n        <rename to=\"widget\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const\">\n      <modify-argument index=\"4\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawItemPixmap(QPainter*,QRect,int,QPixmap)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawItemText(QPainter*,QRect,int,QPalette,bool,QString,QPalette::ColorRole)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QColorDialog\">\n    <enum-type name=\"ColorDialogOption\" flags=\"ColorDialogOptions\"/>\n    <!-- Obsolete method -->\n    <modify-function signature=\"getRgba(uint,bool*,QWidget*)\" remove=\"all\" />\n    <modify-function signature=\"getColor(const QColor&amp;, QWidget*)\" allow-thread=\"yes\" />\n    <modify-function signature=\"getColor(const QColor&amp;, QWidget*, const QString&amp;, QFlags&lt;QColorDialog::ColorDialogOption>)\" allow-thread=\"yes\" />\n  </object-type>\n  <object-type name=\"QLayout\">\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qlayout_help_functions.cpp\"/>\n\n    <enum-type name=\"SizeConstraint\"/>\n\n    <modify-function signature=\"itemAt(int)const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        addLayoutOwnership(%CPPSELF, %0);\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"removeWidget(QWidget*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        removeLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"removeItem(QLayoutItem*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        removeLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"parentWidget()const\">\n      <modify-argument index=\"this\">\n        <parent index=\"return\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"takeAt(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"addItem(QLayoutItem*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"addWidget(QWidget *)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addChildWidget(QWidget *)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addChildLayout(QLayout*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"setMenuBar(QWidget*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"getContentsMargins(int*,int*,int*,int*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n        <inject-code class=\"native\" position=\"end\">\n            <insert-template name=\"fix_native_return_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <!-- ### Obsolete in 4.3 -->\n    <modify-function signature=\"setMargin(int)\" remove=\"all\"/>\n    <modify-function signature=\"margin()const\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n\n  <object-type name=\"QStackedLayout\">\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qlayout_help_functions.cpp\"/>\n    <enum-type name=\"StackingMode\"/>\n    <modify-function signature=\"insertWidget(int,QWidget*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %2);\n      </inject-code>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QBoxLayout\">\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qlayout_help_functions.cpp\"/>\n\n    <enum-type name=\"Direction\" />\n\n    <modify-function signature=\"addWidget(QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"addLayout(QLayout *, int)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"insertWidget(int, QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %2);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"insertLayout(int, QLayout *, int)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %2);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"insertItem(int, QLayoutItem *)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %2);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addSpacerItem(QSpacerItem*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"insertSpacerItem(int,QSpacerItem*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %2);\n      </inject-code>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QGridLayout\">\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qlayout_help_functions.cpp\"/>\n    <modify-function signature=\"itemAtPosition (int, int) const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        addLayoutOwnership(%CPPSELF, %0);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addWidget(QWidget *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"4\">\n        <rename to=\"alignment\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addWidget(QWidget *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"6\">\n        <rename to=\"alignment\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addLayout(QLayout *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"4\">\n        <rename to=\"alignment\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addLayout(QLayout *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"6\">\n        <rename to=\"alignment\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addItem(QLayoutItem *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"4\">\n        <rename to=\"rowSpan\"/>\n      </modify-argument>\n      <modify-argument index=\"5\">\n        <rename to=\"columnSpan\"/>\n      </modify-argument>\n      <modify-argument index=\"6\">\n        <rename to=\"alignment\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        addLayoutOwnership(%CPPSELF, %1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"getItemPosition(int,int*,int*,int*,int*)\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject*\" />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"5\">\n            <remove-argument/>\n            <remove-default-expression/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n        int a, b, c, d;\n        %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b, &amp;c, &amp;d);\n        %PYARG_0 = PyTuple_New(4);\n        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](a));\n        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](b));\n        PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](c));\n        PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](d));\n        </inject-code>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QGraphicsView\">\n    <extra-includes>\n      <include file-name=\"QPainterPath\" location=\"global\"/>\n      <include file-name=\"QVarLengthArray\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"CacheModeFlag\" flags=\"CacheMode\"/>\n    <enum-type name=\"DragMode\"/>\n    <enum-type name=\"OptimizationFlag\" flags=\"OptimizationFlags\"/>\n    <enum-type name=\"ViewportAnchor\"/>\n    <enum-type name=\"ViewportUpdateMode\"/>\n    <modify-function signature=\"setupViewport(QWidget *)\" access=\"non-final\"/>\n    <modify-function signature=\"setScene(QGraphicsScene*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"scene()const\">\n        <inject-code position=\"end\">\n            <insert-template name=\"scene_return_parenting\"/>\n        </inject-code>\n        <modify-argument index=\"return\">\n            <define-ownership owner=\"default\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"itemAt(int,int)const\">\n        <modify-argument index=\"return\">\n            <define-ownership owner=\"default\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"itemAt(QPoint)const\">\n        <modify-argument index=\"return\">\n            <define-ownership owner=\"default\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"drawBackground(QPainter*,QRectF)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawForeground(QPainter*,QRectF)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n\n    <!-- TODO: Support conversions on virtual function -->\n    <modify-function signature=\"drawItems(QPainter*, int, QGraphicsItem**, const QStyleOptionGraphicsItem*)\">\n        <modify-argument index=\"2\">\n            <remove-argument/>\n            <conversion-rule class=\"native\">\n              int %out = PySequence_Size(%PYARG_1);\n            </conversion-rule>\n        </modify-argument>\n\n        <modify-argument index=\"3\">\n            <replace-type modified-type=\"PySequence\"/>\n            <conversion-rule class=\"native\">\n                int numItems = PySequence_Size(%PYARG_1);\n                Shiboken::AutoArrayPointer&lt;QGraphicsItem*&gt; %out(numItems);\n                for (int i=0; i &lt; numItems; i++) {\n                    %out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));\n                }\n            </conversion-rule>\n\n            <conversion-rule class=\"target\">\n                Shiboken::AutoDecRef object(PyList_New(0));\n                for (int i=0, max=numItems; i &lt; max; i++) {\n                    PyList_Append(object, %CONVERTTOPYTHON[QGraphicsItem*](%in[i]));\n                }\n                PyObject *%out = object.object();\n            </conversion-rule>\n        </modify-argument>\n\n        <modify-argument index=\"4\">\n            <replace-type modified-type=\"PySequence\"/>\n            <conversion-rule class=\"target\">\n                Shiboken::AutoDecRef option_object(PyList_New(0));\n                for (int i=0, max=numItems; i &lt; max; i++) {\n                    const QStyleOptionGraphicsItem* item = &amp;%in[i];\n                    PyList_Append(option_object, %CONVERTTOPYTHON[QStyleOptionGraphicsItem](item));\n                }\n                PyObject* %out = option_object.object();\n            </conversion-rule>\n\n            <conversion-rule class=\"native\">\n                int numOptions = PySequence_Size(%PYARG_2);\n                Shiboken::AutoArrayPointer&lt;QStyleOptionGraphicsItem&gt; %out(numOptions);\n                for (int i=0; i &lt; numOptions; i++) {\n                    %out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));\n                }\n            </conversion-rule>\n        </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QInputDialog\">\n    <enum-type name=\"InputDialogOption\"/>\n    <enum-type name=\"InputMode\"/>\n    <modify-function signature=\"getInteger(QWidget*, const QString&amp;, const QString&amp;, int, int, int, int, bool*, QFlags&lt;Qt::WindowType&gt;)\" allow-thread=\"yes\">\n      <modify-argument index=\"8\">\n        <remove-default-expression/>\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"getInt(QWidget*, const QString&amp;, const QString&amp;, int, int, int, int, bool*, QFlags&lt;Qt::WindowType&gt;)\" allow-thread=\"yes\">\n      <modify-argument index=\"8\">\n        <remove-default-expression/>\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"getItem(QWidget*, const QString&amp;, const QString&amp;, const QStringList&amp;, int, bool, bool*, QFlags&lt;Qt::WindowType&gt;)\" allow-thread=\"yes\">\n      <modify-argument index=\"7\">\n        <remove-default-expression/>\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_arg,arg,arg,arg,arg,arg,bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"getText(QWidget *, const QString&amp;, const QString&amp;, QLineEdit::EchoMode, const QString&amp;, bool*, QFlags&lt;Qt::WindowType&gt;)\" allow-thread=\"yes\">\n      <modify-argument index=\"6\">\n        <remove-default-expression/>\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_arg,arg,arg,arg,arg,bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"getDouble(QWidget*, const QString&amp;, const QString&amp;, double, double, double, int, bool*, QFlags&lt;Qt::WindowType&gt;)\" allow-thread=\"yes\">\n      <modify-argument index=\"8\">\n        <remove-default-expression/>\n        <remove-argument/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg\"/>\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QGraphicsScene\">\n    <extra-includes>\n      <include file-name=\"QVarLengthArray\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"ItemIndexMethod\"/>\n    <enum-type name=\"SceneLayer\" flags=\"SceneLayers\"/>\n\n    <!-- ### Obsolete -->\n    <modify-function signature=\"drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)\" remove=\"all\" />\n    <!-- ### -->\n\n    <modify-function signature=\"createItemGroup(const QList&lt;QGraphicsItem*&gt;&amp;)\">\n        <modify-argument index=\"1\">\n            <parent index=\"return\" action=\"add\" />\n        </modify-argument>\n        <modify-argument index=\"return\">\n            <define-ownership owner=\"default\"/>\n        </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"destroyItemGroup(QGraphicsItemGroup*)\">\n        <inject-code>\n        QGraphicsItem* parentItem = %1->parentItem();\n        Shiboken::AutoDecRef parent(%CONVERTTOPYTHON[QGraphicsItem*](parentItem));\n        foreach (QGraphicsItem* item, %1->children())\n            Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[QGraphicsItem*](item));\n        %BEGIN_ALLOW_THREADS\n        %CPPSELF.%FUNCTION_NAME(%1);\n        %END_ALLOW_THREADS\n        // the arg was destroyed by Qt.\n        Shiboken::Object::invalidate(%PYARG_1);\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"contextMenuEvent(QGraphicsSceneContextMenuEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"dragEnterEvent(QGraphicsSceneDragDropEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"dragLeaveEvent(QGraphicsSceneDragDropEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"dragMoveEvent(QGraphicsSceneDragDropEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawBackground(QPainter*,QRectF)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawForeground(QPainter*,QRectF)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"dropEvent(QGraphicsSceneDragDropEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"focusInEvent(QFocusEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"focusOutEvent(QFocusEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"helpEvent(QGraphicsSceneHelpEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"inputMethodEvent(QInputMethodEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"keyPressEvent(QKeyEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"keyReleaseEvent(QKeyEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mouseMoveEvent(QGraphicsSceneMouseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mousePressEvent(QGraphicsSceneMouseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mouseReleaseEvent(QGraphicsSceneMouseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"wheelEvent(QGraphicsSceneWheelEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"addItem(QGraphicsItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n   </modify-function>\n\n    <modify-function signature=\"addEllipse(const QRectF&amp;, const QPen&amp;, const QBrush&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addEllipse(qreal, qreal, qreal, qreal, const QPen&amp;, const QBrush&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"addLine(const QLineF&amp;, const QPen&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addLine(qreal, qreal, qreal, qreal, const QPen&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"addPath(const QPainterPath&amp;, const QPen&amp;, const QBrush&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addPixmap(const QPixmap&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addPolygon(const QPolygonF&amp;, const QPen&amp;, const QBrush&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addRect(const QRectF&amp;, const QPen&amp;, const QBrush&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addRect(qreal, qreal, qreal, qreal, const QPen&amp;, const QBrush&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"addText(const QString&amp;, const QFont&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addSimpleText(const QString&amp;, const QFont&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)\">\n        <!-- TODO: Add a keeper attribute to reference-count tag to do what this inject code do. -->\n        <inject-code>\n        %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2);\n        %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);\n        Shiboken::Object::keepReference((SbkObject*)%PYARG_0, \"setWidget(QWidget*)1\", %PYARG_1);\n        </inject-code>\n    </modify-function>\n\n    <!-- use glue code -->\n    <modify-function signature=\"drawItems(QPainter*, int, QGraphicsItem**, const QStyleOptionGraphicsItem*, QWidget *)\">\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"clear()\">\n        <inject-code>\n            const QList&lt;QGraphicsItem*> items = %CPPSELF.items();\n            Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();\n            foreach (QGraphicsItem* item, items) {\n                SbkObject* obj = bm.retrieveWrapper(item);\n                if (obj) {\n                    if (reinterpret_cast&lt;PyObject*&gt;(obj)->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway.\n                        Shiboken::Object::invalidate(obj);\n                    Shiboken::Object::removeParent(obj);\n                }\n            }\n            %CPPSELF.%FUNCTION_NAME();\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"removeItem(QGraphicsItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setFocusItem(QGraphicsItem*,Qt::FocusReason)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QCalendarWidget\">\n    <enum-type name=\"HorizontalHeaderFormat\"/>\n    <enum-type name=\"SelectionMode\"/>\n    <enum-type name=\"VerticalHeaderFormat\"/>\n    <extra-includes>\n      <include file-name=\"QTextCharFormat\" location=\"global\"/>\n    </extra-includes>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"isHeaderVisible()const\" remove=\"all\"/>\n    <modify-function signature=\"setHeaderVisible(bool)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n    <modify-function signature=\"paintCell(QPainter*,QRect,QDate)const\">\n      <modify-argument invalidate-after-use=\"yes\" index=\"1\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTreeWidget\">\n    <modify-function signature=\"dropMimeData(QTreeWidgetItem*,int,const QMimeData*,Qt::DropAction)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <!-- ### \"indexOfTopLevelItem(QTreeWidgetItem*)\" is an internal method. -->\n    <modify-function signature=\"indexOfTopLevelItem(QTreeWidgetItem *)\" remove=\"all\"/>\n    <modify-function signature=\"addTopLevelItem(QTreeWidgetItem *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addTopLevelItems(const QList&lt;QTreeWidgetItem*&gt; &amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addTopLevelItem(QTreeWidgetItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertTopLevelItem(int, QTreeWidgetItem *)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertTopLevelItems(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setHeaderItem(QTreeWidgetItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"takeTopLevelItem(int)\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"clear()\">\n        <inject-code>\n        QTreeWidgetItem *rootItem = %CPPSELF.invisibleRootItem();\n        Shiboken::BindingManager &amp;bm = Shiboken::BindingManager::instance();\n        for (int i = 0; i &lt; rootItem->childCount(); ++i) {\n            QTreeWidgetItem *item = rootItem->child(i);\n            SbkObject* wrapper = bm.retrieveWrapper(item);\n            if (wrapper)\n                Shiboken::Object::setParent(0, reinterpret_cast&lt;PyObject*&gt;(wrapper));\n        }\n        </inject-code>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"items(const QMimeData*)const\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QAbstractItemDelegate\">\n    <enum-type name=\"EndEditHint\"/>\n    <modify-function signature=\"paint(QPainter*,QStyleOptionViewItem,QModelIndex)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"editorEvent(QEvent*,QAbstractItemModel*,QStyleOptionViewItem,QModelIndex)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"elidedText(QFontMetrics, int, Qt::TextElideMode, QString)\" remove=\"all\"/>\n    <modify-function signature=\"createEditor(QWidget*,QStyleOptionViewItem,QModelIndex)const\">\n      <modify-argument index=\"1\">\n        <define-ownership owner=\"c++\"/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <define-ownership class=\"native\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTableWidgetItem\" >\n    <enum-type name=\"ItemType\"/>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"backgroundColor()const\" remove=\"all\"/>\n    <modify-function signature=\"setBackgroundColor(QColor)\" remove=\"all\"/>\n    <modify-function signature=\"setTextColor(QColor)\" remove=\"all\"/>\n    <modify-function signature=\"textColor()const\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n    <modify-function signature=\"read(QDataStream&amp;)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"write(QDataStream&amp;)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QListWidgetItem\" >\n    <enum-type name=\"ItemType\"/>\n    <modify-function signature=\"QListWidgetItem(const QString&amp;, QListWidget*, int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"2\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QListWidgetItem(const QIcon&amp;, const QString&amp;, QListWidget*, int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"3\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QListWidgetItem(QListWidget*, int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"listWidget() const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"target\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"read(QDataStream&amp;)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"write(QDataStream&amp;)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"backgroundColor()const\" remove=\"all\"/>\n    <modify-function signature=\"setBackgroundColor(QColor)\" remove=\"all\"/>\n    <modify-function signature=\"setTextColor(QColor)\" remove=\"all\"/>\n    <modify-function signature=\"textColor()const\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </object-type>\n  <object-type name=\"QGraphicsTextItem\">\n    <!-- a QObject so main-thread delete redundant -->\n    <extra-includes>\n      <include file-name=\"QTextCursor\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"setDocument(QTextDocument*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QCompleter\">\n    <enum-type name=\"CompletionMode\"/>\n    <enum-type name=\"ModelSorting\"/>\n    <modify-function signature=\"setModel(QAbstractItemModel*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setPopup(QAbstractItemView*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setWidget(QWidget*)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTreeWidgetItem\" hash-function=\"qHash\">\n    <enum-type name=\"ChildIndicatorPolicy\"/>\n    <enum-type name=\"ItemType\"/>\n    <modify-function signature=\"read(QDataStream&amp;)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"write(QDataStream&amp;)const\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"QTreeWidgetItem(QTreeWidget*, int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QTreeWidgetItem(QTreeWidget*, const QStringList&amp;, int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QTreeWidgetItem(QTreeWidget*, QTreeWidgetItem*, int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QTreeWidgetItem(QTreeWidgetItem *,int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QTreeWidgetItem(QTreeWidgetItem*, const QStringList &amp;, int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QTreeWidgetItem(QTreeWidgetItem*, QTreeWidgetItem*, int)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addChild(QTreeWidgetItem *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addChildren(const QList&lt;QTreeWidgetItem*&gt; &amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertChild(int, QTreeWidgetItem *)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertChildren(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeChild(QTreeWidgetItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"takeChild(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"takeChildren()\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"parent() const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n          // Only call the parent function if this return some value\n          // the parent can be the TreeWidget\n          if (%0)\n            Shiboken::Object::setParent(%PYARG_0, %PYSELF);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"treeWidget() const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n          // Only call the parent function if this return some value\n          // the parent can be the TreeWidgetItem\n          if (%0)\n            Shiboken::Object::setParent(%PYARG_0, %PYSELF);\n      </inject-code>\n    </modify-function>\n\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"backgroundColor(int)const\" remove=\"all\"/>\n    <modify-function signature=\"setBackgroundColor(int, QColor)\" remove=\"all\"/>\n    <modify-function signature=\"setTextColor(int, QColor)\" remove=\"all\"/>\n    <modify-function signature=\"textColor(int)const\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </object-type>\n  <object-type name=\"QListWidget\">\n    <modify-function signature=\"setItemWidget(QListWidgetItem *, QWidget *)\">\n      <modify-argument index=\"2\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addItem(QListWidgetItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertItem(int, QListWidgetItem*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"setItemHidden(const QListWidgetItem*,bool)\" remove=\"all\"/>\n    <modify-function signature=\"isItemHidden(const QListWidgetItem*)const\" remove=\"all\"/>\n    <modify-function signature=\"setItemSelected(const QListWidgetItem*,bool)\" remove=\"all\"/>\n    <modify-function signature=\"isItemSelected(const QListWidgetItem*)const\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n    <modify-function signature=\"takeItem(int)\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QWidget\">\n    <extra-includes>\n      <include file-name=\"QIcon\" location=\"global\"/>\n      <include file-name=\"QMessageBox\" location=\"global\"/>\n    </extra-includes>\n\n    <inject-code class=\"native\" file=\"glue/qwidget_glue.cpp\" position=\"beginning\" />\n\n    <enum-type name=\"RenderFlag\" flags=\"RenderFlags\"/>\n\n    <modify-function signature=\"setParent(QWidget*)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setParent(QWidget*, QFlags&lt;Qt::WindowType&gt;)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"parentWidget()const\">\n        <modify-argument index=\"this\">\n          <parent index=\"return\" action=\"add\"/>\n        </modify-argument>\n        <modify-argument index=\"return\">\n          <define-ownership class=\"target\" owner=\"default\"/>\n        </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"actionEvent(QActionEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"changeEvent(QEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"closeEvent(QCloseEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"contextMenuEvent(QContextMenuEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"dragEnterEvent(QDragEnterEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"dragLeaveEvent(QDragLeaveEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"dragMoveEvent(QDragMoveEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"dropEvent(QDropEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"enterEvent(QEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"focusInEvent(QFocusEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"focusOutEvent(QFocusEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"hideEvent(QHideEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"inputMethodEvent(QInputMethodEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"keyPressEvent(QKeyEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"keyReleaseEvent(QKeyEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"leaveEvent(QEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"mouseDoubleClickEvent(QMouseEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"mouseMoveEvent(QMouseEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"mousePressEvent(QMouseEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"mouseReleaseEvent(QMouseEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"moveEvent(QMoveEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"paintEvent(QPaintEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"resizeEvent(QResizeEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"showEvent(QShowEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"tabletEvent(QTabletEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"wheelEvent(QWheelEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\">\n            <rename to=\"event\"/>\n        </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setStyle(QStyle*)\">\n      <inject-code class=\"target\" position=\"end\">\n        Shiboken::Object::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), \"__style__\",  %PYARG_1);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"style()const\">\n      <inject-code class=\"target\" position=\"end\">\n        QStyle* myStyle = %CPPSELF->style();\n        if (myStyle &amp;&amp; qApp) {\n        %PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle);\n            QStyle *appStyle = qApp->style();\n            if (appStyle == myStyle) {\n                Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));\n                Shiboken::Object::setParent(pyApp, %PYARG_0);\n                Shiboken::Object::releaseOwnership(%PYARG_0);\n            } else {\n                Shiboken::Object::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), \"__style__\",  %PYARG_0);\n            }\n        }\n      </inject-code>\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"render(QPainter*,QPoint,QRegion,QFlags&lt;QWidget::RenderFlag&gt;)\">\n      <modify-argument index=\"2\">\n        <!-- Removed because the render(QPainter*) overload conflicts with the identical function in QGraphicsView -->\n        <remove-default-expression/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setFocusProxy(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setInputContext(QInputContext*)\">\n      <modify-argument index=\"1\">\n        <define-ownership owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"getContentsMargins(int*,int*,int*,int*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n        <inject-code class=\"native\" position=\"end\">\n            <insert-template name=\"fix_native_return_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"insertAction(QAction*, QAction*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setLayout(QLayout *)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        qwidgetSetLayout(%CPPSELF, %1);\n        // %FUNCTION_NAME() - disable generation of function call.\n      </inject-code>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"enabledChange(bool)\" remove=\"all\"/>\n    <modify-function signature=\"fontChange(QFont)\" remove=\"all\"/>\n    <modify-function signature=\"isEnabledToTLW()const\" remove=\"all\"/>\n    <modify-function signature=\"isTopLevel()const\" remove=\"all\"/>\n    <modify-function signature=\"paletteChange(QPalette)\" remove=\"all\"/>\n    <modify-function signature=\"setShown(bool)\" remove=\"all\"/>\n    <modify-function signature=\"topLevelWidget()const\" remove=\"all\"/>\n    <modify-function signature=\"windowActivationChange(bool)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n    <modify-function signature=\"raise()\" rename=\"raise_\" />\n    <modify-function signature=\"setParent(QWidget*, QFlags&lt;Qt::WindowType>)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"winId()const\">\n        <inject-documentation mode=\"replace\" format=\"target\">\n            Returns the window system identifier of the widget.\n\n            Portable in principle, but if you use it you are probably about to do something non-portable. Be careful.\n\n            If a widget is non-native (alien) and winId() is invoked on it, that widget will be provided a native handle.\n\n            On X11 the type returned is long, on other platforms it's void pointer casted to a Python long long.\n\n            This value may change at run-time. An event with type PySide.QtCore.QEvent.WinIdChange will be sent to the widget following a change in window system identifier.\n        </inject-documentation>\n    </modify-function>\n\n    <modify-function signature=\"window()const\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QMessageBox\">\n    <enum-type name=\"ButtonRole\"/>\n    <enum-type name=\"Icon\"/>\n    <enum-type name=\"StandardButton\" flags=\"StandardButtons\" />\n    <modify-function signature=\"removeButton(QAbstractButton*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <extra-includes>\n      <include file-name=\"QPixmap\" location=\"global\"/>\n    </extra-includes>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"QMessageBox(QString,QString,QMessageBox::Icon,int,int,int,QWidget*,QFlags&lt;Qt::WindowType&gt;)\" remove=\"all\"/>\n    <modify-function signature=\"buttonText(int)const\" remove=\"all\"/>\n    <modify-function signature=\"setButtonText(int, QString)\" remove=\"all\"/>\n    <modify-function signature=\"standardIcon(QMessageBox::Icon)\" remove=\"all\"/>\n    <modify-function signature=\"critical(QWidget*,QString,QString,int,int,int)\" remove=\"all\"/>\n    <modify-function signature=\"critical(QWidget*,QString,QString,QString,QString,QString,int,int)\" remove=\"all\"/>\n    <modify-function signature=\"information(QWidget*,QString,QString,int,int,int)\" remove=\"all\"/>\n    <modify-function signature=\"information(QWidget*,QString,QString,QString,QString,QString,int,int)\" remove=\"all\"/>\n    <modify-function signature=\"question(QWidget*, QString, QString, int, int, int)\" remove=\"all\"/>\n    <modify-function signature=\"question(QWidget*, QString, QString, QString, QString, QString, int, int)\" remove=\"all\"/>\n    <modify-function signature=\"warning(QWidget*, QString, QString, int, int, int)\" remove=\"all\"/>\n    <modify-function signature=\"warning(QWidget*, QString, QString, QString, QString, QString, int, int)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n\n    <modify-function signature=\"critical(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QMessageBox::StandardButton&gt;, QMessageBox::StandardButton)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"information(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QMessageBox::StandardButton&gt;, QMessageBox::StandardButton)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"question(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QMessageBox::StandardButton&gt;, QMessageBox::StandardButton)\" allow-thread=\"yes\"/>\n    <modify-function signature=\"warning(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QMessageBox::StandardButton&gt;, QMessageBox::StandardButton)\" allow-thread=\"yes\"/>\n\n  </object-type>\n  <object-type name=\"QAbstractSpinBox\">\n    <enum-type name=\"ButtonSymbols\"/>\n    <enum-type name=\"CorrectionMode\"/>\n    <enum-type name=\"StepEnabledFlag\" flags=\"StepEnabled\"/>\n    <modify-function signature=\"setLineEdit(QLineEdit *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"fixup(QString &amp;)const\">\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"QString\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"return_QString\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"validate(QString &amp;, int &amp;)const\">\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"PyObject\"/>\n        <conversion-rule class=\"native\">\n            <insert-template name=\"validator_conversionrule\"/>\n        </conversion-rule>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"return_tuple_QValidator_QString_int\"/>\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTextFrame\" >\n    <extra-includes>\n      <include file-name=\"QTextCursor\" location=\"global\"/>\n    </extra-includes>\n    <value-type name=\"iterator\" >\n      <include file-name=\"QTextFrame\" location=\"global\"/>\n      <!-- ### These operators where removed because they don't make sense in Python.\n           Instead iterator methods (__iter__, next) should be implemented.\n           See bug 688 -->\n      <modify-function signature=\"operator++()\" remove=\"all\"/>\n      <modify-function signature=\"operator--()\" remove=\"all\"/>\n      <!-- ### -->\n      <add-function signature=\"__iter__()\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n          <insert-template name=\"__iter__\" />\n        </inject-code>\n      </add-function>\n      <add-function signature=\"__next__()\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n          <insert-template name=\"__next__\">\n            <replace from=\"%CPPSELF_TYPE\" to=\"QTextFrame::iterator\" />\n          </insert-template>\n        </inject-code>\n      </add-function>\n    </value-type>\n    <add-function signature=\"__iter__()\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n          <insert-template name=\"__iter_parent__\">\n            <replace from=\"%CPPSELF_TYPE\" to=\"QTextFrame::iterator\" />\n          </insert-template>\n        </inject-code>\n    </add-function>\n  </object-type>\n  <object-type name=\"QImageIOHandler\">\n    <extra-includes>\n      <include file-name=\"QRect\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"ImageOption\"/>\n    <modify-function signature=\"setDevice(QIODevice*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"name()const\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QProxyModel\" polymorphic-id-expression=\"qobject_cast&lt;QProxyModel*&gt;(%1)\">\n    <!-- ### This reimplementation of \"QObject::parent()\" is used in C++ only\n         when \"using QObject::parent;\" is not available. It's useless in Python. -->\n    <modify-function signature=\"parent()const\" remove=\"all\"/>\n    <extra-includes>\n      <include file-name=\"QPixmap\" location=\"global\"/>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"setModel(QAbstractItemModel*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QImageReader\">\n    <extra-includes>\n      <include file-name=\"QColor\" location=\"global\"/>\n      <include file-name=\"QRect\" location=\"global\"/>\n      <include file-name=\"QSize\" location=\"global\"/>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QImage\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"ImageReaderError\"/>\n    <!-- ### This method does not make sense in Python.\n         Update: perhaps it does, but no one is missing it. -->\n    <modify-function signature=\"read(QImage*)\" remove=\"all\" />\n    <modify-function signature=\"setDevice(QIODevice*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QMovie\">\n    <extra-includes>\n      <include file-name=\"QColor\" location=\"global\"/>\n      <include file-name=\"QImage\" location=\"global\"/>\n      <include file-name=\"QPixmap\" location=\"global\"/>\n      <include file-name=\"QRect\" location=\"global\"/>\n      <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"CacheMode\"/>\n    <enum-type name=\"MovieState\"/>\n    <!-- ### \"cacheMode()\" is an internal method. -->\n    <modify-function signature=\"cacheMode()\" remove=\"all\"/>\n    <modify-function signature=\"setDevice(QIODevice*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTabWidget\">\n    <enum-type name=\"TabPosition\"/>\n    <enum-type name=\"TabShape\"/>\n    <modify-function signature=\"addTab(QWidget*, const QString&amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addTab(QWidget*, const QIcon&amp;, const QString&amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertTab(int, QWidget*, const QIcon&amp;, const QString&amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertTab(int, QWidget*, const QString&amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCornerWidget(QWidget*, Qt::Corner)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setTabBar(QTabBar*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <!-- This function need be re-implemented in inject code -->\n    <modify-function signature=\"removeTab(int)\">\n    <inject-code class=\"target\" position=\"beginning\">\n        QWidget* tab = %CPPSELF.widget(%1);\n        if (tab) {\n            Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));\n            %CPPSELF.%FUNCTION_NAME(%1);\n        }\n    </inject-code>\n    </modify-function>\n    <modify-function signature=\"clear()\">\n        <inject-code class=\"target\" position=\"beginning\">\n            for (int i = 0; i &lt; %CPPSELF.count(); i++) {\n                QWidget* widget = %CPPSELF.widget(i);\n                Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget));\n                Shiboken::Object::setParent(0, pyWidget);\n            }\n            %CPPSELF.%FUNCTION_NAME();\n        </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QDrag\">\n    <extra-includes>\n      <include file-name=\"QPoint\" location=\"global\"/>\n      <include file-name=\"QPixmap\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"QDrag(QWidget*)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"source() const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"target\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"target() const\">\n      <modify-argument index=\"return\">\n        <define-ownership owner=\"target\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setMimeData(QMimeData*)\">\n      <modify-argument index=\"1\">\n        <!-- TODO: maybe this is not the best solution -->\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"exec(QFlags&lt;Qt::DropAction&gt;)\" rename=\"exec_\" allow-thread=\"yes\"/>\n    <modify-function signature=\"exec(QFlags&lt;Qt::DropAction&gt;, Qt::DropAction)\" rename=\"exec_\" allow-thread=\"yes\"/>\n  </object-type>\n  <object-type name=\"QDateTimeEdit\">\n    <enum-type name=\"Section\" flags=\"Sections\"/>\n    <modify-function signature=\"setCalendarWidget(QCalendarWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QSortFilterProxyModel\">\n    <!-- ### This reimplementation of \"QObject::parent()\" is used in C++ only\n         when \"using QObject::parent;\" is not available. It's useless in Python. -->\n    <modify-function signature=\"parent()const\" remove=\"all\"/>\n    <extra-includes>\n      <include file-name=\"QItemSelection\" location=\"global\"/>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"setSourceModel(QAbstractItemModel*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"clear()\" remove=\"all\"/>\n    <modify-function signature=\"filterChanged()\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </object-type>\n  <object-type name=\"QSlider\">\n      <enum-type name=\"TickPosition\" />\n  </object-type>\n  <object-type name=\"QInputContext\">\n    <extra-includes>\n      <include file-name=\"QTextFormat\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"StandardFormat\"/>\n    <modify-function signature=\"filterEvent(const QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"mouseHandler(int,QMouseEvent*)\">\n      <modify-argument index=\"2\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QProgressDialog\">\n    <modify-function signature=\"setBar(QProgressBar*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setLabel(QLabel*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCancelButton(QPushButton*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QLabel\">\n    <modify-function signature=\"setBuddy(QWidget *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setMovie(QMovie *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n\n  <object-type name=\"QFileDialog\">\n    <enum-type name=\"AcceptMode\"/>\n    <enum-type name=\"DialogLabel\"/>\n    <enum-type name=\"FileMode\"/>\n    <enum-type name=\"Option\" flags=\"Options\"/>\n    <enum-type name=\"ViewMode\"/>\n    <extra-includes>\n      <include file-name=\"QUrl\" location=\"global\"/>\n      <include file-name=\"QAbstractProxyModel\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"setIconProvider(QFileIconProvider*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItemDelegate(QAbstractItemDelegate*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"getOpenFileNames(QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)\" allow-thread=\"yes\">\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"(fileNames, selectedFilter)\"/>\n      </modify-argument>\n      <modify-argument index=\"5\">\n        <replace-type modified-type=\"QString\"/>\n        <replace-default-expression with=\"QString()\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"return_for_QFileDialog\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"getOpenFileName(QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)\" allow-thread=\"yes\">\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"(fileName, selectedFilter)\"/>\n      </modify-argument>\n      <modify-argument index=\"5\">\n        <replace-type modified-type=\"QString\"/>\n        <replace-default-expression with=\"QString()\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"return_for_QFileDialog\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"getSaveFileName(QWidget*, const QString&amp;, const QString&amp;, const QString&amp;, QString*, QFlags&lt;QFileDialog::Option&gt;)\" allow-thread=\"yes\">\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"(fileName, selectedFilter)\"/>\n      </modify-argument>\n      <modify-argument index=\"5\">\n        <replace-type modified-type=\"QString\"/>\n        <replace-default-expression with=\"QString()\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"return_for_QFileDialog\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"getExistingDirectory(QWidget*, const QString&amp;, const QString&amp;, QFlags&lt;QFileDialog::Option>)\" allow-thread=\"yes\" />\n  </object-type>\n  <object-type name=\"QErrorMessage\"/>\n  <object-type name=\"QTabBar\">\n    <extra-includes>\n      <include file-name=\"QIcon\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"Shape\"/>\n    <enum-type name=\"SelectionBehavior\"/>\n    <enum-type name=\"ButtonPosition\"/>\n  </object-type>\n  <object-type name=\"QStandardItemModel\" polymorphic-id-expression=\"qobject_cast&lt;QStandardItemModel*&gt;(%1)\">\n    <extra-includes>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"takeItem(int,int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"takeHorizontalHeaderItem(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"takeVerticalHeaderItem(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"verticalHeaderItem(int) const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"horizontalHeaderItem(int) const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"invisibleRootItem() const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"item(int, int) const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"itemFromIndex(const QModelIndex&amp;) const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"itemPrototype() const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"appendRow(const QList&lt;QStandardItem*&gt;&amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"appendRow(QStandardItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n  </modify-function>\n\n    <modify-function signature=\"insertRow(int, QStandardItem*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setHorizontalHeaderItem(int, QStandardItem*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setItem(int, int, QStandardItem*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        // Clear parent from the old child\n        QStandardItem* _i = %CPPSELF->item(%1, %2);\n        if (_i) {\n            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);\n            Shiboken::Object::setParent(0, _pyI);\n        }\n      </inject-code>\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItem(int, QStandardItem*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        // Clear parent from the old child\n        QStandardItem* _i = %CPPSELF->item(%1);\n        if (_i) {\n            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);\n            Shiboken::Object::setParent(0, _pyI);\n        }\n      </inject-code>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItemPrototype(const QStandardItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"setVerticalHeaderItem(int, QStandardItem*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        // Clear parent from the old child\n        QStandardItem* _i = %CPPSELF->verticalHeaderItem(%1);\n        if (_i) {\n            PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);\n            Shiboken::Object::setParent(0, _pyI);\n        }\n      </inject-code>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"takeColumn(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"takeRow(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"findItems(const QString&amp;, QFlags&lt;Qt::MatchFlag&gt;, int) const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"insertColumn(int, const QList&lt;QStandardItem*&gt;&amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"insertRow(int, const QList&lt;QStandardItem*&gt;&amp;)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"appendColumn(const QList&lt;QStandardItem*&gt;&amp;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\" />\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"clear()\">\n        <inject-code class=\"target\" position=\"beginning\">\n          Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();\n          SbkObject* pyRoot = bm.retrieveWrapper(%CPPSELF.invisibleRootItem());\n          if (pyRoot) {\n            Shiboken::Object::destroy(pyRoot, %CPPSELF.invisibleRootItem());\n          }\n\n          for(int r=0, r_max = %CPPSELF.rowCount(); r &lt; r_max; r++) {\n            QList&lt;QStandardItem *&gt; ri = %CPPSELF.takeRow(0);\n\n            PyObject *pyResult = %CONVERTTOPYTHON[QList&lt;QStandardItem * &gt;](ri);\n            Shiboken::Object::setParent(Py_None, pyResult);\n            Py_XDECREF(pyResult);\n          }\n        </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QRadioButton\" />\n  <object-type name=\"QScrollBar\" />\n  <object-type name=\"QClipboard\">\n    <extra-includes>\n      <include file-name=\"QImage\" location=\"global\"/>\n      <include file-name=\"QPixmap\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"Mode\" />\n    <modify-function signature=\"setMimeData(QMimeData *, QClipboard::Mode)\">\n      <modify-argument index=\"1\">\n        <!-- TODO: maybe this is not the best solution -->\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"text(QString&amp;,QClipboard::Mode)const\">\n      <modify-argument index=\"2\">\n        <replace-default-expression with=\"QClipboard::Clipboard\"/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"(retval, subtype)\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"end\">\n      %BEGIN_ALLOW_THREADS\n      %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);\n      %END_ALLOW_THREADS\n      %PYARG_0 = PyTuple_New(2);\n      PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));\n      PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QAbstractScrollArea\">\n    <modify-function signature=\"setViewport(QWidget *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addScrollBarWidget(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCornerWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setHorizontalScrollBar(QScrollBar*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setVerticalScrollBar(QScrollBar*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setViewport(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setupViewport(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"viewportEvent(QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QPaintEngineState\">\n    <extra-includes>\n      <include file-name=\"QPainterPath\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QRubberBand\">\n    <enum-type name=\"Shape\"/>\n    <modify-function signature=\"QRubberBand(QRubberBand::Shape, QWidget*)\">\n      <modify-argument index=\"this\">\n        <parent index=\"2\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <rename to=\"parent\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QTextLayout\">\n    <extra-includes>\n      <include file-name=\"QTextOption\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"CursorMode\"/>\n    <value-type name=\"FormatRange\">\n      <include file-name=\"QTextLayout\" location=\"global\"/>\n    </value-type>\n  </object-type>\n  <object-type name=\"QTableWidget\">\n    <modify-function signature=\"setHorizontalHeaderItem(int, QTableWidgetItem *)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItem(int, int, QTableWidgetItem *)\">\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"takeHorizontalHeaderItem(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"takeVerticalHeaderItem(int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"takeItem(int,int)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItemPrototype(const QTableWidgetItem *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setVerticalHeaderItem(int, QTableWidgetItem *)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCellWidget(int,int,QWidget*)\">\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCurrentItem(QTableWidgetItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCurrentItem(QTableWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!-- ### Obsolete -->\n    <modify-function signature=\"setItemSelected(const QTableWidgetItem*,bool)\" remove=\"all\"/>\n    <modify-function signature=\"isItemSelected(const QTableWidgetItem*)const\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n  <object-type name=\"QTextDocument\">\n    <extra-includes>\n      <include file-name=\"QTextBlock\" location=\"global\"/>\n      <include file-name=\"QTextFormat\" location=\"global\"/>\n      <include file-name=\"QTextCursor\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"FindFlag\" flags=\"FindFlags\"/>\n    <enum-type name=\"MetaInformation\"/>\n    <enum-type name=\"ResourceType\"/>\n    <enum-type name=\"Stacks\" since=\"4.7\"/>\n    <modify-function signature=\"setDocumentLayout(QAbstractTextDocumentLayout*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"object(int)const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"objectForFormat(const QTextFormat&amp;)const\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"createObject(const QTextFormat&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"print(QPrinter*)const\" rename=\"print_\" />\n  </object-type>\n  <object-type name=\"QSplitter\">\n    <modify-function signature=\"getRange(int,int*,int*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_args,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"addWidget(QWidget *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertWidget(int, QWidget *)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QGroupBox\" />\n  <object-type name=\"QStackedWidget\">\n    <modify-function signature=\"addWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertWidget(int,QWidget*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setCurrentWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QSplitterHandle\"/>\n  <object-type name=\"QDial\" />\n  <object-type name=\"QLineEdit\">\n    <enum-type name=\"EchoMode\"/>\n    <modify-function signature=\"setCompleter(QCompleter*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setValidator(const QValidator*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"del()\" rename=\"del_\" />\n    <modify-function signature=\"getTextMargins(int*, int*, int*, int*) const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject *\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"int\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QLCDNumber\">\n      <enum-type name=\"Mode\"/>\n      <enum-type name=\"SegmentStyle\"/>\n  </object-type>\n  <object-type name=\"QSplashScreen\">\n    <!-- Override QWidget.painter -->\n    <modify-function signature=\"repaint()\" remove=\"all\"/>\n    <modify-function signature=\"drawContents(QPainter*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QDockWidget\">\n    <enum-type name=\"DockWidgetFeature\" flags=\"DockWidgetFeatures\"/>\n    <modify-function signature=\"setTitleBarWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QAbstractProxyModel\" polymorphic-id-expression=\"qobject_cast&lt;QAbstractProxyModel*&gt;(%1)\">\n    <extra-includes>\n      <include file-name=\"QItemSelection\" location=\"global\"/>\n      <include file-name=\"QStringList\" location=\"global\"/>\n      <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"setSourceModel(QAbstractItemModel *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QDesktopWidget\"/>\n  <object-type name=\"QFrame\">\n      <enum-type name=\"Shadow\" extensible=\"yes\"/>\n      <enum-type name=\"Shape\"/>\n      <enum-type name=\"StyleMask\"/>\n  </object-type>\n  <object-type name=\"QTextTable\">\n    <extra-includes>\n      <include file-name=\"QTextCursor\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QSpinBox\">\n      <modify-function signature=\"valueChanged(int)\">\n          <inject-documentation mode=\"append\" format=\"target\">\n::\n\n    def callback_int(value_as_int):\n        print 'int value changed:', repr(value_as_int)\n\n    app = QApplication(sys.argv)\n    spinbox = QSpinBox()\n    spinbox.valueChanged[unicode].connect(callback_unicode)\n    spinbox.show()\n    sys.exit(app.exec_())\n          </inject-documentation>\n      </modify-function>\n      <modify-function signature=\"valueChanged(QString)\">\n          <inject-documentation mode=\"append\" format=\"target\">\n::\n\n    def callback_unicode(value_as_unicode):\n        print 'unicode value changed:', repr(value_as_unicode)\n\n    app = QApplication(sys.argv)\n    spinbox = QSpinBox()\n    spinbox.valueChanged[unicode].connect(callback_unicode)\n    spinbox.show()\n    sys.exit(app.exec_())\n          </inject-documentation>\n      </modify-function>\n  </object-type>\n  <object-type name=\"QTextBrowser\"/>\n  <object-type name=\"QDoubleSpinBox\"/>\n  <object-type name=\"QButtonGroup\">\n   <modify-function signature=\"addButton(QAbstractButton*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addButton(QAbstractButton*, int)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeButton(QAbstractButton *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setId(QAbstractButton *,int)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QToolBar\">\n    <modify-function signature=\"addAction(QIcon,QString,const QObject*,const char*)\">\n      <modify-argument index=\"3\">\n        <replace-type modified-type=\"PyObject\" />\n      </modify-argument>\n      <modify-argument index=\"4\">\n        <remove-argument />\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n\n      <inject-code>\n        QAction* action = %CPPSELF.addAction(%1, %2);\n        %PYARG_0 = %CONVERTTOPYTHON[QAction*](action);\n        Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, \"connect\", \"OsO\", %PYARG_0, SIGNAL(triggered()), %PYARG_3));\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addAction(QString,const QObject*,const char*)\">\n      <modify-argument index=\"2\">\n        <replace-type modified-type=\"PyObject\" />\n      </modify-argument>\n      <modify-argument index=\"3\">\n        <remove-argument />\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <inject-code>\n        QAction* action = %CPPSELF.addAction(%1);\n        %PYARG_0 = %CONVERTTOPYTHON[QAction*](action);\n        Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, \"connect\", \"OsO\", %PYARG_0, SIGNAL(triggered()), %PYARG_2));\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"addAction(const QString&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addAction(const QIcon&amp;, const QString&amp;)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addSeparator()\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertWidget(QAction*,QWidget*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertSeparator(QAction*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"clear()\">\n      <inject-code>\n        QList&lt;PyObject* &gt; lst;\n        Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();\n        foreach(QToolButton* child, %CPPSELF.findChildren&lt;QToolButton*&gt;()) {\n            if (bm.hasWrapper(child)) {\n                PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child);\n                Shiboken::Object::setParent(0, pyChild);\n                lst &lt;&lt; pyChild;\n            }\n        }\n\n        //Remove actions\n        foreach(QAction *act, %CPPSELF.actions()) {\n            Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));\n            Shiboken::Object::setParent(NULL, pyAct);\n            Shiboken::Object::invalidate(pyAct);\n        }\n\n        %CPPSELF.clear();\n        foreach(PyObject* obj, lst) {\n            Shiboken::Object::invalidate(reinterpret_cast&lt;SbkObject* &gt;(obj));\n            Py_XDECREF(obj);\n        }\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QPaintEngine\">\n    <enum-type name=\"DirtyFlag\" flags=\"DirtyFlags\"/>\n    <enum-type name=\"PaintEngineFeature\" flags=\"PaintEngineFeatures\"/>\n    <enum-type name=\"PolygonDrawMode\"/>\n    <enum-type name=\"Type\"/>\n    <modify-function signature=\"begin(QPaintDevice*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"updateState(QPaintEngineState)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"drawTextItem(QPointF,QTextItem)\">\n      <modify-argument index=\"2\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <extra-includes>\n      <include file-name=\"QVarLengthArray\" location=\"global\"/>\n    </extra-includes>\n    <!-- ### \"setPaintDevice(QPaintDevice*)\" is an internal method. -->\n    <modify-function signature=\"setPaintDevice(QPaintDevice*)\" remove=\"all\"/>\n    <modify-field name=\"state\" read=\"false\" write=\"false\"/>\n  </object-type>\n  <object-type name=\"QComboBox\">\n    <enum-type name=\"InsertPolicy\"/>\n    <enum-type name=\"SizeAdjustPolicy\"/>\n    <modify-function signature=\"setCompleter(QCompleter*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setValidator(const QValidator*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItemDelegate(QAbstractItemDelegate *)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setView(QAbstractItemView *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setLineEdit(QLineEdit *)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setModel(QAbstractItemModel *)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"autoCompletion()const\" remove=\"all\"/>\n    <modify-function signature=\"autoCompletionCaseSensitivity()const\" remove=\"all\"/>\n    <modify-function signature=\"setAutoCompletion(bool)\" remove=\"all\"/>\n    <modify-function signature=\"setAutoCompletionCaseSensitivity(Qt::CaseSensitivity)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </object-type>\n  <object-type name=\"QTextEdit\">\n    <enum-type name=\"AutoFormattingFlag\" flags=\"AutoFormatting\"/>\n    <enum-type name=\"LineWrapMode\"/>\n    <value-type name=\"ExtraSelection\" >\n      <include file-name=\"QTextEdit\" location=\"global\"/>\n    </value-type>\n    <extra-includes>\n      <include file-name=\"QTextCursor\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"setDocument(QTextDocument*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertFromMimeData(const QMimeData*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"print(QPrinter*) const\" rename=\"print_\"/>\n  </object-type>\n  <object-type name=\"QAction\">\n    <enum-type name=\"ActionEvent\"/>\n    <enum-type name=\"MenuRole\"/>\n    <enum-type name=\"Priority\" since=\"4.6\"/>\n    <enum-type name=\"SoftKeyRole\" since=\"4.6\"/>\n    <modify-function signature=\"setMenu(QMenu*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QPainter\">\n    <extra-includes>\n      <include file-name=\"QWidget\" location=\"global\"/>\n      <include file-name=\"QPainterPath\" location=\"global\"/>\n      <include file-name=\"QPixmap\" location=\"global\"/>\n    </extra-includes>\n    <enum-type name=\"CompositionMode\"/>\n    <enum-type name=\"PixmapFragmentHint\" flags=\"PixmapFragmentHints\" since=\"4.7\"/>\n    <enum-type name=\"RenderHint\" flags=\"RenderHints\"/>\n    <value-type name=\"PixmapFragment\" since=\"4.7\">\n        <include file-name=\"QPainter\" location=\"global\"/>\n    </value-type>\n\n    <!-- ### \"drawText(...)\" is an internal method. -->\n    <modify-function signature=\"drawText(const QPointF&amp;, const QString&amp;, int, int)\" remove=\"all\"/>\n\n    <template name=\"qpainter_drawlist\">\n        %BEGIN_ALLOW_THREADS\n        %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size());\n        %END_ALLOW_THREADS\n    </template>\n\n    <modify-function signature=\"drawConvexPolygon(const QPoint*, int)\" remove=\"all\" />\n    <add-function signature=\"drawConvexPolygon(QVector&lt;QPoint>)\">\n        <inject-code>\n            <insert-template name=\"qpainter_drawlist\" />\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"drawConvexPolygon(const QPointF*, int)\" remove=\"all\" />\n    <add-function signature=\"drawConvexPolygon(QVector&lt;QPointF>)\">\n        <inject-code>\n            <insert-template name=\"qpainter_drawlist\" />\n        </inject-code>\n    </add-function>\n    <!-- ### Overloads using QVector<T> does the job of these methods -->\n    <modify-function signature=\"drawLines(const QLine*, int)\" remove=\"all\" />\n    <modify-function signature=\"drawLines(const QLineF*, int)\" remove=\"all\" />\n    <modify-function signature=\"drawLines(const QPoint*, int)\" remove=\"all\" />\n    <modify-function signature=\"drawLines(const QPointF*, int)\" remove=\"all\" />\n    <modify-function signature=\"drawRects(const QRect*, int)\" remove=\"all\" />\n    <modify-function signature=\"drawRects(const QRectF*, int)\" remove=\"all\" />\n    <!-- ### -->\n    <modify-function signature=\"drawPoints(const QPoint*, int)\" remove=\"all\" />\n    <add-function signature=\"drawPoints(QVector&lt;QPoint>)\">\n        <inject-code>\n            <insert-template name=\"qpainter_drawlist\" />\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"drawPoints(const QPointF*, int)\" remove=\"all\" />\n    <add-function signature=\"drawPoints(QVector&lt;QPointF>)\">\n        <inject-code>\n            <insert-template name=\"qpainter_drawlist\" />\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"drawPolygon(const QPoint*, int, Qt::FillRule)\" remove=\"all\" />\n    <add-function signature=\"drawPolygon(QVector&lt;QPoint>, Qt::FillRule)\">\n        <inject-code>\n            %BEGIN_ALLOW_THREADS\n            %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);\n            %END_ALLOW_THREADS\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"drawPolygon(const QPointF*, int, Qt::FillRule)\" remove=\"all\" />\n    <add-function signature=\"drawPolygon(QVector&lt;QPointF>, Qt::FillRule)\">\n        <inject-code>\n            %BEGIN_ALLOW_THREADS\n            %CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);\n            %END_ALLOW_THREADS\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"drawPolyline(const QPoint*, int)\" remove=\"all\" />\n    <add-function signature=\"drawPolyline(QVector&lt;QPoint>)\">\n        <inject-code>\n            <insert-template name=\"qpainter_drawlist\" />\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"drawPolyline(const QPointF*, int)\" remove=\"all\" />\n    <add-function signature=\"drawPolyline(QVector&lt;QPointF>)\">\n        <inject-code>\n            <insert-template name=\"qpainter_drawlist\" />\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"drawRoundRect(int, int, int, int, int, int)\">\n      <modify-argument index=\"5\">\n        <rename to=\"xRound\"/>\n      </modify-argument>\n      <modify-argument index=\"6\">\n        <rename to=\"yRound\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"drawTiledPixmap(const QRect&amp;,const QPixmap&amp;, const QPoint&amp;)\">\n      <modify-argument index=\"3\">\n        <rename to=\"pos\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QPainter(QPaintDevice*)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"begin(QPaintDevice*)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"initFrom(const QWidget*)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setRedirected(const QPaintDevice*, QPaintDevice*, const QPoint&amp;)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"restoreRedirected(const QPaintDevice*)\">\n      <modify-argument index=\"1\">\n        <no-null-pointer/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"drawText(QRectF,int,QString,QRectF*)\">\n      <modify-argument index=\"4\">\n        <remove-argument/>\n        <remove-default-expression/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"QRectF\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_args,QRectF*\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"drawText(QRect,int,QString,QRect*)\">\n      <modify-argument index=\"4\">\n        <remove-argument/>\n        <remove-default-expression/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"QRect\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_args,QRect*\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"drawText(int,int,int,int,int,QString,QRect*)\">\n      <modify-argument index=\"7\">\n        <remove-argument/>\n        <remove-default-expression/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_args,QRect*\"/>\n      </inject-code>\n    </modify-function>\n    <!--### Obsoleted by QWidget::render() -->\n    <modify-function signature=\"redirected(const QPaintDevice*,QPoint*)\" remove=\"all\" />\n    <!--### Obsolete in 4.3-->\n    <modify-function signature=\"matrix()const\" remove=\"all\"/>\n    <modify-function signature=\"matrixEnabled()const\" remove=\"all\"/>\n    <modify-function signature=\"setMatrix(QMatrix, bool)\" remove=\"all\"/>\n    <modify-function signature=\"setMatrixEnabled(bool)\" remove=\"all\"/>\n    <!--### End of obsolete section -->\n  </object-type>\n  <!-- qApp macro -->\n  <inject-code class=\"native\" position=\"beginning\">\n    PyObject* moduleQtGui;\n  </inject-code>\n  <inject-code class=\"target\" file=\"glue/qtgui_qapp.cpp\" position=\"end\" />\n  <object-type name=\"QApplication\">\n    <enum-type name=\"ColorSpec\"/>\n    <enum-type name=\"Type\"/>\n    <extra-includes>\n      <include file-name=\"QBasicTimer\" location=\"global\"/>\n      <include file-name=\"QFont\" location=\"global\"/>\n      <include file-name=\"QFontMetrics\" location=\"global\"/>\n      <include file-name=\"QPalette\" location=\"global\"/>\n      <include file-name=\"QIcon\" location=\"global\"/>\n      <include file-name=\"QLocale\" location=\"global\"/>\n      <include file-name=\"QStyle\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"QApplication(int&amp;,char**)\" access=\"private\" />\n    <add-function signature=\"QApplication(PySequence)\">\n        <inject-code>\n            QApplicationConstructor(%PYSELF, %1, &amp;%0);\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"QApplication(int&amp;,char**,bool)\" access=\"private\"/>\n    <add-function signature=\"QApplication(PySequence,bool)\">\n        <inject-code>\n            QApplicationConstructor(%PYSELF, %1, %2, &amp;%0);\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"QApplication(int&amp;,char**,QApplication::Type)\" access=\"private\" />\n    <add-function signature=\"QApplication(PySequence,QApplication::Type)\">\n        <inject-code>\n            QApplicationConstructor(%PYSELF, %1, %2, &amp;%0);\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\"/>\n    <inject-code class=\"native\" file=\"glue/qapplication_init.cpp\" position=\"beginning\" />\n\n    <!-- ### Causes warnings using generator. They were kept here to avoid generation even\n         removing Q_INTERNAL_QAPP_SRC || qdoc from #define section-->\n    <modify-function signature=\"QApplication(int&amp;,char**,int)\" remove=\"all\"/>\n    <modify-function signature=\"QApplication(int&amp;,char**,bool,int)\" remove=\"all\"/>\n    <modify-function signature=\"QApplication(int&amp;,char**,QApplication::Type,int)\" remove=\"all\"/>\n    <!-- ### -->\n\n    <!-- ownership control transfer to qApp -->\n    <modify-function signature=\"setStyle(QStyle*)\">\n        <inject-code class=\"target\" position=\"end\">\n            Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_1);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"style()\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"desktop()\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"clipboard()\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"focusWidget()\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"overrideCursor()\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"topLevelAt(const QPoint&amp;)\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"topLevelAt(int, int)\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"widgetAt(const QPoint&amp;)\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"widgetAt(int, int)\">\n      <inject-code class=\"target\" position=\"end\">\n        <insert-template name=\"set_qapp_parent_for_orphan\"/>\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QCommandLinkButton\"/>\n  <object-type name=\"QFileSystemModel\" polymorphic-id-expression=\"qobject_cast&lt;QFileSystemModel*&gt;(%1)\">\n    <enum-type name=\"Roles\"/>\n    <modify-function signature=\"setIconProvider(QFileIconProvider*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QFormLayout\">\n    <inject-code class=\"native\" position=\"beginning\" file=\"glue/qlayout_help_functions.cpp\"/>\n\n    <enum-type name=\"FieldGrowthPolicy\"/>\n    <enum-type name=\"ItemRole\"/>\n    <enum-type name=\"RowWrapPolicy\"/>\n\n    <template name=\"fix_args,int*,ItemRole*\">\n    int _row;\n    QFormLayout::ItemRole _role;\n    %BEGIN_ALLOW_THREADS\n    %CPPSELF->%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;_row, &amp;_role);\n    %END_ALLOW_THREADS\n    %PYARG_0 = PyTuple_New(2);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](_row));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QFormLayout::ItemRole](_role));\n    </template>\n\n    <modify-function signature=\"getLayoutPosition(QLayout*,int*,QFormLayout::ItemRole*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_args,int*,ItemRole*\"/>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getWidgetPosition(QWidget*,int*,QFormLayout::ItemRole*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_args,int*,ItemRole*\"/>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getItemPosition(int,int*,QFormLayout::ItemRole*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_args,int*,ItemRole*\"/>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"addRow(QWidget*,QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addRow(QLayout*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addRow(QWidget*,QLayout*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addRow(QWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addRow(QString,QLayout*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addRow(QString,QWidget*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertRow(int,QLayout*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertRow(int,QWidget*,QLayout*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertRow(int,QWidget*,QWidget*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertRow(int,QWidget*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertRow(int,QString,QLayout*)\">\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertRow(int,QString,QWidget*)\">\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setLayout(int,QFormLayout::ItemRole,QLayout*)\">\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setWidget(int,QFormLayout::ItemRole,QWidget*)\">\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setItem(int,QFormLayout::ItemRole,QLayoutItem*)\">\n      <modify-argument index=\"3\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QGraphicsGridLayout\" >\n    <modify-function signature=\"addItem(QGraphicsLayoutItem*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"addItem(QGraphicsLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QGraphicsLayout\">\n    <modify-function signature=\"getContentsMargins(qreal*,qreal*,qreal*,qreal*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n        <inject-code class=\"native\" position=\"end\">\n            <insert-template name=\"fix_native_return_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"widgetEvent(QEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QGraphicsLayoutItem\" copyable=\"false\">\n    <modify-function signature=\"getContentsMargins(qreal*,qreal*,qreal*,qreal*)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n        <inject-code class=\"native\" position=\"end\">\n            <insert-template name=\"fix_native_return_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"setParentLayoutItem(QGraphicsLayoutItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QGraphicsLinearLayout\" >\n    <modify-function signature=\"addItem(QGraphicsLayoutItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertItem(int,QGraphicsLayoutItem*)\">\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"removeItem(QGraphicsLayoutItem*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setStretchFactor(QGraphicsLayoutItem*,int)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QGraphicsProxyWidget\">\n    <modify-function signature=\"QGraphicsProxyWidget(QGraphicsItem*, QFlags&lt;Qt::WindowType&gt;)\">\n      <modify-argument index=\"this\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"createProxyForChildWidget(QWidget*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"newProxyWidget(const QWidget*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setWidget(QWidget*)\">\n      <inject-code>\n          QWidget* _old = %CPPSELF.widget();\n          if (_old)\n             Shiboken::Object::setParent(NULL, %CONVERTTOPYTHON[QWidget*](_old));\n          %CPPSELF.%FUNCTION_NAME(%1);\n          Shiboken::Object::setParent(%PYSELF, %PYARG_1);\n      </inject-code>\n    </modify-function>\n  </object-type>\n  <!-- a QObject so main-thread delete redundant -->\n  <object-type name=\"QGraphicsWidget\">\n    <modify-function signature=\"getContentsMargins(qreal*,qreal*,qreal*,qreal*)const\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"getWindowFrameMargins(qreal*,qreal*,qreal*,qreal*)const\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <!-- a QObject so main-thread delete redundant -->\n    <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->\n    <modify-function signature=\"children()const\" remove=\"all\"/>\n    <modify-function signature=\"setLayout(QGraphicsLayout*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"changeEvent(QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"closeEvent(QCloseEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"grabKeyboardEvent(QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"grabMouseEvent(QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"hideEvent(QHideEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"moveEvent(QGraphicsSceneMoveEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"resizeEvent(QGraphicsSceneResizeEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"showEvent(QShowEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"ungrabKeyboardEvent(QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"ungrabMouseEvent(QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"windowFrameEvent(QEvent*)\">\n      <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"setStyle(QStyle*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setTabOrder(QGraphicsWidget*,QGraphicsWidget*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n  <object-type name=\"QPlainTextDocumentLayout\"/>\n  <object-type name=\"QPlainTextEdit\">\n    <enum-type name=\"LineWrapMode\"/>\n    <modify-function signature=\"setDocument(QTextDocument*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"insertFromMimeData(const QMimeData*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"print(QPrinter*)const\" rename=\"print_\" />\n  </object-type>\n  <object-type name=\"QStyledItemDelegate\">\n    <modify-function signature=\"setItemEditorFactory(QItemEditorFactory*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setEditorData(QWidget*,QModelIndex)const\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <value-type name=\"QMatrix2x2\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"4\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"4\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QMatrix2x2(PySequence*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_constructor\">\n          <replace from=\"%SIZE\" to=\"4\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"data()\" return-type=\"qreal\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"4\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"fill(PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_fill_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"4\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"transposed()\" return-type=\"PyObject\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_transposed_function\">\n          <replace from=\"%TRANSPOSED_TYPE\" to=\"QMatrix2x2\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator!=(const QMatrix2x2&amp;)\" return-type=\"bool\" />\n\n    <template name=\"inplace_add\">\n    *%CPPSELF += %1;\n    return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);\n    </template>\n    <template name=\"inplace_sub\">\n    *%CPPSELF -= %1;\n    return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);\n    </template>\n    <template name=\"inplace_mult\">\n    *%CPPSELF *= %1;\n    return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);\n    </template>\n    <template name=\"inplace_div\">\n    *%CPPSELF /= %1;\n    return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);\n    </template>\n\n    <add-function signature=\"operator*=(qreal)\" return-type=\"QMatrix2x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_mult\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator+=(const QMatrix2x2&amp;)\" return-type=\"QMatrix2x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_add\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator-=(const QMatrix2x2&amp;)\" return-type=\"QMatrix2x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_sub\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator/=(qreal)\" return-type=\"QMatrix2x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_div\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator==(const QMatrix2x2&amp;)\" return-type=\"bool\" />\n  </value-type>\n\n  <value-type name=\"QMatrix2x3\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"6\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"6\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QMatrix2x3(PySequence*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_constructor\">\n          <replace from=\"%SIZE\" to=\"6\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"data()\" return-type=\"qreal\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"6\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"fill(PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_fill_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"6\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"transposed()\" return-type=\"PyObject\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_transposed_function\">\n          <replace from=\"%TRANSPOSED_TYPE\" to=\"QMatrix3x2\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator!=(const QMatrix2x3&amp;)\" return-type=\"bool\" />\n    <add-function signature=\"operator*=(qreal)\" return-type=\"QMatrix2x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_mult\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator+=(const QMatrix2x3&amp;)\" return-type=\"QMatrix2x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_add\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator-=(const QMatrix2x3&amp;)\" return-type=\"QMatrix2x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_sub\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator/=(qreal)\" return-type=\"QMatrix2x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_div\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator==(const QMatrix2x3&amp;)\" return-type=\"bool\" />\n  </value-type>\n\n  <value-type name=\"QMatrix2x4\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"8\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"8\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QMatrix2x4(PySequence*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_constructor\">\n          <replace from=\"%SIZE\" to=\"8\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"data()\" return-type=\"qreal\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"8\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"fill(PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_fill_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"8\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"transposed()\" return-type=\"PyObject\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_transposed_function\">\n          <replace from=\"%TRANSPOSED_TYPE\" to=\"QMatrix4x2\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator!=(const QMatrix2x4&amp;)\" return-type=\"bool\" />\n    <add-function signature=\"operator*=(qreal)\" return-type=\"QMatrix2x4\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_mult\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator+=(const QMatrix2x4&amp;)\" return-type=\"QMatrix2x4\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_add\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator-=(const QMatrix2x4&amp;)\" return-type=\"QMatrix2x4\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_sub\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator/=(qreal)\" return-type=\"QMatrix2x4\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_div\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator==(const QMatrix2x4&amp;)\" return-type=\"bool\" />\n </value-type>\n\n  <value-type name=\"QMatrix3x2\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"6\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"6\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QMatrix3x2(PySequence*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_constructor\">\n          <replace from=\"%SIZE\" to=\"6\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"data()\" return-type=\"qreal\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"6\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"fill(PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_fill_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"6\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"transposed()\" return-type=\"PyObject\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_transposed_function\">\n          <replace from=\"%TRANSPOSED_TYPE\" to=\"QMatrix2x3\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator!=(const QMatrix3x2&amp;)\" return-type=\"bool\" />\n    <add-function signature=\"operator*=(qreal)\" return-type=\"QMatrix3x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_mult\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator+=(const QMatrix3x2&amp;)\" return-type=\"QMatrix3x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_add\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator-=(const QMatrix3x2&amp;)\" return-type=\"QMatrix3x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_sub\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator/=(qreal)\" return-type=\"QMatrix3x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_div\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator==(const QMatrix3x2&amp;)\" return-type=\"bool\" />\n  </value-type>\n\n  <value-type name=\"QMatrix3x3\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"9\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"9\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QMatrix3x3(PySequence*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_constructor\">\n          <replace from=\"%SIZE\" to=\"9\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"data()\" return-type=\"qreal\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"9\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"fill(PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_fill_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"9\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"transposed()\" return-type=\"PyObject\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_transposed_function\">\n          <replace from=\"%TRANSPOSED_TYPE\" to=\"QMatrix3x3\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator!=(const QMatrix3x3&amp;)\" return-type=\"bool\" />\n    <add-function signature=\"operator*=(qreal)\" return-type=\"QMatrix3x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_mult\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator+=(const QMatrix3x3&amp;)\" return-type=\"QMatrix3x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_add\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator-=(const QMatrix3x3&amp;)\" return-type=\"QMatrix3x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_sub\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator/=(qreal)\" return-type=\"QMatrix3x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_div\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator==(const QMatrix3x3&amp;)\" return-type=\"bool\" />\n  </value-type>\n\n  <value-type name=\"QMatrix3x4\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"12\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"12\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QMatrix3x4(PySequence*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_constructor\">\n          <replace from=\"%SIZE\" to=\"12\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"data()\" return-type=\"qreal\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"12\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"fill(PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_fill_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"12\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"transposed()\" return-type=\"PyObject\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_transposed_function\">\n          <replace from=\"%TRANSPOSED_TYPE\" to=\"QMatrix4x3\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator!=(const QMatrix3x4&amp;)\" return-type=\"bool\" />\n    <add-function signature=\"operator*=(qreal)\" return-type=\"QMatrix3x4\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_mult\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator+=(const QMatrix3x4&amp;)\" return-type=\"QMatrix3x4\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_add\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator-=(const QMatrix3x4&amp;)\" return-type=\"QMatrix3x4\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_sub\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator/=(qreal)\" return-type=\"QMatrix3x4\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_div\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator==(const QMatrix3x4&amp;)\" return-type=\"bool\" />\n  </value-type>\n\n  <value-type name=\"QMatrix4x2\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"8\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"8\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QMatrix4x2(PySequence*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_constructor\">\n          <replace from=\"%SIZE\" to=\"8\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"data()\" return-type=\"qreal\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"8\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"fill(PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_fill_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"8\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"transposed()\" return-type=\"PyObject\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_transposed_function\">\n          <replace from=\"%TRANSPOSED_TYPE\" to=\"QMatrix2x4\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator!=(const QMatrix4x2&amp;)\" return-type=\"bool\" />\n    <add-function signature=\"operator*=(qreal)\" return-type=\"QMatrix4x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_mult\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator+=(const QMatrix4x2&amp;)\" return-type=\"QMatrix4x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_add\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator-=(const QMatrix4x2&amp;)\" return-type=\"QMatrix4x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_sub\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator/=(qreal)\" return-type=\"QMatrix4x2\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_div\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator==(const QMatrix4x2&amp;)\" return-type=\"bool\" />\n  </value-type>\n\n  <value-type name=\"QMatrix4x3\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"12\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"12\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n    <add-function signature=\"QMatrix4x3(PySequence*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_constructor\">\n          <replace from=\"%SIZE\" to=\"12\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"data()\" return-type=\"qreal\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"12\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"fill(PyObject*)\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_fill_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"12\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"transposed()\" return-type=\"PyObject\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_transposed_function\">\n          <replace from=\"%TRANSPOSED_TYPE\" to=\"QMatrix3x4\" />\n        </insert-template>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator!=(const QMatrix4x3&amp;)\" return-type=\"bool\" />\n    <add-function signature=\"operator*=(qreal)\" return-type=\"QMatrix4x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_mult\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator+=(const QMatrix4x3&amp;)\" return-type=\"QMatrix4x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_add\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator-=(const QMatrix4x3&amp;)\" return-type=\"QMatrix4x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_sub\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator/=(qreal)\" return-type=\"QMatrix4x3\" >\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"inplace_div\"/>\n      </inject-code>\n    </add-function>\n    <add-function signature=\"operator==(const QMatrix4x3&amp;)\" return-type=\"bool\" />\n  </value-type>\n\n  <value-type name=\"QMatrix4x4\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code_matrix\">\n               <replace from=\"%MATRIX_SIZE\" to=\"16\" />\n               <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code_matrix\">\n              <replace from=\"%MATRIX_TYPE\" to=\"qreal\" />\n              <replace from=\"%MATRIX_SIZE\" to=\"16\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <!-- ### \"QMatrix4x4(const qreal*,int,int)\" is an internal constructor. -->\n    <modify-function signature=\"QMatrix4x4(const qreal*,int,int)\" remove=\"all\"/>\n\n    <modify-function signature=\"QMatrix4x4(const qreal*)\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"PySequence\" />\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        if (PySequence_Size(%PYARG_1) == 16) {\n            qreal values[16];\n            for(int i=0; i &lt; 16; i++) {\n                PyObject *pv = PySequence_Fast_GET_ITEM(%PYARG_1, i);\n                values[i] = PyFloat_AsDouble(pv);\n            }\n\n            %0 = new %TYPE(values[0], values[1], values[2], values[3],\n                           values[4], values[5], values[6], values[7],\n                           values[8], values[9], values[10], values[11],\n                           values[12], values[13], values[14], values[15]);\n        }\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"data()\">\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"matrix_data_function\">\n          <replace from=\"%MATRIX_SIZE\" to=\"16\" />\n        </insert-template>\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"copyDataTo(qreal *) const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"PyTupleObject*\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        qreal values[16];\n        %CPPSELF.%FUNCTION_NAME(values);\n        %PYARG_0 = PyTuple_New(16);\n        for(int i=0; i &lt; 16; i++) {\n          PyObject *v = PyFloat_FromDouble(values[i]);\n          PyTuple_SET_ITEM(%PYARG_0, i, v);\n        }\n      </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"inverted(bool*)const\">\n      <modify-argument index=\"1\">\n        <remove-argument/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"PyTuple\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        <insert-template name=\"fix_bool*\"/>\n      </inject-code>\n    </modify-function>\n\n    <!-- ### \"constData() const\" and \"data() const\" are unnecessary in Python and their function is performed by \"data()\". -->\n    <modify-function signature=\"data() const\" remove=\"all\"/>\n    <modify-function signature=\"constData() const\" remove=\"all\"/>\n    <!-- ### -->\n    <modify-function signature=\"operator()(int, int) const\" remove=\"all\"/>\n    <modify-function signature=\"operator()(int, int)\" remove=\"all\"/>\n    <add-function signature=\"__mgetitem__\" return-type=\"PyObject*\">\n       <inject-code>\n         if (PySequence_Check(_key)) {\n             Shiboken::AutoDecRef key(PySequence_Fast(_key, \"Invalid matrix index.\"));\n             if (PySequence_Fast_GET_SIZE(key.object()) == 2) {\n                 PyObject* posx = PySequence_Fast_GET_ITEM(key.object(), 0);\n                 PyObject* posy = PySequence_Fast_GET_ITEM(key.object(), 1);\n                 Py_ssize_t x = PyInt_AsSsize_t(posx);\n                 Py_ssize_t y = PyInt_AsSsize_t(posy);\n                 qreal ret = (*%CPPSELF)(x,y);\n                 return %CONVERTTOPYTHON[qreal](ret);\n             }\n         }\n         PyErr_SetString(PyExc_IndexError, \"Invalid matrix index.\");\n         return 0;\n       </inject-code>\n    </add-function>\n  </value-type>\n\n  <object-type name=\"QGesture\" since=\"4.6\">\n      <enum-type name=\"GestureCancelPolicy\"/>\n  </object-type>\n  <object-type name=\"QGestureRecognizer\" since=\"4.6\">\n      <enum-type name=\"ResultFlag\" flags=\"Result\"/>\n  </object-type>\n  <object-type name=\"QTapAndHoldGesture\" since=\"4.6\"/>\n  <object-type name=\"QTapGesture\" since=\"4.6\"/>\n  <object-type name=\"QGraphicsAnchor\" since=\"4.6\"/>\n  <object-type name=\"QGraphicsAnchorLayout\" since=\"4.6\"/>\n  <object-type name=\"QGraphicsBlurEffect\" since=\"4.6\">\n      <enum-type name=\"BlurHint\" flags=\"BlurHints\"/>\n  </object-type>\n  <object-type name=\"QGraphicsColorizeEffect\" since=\"4.6\"/>\n  <object-type name=\"QGraphicsDropShadowEffect\" since=\"4.6\"/>\n\n  <object-type name=\"QGraphicsEffect\" since=\"4.6\">\n      <enum-type name=\"ChangeFlag\" flags=\"ChangeFlags\"/>\n      <enum-type name=\"PixmapPadMode\"/>\n  </object-type>\n\n  <!-- QtInternal\n  <object-type name=\"QGraphicsEffectSource\"/>\n  -->\n\n  <object-type name=\"QGraphicsObject\" since=\"4.6\" />\n  <object-type name=\"QGraphicsOpacityEffect\" since=\"4.6\"/>\n  <object-type name=\"QGraphicsRotation\" since=\"4.6\"/>\n  <object-type name=\"QGraphicsScale\" since=\"4.6\"/>\n  <object-type name=\"QGraphicsTransform\" since=\"4.6\"/>\n  <object-type name=\"QKeyEventTransition\" since=\"4.6\"/>\n  <object-type name=\"QMouseEventTransition\" since=\"4.6\"/>\n  <object-type name=\"QPanGesture\" since=\"4.6\"/>\n  <object-type name=\"QPinchGesture\" since=\"4.6\">\n      <enum-type name=\"ChangeFlag\" flags=\"ChangeFlags\"/>\n  </object-type>\n  <value-type name=\"QQuaternion\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f, %f, %f\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"dddd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.scalar(), %CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n  </value-type>\n\n\n  <!-- Symbian\n  <value-type name=\"QS60MainApplication\"/>\n  <value-type name=\"QS60MainAppUi\"/>\n  <object-type name=\"QS60MainDocument\"/>\n  <value-type name=\"QS60Style\"/>\n\n  <object-type name=\"QSymbianEvent\">\n      <enum-type name=\"Type\"/>\n  </object-type>\n  -->\n\n  <object-type name=\"QSwipeGesture\" since=\"4.6\">\n      <enum-type name=\"SwipeDirection\"/>\n  </object-type>\n\n  <value-type name=\"QTileRules\" since=\"4.6\"/>\n\n  <object-type name=\"QTouchEvent\" since=\"4.6\">\n      <enum-type name=\"DeviceType\"/>\n      <value-type name=\"TouchPoint\" since=\"4.6\"/>\n  </object-type>\n\n  <value-type name=\"QVector2D\" since=\"4.6\">\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"dd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"dd\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n  </value-type>\n  <value-type name=\"QVector3D\" since=\"4.6\">\n    <extra-includes>\n      <include file-name=\"QMatrix4x4\" location=\"global\"/>\n    </extra-includes>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f, %f\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"ddd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"ddd\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n  </value-type>\n  <value-type name=\"QVector4D\" since=\"4.6\">\n    <extra-includes>\n      <include file-name=\"QMatrix4x4\" location=\"global\"/>\n    </extra-includes>\n    <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"repr_code\">\n               <replace from=\"%REPR_FORMAT\" to=\"%f, %f, %f, %f\" />\n               <replace from=\"%REPR_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()\" />\n             </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"__reduce__\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"reduce_code\">\n              <replace from=\"%REDUCE_FORMAT\" to=\"dddd\" />\n              <replace from=\"%REDUCE_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n\n    <add-function signature=\"toTuple\" return-type=\"PyObject*\">\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"to_tuple\">\n                <replace from=\"%TT_FORMAT\" to=\"dddd\" />\n                <replace from=\"%TT_ARGS\" to=\"%CPPSELF.x(), %CPPSELF.y(), %CPPSELF.z(), %CPPSELF.w()\" />\n            </insert-template>\n        </inject-code>\n    </add-function>\n  </value-type>\n\n  <suppress-warning text=\"template baseclass 'QGenericMatrix&lt;qreal&gt;' of '*' is not known\"/>\n  <suppress-warning text=\"signature 'QApplication(int&amp;,char**)' for function modification in 'QApplication' not found.\"/>\n  <suppress-warning text=\"signature 'QApplication(int&amp;,char**,bool)' for function modification in 'QApplication' not found.\"/>\n  <suppress-warning text=\"signature 'QApplication(int&amp;,char**,QApplication::Type)' for function modification in 'QApplication' not found.\"/>\n  <suppress-warning text=\"signature 'addToolbar(Qt::ToolBarArea,QToolBar*)' for function modification in 'QMainWindow' not found.\"/>\n  <suppress-warning text=\"signature 'addToolbar(QToolBar*)' for function modification in 'QMainWindow' not found.\"/>\n  <suppress-warning text=\"signature 'addToolbar(QString)' for function modification in 'QMainWindow' not found.\"/>\n  <suppress-warning text=\"unhandled enum value: ~FlagMask in QMessageBox::StandardButton\"/>\n  <suppress-warning text=\"unmatched enum ~FlagMask\"/>\n  <suppress-warning text=\"enum 'QMatrix4x4::enum_1' is specified in typesystem, but not declared\"/>\n  <suppress-warning text=\"class not found for setup inheritance 'QMimeSource'\"/>\n  <suppress-warning text=\"class 'QDropEvent' inherits from unknown base class 'QMimeSource'\"/>\n\n\n  <!-- The following entries may be present in the system or not. Keep this section organized. -->\n  <object-type name=\"QAbstractPageSetupDialog\"/>\n  <object-type name=\"QAbstractPrintDialog\">\n    <enum-type name=\"PrintDialogOption\" flags=\"PrintDialogOptions\"/>\n    <enum-type name=\"PrintRange\"/>\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\" />\n  </object-type>\n\n  <object-type name=\"QGtkStyle\">\n    <modify-function signature=\"standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const\">\n      <modify-argument index=\"2\">\n        <replace-default-expression with=\"0\"/>\n      </modify-argument>\n      <modify-argument index=\"3\">\n        <replace-default-expression with=\"0\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QPageSetupDialog\">\n    <enum-type name=\"PageSetupDialogOption\" flags=\"PageSetupDialogOptions\"/>\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\"/>\n  </object-type>\n\n  <object-type name=\"QPrintDialog\">\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\" />\n  </object-type>\n  <object-type name=\"QPrintEngine\">\n    <enum-type name=\"PrintEnginePropertyKey\" />\n  </object-type>\n  <value-type name=\"QPrinterInfo\" />\n  <rejection class=\"QPrinter\" function-name=\"printerSelectionOption\"/>\n  <rejection class=\"QPrinter\" function-name=\"setPrinterSelectionOption\"/>\n\n  <object-type name=\"QPrinter\" >\n    <enum-type name=\"ColorMode\"/>\n    <enum-type name=\"DuplexMode\"/>\n    <enum-type name=\"Orientation\"/>\n    <enum-type name=\"OutputFormat\"/>\n    <enum-type name=\"PageOrder\"/>\n    <enum-type name=\"PageSize\" />\n    <enum-type name=\"PaperSource\"/>\n    <enum-type name=\"PrintRange\"/>\n    <enum-type name=\"PrinterMode\"/>\n    <enum-type name=\"PrinterState\"/>\n    <enum-type name=\"Unit\"/>\n    <modify-function signature=\"getPageMargins(qreal*,qreal*,qreal*,qreal*,QPrinter::Unit)const\">\n        <modify-argument index=\"0\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <modify-argument index=\"1\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"2\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"3\">\n            <remove-argument/>\n        </modify-argument>\n        <modify-argument index=\"4\">\n            <remove-argument/>\n        </modify-argument>\n        <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"fix_number*,number*,number*,number*,args\">\n                <replace from=\"$TYPE\" to=\"qreal\" />\n            </insert-template>\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"setEngines(QPrintEngine*,QPaintEngine*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <extra-includes>\n      <include file-name=\"QPrinterInfo\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n\n  <object-type name=\"QPrintPreviewDialog\"/>\n  <object-type name=\"QPrintPreviewWidget\">\n    <enum-type name=\"ViewMode\"/>\n    <enum-type name=\"ZoomMode\"/>\n    <modify-function signature=\"print()\" rename=\"print_\" />\n  </object-type>\n\n  <object-type name=\"QSessionManager\">\n    <extra-includes>\n    </extra-includes>\n    <enum-type name=\"RestartHint\"/>\n    <!-- ### \"handle()const\" is an internal method. -->\n    <modify-function signature=\"handle()const\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n\n  <object-type name=\"QSizeGrip\"/>\n\n  <object-type name=\"QSystemTrayIcon\">\n    <enum-type name=\"ActivationReason\"/>\n    <enum-type name=\"MessageIcon\"/>\n    <modify-function signature=\"setContextMenu(QMenu*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <!-- The above entries may be present in the system or not. Keep this section organized. -->\n\n  <!-- This enum is present on QtCore -->\n  <suppress-warning text=\"enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared\" />\n\n</typesystem>\n\n"
  },
  {
    "path": "PySide/QtGui/typesystem_gui_mac.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtGui\">\n  <rejection class=\"*\" function-name=\"qt_mac_set_cursor\"/>\n  <rejection class=\"*\" function-name=\"macMenu\"/>\n\n  <primitive-type name=\"Qt::HANDLE\" target-lang-api-name=\"PyObject\"/>\n  <object-type name=\"QMacStyle\" >\n    <enum-type name=\"FocusRectPolicy\"/>\n    <enum-type name=\"WidgetSizePolicy\"/>\n  </object-type>\n\n  <suppress-warning text=\"enum 'QPixmap::ShareMode' does not have a type entry or is not an enum\" />\n  <suppress-warning text=\"enum 'QSysInfo::Endian' is specified in typesystem, but not declared\" />\n  <suppress-warning text=\"type 'QGtkStyle' is specified in typesystem, but not defined. This could potentially lead to compilation errors.\" />\n</typesystem>\n"
  },
  {
    "path": "PySide/QtGui/typesystem_gui_maemo.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtGui\">\n\n  <object-type name=\"QAbstractKineticScroller\">\n      <enum-type name=\"Mode\"/>\n      <enum-type name=\"OvershootPolicy\"/>\n      <enum-type name=\"State\"/>\n  </object-type>\n\n  <load-typesystem name=\"typesystem_gui_x11.xml\" generate=\"yes\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtGui/typesystem_gui_simulator.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtGui\">\n  <!-- These classes are not present in Qt Simulator build, even though\n       QT_NO_PRINTER is *not* set -->\n  <rejection class=\"QAbstractPageSetupDialog\"/>\n  <rejection class=\"QAbstractPrintDialog\"/>\n  <rejection class=\"QPageSetupDialog\"/>\n  <rejection class=\"QPrintDialog\"/>\n  <rejection class=\"QPrintPreviewDialog\"/>\n  <rejection class=\"QPrintPreviewWidget\"/>\n  <rejection class=\"QPrintEngine\"/>\n  <rejection class=\"QPrinterInfo\"/>\n  <rejection class=\"QPrinter\"/>\n\n  <object-type name=\"QPlainTextEdit\">\n    <modify-function signature=\"print(QPrinter*)const\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QTextDocument\">\n    <modify-function signature=\"print(QPrinter*)const\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QTextEdit\">\n    <modify-function signature=\"print(QPrinter*)const\" remove=\"all\"/>\n  </object-type>\n\n  <!-- Qt::HANDLE is typedef to \"void *\", which gives compilation errors on\n       conversion templates -->\n  <value-type name=\"QCursor\">\n    <modify-function signature=\"QCursor(Qt::HANDLE)\" remove=\"all\"/>\n  </value-type>\n  <value-type name=\"QFont\">\n    <modify-function signature=\"handle()const\" remove=\"all\"/>\n  </value-type>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtGui/typesystem_gui_win.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtGui\">\n  <primitive-type name=\"WId\" target-lang-api-name=\"PyObject\">\n    <conversion-rule>\n        <native-to-target>\n        #ifdef IS_PY3K\n        return PyCapsule_New(%in, 0, 0);\n        #else\n        return PyCObject_FromVoidPtr(%in, 0);\n        #endif\n        </native-to-target>\n        <target-to-native>\n            <add-conversion type=\"PyNone\">\n            %out = 0;\n            </add-conversion>\n            <add-conversion check=\"checkPyCapsuleOrPyCObject(%in)\" type=\"PyObject\">\n            #ifdef IS_PY3K\n            %out = (%OUTTYPE)PyCapsule_GetPointer(%in, 0);\n            #else\n            %out = (%OUTTYPE)PyCObject_AsVoidPtr(%in);\n            #endif\n            </add-conversion>\n        </target-to-native>\n    </conversion-rule>\n  </primitive-type>\n  <inject-code class=\"native\" position=\"beginning\">\n    <insert-template name=\"checkPyCapsuleOrPyCObject_func\"/>\n  </inject-code>\n  <enum-type name=\"QPixmap::HBitmapFormat\" />\n</typesystem>\n"
  },
  {
    "path": "PySide/QtGui/typesystem_gui_x11.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtGui\">\n\n  <rejection class=\"\" function-name=\"qt_x11_getX11InfoForWindow\"/>\n  <rejection class=\"QX11Info\" field-name=\"x11data\"/>\n  <value-type name=\"QX11Info\">\n    <add-function signature=\"display()\" return-type=\"unsigned long\" static=\"yes\">\n        <inject-code>\n            %PYARG_0 = PyLong_FromVoidPtr(%TYPE::%FUNCTION_NAME());\n        </inject-code>\n    </add-function>\n    <modify-function signature=\"visual()const\">\n        <inject-code>\n            %PYARG_0 = PyLong_FromVoidPtr(%CPPSELF.%FUNCTION_NAME());\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"appVisual(int)\">\n        <inject-code>\n            %PYARG_0 = PyLong_FromVoidPtr(%CPPSELF.%FUNCTION_NAME());\n        </inject-code>\n    </modify-function>\n  </value-type>\n  <object-type name=\"QX11EmbedContainer\">\n    <enum-type name=\"Error\"/>\n  </object-type>\n  <object-type name=\"QX11EmbedWidget\">\n    <enum-type name=\"Error\"/>\n  </object-type>\n\n  <enum-type name=\"QPixmap::ShareMode\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtHelp/CMakeLists.txt",
    "content": "project(QtHelp)\n\nset(QtHelp_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpcontentitem_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpcontentmodel_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpcontentwidget_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpenginecore_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpengine_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpindexmodel_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpindexwidget_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpsearchengine_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpsearchquerywidget_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpsearchquery_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qhelpsearchresultwidget_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp/qthelp_module_wrapper.cpp\n)\n\nset(QtHelp_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtHelp_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\nset(QtHelp_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}\n                        ${QT_QTCORE_INCLUDE_DIR}\n                        ${QT_QTGUI_INCLUDE_DIR}\n                        ${QT_QTHELP_INCLUDE_DIR}\n                        ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                        ${SHIBOKEN_INCLUDE_DIR}\n                        ${libpyside_SOURCE_DIR}\n                        ${QtGui_BINARY_DIR}/PySide/QtGui/\n                        ${QtCore_BINARY_DIR}/PySide/QtCore/\n                        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtHelp)\nset(QtHelp_libraries  pyside\n                      ${SHIBOKEN_PYTHON_LIBRARIES}\n                      ${QT_QTCORE_LIBRARY}\n                      ${QT_QTGUI_LIBRARY}\n                      ${QT_QTHELP_LIBRARY})\nset(QtHelp_deps QtGui)\n\ncreate_pyside_module(QtHelp\n                     QtHelp_include_dirs\n                     QtHelp_libraries\n                     QtHelp_deps\n                     QtHelp_typesystem_path\n                     QtHelp_SRC\n                     \"\")\n"
  },
  {
    "path": "PySide/QtHelp/typesystem_help.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n\n<typesystem package=\"PySide.QtHelp\">\n    <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\" />\n\n    <value-type name=\"QHelpContentItem\">\n      <modify-function signature=\"parent() const\">\n        <modify-argument index=\"return\">\n          <define-ownership owner=\"default\"/>\n        </modify-argument>\n      </modify-function>\n    </value-type>\n    <object-type name=\"QHelpContentModel\" polymorphic-id-expression=\"qobject_cast&lt;QHelpContentModel*&gt;(%1)\"/>\n    <object-type name=\"QHelpContentWidget\"/>\n    <object-type name=\"QHelpEngine\" />\n    <object-type name=\"QHelpEngineCore\"/>\n    <object-type name=\"QHelpIndexModel\"/>\n    <object-type name=\"QHelpIndexWidget\"/>\n    <object-type name=\"QHelpSearchEngine\"/>\n    <value-type name=\"QHelpSearchQuery\">\n        <enum-type name=\"FieldName\"/>\n    </value-type>\n    <object-type name=\"QHelpSearchQueryWidget\"/>\n    <object-type name=\"QHelpSearchResultWidget\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtMaemo5/CMakeLists.txt",
    "content": "project(QtMaemo5)\n\nset(QtMaemo5_SRC\n${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5abstractpickselector_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5datepickselector_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5editbar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5informationbox_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5listpickselector_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5timepickselector_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5valuebutton_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qtmaemo5_module_wrapper.cpp\n)\n\nset(QtMaemo5_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\n\n# QT_QTMAEMO5_* variables are not defined by CMake\nif(NOT QT_QTMAEMO5_INCLUDE_DIR)\n  FIND_PATH(QT_QTMAEMO5_INCLUDE_DIR QtMaemo5\n            PATHS ${QT_HEADERS_DIR}/QtMaemo5 NO_DEFAULT_PATH)\nendif()\nif(NOT QT_QTMAEMO5_LIBRARY)\n  FIND_LIBRARY(QT_QTMAEMO5_LIBRARY QtMaemo5\n               PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)\nendif()\n\nset(QtMaemo5_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}\n                        ${QT_QTCORE_INCLUDE_DIR}\n                        ${QT_QTGUI_INCLUDE_DIR}\n                        ${QT_QTMAEMO5_INCLUDE_DIR}\n                        ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                        ${SHIBOKEN_INCLUDE_DIR}\n                        ${libpyside_SOURCE_DIR}\n                        ${QtCore_BINARY_DIR}/${BINDING_NAME}/QtCore/\n                        ${QtGui_BINARY_DIR}/${BINDING_NAME}/QtGui/\n                        ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5)\nset(QtMaemo5_libraries  pyside\n                      ${SHIBOKEN_PYTHON_LIBRARIES}\n                      ${QT_QTCORE_LIBRARY}\n                      ${QT_QTGUI_LIBRARY}\n                      ${QT_QTMAEMO5_LIBRARY})\nset(QtMaemo5_deps QtGui)\n\ncreate_pyside_module(QtMaemo5\n                     QtMaemo5_include_dirs\n                     QtMaemo5_libraries\n                     QtMaemo5_deps\n                     QtMaemo5_typesystem_path\n                     QtMaemo5_SRC\n                     \"\")\n\n"
  },
  {
    "path": "PySide/QtMaemo5/typesystem_maemo5.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtMaemo5\">\n  <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\"/>\n\n  <object-type name=\"QMaemo5AbstractPickSelector\">\n    <modify-function signature=\"widget(QWidget*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QMaemo5DatePickSelector\"/>\n\n  <object-type name=\"QMaemo5EditBar\">\n     <modify-function signature=\"addButton(QAbstractButton*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n     </modify-function>\n     <modify-function signature=\"removeButton(QAbstractButton*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"remove\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QMaemo5InformationBox\">\n    <modify-function signature=\"setWidget(QWidget*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n     </modify-function>\n     <modify-function signature=\"paintEvent(QPaintEvent*)\">\n       <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n     </modify-function>\n     <modify-function signature=\"showEvent(QShowEvent*)\">\n       <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QMaemo5ListPickSelector\">\n    <modify-function signature=\"setModel(QAbstractItemModel*)\">\n      <modify-argument index=\"1\">\n        <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"widget(QWidget*)\">\n      <modify-argument index=\"return\">\n        <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QMaemo5TimePickSelector\"/>\n  <object-type name=\"QMaemo5ValueButton\">\n    <enum-type name=\"ValueLayout\"/>\n    <modify-function signature=\"setPickSelector(QMaemo5AbstractPickSelector*)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"paintEvent(QPaintEvent*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n  </object-type>\n\n</typesystem>\n"
  },
  {
    "path": "PySide/QtMultimedia/CMakeLists.txt",
    "content": "project(QtMultimedia)\n\nset(QtMultimedia_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudio_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qabstractvideobuffer_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudioenginefactoryinterface_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qvideosurfaceformat_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qabstractvideosurface_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudiodeviceinfo_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qabstractaudiodeviceinfo_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qabstractaudiooutput_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qabstractaudioinput_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudioengineplugin_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudioformat_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudioinput_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qaudiooutput_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qvideoframe_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/qtmultimedia_module_wrapper.cpp\n)\nset(QtMultimedia_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\n\nset(QtMultimedia_include_dirs   ${CMAKE_CURRENT_SOURCE_DIR}\n                                ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtMultimedia/\n                                ${QT_INCLUDE_DIR}\n                                ${QT_QTCORE_INCLUDE_DIR}\n                                ${QT_QTGUI_INCLUDE_DIR}\n                                ${QT_QTMULTIMEDIA_INCLUDE_DIR}\n                                ${SHIBOKEN_INCLUDE_DIR}\n                                ${libpyside_SOURCE_DIR}\n                                ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                                ${QtCore_BINARY_DIR}/PySide/QtCore/\n                                ${QtGui_BINARY_DIR}/PySide/QtGui/)\n\nset(QtMultimedia_libraries  pyside\n                            ${SHIBOKEN_PYTHON_LIBRARIES}\n                            ${SHIBOKEN_LIBRARY}\n                            ${QT_QTMULTIMEDIA_LIBRARY}\n                            ${QT_QTGUI_LIBRARY})\n\nset(QtMultimedia_deps QtGui)\n\ncreate_pyside_module(QtMultimedia\n                     QtMultimedia_include_dirs\n                     QtMultimedia_libraries\n                     QtMultimedia_deps\n                     QtMultimedia_typesystem_path\n                     QtMultimedia_SRC\n                     \"\")\n"
  },
  {
    "path": "PySide/QtMultimedia/typesystem_multimedia.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtMultimedia\">\n  <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\" />\n\n  <rejection class=\"\" function-name=\"qobject_cast&lt;QAudioEngineFactoryInterface*&gt;\"/>\n  <rejection class=\"\" function-name=\"qobject_interface_iid&lt;QAudioEngineFactoryInterface*&gt;\"/>\n\n  <namespace-type name=\"QAudio\">\n      <enum-type name=\"Error\"/>\n      <enum-type name=\"Mode\"/>\n      <enum-type name=\"State\"/>\n  </namespace-type>\n\n  <value-type name=\"QVideoSurfaceFormat\">\n      <enum-type name=\"Direction\"/>\n      <enum-type name=\"YCbCrColorSpace\"/>\n  </value-type>\n  <object-type name=\"QAbstractVideoBuffer\">\n      <enum-type name=\"HandleType\"/>\n      <enum-type name=\"MapMode\"/>\n      <modify-function signature=\"map(QAbstractVideoBuffer::MapMode, int*, int*)\" remove=\"all\"/>\n      <!-- TODO: discuss a way to have this working with the virtual method.\n      <modify-function signature=\"map(QAbstractVideoBuffer::MapMode, int*, int*)\">\n          <modify-argument index=\"0\">\n              <replace-type modified-type=\"PyObject\"/>\n          </modify-argument>\n          <modify-argument index=\"2\">\n              <remove-argument/>\n          </modify-argument>\n          <modify-argument index=\"3\">\n              <remove-argument/>\n          </modify-argument>\n          <inject-code class=\"target\" position=\"beginning\">\n              <insert-template name=\"fix_arg,int*,int*\"/>\n          </inject-code>\n      </modify-function>\n      -->\n  </object-type>\n  <object-type name=\"QAbstractVideoSurface\">\n      <enum-type name=\"Error\"/>\n  </object-type>\n  <object-type name=\"QVideoFrame\">\n      <enum-type name=\"FieldType\"/>\n      <enum-type name=\"PixelFormat\"/>\n  </object-type>\n\n  <value-type name=\"QAudioFormat\">\n      <enum-type name=\"Endian\"/>\n      <enum-type name=\"SampleType\"/>\n  </value-type>\n  <value-type name=\"QAudioDeviceInfo\"/>\n  <object-type name=\"QAbstractAudioDeviceInfo\"/>\n\n  <object-type name=\"QAbstractAudioOutput\">\n    <modify-function signature=\"start(QIODevice *)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QAbstractAudioInput\">\n    <modify-function signature=\"start(QIODevice *)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QAudioEnginePlugin\">\n    <modify-function signature=\"createInput(const QByteArray&amp;, const QAudioFormat&amp;)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"createOutput(const QByteArray&amp;, const QAudioFormat&amp;)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"createDeviceInfo(const QByteArray&amp;, QAudio::Mode)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QAudioEngineFactoryInterface\">\n    <modify-function signature=\"createInput(const QByteArray&amp;, const QAudioFormat&amp;)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"createOutput(const QByteArray&amp;, const QAudioFormat&amp;)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"createDeviceInfo(const QByteArray&amp;, QAudio::Mode)\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QAudioInput\">\n    <modify-function signature=\"start()\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"start(QIODevice*)\">\n      <modify-argument index=\"1\">\n        <define-ownership class=\"target\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QAudioOutput\">\n    <modify-function signature=\"start()\">\n      <modify-argument index=\"return\">\n        <define-ownership class=\"target\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"start(QIODevice*)\">\n      <modify-argument index=\"1\">\n        <define-ownership class=\"target\" owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n</typesystem>\n"
  },
  {
    "path": "PySide/QtNetwork/CMakeLists.txt",
    "content": "project(QtNetwork)\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} GREATER 6)\n    set (QtNetwork_47_SRC\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkconfiguration_wrapper.cpp\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkconfigurationmanager_wrapper.cpp\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworksession_wrapper.cpp\n    )\nelse()\n    set(QtNetwork_47_SRC )\nendif ()\n\nset(QtNetwork_OPTIONAL_SRC )\nset(QtNetwork_DROPPED_ENTRIES )\ncheck_qt_class(QtNetwork QSslCertificate    QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)\ncheck_qt_class(QtNetwork QSslCipher         QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)\ncheck_qt_class(QtNetwork QSslConfiguration  QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)\ncheck_qt_class(QtNetwork QSslError          QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)\ncheck_qt_class(QtNetwork QSslKey            QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)\ncheck_qt_class(QtNetwork QSslSocket         QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)\n\nset(QtNetwork_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qabstractnetworkcache_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qabstractsocket_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qauthenticator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qftp_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhostaddress_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhostinfo_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttp_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttpheader_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttprequestheader_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qhttpresponseheader_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qipv6address_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qlocalserver_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qlocalsocket_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkaccessmanager_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkaddressentry_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkcachemetadata_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkcookie_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkcookiejar_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkdiskcache_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkproxy_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkproxyfactory_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkproxyquery_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkreply_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkrequest_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qssl_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qtcpserver_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qtcpsocket_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qtnetwork_module_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qudpsocket_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qurlinfo_wrapper.cpp\n\n${QtNetwork_47_SRC}\n${QtNetwork_OPTIONAL_SRC}\n)\n\nset(QtNetwork_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}\")\nset(QtNetwork_include_dirs  ${CMAKE_CURRENT_SOURCE_DIR}\n                            ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/\n                            ${QT_INCLUDE_DIR}\n                            ${QT_QTNETWORK_INCLUDE_DIR}\n                            ${SHIBOKEN_INCLUDE_DIR}\n                            ${libpyside_SOURCE_DIR}\n                            ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                            ${QtCore_BINARY_DIR}/PySide/QtCore/)\nset(QtNetwork_libraries pyside\n                        ${SHIBOKEN_PYTHON_LIBRARIES}\n                        ${SHIBOKEN_LIBRARY}\n                        ${QT_QTNETWORK_LIBRARY})\n\nset(QtNetwork_deps QtCore)\n\ncreate_pyside_module(QtNetwork\n                     QtNetwork_include_dirs\n                     QtNetwork_libraries\n                     QtNetwork_deps\n                     QtNetwork_typesystem_path\n                     QtNetwork_SRC\n                     \"\"\n                     \"\"\n                     QtNetwork_DROPPED_ENTRIES)\n"
  },
  {
    "path": "PySide/QtNetwork/typesystem_network.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtNetwork\">\n  <load-typesystem name=\"typesystem_core.xml\" generate=\"no\"/>\n\n    <namespace-type name=\"QSsl\">\n        <enum-type name=\"AlternateNameEntryType\"/>\n        <enum-type name=\"EncodingFormat\"/>\n        <enum-type name=\"KeyAlgorithm\"/>\n        <enum-type name=\"KeyType\"/>\n        <enum-type name=\"SslProtocol\"/>\n        <extra-includes>\n            <include file-name=\"qssl.h\" location=\"global\"/>\n        </extra-includes>\n    </namespace-type>\n\n    <rejection class=\"QIPv6Address\" field-name=\"c\"/>\n\n    <object-type name=\"QAbstractSocket\">\n        <enum-type name=\"NetworkLayerProtocol\"/>\n        <enum-type name=\"SocketError\"/>\n        <enum-type name=\"SocketOption\" since=\"4.6\"/>\n        <enum-type name=\"SocketState\"/>\n        <enum-type name=\"SocketType\"/>\n        <modify-function signature=\"connectToHost(const QString&amp;, quint16, QFlags&lt;QIODevice::OpenModeFlag>)\" allow-thread=\"yes\" />\n        <modify-function signature=\"connectToHost(const QHostAddress&amp;, quint16, QFlags&lt;QIODevice::OpenModeFlag>)\" allow-thread=\"yes\" />\n        <modify-function signature=\"disconnectFromHost()\" allow-thread=\"yes\" />\n        <modify-function signature=\"waitForConnected(int)\" allow-thread=\"yes\" />\n        <modify-function signature=\"waitForDisconnected(int)\" allow-thread=\"yes\" />\n    </object-type>\n\n    <object-type name=\"QFtp\">\n        <enum-type name=\"Command\"/>\n        <enum-type name=\"Error\"/>\n        <enum-type name=\"State\"/>\n        <enum-type name=\"TransferMode\"/>\n        <enum-type name=\"TransferType\"/>\n        <modify-function signature=\"connectToHost(const QString&amp;, quint16)\" allow-thread=\"yes\" />\n        <modify-function signature=\"login(const QString&amp;, const QString&amp;)\" allow-thread=\"yes\" />\n        <modify-function signature=\"close()\" allow-thread=\"yes\" />\n        <modify-function signature=\"list(const QString&amp;)\" allow-thread=\"yes\" />\n        <modify-function signature=\"cd(const QString&amp;)\" allow-thread=\"yes\" />\n        <modify-function signature=\"get(const QString&amp;, QIODevice*, QFtp::TransferType)\" allow-thread=\"yes\" />\n        <modify-function signature=\"put(const QByteArray&amp;, const QString&amp;, QFtp::TransferType)\" allow-thread=\"yes\" />\n        <modify-function signature=\"put(QIODevice*, const QString&amp;, QFtp::TransferType)\" allow-thread=\"yes\" />\n        <modify-function signature=\"remove(const QString&amp;)\" allow-thread=\"yes\" />\n        <modify-function signature=\"mkdir(const QString&amp;)\" allow-thread=\"yes\" />\n        <modify-function signature=\"rmdir(const QString&amp;)\" allow-thread=\"yes\" />\n        <modify-function signature=\"rename(const QString&amp;, const QString&amp;)\" allow-thread=\"yes\" />\n        <modify-function signature=\"rawCommand(const QString&amp;)\" allow-thread=\"yes\" />\n        <modify-function signature=\"readAll()\" allow-thread=\"yes\" />\n        <modify-function signature=\"read(char*, qint64)\" allow-thread=\"yes\">\n          <modify-argument index=\"return\">\n            <replace-type modified-type=\"QByteArray\"/>\n          </modify-argument>\n          <modify-argument index=\"1\">\n            <remove-argument />\n          </modify-argument>\n          <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"read_wrapper\"/>\n          </inject-code>\n        </modify-function>\n    </object-type>\n\n    <object-type name=\"QHttp\">\n        <enum-type name=\"ConnectionMode\"/>\n        <enum-type name=\"Error\"/>\n        <enum-type name=\"State\"/>\n        <modify-function signature=\"readAll()\" allow-thread=\"yes\"/>\n        <modify-function signature=\"read(char*, qint64)\" allow-thread=\"yes\">\n          <modify-argument index=\"return\">\n            <replace-type modified-type=\"QByteArray\"/>\n          </modify-argument>\n          <modify-argument index=\"1\">\n            <remove-argument />\n          </modify-argument>\n          <inject-code class=\"target\" position=\"beginning\">\n            <insert-template name=\"read_wrapper\"/>\n          </inject-code>\n        </modify-function>\n        <!-- ### Obsolete methods -->\n        <modify-function signature=\"closeConnection()\" remove=\"all\"/>\n        <!-- ### -->\n    </object-type>\n    <object-type name=\"QTcpServer\">\n        <modify-function signature=\"waitForNewConnection(int,bool*)\" allow-thread=\"yes\">\n            <!-- FIXME removing default expression means user will always have to pass a value, but he wouldn't have to -->\n            <modify-argument index=\"1\">\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"2\">\n                <remove-default-expression/>\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, timeOut)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"fix_args,bool*\"/>\n            </inject-code>\n        </modify-function>\n    </object-type>\n    <object-type name=\"QTcpSocket\"/>\n    <object-type name=\"QUdpSocket\">\n        <enum-type name=\"BindFlag\" flags=\"BindMode\"/>\n        <modify-function signature=\"readDatagram(char*, qint64, QHostAddress*, quint16*)\" allow-thread=\"yes\">\n            <modify-argument index=\"1\">\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"3\">\n                <remove-default-expression/>\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-default-expression/>\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(data, address, port)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n            Shiboken::AutoArrayPointer&lt;char&gt; data(%ARGUMENT_NAMES);\n            QHostAddress ha;\n            quint16 port;\n            %BEGIN_ALLOW_THREADS\n            %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(data, %ARGUMENT_NAMES, &amp;ha, &amp;port);\n            %END_ALLOW_THREADS\n            QByteArray ba(data, retval);\n            %PYARG_0 = PyTuple_New(3);\n            PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[QByteArray](ba));\n            PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QHostAddress](ha));\n            PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[quint16](port));\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"writeDatagram(const QByteArray&amp;, const QHostAddress&amp;, quint16)\" allow-thread=\"yes\"/>\n        <!-- ### writeDatagram(QByteArray, ...) does the trick -->\n        <modify-function signature=\"writeDatagram(const char*,qint64,const QHostAddress&amp;,quint16)\" remove=\"all\"/>\n        <!-- ### -->\n    </object-type>\n\n    <object-type name=\"QHttpHeader\" />\n    <object-type name=\"QLocalServer\">\n        <modify-function signature=\"waitForNewConnection(int,bool*)\" allow-thread=\"yes\">\n            <!-- FIXME -->\n            <modify-argument index=\"1\">\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"2\">\n                <remove-default-expression/>\n                <remove-argument/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"fix_args,bool*\"/>\n            </inject-code>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, timeOut)\"/>\n            </modify-argument>\n\n        </modify-function>\n    </object-type>\n    <object-type name=\"QLocalSocket\">\n        <enum-type name=\"LocalSocketError\"/>\n        <enum-type name=\"LocalSocketState\"/>\n    </object-type>\n    <object-type name=\"QNetworkAccessManager\">\n        <enum-type name=\"NetworkAccessibility\" since=\"4.7\"/>\n        <enum-type name=\"Operation\"/>\n        <modify-function signature=\"createRequest(QNetworkAccessManager::Operation, const QNetworkRequest&amp;, QIODevice *)\">\n          <modify-argument index=\"3\" invalidate-after-use=\"yes\"/>\n          <modify-argument index=\"return\">\n            <define-ownership class=\"target\" owner=\"default\"/>\n          </modify-argument>\n        </modify-function>\n        <modify-function signature=\"get(const QNetworkRequest&amp;)\" allow-thread=\"yes\"/>\n        <modify-function signature=\"post(const QNetworkRequest &amp;, QIODevice *)\" allow-thread=\"yes\"/>\n        <modify-function signature=\"post(const QNetworkRequest &amp;, const QByteArray &amp;)\" allow-thread=\"yes\"/>\n        <modify-function signature=\"put(const QNetworkRequest &amp;, QIODevice *)\" allow-thread=\"yes\"/>\n        <modify-function signature=\"put(const QNetworkRequest &amp;, const QByteArray &amp;)\" allow-thread=\"yes\"/>\n        <modify-function signature=\"sendCustomRequest(const QNetworkRequest &amp;, const QByteArray &amp;, QIODevice *)\" allow-thread=\"yes\" since=\"4.7\" />\n        <modify-function signature=\"setCookieJar(QNetworkCookieJar*)\">\n            <modify-argument index=\"1\">\n                <define-ownership class=\"target\" owner=\"c++\"/>\n            </modify-argument>\n        </modify-function>\n    </object-type>\n    <object-type name=\"QNetworkCookieJar\"/>\n    <object-type name=\"QNetworkReply\">\n        <enum-type name=\"NetworkError\"/>\n    </object-type>\n\n    <value-type name=\"QHostAddress\" hash-function=\"qHash\">\n        <enum-type name=\"SpecialAddress\"/>\n        <!-- ### QHostAddress(QIPv6Address) does this -->\n        <modify-function signature=\"QHostAddress(quint8*)\" remove=\"all\" />\n        <!-- ### -->\n        <modify-function signature=\"setAddress(quint8*)\" remove=\"all\" />\n    </value-type>\n\n    <value-type name=\"QHostInfo\">\n        <enum-type name=\"HostInfoError\"/>\n        <modify-function signature=\"lookupHost(QString,QObject*,const char*)\" access=\"private\"/>\n    </value-type>\n\n    <value-type name=\"QHttpRequestHeader\" />\n\n    <value-type name=\"QHttpResponseHeader\" />\n\n    <value-type name=\"QNetworkAddressEntry\" />\n\n    <value-type name=\"QNetworkInterface\">\n        <enum-type name=\"InterfaceFlag\" flags=\"InterfaceFlags\"/>\n    </value-type>\n\n    <value-type name=\"QNetworkProxy\">\n        <enum-type name=\"Capability\" flags=\"Capabilities\" />\n        <enum-type name=\"ProxyType\"/>\n    </value-type>\n\n    <object-type name=\"QNetworkProxyFactory\" />\n    <value-type name=\"QNetworkProxyQuery\">\n        <enum-type name=\"QueryType\" />\n    </value-type>\n\n    <value-type name=\"QUrlInfo\">\n        <enum-type name=\"PermissionSpec\"/>\n    </value-type>\n\n    <value-type name=\"QIPv6Address\">\n        <add-function signature=\"__len__\">\n            <inject-code class=\"target\" position=\"beginning\">\n                return 16;\n            </inject-code>\n        </add-function>\n        <add-function signature=\"__getitem__\">\n            <inject-code class=\"target\" position=\"beginning\">\n            if (_i >= 16) {\n                PyErr_SetString(PyExc_IndexError, \"index out of bounds\");\n                return 0;\n            }\n            if (_i &lt; 0)\n                _i = 16 - qAbs(_i);\n\n            uint item = %CPPSELF.c[_i];\n            return %CONVERTTOPYTHON[uint](item);\n            </inject-code>\n        </add-function>\n        <add-function signature=\"__len__\">\n            <inject-code class=\"target\" position=\"beginning\">\n                return 16;\n            </inject-code>\n        </add-function>\n        <add-function signature=\"__setitem__\">\n            <inject-code class=\"target\" position=\"beginning\">\n            if (_i >= 16) {\n                PyErr_SetString(PyExc_IndexError, \"index out of bounds\");\n                return -1;\n            }\n            if (_i &lt; 0)\n                _i = 16 - qAbs(_i);\n            quint8 item = %CONVERTTOCPP[quint8](_value);\n            %CPPSELF.c[_i] = item;\n            return 0;\n            </inject-code>\n        </add-function>\n    </value-type>\n\n    <value-type name=\"QAuthenticator\" />\n    <value-type name=\"QNetworkCookie\">\n        <enum-type name=\"RawForm\"/>\n        <extra-includes>\n            <include file-name=\"QDateTime\" location=\"global\"/>\n        </extra-includes>\n    </value-type>\n    <value-type name=\"QNetworkRequest\">\n        <enum-type name=\"Attribute\" extensible=\"yes\"/>\n        <enum-type name=\"LoadControl\" since=\"4.7\"/>\n        <enum-type name=\"Priority\" since=\"4.7\"/>\n        <enum-type name=\"CacheLoadControl\"/>\n        <enum-type name=\"KnownHeaders\"/>\n    </value-type>\n\n    <!-- TODO QSslCertificate requires QMultiMap which isn't implemented yet\n    <value-type name=\"QSslCertificate\"/>\n    -->\n    <enum-type name=\"QSslCertificate::SubjectInfo\"/>\n\n    <!-- Qt 4.7 -->\n    <value-type name=\"QNetworkConfiguration\" since=\"4.7\">\n        <enum-type name=\"BearerType\" />\n        <enum-type name=\"Purpose\" since=\"4.7\"/>\n        <enum-type name=\"StateFlag\" flags=\"StateFlags\" since=\"4.7\"/>\n        <enum-type name=\"Type\" since=\"4.7\"/>\n    </value-type>\n    <object-type name=\"QNetworkConfigurationManager\" since=\"4.7\">\n        <enum-type name=\"Capability\" flags=\"Capabilities\" since=\"4.7\"/>\n    </object-type>\n    <object-type name=\"QNetworkSession\" since=\"4.7\">\n        <enum-type name=\"SessionError\" since=\"4.7\"/>\n        <enum-type name=\"State\" since=\"4.7\"/>\n    </object-type>\n\n    <object-type name=\"QAbstractNetworkCache\"/>\n    <object-type name=\"QNetworkDiskCache\"/>\n    <value-type name=\"QNetworkCacheMetaData\"/>\n\n    <suppress-warning text=\"Shadowing: QAbstractSocket::*\"/>\n\n\n    <!-- The following entries may be present in the system or not. Keep this section organized. -->\n    <value-type name=\"QSslCertificate\"/>\n    <value-type name=\"QSslCipher\"/>\n    <value-type name=\"QSslConfiguration\"/>\n    <value-type name=\"QSslError\">\n        <enum-type name=\"SslError\"/>\n    </value-type>\n\n    <value-type name=\"QSslKey\"/>\n    <object-type name=\"QSslSocket\">\n        <enum-type name=\"SslMode\"/>\n        <enum-type name=\"PeerVerifyMode\"/>\n        <modify-function signature=\"connectToHostEncrypted(const QString&amp;, quint16, QFlags&lt;QIODevice::OpenModeFlag>)\" allow-thread=\"yes\" />\n        <modify-function signature=\"waitForEncrypted(int)\" allow-thread=\"yes\" />\n    </object-type>\n    <!-- The above entries may be present in the system or not. Keep this section organized. -->\n</typesystem>\n\n"
  },
  {
    "path": "PySide/QtOpenGL/CMakeLists.txt",
    "content": "project(QtOpenGL)\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)\n  set(QtOpenGL_46_SRC )\nelse()\n  set(QtOpenGL_46_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglframebufferobjectformat_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglshaderprogram_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglshader_wrapper.cpp\n  )\nendif()\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 7)\n  set(QtOpenGL_47_SRC )\nelse()\n  set(QtOpenGL_47_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglbuffer_wrapper.cpp\n  )\nendif()\n\n\nset(QtOpenGL_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qgl_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglcolormap_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglcontext_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglformat_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglframebufferobject_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglpixelbuffer_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglwidget_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qtopengl_module_wrapper.cpp\n    ${QtOpenGL_46_SRC}\n    ${QtOpenGL_47_SRC}\n)\n\nset(QtOpenGL_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtOpenGL_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\nset(QtOpenGL_include_dirs   ${CMAKE_CURRENT_SOURCE_DIR}\n                            ${QT_QTCORE_INCLUDE_DIR}\n                            ${QT_QTGUI_INCLUDE_DIR}\n                            ${QT_QTOPENGL_INCLUDE_DIR}\n                            ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                            ${SHIBOKEN_INCLUDE_DIR}\n                            ${libpyside_SOURCE_DIR}\n                            ${QtGui_BINARY_DIR}/PySide/QtGui/\n                            ${QtCore_BINARY_DIR}/PySide/QtCore/\n                            ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL)\nset(QtOpenGL_libraries      pyside\n                            ${SHIBOKEN_PYTHON_LIBRARIES}\n                            ${QT_QTCORE_LIBRARY}\n                            ${QT_QTGUI_LIBRARY}\n                            ${QT_QTOPENGL_LIBRARY})\nset(QtOpenGL_deps QtGui)\ncreate_pyside_module(QtOpenGL\n                    QtOpenGL_include_dirs\n                    QtOpenGL_libraries\n                    QtOpenGL_deps\n                    QtOpenGL_typesystem_path\n                    QtOpenGL_SRC\n                    \"\")\n"
  },
  {
    "path": "PySide/QtOpenGL/typesystem_opengl.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtOpenGL\">\n  <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\" />\n\n  <primitive-type name=\"GLbitfield\"/>\n  <primitive-type name=\"GLboolean\"/>\n  <primitive-type name=\"GLbyte\"/>\n  <primitive-type name=\"GLclampd\"/>\n  <primitive-type name=\"GLclampf\"/>\n  <primitive-type name=\"GLdouble\"/>\n  <primitive-type name=\"GLenum\"/>\n  <primitive-type name=\"GLfloat\"/>\n  <primitive-type name=\"GLint\"/>\n  <primitive-type name=\"GLshort\"/>\n  <primitive-type name=\"GLsizei\"/>\n  <primitive-type name=\"GLubyte\"/>\n  <primitive-type name=\"GLuint\"/>\n  <primitive-type name=\"GLushort\"/>\n\n  <rejection class=\"QGLColormap::QGLColormapData\"/>\n  <rejection class=\"QGLContext\" field-name=\"currentCtx\"/>\n\n  <namespace-type name=\"QGL\">\n    <enum-type name=\"FormatOption\" flags=\"FormatOptions\" force-integer=\"yes\"/>\n    <extra-includes>\n        <include file-name=\"qgl.h\" location=\"global\"/>\n    </extra-includes>\n  </namespace-type>\n\n  <value-type name=\"QGLColormap\">\n    <modify-function signature=\"setEntries(int,const unsigned int*,int)\">\n        <access modifier=\"private\"/>\n    </modify-function>\n  </value-type>\n\n  <value-type name=\"QGLFormat\">\n    <enum-type name=\"OpenGLContextProfile\" since=\"4.7\"/>\n    <enum-type name=\"OpenGLVersionFlag\" flags=\"OpenGLVersionFlags\"/>\n  </value-type>\n\n  <rejection class=\"QGLContext\" field-name=\"currentCtx\" />\n  <object-type name=\"QGLContext\">\n    <enum-type name=\"BindOption\" flags=\"BindOptions\" since=\"4.6\"/>\n    <modify-function signature=\"chooseContext(const QGLContext*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n    <modify-function signature=\"create(const QGLContext*)\">\n        <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n    </modify-function>\n\n    <!-- ### Obsolete functions and ctors -->\n    <modify-function signature=\"generateFontDisplayLists(QFont, int)\" remove=\"all\"/>\n    <modify-function signature=\"QGLContext(const QGLFormat&amp;, QPaintDevice*)\" remove=\"all\" />\n    <!-- ### -->\n  </object-type>\n  <object-type name=\"QGLFramebufferObject\">\n    <enum-type name=\"Attachment\"/>\n  </object-type>\n  <object-type name=\"QGLPixelBuffer\">\n    <extra-includes>\n        <include file-name=\"QImage\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QGLWidget\">\n    <extra-includes>\n        <include file-name=\"QImage\" location=\"global\"/>\n        <include file-name=\"QPixmap\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"QGLWidget(QGLContext*, QWidget*, const QGLWidget*, QFlags&lt;Qt::WindowType&gt;)\">\n      <modify-argument index=\"1\">\n        <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n      <modify-argument index=\"this\">\n        <parent index=\"2\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <!-- ### Not part of Qt public API -->\n    <modify-function signature=\"setContext(QGLContext*,const QGLContext*,bool)\" remove=\"all\" />\n    <!-- ### -->\n    <!--- ### Obsolete functions -->\n    <modify-function signature=\"fontDisplayListBase(QFont, int)\" remove=\"all\"/>\n    <modify-function signature=\"setFormat(QGLFormat)\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n\n  <value-type name=\"QGLFramebufferObjectFormat\" since=\"4.6\"/>\n  <object-type name=\"QGLShader\" since=\"4.6\">\n    <enum-type name=\"ShaderTypeBit\" flags=\"ShaderType\"/>\n  </object-type>\n\n  <template name=\"callArrayFunction\">\n      int _size = PySequence_Size(%PYARG_2);\n      if (_size) {\n          $ATTR_TYPE *_list = new $ATTR_TYPE[_size];\n          if (_size) {\n            Shiboken::AutoDecRef fast(PySequence_Fast(%PYARG_2, \"Failed to parse sequence with type %VECTOR_TYPE.\"));\n            for(int i=0; i &lt; _size; i++) {\n                PyObject* pv = PySequence_Fast_GET_ITEM(fast.object(), i);\n                _list[i] = %CONVERTTOCPP[$ATTR_TYPE](pv);\n            }\n          }\n          %CPPSELF.%FUNCTION_NAME(%1, _list, $ARG0);\n          delete[] _list;\n       } else {\n          %CPPSELF.%FUNCTION_NAME(%1, ($ATTR_TYPE*)NULL, $ARG1);\n       }\n  </template>\n\n  <object-type name=\"QGLShaderProgram\" since=\"4.6\">\n    <!-- setAttributeArray -->\n    <modify-function signature=\"setAttributeArray(int, const QVector2D*, int)\" rename=\"setAttributeArray2D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"%3\" />\n                <replace from=\"$ARG1\" to=\"%3\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector2D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setAttributeArray(int, const QVector3D*, int)\" rename=\"setAttributeArray3D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"%3\" />\n                <replace from=\"$ARG1\" to=\"%3\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector3D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setAttributeArray(int, const QVector4D*, int)\" rename=\"setAttributeArray4D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"%3\" />\n                <replace from=\"$ARG1\" to=\"%3\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector4D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setAttributeArray(const char*, const QVector2D*, int)\" rename=\"setAttributeArray2D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"%3\" />\n                <replace from=\"$ARG1\" to=\"%3\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector2D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setAttributeArray(const char*, const QVector3D*, int)\" rename=\"setAttributeArray3D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"%3\" />\n                <replace from=\"$ARG1\" to=\"%3\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector3D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setAttributeArray(const char*, const QVector4D*, int)\" rename=\"setAttributeArray4D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"%3\" />\n                <replace from=\"$ARG1\" to=\"%3\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector4D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <!-- setUniformValueArray -->\n    <modify-function signature=\"setUniformValueArray(int, const GLint*, int)\" rename=\"setUniformValueArrayInt\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"GLint\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const GLuint*, int)\" rename=\"setUniformValueArrayUint\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"GLuint\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QVector2D*, int)\" rename=\"setUniformValueArray2D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector2D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QVector3D*, int)\" rename=\"setUniformValueArray3D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector3D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QVector4D*, int)\" rename=\"setUniformValueArray4D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector4D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix2x2*, int)\" rename=\"setUniformValueArray2x2\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix2x2\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix2x3*, int)\" rename=\"setUniformValueArray2x3\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix2x3\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix2x4*, int)\" rename=\"setUniformValueArray2x4\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix2x4\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix3x2*, int)\" rename=\"setUniformValueArray3x2\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix3x2\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix3x3*, int)\" rename=\"setUniformValueArray3x3\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix3x3\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix3x4*, int)\" rename=\"setUniformValueArray3x4\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix3x4\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix4x2*, int)\" rename=\"setUniformValueArray4x2\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix4x2\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix4x3*, int)\" rename=\"setUniformValueArray4x3\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix4x3\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(int, const QMatrix4x4*, int)\" rename=\"setUniformValueArray4x4\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix4x4\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const GLint*, int)\" rename=\"setUniformValueArrayInt\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"GLint\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const GLuint*, int)\" rename=\"setUniformValueArrayUint\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"GLuint\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QVector2D*, int)\" rename=\"setUniformValueArray2D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector2D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QVector3D*, int)\" rename=\"setUniformValueArray3D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector3D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QVector4D*, int)\" rename=\"setUniformValueArray4D\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QVector4D\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix2x2*, int)\" rename=\"setUniformValueArray2x2\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix2x2\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix2x3*, int)\" rename=\"setUniformValueArray2x3\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix2x3\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix2x4*, int)\" rename=\"setUniformValueArray2x4\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix2x4\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix3x2*, int)\" rename=\"setUniformValueArray3x2\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix3x2\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix3x3*, int)\" rename=\"setUniformValueArray3x3\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix3x3\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix3x4*, int)\" rename=\"setUniformValueArray3x4\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix3x4\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix4x2*, int)\" rename=\"setUniformValueArray4x2\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix4x2\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix4x3*, int)\" rename=\"setUniformValueArray4x3\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix4x3\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <modify-function signature=\"setUniformValueArray(const char*, const QMatrix4x4*, int)\" rename=\"setUniformValueArray4x4\">\n        <modify-argument index=\"2\" >\n            <replace-type modified-type=\"PySequence\" />\n        </modify-argument>\n        <modify-argument index=\"3\">\n             <remove-argument />\n        </modify-argument>\n        <inject-code>\n            <insert-template name=\"callArrayFunction\">\n                <replace from=\"$ARG0\" to=\"_size\" />\n                <replace from=\"$ARG1\" to=\"0\" />\n                <replace from=\"$ATTR_TYPE\" to=\"QMatrix4x4\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n\n    <!-- ### TODO: must evaluate if anything other than removal should be done. -->\n    <modify-function signature=\"setAttributeArray(int,const GLfloat*,int,int)\" remove=\"all\" />\n    <modify-function signature=\"setAttributeArray(const char*,const GLfloat*,int,int)\" remove=\"all\" />\n    <modify-function signature=\"setUniformValueArray(int,const GLfloat*,int,int)\" remove=\"all\" />\n    <modify-function signature=\"setUniformValueArray(const char*,const GLfloat*,int,int)\" remove=\"all\" />\n    <!-- ### -->\n\n    <!-- ### Use QMatrixZxY overloads -->\n    <modify-function signature=\"setUniformValue(int,Array)\" remove=\"all\" />\n    <modify-function signature=\"setUniformValue(const char*,Array)\" remove=\"all\" />\n    <modify-function signature=\"setAttributeValue(int,const GLfloat*,int,int)\" remove=\"all\" />\n    <modify-function signature=\"setAttributeValue(const char*,const GLfloat*,int,int)\" remove=\"all\" />\n    <modify-function signature=\"setAttributeArray(int, GLenum, const void*, int, int)\" remove=\"all\" since=\"4.7\" />\n    <modify-function signature=\"setAttributeArray(const char*, GLenum, const void*, int, int)\" remove=\"all\" since=\"4.7\" />\n    <!-- ### -->\n  </object-type>\n\n  <!-- Qt 4.7 -->\n  <object-type name=\"QGLBuffer\" since=\"4.7\">\n    <enum-type name=\"Access\" since=\"4.7\"/>\n    <enum-type name=\"Type\" since=\"4.7\"/>\n    <enum-type name=\"UsagePattern\" since=\"4.7\"/>\n    <modify-function signature=\"allocate(const void*, int)\">\n      <modify-argument index=\"1\">\n        <replace-type modified-type=\"QByteArray&amp;\"/>\n      </modify-argument>\n      <modify-argument index=\"2\">\n        <replace-default-expression with=\"-1\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        int size = (%2 &lt; 0) ? %1.size() : %2;\n        %CPPSELF.allocate((const void*) %1.data(), size);\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"map(QGLBuffer::Access)\">\n      <inject-code>\n        Py_ssize_t dataSize = %CPPSELF.size();\n        void* data = %CPPSELF.map(%1);\n\n        if (!data) {\n            Py_INCREF(Py_None);\n            %PYARG_0 = Py_None;\n        } else if (%1 == QGLBuffer::ReadOnly) {\n            %PYARG_0 = Shiboken::Buffer::newObject(data, dataSize, Shiboken::Buffer::ReadOnly);\n        } else {\n            %PYARG_0 = Shiboken::Buffer::newObject(data, dataSize, Shiboken::Buffer::ReadWrite);\n        }\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"read(int, void*, int)\">\n      <modify-argument index=\"2\">\n        <remove-argument/>\n      </modify-argument>\n      <modify-argument index=\"return\">\n        <replace-type modified-type=\"(retval, data)\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        char *data = new char[%3];\n        bool result = %CPPSELF.read(%1, data, %3);\n        QByteArray ret;\n        if (result)\n            ret.append((const char*)data, %3);\n        %PYARG_0 = PyTuple_New(2);\n        PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[bool](result));\n        PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QByteArray](ret));\n        delete[] data;\n      </inject-code>\n    </modify-function>\n    <modify-function signature=\"write(int, const void*, int)\">\n      <modify-argument index=\"2\">\n        <replace-type modified-type=\"QByteArray&amp;\"/>\n      </modify-argument>\n      <modify-argument index=\"3\">\n        <replace-default-expression with=\"-1\"/>\n      </modify-argument>\n      <inject-code class=\"target\" position=\"beginning\">\n        int size = (%3 &lt; 0) ? %2.size() : %3;\n        %CPPSELF.write(%1, (const void*) %2.data(), size);\n      </inject-code>\n    </modify-function>\n  </object-type>\n\n</typesystem>\n"
  },
  {
    "path": "PySide/QtScript/CMakeLists.txt",
    "content": "project(QtScript)\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 7)\n    set (QtScript_47_SRC )\nelse()\n    set(QtScript_47_SRC\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptprogram_wrapper.cpp\n    )\nendif()\n\nset(QtScript_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptable_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptclass_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptclasspropertyiterator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptcontext_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptcontextinfo_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptengineagent_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qtscript_module_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptengine_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptextensioninterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptextensionplugin_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptstring_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptvalue_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript/qscriptvalueiterator_wrapper.cpp\n${QtScript_47_SRC}\n)\n\nset(QtScript_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}\")\nset(QtScript_include_dirs   ${CMAKE_CURRENT_SOURCE_DIR}\n                            ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScript\n                            ${QT_INCLUDE_DIR}\n                            ${QT_QTSCRIPT_INCLUDE_DIR}\n                            ${SHIBOKEN_INCLUDE_DIR}\n                            ${libpyside_SOURCE_DIR}\n                            ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                            ${QtCore_BINARY_DIR}/PySide/QtCore )\nset(QtScript_libraries      pyside\n                            ${SHIBOKEN_PYTHON_LIBRARIES}\n                            ${SHIBOKEN_LIBRARY}\n                            ${QT_QTCORE_LIBRARY}\n                            ${QT_QTSCRIPT_LIBRARY})\nset(QtScript_deps QtCore)\ncreate_pyside_module(QtScript\n                     QtScript_include_dirs\n                     QtScript_libraries\n                     QtScript_deps\n                     QtScript_typesystem_path\n                     QtScript_SRC\n                     \"\")\n"
  },
  {
    "path": "PySide/QtScript/typesystem_script.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtScript\">\n    <load-typesystem name=\"typesystem_core.xml\" generate=\"no\" />\n\n    <object-type name=\"QScriptable\"/>\n    <object-type name=\"QScriptClass\">\n        <enum-type name=\"Extension\"/>\n        <enum-type name=\"QueryFlag\"/>\n    </object-type>\n    <object-type name=\"QScriptClassPropertyIterator\"/>\n    <object-type name=\"QScriptContext\">\n        <enum-type name=\"Error\"/>\n        <enum-type name=\"ExecutionState\"/>\n    </object-type>\n    <value-type name=\"QScriptContextInfo\">\n        <enum-type name=\"FunctionType\"/>\n    </value-type>\n    <object-type name=\"QScriptEngineAgent\">\n        <enum-type name=\"Extension\"/>\n    </object-type>\n    <object-type name=\"QScriptEngine\">\n        <enum-type name=\"QObjectWrapOption\" flags=\"QObjectWrapOptions\"/>\n        <enum-type name=\"ValueOwnership\"/>\n        <!-- Not supported BUG #957-->\n        <modify-function signature=\"scriptValueFromQMetaObject()\" remove=\"all\" />\n    </object-type>\n    <object-type name=\"QScriptExtensionInterface\"/>\n    <object-type name=\"QScriptExtensionPlugin\"/>\n    <value-type name=\"QScriptProgram\" since=\"4.7\"/>\n    <value-type name=\"QScriptString\">\n        <modify-function signature=\"toArrayIndex(bool*)const\">\n            <modify-argument index=\"1\">\n                <remove-argument/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"fix_bool*\"/>\n            </inject-code>\n        </modify-function>\n    </value-type>\n    <value-type name=\"QScriptValue\">\n        <enum-type name=\"PropertyFlag\" flags=\"PropertyFlags\"/>\n        <enum-type name=\"ResolveFlag\" flags=\"ResolveFlags\"/>\n        <enum-type name=\"SpecialValue\"/>\n        <add-function signature=\"__repr__\" return-type=\"PyObject*\">\n            <inject-code class=\"target\" position=\"beginning\">\n                if (%CPPSELF.isVariant() || %CPPSELF.isString()) {\n                    QString format = QString().sprintf(\"%s(\\\"%s\\\")\", ((PyObject*)%PYSELF)->ob_type->tp_name, qPrintable(%CPPSELF.toString()));\n                    %PYARG_0 = Shiboken::String::fromCString(qPrintable(format));\n                 } else {\n                    %PYARG_0 = Shiboken::String::fromCString(\n                                    ((PyObject* )%PYSELF)->ob_type->tp_name);\n                }\n            </inject-code>\n        </add-function>\n        <add-function signature=\"__mgetitem__\">\n            <inject-code>\n                Shiboken::AutoDecRef key(PyObject_Str(_key));\n                QVariant res = %CPPSELF.property(Shiboken::String::toCString(key.object())).toVariant();\n                if (res.isValid()) {\n                    return %CONVERTTOPYTHON[QVariant](res);\n                } else {\n                    PyObject* errorType = PyInt_Check(_key) ? PyExc_IndexError : PyExc_KeyError;\n                    PyErr_SetString(errorType, \"Key not found.\");\n                    return 0;\n                }\n            </inject-code>\n        </add-function>\n        <add-function signature=\"__iter__()\" return-type=\"PyObject*\">\n            <inject-code>\n                %PYARG_0 = Shiboken::createWrapper(new QScriptValueIterator(*%CPPSELF), true, true);\n            </inject-code>\n        </add-function>\n    </value-type>\n    <object-type name=\"QScriptValueIterator\">\n        <add-function signature=\"__iter__()\" return-type=\"PyObject*\">\n            <inject-code>\n                <insert-template name=\"__iter__\" />\n            </inject-code>\n        </add-function>\n        <add-function signature=\"__next__()\" return-type=\"PyObject*\">\n            <inject-code>\n            if (%CPPSELF.hasNext()) {\n                %CPPSELF.next();\n                QString name = %CPPSELF.name();\n                QVariant value = %CPPSELF.value().toVariant();\n                %PYARG_0 = PyTuple_New(2);\n                PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[QString](name));\n                PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QVariant](value));\n            } else {\n                PyErr_SetNone(PyExc_StopIteration);\n            }\n            </inject-code>\n        </add-function>\n    </object-type>\n</typesystem>\n\n"
  },
  {
    "path": "PySide/QtScriptTools/CMakeLists.txt",
    "content": "project(QtScriptTools)\n\nset(QtScriptTools_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools/qtscripttools_module_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools/qscriptenginedebugger_wrapper.cpp\n)\n\nset(QtScriptTools_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtScript_SOURCE_DIR}${PATH_SEP}${QtScriptTools_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\n\nset(QtScriptTools_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}\n                                ${QT_QTCORE_INCLUDE_DIR}\n                                ${QT_GUI_INCLUDE_DIR}\n                                ${QT_QTSCRIPT_INCLUDE_DIR}\n                                ${QT_QTSCRIPTTOOLS_INCLUDE_DIR}\n                                ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                                ${SHIBOKEN_INCLUDE_DIR}\n                                ${libpyside_SOURCE_DIR}\n                                ${QtCore_BINARY_DIR}/PySide/QtCore/\n                                ${QtGui_BINARY_DIR}/PySide/QtGui/\n                                ${QtScript_BINARY_DIR}/PySide/QtScript/\n                                ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtScriptTools)\n\nset(QtScriptTools_libraries     pyside\n                                ${SHIBOKEN_PYTHON_LIBRARIES}\n                                ${QT_QTCORE_LIBRARY}\n                                ${QT_GUI_LIBRARY}\n                                ${QT_QTSCRIPT_LIBRARY}\n                                ${QT_QTSCRIPTTOOLS_LIBRARY})\nset(QtScriptTools_deps QtCore QtScript QtGui)\n\ncreate_pyside_module(QtScriptTools\n                     QtScriptTools_include_dirs\n                     QtScriptTools_libraries\n                     QtScriptTools_deps\n                     QtScriptTools_typesystem_path\n                     QtScriptTools_SRC\n                     \"\")\n"
  },
  {
    "path": "PySide/QtScriptTools/typesystem_scripttools.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtScriptTools\">\n    <load-typesystem name=\"typesystem_script.xml\" generate=\"no\" />\n    <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\" />\n\n    <object-type name=\"QScriptEngineDebugger\">\n        <enum-type name=\"DebuggerAction\"/>\n        <enum-type name=\"DebuggerState\" since=\"4.6\"/>\n        <enum-type name=\"DebuggerWidget\"/>\n        <extra-includes>\n            <include file-name=\"QScriptEngine\" location=\"global\"/>\n        </extra-includes>\n    </object-type>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtSql/CMakeLists.txt",
    "content": "project(QtSql)\n\nset(QtSql_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlindex_wrapper.cpp\n\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqldatabase_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqldrivercreatorbase_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqldriver_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlerror_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlfield_wrapper.cpp\n\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlquerymodel_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlquery_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlrecord_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlrelationaldelegate_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlrelationaltablemodel_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlrelation_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqlresult_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsqltablemodel_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qsql_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/qtsql_module_wrapper.cpp\n)\n\nset(QtSql_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtSql_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\nset(QtSql_include_dirs  ${CMAKE_CURRENT_SOURCE_DIR}\n                        ${QT_QTCORE_INCLUDE_DIR}\n                        ${QT_QTGUI_INCLUDE_DIR}\n                        ${QT_QTSQL_INCLUDE_DIR}\n                        ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                        ${SHIBOKEN_INCLUDE_DIR}\n                        ${libpyside_SOURCE_DIR}\n                        ${QtCore_BINARY_DIR}/PySide/QtCore/\n                        ${QtGui_BINARY_DIR}/PySide/QtGui/\n                        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSql/)\nset(QtSql_libraries     pyside\n                        ${SHIBOKEN_PYTHON_LIBRARIES}\n                        ${QT_QTCORE_LIBRARY}\n                        ${QT_QTGUI_LIBRARY}\n                        ${QT_QTSQL_LIBRARY})\nset(QtSql_deps QtGui)\ncreate_pyside_module(QtSql\n                     QtSql_include_dirs\n                     QtSql_libraries\n                     QtSql_deps\n                     QtSql_typesystem_path\n                     QtSql_SRC\n                     \"\")\n"
  },
  {
    "path": "PySide/QtSql/typesystem_sql.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtSql\">\n  <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\"/>\n\n  <rejection class=\"QSqlDriverCreator\"/>\n  <rejection class=\"QSqlDriverPlugin\"/>\n  <rejection class=\"QSqlDriverFactoryInterface\"/>\n\n  <namespace-type name=\"QSql\">\n    <enum-type name=\"Location\"/>\n    <enum-type name=\"ParamTypeFlag\" flags=\"ParamType\"/>\n    <enum-type name=\"TableType\"/>\n    <enum-type name=\"NumericalPrecisionPolicy\"/>\n    <extra-includes>\n        <include file-name=\"QtSql/qsql.h\" location=\"global\"/>\n    </extra-includes>\n  </namespace-type>\n\n  <value-type name=\"QSqlDatabase\">\n    <extra-includes>\n        <include file-name=\"QSqlQuery\" location=\"global\"/>\n        <include file-name=\"QSqlError\" location=\"global\"/>\n        <include file-name=\"QSqlIndex\" location=\"global\"/>\n        <include file-name=\"QSqlRecord\" location=\"global\"/>\n        <include file-name=\"QStringList\" location=\"global\"/>\n        <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"exec(QString)const\" rename=\"exec_\" allow-thread=\"yes\" />\n    <modify-function signature=\"open()\" allow-thread=\"yes\" />\n    <modify-function signature=\"open(const QString&amp;, const QString&amp;)\" allow-thread=\"yes\" />\n    <modify-function signature=\"commit()\" allow-thread=\"yes\" />\n    <modify-function signature=\"rollback()\" allow-thread=\"yes\" />\n    <modify-function signature=\"transaction()\" allow-thread=\"yes\" />\n    <modify-function signature=\"registerSqlDriver(const QString &amp;, QSqlDriverCreatorBase*)\">\n      <modify-argument index=\"2\">\n        <define-ownership owner=\"c++\"/>\n      </modify-argument>\n    </modify-function>\n  </value-type>\n\n  <value-type name=\"QSqlQuery\">\n    <enum-type name=\"BatchExecutionMode\"/>\n    <extra-includes>\n        <include file-name=\"QSqlError\" location=\"global\"/>\n        <include file-name=\"QSqlRecord\" location=\"global\"/>\n        <include file-name=\"QStringList\" location=\"global\"/>\n        <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\" />\n    <modify-function signature=\"exec(const QString &amp;)\" rename=\"exec_\" allow-thread=\"yes\" />\n    <modify-function signature=\"prepare(const QString&amp;)\" allow-thread=\"yes\" />\n    <modify-function signature=\"clear()\" allow-thread=\"yes\" />\n    <modify-function signature=\"last()\" allow-thread=\"yes\" />\n    <modify-function signature=\"first()\" allow-thread=\"yes\" />\n    <modify-function signature=\"previous()\" allow-thread=\"yes\" />\n    <modify-function signature=\"next()\" allow-thread=\"yes\" />\n    <modify-function signature=\"seek(int,bool)\" allow-thread=\"yes\" />\n  </value-type>\n\n  <value-type name=\"QSqlRecord\">\n    <extra-includes>\n        <include file-name=\"QSqlField\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"append(QSqlField)\" access=\"non-final\"/>\n  </value-type>\n\n  <value-type name=\"QSqlError\">\n    <enum-type name=\"ErrorType\"/>\n  </value-type>\n\n  <value-type name=\"QSqlIndex\" />\n\n  <value-type name=\"QSqlRelation\"/>\n\n  <object-type name=\"QSqlRelationalDelegate\"/>\n\n  <value-type name=\"QSqlField\">\n      <enum-type name=\"RequiredStatus\"/>\n  </value-type>\n\n  <object-type name=\"QSqlDriver\">\n    <enum-type name=\"DriverFeature\"/>\n    <enum-type name=\"IdentifierType\"/>\n    <enum-type name=\"StatementType\"/>\n    <extra-includes>\n        <include file-name=\"QSqlQuery\" location=\"global\"/>\n        <include file-name=\"QSqlError\" location=\"global\"/>\n        <include file-name=\"QSqlIndex\" location=\"global\"/>\n        <include file-name=\"QSqlRecord\" location=\"global\"/>\n        <include file-name=\"QStringList\" location=\"global\"/>\n        <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n    <modify-function signature=\"beginTransaction()\" allow-thread=\"yes\" />\n    <modify-function signature=\"commitTransaction()\" allow-thread=\"yes\" />\n    <modify-function signature=\"rollbackTransaction()\" allow-thread=\"yes\" />\n    <modify-function signature=\"open(const QString &amp;, const QString&amp;, const QString&amp;, const QString&amp;, int, const QString&amp;)\" allow-thread=\"yes\" />\n    <!-- ### This is too low level for Python, and pointer would be useless for the Python programmer -->\n    <modify-function signature=\"handle() const\" remove=\"all\"/>\n    <!-- ### -->\n  </object-type>\n\n  <object-type name=\"QSqlQueryModel\">\n    <modify-function signature=\"indexInQuery(QModelIndex)const\" access=\"non-final\"/>\n    <modify-function signature=\"setQuery(QSqlQuery)\" access=\"non-final\"/>\n    <extra-includes>\n        <include file-name=\"QSqlError\" location=\"global\"/>\n        <include file-name=\"QSqlQuery\" location=\"global\"/>\n        <include file-name=\"QSqlRecord\" location=\"global\"/>\n        <include file-name=\"QStringList\" location=\"global\"/>\n        <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QSqlRelationalTableModel\">\n    <extra-includes>\n        <include file-name=\"QStringList\" location=\"global\"/>\n        <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QSqlResult\">\n      <enum-type name=\"BindingSyntax\"/>\n      <enum-type name=\"VirtualHookOperation\"/>\n      <extra-includes>\n        <include file-name=\"QSqlError\" location=\"global\"/>\n        <include file-name=\"QSqlQuery\" location=\"global\"/>\n        <include file-name=\"QSqlRecord\" location=\"global\"/>\n        <include file-name=\"QStringList\" location=\"global\"/>\n        <include file-name=\"QSize\" location=\"global\"/>\n      </extra-includes>\n      <!-- ### This isn't part of Qt public API -->\n      <modify-function signature=\"virtual_hook(int,void*)\" remove=\"all\" />\n      <!-- ### -->\n      <modify-function signature=\"exec()\" rename=\"exec_\" allow-thread=\"yes\" />\n      <modify-function signature=\"fetchLast()\" allow-thread=\"yes\" />\n      <modify-function signature=\"fetchFirst()\" allow-thread=\"yes\" />\n      <modify-function signature=\"fetchNext()\" allow-thread=\"yes\" />\n      <modify-function signature=\"fetchPrevious()\" allow-thread=\"yes\" />\n      <modify-function signature=\"fetch(int)\" allow-thread=\"yes\" />\n      <modify-function signature=\"prepare(QString)\" allow-thread=\"yes\" />\n  </object-type>\n  <object-type name=\"QSqlTableModel\">\n    <enum-type name=\"EditStrategy\"/>\n    <extra-includes>\n        <include file-name=\"QSqlIndex\" location=\"global\"/>\n        <include file-name=\"QStringList\" location=\"global\"/>\n        <include file-name=\"QSize\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n  <object-type name=\"QSqlDriverCreatorBase\">\n    <extra-includes>\n        <include file-name=\"QSqlDriver\" location=\"global\"/>\n    </extra-includes>\n  </object-type>\n\n</typesystem>\n"
  },
  {
    "path": "PySide/QtSvg/CMakeLists.txt",
    "content": "project(QtSvg)\n\nset(QtSvg_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qgraphicssvgitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvggenerator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgrenderer_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qsvgwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/qtsvg_module_wrapper.cpp\n)\n\nset(QtSvg_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\nset(QtSvg_include_dirs  ${CMAKE_CURRENT_SOURCE_DIR}\n                        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtSvg/\n                        ${QT_INCLUDE_DIR}\n                        ${QT_QTCORE_INCLUDE_DIR}\n                        ${QT_QTGUI_INCLUDE_DIR}\n                        ${QT_QTSVG_INCLUDE_DIR}\n                        ${SHIBOKEN_INCLUDE_DIR}\n                        ${libpyside_SOURCE_DIR}\n                        ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                        ${QtCore_BINARY_DIR}/PySide/QtCore/\n                        ${QtGui_BINARY_DIR}/PySide/QtGui/)\nset(QtSvg_libraries     pyside\n                        ${SHIBOKEN_PYTHON_LIBRARIES}\n                        ${SHIBOKEN_LIBRARY}\n                        ${QT_QTSVG_LIBRARY}\n                        ${QT_QTGUI_LIBRARY})\nset(QtSvg_deps QtGui)\ncreate_pyside_module(QtSvg\n                     QtSvg_include_dirs\n                     QtSvg_libraries\n                     QtSvg_deps\n                     QtSvg_typesystem_path\n                     QtSvg_SRC\n                     \"\")\n"
  },
  {
    "path": "PySide/QtSvg/typesystem_svg.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtSvg\">\n  <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\"/>\n\n  <object-type name=\"QSvgRenderer\" />\n  <object-type name=\"QSvgWidget\" />\n\n  <object-type name=\"QSvgGenerator\">\n    <modify-function signature=\"setOutputDevice(QIODevice*)\">\n      <modify-argument index=\"1\">\n          <reference-count action=\"set\"/>\n      </modify-argument>\n    </modify-function>\n\n    <modify-function signature=\"outputDevice() const\">\n      <modify-argument index=\"return\">\n          <define-ownership class=\"target\" owner=\"default\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QGraphicsSvgItem\">\n    <modify-function signature=\"QGraphicsSvgItem(QGraphicsItem*)\">\n      <modify-argument index=\"this\">\n          <parent index=\"1\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"QGraphicsSvgItem(const QString&amp;, QGraphicsItem*)\">\n      <modify-argument index=\"this\">\n          <parent index=\"2\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n  </object-type>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtTest/CMakeLists.txt",
    "content": "project(QtTest)\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)\n    set(QtTest_46_SRC \"\")\nelse()\n    set(QtTest_46_SRC\n        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_pysideqtoucheventsequence_wrapper.cpp\n        )\nendif()\n\nset(QtTest_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp\n${QtTest_46_SRC}\n)\n\nset(QtTest_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\nset(QtTest_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}\n                        ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/\n                        ${QT_INCLUDE_DIR}\n                        ${QT_QTCORE_INCLUDE_DIR}\n                        ${QT_QTGUI_INCLUDE_DIR}\n                        ${QT_QTTEST_INCLUDE_DIR}\n                        ${SHIBOKEN_INCLUDE_DIR}\n                        ${libpyside_SOURCE_DIR}\n                        ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                        ${QtCore_BINARY_DIR}/PySide/QtCore/\n                        ${QtGui_BINARY_DIR}/PySide/QtGui/)\nset(QtTest_libraries    pyside\n                        ${SHIBOKEN_PYTHON_LIBRARIES}\n                        ${SHIBOKEN_LIBRARY}\n                        ${QT_QTTEST_LIBRARY}\n                        ${QT_QTGUI_LIBRARY}\n                        ${QT_QTCORE_LIBRARY})\nset(QtTest_deps  QtGui)\ncreate_pyside_module(QtTest\n                     QtTest_include_dirs\n                     QtTest_libraries\n                     QtTest_deps\n                     QtTest_typesystem_path\n                     QtTest_SRC\n                     \"\")\n"
  },
  {
    "path": "PySide/QtTest/typesystem_test.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtTest\">\n  <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\"/>\n\n  <rejection class=\"QTest\" function-name=\"qCompare&lt;char&gt;\"/>\n  <rejection class=\"QTest\" function-name=\"qCompare&lt;char*&gt;\"/>\n  <rejection class=\"QTest\" function-name=\"qCompare&lt;double&gt;\"/>\n  <rejection class=\"QTest\" function-name=\"qCompare&lt;float&gt;\"/>\n  <rejection class=\"QTest\" function-name=\"qCompare&lt;double,qreal&gt;\"/>\n  <rejection class=\"QTest\" function-name=\"qCompare&lt;qreal,double&gt;\"/>\n  <rejection class=\"QTest\" function-name=\"qCompare\"/>\n  <rejection class=\"QTest\" function-name=\"qVerify\"/>\n  <rejection class=\"QTest\" function-name=\"qSleep\"/>\n  <rejection class=\"QTest\" function-name=\"toHexRepresentation\"/>\n  <rejection class=\"QTest\" function-name=\"qWait\"/>\n  <rejection class=\"QTest\" function-name=\"qFail\"/>\n  <rejection class=\"QTest\" function-name=\"qExec\"/>\n  <rejection class=\"QTest\" function-name=\"qData\"/>\n  <rejection class=\"QTest\" function-name=\"qWarn\"/>\n  <rejection class=\"QTest\" function-name=\"toString\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;bool>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;char>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;double>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;float>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;int>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;long>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;qint64>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;quint64>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;short>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;uint>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;ulong>\"/>\n  <rejection class=\"QTest\" function-name=\"toString&lt;ushort>\"/>\n  <rejection class=\"QTest\" function-name=\"qt_snprintf\"/>\n\n  <rejection class=\"QTest\" function-name=\"compare_helper\"/>\n  <rejection class=\"QTest\" function-name=\"touchEvent\"/>\n\n  <namespace-type name=\"QTest\">\n    <enum-type name=\"AttributeIndex\" since=\"4.6\"/>\n    <enum-type name=\"KeyAction\"/>\n    <enum-type name=\"LogElementType\" since=\"4.6\"/>\n    <enum-type name=\"MouseAction\"/>\n    <enum-type name=\"QBenchmarkMetric\" since=\"4.7\"/>\n    <enum-type name=\"SkipMode\"/>\n    <enum-type name=\"TestFailMode\"/>\n    <extra-includes>\n        <include file-name=\"QtTest\" location=\"global\"/>\n    </extra-includes>\n    <!--<modify-function signature=\"qCompare<char>(char\">-->\n    <rejection class=\"QTouchEventSequence\"/>\n    <object-type name=\"PySideQTouchEventSequence\" target-lang-name=\"QTouchEventSequence\" since=\"4.6\" >\n        <modify-function signature=\"press(int, const QPoint&amp;, QWidget*)\">\n            <modify-argument index=\"return\">\n                <define-ownership class=\"target\" owner=\"default\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"move(int, const QPoint&amp;, QWidget*)\">\n            <modify-argument index=\"return\">\n                <define-ownership class=\"target\" owner=\"default\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"release(int, const QPoint&amp;, QWidget*)\">\n            <modify-argument index=\"return\">\n                <define-ownership class=\"target\" owner=\"default\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"stationary(int)\">\n            <modify-argument index=\"return\">\n                <define-ownership class=\"target\" owner=\"default\"/>\n            </modify-argument>\n        </modify-function>\n    </object-type>\n    <modify-function signature=\"generateTouchEvent(QWidget*, QTouchEvent::DeviceType)\" rename=\"touchEvent\" since=\"4.6\">\n        <modify-argument index=\"return\">\n            <define-ownership class=\"target\" owner=\"target\"/>\n        </modify-argument>\n    </modify-function>\n  </namespace-type>\n\n  <rejection class=\"QSignalSpy\"/>\n  <rejection class=\"QTestEventList\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtUiTools/CMakeLists.txt",
    "content": "project(QtUiTools)\n\nset(QtUiTools_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools/qtuitools_module_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools/quiloader_wrapper.cpp\n)\n\nset(QtUiTools_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtXml_SOURCE_DIR}${PATH_SEP}${QtUiTools_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\nset(QtUiTools_include_dirs  ${CMAKE_CURRENT_SOURCE_DIR}\n                            ${QT_QTCORE_INCLUDE_DIR}\n                            ${QT_QTGUI_INCLUDE_DIR}\n                            ${QT_QTXML_INCLUDE_DIR}\n                            ${QT_QTDESIGNER_INCLUDE_DIR}\n                            ${QT_QTUITOOLS_INCLUDE_DIR}\n                            ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                            ${SHIBOKEN_INCLUDE_DIR}\n                            ${libpyside_SOURCE_DIR}\n                            ${plugins_SOURCE_DIR}\n                            ${QtCore_BINARY_DIR}/PySide/QtCore/\n                            ${QtXml_BINARY_DIR}/PySide/QtXml/\n                            ${QtGui_BINARY_DIR}/PySide/QtGui/\n                            ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtUiTools)\nset(QtUiTools_libraries     pyside\n                            uiplugin\n                            ${SHIBOKEN_PYTHON_LIBRARIES}\n                            ${QT_QTUITOOLS_LIBRARY}\n                            ${QT_QTDESIGNER_LIBRARY}\n                            ${QT_QTCORE_LIBRARY}\n                            ${QT_QTGUI_LIBRARY})\nset(QtUiTools_deps QtGui QtXml)\ncreate_pyside_module(QtUiTools\n                     QtUiTools_include_dirs\n                     QtUiTools_libraries\n                     QtUiTools_deps\n                     QtUiTools_typesystem_path\n                     QtUiTools_SRC\n                     \"\")\n\n"
  },
  {
    "path": "PySide/QtUiTools/glue/plugins.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef _PLUGIN_H_\n#define _PLUGIN_H_\n\n#include <QPluginLoader>\n#include \"customwidgets.h\"\n\ninline void registerCustomWidget(PyObject* obj)\n{\n    static PyCustomWidgets* plugin = 0;\n\n    if (plugin == 0) {\n        foreach(QObject* o, QPluginLoader::staticInstances()) {\n            plugin = qobject_cast<PyCustomWidgets*>(o);\n            if (plugin)\n                break;\n        }\n    }\n\n    if (!plugin)\n        qDebug() << \"Failed to load uiloader plugin.\";\n    else\n        plugin->registerWidgetType(obj);\n}\n\n#endif\n"
  },
  {
    "path": "PySide/QtUiTools/glue/uitools_loadui.cpp",
    "content": "/*\n * Based on code provided by:\n *          Antonio Valentino <antonio.valentino at tiscali.it>\n *          Frédéric <frederic.mantegazza at gbiloba.org>\n */\n\n#include <shiboken.h>\n#include <QUiLoader>\n#include <QFile>\n#include <QWidget>\n\nstatic void createChildrenNameAttributes(PyObject* root, QObject* object)\n{\n    foreach (QObject* child, object->children()) {\n        const QByteArray name = child->objectName().toLocal8Bit();\n\n        if (!name.isEmpty() && !name.startsWith(\"_\") && !name.startsWith(\"qt_\")) {\n            bool hasAttr = PyObject_HasAttrString(root, name.constData());\n            if (!hasAttr) {\n                Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));\n                PyObject_SetAttrString(root, name.constData(), pyChild);\n            }\n            createChildrenNameAttributes(root, child);\n        }\n        createChildrenNameAttributes(root, child);\n    }\n}\n\nstatic PyObject* QUiLoadedLoadUiFromDevice(QUiLoader* self, QIODevice* dev, QWidget* parent)\n{\n    QWidget* wdg = self->load(dev, parent);\n\n    if (wdg) {\n        PyObject* pyWdg = %CONVERTTOPYTHON[QWidget*](wdg);\n        createChildrenNameAttributes(pyWdg, wdg);\n        if (parent) {\n            Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](parent));\n            Shiboken::Object::setParent(pyParent, pyWdg);\n        }\n        return pyWdg;\n    }\n\n    if (!PyErr_Occurred())\n        PyErr_SetString(PyExc_RuntimeError, \"Unable to open/read ui device\");\n    return 0;\n}\n\nstatic PyObject* QUiLoaderLoadUiFromFileName(QUiLoader* self, const QString& uiFile, QWidget* parent)\n{\n    QFile fd(uiFile);\n    return QUiLoadedLoadUiFromDevice(self, &fd, parent);\n}\n"
  },
  {
    "path": "PySide/QtUiTools/typesystem_uitools.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtUiTools\">\n    <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\" />\n    <load-typesystem name=\"typesystem_xml.xml\" generate=\"no\" />\n\n    <object-type name=\"QUiLoader\">\n      <extra-includes>\n        <include file-name=\"glue/plugins.h\" location=\"local\"/>\n      </extra-includes>\n      <inject-code class=\"native\" position=\"beginning\" file=\"glue/uitools_loadui.cpp\"/>\n      <inject-code>\n          Q_IMPORT_PLUGIN(uiplugin);\n      </inject-code>\n      <add-function signature=\"registerCustomWidget(PyObject*)\" return-type=\"void\">\n         <modify-argument index=\"1\">\n            <rename to=\"customWidgetType\" />\n         </modify-argument>\n         <inject-documentation format=\"target\" mode=\"append\">\n         Registers a Python created custom widget to QUiLoader, so it can be recognized when\n         loading a `.ui` file. The custom widget type is passed via the ``customWidgetType`` argument.\n         This is needed when you want to override a virtual method of some widget in the interface,\n         since duck punching will not work with widgets created by QUiLoader based on the contents\n         of the `.ui` file.\n\n         (Remember that `duck punching virtual methods is an invitation for your own demise!\n         &lt;http://www.pyside.org/docs/shiboken/wordsofadvice.html#duck-punching-and-virtual-methods>`_)\n\n         Let's see an obvious example. If you want to create a new widget it's probable you'll end up\n         overriding :class:`~PySide.QtGui.QWidget`'s :meth:`~PySide.QtGui.QWidget.paintEvent` method.\n\n         .. code-block:: python\n\n            class Circle(QWidget):\n                def paintEvent(self, event):\n                    painter = QPainter(self)\n                    painter.setPen(self.pen)\n                    painter.setBrush(QBrush(self.color))\n                    painter.drawEllipse(event.rect().center(), 20, 20)\n\n            # ...\n\n            loader = QUiLoader()\n            loader.registerCustomWidget(Circle)\n            circle = loader.load('circle.ui')\n            circle.show()\n\n            # ...\n         </inject-documentation>\n         <inject-code class=\"target\" position=\"beginning\">\n             registerCustomWidget(%PYARG_1);\n             %CPPSELF.addPluginPath(\"\"); // force reload widgets\n         </inject-code>\n      </add-function>\n      <modify-function signature=\"createAction(QObject*, const QString&amp;)\">\n        <modify-argument index=\"return\">\n          <parent index=\"1\" action=\"add\"/>\n        </modify-argument>\n      </modify-function>\n\n      <modify-function signature=\"createActionGroup(QObject*, const QString&amp;)\">\n        <modify-argument index=\"return\">\n          <parent index=\"1\" action=\"add\"/>\n        </modify-argument>\n      </modify-function>\n\n      <modify-function signature=\"createLayout(const QString&amp;, QObject*, const QString&amp;)\">\n        <modify-argument index=\"return\">\n          <parent index=\"2\" action=\"add\"/>\n        </modify-argument>\n      </modify-function>\n\n      <modify-function signature=\"createWidget(const QString&amp;, QWidget*, const QString&amp;)\">\n        <modify-argument index=\"return\">\n            <parent index=\"2\" action=\"add\"/>\n            <define-ownership class=\"target\" owner=\"default\"/>\n        </modify-argument>\n      </modify-function>\n\n      <modify-function signature=\"load(QIODevice*, QWidget*)\">\n        <modify-argument index=\"2\">\n          <replace-default-expression with=\"0\" />\n          <rename to=\"parentWidget\" />\n        </modify-argument>\n        <modify-argument index=\"return\">\n           <define-ownership class=\"target\" owner=\"target\"/>\n        </modify-argument>\n        <inject-code>\n            // Avoid calling the original function: %CPPSELF.%FUNCTION_NAME()\n            %PYARG_0 = QUiLoadedLoadUiFromDevice(%CPPSELF, %1, %2);\n        </inject-code>\n     </modify-function>\n\n      <!-- Syntax sugar -->\n      <add-function signature=\"load(QString, QWidget*)\" return-type=\"QWidget*\">\n        <modify-argument index=\"2\">\n          <replace-default-expression with=\"0\" />\n          <rename to=\"parentWidget\" />\n        </modify-argument>\n        <modify-argument index=\"return\">\n          <define-ownership class=\"target\" owner=\"target\"/>\n        </modify-argument>\n        <inject-code>\n            // Avoid calling the original function: %CPPSELF.%FUNCTION_NAME()\n            %PYARG_0 = QUiLoaderLoadUiFromFileName(%CPPSELF, %1, %2);\n        </inject-code>\n      </add-function>\n    </object-type>\n\n</typesystem>\n"
  },
  {
    "path": "PySide/QtWebKit/CMakeLists.txt",
    "content": "project(QtWebKit)\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)\n    set (QtWebKit_46_SRC )\nelse ()\n    set(QtWebKit_46_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebelement_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebelementcollection_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebinspector_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_errorpageextensionoption_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_errorpageextensionreturn_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qgraphicswebview_wrapper.cpp\n    )\nendif ()\n\nset(QtWebKit_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qtwebkit_module_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebdatabase_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebframe_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebhistoryinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebhistoryitem_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebhistory_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebhittestresult_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_choosemultiplefilesextensionoption_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_choosemultiplefilesextensionreturn_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_extensionoption_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_extensionreturn_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpluginfactory_mimetype_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpluginfactory_plugin_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpluginfactory_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebsecurityorigin_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebsettings_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/webcore_wrapper.cpp\n\n${QtWebKit_46_SRC}\n)\n\nset(QtWebKit_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\nset(QtWebkit_include_dirs   ${CMAKE_CURRENT_SOURCE_DIR}\n                            ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebkit/\n                            ${QT_INCLUDE_DIR}\n                            ${QT_QTCORE_INCLUDE_DIR}\n                            ${QT_QTGUI_INCLUDE_DIR}\n                            ${QT_QTNETWORK_INCLUDE_DIR}\n                            ${QT_QTWEBKIT_INCLUDE_DIR}\n                            ${SHIBOKEN_INCLUDE_DIR}\n                            ${libpyside_SOURCE_DIR}\n                            ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                            ${QtCore_BINARY_DIR}/PySide/QtCore/\n                            ${QtGui_BINARY_DIR}/PySide/QtGui/\n                            ${QtNetwork_BINARY_DIR}/PySide/QtNetwork/ )\nset(QtWebKit_libraries      pyside\n                            ${SHIBOKEN_PYTHON_LIBRARIES}\n                            ${SHIBOKEN_LIBRARY}\n                            ${QT_QTWEBKIT_LIBRARY}\n                            ${QT_QTNETWORK_LIBRARY}\n                            ${QT_QTGUI_LIBRARY})\nset(QtWebKit_deps QtGui QtNetwork)\ncreate_pyside_module(QtWebKit\n                     QtWebkit_include_dirs\n                     QtWebKit_libraries\n                     QtWebKit_deps\n                     QtWebKit_typesystem_path\n                     QtWebKit_SRC\n                     \"\")\n\n"
  },
  {
    "path": "PySide/QtWebKit/typesystem_webkit.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtWebKit\">\n  <load-typesystem name=\"typesystem_core.xml\" generate=\"no\"/>\n  <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\"/>\n  <load-typesystem name=\"typesystem_network.xml\" generate=\"no\"/>\n\n  <namespace-type name=\"WebCore\"/>\n\n  <object-type name=\"QWebView\">\n    <modify-function signature=\"setPage(QWebPage*)\">\n        <modify-argument index=\"1\">\n            <reference-count action=\"set\"/>\n        </modify-argument>\n    </modify-function>\n    <modify-function signature=\"page() const\">\n        <modify-argument index=\"return\">\n            <define-ownership class=\"target\" owner=\"default\"/>\n        </modify-argument>\n        <inject-code position=\"end\">\n            SbkObject* _pyReturn = reinterpret_cast&lt;SbkObject*&gt;(%PYARG_0);\n            if (!Shiboken::Object::hasParentInfo(_pyReturn))\n                Shiboken::Object::setParent(%PYSELF, %PYARG_0);\n        </inject-code>\n    </modify-function>\n    <modify-function signature=\"print(QPrinter*)const\" rename=\"print_\" />\n  </object-type>\n  <object-type name=\"QWebFrame\">\n    <enum-type name=\"RenderLayer\" since=\"4.6\"/>\n    <modify-function signature=\"addToJavaScriptWindowObject(QString,QObject*)\">\n      <modify-argument index=\"2\">\n          <parent index=\"this\" action=\"add\"/>\n      </modify-argument>\n    </modify-function>\n    <modify-function signature=\"print(QPrinter*)const\" rename=\"print_\" />\n    <modify-function signature=\"metaData()const\">\n        <modify-argument index=\"return\">\n            <replace-type modified-type=\"PyObject\" />\n        </modify-argument>\n        <inject-code position=\"end\">\n            <insert-template name=\"convertFromMultiMap\">\n                <replace from=\"%MAP_NAME\" to=\"%0\"/>\n                <replace from=\"%RETURN_NAME\" to=\"%PYARG_0\"/>\n                <replace from=\"%KEY_TYPE\" to=\"QString\"/>\n                <replace from=\"%VALUE_TYPE\" to=\"QString\"/>\n            </insert-template>\n        </inject-code>\n    </modify-function>\n  </object-type>\n\n  <object-type name=\"QWebSettings\">\n    <enum-type name=\"FontFamily\"/>\n    <enum-type name=\"FontSize\"/>\n    <enum-type name=\"WebAttribute\"/>\n    <enum-type name=\"WebGraphic\"/>\n  </object-type>\n  <object-type name=\"QWebPage\">\n    <enum-type name=\"FindFlag\" flags=\"FindFlags\"/>\n    <enum-type name=\"LinkDelegationPolicy\"/>\n    <enum-type name=\"NavigationType\"/>\n    <enum-type name=\"WebAction\"/>\n    <enum-type name=\"WebWindowType\"/>\n    <!-- Qt 4.6 -->\n    <enum-type name=\"ErrorDomain\" since=\"4.6\"/>\n    <enum-type name=\"Extension\"/>\n    <!-- Qt 4.8 -->\n    <enum-type name=\"Feature\" since=\"4.8\" revision=\"4800\" />\n    <enum-type name=\"PermissionPolicy\" since=\"4.8\" revision=\"4800\" />\n\n   <value-type name=\"ChooseMultipleFilesExtensionOption\" />\n   <value-type name=\"ChooseMultipleFilesExtensionReturn\" />\n   <value-type name=\"ErrorPageExtensionOption\" since=\"4.6\" />\n   <value-type name=\"ErrorPageExtensionReturn\" since=\"4.6\" />\n   <value-type name=\"ExtensionOption\" />\n   <value-type name=\"ExtensionReturn\" />\n\n   <modify-function signature=\"extension(QWebPage::Extension, const QWebPage::ExtensionOption*, QWebPage::ExtensionReturn*)\">\n        <template name=\"qwebpage_extension_argument_conversion\">\n        PyObject* %out = 0;\n        // Cast the parameters according to the extension type\n        if (extension == QWebPage::ChooseMultipleFilesExtension) {\n            const ChooseMultipleFilesExtension$TYPE_SUFFIX* _in = reinterpret_cast&lt;const ChooseMultipleFilesExtension$TYPE_SUFFIX*>(%in);\n            %out = %CONVERTTOPYTHON[const QWebPage::ChooseMultipleFilesExtension$TYPE_SUFFIX*](_in);\n        #if QT_VERSION >= 0x040600\n        } else if (extension == QWebPage::ErrorPageExtension) {\n            const ErrorPageExtension$TYPE_SUFFIX* _in = reinterpret_cast&lt;const ErrorPageExtension$TYPE_SUFFIX*>(%in);\n            %out = %CONVERTTOPYTHON[const QWebPage::ErrorPageExtension$TYPE_SUFFIX*](_in);\n        #endif\n        }\n        </template>\n        <modify-argument index=\"2\" invalidate-after-use=\"yes\">\n            <conversion-rule class=\"target\">\n                <insert-template name=\"qwebpage_extension_argument_conversion\">\n                    <replace from=\"$TYPE_SUFFIX\" to=\"Option\"/>\n                </insert-template>\n            </conversion-rule>\n        </modify-argument>\n        <modify-argument index=\"3\" invalidate-after-use=\"yes\">\n            <conversion-rule class=\"target\">\n                <insert-template name=\"qwebpage_extension_argument_conversion\">\n                    <replace from=\"$TYPE_SUFFIX\" to=\"Return\"/>\n                </insert-template>\n            </conversion-rule>\n        </modify-argument>\n   </modify-function>\n\n   <modify-function signature=\"setNetworkAccessManager(QNetworkAccessManager*)\">\n        <modify-argument index=\"1\">\n            <reference-count action=\"set\"/>\n        </modify-argument>\n   </modify-function>\n   <modify-function signature=\"networkAccessManager()const\">\n        <modify-argument index=\"return\">\n            <reference-count action=\"set\" variable-name=\"setNetworkAccessManager(QNetworkAccessManager*)1\" />\n        </modify-argument>\n   </modify-function>\n   <modify-function signature=\"view()const\">\n        <modify-argument index=\"return\">\n            <define-ownership owner=\"default\"/>\n        </modify-argument>\n   </modify-function>\n   <modify-function signature=\"pluginFactory()const\">\n        <modify-argument index=\"return\">\n            <define-ownership owner=\"default\"/>\n        </modify-argument>\n   </modify-function>\n\n    <modify-function signature=\"javaScriptPrompt(QWebFrame*,const QString &amp;,const QString &amp;,QString*)\">\n      <modify-argument index=\"4\">\n        <remove-argument />\n        <conversion-rule class=\"native\">\n        QString _local;\n        QString* %4 = &amp;_local;\n        </conversion-rule>\n      </modify-argument>\n      <modify-argument index=\"return\">\n          <replace-type modified-type=\"PySequence\"/>\n          <conversion-rule class=\"native\">\n          Shiboken::AutoDecRef pyRes(PySequence_GetItem(%PYARG_0, 0));\n          Shiboken::AutoDecRef pyStr(PySequence_GetItem(%PYARG_0, 1));\n          %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](pyRes);\n          *%4 = %CONVERTTOCPP[QString](pyStr);\n          </conversion-rule>\n          <conversion-rule class=\"target\">\n          %PYARG_0 = PyTuple_New(2);\n          PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));\n          PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QString](*%4));\n          </conversion-rule>\n      </modify-argument>\n    </modify-function>\n\n    <add-function signature=\"qt_metacall()\">\n        <inject-code class=\"native\">\n            static int _signalIndex = -1;\n            static QMetaMethod _m;\n\n            if (_signalIndex == -1) {\n                _signalIndex = QWebPage::staticMetaObject.indexOfSlot(\"shouldInterruptJavaScript()\");\n                _m = QWebPage::staticMetaObject.method(_signalIndex);\n            }\n\n            if (_signalIndex == id) {\n                Shiboken::GilState gil;\n                PyObject* self = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(this);\n                if (self) {\n                    Shiboken::AutoDecRef _pyMethod(PyObject_GetAttrString(self, \"shouldInterruptJavaScript\"));\n                    return PySide::SignalManager::callPythonMetaMethod(_m, args, _pyMethod, false);\n                }\n            }\n        </inject-code>\n    </add-function>\n  </object-type>\n  <object-type name=\"QWebHistory\"/>\n  <object-type name=\"QWebHistoryInterface\"/>\n  <object-type name=\"QWebPluginFactory\">\n    <enum-type name=\"Extension\"/>\n    <value-type name=\"Plugin\"/>\n    <value-type name=\"MimeType\"/>\n    <modify-function signature=\"create(const QString &amp;, const QUrl &amp;, const QStringList &amp;, const QStringList &amp;) const\">\n        <modify-argument index=\"return\">\n            <define-ownership class=\"native\" owner=\"c++\"/>\n            <define-ownership class=\"target\" owner=\"target\"/>\n        </modify-argument>\n    </modify-function>\n  </object-type>\n  <value-type name=\"QWebDatabase\"/>\n  <value-type name=\"QWebHistoryItem\"/>\n  <value-type name=\"QWebHitTestResult\"/>\n  <value-type name=\"QWebSecurityOrigin\"/>\n\n  <!-- Qt 4.6 -->\n  <object-type name=\"QGraphicsWebView\" since=\"4.6\"/>\n  <object-type name=\"QWebInspector\" since=\"4.6\"/>\n  <value-type name=\"QWebElement\" since=\"4.6\">\n    <enum-type name=\"StyleResolveStrategy\"/>\n  </value-type>\n  <value-type name=\"QWebElementCollection\" since=\"4.6\">\n    <add-function signature=\"__len__\">\n        <inject-code>\n        return %CPPSELF.count();\n        </inject-code>\n    </add-function>\n    <add-function signature=\"__getitem__\">\n        <inject-code>\n        if (_i &lt; 0 || _i >= %CPPSELF.count()) {\n            PyErr_SetString(PyExc_IndexError, \"index out of bounds\");\n            return 0;\n        }\n        QWebElement element = %CPPSELF.at(_i);\n        return %CONVERTTOPYTHON[QWebElement](element);\n        </inject-code>\n    </add-function>\n  </value-type>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtWebKit/typesystem_webkit_simulator.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtWebKit\">\n  <object-type name=\"QWebFrame\">\n    <modify-function signature=\"print(QPrinter*)const\" remove=\"all\"/>\n  </object-type>\n  <object-type name=\"QWebView\">\n    <modify-function signature=\"print(QPrinter*)const\" remove=\"all\"/>\n  </object-type>\n\n  <load-typesystem name=\"typesystem_webkit.xml\" generate=\"yes\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/QtXml/CMakeLists.txt",
    "content": "project(QtXml)\n\nset(QtXml_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomattr_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomcdatasection_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomcharacterdata_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomcomment_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomdocument_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomdocumentfragment_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomdocumenttype_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomelement_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomentity_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomentityreference_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomimplementation_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomnamednodemap_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomnode_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomnodelist_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomnotation_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomprocessinginstruction_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qdomtext_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qtxml_module_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlattributes_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlcontenthandler_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmldeclhandler_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmldefaulthandler_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmldtdhandler_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlentityresolver_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlerrorhandler_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlinputsource_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmllexicalhandler_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmllocator_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlnamespacesupport_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlparseexception_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlreader_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml/qxmlsimplereader_wrapper.cpp\n)\n\nset(QtXml_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}\")\nset(QtXml_include_dirs      ${CMAKE_CURRENT_SOURCE_DIR}\n                            ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXml\n                            ${CMAKE_SOURCE_DIR}\n                            ${QT_INCLUDE_DIR}\n                            ${QT_QTCORE_INCLUDE_DIR}\n                            ${QT_QTXML_INCLUDE_DIR}\n                            ${SHIBOKEN_INCLUDE_DIR}\n                            ${libpyside_SOURCE_DIR}\n                            ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                            ${QtCore_BINARY_DIR}/PySide/QtCore)\nset(QtXml_libraries         pyside\n                            ${SHIBOKEN_PYTHON_LIBRARIES}\n                            ${SHIBOKEN_LIBRARY}\n                            ${QT_QTXML_LIBRARY})\nset(QtXml_deps QtCore)\ncreate_pyside_module(QtXml\n                     QtXml_include_dirs\n                     QtXml_libraries\n                     QtXml_deps\n                     QtXml_typesystem_path\n                     QtXml_SRC\n                     \"\")\n"
  },
  {
    "path": "PySide/QtXml/typesystem_xml.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtXml\">\n    <load-typesystem name=\"typesystem_templates.xml\" generate=\"no\" />\n    <load-typesystem name=\"typesystem_core.xml\" generate=\"no\" />\n\n    <rejection class=\"QXmlAttributes::Attribute\"/>\n    <rejection class=\"QDomNode\" field-name=\"impl\"/>\n    <rejection class=\"QXmlInputSource\" field-name=\"EndOfData\"/>\n    <rejection class=\"QXmlInputSource\" field-name=\"EndOfDocument\"/>\n\n    <value-type name=\"QDomAttr\" />\n    <value-type name=\"QDomCDATASection\" />\n    <value-type name=\"QDomCharacterData\" />\n    <value-type name=\"QDomComment\" />\n\n    <template name=\"qdomdocument_setcontent\">\n    QString _errorMsg_;\n    int _errorLine_ = 0;\n    int _errorColumn_ = 0;\n    %BEGIN_ALLOW_THREADS\n    bool _ret_ = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;_errorMsg_, &amp;_errorLine_, &amp;_errorColumn_);\n    %END_ALLOW_THREADS\n    %PYARG_0 = PyTuple_New(4);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[bool](_ret_));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QString](_errorMsg_));\n    PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](_errorLine_));\n    PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](_errorColumn_));\n    </template>\n\n    <value-type name=\"QDomDocument\">\n        <!-- will be replaced in inject code -->\n        <modify-function signature=\"setContent(const QByteArray&amp;, bool, QString*, int*, int*)\">\n            <modify-argument index=\"3\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"5\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, errorMsg, errorLine, errorColumn)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"qdomdocument_setcontent\" />\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"setContent(const QString&amp;, bool, QString*, int*, int*)\">\n            <modify-argument index=\"3\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"5\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, errorMsg, errorLine, errorColumn)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"qdomdocument_setcontent\" />\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"setContent(QIODevice*, bool, QString*, int*, int*)\">\n            <modify-argument index=\"3\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"5\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, errorMsg, errorLine, errorColumn)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"qdomdocument_setcontent\" />\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"setContent(const QByteArray&amp;, QString*, int*, int*)\">\n            <modify-argument index=\"2\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"3\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, errorMsg, errorLine, errorColumn)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"qdomdocument_setcontent\" />\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"setContent(QIODevice*,QString*,int*,int*)\">\n            <modify-argument index=\"2\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"3\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, errorMsg, errorLine, errorColumn)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"qdomdocument_setcontent\" />\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"setContent(QXmlInputSource*,bool,QString*,int*,int*)\">\n            <modify-argument index=\"3\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"5\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, errorMsg, errorLine, errorColumn)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"qdomdocument_setcontent\" />\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"setContent(QXmlInputSource*,QXmlReader*,QString*,int*,int*)\">\n            <modify-argument index=\"3\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"5\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, errorMsg, errorLine, errorColumn)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"qdomdocument_setcontent\" />\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"setContent(const QString&amp;, QString*,int*,int*)\">\n            <modify-argument index=\"2\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"3\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"4\">\n                <remove-argument/>\n                <remove-default-expression/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"(retval, errorMsg, errorLine, errorColumn)\"/>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"qdomdocument_setcontent\" />\n            </inject-code>\n        </modify-function>\n    </value-type>\n\n    <value-type name=\"QDomDocumentFragment\" />\n    <value-type name=\"QDomDocumentType\" />\n    <value-type name=\"QDomEntity\" />\n    <value-type name=\"QDomEntityReference\" />\n    <value-type name=\"QDomImplementation\">\n        <enum-type name=\"InvalidDataPolicy\"/>\n    </value-type>\n\n    <value-type name=\"QDomNamedNodeMap\" />\n\n    <value-type name=\"QDomNode\">\n        <enum-type name=\"EncodingPolicy\"/>\n        <enum-type name=\"NodeType\"/>\n        <modify-function signature=\"save(QTextStream&amp;, int)const\" allow-thread=\"yes\"/>\n        <modify-function signature=\"save(QTextStream&amp;, int, QDomNode::EncodingPolicy)const\" allow-thread=\"yes\"/>\n    </value-type>\n\n    <value-type name=\"QDomNodeList\" />\n    <value-type name=\"QDomNotation\" />\n    <value-type name=\"QDomProcessingInstruction\" />\n\n    <value-type name=\"QDomText\" />\n\n    <object-type name=\"QXmlParseException\"/>\n\n    <value-type name=\"QXmlAttributes\"/>\n\n    <object-type name=\"QXmlNamespaceSupport\"/>\n\n    <value-type name=\"QDomElement\"/>\n\n    <object-type name=\"QXmlContentHandler\">\n        <modify-function signature=\"setDocumentLocator(QXmlLocator*)\">\n            <modify-argument index=\"1\">\n                <define-ownership owner=\"c++\"/>\n            </modify-argument>\n        </modify-function>\n    </object-type>\n    <object-type name=\"QXmlDTDHandler\"/>\n    <object-type name=\"QXmlDeclHandler\"/>\n    <object-type name=\"QXmlErrorHandler\"/>\n    <object-type name=\"QXmlLexicalHandler\"/>\n\n    <template name=\"QXmlEntityResolver_resolveEntity_return_conversion_native\">\n        Shiboken::AutoDecRef  _py_ok_(PySequence_GetItem(%PYARG_0, 0));\n        Shiboken::AutoDecRef  _py_ret_(PySequence_GetItem(%PYARG_0, 1));\n        %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](_py_ok_);\n        %3 = %CONVERTTOCPP[QXmlInputSource*](_py_ret_);\n    </template>\n\n    <object-type name=\"QXmlEntityResolver\">\n        <modify-function signature=\"resolveEntity(const QString&amp;, const QString&amp;, QXmlInputSource*&amp;)\">\n            <modify-argument index=\"3\">\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"PySequence\"/>\n                <conversion-rule class=\"native\">\n                    <insert-template name=\"QXmlEntityResolver_resolveEntity_return_conversion_native\"/>\n                </conversion-rule>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"end\">\n            QXmlInputSource* _qxmlinputsource_arg_ = 0;\n            %BEGIN_ALLOW_THREADS\n            %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);\n            %END_ALLOW_THREADS\n            %PYARG_0 = PyTuple_New(2);\n            PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));\n            PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QXmlInputSource*](_qxmlinputsource_arg_));\n            </inject-code>\n        </modify-function>\n    </object-type>\n    <object-type name=\"QXmlDefaultHandler\">\n        <modify-function signature=\"setDocumentLocator(QXmlLocator*)\">\n            <modify-argument index=\"1\">\n                <define-ownership owner=\"c++\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"resolveEntity(const QString&amp;, const QString&amp;, QXmlInputSource*&amp;)\">\n            <modify-argument index=\"3\">\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"PySequence\"/>\n                <conversion-rule class=\"native\">\n                    <insert-template name=\"QXmlEntityResolver_resolveEntity_return_conversion_native\"/>\n                </conversion-rule>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"end\">\n            QXmlInputSource* _qxmlinputsource_arg_ = 0;\n            %BEGIN_ALLOW_THREADS\n            %RETURN_TYPE %0 = %CPPSELF.%TYPE::%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);\n            %END_ALLOW_THREADS\n            %PYARG_0 = PyTuple_New(2);\n            PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));\n            PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QXmlInputSource*](_qxmlinputsource_arg_));\n            </inject-code>\n        </modify-function>\n    </object-type>\n    <object-type name=\"QXmlInputSource\"/>\n    <object-type name=\"QXmlLocator\"/>\n\n    <object-type name=\"QXmlReader\">\n        <modify-function signature=\"parse(const QXmlInputSource*)\">\n            <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n        </modify-function>\n        <modify-function signature=\"feature(QString,bool*)const\">\n            <modify-argument index=\"2\">\n                <remove-default-expression/>\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"PySequence\" />\n                <conversion-rule class=\"native\">\n                    <insert-template name=\"fix_virtual_method_return_value_and_bool*\"/>\n                </conversion-rule>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"fix_args,bool*\"/>\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"property(QString,bool*)const\">\n            <modify-argument index=\"2\">\n                <remove-default-expression/>\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"PySequence\" />\n                <conversion-rule class=\"native\">\n                    <insert-template name=\"fix_virtual_method_return_value_and_bool*\"/>\n                </conversion-rule>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"fix_args,bool*\"/>\n            </inject-code>\n        </modify-function>\n    </object-type>\n    <object-type name=\"QXmlSimpleReader\">\n        <modify-function signature=\"parse(const QXmlInputSource*,bool)\">\n            <modify-argument index=\"1\" invalidate-after-use=\"yes\"/>\n        </modify-function>\n\n        <modify-function signature=\"setContentHandler(QXmlContentHandler*)\">\n            <modify-argument index=\"1\">\n                <parent index=\"this\" action=\"add\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"setDTDHandler(QXmlDTDHandler*)\">\n            <modify-argument index=\"1\">\n                <parent index=\"this\" action=\"add\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"setDeclHandler(QXmlDeclHandler*)\">\n            <modify-argument index=\"1\">\n                <parent index=\"this\" action=\"add\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"setEntityResolver(QXmlEntityResolver*)\">\n            <modify-argument index=\"1\">\n                <parent index=\"this\" action=\"add\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"setErrorHandler(QXmlErrorHandler*)\">\n            <modify-argument index=\"1\">\n                <parent index=\"this\" action=\"add\"/>\n            </modify-argument>\n        </modify-function>\n        <modify-function signature=\"setLexicalHandler(QXmlLexicalHandler*)\">\n            <modify-argument index=\"1\">\n                <parent index=\"this\" action=\"add\"/>\n            </modify-argument>\n        </modify-function>\n\n        <modify-function signature=\"feature(QString,bool*)const\">\n            <modify-argument index=\"2\">\n                <remove-default-expression/>\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"PySequence\" />\n                <conversion-rule class=\"native\">\n                    <insert-template name=\"fix_virtual_method_return_value_and_bool*\"/>\n                </conversion-rule>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"fix_args,bool*\"/>\n            </inject-code>\n        </modify-function>\n        <modify-function signature=\"property(QString,bool*)const\">\n            <modify-argument index=\"2\">\n                <remove-default-expression/>\n                <remove-argument/>\n            </modify-argument>\n            <modify-argument index=\"return\">\n                <replace-type modified-type=\"PySequence\" />\n                <conversion-rule class=\"native\">\n                    <insert-template name=\"fix_virtual_method_return_value_and_bool*\"/>\n                </conversion-rule>\n            </modify-argument>\n            <inject-code class=\"target\" position=\"beginning\">\n                <insert-template name=\"fix_args,bool*\"/>\n            </inject-code>\n        </modify-function>\n    </object-type>\n</typesystem>\n\n"
  },
  {
    "path": "PySide/QtXmlPatterns/CMakeLists.txt",
    "content": "project(QtXmlPatterns)\n\nif (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)\n    set(QtXmlPatterns_46_SRC )\nelse()\n    set(QtXmlPatterns_46_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlschemavalidator_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlschema_wrapper.cpp\n    )\nendif()\n\nset(QtXmlPatterns_SRC\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qabstractmessagehandler_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qabstracturiresolver_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qabstractxmlnodemodel_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qabstractxmlreceiver_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qsourcelocation_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qtxmlpatterns_module_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlformatter_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlitem_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlnamepool_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlname_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlnodemodelindex_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlquery_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlresultitems_wrapper.cpp\n    ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns/qxmlserializer_wrapper.cpp\n    ${QtXmlPatterns_46_SRC}\n)\nset(QtXmlPatterns_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}\")\nset(QtXmlPatterns_include_dirs  ${CMAKE_CURRENT_SOURCE_DIR}\n                                ${QT_QTCORE_INCLUDE_DIR}\n                                ${QT_QTXMLPATTERNS_INCLUDE_DIR}\n                                ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                                ${SHIBOKEN_INCLUDE_DIR}\n                                ${libpyside_SOURCE_DIR}\n                                ${QtCore_BINARY_DIR}/PySide/QtCore/\n                                ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtXmlPatterns)\nset(QtXmlPatterns_libraries     pyside\n                                ${SHIBOKEN_PYTHON_LIBRARIES}\n                                ${QT_QTCORE_LIBRARY}\n                                ${QT_QTXMLPATTERNS_LIBRARY})\nset(QtXmlPatterns_deps QtCore)\ncreate_pyside_module(QtXmlPatterns\n                     QtXmlPatterns_include_dirs\n                     QtXmlPatterns_libraries\n                     QtXmlPatterns_deps\n                     QtXmlPatterns_typesystem_path\n                     QtXmlPatterns_SRC\n                     \"\")\n\n"
  },
  {
    "path": "PySide/QtXmlPatterns/typesystem_xmlpatterns.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.QtXmlPatterns\">\n    <load-typesystem name=\"typesystem_core.xml\" generate=\"no\"/>\n\n    <object-type name=\"QXmlSchema\" since=\"4.6\" /> <!-- Qt scoped pointer does not allow declare this as value type -->\n    <object-type name=\"QXmlSchemaValidator\" since=\"4.6\">\n      <modify-function signature=\"schema() const\">\n        <modify-argument index=\"return\">\n          <replace-type modified-type=\"QXmlSchema*\"/>\n          <define-ownership owner=\"target\"/>\n        </modify-argument>\n        <inject-code>\n          QXmlSchema* %0 = new QXmlSchema(%CPPSELF.schema());\n          %PYARG_0 = %CONVERTTOPYTHON[QXmlSchema*](%0);\n        </inject-code>\n      </modify-function>\n    </object-type>\n    <object-type name=\"QAbstractMessageHandler\" />\n    <object-type name=\"QAbstractUriResolver\" />\n    <object-type name=\"QAbstractXmlNodeModel\">\n        <enum-type name=\"NodeCopySetting\" />\n        <enum-type name=\"SimpleAxis\" />\n    </object-type>\n    <object-type name=\"QAbstractXmlReceiver\" />\n    <value-type name=\"QSourceLocation\" />\n    <object-type name=\"QXmlFormatter\" />\n    <value-type name=\"QXmlItem\" />\n    <value-type name=\"QXmlName\">\n        <!-- ### These methods aren't part of Qt public API -->\n        <modify-function signature=\"QXmlName(short, short, short)\" remove=\"all\" />\n        <modify-function signature=\"setNamespaceURI(short)\" remove=\"all\" />\n        <modify-function signature=\"localName()const\" remove=\"all\" />\n        <modify-function signature=\"prefix()const\" remove=\"all\" />\n        <modify-function signature=\"hasPrefix()const\" remove=\"all\" />\n        <modify-function signature=\"hasNamespace()const\" remove=\"all\" />\n        <modify-function signature=\"namespaceURI()const\" remove=\"all\" />\n        <modify-function signature=\"isLexicallyEqual(const QXmlName&amp;)const\" remove=\"all\" />\n        <modify-function signature=\"setPrefix(short)\" remove=\"all\" />\n        <modify-function signature=\"setLocalName(short)\" remove=\"all\" />\n        <modify-function signature=\"code()const\" remove=\"all\" />\n        <!-- ### -->\n    </value-type>\n    <value-type name=\"QXmlNamePool\" />\n\n    <rejection class=\"QXmlNodeModelIndex\" function-name=\"type\" />\n    <rejection class=\"QXmlNodeModelIndex\" function-name=\"sequencedTypedValue\" />\n    <rejection class=\"QXmlNodeModelIndex\" function-name=\"iterate\" />\n    <!-- ### This enum isn't part of Qt public API -->\n    <suppress-warning text=\"enum 'QXmlNodeModelIndex::Axis' does not have a type entry or is not an enum\"/>\n    <value-type name=\"QXmlNodeModelIndex\">\n        <enum-type name=\"DocumentOrder\" />\n        <enum-type name=\"NodeKind\" />\n        <!-- ### Qt internal methods -->\n        <modify-function signature=\"name()const\" remove=\"all\" />\n        <modify-function signature=\"root()const\" remove=\"all\" />\n        <modify-function signature=\"documentUri()const\" remove=\"all\" />\n        <modify-function signature=\"baseUri()const\" remove=\"all\" />\n        <modify-function signature=\"kind()const\" remove=\"all\" />\n        <modify-function signature=\"isDeepEqual(const QXmlNodeModelIndex&amp;)const\" remove=\"all\" />\n        <modify-function signature=\"compareOrder(const QXmlNodeModelIndex &amp;)const\" remove=\"all\" />\n        <modify-function signature=\"sendNamespaces(QAbstractXmlReceiver *)const\" remove=\"all\" />\n        <modify-function signature=\"namespaceBindings()const\" remove=\"all\" />\n        <modify-function signature=\"namespaceForPrefix(short)const\" remove=\"all\" />\n        <modify-function signature=\"stringValue()const\" remove=\"all\" />\n        <modify-function signature=\"is(const QXmlNodeModelIndex &amp;)const\" remove=\"all\" />\n        <modify-function signature=\"reset()\" remove=\"all\" />\n        <!-- ### -->\n    </value-type>\n\n    <value-type name=\"QXmlQuery\">\n        <!-- ### TODO: must evaluate if anything other than removal is needed. -->\n        <enum-type name=\"QueryLanguage\" />\n        <modify-function signature=\"evaluateTo(QStringList*)const\" remove=\"all\" />\n        <modify-function signature=\"evaluateTo(QString*)const\" remove=\"all\" />\n        <!-- ### -->\n    </value-type>\n    <object-type name=\"QXmlResultItems\" />\n    <object-type name=\"QXmlSerializer\" />\n\n    <suppress-warning text=\"class 'QAbstractXmlNodeModel' inherits from unknown base class 'QSharedData'\"/>\n    <suppress-warning text=\"class not found for setup inheritance 'QSharedData'\"/>\n</typesystem>\n"
  },
  {
    "path": "PySide/__init__.py.in",
    "content": "__all__ = ['QtCore', 'QtGui', 'QtNetwork', 'QtOpenGL', 'QtSql', 'QtSvg', 'QtTest', 'QtWebKit', 'QtScript']\n__version__         = \"@BINDING_API_VERSION_FULL@\"\n__version_info__    = (@BINDING_API_MAJOR_VERSION@, @BINDING_API_MINOR_VERSION@, @BINDING_API_MICRO_VERSION@, \"@BINDING_API_RELEASE_LEVEL@\", @BINDING_API_SERIAL@)\n\n\ndef _setupQtDirectories():\n    import sys\n    import os\n    from . import _utils\n\n    pysideDir = _utils.get_pyside_dir()\n\n    # Register PySide qt.conf to override the built-in\n    # configuration variables, if there is no default qt.conf in\n    # executable folder\n    prefix = pysideDir.replace('\\\\', '/')\n    _utils.register_qt_conf(prefix=prefix,\n                            binaries=prefix,\n                            plugins=prefix+\"/plugins\",\n                            imports=prefix+\"/imports\",\n                            translations=prefix+\"/translations\")\n\n    # On Windows add the PySide\\openssl folder (if it exists) to the\n    # PATH so the SSL DLLs can be found when Qt tries to dynamically\n    # load them.  Tell Qt to load them and then reset the PATH.\n    if sys.platform == 'win32':\n        opensslDir = os.path.join(pysideDir, 'openssl')\n        if os.path.exists(opensslDir):\n            path = os.environ['PATH']\n            try:\n                os.environ['PATH'] = opensslDir + os.pathsep + path\n                try:\n                    from . import QtNetwork\n                except ImportError:\n                    pass\n                else:\n                    QtNetwork.QSslSocket.supportsSsl()\n            finally:\n                os.environ['PATH'] = path\n\n_setupQtDirectories()\n"
  },
  {
    "path": "PySide/_utils.py.in",
    "content": "# This file is part of PySide: Python for Qt\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n#\n# Contact: PySide team <contact@pyside.org>\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public License\n# version 2 as published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n\nimport sys\nimport os\nimport fnmatch\n\n\nif sys.platform == 'win32':\n    # On Windows get the PySide package path in case sensitive format.\n    # Even if the file system on Windows is case insensitive,\n    # some parts in Qt environment such as qml imports path,\n    # requires to be in case sensitive format.\n    import ctypes\n    from ctypes import POINTER, WinError, sizeof, byref, create_unicode_buffer\n    from ctypes.wintypes import MAX_PATH, LPCWSTR, LPWSTR, DWORD\n\n    GetShortPathNameW = ctypes.windll.kernel32.GetShortPathNameW\n    GetShortPathNameW.argtypes = [LPCWSTR, LPWSTR, DWORD]\n    GetShortPathNameW.restype = DWORD\n\n    GetLongPathNameW = ctypes.windll.kernel32.GetLongPathNameW\n    GetLongPathNameW.argtypes = [LPCWSTR, LPWSTR, DWORD]\n    GetLongPathNameW.restype = DWORD\n\n    PY_2 = sys.version_info[0] < 3\n\n    if PY_2:\n        def u(x):\n            return unicode(x)\n        def u_fs(x):\n            return unicode(x, sys.getfilesystemencoding())\n    else:\n        def u(x):\n            return x\n        def u_fs(x):\n            return x\n\n    def _get_win32_short_name(s):\n        \"\"\" Returns short name \"\"\"\n        buf_size = MAX_PATH\n        for i in range(2):\n            buf = create_unicode_buffer(u('\\0') * (buf_size + 1))\n            r = GetShortPathNameW(u_fs(s), buf, buf_size)\n            if r == 0:\n                raise WinError()\n            if r < buf_size:\n                if PY_2:\n                    return buf.value.encode(sys.getfilesystemencoding())\n                return buf.value\n            buf_size = r\n        raise WinError()\n\n    def _get_win32_long_name(s):\n        \"\"\" Returns long name \"\"\"\n        buf_size = MAX_PATH\n        for i in range(2):\n            buf = create_unicode_buffer(u('\\0') * (buf_size + 1))\n            r = GetLongPathNameW(u_fs(s), buf, buf_size)\n            if r == 0:\n                raise WinError()\n            if r < buf_size:\n                if PY_2:\n                    return buf.value.encode(sys.getfilesystemencoding())\n                return buf.value\n            buf_size = r\n        raise WinError()\n\n    def _get_win32_case_sensitive_name(s):\n        \"\"\" Returns long name in case sensitive format \"\"\"\n        path = _get_win32_long_name(_get_win32_short_name(s))\n        return path\n\n    def get_pyside_dir():\n        try:\n            from . import QtCore\n        except ImportError:\n            return _get_win32_case_sensitive_name(os.path.abspath(os.path.dirname(__file__)))\n        else:\n            return _get_win32_case_sensitive_name(os.path.abspath(os.path.dirname(QtCore.__file__)))\n\nelse:\n    def get_pyside_dir():\n        try:\n            from . import QtCore\n        except ImportError:\n            return os.path.abspath(os.path.dirname(__file__))\n        else:\n            return os.path.abspath(os.path.dirname(QtCore.__file__))\n\n\ndef _filter_match(name, patterns):\n    for pattern in patterns:\n        if pattern is None:\n            continue\n        if fnmatch.fnmatch(name, pattern):\n            return True\n    return False\n\n\ndef _dir_contains(dir, filter):\n    names = os.listdir(dir)\n    for name in names:\n        srcname = os.path.join(dir, name)\n        if not os.path.isdir(srcname) and _filter_match(name, filter):\n            return True\n    return False\n\n\ndef _rcc_write_number(out, number, width):\n    dividend = 1\n    if width == 2:\n        dividend = 256\n    elif width == 3:\n        dividend = 65536\n    elif width == 4:\n        dividend = 16777216\n    while dividend >= 1:\n        tmp = int(number / dividend)\n        out.append(\"%02x\" % tmp)\n        number -= tmp * dividend\n        dividend = int(dividend / 256)\n\n\ndef _rcc_write_data(out, data):\n    _rcc_write_number(out, len(data), 4)\n    for d in data:\n        _rcc_write_number(out, ord(d), 1)\n\n\ndef _get_qt_conf_resource(prefix, binaries, plugins, imports, translations):\n    \"\"\"\n    Generate Qt resource with embedded qt.conf\n    \"\"\"\n    qt_conf_template = \"\\\n[Paths]\\x0d\\x0a\\\nPrefix = %(prefix)s\\x0d\\x0a\\\nBinaries = %(binaries)s\\x0d\\x0a\\\nImports = %(imports)s\\x0d\\x0a\\\nPlugins = %(plugins)s\\x0d\\x0a\\\nTranslations = %(translations)s\"\n\n    rc_data_input = qt_conf_template % {\"prefix\": prefix,\n                                        \"binaries\": binaries,\n                                        \"plugins\": plugins,\n                                        \"imports\": imports,\n                                        \"translations\": translations}\n    rc_data_ouput = []\n    _rcc_write_data(rc_data_ouput, rc_data_input)\n\n    # The rc_struct and rc_name was pre-generated by pyside-rcc from file:\n    # <!DOCTYPE RCC><RCC version=\"1.0\">\n    # <qresource>\n    #   <file>qt/etc/qt.conf</file>\n    # </qresource>\n    # </RCC>\n    PY_2 = sys.version_info[0] < 3\n    if PY_2:\n        rc_struct = \"\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\\n\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x0a\\x00\\x02\\x00\\x00\\\n\\x00\\x01\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x16\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\\n\\x00\\x00\"\n        rc_name = \"\\\n\\x00\\x02\\x00\\x00\\x07\\x84\\x00q\\x00t\\x00\\x03\\x00\\x00l\\xa3\\x00e\\x00t\\x00c\\x00\\\n\\x07\\x08t\\xa6\\xa6\\x00q\\x00t\\x00.\\x00c\\x00o\\x00n\\x00f\"\n        rc_data = \"\".join(rc_data_ouput).decode('hex')\n    else:\n        rc_struct = b\"\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\\n\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x0a\\x00\\x02\\x00\\x00\\\n\\x00\\x01\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x16\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\\n\\x00\\x00\"\n        rc_name = b\"\\\n\\x00\\x02\\x00\\x00\\x07\\x84\\x00q\\x00t\\x00\\x03\\x00\\x00l\\xa3\\x00e\\x00t\\x00c\\x00\\\n\\x07\\x08t\\xa6\\xa6\\x00q\\x00t\\x00.\\x00c\\x00o\\x00n\\x00f\"\n        rc_data = bytes.fromhex(\"\".join(rc_data_ouput))\n\n    return rc_struct, rc_name, rc_data\n\n\ndef register_qt_conf(prefix, binaries, plugins, imports, translations,\n                     force=False):\n    \"\"\"\n    Register qt.conf in Qt resource system to override the built-in\n    configuration variables, if there is no default qt.conf in\n    executable folder and another qt.conf is not already registered in\n    Qt resource system.\n    \"\"\"\n    try:\n        from . import QtCore\n    except ImportError:\n        return\n\n    # Check folder structure\n    if not prefix or not os.path.exists(prefix):\n        if force:\n            raise RuntimeError(\"Invalid prefix path specified: %s\" % prefix)\n        else:\n            return\n    if not binaries or not os.path.exists(binaries):\n        if force:\n            raise RuntimeError(\"Invalid binaries path specified: %s\" % binaries)\n        else:\n            return\n    else:\n        # Check if required Qt libs exists in binaries folder\n        if sys.platform == 'win32':\n            pattern = [\"QtCore*.dll\"]\n        else:\n            pattern = [\"libQtCore.so.*\"]\n        if not _dir_contains(binaries, pattern):\n            if force:\n                raise RuntimeError(\"QtCore lib not found in folder: %s\" % \\\n                    binaries)\n            else:\n                return\n    if not plugins or not os.path.exists(plugins):\n        if force:\n            raise RuntimeError(\"Invalid plugins path specified: %s\" % plugins)\n        else:\n            return\n    if not imports or not os.path.exists(imports):\n        if force:\n            raise RuntimeError(\"Invalid imports path specified: %s\" % imports)\n        else:\n            return\n    if not translations or not os.path.exists(translations):\n        if force:\n            raise RuntimeError(\"Invalid translations path specified: %s\" \\\n                % translations)\n        else:\n            return\n\n    # Check if there is no default qt.conf in executable folder\n    exec_prefix = os.path.dirname(sys.executable)\n    qtconf_path = os.path.join(exec_prefix, 'qt.conf')\n    if os.path.exists(qtconf_path) and not force:\n        return\n\n    # Check if another qt.conf is not already registered in Qt resource system\n    if QtCore.QFile.exists(\":/qt/etc/qt.conf\") and not force:\n        return\n\n    rc_struct, rc_name, rc_data = _get_qt_conf_resource(prefix, binaries,\n                                                        plugins, imports,\n                                                        translations)\n    QtCore.qRegisterResourceData(0x01, rc_struct, rc_name, rc_data)\n\n    # Initialize the Qt library by querying the QLibraryInfo\n    prefixPath = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PrefixPath)\n"
  },
  {
    "path": "PySide/global.h.in",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n**\n** This file is part of the QtCore module of the Qt Toolkit, plus some\n** modifications by PySide team.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** If you are unsure which license is appropriate for your use, please\n** Contact: http://www.qt-project.org/legal\n**\n****************************************************************************/\n\n#undef QT_NO_STL\n#undef QT_NO_STL_WCHAR\n#define Q_BYTE_ORDER // used to enable QSysInfo.Endian detection on MacOSX\n\n#include \"@QT_QTCORE_INCLUDE_DIR@/qnamespace.h\"\n\nQT_BEGIN_HEADER\n\nQT_BEGIN_NAMESPACE\n\nQT_MODULE(Core)\n\nclass QByteArray;\n\nclass QString;\n\n#ifndef Q_MOC_OUTPUT_REVISION\n#define Q_MOC_OUTPUT_REVISION 61\n#endif\n\n// macro for onaming members\n#ifdef METHOD\n#undef METHOD\n#endif\n#ifdef SLOT\n#undef SLOT\n#endif\n#ifdef SIGNAL\n#undef SIGNAL\n#endif\n\nQ_CORE_EXPORT const char *qFlagLocation(const char *method);\n\n#define QTOSTRING_HELPER(s) #s\n#define QTOSTRING(s) QTOSTRING_HELPER(s)\n#ifndef QT_NO_DEBUG\n# define QLOCATION \"\\0\"__FILE__\":\"QTOSTRING(__LINE__)\n# define METHOD(a)   qFlagLocation(\"0\"#a QLOCATION)\n# define SLOT(a)     qFlagLocation(\"1\"#a QLOCATION)\n# define SIGNAL(a)   qFlagLocation(\"2\"#a QLOCATION)\n#else\n# define METHOD(a)   \"0\"#a\n# define SLOT(a)     \"1\"#a\n# define SIGNAL(a)   \"2\"#a\n#endif\n\n#ifdef QT3_SUPPORT\n#define METHOD_CODE   0                        // member type codes\n#define SLOT_CODE     1\n#define SIGNAL_CODE   2\n#endif\n\n#define QMETHOD_CODE  0                        // member type codes\n#define QSLOT_CODE    1\n#define QSIGNAL_CODE  2\n\n#define Q_ARG(type, data) QArgument<type >(#type, data)\n#define Q_RETURN_ARG(type, data) QReturnArgument<type >(#type, data)\n\nclass QObject;\nclass QMetaMethod;\nclass QMetaEnum;\nclass QMetaProperty;\nclass QMetaClassInfo;\n\n\nclass Q_CORE_EXPORT QGenericArgument\n{\npublic:\n    inline QGenericArgument(const char *aName = 0, const void *aData = 0)\n        : _data(aData), _name(aName) {}\n    inline void *data() const { return const_cast<void *>(_data); }\n    inline const char *name() const { return _name; }\n\nprivate:\n    const void *_data;\n    const char *_name;\n};\n\nclass Q_CORE_EXPORT QGenericReturnArgument: public QGenericArgument\n{\npublic:\n    inline QGenericReturnArgument(const char *aName = 0, void *aData = 0)\n        : QGenericArgument(aName, aData)\n        {}\n};\n\ntemplate <class T>\nclass QArgument: public QGenericArgument\n{\npublic:\n    inline QArgument(const char *aName, const T &aData)\n        : QGenericArgument(aName, static_cast<const void *>(&aData))\n        {}\n};\n\n\ntemplate <typename T>\nclass QReturnArgument: public QGenericReturnArgument\n{\npublic:\n    inline QReturnArgument(const char *aName, T &aData)\n        : QGenericReturnArgument(aName, static_cast<void *>(&aData))\n        {}\n};\n\nstruct Q_CORE_EXPORT QMetaObject\n{\n    const char *className() const;\n    const QMetaObject *superClass() const;\n\n    QObject *cast(QObject *obj) const;\n\n#ifndef QT_NO_TRANSLATION\n    // ### Qt 4: Merge overloads\n    QString tr(const char *s, const char *c) const;\n    QString trUtf8(const char *s, const char *c) const;\n    QString tr(const char *s, const char *c, int n) const;\n    QString trUtf8(const char *s, const char *c, int n) const;\n#endif // QT_NO_TRANSLATION\n\n    int methodOffset() const;\n    int enumeratorOffset() const;\n    int propertyOffset() const;\n    int classInfoOffset() const;\n\n    int constructorCount() const;\n    int methodCount() const;\n    int enumeratorCount() const;\n    int propertyCount() const;\n    int classInfoCount() const;\n\n    int indexOfConstructor(const char *constructor) const;\n    int indexOfMethod(const char *method) const;\n    int indexOfSignal(const char *signal) const;\n    int indexOfSlot(const char *slot) const;\n    int indexOfEnumerator(const char *name) const;\n    int indexOfProperty(const char *name) const;\n    int indexOfClassInfo(const char *name) const;\n\n    QMetaMethod constructor(int index) const;\n    QMetaMethod method(int index) const;\n    QMetaEnum enumerator(int index) const;\n    QMetaProperty property(int index) const;\n    QMetaClassInfo classInfo(int index) const;\n    QMetaProperty userProperty() const;\n\n    static bool checkConnectArgs(const char *signal, const char *method);\n    static QByteArray normalizedSignature(const char *method);\n    static QByteArray normalizedType(const char *type);\n\n    // internal index-based connect\n    static bool connect(const QObject *sender, int signal_index,\n                        const QObject *receiver, int method_index,\n                        int type = 0, int *types = 0);\n    // internal index-based disconnect\n    static bool disconnect(const QObject *sender, int signal_index,\n                           const QObject *receiver, int method_index);\n    // internal slot-name based connect\n    static void connectSlotsByName(QObject *o);\n\n    // internal index-based signal activation\n    static void activate(QObject *sender, int signal_index, void **argv);\n    static void activate(QObject *sender, int from_signal_index, int to_signal_index, void **argv);\n    static void activate(QObject *sender, const QMetaObject *, int local_signal_index, void **argv);\n    static void activate(QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv);\n    // internal guarded pointers\n    static void addGuard(QObject **ptr);\n    static void removeGuard(QObject **ptr);\n    static void changeGuard(QObject **ptr, QObject *o);\n\n    static bool invokeMethod(QObject *obj, const char *member,\n                             Qt::ConnectionType,\n                             QGenericReturnArgument ret,\n                             QGenericArgument val0 = QGenericArgument(0),\n                             QGenericArgument val1 = QGenericArgument(),\n                             QGenericArgument val2 = QGenericArgument(),\n                             QGenericArgument val3 = QGenericArgument(),\n                             QGenericArgument val4 = QGenericArgument(),\n                             QGenericArgument val5 = QGenericArgument(),\n                             QGenericArgument val6 = QGenericArgument(),\n                             QGenericArgument val7 = QGenericArgument(),\n                             QGenericArgument val8 = QGenericArgument(),\n                             QGenericArgument val9 = QGenericArgument());\n\n    static inline bool invokeMethod(QObject *obj, const char *member,\n                             QGenericReturnArgument ret,\n                             QGenericArgument val0 = QGenericArgument(0),\n                             QGenericArgument val1 = QGenericArgument(),\n                             QGenericArgument val2 = QGenericArgument(),\n                             QGenericArgument val3 = QGenericArgument(),\n                             QGenericArgument val4 = QGenericArgument(),\n                             QGenericArgument val5 = QGenericArgument(),\n                             QGenericArgument val6 = QGenericArgument(),\n                             QGenericArgument val7 = QGenericArgument(),\n                             QGenericArgument val8 = QGenericArgument(),\n                             QGenericArgument val9 = QGenericArgument())\n    {\n        return invokeMethod(obj, member, Qt::AutoConnection, ret, val0, val1, val2, val3,\n                val4, val5, val6, val7, val8, val9);\n    }\n\n    static inline bool invokeMethod(QObject *obj, const char *member,\n                             Qt::ConnectionType type,\n                             QGenericArgument val0 = QGenericArgument(0),\n                             QGenericArgument val1 = QGenericArgument(),\n                             QGenericArgument val2 = QGenericArgument(),\n                             QGenericArgument val3 = QGenericArgument(),\n                             QGenericArgument val4 = QGenericArgument(),\n                             QGenericArgument val5 = QGenericArgument(),\n                             QGenericArgument val6 = QGenericArgument(),\n                             QGenericArgument val7 = QGenericArgument(),\n                             QGenericArgument val8 = QGenericArgument(),\n                             QGenericArgument val9 = QGenericArgument())\n    {\n        return invokeMethod(obj, member, type, QGenericReturnArgument(), val0, val1, val2,\n                                 val3, val4, val5, val6, val7, val8, val9);\n    }\n\n    static inline bool invokeMethod(QObject *obj, const char *member,\n                             QGenericArgument val0 = QGenericArgument(0),\n                             QGenericArgument val1 = QGenericArgument(),\n                             QGenericArgument val2 = QGenericArgument(),\n                             QGenericArgument val3 = QGenericArgument(),\n                             QGenericArgument val4 = QGenericArgument(),\n                             QGenericArgument val5 = QGenericArgument(),\n                             QGenericArgument val6 = QGenericArgument(),\n                             QGenericArgument val7 = QGenericArgument(),\n                             QGenericArgument val8 = QGenericArgument(),\n                             QGenericArgument val9 = QGenericArgument())\n    {\n        return invokeMethod(obj, member, Qt::AutoConnection, QGenericReturnArgument(), val0,\n                val1, val2, val3, val4, val5, val6, val7, val8, val9);\n    }\n\n    QObject *newInstance(QGenericArgument val0 = QGenericArgument(0),\n                         QGenericArgument val1 = QGenericArgument(),\n                         QGenericArgument val2 = QGenericArgument(),\n                         QGenericArgument val3 = QGenericArgument(),\n                         QGenericArgument val4 = QGenericArgument(),\n                         QGenericArgument val5 = QGenericArgument(),\n                         QGenericArgument val6 = QGenericArgument(),\n                         QGenericArgument val7 = QGenericArgument(),\n                         QGenericArgument val8 = QGenericArgument(),\n                         QGenericArgument val9 = QGenericArgument()) const;\n\n    enum Call {\n        InvokeMetaMethod,\n        ReadProperty,\n        WriteProperty,\n        ResetProperty,\n        QueryPropertyDesignable,\n        QueryPropertyScriptable,\n        QueryPropertyStored,\n        QueryPropertyEditable,\n        QueryPropertyUser,\n        CreateInstance\n    };\n\n    int static_metacall(Call, int, void **) const;\n\n#ifdef QT3_SUPPORT\n    QT3_SUPPORT const char *superClassName() const;\n#endif\n\n    struct { // private data\n        const QMetaObject *superdata;\n        const char *stringdata;\n        const uint *data;\n        const void *extradata;\n    } d;\n};\n\nstruct QMetaObjectExtraData\n{\n    const QMetaObject **objects;\n    int (*static_metacall)(QMetaObject::Call, int, void **);\n};\n\ninline const char *QMetaObject::className() const\n{ return d.stringdata; }\n\ninline const QMetaObject *QMetaObject::superClass() const\n{ return d.superdata; }\n\n#ifdef QT3_SUPPORT\ninline const char *QMetaObject::superClassName() const\n{ return d.superdata ? d.superdata->className() : 0; }\n#endif\n\nQT_END_NAMESPACE\n\nQT_END_HEADER\n\n#define qdoc\n\n#if @ENABLE_X11@\n  #define Q_WS_X11\n#elif @ENABLE_MAC@\n  #define Q_WS_MAC\n#elif @ENABLE_WIN@\n  #include \"pysidewtypes.h\"\n  #define Q_WS_WIN\n#elif @ENABLE_SIMULATOR@\n  #define Q_WS_SIMULATOR\n#endif\n\n// There are symbols in Qt that exist in Debug but\n// not in release\n#define QT_NO_DEBUG\n\n#include \"@QT_QTCORE_INCLUDE_DIR@/QtCore\"\n#if @ENABLE_MAC@ || @ENABLE_WIN@\n  // Workaround to parse the QApplication header\n  #define Q_INTERNAL_QAPP_SRC\n  #undef qdoc\n#endif\n#include \"@QT_QTGUI_INCLUDE_DIR@/QtGui\"\n#include \"qpytextobject.h\"  // PySide class\n#if @ENABLE_X11@\n  #include \"@QT_QTGUI_INCLUDE_DIR@/QX11Info\"\n  #include \"@QT_QTGUI_INCLUDE_DIR@/QX11EmbedContainer\"\n  #include \"@QT_QTGUI_INCLUDE_DIR@/QX11EmbedWidget\"\n#elif @ENABLE_MAC@\n  #include \"@QT_QTGUI_INCLUDE_DIR@/qmacstyle_mac.h\"\n#endif\n#include \"@QT_QTXML_INCLUDE_DIR@/QtXml\"\n#include \"@QT_QTUITOOLS_INCLUDE_DIR@/QtUiTools\"\n#include \"@QT_QTNETWORK_INCLUDE_DIR@/QtNetwork\"\n#include \"@QT_QTSCRIPT_INCLUDE_DIR@/QtScript\"\n#include \"@QT_QTSCRIPTTOOLS_INCLUDE_DIR@/QtScriptTools\"\n#include \"@QT_QTMULTIMEDIA_INCLUDE_DIR@/QtMultimedia\"\n#include <QtMaemo5/QtMaemo5>\n#include \"@QT_QTDECLARATIVE_INCLUDE_DIR@/QtDeclarative\"\n\n// QT_GUI_LIB must be defined to QSqlRelationalDelegate become visible\n#define QT_GUI_LIB\n#undef Q_DECLARE_INTERFACE\n#include \"@QT_QTSQL_INCLUDE_DIR@/QtSql\"\n#include \"@QT_QTSVG_INCLUDE_DIR@/QtSvg\"\n\n#if @QT_QTXMLPATTERNS_FOUND@\n#  include \"@QT_QTXMLPATTERNS_INCLUDE_DIR@/QtXmlPatterns\"\n#endif\n\n#if @QT_QTWEBKIT_FOUND@\n#  include \"@QT_QTWEBKIT_INCLUDE_DIR@/QtWebKit\"\n#endif\n\n#if @QT_QTTEST_FOUND@\n#  include \"@QT_QTTEST_INCLUDE_DIR@/QtTest\"\n#if @QT_VERSION_MINOR@ > 5\n#  include \"pysideqtesttouch.h\"\n#endif\n#endif\n\n// Phonon\n#include \"phonon/pyside_phonon.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/abstractaudiooutput.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/abstractmediastream.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/abstractvideooutput.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/addoninterface.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/audiooutput.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/audiooutputinterface.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/backendcapabilities.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/backendinterface.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/effect.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/effectinterface.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/effectparameter.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/effectwidget.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/mediacontroller.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/medianode.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/mediaobject.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/mediaobjectinterface.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/mediasource.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/objectdescription.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/objectdescriptionmodel.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/path.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/phonon_export.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/phonondefs.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/phononnamespace.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/platformplugin.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/seekslider.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/streaminterface.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/videoplayer.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/videowidget.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/videowidgetinterface.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/volumefadereffect.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/volumefaderinterface.h\"\n#include \"@QT_PHONON_INCLUDE_DIR@/volumeslider.h\"\n\n//QtHelp need be included after QtSql\n#include \"@QT_QTHELP_INCLUDE_DIR@/QtHelp\"\n\n#ifndef QT_NO_OPENGL\n#include <@GL_H@>\n#include <@QT_QTOPENGL_INCLUDE_DIR@/QtOpenGL>\n#endif // QT_NO_OPENGL\n\n"
  },
  {
    "path": "PySide/licensecomment.txt",
    "content": "/*\n * This file is part of PySide: Python for Qt\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public License\n * version 2.1 as published by the Free Software Foundation.\n *\n * This library is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA\n *\n */\n\n"
  },
  {
    "path": "PySide/phonon/CMakeLists.txt",
    "content": "project(phonon)\n\n# workaround for a cmake bug under MacOSX, it finds phonon but not the include path\nif (NOT QT_PHONON_INCLUDE_DIR AND CMAKE_HOST_APPLE)\n    set(QT_PHONON_INCLUDE_DIR \"${QT_LIBRARY_DIR}/phonon.framework/Headers\")\nendif ()\n\nset(phonon_OPTIONAL_SRC )\nset(phonon_DROPPED_ENTRIES )\ncheck_qt_class(phonon VideoCaptureDevice    phonon_OPTIONAL_SRC phonon_DROPPED_ENTRIES Phonon ObjectDescription)\n\nset(phonon_SRC\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_abstractaudiooutput_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_abstractmediastream_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_abstractvideooutput_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_addoninterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_audiocapturedevice_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_audiochanneldescription_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_audiooutputdevicemodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_audiooutputdevice_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_audiooutput_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_effectdescriptionmodel_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_effectdescription_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_effectinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_effectparameter_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_effectwidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_effect_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_mediacontroller_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_medianode_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_mediaobjectinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_mediaobject_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_mediasource_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_module_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_path_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_platformplugin_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_seekslider_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_streaminterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_subtitledescription_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_videoplayer_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_videowidgetinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_videowidget_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumefadereffect_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumefaderinterface_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_notifierwrapper_wrapper.cpp\n${phonon_OPTIONAL_SRC}\n)\n\nset(phonon_typesystem_path \"${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${phonon_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\")\nset(phonon_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}\n                        ${QT_QTCORE_INCLUDE_DIR}\n                        ${QT_QTGUI_INCLUDE_DIR}\n                        ${QT_PHONON_INCLUDE_DIR}\n                        ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                        ${SHIBOKEN_INCLUDE_DIR}\n                        ${libpyside_SOURCE_DIR}\n                        ${QtGui_BINARY_DIR}/PySide/QtGui/\n                        ${QtCore_BINARY_DIR}/PySide/QtCore/\n                        ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon)\nset(phonon_libraries  pyside\n                      ${SHIBOKEN_PYTHON_LIBRARIES}\n                      ${QT_QTCORE_LIBRARY}\n                      ${QT_QTGUI_LIBRARY}\n                      ${QT_PHONON_LIBRARY})\nset(phonon_deps QtGui)\n\ncreate_pyside_module(phonon\n                     phonon_include_dirs\n                     phonon_libraries\n                     phonon_deps\n                     phonon_typesystem_path\n                     phonon_SRC\n                     \"\"\n                     \"\"\n                     phonon_DROPPED_ENTRIES)\n"
  },
  {
    "path": "PySide/phonon/pyside_phonon.h",
    "content": "#ifndef PYSIDE_PHONON\n#define PYSIDE_PHONON\n\n#include <QObject>\n#include <phonon/backendcapabilities.h>\n\nnamespace Phonon\n{\nnamespace BackendCapabilities\n{\n    class NotifierWrapper : public QObject\n    {\n        public:\n\n            inline static NotifierWrapper* notifier() {\n                Notifier* notifier = BackendCapabilities::notifier();\n\n                if (notifier != m_notifier) {\n                    delete m_instance;\n                    m_instance = new NotifierWrapper(notifier);\n\n                }\n\n                return m_instance;\n            }\n\n            inline const QMetaObject* metaObject() const { return m_notifier->metaObject(); }\n\n        private:\n            static NotifierWrapper* m_instance;\n            static Notifier* m_notifier;\n\n            NotifierWrapper(Notifier* notifier) { m_notifier = notifier; }\n            NotifierWrapper() {}\n    };\n}\n}\n\n#endif\n"
  },
  {
    "path": "PySide/phonon/typesystem_phonon.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide.phonon\">\n    <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\" />\n\n    <rejection class=\"Phonon::ObjectDescriptionData\"/>\n    <rejection class=\"Phonon::ObjectDescriptionModelData\"/>\n    <rejection class=\"Phonon::MediaNodeDestructionHandler\"/>\n    <rejection class=\"Phonon::GlobalConfig\"/>\n    <rejection class=\"Phonon::IODeviceStream\"/>\n    <rejection class=\"Phonon::Factory\"/>\n    <rejection class=\"Phonon::Experimental\"/>\n    <rejection class=\"AudioOutputAdaptor\"/>\n    <rejection class=\"Phonon::BackendCapabilities::Notifier\"/>\n    <rejection class=\"*\" field-name=\"k_ptr\"/>\n    <rejection class=\"*\" field-name=\"k_func\"/>\n\n    <namespace-type name=\"Phonon\">\n        <extra-includes>\n          <include file-name=\"phononnamespace.h\" location=\"global\"/>\n        </extra-includes>\n\n        <namespace-type name=\"BackendCapabilities\" >\n           <inject-code class=\"native\">\n            Phonon::BackendCapabilities::NotifierWrapper* Phonon::BackendCapabilities::NotifierWrapper::m_instance = 0;\n            Phonon::BackendCapabilities::Notifier* Phonon::BackendCapabilities::NotifierWrapper::m_notifier = 0;\n           </inject-code>\n\n           <add-function signature=\"notifier()\" return-type=\"Phonon::BackendCapabilities::NotifierWrapper\">\n              <inject-code class=\"target\">\n                Phonon::BackendCapabilities::NotifierWrapper *_notifierWrapper =  Phonon::BackendCapabilities::NotifierWrapper::notifier();\n                %PYARG_0 = %CONVERTTOPYTHON[Phonon::BackendCapabilities::NotifierWrapper*](_notifierWrapper);\n              </inject-code>\n           </add-function>\n\n            <!-- ### causes moc-related linker error -->\n            <!-- <object-type name=\"Notifier\"/> -->\n            <object-type name=\"NotifierWrapper\" target-lang-name=\"Notifier\">\n              <inject-documentation format=\"target\" mode=\"append\">\n.. class: Notifier\n\n   Notifications about backend capabilities\n\n.. method:: capabilitiesChanged()\n\n    This signal is emitted if the capabilities have changed. This can happen if the user has requested a backend change.\n\n.. method:: availableAudioOutputDevicesChanged()\n\n    This signal is emitted when audio capture devices were plugged or unplugged.\n\n    Check :meth:`PySide.phonon.BackendCapabilities.availableAudioOutputDevices` to get the current list of available devices.\n\n.. method:: availableAudioCaptureDevicesChanged()\n\n    This signal is emitted when audio capture devices were plugged or unplugged.\n\n    Check :meth:`PySide.phonon.BackendCapabilities.availableAudioCaptureDevices` to get the current list of available devices.\n              </inject-documentation>\n                <include file-name=\"backendcapabilities.h\" location=\"global\"/>\n                <include file-name=\"pyside_phonon.h\" location=\"local\"/>\n\n                <!-- ### This isn't part of Qt public API -->\n                <modify-function signature=\"notifier()\" remove=\"all\"/>\n                <modify-function signature=\"Phonon::BackendCapabilities::NotifierWrapper(Phonon::BackendCapabilities::Notifier*)\">\n                  <access modifier=\"private\"/>\n                </modify-function>\n                <!-- ### -->\n              <inject-code class=\"target\" position=\"end\">\n                   PySideSignal* signal_item;\n\n                   signal_item = PySide::Signal::newObject(\"capabilitiesChanged\", \"void\", NULL);\n                   PyDict_SetItemString(Sbk_Phonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, \"capabilitiesChanged\", (PyObject*)signal_item);\n                   Py_DECREF((PyObject*)signal_item);\n\n                   signal_item = PySide::Signal::newObject(\"availableAudioOutputDevicesChanged\", \"void\", NULL);\n                   PyDict_SetItemString( Sbk_Phonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, \"availableAudioOutputDevicesChanged\",  (PyObject*)signal_item);\n                   Py_DECREF((PyObject*)signal_item);\n              </inject-code>\n            </object-type>\n        </namespace-type>\n\n        <enum-type name=\"Category\" />\n        <enum-type name=\"DiscType\"/>\n        <enum-type name=\"ErrorType\"/>\n        <enum-type name=\"MetaData\"/>\n        <enum-type name=\"ObjectDescriptionType\"/>\n        <enum-type name=\"State\"/>\n        <enum-type name=\"CaptureCategory\"/>\n\n        <object-type name=\"AbstractVideoOutput\"/>\n        <object-type name=\"AddonInterface\">\n            <enum-type name=\"AngleCommand\"/>\n            <enum-type name=\"AudioChannelCommand\"/>\n            <enum-type name=\"ChapterCommand\"/>\n            <enum-type name=\"Interface\"/>\n            <enum-type name=\"NavigationCommand\"/>\n            <enum-type name=\"SubtitleCommand\"/>\n            <enum-type name=\"TitleCommand\"/>\n        </object-type>\n        <object-type name=\"BackendInterface\">\n            <enum-type name=\"Class\"/>\n        </object-type>\n        <object-type name=\"EffectInterface\"/>\n        <object-type name=\"MediaNode\"/>\n\n        <object-type name=\"MediaObjectInterface\"/>\n        <object-type name=\"PlatformPlugin\"/>\n        <object-type name=\"StreamInterface\"/>\n        <object-type name=\"VideoWidgetInterface\"/>\n        <object-type name=\"VolumeFaderInterface\"/>\n\n        <value-type name=\"EffectParameter\">\n            <enum-type name=\"Hint\" flags=\"Hints\"/>\n            <!-- ### Internal methods and ctors -->\n            <modify-function signature=\"EffectParameter()\" remove=\"all\"/>\n            <modify-function signature=\"operator&lt;(const Phonon::EffectParameter &amp;)const\" remove=\"all\"/>\n            <modify-function signature=\"operator&gt;(const Phonon::EffectParameter &amp;)const\" remove=\"all\"/>\n            <modify-function signature=\"id()const\" remove=\"all\"/>\n            <modify-function signature=\"operator==(Phonon::EffectParameter)const\" remove=\"all\"/>\n            <!-- ### -->\n        </value-type>\n        <value-type name=\"MediaSource\">\n            <enum-type name=\"Type\"/>\n        </value-type>\n        <value-type name=\"Path\">\n            <modify-function signature=\"disconnect()\" rename=\"disconnectPath\"/>\n            <modify-function signature=\"insertEffect(Phonon::EffectDescription,Phonon::Effect*)\">\n                <modify-argument index=\"1\">\n                    <parent index=\"this\" action=\"add\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"insertEffect(Phonon::Effect*,Phonon::Effect*)\">\n                <modify-argument index=\"1\">\n                    <parent index=\"this\" action=\"add\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"removeEffect(Phonon::Effect*)\">\n                <modify-argument index=\"1\">\n                    <parent index=\"this\" action=\"remove\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"sink() const\">\n                <modify-argument index=\"return\">\n                    <define-ownership class=\"target\" owner=\"default\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"source() const\">\n                <modify-argument index=\"return\">\n                    <define-ownership class=\"target\" owner=\"default\"/>\n                </modify-argument>\n            </modify-function>\n        </value-type>\n        <value-type name=\"ObjectDescription\" generate=\"no\"/>\n        <value-type name=\"EffectDescription\">\n            <modify-function signature=\"operator==(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::EffectDescription\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"operator!=(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::EffectDescription\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"fromIndex(int)\">\n              <modify-argument index=\"return\">\n                <replace-type modified-type=\"EffectDescription\"/>\n              </modify-argument>\n            </modify-function>\n        </value-type>\n        <value-type name=\"AudioOutputDevice\">\n            <modify-function signature=\"operator==(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::AudioOutputDevice\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"operator!=(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::AudioOutputDevice\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"fromIndex(int)\">\n              <modify-argument index=\"return\">\n                <replace-type modified-type=\"AudioOutputDevice\"/>\n              </modify-argument>\n            </modify-function>\n        </value-type>\n       <value-type name=\"AudioCaptureDevice\">\n            <modify-function signature=\"operator==(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::AudioCaptureDevice\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"operator!=(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::AudioCaptureDevice\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"fromIndex(int)\">\n              <modify-argument index=\"return\">\n                <replace-type modified-type=\"AudioCaptureDevice\"/>\n              </modify-argument>\n            </modify-function>\n        </value-type>\n        <value-type name=\"AudioChannelDescription\">\n            <modify-function signature=\"operator==(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::AudioChannelDescription\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"operator!=(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::AudioChannelDescription\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"fromIndex(int)\">\n              <modify-argument index=\"return\">\n                <replace-type modified-type=\"AudioChannelDescription\"/>\n              </modify-argument>\n            </modify-function>\n        </value-type>\n        <value-type name=\"SubtitleDescription\">\n            <modify-function signature=\"operator==(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::SubtitleDescription\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"operator!=(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::SubtitleDescription\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"fromIndex(int)\">\n              <modify-argument index=\"return\">\n                <replace-type modified-type=\"SubtitleDescription\"/>\n              </modify-argument>\n            </modify-function>\n        </value-type>\n        <object-type name=\"ObjectDescriptionModel\" generate=\"no\"/>\n        <object-type name=\"EffectDescriptionModel\" />\n        <object-type name=\"AudioOutputDeviceModel\" />\n\n        <object-type name=\"AbstractAudioOutput\"/>\n        <object-type name=\"AbstractMediaStream\"/>\n        <object-type name=\"AudioOutput\"/>\n        <object-type name=\"Effect\"/>\n        <object-type name=\"EffectWidget\"/>\n        <object-type name=\"MediaController\">\n            <enum-type name=\"Feature\" flags=\"Features\"/>\n            <enum-type name=\"NavigationMenu\"/>\n        </object-type>\n        <object-type name=\"MediaObject\" />\n        <object-type name=\"SeekSlider\">\n            <modify-function signature=\"setMediaObject(Phonon::MediaObject*)\">\n                <modify-argument index=\"1\">\n                    <parent index=\"this\" action=\"add\"/>\n                </modify-argument>\n            </modify-function>\n        </object-type>\n        <object-type name=\"VideoPlayer\"/>\n        <object-type name=\"VideoWidget\">\n            <enum-type name=\"AspectRatio\"/>\n            <enum-type name=\"ScaleMode\"/>\n        </object-type>\n        <object-type name=\"VolumeFaderEffect\">\n            <enum-type name=\"FadeCurve\"/>\n        </object-type>\n        <object-type name=\"VolumeSlider\">\n            <modify-function signature=\"setAudioOutput(Phonon::AudioOutput*)\">\n                <modify-argument index=\"1\">\n                    <parent index=\"this\" action=\"add\"/>\n                </modify-argument>\n            </modify-function>\n        </object-type>\n\n        <!-- ### The following entries may be present in the system or not. Keep this section organized. -->\n        <value-type name=\"VideoCaptureDevice\">\n            <modify-function signature=\"operator==(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::VideoCaptureDevice\" />\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"operator!=(Phonon::ObjectDescription)const\">\n                <modify-argument index=\"1\">\n                    <replace-type modified-type=\"Phonon::VideoCaptureDevice\"/>\n                </modify-argument>\n            </modify-function>\n            <modify-function signature=\"fromIndex(int)\">\n              <modify-argument index=\"return\">\n                <replace-type modified-type=\"VideoCaptureDevice\"/>\n              </modify-argument>\n            </modify-function>\n        </value-type>\n        <!-- ### -->\n    </namespace-type>\n</typesystem>\n"
  },
  {
    "path": "PySide/pysideqtesttouch.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the QtTest module of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef PYSIDEQTESTTOUCH_H\n#define PYSIDEQTESTTOUCH_H\n\n#include <QtTest/qtest_global.h>\n#include <QtTest/qtestassert.h>\n#include <QtTest/qtestsystem.h>\n#include <QtTest/qtestspontaneevent.h>\n#include <QtTest/qtesttouch.h>\n\n#include <QtCore/qmap.h>\n#include <QtGui/qevent.h>\n#include <QtGui/qwidget.h>\n\nQT_BEGIN_NAMESPACE\n\nnamespace QTest\n{\n\n    class PySideQTouchEventSequence\n    {\n    public:\n        ~PySideQTouchEventSequence()\n        {\n            commit();\n        }\n\n        PySideQTouchEventSequence* press(int touchId, const QPoint &pt, QWidget *widget = 0)\n        {\n            QTouchEvent::TouchPoint &p = point(touchId);\n            p.setScreenPos(mapToScreen(widget, pt));\n            p.setState(Qt::TouchPointPressed);\n            return this;\n        }\n\n        PySideQTouchEventSequence* move(int touchId, const QPoint &pt, QWidget *widget = 0)\n        {\n            QTouchEvent::TouchPoint &p = point(touchId);\n            p.setScreenPos(mapToScreen(widget, pt));\n            p.setState(Qt::TouchPointMoved);\n            return this;\n        }\n\n        PySideQTouchEventSequence* release(int touchId, const QPoint &pt, QWidget *widget = 0)\n        {\n            QTouchEvent::TouchPoint &p = point(touchId);\n            p.setScreenPos(mapToScreen(widget, pt));\n            p.setState(Qt::TouchPointReleased);\n            return this;\n        }\n\n        PySideQTouchEventSequence* stationary(int touchId)\n        {\n            QTouchEvent::TouchPoint &p = point(touchId);\n            p.setState(Qt::TouchPointStationary);\n            return this;\n        }\n\n        void commit()\n        {\n            qt_translateRawTouchEvent(targetWidget, deviceType, points.values());\n            targetWidget = 0;\n            points.clear();\n        }\n\n    private:\n        PySideQTouchEventSequence(QWidget *widget, QTouchEvent::DeviceType aDeviceType)\n            : targetWidget(widget), deviceType(aDeviceType)\n        {\n        }\n\n        PySideQTouchEventSequence(const PySideQTouchEventSequence &v);\n\n        void operator=(const PySideQTouchEventSequence&);\n\n        QTouchEvent::TouchPoint &point(int touchId)\n        {\n            if (!points.contains(touchId))\n                points[touchId] = QTouchEvent::TouchPoint(touchId);\n            return points[touchId];\n        }\n\n        QPoint mapToScreen(QWidget *widget, const QPoint &pt)\n        {\n            if (widget)\n                return widget->mapToGlobal(pt);\n            return targetWidget ? targetWidget->mapToGlobal(pt) : pt;\n        }\n\n        QMap<int, QTouchEvent::TouchPoint> points;\n        QWidget *targetWidget;\n        QTouchEvent::DeviceType deviceType;\n        friend PySideQTouchEventSequence* generateTouchEvent(QWidget *, QTouchEvent::DeviceType);\n    };\n\n    inline\n    PySideQTouchEventSequence* generateTouchEvent(QWidget *widget = 0,\n                                                  QTouchEvent::DeviceType deviceType = QTouchEvent::TouchScreen)\n    {\n        return new PySideQTouchEventSequence(widget, deviceType);\n    }\n\n}\n\nQT_END_NAMESPACE\n\n#endif // PYSIDEQTESTTOUCH_H\n"
  },
  {
    "path": "PySide/pysidewtypes.h",
    "content": "#ifndef __PYSIDEWTYPES__\n#define __PYSIDEWTYPES__\n\ntypedef struct HWND__ *HWND;\ntypedef unsigned UINT;\ntypedef long LONG;\ntypedef unsigned long DWORD;\ntypedef UINT WPARAM;\ntypedef LONG LPARAM;\n\nstruct POINT\n{\n    LONG x;\n    LONG y;\n};\n\nstruct MSG\n{\n    HWND hwnd;\n    UINT message;\n    WPARAM wParam;\n    LPARAM lParam;\n    DWORD time;\n    POINT pt;\n};\n\n#endif\n"
  },
  {
    "path": "PySide/qpytextobject.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"qpytextobject.h\"\n\n/*!\n    \\class QPyTextObject\n    \\brief Workaround to make possible use QTextObjectInterface on PySide.\n    \\ingroup richtext-processing\n    Due to the technical details of how to bind C++ classes to Python, you need to use this class when you need to implement\n    your own QTextObjectInterface rather than create a class inheriting from QObject and QTextObjectInterface.\n\n    \\sa QTextObjectInterface\n*/\n"
  },
  {
    "path": "PySide/qpytextobject.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef QPYTEXTOBJECT\n#define QPYTEXTOBJECT\n\n#include <QObject>\n#include <QTextObjectInterface>\n\nclass QPyTextObject : public QObject, public QTextObjectInterface\n{\n    Q_OBJECT\n    Q_INTERFACES(QTextObjectInterface)\npublic:\n    QPyTextObject(QObject* parent = 0) : QObject(parent) {}\n    void drawObject(QPainter* painter, const QRectF& rect, QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0;\n    QSizeF intrinsicSize(QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0;\n};\n#endif\n\n\n"
  },
  {
    "path": "PySide/typesystem_templates.xml",
    "content": "<?xml version=\"1.0\"?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem>\n    <template name=\"replace_child\">\n        $CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD();\n        if (oldChild &amp;&amp; (oldChild != $CPPARG)) {\n            Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[$CHILD_TYPE*](oldChild));\n            Shiboken::Object::setParent(0, pyChild);\n            Shiboken::Object::releaseOwnership(pyChild);\n        }\n        Shiboken::Object::setParent(%PYSELF, $PYARG);\n    </template>\n\n    <!-- Templates to fix bool* parameters -->\n    <template name=\"tuple_retval_ok\">\n    %PYARG_0 = PyTuple_New(2);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[bool](ok_));\n    </template>\n    <template name=\"fix_bool*\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_args,bool*\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;ok_);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_arg,bool*,arg\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, &amp;ok_, %3);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_bool*,arg\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_bool*,arg,arg\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_bool*,arg,arg,arg\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3, %4);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_bool*,arg,arg,arg,arg\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;ok_, %2, %3, %4, %5);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, &amp;ok_, %9);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_arg,arg,arg,arg,arg,arg,bool*,arg\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, &amp;ok_, %8);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"fix_arg,arg,arg,arg,arg,bool*,arg\">\n        bool ok_;\n        %BEGIN_ALLOW_THREADS\n        %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, &amp;ok_, %7);\n        %END_ALLOW_THREADS\n        <insert-template name=\"tuple_retval_ok\"/>\n    </template>\n    <template name=\"get_slice\">\n        %TYPE* sequence;\n        Py_ssize_t start, end;\n        Py_ssize_t len = %CPPSELF->count();\n\n        if (_i1 &gt; len)\n            start = len;\n        else if (_i1 &lt; 0)\n            start = 0;\n        else\n            start = _i1;\n\n        if (_i2 &gt; len)\n            end = len;\n        else if (_i2 &lt; 0)\n           end = 0;\n        else\n           end = _i2;\n\n        sequence = new %TYPE();\n        for (Py_ssize_t i = start; i &lt; end; i++)\n            sequence->append(%CPPSELF->at(i));\n\n        return %CONVERTTOPYTHON[%TYPE](*sequence);\n    </template>\n\n    <template name=\"fix_args,QRectF*\">\n        QRectF rect_;\n        %BEGIN_ALLOW_THREADS\n        %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;rect_);\n        %END_ALLOW_THREADS\n        %PYARG_0 = %CONVERTTOPYTHON[QRectF](rect_);\n    </template>\n\n    <template name=\"fix_args,QRect*\">\n        QRect rect_;\n        %BEGIN_ALLOW_THREADS\n        %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;rect_);\n        %END_ALLOW_THREADS\n        %PYARG_0 = %CONVERTTOPYTHON[QRect](rect_);\n    </template>\n\n    <template name=\"fix_char*\">\n    char val_;\n    %BEGIN_ALLOW_THREADS\n    %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&amp;val_);\n    %END_ALLOW_THREADS\n    %PYARG_0 = PyTuple_New(2);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[char](val_));\n    </template>\n\n    <template name=\"tuple_abcd_same_type\">\n    %PYARG_0 = PyTuple_New(4);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));\n    PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[$TYPE](c));\n    PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[$TYPE](d));\n    </template>\n    <template name=\"fix_number*,number*,number*,number*\">\n    $TYPE a, b, c, d;\n    %BEGIN_ALLOW_THREADS\n    %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d);\n    %END_ALLOW_THREADS\n    <insert-template name=\"tuple_abcd_same_type\"/>\n    </template>\n    <template name=\"fix_number*,number*,number*,number*,args\">\n    $TYPE a, b, c, d;\n    %BEGIN_ALLOW_THREADS\n    %CPPSELF->::%TYPE::%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, %ARGUMENT_NAMES);\n    %END_ALLOW_THREADS\n    <insert-template name=\"tuple_abcd_same_type\"/>\n    </template>\n\n    <template name=\"fix_native_return_number*,number*,number*,number*\">\n        PyObject* _obj = %PYARG_0.object();\n        if (!PySequence_Check(_obj)\n            || PySequence_Fast_GET_SIZE(_obj) != 4\n            || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 0))\n            || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 1))\n            || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 2))\n            || !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 3))) {\n            PyErr_SetString(PyExc_TypeError, \"Sequence of 4 numbers expected\");\n        } else {\n            *%1 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 0));\n            *%2 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 1));\n            *%3 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 2));\n            *%4 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 3));\n        }\n    </template>\n\n    <template name=\"fix_number*,number*,number*,number*,number*\">\n    $TYPE a, b, c, d, e;\n    %BEGIN_ALLOW_THREADS\n    %CPPSELF.%FUNCTION_NAME(&amp;a, &amp;b, &amp;c, &amp;d, &amp;e);\n    %END_ALLOW_THREADS\n    %PYARG_0 = PyTuple_New(5);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));\n    PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[$TYPE](c));\n    PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[$TYPE](d));\n    PyTuple_SET_ITEM(%PYARG_0, 4, %CONVERTTOPYTHON[$TYPE](e));\n    </template>\n\n    <template name=\"read_wrapper\">\n        Shiboken::AutoArrayPointer&lt;char&gt; _data(%2);\n        qint64 _size = %CPPSELF.%FUNCTION_NAME(_data, %2);\n        QByteArray ba;\n        if (_size > 0)\n            ba = QByteArray(_data, _size);\n        %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);\n    </template>\n\n    <template name=\"fix_args,number*,number*\">\n    $TYPE a, b;\n    %BEGIN_ALLOW_THREADS\n    %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &amp;a, &amp;b);\n    %END_ALLOW_THREADS\n    %PYARG_0 = PyTuple_New(2);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[$TYPE](a));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[$TYPE](b));\n    </template>\n\n    <template name=\"fix_virtual_method_return_value_and_bool*\">\n        Shiboken::AutoDecRef _py_ret_(PySequence_GetItem(%PYARG_0, 0));\n        Shiboken::AutoDecRef _py_ok_(PySequence_GetItem(%PYARG_0, 1));\n        %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](_py_ret_);\n        *%2 = %CONVERTTOCPP[bool](_py_ok_);\n    </template>\n\n    <template name=\"fix_arg,int*,int*\">\n    %RETURN_TYPE _ret;\n    int a, b;\n    %BEGIN_ALLOW_THREADS\n    _ret = %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b);\n    %END_ALLOW_THREADS\n    %PYARG_0 = PyTuple_New(3);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](_ret));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](a));\n    PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](b));\n    </template>\n\n    <template name=\"return_QString\">\n        %PYARG_0 = %CONVERTTOPYTHON[QString](%1);\n    </template>\n\n    <template name=\"return_tuple_QValidator_QString_int\">\n    %BEGIN_ALLOW_THREADS\n    %RETURN_TYPE retval_ = %RETURN_TYPE(%CPPSELF.%FUNCTION_NAME(%1, %2));\n    %END_ALLOW_THREADS\n    %PYARG_0 = PyTuple_New(3);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));\n    PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[%ARG2_TYPE](%2));\n    </template>\n\n    <template name=\"return_for_QFileDialog\">\n    %BEGIN_ALLOW_THREADS\n    %RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, &amp;%5, %6);\n    %END_ALLOW_THREADS\n    %PYARG_0 = PyTuple_New(2);\n    PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));\n    PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG5_TYPE](%5));\n    </template>\n    <template name=\"set_qapp_parent_for_orphan\">\n        if (%PYARG_0 &amp;&amp; (%PYARG_0 != Py_None)) {\n            SbkObject* _pySelf = reinterpret_cast&lt;SbkObject*&gt;(%PYARG_0);\n            if (!Shiboken::Object::hasParentInfo(_pySelf))\n                Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);\n        }\n    </template>\n    <!-- templates for __repr__ -->\n    <template name=\"repr_code\">\n        QString format = QString().sprintf(\"%s(%REPR_FORMAT)\", ((PyObject*)%PYSELF)->ob_type->tp_name, %REPR_ARGS);\n        %PYARG_0 = Shiboken::String::fromCString(qPrintable(format));\n    </template>\n    <template name=\"repr_code_matrix\">\n        QString format= QString(\"%1((\").arg(((PyObject*)%PYSELF)->ob_type->tp_name);\n\n        QList&lt; %MATRIX_TYPE &gt; cppArgs;\n        %MATRIX_TYPE data[%MATRIX_SIZE];\n        %CPPSELF.copyDataTo(data);\n        int matrixSize = %MATRIX_SIZE;\n        for(int size=0; size &lt; matrixSize; size++) {\n            if (size > 0)\n                format += \", \";\n            format += QString::number(data[size]);\n        }\n        format += \"))\";\n\n        %PYARG_0 = Shiboken::String::fromCString(qPrintable(format));\n    </template>\n\n    <template name=\"return_internal_pointer\">\n        %PYARG_0 = reinterpret_cast&lt;PyObject*>(%CPPSELF.%FUNCTION_NAME());\n        if (!%PYARG_0)\n            %PYARG_0 = Py_None;\n        Py_INCREF(%PYARG_0);\n    </template>\n\n    <!-- templates for __reduce__ -->\n    <template name=\"reduce_code\">\n        %PYARG_0 = Py_BuildValue(\"(N(%REDUCE_FORMAT))\", PyObject_Type(%PYSELF), %REDUCE_ARGS);\n    </template>\n    <template name=\"reduce_code_matrix\">\n        QList&lt; %MATRIX_TYPE &gt; cppArgs;\n        %MATRIX_TYPE data[%MATRIX_SIZE];\n        %CPPSELF.copyDataTo(data);\n        int matrixSize = %MATRIX_SIZE;\n        for(int size=0; size &lt; matrixSize; size++)\n            cppArgs.append(data[size]);\n\n        PyObject *type = PyObject_Type(%PYSELF);\n        PyObject *args = Py_BuildValue(\"(N)\", %CONVERTTOPYTHON[QList&lt;%MATRIX_TYPE&gt; ](cppArgs));\n        %PYARG_0 = Py_BuildValue(\"(NN)\", type, args);\n    </template>\n\n    <!-- Matrix Aux functions -->\n    <template name=\"matrix_constructor\">\n        if (PySequence_Size(%PYARG_1) == %SIZE) {\n            Shiboken::AutoDecRef fast(PySequence_Fast(%PYARG_1, \"Failed to parse sequence on %TYPE constructor.\"));\n            qreal values[%SIZE];\n            for(int i=0; i &lt; %SIZE; i++) {\n                PyObject *pv = PySequence_Fast_GET_ITEM(fast.object(), i);\n                values[i] = %CONVERTTOCPP[qreal](pv);\n            }\n            %0 = new %TYPE(values);\n        }\n    </template>\n\n    <template name=\"matrix_data_function\">\n        const qreal* data = %CPPSELF.constData();\n        PyObject *pyData = PyTuple_New(%MATRIX_SIZE);\n        if (data) {\n            for(int i=0; i &lt; %MATRIX_SIZE; i++)\n                PyTuple_SET_ITEM(pyData, i, %CONVERTTOPYTHON[qreal](data[i]));\n        }\n        return pyData;\n    </template>\n\n    <template name=\"matrix_fill_function\">\n        qreal value = %CONVERTTOCPP[qreal](%PYARG_1);\n        %CPPSELF.fill(value);\n    </template>\n\n    <template name=\"matrix_transposed_function\">\n        %TRANSPOSED_TYPE transp = %CPPSELF.transposed();\n        return %CONVERTTOPYTHON[%TRANSPOSED_TYPE](transp);\n    </template>\n\n    <!-- Replace '#' for the argument number you want. -->\n    <template name=\"return_argument\">\n        Py_INCREF(%PYARG_#);\n        %PYARG_0 = %PYARG_#;\n    </template>\n\n    <!-- Iterator -->\n    <template name=\"__iter__\">\n        Py_INCREF(%PYSELF);\n        %PYARG_0 = %PYSELF;\n    </template>\n\n    <template name=\"__iter_parent__\">\n        %CPPSELF_TYPE _tmp = %CPPSELF.begin();\n        %PYARG_0 = %CONVERTTOPYTHON[%CPPSELF_TYPE](_tmp);\n    </template>\n\n    <template name=\"__next__\">\n        if (!%CPPSELF.atEnd()) {\n            %PYARG_0 = %CONVERTTOPYTHON[%CPPSELF_TYPE](*%CPPSELF);\n            ++(*%CPPSELF);\n        }\n    </template>\n\n    <template name=\"convertFromMultiMap\">\n        %RETURN_NAME = PyDict_New();\n        foreach(%KEY_TYPE _key, %MAP_NAME.keys()) {\n            Shiboken::AutoDecRef _pyValueList(PyList_New(0));\n            foreach(%VALUE_TYPE _value, %MAP_NAME.values(_key)) {\n                Shiboken::AutoDecRef _pyValue(%CONVERTTOPYTHON[%VALUE_TYPE](_value));\n                PyList_Append(_pyValueList, _pyValue);\n            }\n\n            Shiboken::AutoDecRef _pyKey(%CONVERTTOPYTHON[%KEY_TYPE](_key));\n            PyDict_SetItem(%RETURN_NAME, _pyKey, _pyValueList);\n        }\n    </template>\n\n    <template name=\"to_tuple\">\n        %PYARG_0 = Py_BuildValue(\"%TT_FORMAT\", %TT_ARGS);\n    </template>\n\n    <template name=\"cpplist_to_pylist_conversion\">\n    PyObject* %out = PyList_New((int) %in.size());\n    %INTYPE::const_iterator it = %in.begin();\n    for (int idx = 0; it != %in.end(); ++it, ++idx) {\n        %INTYPE_0 cppItem(*it);\n        PyList_SET_ITEM(%out, idx, %CONVERTTOPYTHON[%INTYPE_0](cppItem));\n    }\n    return %out;\n    </template>\n    <template name=\"pyseq_to_cpplist_conversion\">\n    for (int i = 0; i &lt; PySequence_Size(%in); i++) {\n        Shiboken::AutoDecRef pyItem(PySequence_GetItem(%in, i));\n        %OUTTYPE_0 cppItem = %CONVERTTOCPP[%OUTTYPE_0](pyItem);\n        %out &lt;&lt; cppItem;\n    }\n    </template>\n    <template name=\"cppvector_to_pylist_conversion\">\n    %INTYPE::size_type vectorSize = %in.size();\n    PyObject* %out = PyList_New((int) vectorSize);\n    for (%INTYPE::size_type idx = 0; idx &lt; vectorSize; ++idx) {\n        %INTYPE_0 cppItem(%in[idx]);\n        PyList_SET_ITEM(%out, idx, %CONVERTTOPYTHON[%INTYPE_0](cppItem));\n    }\n    return %out;\n    </template>\n    <template name=\"pyseq_to_cppvector_conversion\">\n    int vectorSize = PySequence_Size(%in);\n    %out.reserve(vectorSize);\n    for (int idx = 0; idx &lt; vectorSize; ++idx) {\n        Shiboken::AutoDecRef pyItem(PySequence_GetItem(%in, idx));\n        %OUTTYPE_0 cppItem = %CONVERTTOCPP[%OUTTYPE_0](pyItem);\n        %out.push_back(cppItem);\n    }\n    </template>\n\n    <template name=\"checkPyCapsuleOrPyCObject_func\">\n    static bool checkPyCapsuleOrPyCObject(PyObject* pyObj)\n    {\n        #ifdef IS_PY3K\n        return PyCapsule_CheckExact(pyObj);\n        #else\n        return PyCObject_Check(pyObj);\n        #endif\n    }\n    </template>\n\n</typesystem>\n"
  },
  {
    "path": "cmake/Macros/FindQt4Extra.cmake",
    "content": "#\n# Try to find QtMultimedia\n# TODO: Remove this hack when cmake support QtMultimedia module\nif (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)\n    find_path(QT_QTMULTIMEDIA_INCLUDE_DIR QtMultimedia\n            PATHS ${QT_HEADERS_DIR}/QtMultimedia\n                ${QT_LIBRARY_DIR}/QtMultimedia.framework/Headers\n            NO_DEFAULT_PATH)\n    find_library(QT_QTMULTIMEDIA_LIBRARY QtMultimedia PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)\n    if (QT_QTMULTIMEDIA_INCLUDE_DIR AND QT_QTMULTIMEDIA_LIBRARY)\n        set(QT_QTMULTIMEDIA_FOUND ON)\n    else()\n        #Replace this on documentation\n        set(if_QtMultimedia \"<!--\")\n        set(end_QtMultimedia \"-->\")\n    endif()\nendif ()\n\n# Try to find QtMaemo5 - it has to be done before QtGui to enable some QtMaemo5 flags\n# TODO: Remove this hack when cmake support QtMaemo5 module\nif (NOT QT_QTMAEMO5_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)\n    find_path(QT_QTMAEMO5_INCLUDE_DIR QtMaemo5\n            PATHS ${QT_HEADERS_DIR}/QtMaemo5\n                ${QT_LIBRARY_DIR}/QtMaemo5.framework/Headers\n            NO_DEFAULT_PATH)\n    find_library(QT_QTMAEMO5_LIBRARY QtMaemo5 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)\n    if (QT_QTMAEMO5_INCLUDE_DIR AND QT_QTMAEMO5_LIBRARY)\n        set(QT_QTMAEMO5_FOUND ON)\n        set(Q_WS_MAEMO_5 ON)\n    else()\n        #Replace this on documentation\n        set(if_Maemo5 \"<!--\")\n        set(end_Maemo5 \"-->\")\n    endif()\nendif ()\n\n# Try to find QtDeclarative\n# TODO: Remove this hack when cmake support QtDeclarative module\nif (NOT QT_QTDECLARATIVE_FOUND AND ${QTVERSION} VERSION_GREATER 4.6.0)\n    find_path(QT_QTDECLARATIVE_INCLUDE_DIR QtDeclarative\n            PATHS ${QT_HEADERS_DIR}/QtDeclarative\n                ${QT_LIBRARY_DIR}/QtDeclarative.framework/Headers\n            NO_DEFAULT_PATH)\n    find_library(QT_QTDECLARATIVE_LIBRARY QtDeclarative PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)\n    if (QT_QTDECLARATIVE_INCLUDE_DIR AND QT_QTDECLARATIVE_LIBRARY)\n        set(QT_QTDECLARATIVE_FOUND ON)\n    else()\n        #Replace this on documentation\n        set(if_QtDeclarative \"<!--\")\n        set(end_QtDeclarative \"-->\")\n    endif()\nendif ()\n\n\n"
  },
  {
    "path": "cmake/Macros/PySideModules.cmake",
    "content": "macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources module_static_sources)\n    string(TOLOWER ${module_name} _module)\n    string(REGEX REPLACE ^qt \"\" _module ${_module})\n\n    if(${ARGC} GREATER 7)\n        set (typesystem_name ${ARGV7})\n    else()\n        set (typesystem_name \"\")\n    endif()\n    if(${ARGC} GREATER 8)\n        string(REPLACE \";\" \"\\\\;\" dropped_entries \"${${ARGV8}}\")\n    else()\n        set (dropped_entries \"\")\n    endif()\n\n    if (NOT EXISTS ${typesystem_name})\n        set(typesystem_path ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${_module}.xml)\n    else()\n        set(typesystem_path ${typesystem_name})\n    endif()\n\n    add_custom_command(OUTPUT ${${module_sources}}\n                        COMMAND ${SHIBOKEN_BINARY} ${GENERATOR_EXTRA_FLAGS}\n                        ${pyside_BINARY_DIR}/pyside_global.h\n                        --include-paths=${pyside_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}\n                        --typesystem-paths=${pyside_SOURCE_DIR}${PATH_SEP}${${module_typesystem_path}}\n                        --output-directory=${CMAKE_CURRENT_BINARY_DIR}\n                        --license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt\n                        ${typesystem_path}\n                        --api-version=${SUPPORTED_QT_VERSION}\n                        --drop-type-entries=\"${dropped_entries}\"\n                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}\n                        COMMENT \"Running generator for ${module_name}...\")\n\n    include_directories(${module_name} ${${module_include_dir}} ${pyside_SOURCE_DIR})\n    add_library(${module_name} MODULE ${${module_sources}} ${${module_static_sources}})\n    set_target_properties(${module_name} PROPERTIES PREFIX \"\" LIBRARY_OUTPUT_DIRECTORY ${pyside_BINARY_DIR})\n    if(WIN32)\n        set_target_properties(${module_name} PROPERTIES SUFFIX \".pyd\")\n        set(${module_name}_suffix \".pyd\")\n    else()\n        set(${module_name}_suffix ${CMAKE_SHARED_MODULE_SUFFIX})\n    endif()\n    target_link_libraries(${module_name} ${${module_libraries}})\n    if(${module_deps})\n        add_dependencies(${module_name} ${${module_deps}})\n    endif()\n\n\n    # install\n    install(TARGETS ${module_name} LIBRARY DESTINATION ${SITE_PACKAGE}/PySide)\n    string(TOLOWER ${module_name} lower_module_name)\n    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h\n            DESTINATION include/PySide${pyside_SUFFIX}/${module_name}/)\n    file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml ${typesystem_path})\n    install(FILES ${typesystem_files} DESTINATION share/PySide${pyside_SUFFIX}/typesystems)\nendmacro()\n\n#macro(check_qt_class_with_namespace module namespace class optional_source_files dropped_entries [namespace] [module])\nmacro(check_qt_class module class optional_source_files dropped_entries)\n    if (${ARGC} GREATER 4)\n        set (namespace ${ARGV4})\n        string(TOLOWER ${namespace} _namespace)\n    else ()\n        set (namespace \"\")\n    endif ()\n    if (${ARGC} GREATER 5)\n        set (include_file ${ARGV5})\n    else ()\n        set (include_file ${class})\n    endif ()\n    string(TOLOWER ${class} _class)\n    string(TOUPPER ${module} _module)\n    if (_namespace)\n        set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module}/${_namespace}_${_class}_wrapper.cpp)\n    else ()\n        set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module}/${_class}_wrapper.cpp)\n    endif ()\n    if (DEFINED PYSIDE_${class})\n        if (PYSIDE_${class})\n            list(APPEND ${optional_source_files} ${_cppfile})\n        else()\n            list(APPEND ${dropped_entries} PySide.${module}.${class})\n        endif()\n    else()\n        if (NOT ${namespace} STREQUAL \"\" )\n            set (NAMESPACE_USE \"using namespace ${namespace};\")\n        else ()\n            set (NAMESPACE_USE \"\")\n        endif ()\n        set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test${class}.cxx)\n        file(WRITE ${SRC_FILE}\n             \"#include <${include_file}>\\n\"\n             \"${NAMESPACE_USE}\\n\"\n             \"int main() { sizeof(${class}); }\\n\"\n        )\n        try_compile(Q_WORKS ${CMAKE_BINARY_DIR}\n                    ${SRC_FILE}\n                    CMAKE_FLAGS\n                        \"-DLINK_LIBRARIES=${QT_${_module}_LIBRARY}\"\n                        \"-DLINK_DIRECTORIES=${QT_LIBRARY_DIR}\"\n                        \"-DINCLUDE_DIRECTORIES=${QT_INCLUDE_DIR};${QT_${_module}_INCLUDE_DIR}\"\n                    OUTPUT_VARIABLE OUTPUT)\n        file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCheckQtClassTest.log ${OUTPUT})\n\n        set(\"PYSIDE_${class}\" ${Q_WORKS} CACHE STRING \"Has ${class} class been found?\")\n        if(Q_WORKS)\n            message(STATUS \"Checking for ${class} in ${module} -- found\")\n            list(APPEND ${optional_source_files} ${_cppfile})\n        else()\n            message(STATUS \"Checking for ${class} in ${module} -- not found\")\n            list(APPEND ${dropped_entries} PySide.${module}.${class})\n        endif()\n    endif()\nendmacro()\n\n\n# Only add subdirectory if the associated Qt module is found.\nmacro(HAS_QT_MODULE var name)\n    if (NOT DISABLE_${name} AND ${var})\n        add_subdirectory(${name})\n    else()\n        # Used on documentation to skip modules\n        set(\"if_${name}\" \"<!--\" PARENT_SCOPE)\n        set(\"end_${name}\" \"-->\" PARENT_SCOPE)\n    endif()\nendmacro()\n"
  },
  {
    "path": "cmake/Macros/icecc.cmake",
    "content": "include (CMakeForceCompiler)\noption(ENABLE_ICECC \"Enable icecc checking, for distributed compilation\")\nif (ENABLE_ICECC)\n    find_program(ICECC icecc)\n    if (ICECC)\n        message(STATUS \"icecc found! Distributed compilation for all!! huhuhu.\")\n        cmake_force_cxx_compiler(${ICECC} icecc)\n    else(ICECC)\n        message(FATAL_ERROR \"icecc NOT found! re-run cmake without -DENABLE_ICECC\")\n    endif(ICECC)\nendif(ENABLE_ICECC)\n"
  },
  {
    "path": "cmake_uninstall.cmake",
    "content": "IF(NOT EXISTS \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\")\n  MESSAGE(FATAL_ERROR \"Cannot find install manifest: \\\"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\\\"\")\nENDIF(NOT EXISTS \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\")\n\nFILE(READ \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\" files)\nSTRING(REGEX REPLACE \"\\n\" \";\" files \"${files}\")\nFOREACH(file ${files})\n  MESSAGE(STATUS \"Uninstalling \\\"$ENV{DESTDIR}${file}\\\"\")\n  IF(EXISTS \"$ENV{DESTDIR}${file}\")\n    EXEC_PROGRAM(\n      \"@CMAKE_COMMAND@\" ARGS \"-E remove \\\"$ENV{DESTDIR}${file}\\\"\"\n      OUTPUT_VARIABLE rm_out\n      RETURN_VALUE rm_retval\n      )\n    IF(NOT \"${rm_retval}\" STREQUAL 0)\n      MESSAGE(FATAL_ERROR \"Problem when removing \\\"$ENV{DESTDIR}${file}\\\"\")\n    ENDIF(NOT \"${rm_retval}\" STREQUAL 0)\n  ELSE(EXISTS \"$ENV{DESTDIR}${file}\")\n    MESSAGE(STATUS \"File \\\"$ENV{DESTDIR}${file}\\\" does not exist.\")\n  ENDIF(EXISTS \"$ENV{DESTDIR}${file}\")\nENDFOREACH(file)\n"
  },
  {
    "path": "doc/CMakeLists.txt",
    "content": "project(doc)\n\nset(DOC_DATA_DIR \"${CMAKE_CURRENT_BINARY_DIR}/qdoc3-output\")\nconfigure_file(\"pyside.qdocconf.in\" \"pyside.qdocconf\" @ONLY)\n\nadd_custom_target(qdoc3\n                COMMAND qdoc3 pyside.qdocconf\n                COMMENT \"Running qdoc3 against Qt source code...\"\n                SOURCE \"pyside.qdocconf\")\n\n\nfind_program(SPHINX_BUILD NAMES sphinx-build)\nif (${SPHINX_BUILD} MATCHES \"SPHINX_BUILD-NOTFOUND\")\n    message(FATAL_ERROR \"sphinx-build command not found.\")\nendif()\nadd_custom_target(apidoc\n                  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/rst\n                  COMMAND ${SHIBOKEN_PYTHON_INTERPRETER} ${SPHINX_BUILD} -b html  ${CMAKE_CURRENT_BINARY_DIR}/rst html\n                 )\n\n# create conf.py based on conf.py.in\nconfigure_file(\"conf.py.in\" \"rst/conf.py\" @ONLY)\nconfigure_file(typesystem_doc.xml.in typesystem_doc.xml @ONLY)\n\nadd_custom_target(\"docrsts\"\n    COMMAND ${SHIBOKEN_BINARY} --generator-set=qtdoc\n            ${pyside_BINARY_DIR}/pyside_global.h\n            --include-paths=\"${QT_INCLUDE_DIR}${PATH_SEP}${pyside_SOURCE_DIR}\"\n            --api-version=${SUPPORTED_QT_VERSION}\n            --typesystem-paths=\"${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}${PATH_SEP}${QtDeclarative_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}${PATH_SEP}${QtHelp_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}${PATH_SEP}${QtMultimedia_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtOpenGL_SOURCE_DIR}${PATH_SEP}${QtScript_SOURCE_DIR}${PATH_SEP}${QtScriptTools_SOURCE_DIR}${PATH_SEP}${QtSql_SOURCE_DIR}${PATH_SEP}${QtSvg_SOURCE_DIR}${PATH_SEP}${QtTest_SOURCE_DIR}${PATH_SEP}${QtUiTools_SOURCE_DIR}${PATH_SEP}${QtWebKit_SOURCE_DIR}${PATH_SEP}${QtXml_SOURCE_DIR}${PATH_SEP}${QtXmlPatterns_SOURCE_DIR}${PATH_SEP}${phonon_SOURCE_DIR}\"\n            --library-source-dir=${QT_SRC_DIR}\n            --documentation-only\n            --documentation-data-dir=${DOC_DATA_DIR}\n            --output-directory=${CMAKE_CURRENT_BINARY_DIR}/rst\n            --documentation-code-snippets-dir=${CMAKE_CURRENT_SOURCE_DIR}/codesnippets${PATH_SEP}${CMAKE_CURRENT_SOURCE_DIR}/codesnippets/examples\n            --documentation-extra-sections-dir=${CMAKE_CURRENT_SOURCE_DIR}/extras\n            ${CMAKE_CURRENT_BINARY_DIR}/typesystem_doc.xml\n    WORKING_DIRECTORY ${${module}_SOURCE_DIR}\n    COMMENT \"Running generator to generate documentation...\"\n)\nadd_dependencies(apidoc docrsts)\nadd_dependencies(docrsts qdoc3)\n\n# #create devhelp file\n# add_custom_target(apidevhelp\n#     COMMAND python;${CMAKE_CURRENT_SOURCE_DIR}/pyhtml2devhelp.py;${CMAKE_BINARY_DIR}/apidoc/html;index.html >\n#             ${CMAKE_BINARY_DIR}/apidoc/html/PySide.devhelp;${BINDING_API_VERSION}&&;\n#             gzip;-9v;-f;${CMAKE_BINARY_DIR}/apidoc/html/PySide.devhelp\n#     COMMAND ${CMAKE_COMMAND} -E make_directory \"${CMAKE_INSTALL_PREFIX}/share/devhelp/books\"\n#     COMMAND ${CMAKE_COMMAND} -E create_symlink \"${CMAKE_INSTALL_PREFIX}/share/doc/${BINDING_NAME}/html\" \"${CMAKE_INSTALL_PREFIX}/share/devhelp/books/${BINDING_NAME}\"\n# )\n\n#install files\nadd_custom_target(apidocinstall\n    COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/share/doc/PySide-${BINDING_API_VERSION} && cp -rv ${CMAKE_CURRENT_BINARY_DIR}/html/* ${CMAKE_INSTALL_PREFIX}/share/doc/PySide-${BINDING_API_VERSION}\n)\n\nadd_dependencies(apidocinstall apidoc)\n# add_dependencies(apidocinstall apidevhelp)\n\n"
  },
  {
    "path": "doc/_templates/index.html",
    "content": "{% extends \"layout.html\" %}\n{% set title = 'Overview' %}\n{% block body %}\n<div class=\"section\">\n  <h1>PySide {{ version }} Reference</h1>\n\n    <p><a href=\"http://www.qtsoftware.com/\">Qt</a> is a cross-platform application framework from Qt Software (owned by Nokia).\n    It features a large number of libraries providing services like network abstraction and XML handling, along with a very rich\n    GUI package, allowing C++ developers to write their applications once and run them unmodified in different systems.\n    PySide aims to provide Python developers access to the Qt libraries in the most natural way.</p>\n\n    <p>PySide is built using the <a href=\"http://www.pyside.org/docs/shiboken\">Shiboken</a> binding generator.</p>\n\n  <h2>Notes</h2>\n\n    <h3>About 0 vs None</h3>\n\n    <p>The PySide class reference documentation is automatically generated from the original Qt documentation for C++, some parts were tuned to fit the Python world. However, it's not possible to rewrite all Qt docs as it would require a really huge effort, so if the documentation says you can use 0 on an QObject argument, interpret it as None.</p>\n\n    <h3>About keyword arguments</h3>\n\n    <p>Only optional arguments can be used as keyword arguments.</p>\n\n  <h2>Modules</h2>\n\n  <table class=\"contentstable\" align=\"center\" ><tr>\n    <td width=\"50%\">\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtCore/index\") }}\">QtCore</a><br/>\n         <span class=\"linkdescr\">core non-GUI functionality</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtGui/index\") }}\">QtGui</a><br/>\n         <span class=\"linkdescr\">extends QtCore with GUI functionality.</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtDeclarative/index\") }}\">QtDeclarative</a><br/>\n         <span class=\"linkdescr\">a declarative framework for building highly dynamic, custom user interfaces.</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtHelp/index\") }}\">QtHelp</a><br/>\n         <span class=\"linkdescr\">provides classes for integrating online documentation in applications</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtMultimedia/index\") }}\">QtMultimedia</a><br/>\n         <span class=\"linkdescr\">provides low-level multimedia functionality</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtNetwork/index\") }}\">QtNetwork</a><br/>\n         <span class=\"linkdescr\">offers classes that allow you to write TCP/IP clients and servers</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtOpenGL/index\") }}\">QtOpenGL</a><br/>\n         <span class=\"linkdescr\">offers classes that make it easy to use OpenGL in Qt applications</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtScript/index\") }}\">QtScript</a><br/>\n         <span class=\"linkdescr\">provides classes for making Qt applications scriptable</span></p>\n    </td>\n    <td width=\"50%\">\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtScriptTools/index\") }}\">QtScriptTools</a><br/>\n         <span class=\"linkdescr\">provides additional components for applications that use Qt Script</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtSql/index\") }}\">QtSql</a><br/>\n         <span class=\"linkdescr\">helps you provide seamless database integration to your Qt applications</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtSvg/index\") }}\">QtSvg</a><br/>\n         <span class=\"linkdescr\">provides classes for displaying the contents of SVG files</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtUiTools/index\") }}\">QtUiTools</a><br/>\n         <span class=\"linkdescr\">provides classes to handle forms created with Qt Designer</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtXml/index\") }}\">QtXml</a><br/>\n         <span class=\"linkdescr\">provides a stream reader and writer for XML documents</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/QtWebKit/index\") }}\">QtWebkit</a><br/>\n         <span class=\"linkdescr\">provides a Web browser engine</span></p>\n      <p class=\"biglink\"><a class=\"biglink\" href=\"{{ pathto(\"PySide/phonon/index\") }}\">Phonon</a><br/>\n         <span class=\"linkdescr\">cross-platform multimedia framework that enables the use of audio and video\n          content in Qt applications</span></p>\n    </td></tr>\n  </table>\n\n  <h2>Tutorials and examples</h2>\n\n  <p>A collection of <a href=\"{{ pathto(\"tutorials/index\") }}\">tutorials</a> 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 <a href=\"{{ pathto(\"tutorials/index\") }}\">tutorials</a> that show how an application is put together.</p>\n\n  <h2>Other stuff</h2>\n\n  <ul>\n    <li class=\"toctree-l1\"><a class=\"reference internal\" href=\"pysideapi2.html\">PySide API 2</a></li>\n    <li class=\"toctree-l1\"><a class=\"reference internal\" href=\"pysideversion.html\">Getting PySide and Qt version</a></li>\n  </ul>\n</div>\n{% endblock %}\n"
  },
  {
    "path": "doc/_templates/layout.html",
    "content": "{% extends \"!layout.html\" %}\n\n# Invert sidebars\n{%- block sidebar1 %}{{ sidebar() }}{%- endblock %}\n{%- block sidebar2 %}{%- endblock %}\n\n{%- block header %}\n<div id=\"container\">\n<div class=\"header\">\n    <div class=\"header_container\">\n        <div class=\"logo\"><a href=\"http://www.pyside.org\"><img alt=\"PySide\" src=\"{{ pathto('_static/pysidelogo.png', 1) }}\" width=\"199\" height=\"102\" /></a></div>\n        <div class=\"related\">\n            <ul>\n                {%- block rootrellink %}\n                <li><a href=\"{{ pathto( 'index' ) }}\">{{ shorttitle|e }}</a></li>\n                {%- endblock %}\n                {%- for parent in parents %}\n                <li>{{ reldelim1 }} <a href=\"{{ parent.link|e }}\" {% if loop.last %}{{ accesskey(\"U\") }}{% endif %}>{{ parent.title }}</a></li>\n                {%- endfor %}\n                {%- block relbaritems %} {% endblock %}\n            </ul>\n        </div>\n    </div>\n</div>\n{%- endblock -%}\n\n{%- block footer %}\n    <div class=\"footer\">\n    <a href=\"http://www.indt.org.br\"><img src=\"{{ pathto('_static/logo_indt.jpg', 1) }}\" alt=\"Indt\" border=\"0\" /></a>\n    <a href=\"http://www.openbossa.org\"><img src=\"{{ pathto('_static/logo_openbossa.png', 1) }}\" alt=\"Openbossa\" border=\"0\" /></a>\n    <a href=\"http://qt.nokia.com/\"><img src=\"{{ pathto('_static/logo_qt.png', 1) }}\" alt=\"Qt\" border=\"0\" /></a>\n    <a href=\"http://www.python.org\"><img src=\"{{ pathto('_static/logo_python.jpg', 1) }}\" alt=\"Python\" border=\"0\" /></a>\n    </div>\n</div>\n{%- endblock %}\n\n# No top relbar.\n{%- block relbar1 %}{%- endblock %}\n\n# No bottom relbar.\n{%- block relbar2 %}{%- endblock %}\n"
  },
  {
    "path": "doc/_themes/pysidedocs/domainindex.html",
    "content": "{#\n    basic/domainindex.html\n    ~~~~~~~~~~~~~~~~~~~~~~\n\n    Template for domain indices (module index, ...).\n\n    :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.\n    :license: BSD, see LICENSE for details.\n#}\n{% extends \"layout.html\" %}\n{% set title = indextitle %}\n{% block extrahead %}\n{{ super() }}\n{% if not embedded and collapse_index %}\n    <script type=\"text/javascript\">\n      DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;\n    </script>\n{% endif %}\n{% endblock %}\n{% block body %}\n<div class=\"section\">\n   {%- set curr_group = 0 %}\n\n   <h1>{{ indextitle }}</h1>\n\n   <div class=\"modindex-jumpbox\">\n   {%- for (letter, entries) in content %}\n   <a href=\"#cap-{{ letter }}\"><strong>{{ letter }}</strong></a>\n     {%- if not loop.last %} | {% endif %}\n   {%- endfor %}\n   </div>\n\n   <table class=\"indextable modindextable\" cellspacing=\"0\" cellpadding=\"2\">\n   {%- for letter, entries in content %}\n     <tr class=\"pcap\"><td></td><td>&nbsp;</td><td></td></tr>\n     <tr class=\"cap\"><td></td><td><a name=\"cap-{{ letter }}\">\n           <strong>{{ letter }}</strong></a></td><td></td></tr>\n     {%- for (name, grouptype, page, anchor, extra, qualifier, description)\n             in entries %}\n     {%- if grouptype == 1 %}{% set curr_group = curr_group + 1 %}{% endif %}\n     <tr{% if grouptype == 2 %} class=\"cg-{{ curr_group }}\"{% endif %}>\n       <td>{% if grouptype == 1 -%}\n         <img src=\"{{ pathto('_static/minus.png', 1) }}\" id=\"toggle-{{ curr_group }}\"\n              class=\"toggler\" style=\"display: none\" alt=\"-\" />\n           {%- endif %}</td>\n       <td>{% if grouptype == 2 %}&nbsp;&nbsp;&nbsp;{% endif %}\n       {% if page %}<a href=\"{{ pathto(page) }}#{{ anchor }}\">{% endif -%}\n       <tt class=\"xref\">{{ name|e }}</tt>\n       {%- if page %}</a>{% endif %}\n     {%- if extra %} <em>({{ extra|e }})</em>{% endif -%}\n     </td><td>{% if qualifier %}<strong>{{ qualifier|e }}:</strong>{% endif %}\n       <em>{{ description|e }}</em></td></tr>\n     {%- endfor %}\n   {%- endfor %}\n   </table>\n</div>\n{% endblock %}\n"
  },
  {
    "path": "doc/_themes/pysidedocs/searchbox.html",
    "content": "{%- if pagename != \"search\" %}\n<div id=\"searchbox\" style=\"display: none\">\n  <h3>{{ _('Quick search') }}</h3>\n    <form class=\"search\" action=\"{{ pathto('search') }}\" method=\"get\">\n      <input type=\"text\" name=\"q\" id=\"q\" size=\"18\" />\n      <input type=\"submit\" value=\"{{ _('Go') }}\" id=\"search_button\" />\n      <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n      <input type=\"hidden\" name=\"area\" value=\"default\" />\n    </form>\n</div>\n<script type=\"text/javascript\">$('#searchbox').show(0);</script>\n{%- endif %}\n"
  },
  {
    "path": "doc/_themes/pysidedocs/static/pysidedocs.css",
    "content": "* {\n    font: 100% Verdana, Arial, Helvetica, sans-serif;\n    font-size:12px;\n}\n\nhtml {\n    height: 100%;\n}\n\nbody {\n    margin: 0;\n    padding: 0;\n    background-color: #EBEBEB;\n    height: 100%;\n    color: #333;\n}\n\nstrong {\n    font-weight:bold;\n}\n\n.document {\n    padding-bottom: 90px;\n}\n\n#container {\n    position: relative;\n    min-height: 100%;\n    background-image: url(fakebar.png);\n    background-repeat: repeat-y;\n    background-color: white;\n}\n\n.footer {\n    position: absolute;\n    bottom: 0px;\n    margin-top: 50px;\n    text-align:center;\n    background-color: white;\n    border-top: 2px solid #e0e0e0;\n    white-space: nowrap;\n    height: 90px;\n    width: 100%;\n}\n\n.footer img {\n    margin-left: 8px;\n    margin-right: 8px;\n}\n\n.sphinxsidebar {\n    float: left;\n    width: 250px;\n    padding: 0px 10px 0px 10px;\n    text-align: left;\n}\n\n.sphinxsidebar ul {\n    padding: 0px;\n    margin: 0px;\n    list-style-position: inside;\n}\n\n.sphinxsidebar > ul {\n    padding: 0px;\n    margin: 0px;\n}\n\n.sphinxsidebar ul li {\n    margin-left: 10px;\n    padding: 0px;\n}\n\n.sphinxsidebar h3, .sphinxsidebar h3 a {\n    font-weight: bold;\n    color: #333;\n}\n\n.documentwrapper {\n    margin-left: 270px;\n    text-align: left;\n    background-color: #ffffff;\n    border-left: 1px solid #989898;\n    font-size:18px;\n    padding: 10px 50px 15px 50px;\n    height: 100%;\n}\n\nh1 {\n    font-size:18px;\n    padding-left: 50px;\n    padding-bottom: 15px;\n    padding-top: 15px;\n    border-bottom: 1px solid #c2c2c2;\n/*     text-transform:uppercase; */\n    margin-right: -100px;\n    position: relative;\n    left: -50px;\n    top: -10px;\n}\n\nh2 {\n    font-size:12px;\n    font-weight:bold;\n    border-left-width: 1px;\n    border-right-width: 1px;\n    border-top-width: 1px;\n    border-bottom-width: 2px;\n    border-style: solid;\n    border-left-color: #b1b1b1;\n    border-right-color: #b1b1b1;\n    border-top-color: #b1b1b1;\n    border-bottom-color: #009491;\n    background-color: #e0e0e0;\n    padding:5px;\n    margin-top: 20px;\n    -moz-border-radius:5px;\n    -webkit-border-radius:5px;\n    -khtml-border-radius:5px;\n}\n\nh3, h4 {\n    font-weight: bolder;\n}\n\npre {\n    border-top: 1px solid #e0e0e0;\n    border-bottom: 1px solid #e0e0e0;\n    background-color: #fafafa;\n    padding: 5px;\n    font: 100% monospace;\n    overflow: auto;\n}\n\npre * {\n    font: 100% monospace;\n}\n\n.pre {\n    font: 100% monospace;\n}\n\n.headerlink {\n    font-size: 100%;\n    color: inherit;\n    float: right;\n    visibility: Hidden\n}\n\nh1 .headerlink {\n    padding-right: 50px;\n}\n\nh1:hover .headerlink, h2:hover .headerlink, h3:hover .headerlink {\n    visibility: Visible;\n}\n\na, a:visited {\n    color: #009491;\n    text-decoration: none;\n}\n\na:hover {\n    text-decoration: underline;\n}\n\n/* -- admonitions ----------------------------------------------------------- */\n\ndiv.admonition {\n    margin-top: 10px;\n    margin-bottom: 10px;\n    padding: 7px;\n}\n\ndiv.admonition dt {\n    font-weight: bold;\n}\n\ndiv.admonition dl {\n    margin-bottom: 0;\n}\n\np.admonition-title {\n    margin: 0px 10px 5px 0px;\n    font-weight: bold;\n}\n\ndiv.body p.centered {\n    text-align: center;\n    margin-top: 25px;\n}\n\ndiv.warning {\n    background-color: #ffe4e4;\n    border: 1px solid #f66;\n}\n\ndiv.seealso {\n    background-color: #ffffcc;\n    border: 1px solid #ffff66;\n}\n\ndiv.note {\n    border: 1px solid #e3e3e3;\n}\n\ntable.docutils {\n    margin-left: auto;\n    margin-right: auto;\n    margin-bottom: 10px;\n    border: none;\n}\n\ntable.docutils td {\n    border: none;\n}\n\ntable.docutils th {\n    border: none;\n    font-weight: bold;\n    vertical-align: top;\n}\n\nh2 em {\n    float: right;\n    font-size: 10px;\n    position: relative;\n    top: -20px;\n}\n\n/* Table of pymaemo components */\n\n#development table.docutils td {\n    border-bottom: 1px solid #EBEBEB;\n}\n\n#development th {\n    background-color: #EBEBEB;\n    color: #FC7E00;\n    padding: 5px;\n}\n\n#development th:first-child {\n    -moz-border-radius: 20px 0px 0px 0px;\n    -webkit-border-radius: 20px 0px 0px 0px;\n    -khtml-border-radius: 20px 0px 0px 0px;\n    padding-left: 10px;\n}\n#development th:last-child {\n    -moz-border-radius: 0px 20px 0px 0px;\n    -webkit-border-radius: 0px 20px 0px 0px;\n    -khtml-border-radius: 0px 20px 0px 0px;\n    padding-right: 10px;\n    width: 100px;\n}\n\nhr {\n    border: none;\n    border-bottom: 1px dashed #EBEBEB;\n    width: 70%\n}\n\n.oldnews {\n    text-align: right;\n}\n\n/******************* TOPO *****************************/\n.header {\n    background-image: url(bg_topo.jpg);\n    background-repeat: repeat-x;\n    height: 147px;\n}\n\n.header_container {\n    background-image: url(bg_header.png);\n    background-repeat: no-repeat;\n    background-position: 100px 0px;\n}\n\n.logo {\n    text-align: left;\n    margin-bottom: 10px;\n}\n\n#searchbox {\n    border-top: 1px solid #989898;\n    padding-top: 10px;\n    margin-left: -10px;\n    margin-right: -10px;\n    padding-left: 10px;\n    padding-right: 10px;\n}\n\n#search_button {\n    border: 1px solid #3A393A;\n    background-color: #3A393A;\n    color: white;\n    cursor: pointer;\n    -moz-border-radius: 5px;\n    -webkit-border-radius: 5px;\n    -khtml-border-radius: 5px;\n\n}\n\nform {\n    margin: 0px;\n    padding: 0px;\n}\n\n/* search field */\nform #q {\n    width: 136px;\n/*     height: 22px; */\n    border: none;\n    margin: 0px;\n    -moz-border-radius: 5px;\n    -webkit-border-radius: 5px;\n    -khtml-border-radius: 5px;\n    margin-top: 2px;\n    padding: 4px;\n    line-height: 22px\n}\n\n#search-results h2 {\n    display: none;\n}\n\n#search-results h2 {\n    display: none;\n}\n\n#search-results ul.search {\n    margin: 0px;\n    padding: 0px;\n}\n\nul.search div.context {\n    padding-left: 40px;\n}\n\n#installation td {\n    text-align: center;\n    font-weight: bold;\n}\n\nem {\n    color: inherit;\n    font-style:italic;\n}\n\n/********   REL bar     *********/\n\n.related {\n    display: inline;\n}\n\n.related ul {\n    padding: 0px 0px 0px 10px;\n    margin: 0px;\n    text-align: left;\n    background-image: url(relbar_bg.png);\n}\n\n.related li {\n    display: inline;\n    color: white;\n    font-weight: bold;\n}\n\n.related li a {\n    color: inherit;\n    line-height: 35px;\n    font-weight: bold;\n    vertical-align: middle;\n}\n\n.related li.right {\n    float: right;\n    margin-right: 5px;\n}\n\n.related h3 {\n    display: none;\n}\n\n.align-center {\n    text-align: center;\n}\n\n.contentstable {\n    width: 100%;\n}\n\n.contentstable td {\n    padding-left: 30px;\n    vertical-align: top;\n}\n\np.biglink a {\n    font-size: 20px;\n}\n\ndt:target, .highlight {\n    background-color: #fbe54e;\n}\n\nimg {\n    border: 0px;\n}\n\n.figure .caption {\n    font-style:italic;\n}\n\ntable.footnote {\n    margin: 0px;\n}\n\n#synopsis table, table.field-list {\n    margin: 0px;\n}\n\ntt.descname {\n    font-size: 120%;\n    font-weight: bold;\n}\n\n#functions ul, #virtual-functions ul, #slots ul, #signals ul, #static-functions ul {\n    list-style: none;\n    margin: 0px;\n    padding: 10px;\n    border: 1px solid #ddd;\n    background-color: #f4f4f4;\n    -moz-border-radius:10px;\n    -webkit-border-radius:10px;\n    -khtml-border-radius:10px;\n}\n\n#synopsis span.pre {\n    color: #009491;\n    font-weight: bolder;\n}\n\n#detailed-description .class dt, #detailed-description .method dt, #detailed-description .attribute dt  {\n    margin: 0px;\n    padding: 10px;\n    border: 1px solid #ddd;\n    background-color: #f4f4f4;\n    -moz-border-radius:10px;\n    -webkit-border-radius:10px;\n    -khtml-border-radius:10px;\n}\n\n.pysidetoc ul {\n    list-style: none;\n    padding: 0px;\n    margin: 0px;\n}\n\n.pysidetoc em {\n    font-style: normal;\n}\n\n.pysidetoc strong {\n    display: block;\n    padding: 5px;\n    border: 1px solid #ddd;\n    background-color: #f4f4f4;\n    -moz-border-radius:6px;\n    -webkit-border-radius:6px;\n    -khtml-border-radius:6px;\n}\n\n.hide {\n    display: none;\n}\n\n"
  },
  {
    "path": "doc/_themes/pysidedocs/theme.conf",
    "content": "[theme]\ninherit = default\nstylesheet = pysidedocs.css\npygments_style = none\n\n[options]\nnosidebar = false\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/accessibilityfactorysnippet.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n//! [0]\nQAccessibleInterface *sliderFactory(const QString &classname, QObject *object)\n{\n    QAccessibleInterface *interface = 0;\n\n    if (classname == \"QSlider\" && object && object->isWidgetType())\n        interface = new SliderInterface(classname,\n                                        static_cast<QWidget *>(object));\n    \n    return interface;\n}\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n    QAccessible::installFactory(sliderFactory);\n//! [0]\n\n    QMainWindow mainWindow;\n    mainWindow.show();\n\n    return app.exec();\n//! [1]\n}\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/accessibilitypluginsnippet.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nclass SliderPlugin : public QAccessiblePlugin\n{\npublic:\n    SliderPlugin() {}\n\n    QStringList keys() const;\n    QAccessibleInterface *create(const QString &classname, QObject *object);\n};\n\n//! [0]\nQStringList SliderPlugin::keys() const\n{\n    return QStringList() << \"QSlider\";\n}\n//! [0]\n\n//! [1]\nQAccessibleInterface *SliderPlugin::create(const QString &classname, QObject *object)\n{\n    QAccessibleInterface *interface = 0;\n\n    if (classname == \"QSlider\" && object && object->isWidgetType())\n        interface = new AccessibleSlider(classname, static_cast<QWidget *>(object));\n\n    return interface;\n}\n//! [1]\n\n//! [2]\nQ_EXPORT_STATIC_PLUGIN(SliderPlugin)\nQ_EXPORT_PLUGIN2(acc_sliderplugin, SliderPlugin)\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/accessibilityslidersnippet.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n\n//! [0]\nQAccessibleSlider::QAccessibleSlider(QWidget *w)\n: QAccessibleAbstractSlider(w)\n{\n    Q_ASSERT(slider());\n    addControllingSignal(QLatin1String(\"valueChanged(int)\"));\n}\n//! [0]\n\nQSlider *QAccessibleSlider::slider() const\n{\n    return qobject_cast<QSlider*>(object());\n}\n\n//! [1]\nQRect QAccessibleSlider::rect(int child) const\n{\n//! [1]\n    QRect rect;\n    if (!slider()->isVisible())\n        return rect;\n    const QStyleOptionSlider option = qt_qsliderStyleOption(slider());\n    QRect srect = slider()->style()->subControlRect(QStyle::CC_Slider, &option,\n                                                    QStyle::SC_SliderHandle, slider());\n\n//! [2]\n    switch (child) {\n    case PageLeft:\n        if (slider()->orientation() == Qt::Vertical)\n            rect = QRect(0, 0, slider()->width(), srect.y());\n        else\n            rect = QRect(0, 0, srect.x(), slider()->height());\n        break;\n    case Position:\n        rect = srect;\n        break;\n    case PageRight:\n        if (slider()->orientation() == Qt::Vertical)\n            rect = QRect(0, srect.y() + srect.height(), slider()->width(), slider()->height()- srect.y() - srect.height());\n        else\n            rect = QRect(srect.x() + srect.width(), 0, slider()->width() - srect.x() - srect.width(), slider()->height());\n        break;\n    default:\n        return QAccessibleAbstractSlider::rect(child);\n    }\n//! [2] //! [3]\n\n    QPoint tp = slider()->mapToGlobal(QPoint(0,0));\n    return QRect(tp.x() + rect.x(), tp.y() + rect.y(), rect.width(), rect.height());\n}\n//! [3]\n\nint QAccessibleSlider::childCount() const\n{\n    if (!slider()->isVisible())\n        return 0;\n    return PageRight;\n}\n\n//! [4]\nQString QAccessibleSlider::text(Text t, int child) const\n{\n    if (!slider()->isVisible())\n        return QString();\n    switch (t) {\n    case Value:\n        if (!child || child == 2)\n            return QString::number(slider()->value());\n        return QString();\n    case Name:\n        switch (child) {\n        case PageLeft:\n            return slider()->orientation() == Qt::Horizontal ?\n                QSlider::tr(\"Page left\") : QSlider::tr(\"Page up\");\n        case Position:\n            return QSlider::tr(\"Position\");\n        case PageRight:\n            return slider()->orientation() == Qt::Horizontal ?\n                QSlider::tr(\"Page right\") : QSlider::tr(\"Page down\");\n        }\n        break;\n    default:\n        break;\n    }\n    return QAccessibleAbstractSlider::text(t, child);\n}\n//! [4]\n\n//! [5]\nQAccessible::Role QAccessibleSlider::role(int child) const\n{\n    switch (child) {\n    case PageLeft:\n    case PageRight:\n        return PushButton;\n    case Position:\n        return Indicator;\n    default:\n        return Slider;\n    }\n}\n//! [5]\n\n//! [6]\nQAccessible::State QAccessibleSlider::state(int child) const\n{\n    const State parentState = QAccessibleAbstractSlider::state(0);\n//! [6]\n\n    if (child == 0)\n        return parentState;\n\n    // Inherit the Invisible state from parent.\n    State state = parentState & QAccessible::Invisible;\n\n    // Disable left/right if we are at the minimum/maximum.\n    const QSlider * const slider = QAccessibleSlider::slider();\n//! [7]\n    switch (child) {\n    case PageLeft:\n        if (slider->value() <= slider->minimum())\n            state |= Unavailable;\n        break;\n    case PageRight:\n        if (slider->value() >= slider->maximum())\n            state |= Unavailable;\n        break;\n    case Position:\n    default:\n        break;\n    }\n\n    return state;\n}\n//! [7]\n\nint QAccessibleSlider::defaultAction(int child) const\n{\n    switch (child) {\n        case SliderSelf:\n            return SetFocus;\n        case PageLeft:\n            return Press;\n        case PageRight:\n            return Press;\n    }\n\n    return 0;\n}\n\n// Name, Description, Value, Help, Accelerator\nstatic const char * const actionTexts[][5] =\n{\n    {\"Press\", \"Decreases the value of the slider\", \"\", \"\", \"Ctrl+L\"},\n    {\"Press\", \"Increaces the value of the slider\", \"\", \"\", \"Ctrl+R\"}\n};\n\nQString QAccessibleSlider::actionText(int action, Text text, int child) const\n{\n    if (action != Press || child < 1 || child > 2)\n        return QAccessibleAbstractSlider::actionText(action, text, child);        \n\n    return actionTexts[child - 1][t];\n}\n\nbool QAccessibleSlider::doAction(int action, int child)\n{\n    if (action != Press || child < 1 || child > 2)\n        return false;\n    \n    if (child == PageLeft)\n        slider()->setValue(slider()->value() - slider()->pageStep());\n    else\n        slider()->setValue(slider()->value() + slider()->pageStep());\n}\n\nQAccessibleAbstractSlider::QAccessibleAbstractSlider(QWidget *w, Role r)\n    : QAccessibleWidgetEx(w, r)\n{\n    Q_ASSERT(qobject_cast<QAbstractSlider *>(w));\n}\n\nQVariant QAccessibleAbstractSlider::invokeMethodEx(Method method, int child, const QVariantList &params)\n{\n    switch (method) {\n    case ListSupportedMethods: {\n        QSet<QAccessible::Method> set;\n        set << ListSupportedMethods;\n        return qVariantFromValue(set | qvariant_cast<QSet<QAccessible::Method> >(\n                    QAccessibleWidgetEx::invokeMethodEx(method, child, params)));\n    }\n    default:\n        return QAccessibleWidgetEx::invokeMethodEx(method, child, params);\n    }\n}\n\nQVariant QAccessibleAbstractSlider::currentValue()\n{\n    return abstractSlider()->value();\n}\n\nvoid QAccessibleAbstractSlider::setCurrentValue(const QVariant &value)\n{\n    abstractSlider()->setValue(value.toInt());\n}\n\nQVariant QAccessibleAbstractSlider::maximumValue()\n{\n    return abstractSlider()->maximum();\n}\n\nQVariant QAccessibleAbstractSlider::minimumValue()\n{\n    return abstractSlider()->minimum();\n}\n\nQAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const\n{\n    return static_cast<QAbstractSlider *>(object());\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/alphachannel.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n//! [0]\n\tpixmap = QPixmap(100, 100)\n\tpixmap.fill(Qt.transparent)\n\n\tgradient = QRadialGradient(50, 50, 50, 50, 50)\n\tgradient.setColorAt(0, QColor.fromRgbF(1, 0, 0, 1))\n\tgradient.setColorAt(1, QColor.fromRgbF(0, 0, 0, 0))\n\tpainter = QPainter(pixmap)\n\tpainter.fillRect(0, 0, 100, 100, gradient)\n\n\tchannelImage = pixmap.alphaChannel()\n\tupdate()\n//! [0]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/audio/main.cpp",
    "content": "\nclass Window2 (QWidget):\n//![0]\n    @Slot(QAudio.State)\n    def stateChanged(self, newState):\n        if newState == QAudio.StopState:\n            if self.input.error() != QAudio.NoError:\n                # Error handling\n//![0]\n\nclass Window (QWidget):\n    def __init__(self):\n        QWidget.__init__(self)\n        self.output = QAudioOutput()\n        self.output.stateChanged[QAudio.State].connect(self.stateChanged)\n\n    def setupFormat(self):\n//![1]\n        format = QAudioFormat()\n        format.setFrequency(44100)\n//![1]\n        format.setChannels(2)\n        format.setSampleSize(16)\n        format.setCodec(\"audio/pcm\")\n        format.setByteOrder(QAudioFormat.LittleEndian)\n//![2]\n        format.setSampleType(QAudioFormat.SignedInt)\n\n        info = QAudioDeviceInfo(QAudioDeviceInfo.defaultOutputDevice())\n\n        if not info.isFormatSupported(format):\n            format = info.nearestFormat(format)\n//![2]\n\n//![3]\n    @Slot(QAudio.State)\n    def stateChanged(self, newState):\n        if newState == QAudio.StopState:\n            if self.output.error() != QAudio.NoError:\n                # Perform error handling\n            else:\n                # Normal stop\n//![3]\n\n        # Handle\n        elif newState == QAudio.ActiveState:\n            # Handle active state...\n\napp = QApplication(sys.argv)\n\nwindow = Window()\nwindow.show()\nsys.exit(app.exec_())\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/audioeffects.cpp",
    "content": "#include <QtGui>\n\n#include <phonon/audiooutput.h>\n#include <phonon/mediaobject.h>\n#include <phonon/backendcapabilities.h>\n#include <phonon/effect.h>\n#include <phonon/effectwidget.h>\n\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n    app.setApplicationName(\"Audio effect tester\");\n\n    Phonon::MediaObject *mediaObject = new Phonon::MediaObject;\n    mediaObject->setCurrentSource(QString(\"/home/gvatteka/Music/Lumme-Badloop.ogg\"));\n\n    Phonon::AudioOutput *audioOutput =\n        new Phonon::AudioOutput(Phonon::MusicCategory);\n\n//! [0]\n    QList<Phonon::EffectDescription> effectDescriptions =\n            Phonon::BackendCapabilities::availableAudioEffects();\n    Phonon::EffectDescription effectDescription = effectDescriptions.at(4);\n    \n    Phonon::Path path = Phonon::createPath(mediaObject, audioOutput);\n\n//! [1]\n    Phonon::Effect *effect = new Phonon::Effect(effectDescription);\n    path.insertEffect(effect);\n//! [0]\n\n    Phonon::EffectWidget *effectWidget = new Phonon::EffectWidget(effect);\n    effectWidget->show();\n//! [1]\n\n    mediaObject->play();\n    \n    effectWidget->setWindowTitle(\"Effect Name: \" + effectDescription.name());\n\n    app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/brush/brush.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nint main()\n{\n    QWidget anyPaintDevice;\n    {\n        // PEN SNIPPET\n        QPainter painter;\n        QPen pen(Qt::red, 2);                 // red solid line, 2 pixels wide\n        painter.begin(&anyPaintDevice);   // paint something\n        painter.setPen(pen);              // set the red, wide pen\n        painter.drawRect(40,30, 200,100); // draw a rectangle\n        painter.setPen(Qt::blue);             // set blue pen, 0 pixel width\n        painter.drawLine(40,30, 240,130); // draw a diagonal in rectangle\n        painter.end();                    // painting done\n    }\n\n    {\n        // BRUSH SNIPPET\n        QPainter painter;\n        QBrush brush(Qt::yellow);           // yellow solid pattern\n        painter.begin(&anyPaintDevice);   // paint something\n        painter.setBrush(brush);          // set the yellow brush\n        painter.setPen(Qt::NoPen);        // do not draw outline\n        painter.drawRect(40,30, 200,100); // draw filled rectangle\n        painter.setBrush(Qt::NoBrush);    // do not fill\n        painter.setPen(Qt::black);            // set black pen, 0 pixel width\n        painter.drawRect(10,10, 30,20);   // draw rectangle outline\n        painter.end();                    // painting done\n    }\n\n    // LINEAR\n//! [0]\n    linearGrad = QLinearGradient(QPointF(100, 100), QPointF(200, 200))\n    linearGrad.setColorAt(0, Qt.black)\n    linearGrad.setColorAt(1, Qt.white)\n//! [0]\n\n    // RADIAL\n//! [1]\n    radialGrad = QRadialGradient(QPointF(100, 100), 100)\n    radialGrad.setColorAt(0, Qt.red)\n    radialGrad.setColorAt(0.5, Qt.blue)\n    radialGrad.setColorAt(1, Qt.green)\n//! [1]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/brush/gradientcreationsnippet.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n\n//! [0]\n    gradient = QRadialGradient gradient(50, 50, 50, 50, 50)\n    gradient.setColorAt(0, QColor.fromRgbF(0, 1, 0, 1))\n    gradient.setColorAt(1, QColor.fromRgbF(0, 0, 0, 0))\n\n    brush = QBrush(gradient)\n//! [0]\n\n    QWidget widget;\n    QPalette palette;\n    palette.setBrush(widget.backgroundRole(), brush);\n    widget.setPalette(palette);\n    widget.show();\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/brushstyles/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n\n#include \"stylewidget.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    StyleWidget widget;\n    widget.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/brushstyles/renderarea.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"renderarea.h\"\n\nRenderArea::RenderArea(QBrush *brush, QWidget *parent)\n        : QWidget(parent)\n{\n    currentBrush = brush;\n}\n\nQSize RenderArea::minimumSizeHint() const\n{\n    return QSize(120, 60);\n}\n\nvoid RenderArea::paintEvent(QPaintEvent *)\n{\n    QPainter painter(this);\n    painter.setPen(Qt::NoPen);\n    painter.setRenderHint(QPainter::Antialiasing);\n\n\n    if(currentBrush->style() == Qt::LinearGradientPattern) {\n        currentBrush = new QBrush(QLinearGradient(0, 0, width(), 60));\n    } else if(currentBrush->style() == Qt::RadialGradientPattern) {\n        QRadialGradient radial(width() / 2, 30, width() / 2, width() / 2, 30);\n        radial.setColorAt(0, Qt::white);\n        radial.setColorAt(1, Qt::black);\n        currentBrush = new QBrush(radial);\n    } else if(currentBrush->style() == Qt::ConicalGradientPattern) {\n        currentBrush = new QBrush(QConicalGradient(width() / 2, 30, 90));\n    }\n    painter.setBrush(*currentBrush);\n\n    QPainterPath path;\n    path.addRect(0, 0, parentWidget()->width(), 60);\n    painter.drawPath(path);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/brushstyles/renderarea.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef RENDERAREA_H\n#define RENDERAREA_H\n\n#include <QWidget>\n\nclass RenderArea : public QWidget\n{\n   Q_OBJECT\n\npublic:\n   RenderArea(QBrush *brush, QWidget *parent = 0);\n   QSize minimumSizeHint() const;\n\nprotected:\n    void paintEvent(QPaintEvent *event);\n\nprivate:\n    QBrush *currentBrush;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/brushstyles/stylewidget.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"stylewidget.h\"\n\nStyleWidget::StyleWidget(QWidget *parent)\n        : QWidget(parent)\n{\n    solid = new RenderArea(new QBrush(Qt::SolidPattern));\n    dense1 = new RenderArea(new QBrush(Qt::Dense1Pattern));\n    dense2 = new RenderArea(new QBrush(Qt::Dense2Pattern));\n    dense3 = new RenderArea(new QBrush(Qt::Dense3Pattern));\n    dense4 = new RenderArea(new QBrush(Qt::Dense4Pattern));\n    dense5 = new RenderArea(new QBrush(Qt::Dense5Pattern));\n    dense6 = new RenderArea(new QBrush(Qt::Dense6Pattern));\n    dense7 = new RenderArea(new QBrush(Qt::Dense7Pattern));\n    no = new RenderArea(new QBrush(Qt::NoBrush));\n    hor = new RenderArea(new QBrush(Qt::HorPattern));\n    ver = new RenderArea(new QBrush(Qt::VerPattern));\n    cross = new RenderArea(new QBrush(Qt::CrossPattern));\n    bdiag = new RenderArea(new QBrush(Qt::BDiagPattern));\n    fdiag = new RenderArea(new QBrush(Qt::FDiagPattern));\n    diagCross = new RenderArea(new QBrush(Qt::DiagCrossPattern));\n    linear = new RenderArea(new QBrush(QLinearGradient()));\n    radial = new RenderArea(new QBrush(QRadialGradient()));\n    conical = new RenderArea(new QBrush(QConicalGradient()));\n    texture = new RenderArea(new QBrush(QPixmap(\"qt-logo.png\")));\n\n    solidLabel = new QLabel(\"Qt::SolidPattern\");\n    dense1Label = new QLabel(\"Qt::Dense1Pattern\");\n    dense2Label = new QLabel(\"Qt::Dense2Pattern\");\n    dense3Label = new QLabel(\"Qt::Dense3Pattern\");\n    dense4Label = new QLabel(\"Qt::Dense4Pattern\");\n    dense5Label = new QLabel(\"Qt::Dense5Pattern\");\n    dense6Label = new QLabel(\"Qt::Dense6Pattern\");\n    dense7Label = new QLabel(\"Qt::Dense7Pattern\");\n    noLabel = new QLabel(\"Qt::NoPattern\");\n    horLabel = new QLabel(\"Qt::HorPattern\");\n    verLabel = new QLabel(\"Qt::VerPattern\");\n    crossLabel = new QLabel(\"Qt::CrossPattern\");\n    bdiagLabel = new QLabel(\"Qt::BDiagPattern\");\n    fdiagLabel = new QLabel(\"Qt::FDiagPattern\");\n    diagCrossLabel = new QLabel(\"Qt::DiagCrossPattern\");\n    linearLabel = new QLabel(\"Qt::LinearGradientPattern\");\n    radialLabel = new QLabel(\"Qt::RadialGradientPattern\");\n    conicalLabel = new QLabel(\"Qt::ConicalGradientPattern\");\n    textureLabel = new QLabel(\"Qt::TexturePattern\");\n\n    QGridLayout *layout = new QGridLayout;\n    layout->addWidget(solid, 0, 0);\n    layout->addWidget(dense1, 0, 1);\n    layout->addWidget(dense2, 0, 2);\n    layout->addWidget(solidLabel, 1, 0);\n    layout->addWidget(dense1Label, 1, 1);\n    layout->addWidget(dense2Label, 1, 2);\n\n    layout->addWidget(dense3, 2, 0 );\n    layout->addWidget(dense4, 2, 1);\n    layout->addWidget(dense5, 2, 2);\n    layout->addWidget(dense3Label, 3, 0);\n    layout->addWidget(dense4Label, 3, 1);\n    layout->addWidget(dense5Label, 3, 2);\n\n    layout->addWidget(dense6, 4, 0);\n    layout->addWidget(dense7, 4, 1);\n    layout->addWidget(no, 4, 2);\n    layout->addWidget(dense6Label, 5, 0);\n    layout->addWidget(dense7Label, 5, 1);\n    layout->addWidget(noLabel, 5, 2);\n\n    layout->addWidget(hor, 6, 0);\n    layout->addWidget(ver, 6, 1);\n    layout->addWidget(cross, 6, 2);\n    layout->addWidget(horLabel, 7, 0);\n    layout->addWidget(verLabel, 7, 1);\n    layout->addWidget(crossLabel, 7, 2);\n\n    layout->addWidget(bdiag, 8, 0);\n    layout->addWidget(fdiag, 8, 1);\n    layout->addWidget(diagCross, 8, 2);\n    layout->addWidget(bdiagLabel, 9, 0);\n    layout->addWidget(fdiagLabel, 9, 1);\n    layout->addWidget(diagCrossLabel, 9, 2);\n\n    layout->addWidget(linear, 10, 0);\n    layout->addWidget(radial, 10, 1);\n    layout->addWidget(conical, 10, 2);\n    layout->addWidget(linearLabel, 11, 0);\n    layout->addWidget(radialLabel, 11, 1);\n    layout->addWidget(conicalLabel, 11, 2);\n\n    layout->addWidget(texture, 12, 0, 1, 3);\n    layout->addWidget(textureLabel, 13, 0, 1, 3);\n\n    setLayout(layout);\n\n    QPalette newPalette = palette();\n    newPalette.setColor(QPalette::Window, Qt::white);\n    setPalette(newPalette);\n\n    setWindowTitle(tr(\"Brush Styles\"));\n    resize(430, 605);\n}\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/brushstyles/stylewidget.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef STYLEWIDGET_H\n#define STYLEWIDGET_H\n\n#include <QWidget>\n#include <QPainterPath>\n#include \"renderarea.h\"\n\nclass QLabel;\n\nclass StyleWidget : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    StyleWidget(QWidget *parent = 0);\n\nprivate:\n    RenderArea *solid;\n    RenderArea *dense1;\n    RenderArea *dense2;\n    RenderArea *dense3;\n    RenderArea *dense4;\n    RenderArea *dense5;\n    RenderArea *dense6;\n    RenderArea *dense7;\n    RenderArea *no;\n    RenderArea *hor;\n    RenderArea *ver;\n    RenderArea *cross;\n    RenderArea *bdiag;\n    RenderArea *fdiag;\n    RenderArea *diagCross;\n    RenderArea *linear;\n    RenderArea *radial;\n    RenderArea *conical;\n    RenderArea *texture;\n\n    QLabel *solidLabel;\n    QLabel *dense1Label;\n    QLabel *dense2Label;\n    QLabel *dense3Label;\n    QLabel *dense4Label;\n    QLabel *dense5Label;\n    QLabel *dense6Label;\n    QLabel *dense7Label;\n    QLabel *noLabel;\n    QLabel *horLabel;\n    QLabel *verLabel;\n    QLabel *crossLabel;\n    QLabel *bdiagLabel;\n    QLabel *fdiagLabel;\n    QLabel *diagCrossLabel;\n    QLabel *linearLabel;\n    QLabel *radialLabel;\n    QLabel *conicalLabel;\n    QLabel *textureLabel;\n};\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/buffer/buffer.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QBuffer>\n#include <QPalette>\n\nstatic void main_snippet()\n{\n//! [0]\n    buffer = QBuffer()\n\n    buffer.open(QBuffer.ReadWrite)\n    buffer.write(\"Qt rocks!\")\n    buffer.seek(0)\n    ch = buffer.getChar()  # ch == 'Q'\n    ch = buffer.getChar()  # ch == 't'\n    ch = buffer.getChar()  # ch == ' '\n    ch = buffer.getChar()  # ch == 'r'\n//! [0]\n}\n\nstatic void write_datastream_snippets()\n{\n//! [1]\n    byteArray = QByteArray()\n    buffer = QBuffer(byteArray)\n    buffer.open(QIODevice.WriteOnly)\n\n    out = QDataStream(buffer)\n    out << QApplication.palette()\n//! [1]\n}\n\nstatic void read_datastream_snippets()\n{\n    QByteArray byteArray;\n\n//! [2]\n    palette = QPalette()\n    buffer = QBuffer(byteArray)\n    buffer.open(QIODevice.ReadOnly)\n\n    in = QDataStream(buffer)\n    in >> palette\n//! [2]\n}\n\nstatic void bytearray_ptr_ctor_snippet()\n{\n//! [3]\n    byteArray = QByteArray(\"abc\")\n    buffer = QBuffer(byteArray)\n    buffer.open(QIODevice.WriteOnly)\n    buffer.seek(3)\n    buffer.write(\"def\")\n    buffer.close()\n    # byteArray == \"abcdef\"\n//! [3]\n}\n\nstatic void setBuffer_snippet()\n{\n//! [4]\n    byteArray = QByteArray(\"abc\")\n    buffer = QBuffer()\n    buffer.setBuffer(byteArray)\n    buffer.open(QIODevice.WriteOnly)\n    buffer.seek(3)\n    buffer.write(\"def\")\n    buffer.close()\n    # byteArray == \"abcdef\"\n//! [4]\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    main_snippet();\n    bytearray_ptr_ctor_snippet();\n    write_datastream_snippets();\n    read_datastream_snippets();\n    setBuffer_snippet();\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/clipboard/clipwindow.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\nform PySide.QtGui import *\n\n\ndef __init__(self, parent):\n    QMainWindow.__init__(self, parent)\n    clipboard = QApplication.clipboard()\n\n    centralWidget =  QWidget(self)\n    currentItem =  QWidget(centralWidget)\n    mimeTypeLabel =  QLabel(tr(\"MIME types:\"), currentItem)\n    mimeTypeCombo =  QComboBox(currentItem)\n    dataLabel =  QLabel(tr(\"Data:\"), currentItem)\n    dataInfoLabel =  QLabel(\"\", currentItem)\n\n    previousItems =  QListWidget(centralWidget)\n\n//! [0]\n    connect(clipboard, SIGNAL(\"dataChanged()\"), self, SLOT(\"updateClipboard()\"))\n//! [0]\n    connect(mimeTypeCombo, SIGNAL(\"activated(const QString &)\"),\n            self, SLOT(\"updateData(const QString &))\")\n\n    currentLayout = QVBoxLayout(currentItem)\n    currentLayout.addWidget(mimeTypeLabel)\n    currentLayout.addWidget(mimeTypeCombo)\n    currentLayout.addWidget(dataLabel)\n    currentLayout.addWidget(dataInfoLabel)\n    currentLayout.addStretch(1)\n\n    mainLayout = QHBoxLayout(centralWidget)\n    mainLayout.addWidget(currentItem, 1)\n    mainLayout.addWidget(previousItems)\n\n    setCentralWidget(centralWidget)\n    setWindowTitle(tr(\"Clipboard\"))\n\n//! [1]\ndef updateClipboard(self):\n    formats = clipboard.mimeData().formats()\n    data = clipboard.mimeData().data(format)\n//! [1]\n\n    mimeTypeCombo.clear()\n    mimeTypeCombo.insertStringList(formats)\n\n    size = clipboard.mimeData().data(formats[0]).size()\n    Item = QListWidgetItem(previousItems)\n    Item.setText(tr(\"%1 (%2 bytes)\").arg(formats[0]).arg(size))\n\n    updateData(formats[0])\n//! [2]\n//! [2]\n\ndef updateData(self, format)\n    data = clipboard.mimeData().data(format)\n    dataInfoLabel.setText(tr(\"%1 bytes\").arg(data.size()))\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/clipboard/clipwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef CLIPWINDOW_H\n#define CLIPWINDOW_H\n\n#include <QMainWindow>\n\nclass QClipboard;\nclass QComboBox;\nclass QLabel;\nclass QListWidget;\nclass QMimeData;\nclass QWidget;\n\nclass ClipWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    ClipWindow(QWidget *parent = 0);\n\npublic slots:\n    void updateClipboard();\n    void updateData(const QString &format);\n\nprivate:\n    int currentItem;\n    QClipboard *clipboard;\n    QComboBox *mimeTypeCombo;\n    QLabel *dataInfoLabel;\n    QListWidget *previousItems;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/clipboard/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n\n#include \"clipwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    ClipWindow *window = new ClipWindow;\n    window->resize(640, 480);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/doc_src_phonon-api.qdoc",
    "content": "//! [0]\nclass PushStream (AbstractMediaStream):\n    def __init__(self, parent = None):\n        AbstractMediaStream.__init(self, parent)\n        self.timer = QTimer(self)\n        self.setStreamSize(self.getMediaStreamSize())\n\n        self.timer.timeout.connect(self.moreData)\n        self.timer.setInterval(0)\n\n    @Slot()\n    def moreData(self):\n        data = self.getMediaData()\n        if data.isEmpty():\n            self.endOfData()\n        else:\n            self.writeData(data)\n\n    def needData(self):\n        self.timer.start()\n        self.moreData()\n\n    def enoughData(self):\n        self.timer.stop()\n//! [0]\n\n\n//! [1]\nclass PushStream (AbstractMediaStream):\n    def __init__(self, parent = None):\n        AbstractMediaStream.__init(self, parent)\n        self.setStreamSize(self.getMediaStreamSize())\n\n    @Slot()\n    def needData(self):\n        data = self.getMediaData()\n        if data.isEmpty():\n            self.endOfData()\n        else:\n            self.writeData(data)\n//! [1]\n\n\n//! [2]\nself.seekStream(0)\n//! [2]\n\n\n//! [3]\nm = MediaObject()\nfileName = \"/home/foo/bar.ogg\"\nurl = QUrl(\"http://www.example.com/stream.mp3\")\nsomeBuffer = QBuffer()\nm.setCurrentSource(fileName)\nm.setCurrentSource(url)\nm.setCurrentSource(someBuffer)\nm.setCurrentSource(Phonon.Cd)\n//! [3]\n\n\n//! [4]\nplayer = VideoPlayer(Phonon.VideoCategory, parentWidget)\nplayer.finished.connect(player.deleteLater)\nplayer.play(url)\n//! [4]\n\n\n//! [5]\naudioPlayer.load(url)\naudioPlayer.play()\n//! [5]\n\n\n//! [6]\nmedia = MediaObject(self)\nmedia.finished.connect(self.slotFinished)\nmedia.setCurrentSource(\"/home/username/music/filename.ogg\")\n\n# ...\n\nmedia.play()\n//! [6]\n\n\n//! [7]\nmedia.setCurrentSource(\":/sounds/startsound.ogg\")\nmedia.enqueue(\"/home/username/music/song.mp3\")\nmedia.enqueue(\":/sounds/endsound.ogg\")\n//! [7]\n\n\n//! [8]\n  media.setCurrentSource(\":/sounds/startsound.ogg\")\n  media.aboutToFinish.connect(lambda : media.enqueue(\"/home/username/music/song.mp3\"))\n//! [8]\n\n\n//! [9]\nx = 200\nmedia.setTickInterval(x)\nassert(x == producer.tickInterval())\n//! [9]\n\n\n//! [10]\nx = 200\nmedia.setTickInterval(x)\nassert(x >= producer.tickInterval() and x <= * producer.tickInterval())\n//! [10]\n\n\n//! [11]\n//! [12]\n    self.media.hasVideoChanged[bool].connect(hasVideoChanged)\n    self.media.setCurrentSource(\"somevideo.avi\")\n    self.media.hasVideo() # returns false\n\n    @Slot(bool)\n    def hasVideoChanged(self, b):\n        # b == true\n        media.hasVideo() # returns true\n//! [12]\n//! [11]\n\n//! [13]\nself.setMetaArtist(media.metaData(\"ARTIST\"))\nself.setMetaAlbum(media.metaData(\"ALBUM\"))\nself.setMetaTitle(media.metaData(\"TITLE\"))\nself.setMetaDate(media.metaData(\"DATE\"))\nself.setMetaGenre(media.metaData(\"GENRE\"))\nself.setMetaTrack(media.metaData(\"TRACKNUMBER\"))\nself.setMetaComment(media.metaData(\"DESCRIPTION\"))\n//! [13]\n\n\n//! [14]\nurl = QUrl(\"http://www.example.com/music.ogg\")\nmedia.setCurrentSource(url)\n//! [14]\n\n\n//! [15]\nprogressBar.setRange(0, 100) # this is the default\nself.media.bufferStatus[int].connect(progressBar.setValue)\n//! [15]\n\n\n//! [16]\nBackendCapabilities.notifier.capabilitiesChanged.connect(...)\n//! [16]\n\n\n//! [17]\ncb = QComboBox(parentWidget)\nmodel = ObjectDescriptionModel(cb)\nmodel.setModelData(BackendCapabilities.availableAudioOutputDevices())\ncb.setModel(model)\ncb.setCurrentIndex(0) # select first entry\n//! [17]\n\n\n//! [18]\ncbIndex = cb.currentIndex()\nselectedDevice = model.modelData(cbIndex)\n//! [18]\n\n\n//! [19]\npath = Phonon.createPath(...)\neffect = Effect(this)\npath.insertEffect(effect)\n//! [19]\n\n\n//! [20]\nmedia = MediaObject()\noutput = AudioOutput(Phonon.MusicCategory)\npath = Phonon.createPath(media, output)\nassert(path.isValid()) # for this simple case the path should always be\n                       # valid - there are unit tests to ensure it\n# insert an effect\neffectList = BackendCapabilities.availableAudioEffects()\nif effectList:\n    effect = path.insertEffect(effectList[0])\n//! [20]\n\n\n//! [21]\nmedia = MediaObject(parent)\nvwidget = VideoWidget(parent)\nPhonon.createPath(media, vwidget)\n//! [21]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/doc_src_qnamespace.qdoc",
    "content": "\n//! [0]\nQObject::connect: Cannot queue arguments of type 'MyType'\n//! [0]\n\n\n//! [1]\n# An important event\nImportantEventPriority = Qt.HighEventPriority\n# A more important event\nMoreImportantEventPriority = ImportantEventPriority + 1\n# A critical event\nCriticalEventPriority = 100 * MoreImportantEventPriority\n# Not that important\nStatusEventPriority = Qt.LowEventPriority\n# These are less important than Status events\nIdleProcessingDoneEventPriority = StatusEventPriority - 1\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src.gui.text.qtextdocumentwriter.cpp",
    "content": "//! [0]\n        writer = QTextDocumentWriter()\n        writer.setFormat(\"odf\") # same as writer.setFormat(\"ODF\");\n//! [0]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingcall.cpp",
    "content": "{\n//! [0]\n    QDBusPendingCall async = iface->asyncCall(\"RemoteMethod\", value1, value2);\n    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);\n\n    QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),\n                     this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*)));\n//! [0]\n\n}\n\n//! [1]\nvoid MyClass::callFinishedSlot(QDBusPendingCallWatcher *call)\n{\n    QDBusPendingReply<QString, QByteArray> reply = *call;\n    if (reply.isError()) {\n        showError();\n    } else {\n        QString text = reply.argumentAt<0>();\n        QByteArray data = reply.argumentAt<1>();\n        showReply(text, data);\n    }\n}\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src.qdbus.qdbuspendingreply.cpp",
    "content": "{\n//! [0]\n    QDBusPendingReply<QString> reply = interface->asyncCall(\"RemoteMethod\");\n    reply.waitForFinished();\n    if (reply.isError())\n        // call failed. Show an error condition.\n        showError(reply.error());\n    else\n        // use the returned value\n        useValue(reply.value());\n//! [0]\n\n//! [2]\n    QDBusPendingReply<bool, QString> reply = interface->asyncCall(\"RemoteMethod\");\n    reply.waitForFinished();\n    if (!reply.isError()) {\n        if (reply.argumentAt<0>())\n            showSuccess(reply.argumentAt<1>());\n        else\n            showFailure(reply.argumentAt<1>());\n    }\n//! [2]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src.scripttools.qscriptenginedebugger.cpp",
    "content": "//! [0]\n    engine = QScriptEngine()\n    debugger = QScriptEngineDebugger()\n    debugger.attachTo(engine)\n//! [0]\n\n//! [1]\n    engine.evaluate(\"debugger\")\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp",
    "content": "//! [0]\nencodedString = QByteArray(\"...\")\ncodec = QTextCodec.codecForName(\"KOI8-R\")\nstring = codec.toUnicode(encodedString)\n//! [0]\n\n\n//! [1]\nstring = u\"...\"\ncodec = QTextCodec.codecForName(\"KOI8-R\")\nencodedString = codec.fromUnicode(string)\n//! [1]\n\n\n//! [2]\ncodec = QTextCodec.codecForName(\"Shift-JIS\")\ndecoder = codec.makeDecoder()\n\nstring = u''\nwhile new_data_available():\n    chunk = get_new_data()\n    string += decoder.toUnicode(chunk)\n\n//! [2]\n\n\n//! [3]\ndef main():\n    app = QApplication([])\n    QTextCodec.setCodecForTr(QTextCodec.codecForName(\"eucKR\"))\n    ...\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_codecs_qtextcodecplugin.cpp",
    "content": "//! [0]\n\ndef names(self):\n    return list = [\"IBM01140\", \"hp15-tw\"]\n\ndef createForName(name):\n    if (name == \"IBM01140\"):\n        return Ibm01140Codec()\n    else if (name == \"hp15-tw\"):\n        return Hp15TwCodec()\n    return None\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuture.cpp",
    "content": "//! [0]\nQFuture<QString> future = ...;\n\nQFuture<QString>::const_iterator i;\nfor (i = future.constBegin(); i != future.constEnd(); ++i)\n    cout << *i << endl;\n//! [0]\n\n\n//! [1]\nQFuture<QString> future;\n...\nQFutureIterator<QString> i(future);\nwhile (i.hasNext())\n    qDebug() << i.next();\n//! [1]\n\n\n//! [2]\nQFutureIterator<QString> i(future);\ni.toBack();\nwhile (i.hasPrevious())\n    qDebug() << i.previous();\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturesynchronizer.cpp",
    "content": "//! [0]\nvoid someFunction()\n{\n    QFutureSynchronizer<void> synchronizer;\n\n    ...\n\n    synchronizer.addFuture(QtConcurrent::run(anotherFunction));\n    synchronizer.addFuture(QtConcurrent::map(list, mapFunction));\n\n    return; // QFutureSynchronizer waits for all futures to finish\n}\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp",
    "content": "//! [0]\n// Instantiate the objects and connect to the finished signal.\nMyClass myObject;\nQFutureWatcher<int> watcher;\nconnect(&watcher, SIGNAL(finished()), &myObject, SLOT(handleFinished()));\n\n// Start the computation.\nQFuture<int> future = QtConcurrent::run(...);\nwatcher.setFuture(future);\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentexception.cpp",
    "content": "//! [0]\n\nclass MyException : public QtConcurrent::Exception\n{\npublic:\n    void raise() const { throw *this; }\n    Exception *clone() const { return new MyException(*this); }\n};\n\n//! [0]\n\n\n//! [1]\n\ntry  {\n    QtConcurrent::blockingMap(list, throwFunction); // throwFunction throws MyException\n} catch (MyException &e) {\n    // handle exception\n}\n\n//! [1]\n\n\n//! [2]\n\nvoid MyException::raise() const { throw *this; }\n\n//! [2]\n\n\n//! [3]\n\nMyException *MyException::clone() const { return new MyException(*this); }\n\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentfilter.cpp",
    "content": "//! [0]\nbool function(const T &t);\n//! [0]\n\n\n//! [1]\nbool allLowerCase(const QString &string)\n{\n    return string.lowered() == string;\n}\n\nQStringList strings = ...;\nQFuture<QString> lowerCaseStrings = QtConcurrent::filtered(strings, allLowerCase);\n//! [1]\n\n\n//! [2]\nQStringList strings = ...;\nQFuture<void> future = QtConcurrent::filter(strings, allLowerCase);\n//! [2]\n\n\n//! [3]\nV function(T &result, const U &intermediate)\n//! [3]\n\n\n//! [4]\nvoid addToDictionary(QSet<QString> &dictionary, const QString &string)\n{\n    dictionary.insert(string);\n}\n\nQStringList strings = ...;\nQFuture<QSet<QString> > dictionary = QtConcurrent::filteredReduced(strings, allLowerCase, addToDictionary);\n//! [4]\n\n\n//! [5]\nQStringList strings = ...;\nQFuture<QString> lowerCaseStrings = QtConcurrent::filtered(strings.constBegin(), strings.constEnd(), allLowerCase);\n\n// filter in-place only works on non-const iterators\nQFuture<void> future = QtConcurrent::filter(strings.begin(), strings.end(), allLowerCase);\n\nQFuture<QSet<QString> > dictionary = QtConcurrent::filteredReduced(strings.constBegin(), strings.constEnd(), allLowerCase, addToDictionary);\n//! [5]\n\n\n//! [6]\nQStringList strings = ...;\n\n// each call blocks until the entire operation is finished\nQStringList lowerCaseStrings = QtConcurrent::blockingFiltered(strings, allLowerCase);\n\n\nQtConcurrent::blockingFilter(strings, allLowerCase);\n\nQSet<QString> dictionary = QtConcurrent::blockingFilteredReduced(strings, allLowerCase, addToDictionary);\n//! [6]\n\n\n//! [7]\n// keep only images with an alpha channel\nQList<QImage> images = ...;\nQFuture<void> alphaImages = QtConcurrent::filter(strings, &QImage::hasAlphaChannel);\n\n// keep only gray scale images\nQList<QImage> images = ...;\nQFuture<QImage> grayscaleImages = QtConcurrent::filtered(images, &QImage::isGrayscale);\n\n// create a set of all printable characters\nQList<QChar> characters = ...;\nQFuture<QSet<QChar> > set = QtConcurrent::filteredReduced(characters, &QChar::isPrint, &QSet<QChar>::insert);\n//! [7]\n\n\n//! [8]\n// can mix normal functions and member functions with QtConcurrent::filteredReduced()\n\n// create a dictionary of all lower cased strings\nextern bool allLowerCase(const QString &string);\nQStringList strings = ...;\nQFuture<QSet<int> > averageWordLength = QtConcurrent::filteredReduced(strings, allLowerCase, QSet<QString>::insert);\n\n// create a collage of all gray scale images\nextern void addToCollage(QImage &collage, const QImage &grayscaleImage);\nQList<QImage> images = ...;\nQFuture<QImage> collage = QtConcurrent::filteredReduced(images, &QImage::isGrayscale, addToCollage);\n//! [8]\n\n\n//! [9]\nbool QString::contains(const QRegExp &regexp) const;\n//! [9]\n\n\n//! [10]\nboost::bind(&QString::contains, QRegExp(\"^\\\\S+$\")); // matches strings without whitespace\n//! [10]\n\n\n//! [11]\nbool contains(const QString &string)\n//! [11]\n\n\n//! [12]\nQStringList strings = ...;\nboost::bind(static_cast<bool(QString::*)(const QRegExp&)>( &QString::contains ), QRegExp(\"...\" ));\n//! [12]\n\n//! [13]\nstruct StartsWith\n{\n    StartsWith(const QString &string)\n    : m_string(string) { }\n\n    typedef bool result_type;\n\n    bool operator()(const QString &testString)\n    {\n        return testString.startsWith(m_string);\n    }\n\n    QString m_string;\n};\n\nQList<QString> strings = ...;\nQFuture<QString> fooString = QtConcurrent::filtered(images, StartsWith(QLatin1String(\"Foo\")));\n//! [13]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentmap.cpp",
    "content": "//! [0]\nU function(const T &t);\n//! [0]\n\n\n//! [1]\nQImage scaled(const QImage &image)\n{\n    return image.scaled(100, 100);\n}\n\nQList<QImage> images = ...;\nQFuture<QImage> thumbnails = QtConcurrent::mapped(images, scaled);\n//! [1]\n\n\n//! [2]\nU function(T &t);\n//! [2]\n\n\n//! [3]\nvoid scale(QImage &image)\n{\n    image = image.scaled(100, 100);\n}\n\nQList<QImage> images = ...;\nQFuture<void> future = QtConcurrent::map(images, scale);\n//! [3]\n\n\n//! [4]\nV function(T &result, const U &intermediate)\n//! [4]\n\n\n//! [5]\nvoid addToCollage(QImage &collage, const QImage &thumbnail)\n{\n    QPainter p(&collage);\n    static QPoint offset = QPoint(0, 0);\n    p.drawImage(offset, thumbnail);\n    offset += ...;\n}\n\nQList<QImage> images = ...;\nQFuture<QImage> collage = QtConcurrent::mappedReduced(images, scaled, addToCollage);\n//! [5]\n\n\n//! [6]\nQList<QImage> images = ...;\n\nQFuture<QImage> thumbnails = QtConcurrent::mapped(images.constBegin(), images.constEnd(), scaled);\n\n// map in-place only works on non-const iterators\nQFuture<void> future = QtConcurrent::map(images.begin(), images.end(), scale);\n\nQFuture<QImage> collage = QtConcurrent::mappedReduced(images.constBegin(), images.constEnd(), scaled, addToCollage);\n//! [6]\n\n\n//! [7]\nQList<QImage> images = ...;\n\n// each call blocks until the entire operation is finished\nQList<QImage> future = QtConcurrent::blockingMapped(images, scaled);\n\nQtConcurrent::blockingMap(images, scale);\n\nQImage collage = QtConcurrent::blockingMappedReduced(images, scaled, addToCollage);\n//! [7]\n\n\n//! [8]\n// squeeze all strings in a QStringList\nQStringList strings = ...;\nQFuture<void> squeezedStrings = QtConcurrent::map(strings, &QString::squeeze);\n\n// swap the rgb values of all pixels on a list of images\nQList<QImage> images = ...;\nQFuture<QImage> bgrImages = QtConcurrent::mapped(images, &QImage::rgbSwapped);\n\n// create a set of the lengths of all strings in a list\nQStringList strings = ...;\nQFuture<QSet<int> > wordLengths = QtConcurrent::mappedReduced(string, &QString::length, &QSet<int>::insert);\n//! [8]\n\n\n//! [9]\n// can mix normal functions and member functions with QtConcurrent::mappedReduced()\n\n// compute the average length of a list of strings\nextern void computeAverage(int &average, int length);\nQStringList strings = ...;\nQFuture<int> averageWordLength = QtConcurrent::mappedReduced(strings, &QString::length, computeAverage);\n\n// create a set of the color distribution of all images in a list\nextern int colorDistribution(const QImage &string);\nQList<QImage> images = ...;\nQFuture<QSet<int> > totalColorDistribution = QtConcurrent::mappedReduced(images, colorDistribution, QSet<int>::insert);\n//! [9]\n\n\n//! [10]\nQImage QImage::scaledToWidth(int width, Qt::TransformationMode) const;\n//! [10]\n\n\n//! [11]\nboost::bind(&QImage::scaledToWidth, 100, Qt::SmoothTransformation)\n//! [11]\n\n\n//! [12]\nQImage scaledToWith(const QImage &image)\n//! [12]\n\n\n//! [13]\nQList<QImage> images = ...;\nQFuture<QImage> thumbnails = QtConcurrent::mapped(images, boost::bind(&QImage::scaledToWidth, 100 Qt::SmoothTransformation));\n//! [13]\n\n//! [14]\nstruct Scaled\n{\n    Scaled(int size)\n    : m_size(size) { }\n\n    typedef QImage result_type;\n\n    QImage operator()(const QImage &image)\n    {\n        return image.scaled(m_size, m_size);\n    }\n\n    int m_size;\n};\n\nQList<QImage> images = ...;\nQFuture<QImage> thumbnails = QtConcurrent::mapped(images, Scaled(100));\n//! [14]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp",
    "content": "//! [0]\nextern void aFunction();\nQFuture<void> future = QtConcurrent::run(aFunction);\n//! [0]\n\n\n//! [1]\nextern void aFunctionWithArguments(int arg1, double arg2, const QString &string);\n\nint integer = ...;\ndouble floatingPoint = ...;\nQString string = ...;\n\nQFuture<void> future = QtConcurrent::run(aFunctionWithArguments, integer, floatingPoint, string);\n//! [1]\n\n\n//! [2]\nextern QString functionReturningAString();\nQFuture<QString> future = QtConcurrent::run(functionReturningAString);\n...\nQString result = future.result();\n//! [2]\n\n\n//! [3]\nextern QString someFunction(const QByteArray &input);\n\nQByteArray bytearray = ...;\n\nQFuture<QString> future = QtConcurrent::run(someFunction, bytearray);\n...\nQString result = future.result();\n//! [3]\n\n\n//! [4]\n// call 'QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const' in a separate thread\nQString string = ...;\nQFuture<QStringList> future = QtConcurrent::run(string, &QString::split, QString(\", \"), QString::KeepEmptyParts, Qt::CaseSensitive);\n...\nQStringList result = future.result();\n//! [4]\n\n\n//! [5]\n// call 'void QImage::invertPixels(InvertMode mode)' in a separate thread\nQImage image = ...;\nQFuture<void> future = QtConcurrent::run(image, &QImage::invertPixels, QImage::InvertRgba);\n...\nfuture.waitForFinished();\n// At this point, the pixels in 'image' have been inverted\n//! [5]\n\n\n//! [6]\nvoid someFunction(int arg1, double arg2);\nQFuture<void> future = QtConcurrent::run(boost::bind(someFunction, 1, 2.0));\n...\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp",
    "content": "//! [0]\nclass HelloWorldTask(QRunnable):\n    def run(self):\n        print \"Hello world from thread\", QThread.currentThread()\n\nhello = HelloWorldTask()\n# QThreadPool takes ownership and deletes 'hello' automatically\nQThreadPool.globalInstance().start(hello)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_global_qglobal.cpp",
    "content": "//! [0]\nlabel.setAlignment(Qt.AlignLeft | Qt.AlignTop)\n//! [0]\n\n\n//! [1]\nclass MyClass\n{\npublic:\n    enum Option {\n        NoOptions = 0x0,\n        ShowTabs = 0x1,\n        ShowAll = 0x2,\n        SqueezeBlank = 0x4\n    };\n    Q_DECLARE_FLAGS(Options, Option)\n    ...\n};\n\nQ_DECLARE_OPERATORS_FOR_FLAGS(MyClass::Options)\n//! [1]\n\n//! [meta-object flags]\nQ_FLAGS(Options)\n//! [meta-object flags]\n\n//! [2]\ntypedef QFlags<Enum> Flags;\n//! [2]\n\n\n//! [3]\nint myValue = 10;\nint minValue = 2;\nint maxValue = 6;\n\nint boundedValue = qBound(minValue, myValue, maxValue);\n// boundedValue == 6\n//! [3]\n\n\n//! [4]\nif (!driver()->isOpen() || driver()->isOpenError()) {\n    qWarning(\"QSqlQuery::exec: database not open\");\n    return false;\n}\n//! [4]\n\n\n//! [5]\nqint64 value = Q_INT64_C(932838457459459);\n//! [5]\n\n\n//! [6]\nquint64 value = Q_UINT64_C(932838457459459);\n//! [6]\n\n\n//! [7]\nvoid myMsgHandler(QtMsgType, const char *);\n//! [7]\n\n\n//! [8]\nqint64 value = Q_INT64_C(932838457459459);\n//! [8]\n\n\n//! [9]\nquint64 value = Q_UINT64_C(932838457459459);\n//! [9]\n\n\n//! [10]\nmyValue = -4\nabsoluteValue = qAbs(myValue)\n// absoluteValue == 4\n//! [10]\n\n\n//! [11]\nvalueA = 2.3\nvalueB = 2.7\n\nroundedValueA = qRound(valueA)\n// roundedValueA = 2\nroundedValueB = qRound(valueB)\n// roundedValueB = 3\n//! [11]\n\n\n//! [12]\nvalueA = 42949672960.3\nvalueB = 42949672960.7\n\nroundedValueA = qRound(valueA)\n// roundedValueA = 42949672960\nroundedValueB = qRound(valueB)\n// roundedValueB = 42949672961\n//! [12]\n\n\n//! [13]\nmyValue = 6\nyourValue = 4\n\nminValue = qMin(myValue, yourValue)\n// minValue == yourValue\n//! [13]\n\n\n//! [14]\nmyValue = 6\nyourValue = 4\n\nmaxValue = qMax(myValue, yourValue)\n// maxValue == myValue\n//! [14]\n\n\n//! [15]\nmyValue = 10\nminValue = 2\nmaxValue = 6\n\nboundedValue = qBound(minValue, myValue, maxValue)\n// boundedValue == 6\n//! [15]\n\n\n//! [16]\n#if QT_VERSION >= 0x040100\n    QIcon icon = style()->standardIcon(QStyle::SP_TrashIcon);\n#else\n    QPixmap pixmap = style()->standardPixmap(QStyle::SP_TrashIcon);\n    QIcon icon(pixmap);\n#endif\n//! [16]\n\n\n//! [17]\n// File: div.cpp\n\n#include <QtGlobal>\n\nint divide(int a, int b)\n{\n    Q_ASSERT(b != 0);\n    return a / b;\n}\n//! [17]\n\n\n//! [18]\nASSERT: \"b == 0\" in file div.cpp, line 7\n//! [18]\n\n\n//! [19]\n// File: div.cpp\n\n#include <QtGlobal>\n\nint divide(int a, int b)\n{\n    Q_ASSERT_X(b != 0, \"divide\", \"division by zero\");\n    return a / b;\n}\n//! [19]\n\n\n//! [20]\nASSERT failure in divide: \"division by zero\", file div.cpp, line 7\n//! [20]\n\n\n//! [21]\nint *a;\n\nQ_CHECK_PTR(a = new int[80]);   // WRONG!\n\na = new (nothrow) int[80];      // Right\nQ_CHECK_PTR(a);\n//! [21]\n\n\n//! [22]\ntemplate<typename TInputType>\nconst TInputType &myMin(const TInputType &value1, const TInputType &value2)\n{\n    qDebug() << Q_FUNC_INFO << \"was called with value1:\" << value1 << \"value2:\" << value2;\n\n    if(value1 < value2)\n        return value1;\n    else\n        return value2;\n}\n//! [22]\n\n\n//! [23]\n#include <qapplication.h>\n#include <stdio.h>\n#include <stdlib.h>\n\nvoid myMessageOutput(QtMsgType type, const char *msg)\n{\n    switch (type) {\n    case QtDebugMsg:\n        fprintf(stderr, \"Debug: %s\\n\", msg);\n        break;\n    case QtWarningMsg:\n        fprintf(stderr, \"Warning: %s\\n\", msg);\n        break;\n    case QtCriticalMsg:\n        fprintf(stderr, \"Critical: %s\\n\", msg);\n        break;\n    case QtFatalMsg:\n        fprintf(stderr, \"Fatal: %s\\n\", msg);\n        abort();\n    }\n}\n\nint main(int argc, char **argv)\n{\n    qInstallMsgHandler(myMessageOutput);\n    QApplication app(argc, argv);\n    ...\n    return app.exec();\n}\n//! [23]\n\n\n//! [24]\nqDebug(\"Items in list: %d\", myList.size());\n//! [24]\n\n\n//! [25]\nqDebug() << \"Brush:\" << myQBrush << \"Other value:\" << i;\n//! [25]\n\n\n//! [26]\nvoid f(int c)\n{\n    if (c > 200)\n        qWarning(\"f: bad argument, c == %d\", c);\n}\n//! [26]\n\n\n//! [27]\nqWarning() << \"Brush:\" << myQBrush << \"Other value:\"\n<< i;\n//! [27]\n\n\n//! [28]\nvoid load(const QString &fileName)\n{\n    QFile file(fileName);\n    if (!file.exists())\n        qCritical(\"File '%s' does not exist!\", qPrintable(fileName));\n}\n//! [28]\n\n\n//! [29]\nqCritical() << \"Brush:\" << myQBrush << \"Other\nvalue:\" << i;\n//! [29]\n\n\n//! [30]\nint divide(int a, int b)\n{\n    if (b == 0)                                // program error\n        qFatal(\"divide: cannot divide by zero\");\n    return a / b;\n}\n//! [30]\n\n\n//! [31]\nforever {\n    ...\n}\n//! [31]\n\n\n//! [32]\nCONFIG += no_keywords\n//! [32]\n\n\n//! [33]\nCONFIG += no_keywords\n//! [33]\n\n\n//! [34]\nQString FriendlyConversation::greeting(int type)\n{\nstatic const char *greeting_strings[] = {\n    QT_TR_NOOP(\"Hello\"),\n    QT_TR_NOOP(\"Goodbye\")\n};\nreturn tr(greeting_strings[type]);\n}\n//! [34]\n\n\n//! [35]\nstatic const char *greeting_strings[] = {\n    QT_TRANSLATE_NOOP(\"FriendlyConversation\", \"Hello\"),\n    QT_TRANSLATE_NOOP(\"FriendlyConversation\", \"Goodbye\")\n};\n\nQString FriendlyConversation::greeting(int type)\n{\n    return tr(greeting_strings[type]);\n}\n\nQString global_greeting(int type)\n{\n    return qApp->translate(\"FriendlyConversation\",\n           greeting_strings[type]);\n}\n//! [35]\n\n\n//! [36]\n\nstatic { const char *source; const char *comment; } greeting_strings[] =\n{\n    QT_TRANSLATE_NOOP3(\"FriendlyConversation\", \"Hello\",\n                       \"A really friendly hello\"),\n    QT_TRANSLATE_NOOP3(\"FriendlyConversation\", \"Goodbye\",\n                       \"A really friendly goodbye\")\n};\n\nQString FriendlyConversation::greeting(int type)\n{\n    return tr(greeting_strings[type].source,\n              greeting_strings[type].comment);\n}\n\nQString global_greeting(int type)\n{\n    return qApp->translate(\"FriendlyConversation\",\n           greeting_strings[type].source,\n           greeting_strings[type].comment);\n}\n//! [36]\n\n\n//! [37]\nqWarning(\"%s: %s\", qPrintable(key), qPrintable(value));\n//! [37]\n\n\n//! [38]\nstruct Point2D\n{\n    int x;\n    int y;\n};\n\nQ_DECLARE_TYPEINFO(Point2D, Q_PRIMITIVE_TYPE);\n//! [38]\n\n\n//! [39]\nclass Point2D\n{\npublic:\n    Point2D() { data = new int[2]; }\n    Point2D(const Point2D &other) { ... }\n    ~Point2D() { delete[] data; }\n\n    Point2D &operator=(const Point2D &other) { ... }\n\n    int x() const { return data[0]; }\n    int y() const { return data[1]; }\n\nprivate:\n    int *data;\n};\n\nQ_DECLARE_TYPEINFO(Point2D, Q_MOVABLE_TYPE);\n//! [39]\n\n\n//! [40]\n#if Q_BYTE_ORDER == Q_BIG_ENDIAN\n...\n#endif\n\nor\n\n#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN\n...\n#endif\n\n//! [40]\n\n\n//! [41]\n\n#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN\n...\n#endif\n\n//! [41]\n\n\n//! [42]\n#if Q_BYTE_ORDER == Q_BIG_ENDIAN\n...\n#endif\n\n//! [42]\n\n//! [begin namespace macro]\nnamespace QT_NAMESPACE {\n//! [begin namespace macro]\n\n//! [end namespace macro]\n}\n//! [end namespace macro]\n\n//! [43]\nclass MyClass : public QObject\n{\n\n  private:\n    Q_DISABLE_COPY(MyClass)\n};\n\n//! [43]\n\n//! [44]\nclass MyClass : public QObject\n{\n\n  private:\n     MyClass(const MyClass &);\n     MyClass &operator=(const MyClass &);\n};\n//! [44]\n\n//! [45]\n  w = QWidget()\n//! [45]\n\n//! [46]\n\t// Instead of comparing with 0.0\n\t\tqFuzzyCompare(0.0,1.0e-200); // This will return false\n\t// Compare adding 1 to both values will fix the problem\n\t\tqFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true\n//! [46]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp",
    "content": "//! [0]\nclass ZipEngineHandler(QAbstractFileEngineHandler):\n    def create(self, fileName):\n        # ZipEngineHandler returns a ZipEngine for all .zip files\n        if fileName.toLower().endsWith(\".zip\"):\n            return ZipEngine(fileName)\n        else\n            return None\n\ndef main():\n    app = QApplication(sys.argv)\n\n    engine = ZipEngineHandler()\n\n    window = MainWindow()\n    window.show()\n\n    return app.exec()\n//! [0]\n\n\n//! [1]\ndef create(fileName):\n    # ZipEngineHandler returns a ZipEngine for all .zip files\n    if fileName.lower().endswith(\".zip\"):\n        return ZipEngine(fileName)\n    else\n        return None\n//! [1]\n\n\n//! [2]\n# @arg filters QDir.Filters\n# @arg filterNames [str, ...]\n# @return QAbstractFileEngineIterator\ndef beginEntryList(filters, filterNames):\n    return CustomFileEngineIterator(filters, filterNames)\n//! [2]\n\n\n//! [3]\nclass CustomIterator(QAbstractFileEngineIterator):\n    def __init__(self, nameFilters, filters):\n        QAbstractFileEngineIterator.__init__(self, nameFilters, filters)\n\n        self.index = 0\n        # In a real iterator, these entries are fetched from the\n        # file system based on the value of path().\n        self.entries << \"entry1\" << \"entry2\" << \"entry3\"\n\n    def hasNext(self):\n        return self.index < self.entries.size() - 1\n\n    def next(self):\n       if not self.hasNext():\n           return None\n       index += 1\n       return currentFilePath()\n\n    def currentFileName(self):\n       return self.entries.at(index)\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdatastream.cpp",
    "content": "void wrapInFunction()\n{\n\n//! [0]\nfile_ = QFile(\"file.dat\")\nfile_.open(QIODevice.WriteOnly)\n# we will serialize the data into the file\nout = QDataStream(file_)\n# serialize a string\nout.writeQString(\"the answer is\")\n# serialize an integer\nout.writeInt32(42)\n//! [0]\n\n\n//! [1]\nfile_ = QFile(\"file.dat\")\nfile_.open(QIODevice.ReadOnly)\n# read the data serialized from the file\ni = QDataStream(file_)\nstring = ''\na = 0\n# extract \"the answer is\" and 42\nstring = i.readQString()\na = i.readInt32()\n//! [1]\n\n\n//! [2]\nstream.setVersion(QDataStream.Qt_4_0)\n//! [2]\n\n\n//! [3]\nfile_ = QFile(\"file.xxx\")\nfile_.open(QIODevice.WriteOnly)\nout = QDataStream(file_)\n\n# Write a header with a \"magic number\" and a version\nout.writeInt32(0xA0B0C0D0)\nout.writeInt32(123)\n\nout.setVersion(QDataStream.Qt_4_0)\n\n// Write the data\nout << lots_of_interesting_data\n//! [3]\n\n\n//! [4]\nfile_ = QFile(\"file.xxx\")\nfile_.open(QIODevice.ReadOnly)\ni = QDataStream(file_)\n\n// Read and check the header\nmagic = i.readInt32()\nif magic != 0xA0B0C0D0:\n    return XXX_BAD_FILE_FORMAT\n\n// Read the version\nversion = i.readInt32()\nif version < 100:\n    return XXX_BAD_FILE_TOO_OLD\nif version > 123:\n    return XXX_BAD_FILE_TOO_NEW\n\nif version <= 110:\n    in_.setVersion(QDataStream.Qt_3_2)\nelse:\n    in_.setVersion(QDataStream.Qt_4_0)\n\n// Read the data\nin_ >> lots_of_interesting_data\nif version >= 120:\n    in_ >> data_new_in_XXX_version_1_2\nin_ >> other_interesting_data\n//! [4]\n\n\n//! [5]\nout = QDataStream(file_)\nout.setVersion(QDataStream.Qt_4_0)\n//! [5]\n\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdir.cpp",
    "content": "\nvoid wrapInFunction()\n{\n\n//! [0]\nQDir(\"/home/user/Documents\")\nQDir(\"C:/Documents and Settings\")\n//! [0]\n\n\n//! [1]\nQDir(\"images/landscape.png\")\n//! [1]\n\n\n//! [2]\nQDir(\"Documents/Letters/Applications\").dirName() # \"Applications\"\nQDir().dirName()                                 # \".\"\n//! [2]\n\n\n//! [3]\ndirectory = QDir(\"Documents/Letters\")\npath = directory.filePath(\"contents.txt\")\nabsolutePath = directory.absoluteFilePath(\"contents.txt\")\n//! [3]\n\n\n//! [4]\ndir = QDir(\"example\")\nif not dir.exists():\n    print \"Cannot find the example directory\"\n//! [4]\n\n\n//! [5]\ndir = QDir.root()                 # \"/\"\nif not dir.cd(\"tmp\"):             # \"/tmp\"\n    print \"Cannot find the \\\"/tmp\\\" directory\"\nelse:\n    file = QFile(dir.filePath(\"ex1.txt\"))   # \"/tmp/ex1.txt\"\n    if !file.open(QIODevice.ReadWrite):\n        print \"Cannot create the file %s\" % (file.name())\n//! [5]\n\n\n//! [6]\nbin = \"/local/bin\"         # where /local/bin is a symlink to /usr/bin\nbinDir = QDir(bin)\ncanonicalBin = binDir.canonicalPath()\n# canonicalBin now equals \"/usr/bin\"\n\nls = \"/local/bin/ls\"       # where ls is the executable \"ls\"\nlsDir = QDir(ls)\ncanonicalLs = lsDir.canonicalPath()\n# canonicalLS now equals \"/usr/bin/ls\".\n//! [6]\n\n\n//! [7]\ndir = QDir(\"/home/bob\")\n\ns = dir.relativeFilePath(\"images/file.jpg\")         # s is \"images/file.jpg\"\ns = dir.relativeFilePath(\"/home/mary/file.txt\")     # s is \"../mary/file.txt\"\n//! [7]\n\n\n//! [8]\nQDir.setSearchPaths(\"icons\", [QDir.homePath() + \"/images\"])\nQDir.setSearchPaths(\"docs\", [\":/embeddedDocuments\"])\n...\npixmap = QPixmap(\"icons:undo.png\")  # will look for undo.png in QDir::homePath() + \"/images\"\nfile = QFile(\"docs:design.odf\")     # will look in the :/embeddedDocuments resource path\n//! [8]\n\n\n//! [9]\ndir = QDir(\"/tmp/root_link\")\ndir = dir.canonicalPath()\nif dir.isRoot():\n    print \"It is a root link\"\n//! [9]\n\n\n//! [10]\n# The current directory is \"/usr/local\"\nd1 = QDir(\"/usr/local/bin\")\nd2 = QDir(\"bin\")\nif d1 == d2:\n    print \"They're the same\"\n//! [10]\n\n\n//! [11]\n// The current directory is \"/usr/local\"\nd1 = QDir(\"/usr/local/bin\")\nd1.setFilter(QDir.Executable)\nd2 = QDir(\"bin\")\nif d1 != d2:\n    print \"They differ\"\n//! [11]\n\n\n//! [12]\nC:/Documents and Settings/Username\n//! [12]\n\n\n//! [13]\nQ_INIT_RESOURCE(myapp);\n//! [13]\n\n\n//! [14]\ndef initMyResource():\n    Q_INIT_RESOURCE(myapp)\n\nclass MyNamespace\n    ...\n\n    def myFunction(self):\n        initMyResource()\n//! [14]\n\n\n//! [15]\nQ_CLEANUP_RESOURCE(myapp);\n//! [15]\n\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp",
    "content": "//! [0]\nit = QDirIterator(\"/etc\", QDirIterator.Subdirectories)\nwhile it.hasNext():\n    print it.next()\n\n    # /etc/.\n    # /etc/..\n    # /etc/X11\n    # /etc/X11/fs\n    # ...\n\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfile.cpp",
    "content": "//! [0]\nfile = QFile()\nQDir.setCurrent(\"/tmp\")\nfile.setFileName(\"readme.txt\")\nQDir.setCurrent(\"/home\")\nfile.open(QIODevice.ReadOnly)       # opens \"/home/readme.txt\" under Unix\n//! [0]\n\n\n//! [1]\ndef myEncoderFunc(fileName):\n//! [1]\n\n\n//! [2]\ndef myDecoderFunc(localFileName):\n//! [2]\n\n\n//! [3]\n\ndef printError(msg):\n    file = QFile()\n    file.open(sys.stderr.fileno(), QIODevice.WriteOnly)\n    file.write(msg, size(msg))                  # write to stderr\n    file.close()\n//! [3]\n\n\n//! [4]\nCONFIG += console\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qfileinfo.cpp",
    "content": "\n//![newstuff]\n    fi = QFileInfo(\"c:/temp/foo\") => fi.absoluteFilePath() => \"C:/temp/foo\"\n//![newstuff]\n\n//! [0]\ninfo1 = QFileInfo(\"/home/bob/bin/untabify\")\ninfo1.isSymLink()           # returns true\ninfo1.absoluteFilePath()    # returns \"/home/bob/bin/untabify\"\ninfo1.size()                # returns 56201\ninfo1.symLinkTarget()       # returns \"/opt/pretty++/bin/untabify\"\n\ninfo2 = QFileInfo(info1.symLinkTarget())\ninfo1.isSymLink()           # returns False\ninfo1.absoluteFilePath()    # returns \"/opt/pretty++/bin/untabify\"\ninfo1.size()                # returns 56201\n\n//! [0]\n\n\n//! [1]\ninfo1 = QFileInfo(\"C:\\\\Documents and Settings\\\\Bob\\\\untabify.lnk\")\ninfo1.isSymLink()           # returns True\ninfo1.absoluteFilePath()    # returns \"C:/Documents and Settings/Bob/untabify.lnk\"\ninfo1.size()                # returns 743\ninfo1.symLinkTarget()       # returns \"C:/Pretty++/untabify\"\n\ninfo2 = QFileInfo(info1.symLinkTarget())\ninfo1.isSymLink()           # returns False\ninfo1.absoluteFilePath()    # returns \"C:/Pretty++/untabify\"\ninfo1.size()                # returns 63942\n//! [1]\n\n\n//! [2]\nabsolute = \"/local/bin\"\nrelative = \"local/bin\"\nabsFile = QFileInfo(absolute)\nrelFile = QFileInfo(relative)\n\nQDir.setCurrent(QDir.rootPath())\n# absFile and relFile now point to the same file\n\nQDir.setCurrent(\"/tmp\")\n# absFile now points to \"/local/bin\",\n# while relFile points to \"/tmp/local/bin\"\n//! [2]\n\n\n//! [3]\nfi = QFileInfo(\"/tmp/archive.tar.gz\")\nname = fi.fileName()                    # name = \"archive.tar.gz\"\n//! [3]\n\n\n//! [4]\nfi = QFileInfo(\"/Applications/Safari.app\")\nbundle = fi.bundleName()                # name = \"Safari\"\n//! [4]\n\n\n//! [5]\nfi = QFileInfo(\"/tmp/archive.tar.gz\")\nbase = fi.baseName()                    # base = \"archive\"\n//! [5]\n\n\n//! [6]\nfi = QFileInfo(\"/tmp/archive.tar.gz\")\nbase = fi.completeBaseName()            # base = \"archive.tar\"\n//! [6]\n\n\n//! [7]\nfi = QFileInfo(\"/tmp/archive.tar.gz\")\next = fi.completeSuffix()               # ext = \"tar.gz\"\n//! [7]\n\n\n//! [8]\nfi = QFileInfo(\"/tmp/archive.tar.gz\")\next = fi.suffix();                      # ext = \"gz\"\n//! [8]\n\n\n//! [9]\ninfo = QFileInfo(fileName)\nif info.isSymLink():\n    fileName = info.symLinkTarget()\n//! [9]\n\n\n//! [10]\nfi = QFileInfo(\"/tmp/archive.tar.gz\")\nif fi.permission(QFile.WriteUser | QFile.ReadGroup):\n    print \"I can change the file; my group can read the file\"\nif fi.permission(QFile.WriteGroup | QFile.WriteOther):\n    print \"The group or others can change the file\"\n//! [10]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qiodevice.cpp",
    "content": "//! [0]\ngzip = QProcess()\ngzip.start(\"gzip\", [\"-c\"])\nif not gzip.waitForStarted():\n    return False\n\ngzip.write(\"uncompressed data\")\n\ncompressed = QByteArray()\nwhile gzip.waitForReadyRead():\n    compressed += gzip.readAll()\n//! [0]\n\n\n//! [1]\ndef bytesAvailable(self):\n    return buffer.size() + QIODevice.bytesAvailable()\n//! [1]\n\n\n//! [2]\nfile = QFile(\"box.txt\")\nif file.open(QFile.ReadOnly):\n    buf = file.readLine(1024)\n    if buf.size():\n        # the line is available in buf\n//! [2]\n\n\n//! [3]\ndef canReadLine(self):\n    return buffer.contains('\\n') or QIODevice.canReadLine()\n//! [3]\n\n\n//! [4]\ndef isExeFile(file_):\n    buf = file_.peek(2)\n    if buf.size() == 2:\n        return buf[0] == 'M' and buf[1] == 'Z'\n    return False\n//! [4]\n\n\n//! [5]\ndef isExeFile(file_):\n    return file_.peek(2) == \"MZ\"\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qprocess.cpp",
    "content": "\ndef wrapInFunction():\n\n//! [0]\nbuilder = QProcess()\nbuilder.setProcessChannelMode(QProcess.MergedChannels)\nbuilder.start(\"make\", [\"-j2\"])\n\nimport sys\nif not builder.waitForFinished():\n    sys.stderr.write(\"Make failed:\" + builder.errorString())\nelse\n    sys.stderr.write(\"Make output:\" + builder.readAll())\n//! [0]\n\n\n//! [1]\nmore = QProcess()\nmore.start(\"more\")\nmore.write(\"Text to display\")\nmore.closeWriteChannel()\n#QProcess will emit readyRead() once \"more\" starts printing\n//! [1]\n\n\n//! [2]\ncommand1 | command2\n//! [2]\n\n\n//! [3]\nprocess1 = QProcess()\nprocess2 = QProcess()\n\nprocess1.setStandardOutputProcess(process2)\n\nprocess1.start(\"command1\")\nprocess2.start(\"command2\")\n//! [3]\n\n\n//! [4]\nclass SandboxProcess(QProcess):\n    def setupChildProcess(self)\n        # Drop all privileges in the child process, and enter\n        # a chroot jail.\n        os.setgroups(0, 0)\n        os.chroot(\"/etc/safe\")\n        os.chdir(\"/\")\n        os.setgid(safeGid)\n        os.setuid(safeUid)\n        os.umask(0)\n\n//! [4]\n\n\n//! [5]\nprocess = QProcess()\nprocess.start(\"del /s *.txt\")\n# same as process.start(\"del\", [\"/s\", \"*.txt\"])\n...\n//! [5]\n\n\n//! [6]\nprocess = QProcess()\nprocess.start(\"dir \\\"My Documents\\\"\")\n//! [6]\n\n\n//! [7]\nprocess = QProcess()\nprocess.start(\"dir \\\"\\\"\\\"My Documents\\\"\\\"\\\"\")\n//! [7]\n\n\n//! [8]\nenvironment = QProcess.systemEnvironment()\n# environment = [PATH=/usr/bin:/usr/local/bin\",\n#                \"USER=greg\", \"HOME=/home/greg\"]\n//! [8]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qsettings.cpp",
    "content": "//! [0]\nsettings = QSettings(\"MySoft\", \"Star Runner\")\ncolor = QColor(settings.value(\"DataPump/bgcolor\"))\n//! [0]\n\n\n//! [1]\nsettings = QSettings(\"MySoft\", \"Star Runner\")\ncolor = palette().background().color()\nsettings.setValue(\"DataPump/bgcolor\", color)\n//! [1]\n\n\n//! [2]\nsettings = QSettings(\"/home/petra/misc/myapp.ini\",\n                     QSettings.IniFormat)\n//! [2]\n\n\n//! [3]\nsettings = QSettings(\"/Users/petra/misc/myapp.plist\",\n                     QSettings.NativeFormat)\n//! [3]\n\n\n//! [4]\nsettings = QSettings(\"HKEY_CURRENT_USER\\\\Software\\\\Microsoft\\\\Office\",\n                     QSettings.NativeFormat)\n//! [4]\n\n\n//! [5]\nsettings.setValue(\"11.0/Outlook/Security/DontTrustInstalledFiles\", 0)\n//! [5]\n\n\n//! [6]\nsettings.setValue(\"HKEY_CURRENT_USER\\\\MySoft\\\\Star Runner\\\\Galaxy\", \"Milkyway\")\nsettings.setValue(\"HKEY_CURRENT_USER\\\\MySoft\\\\Star Runner\\\\Galaxy\\\\Sun\", \"OurStar\")\nsettings.value(\"HKEY_CURRENT_USER\\\\MySoft\\\\Star Runner\\\\Galaxy\\\\Default\")   # returns \"Milkyway\"\n//! [6]\n\n\n//! [7]\n#ifdef Q_WS_MAC\n    settings = QSettings(\"grenoullelogique.fr\", \"Squash\")\n#else\n    settings = QSettings(\"Grenoulle Logique\", \"Squash\")\n#endif\n//! [7]\n\n\n//! [8]\npos = @Point(100 100)\n//! [8]\n\n\n//! [9]\nwindir = C:\\Windows\n//! [9]\n\n\n//! [10]\nsettings = QSettings(\"Moose Tech\", \"Facturo-Pro\")\n//! [10]\n\n\n//! [11]\nsettings = QSettings(\"Moose Soft\", \"Facturo-Pro\")\n//! [11]\n\n\n//! [12]\nQCoreApplication.setOrganizationName(\"Moose Soft\")\nQCoreApplication.setApplicationName(\"Facturo-Pro\")\nsettings = QSettings()\n//! [12]\n\n\n//! [13]\nsettings.beginGroup(\"mainwindow\")\nsettings.setValue(\"size\", win.size())\nsettings.setValue(\"fullScreen\", win.isFullScreen())\nsettings.endGroup()\n\nsettings.beginGroup(\"outputpanel\")\nsettings.setValue(\"visible\", panel.isVisible())\nsettings.endGroup()\n//! [13]\n\n\n//! [14]\nsettings.beginGroup(\"alpha\")\n# settings.group() == \"alpha\"\n\nsettings.beginGroup(\"beta\")\n# settings.group() == \"alpha/beta\"\n\nsettings.endGroup()\n# settings.group() == \"alpha\"\n\nsettings.endGroup()\n# settings.group() == \"\"\n//! [14]\n\n\n//! [15]\nclass Login:\n    userName = ''\n    password = ''\n\n    logins = []\n    ...\n\n    settings = QSettings()\n    size = settings.beginReadArray(\"logins\")\n    for i in range(size):\n        settings.setArrayIndex(i)\n        login = Login()\n        login.userName = settings.value(\"userName\")\n        login.password = settings.value(\"password\")\n        logins.append(login)\n\n    settings.endArray()\n//! [15]\n\n\n//! [16]\nclass Login:\n    userName = ''\n    password = ''\n\n    logins = []\n    ...\n\n    settings = QSettings()\n    settings.beginWriteArray(\"logins\")\n    for i in range(logins.size()):\n        settings.setArrayIndex(i)\n        settings.setValue(\"userName\", list.at(i).userName)\n        settings.setValue(\"password\", list.at(i).password)\n\n    settings.endArray()\n//! [16]\n\n\n//! [17]\nsettings = QSettings()\nsettings.setValue(\"fridge/color\", Qt.white)\nsettings.setValue(\"fridge/size\", QSize(32, 96))\nsettings.setValue(\"sofa\", True)\nsettings.setValue(\"tv\", False)\n\nkeys = settings.allKeys();\n# keys: [\"fridge/color\", \"fridge/size\", \"sofa\", \"tv\"]\n//! [17]\n\n\n//! [18]\nsettings.beginGroup(\"fridge\")\nkeys = settings.allKeys()\n# keys: [\"color\", \"size\"]\n//! [18]\n\n\n//! [19]\nsettings = QSettings()\nsettings.setValue(\"fridge/color\", Qt.white)\nsettings.setValue(\"fridge/size\", QSize(32, 96))\nsettings.setValue(\"sofa\", True)\nsettings.setValue(\"tv\", False)\n\nkeys = settings.childKeys()\n# keys: [\"sofa\", \"tv\"]\n//! [19]\n\n\n//! [20]\nsettings.beginGroup(\"fridge\")\nkeys = settings.childKeys()\n# keys: [\"color\", \"size\"]\n//! [20]\n\n\n//! [21]\nsettings = QSettings()\nsettings.setValue(\"fridge/color\", Qt.white)\nsettings.setValue(\"fridge/size\", QSize(32, 96));\nsettings.setValue(\"sofa\", True)\nsettings.setValue(\"tv\", False)\n\ngroups = settings.childGroups()\n# group: [\"fridge\"]\n//! [21]\n\n\n//! [22]\nsettings.beginGroup(\"fridge\")\ngroups = settings.childGroups()\n# groups: []\n//! [22]\n\n\n//! [23]\nsettings = QSettings()\nsettings.setValue(\"interval\", 30)\nsettings.value(\"interval\")      # returns 30\n\nsettings.setValue(\"interval\", 6.55)\nsettings.value(\"interval\")  # returns 6.55\n//! [23]\n\n\n//! [24]\nsettings = QSettings()\nsettings.setValue(\"ape\")\nsettings.setValue(\"monkey\", 1)\nsettings.setValue(\"monkey/sea\", 2)\nsettings.setValue(\"monkey/doe\", 4)\n\nsettings.remove(\"monkey\")\nkeys = settings.allKeys()\n# keys: [\"ape\"]\n//! [24]\n\n\n//! [25]\nsettings = QSettings()\nsettings.setValue(\"ape\")\nsettings.setValue(\"monkey\", 1)\nsettings.setValue(\"monkey/sea\", 2)\nsettings.setValue(\"monkey/doe\", 4)\n\nsettings.beginGroup(\"monkey\")\nsettings.remove(\"\")\nsettings.endGroup()\n\nkeys = settings.allKeys()\n# keys: [\"ape\"]\n//! [25]\n\n\n//! [26]\nsettings = QSettings()\nsettings.setValue(\"animal/snake\", 58)\nsettings.value(\"animal/snake\", 1024)   # returns 58\nsettings.value(\"animal/zebra\", 1024)   # returns 1024\nsettings.value(\"animal/zebra\")         # returns 0\n//! [26]\n\n\n//! [27]\n# @arg device QIODevice\n# @arg map QSettings.SettingsMap\n# @return bool\ndef myReadFunc(device, map):\n//! [27]\n\n\n//! [28]\n# @arg device QIODevice\n# @arg map QSettings.SettingsMap\n# @return bool\ndef myWriteFunc(device, map)\n//! [28]\n\n\n//! [29]\n# @arg device QIODevice\n# @arg map QSettings.SettingsMap\n# @return bool\ndef readXmlFile(device, map):\ndef writeXmlFile(device, map):\n\ndef main():\n    XmlFormat = QSettings::registerFormat(\"xml\", readXmlFile, writeXmlFile)\n    settings = QSettings(XmlFormat, QSettings.UserSettings,\n                         \"MySoft\", \"Star Runner\")\n    ...\n//! [29]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp",
    "content": "{\n//! [0]\n    # Within a function/method...\n\n    file_ = QTemporaryFile()\n    if file_.open():\n        # file_.fileName() returns the unique file name\n\n    # The QTemporaryFile destructor removes the temporary file\n    # as it goes out of scope.\n//! [0]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qtextstream.cpp",
    "content": "//! [0]\ndata = QFile(\"output.txt\")\nif data.open(QFile.WriteOnly | QFile.Truncate):\n    out = QTextStream(&data)\n    out << \"Result: \" << qSetFieldWidth(10) << left << 3.14 << 2.7\n    # writes \"Result: 3.14      2.7       \"\n\n//! [0]\n\n\n//! [1]\nstream = QTextStream(sys.stdin.fileno())\n\nwhile(True):\n    line = stream.readLine()\n    if line.isNull():\n        break;\n//! [1]\n\n\n//! [2]\nin_ = QTextStream(\"0x50 0x20\")\nfirstNumber = 0\nsecondNumber = 0\n\nin_ >> firstNumber             # firstNumber == 80\nin_ >> dec >> secondNumber     # secondNumber == 0\n\nch = None\nin_ >> ch                      # ch == 'x'\n//! [2]\n\n\n//! [3]\ndef main():\n    # read numeric arguments (123, 0x20, 4.5...)\n    for i in sys.argv():\n          number = None\n          QTextStream in_(i)\n          in_ >> number\n          ...\n//! [3]\n\n\n//! [4]\nstr = QString()\nin_ = QTextStream(sys.stdin.fileno())\nin_ >> str\n//! [4]\n\n\n//! [5]\ns = QString()\nout = QTextStream(s)\nout.setFieldWidth(10)\nout.setFieldAlignment(QTextStream::AlignCenter)\nout.setPadChar('-')\nout << \"Qt\" << \"rocks!\"\n//! [5]\n\n\n//! [6]\n----Qt------rocks!--\n//! [6]\n\n\n//! [7]\nin_ = QTextStream(file)\nch1 = QChar()\nch2 = QChar()\nch3 = QChar()\nin_ >> ch1 >> ch2 >> ch3;\n//! [7]\n\n\n//! [8]\nout = QTextStream(sys.stdout.fileno())\nout << \"Qt rocks!\" << endl\n//! [8]\n\n\n//! [9]\nstream << '\\n' << flush\n//! [9]\n\n\n//! [10]\nout = QTextStream(file)\nout.setCodec(\"UTF-8\")\n//! [10]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_io_qurl.cpp",
    "content": "//! [0]\nurl = QUrl(\"http://www.example.com/List of holidays.xml\")\n# url.toEncoded() == \"http://www.example.com/List%20of%20holidays.xml\"\n//! [0]\n\n\n//! [1]\nurl = QUrl.fromEncoded(\"http://qtsoftware.com/List%20of%20holidays.xml\")\n//! [1]\n\n\n//! [2]\ndef checkUrl(url):\n    if !url.isValid():\n        print \"Invalid URL: %s\" % url.toString()\n        return False\n\n    return True\n\n//! [2]\n\n\n//! [3]\nftp = QFtp()\nftp.connectToHost(url.host(), url.port(21))\n//! [3]\n\n\n//! [4]\nhttp://www.example.com/cgi-bin/drawgraph.cgi?type-pie/color-green\n//! [4]\n\n\n//! [5]\nbaseUrl = QUrl(\"http://qtsoftware.com/support\")\nrelativeUrl = QUrl(\"../products/solutions\")\nprint baseUrl.resolved(relativeUrl).toString()\n# prints \"http://qtsoftware.com/products/solutions\"\n//! [5]\n\n\n//! [6]\nba = QUrl.toPercentEncoding(\"{a fishy string?}\", \"{}\", \"s\")\nprint ba\n# prints \"{a fi%73hy %73tring%3F}\"\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp",
    "content": "//! [0]\nbool myEventFilter(void *message);\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp",
    "content": "//! [0]\nbeginInsertRows(parent, 2, 4)\n//! [0]\n\n\n//! [1]\nbeginInsertRows(parent, 4, 5)\n//! [1]\n\n\n//! [2]\nbeginRemoveRows(parent, 2, 3)\n//! [2]\n\n\n//! [3]\nbeginInsertColumns(parent, 4, 6)\n//! [3]\n\n\n//! [4]\nbeginInsertColumns(parent, 6, 8)\n//! [4]\n\n\n//! [5]\nbeginRemoveColumns(parent, 4, 6)\n//! [5]\n\n\n//! [6]\nbeginMoveRows(sourceParent, 2, 4, destinationParent, 2)\n//! [6]\n\n\n//! [7]\nbeginMoveRows(sourceParent, 2, 4, destinationParent, 6)\n//! [7]\n\n\n//! [8]\nbeginMoveRows(parent, 2, 2, parent, 0)\n//! [8]\n\n\n//! [9]\nbeginMoveRows(parent, 2, 2, parent, 4)\n//! [9]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp",
    "content": "//! [0]\nevent = QMouseEvent(QEvent.MouseButtonPress, pos, 0, 0, 0)\nQApplication.sendEvent(mainWindow, event)\n//! [0]\n\n\n//! [1]\nquitButton = QPushButton(\"Quit\")\nquitButton.clicked.connect(app.quit)\n//! [1]\n\n\n//! [2]\nfor path in app.libraryPaths():\n    do_something(path)\n//! [2]\n\n\n//! [3]\nmyEventFilter(message, result)\n//! [3]\n\n\n//! [4]\ndef cleanup_stuff():\n    # do the cleanup stuff\n\ndef init_stuff():\n    qAddPostRoutine(cleanup_stuff)\n//! [4]\n\n\n//! [5]\nclass MyPrivateInitStuff : public QObject\n{\npublic:\n    static MyPrivateInitStuff *initStuff(QObject *parent)\n    {\n        if (!p)\n            p = new MyPrivateInitStuff(parent);\n        return p;\n    }\n\n    ~MyPrivateInitStuff()\n    {\n        // cleanup goes here\n    }\n\nprivate:\n    MyPrivateInitStuff(QObject *parent)\n        : QObject(parent)\n    {\n        // initialization goes here\n    }\n\n    MyPrivateInitStuff *p;\n};\n//! [5]\n\n\n//! [6]\nstatic inline QString tr(const char *sourceText,\n                         const char *comment = 0);\nstatic inline QString trUtf8(const char *sourceText,\n                             const char *comment = 0);\n//! [6]\n\n\n//! [7]\nclass MyMfcView : public CView\n{\n    Q_DECLARE_TR_FUNCTIONS(MyMfcView)\n\npublic:\n    MyMfcView();\n    ...\n};\n//! [7]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp",
    "content": "\nvoid wrapInFunction()\n{\n\n//! [0]\nclass MyClass:\n\n    Q_CLASSINFO(\"author\", \"Sabrina Schweinsteiger\")\n    Q_CLASSINFO(\"url\", \"http://doc.moosesoft.co.uk/1.0/\")\n\n    ...\n//! [0]\n\n\n//! [1]\nnormType = QMetaObject.normalizedType(\" int    const  *\")\n# normType is now \"const int*\"\n//! [1]\n\n\n//! [2]\nQMetaObject.invokeMethod(pushButton, \"animateClick\",\n                         Qt.QueuedConnection)\n//! [2]\n\n\n//! [3]\nQMetaObject.invokeMethod: Unable to handle unregistered datatype 'MyType'\n//! [3]\n\n\n//! [4]\nretVal = QString()\nQMetaObject.invokeMethod(obj, \"compute\", Qt::DirectConnection,\n                         Q_RETURN_ARG(QString, retVal),\n                         Q_ARG(QString, \"sqrt\"),\n                         Q_ARG(int, 42),\n                         Q_ARG(double, 9.7));\n//! [4]\n\n\n//! [5]\nclass MyClass:\n    Q_CLASSINFO(\"author\", \"Sabrina Schweinsteiger\")\n    Q_CLASSINFO(\"url\", \"http://doc.moosesoft.co.uk/1.0/\")\n//! [5]\n\n\n//! [propertyCount]\nmetaObject = obj.metaObject()\nproperties = [metaObject.property(i).name() for i in range(metaObject.propertyOffset(), metaObject.propertyCount())]\n//! [propertyCount]\n\n\n//! [methodCount]\nmetaObject = obj.metaObject()\nmethods = [metaObject.method(i).signature() for i in range(metaObject.methodOffset(), metaObject.methodCount())]\n//! [methodCount]\n\n//! [6]\nmethodIndex = pushButton.metaObject().indexOfMethod(\"animateClick()\")\nmethod = metaObject.method(methodIndex)\nmethod.invoke(pushButton, Qt.QueuedConnection)\n//! [6]\n\n//! [7]\nQMetaMethod.invoke: Unable to handle unregistered datatype 'MyType'\n//! [7]\n\n//! [8]\nretVal = QString()\nnormalizedSignature = QMetaObject.normalizedSignature(\"compute(QString, int, double)\")\nmethodIndex = obj.metaObject().indexOfMethod(normalizedSignature)\nmethod = metaObject.method(methodIndex)\nmethod.invoke(obj,\n              Qt.DirectConnection,\n              Q_RETURN_ARG(QString, retVal),\n              Q_ARG(QString, \"sqrt\"),\n              Q_ARG(int, 42),\n              Q_ARG(double, 9.7));\n//! [8]\n\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp",
    "content": "//! [0]\nstruct MyStruct\n{\n    int i;\n    ...\n};\n\nQ_DECLARE_METATYPE(MyStruct)\n//! [0]\n\n\n//! [1]\nnamespace MyNamespace\n{\n    ...\n}\n\nQ_DECLARE_METATYPE(MyNamespace::MyStruct)\n//! [1]\n\n\n//! [2]\nMyStruct s;\nQVariant var;\nvar.setValue(s); // copy s into the variant\n\n...\n\n// retrieve the value\nMyStruct s2 = var.value<MyStruct>();\n//! [2]\n\n\n//! [3]\nint id = QMetaType::type(\"MyClass\");\nif (id == 0) {\n    void *myClassPtr = QMetaType::construct(id);\n    ...\n    QMetaType::destroy(id, myClassPtr);\n    myClassPtr = 0;\n}\n//! [3]\n\n\n//! [4]\nqRegisterMetaType<MyClass>(\"MyClass\");\n//! [4]\n\n\n//! [5]\nqRegisterMetaTypeStreamOperators<MyClass>(\"MyClass\");\n//! [5]\n\n\n//! [6]\nQDataStream &operator<<(QDataStream &out, const MyClass &myObj);\nQDataStream &operator>>(QDataStream &in, MyClass &myObj);\n//! [6]\n\n\n//! [7]\nint id = qRegisterMetaType<MyStruct>();\n//! [7]\n\n\n//! [8]\nint id = qMetaTypeId<QString>();    // id is now QMetaType::QString\nid = qMetaTypeId<MyStruct>();       // compile error if MyStruct not declared\n//! [8]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp",
    "content": "//! [0]\ndef dragEnterEvent(self, event):\n    if event.mimeData().hasUrls():\n        event.acceptProposedAction()\n\ndef dropEvent(self, event):\n    if event->mimeData().hasUrls():\n        for url in event.mimeData().urls():\n            ...\n//! [0]\n\n\n//! [1]\ncsvData = QByteArray(...)\n\nmimeData = QMimeData()\nmimeData.setData(\"text/csv\", csvData)\n//! [1]\n\n\n//! [2]\ndef dropEvent(self, event):\n    myData = event->mimeData()\n    if myData:\n        # access myData's data directly (not through QMimeData's API)\n}\n//! [2]\n\n\n//! [3]\napplication/x-qt-windows-mime;value=\"<custom type>\"\n//! [3]\n\n\n//! [4]\napplication/x-qt-windows-mime;value=\"FileGroupDescriptor\"\napplication/x-qt-windows-mime;value=\"FileContents\"\n//! [4]\n\n\n//! [5]\nif event.mimeData().hasImage():\n    image = QImage(event.mimeData().imageData())\n    ...\n//! [5]\n\n\n//! [6]\nmimeData.setImageData(QImage(\"beautifulfjord.png\"))\n//! [6]\n\n\n//! [7]\nif event.mimeData().hasColor():\n    color = QColor(event.mimeData().colorData())\n    ...\n//! [7]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qobject.cpp",
    "content": "//! [0]\nlineEdit = qt_find_obj_child(myWidget, \"QLineEdit\", \"my line edit\")\nif lineEdit:\n    lineEdit.setText(\"Default\")\n//! [0]\n\n\n//! [1]\nobj = QPushButton()\nobj.metaObject().className()                # returns \"QPushButton\"\n\nQPushButton.staticMetaObject.className()    # returns \"QPushButton\"\n//! [1]\n\n\n//! [2]\nQPushButton.staticMetaObject.className()    # returns \"QPushButton\"\n\nobj = QPushButton()\nobj.metaObject().className()                # returns \"QPushButton\"\n//! [2]\n\n\n//! [3]\nobj = QTimer()                              # QTimer inherits QObject\n\ntimer = obj\n# timer == (QObject *)obj\n\nbutton = obj\n# button == 0\n//! [3]\n\n\n//! [4]\ntimer = QTimer()                    # QTimer inherits QObject\ntimer.inherits(\"QTimer\")            # returns true\ntimer.inherits(\"QObject\")           # returns true\ntimer.inherits(\"QAbstractButton\")   # returns false\n\n# QLayout inherits QObject and QLayoutItem\nlayout = QLayout()\nlayout.inherits(\"QObject\")          # returns true\nlayout.inherits(\"QLayoutItem\")      # returns false\n//! [4]\n\n\n//! [5]\nprint \"MyClass::setPrecision(): (%s) invalid precision %f\" % \\\n       (qPrintable(objectName()), newPrecision)\n//! [5]\n\n\n//! [6]\nclass MainWindow(QMainWindow):\n    def __init__(self):\n        self.textEdit = QTextEdit()\n        setCentralWidget(self.textEdit)\n        textEdit.installEventFilter(self)\n\n    def eventFilter(self, obj, event):\n        if obj == textEdit:\n            if event.type() == QEvent.KeyPress:\n                keyEvent = event\n                print \"Ate key press\", keyEvent.key()\n                return true\n            else:\n                return false\n        else:\n            # pass the event on to the parent class\n            return QMainWindow.eventFilter(self, obj, event)\n//! [6]\n\n\n//! [7]\nmyObject.moveToThread(QApplication.instance().thread())\n//! [7]\n\n\n//! [8]\nclass MyObject(QObject):\n    def __init__(self, parent):\n        QObject.__init__(self, parent)\n\n        self.startTimer(50)         # 50-millisecond timer\n        self.startTimer(1000)       # 1-second timer\n        self.startTimer(60000)      # 1-minute timer\n\n\n    def timerEvent(self, event):\n        print \"Timer ID:\", event.timerId()\n\n//! [8]\n\n\n//! [9]\nlist = window().queryList(\"QAbstractButton\")\nfor obj in list:\n    obj.setEnabled(false)\n//! [9]\n\n\n//! [10]\nbutton = parentWidget.findChild(QPushButton, \"button1\")\n//! [10]\n\n\n//! [11]\nlist = parentWidget.findChild(QListWidget)\n//! [11]\n\n\n//! [12]\nwidgets = parentWidget.findChildren(QWidget, \"widgetname\")\n//! [12]\n\n\n//! [13]\nallPButtons = parentWidget.findChildren(QPushButton)\n//! [13]\n\n\n//! [14]\nmonitoredObj.installEventFilter(filterObj)\n//! [14]\n\n\n//! [15]\nclass KeyPressEater(QObject):\n    def eventFilter(self, obj, event):\n        if event.type() == QEvent.KeyPress:\n            print \"Ate key press\", event.key()\n            return True\n        else:\n            # standard event processing\n            return QObject.eventFilter(self, obj, event)\n//! [15]\n\n\n//! [16]\nkeyPressEater = KeyPressEater(self)\npushButton = QPushButton(self)\nlistView = QListView(self)\n\npushButton.installEventFilter(keyPressEater)\nlistView.installEventFilter(keyPressEater)\n//! [16]\n\n\n//! [17]\ndef __init__(self):\n    senderLabel = QLabel(self.tr(\"Name:\"))\n    recipientLabel = QLabel(self.tr(\"Name:\", \"recipient\"))\n    # ...\n//! [17]\n\n\n//! [18]\nn = messages.count();\nshowMessage(self.tr(\"%n message(s) saved\", \"\", n));\n//! [18]\n\n\n//! [19]\nif n == 1:\n    self.tr(\"%n message saved\")\nelse:\n    self.tr(\"%n messages saved\")\n//! [19]\n\n\n//! [20]\nlabel.setText(self.tr(\"F\\374r \\310lise\"))\n//! [20]\n\n\n//! [21]\nif receivers(SIGNAL('valueChanged()')) > 0:\n    data = get_the_value()  # expensive operation\n    self.valueChanged(data)\n//! [21]\n\n\n//! [22]\nlabel = QLabel()\nscrollBar = QScrollBar()\nQObject.connect(scrollBar, SIGNAL('valueChanged()'),\n                label,  SLOT('setNum()'))\n//! [22]\n\n\n//! [23]\n// WRONG\nQObject.connect(scrollBar, SIGNAL('valueChanged()'),\n                 label, SLOT('setNum()'));\n//! [23]\n\n\n//! [24]\nclass MyWidget(QWidget):\n    def __init__(self):\n        myButton = QPushButton(self)\n        connect(myButton, SIGNAL('clicked()'),\n                self, SIGNAL('buttonClicked()'))\n//! [24]\n\n\n//! [25]\nQObject.connect: Cannot queue arguments of type 'MyType'\n(Make sure 'MyType' is registered using qRegisterMetaType().)\n//! [25]\n\n\n//! [26]\ndisconnect(myObject, 0, 0, 0)\n//! [26]\n\n\n//! [27]\nmyObject.disconnect()\n//! [27]\n\n\n//! [28]\ndisconnect(myObject, SIGNAL('mySignal()'), 0, 0)\n//! [28]\n\n\n//! [29]\nmyObject.disconnect(SIGNAL('mySignal()'))\n//! [29]\n\n\n//! [30]\ndisconnect(myObject, 0, myReceiver, 0)\n//! [30]\n\n\n//! [31]\nmyObject.disconnect(myReceiver)\n//! [31]\n\n\n//! [32]\nif QLatin1String(signal) == SIGNAL('valueChanged()'):\n    # signal is valueChanged()\n//! [32]\n\n\n//! [33]\ndef on_<object name>_<signal name>(<signal parameters>)\n//! [33]\n\n\n//! [34]\ndef on_button1_clicked()\n//! [34]\n\n\n//! [35]\nclass MyClass(QObject):\n    Q_CLASSINFO(\"Author\", \"Pierre Gendron\")\n    Q_CLASSINFO(\"URL\", \"http://www.my-organization.qc.ca\")\n\n//! [35]\n\n\n//! [36]\nQ_PROPERTY(type name\n           READ getFunction\n           [WRITE setFunction]\n           [RESET resetFunction]\n           [DESIGNABLE bool]\n           [SCRIPTABLE bool]\n           [STORED bool]\n\t   [USER bool])\n//! [36]\n\n\n//! [37]\nQ_PROPERTY(QString title READ title WRITE setTitle USER true)\n//! [37]\n\n\n//! [38]\n#this not apply for Python\nclass MyClass(QObject):\n\n    Q_OBJECT\n    Q_ENUMS(Priority)\n\npublic:\n    MyClass(QObject *parent = 0);\n    ~MyClass();\n\n    enum Priority { High, Low, VeryHigh, VeryLow };\n    void setPriority(Priority priority);\n    Priority priority() const;\n};\n//! [38]\n\n\n//! [39]\n#this not apply for Python\nQ_FLAGS(Options Alignment)\n//! [39]\n\n\n//! [40]\n//: This name refers to a host name.\nhostNameLabel.setText(self.tr(\"Name:\"))\n\n#: This text refers to a C++ code example. \nexample = self.tr(\"Example\")\n//! [40]\n\n//! [explicit tr context]\ntext = QScrollBar.tr(\"Page up\")\n//! [explicit tr context]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp",
    "content": "//! [0]\nsem = QSystemSemaphore(\"market\", 3, QSystemSemaphore.Create)\n# resources available == 3\nsem.acquire()               # resources available == 2\nsem.acquire()               # resources available == 1\nsem.acquire()               # resources available == 0\nsem.release()               # resources available == 1\nsem.release(2)              # resources available == 3\n//! [0]\n\n\n//! [1]\nsem = QSystemSemaphore(\"market\", 5, QSystemSemaphore.Create)\nsem.acquire(5)           # acquire all 5 resources\nsem.release(5)           # release the 5 resources\n//! [1]\n\n\n//! [2]\nsem.release(10)          # \"create\" 10 new resources\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp",
    "content": "//! [0]\nfrom PySide.QtCore import QApplication, QTimer\n\ndef main():\n\n    app = QApplication([])\n    QTimer.singleShot(600000, app, SLOT('quit()'))\n    ...\n    return app.exec_()\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp",
    "content": "//! [0]\nQLibrary myLib(\"mylib\");\ntypedef void (*MyPrototype)();\nMyPrototype myFunction = (MyPrototype) myLib.resolve(\"mysymbol\");\nif (myFunction)\n    myFunction();\n//! [0]\n\n\n//! [1]\ntypedef void (*MyPrototype)();\nMyPrototype myFunction =\n        (MyPrototype) QLibrary::resolve(\"mylib\", \"mysymbol\");\nif (myFunction)\n    myFunction();\n//! [1]\n\n\n//! [2]\ntypedef int (*AvgFunction)(int, int);\n\nAvgFunction avg = (AvgFunction) library->resolve(\"avg\");\nif (avg)\n    return avg(5, 8);\nelse\n    return -1;\n//! [2]\n\n\n//! [3]\nextern \"C\" MY_EXPORT int avg(int a, int b)\n{\n    return (a + b) / 2;\n}\n//! [3]\n\n\n//! [4]\n#ifdef Q_WS_WIN\n#define MY_EXPORT __declspec(dllexport)\n#else\n#define MY_EXPORT\n#endif\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_plugin_quuid.cpp",
    "content": "//! [0]\n# {67C8770B-44F1-410A-AB9A-F9B5446F13EE}\nIID_MyInterface = QUuid(0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [simple state machine]\nbutton = QPushButton()\n\nmachine = QStateMachine()\ns1 = QState()\ns1.assignProperty(button, \"text\", \"Click me\")\n\ns2 = QFinalState()\ns1.addTransition(button, SIGNAL('clicked()'), s2)\n\nmachine.addState(s1)\nmachine.addState(s2)\nmachine.setInitialState(s1)\nmachine.start()\n//! [simple state machine]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qatomic.cpp",
    "content": "//! [0]\nMySharedType &MySharedType::operator=(const MySharedType &other)\n{\n    (void) other.data->atomicInt.ref();\n    if (!data->atomicInt.deref()) {\n        // The last reference has been released\n        delete d;\n    }\n    d = other.d;\n    return *this;\n}\n//! [0]\n\n\n//! [1]\nif (currentValue == expectedValue) {\n    currentValue = newValue;\n    return true;\n}\nreturn false;\n//! [1]\n\n\n//! [2]\nint originalValue = currentValue;\ncurrentValue = newValue;\nreturn originalValue;\n//! [2]\n\n\n//! [3]\nint originalValue = currentValue;\ncurrentValue += valueToAdd;\nreturn originalValue;\n//! [3]\n\n\n//! [4]\nif (currentValue == expectedValue) {\n    currentValue = newValue;\n    return true;\n}\nreturn false;\n//! [4]\n\n\n//! [5]\nT *originalValue = currentValue;\ncurrentValue = newValue;\nreturn originalValue;\n//! [5]\n\n\n//! [6]\nT *originalValue = currentValue;\ncurrentValue += valueToAdd;\nreturn originalValue;\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutex.cpp",
    "content": "//! [0]\nnumber = 6\n\ndef method1():\n    number *= 5\n    number /= 4\n\ndef method2():\n    number *= 3\n    number /= 2\n//! [0]\n\n\n//! [1]\n# method1()\nnumber *= 5        # number is now 30\nnumber /= 4        # number is now 7\n\n# method2()\nnumber *= 3        # number is now 21\nnumber /= 2        # number is now 10\n//! [1]\n\n\n//! [2]\n# Thread 1 calls method1()\nnumber *= 5        # number is now 30\n\n# Thread 2 calls method2().\n#\n# Most likely Thread 1 has been put to sleep by the operating\n# system to allow Thread 2 to run.\nnumber *= 3        # number is now 90\nnumber /= 2        # number is now 45\n\n# Thread 1 finishes executing.\nnumber /= 4        # number is now 11, instead of 10\n//! [2]\n\n\n//! [3]\nmutex = QMutex()\nnumber = 6\n\ndef method1():\n    mutex.lock()\n    number *= 5\n    number /= 4\n    mutex.unlock()\n\ndef method2():\n    mutex.lock()\n    number *= 3\n    number /= 2\n    mutex.unlock()\n//! [3]\n\n\n//! [4]\ndef complexFunction(flag):\n    mutex.lock()\n\n    retVal = 0\n\n    if flag == 0 or flag == 1:\n        mutex.unlock()\n        return moreComplexFunction(flag)\n    elif flag == 2:\n        status = anotherFunction()\n        if status < 0:\n            mutex.unlock()\n            return -2\n        retVal = status + flag\n    else:\n        if flag > 10:\n            mutex.unlock()\n            return -1\n\n    mutex.unlock()\n    return retVal\n//! [4]\n\n\n//! [5]\ndef complexFunction(flag):\n    locker = QMutexLocker(mutex)\n\n    retVal = 0\n\n    if flag == 0 or flag == 1:\n        return moreComplexFunction(flag)\n    elif flag == 2:\n            status = anotherFunction()\n            if status < 0:\n                return -2\n            retVal = status + flag\n    else:\n        if flag > 10:\n            return -1\n\n    return retVal\n//! [5]\n\n\n//! [6]\nclass SignalWaiter:\n    def __init__(mutex):\n        self.locker = mutex\n\n    def waitForSignal():\n        # ...\n        while not signalled:\n            waitCondition.wait(self.locker.mutex())\n        # ...\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp",
    "content": "//! [0]\nclass Number:\n    def __init__(n):\n        self.num = n\n//! [0]\n\n\n//! [1]\ndef calcSquare(number):\n    locker = QMutexLocker(mutexpool.get(number))\n    number.num = number.num * number.num\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp",
    "content": "//! [0]\nlock = QReadWriteLock()\n\nclass ReaderThread:\n    # ...\n    def run():\n        # ...\n        lock.lockForRead()\n        read_file()\n        lock.unlock()\n        # ...\n\nclass WriterThread:\n    #...\n    def run():\n        # ...\n        lock.lockForWrite()\n        write_file()\n        lock.unlock()\n        # ...\n//! [0]\n\n\n//! [1]\nlock = QReadWriteLock()\n\ndef readData():\n    locker = QReadLocker(lock)\n    # ...\n    return data\n//! [1]\n\n\n//! [2]\nlock = QReadWriteLock()\n\ndef readData():\n    locker.lockForRead()\n    # ...\n    locker.unlock()\n    return data\n//! [2]\n\n\n//! [3]\nlock = QReadWriteLock()\n\ndef writeData(data):\n    locker = QWriteLocker(lock)\n    # ...\n//! [3]\n\n\n//! [4]\nlock = QReadWriteLock()\n\ndef writeData(data):\n    locker.lockForWrite()\n    # ...\n    locker.unlock()\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp",
    "content": "//! [0]\nsem = QSemaphore(5)      # sem.available() == 5\n\nsem.acquire(3)           # sem.available() == 2\nsem.acquire(2)           # sem.available() == 0\nsem.release(5)           # sem.available() == 5\nsem.release(5)           # sem.available() == 10\n\nsem.tryAcquire(1)        # sem.available() == 9, returns true\nsem.tryAcquire(250)      # sem.available() == 9, returns false\n//! [0]\n\n\n//! [1]\nsem = QSemaphore(5)     # a semaphore that guards 5 resources\nsem.acquire(5)          # acquire all 5 resources\nsem.release(5)          # release the 5 resources\nsem.release(10)         # \"create\" 10 new resources\n//! [1]\n\n\n//! [2]\nsem = QSemaphore(5)      # sem.available() == 5\nsem.tryAcquire(250)      # sem.available() == 5, returns false\nsem.tryAcquire(3)        # sem.available() == 2, returns true\n//! [2]\n\n\n//! [3]\nsem = QSemaphore(5)             # sem.available() == 5\nsem.tryAcquire(250, 1000)       # sem.available() == 5, waits 1000 milliseconds and returns false\nsem.tryAcquire(3, 30000)        # sem.available() == 2, returns true without waiting\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qthread.cpp",
    "content": "//! [0]\nclass MyThread (QThread):\n    def run():\n        socket = QTcpSocket()\n        # connect QTcpSocket's signals somewhere meaningful\n        # ...\n        socket.connectToHost(hostName, portNumber)\n        self.exec_()\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp",
    "content": "//! [0]\nwhile True:\n    mutex.lock()\n    keyPressed.wait(mutex)\n    do_something()\n    mutex.unlock()\n//! [0]\n\n\n//! [1]\nwhile True:\n    getchar()\n    keyPressed.wakeAll()\n\n//! [1]\n\n\n//! [2]\nwhile True:\n    mutex.lock()\n    keyPressed.wait(&mutex)\n    count += 1\n    mutex.unlock()\n\n    do_something()\n\n    mutex.lock()\n    count -= 1\n    mutex.unlock()\n//! [2]\n\n\n//! [3]\nwhile True:\n    getchar()\n\n    mutex.lock()\n    # Sleep until there are no busy worker threads\n    while count > 0:\n        mutex.unlock()\n        sleep(1)\n        mutex.lock()\n    keyPressed.wakeAll()\n    mutex.unlock()\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbitarray.cpp",
    "content": "//! [0]\nba = QBitArray(200)\n//! [0]\n\n\n//! [1]\nba = QBitArray()\nba.resize(3)\nba[0] = True\nba[1] = False\nba[2] = True\n//! [1]\n\n\n//! [2]\nba = QBitArray(3)\nba.setBit(0, True)\nba.setBit(1, False)\nba.setBit(2, True)\n//! [2]\n\n\n//! [3]\nx = QBitArray(5)\nx.setBit(3, True)\n# x: [ 0, 0, 0, 1, 0 ]\n\ny = QBitArray(5)\ny.setBit(4, True)\n# y: [ 0, 0, 0, 0, 1 ]\n\nx |= y\n# x: [ 0, 0, 0, 1, 1 ]\n//! [3]\n\n\n//! [4]\nQBitArray().isNull()           # returns True\nQBitArray().isEmpty()          # returns True\n\nQBitArray(0).isNull()          # returns False\nQBitArray(0).isEmpty()         # returns True\n\nQBitArray(3).isNull()          # returns False\nQBitArray(3).isEmpty()         # returns False\n//! [4]\n\n\n//! [5]\nQBitArray().isNull()           # returns True\nQBitArray(0).isNull()          # returns False\nQBitArray(3).isNull()          # returns False\n//! [5]\n\n\n//! [6]\nba = QBitArray(8)\nba.fill(True)\n# ba: [ 1, 1, 1, 1, 1, 1, 1, 1 ]\n\nba.fill(False, 2)\n# ba: [ 0, 0 ]\n//! [6]\n\n\n//! [7]\na = QBitArray(3)\na[0] = False\na[1] = True\na[2] = a[0] ^ a[1]\n//! [7]\n\n\n//! [8]\na = QBitArray(3)\nb = QBitArray(2)\na[0] = 1\na[1] = 0\na[2] = 1\n# a: [ 1, 0, 1 ]\n\nb[0] = 1\nb[1] = 0\n# b: [ 1, 1 ]\n\na &= b\n# a: [ 1, 0, 0 ]\n//! [8]\n\n\n//! [9]\na = QBitArray(3)\nb = QBitArray(2)\na[0] = 1\na[1] = 0\na[2] = 1\n# a: [ 1, 0, 1 ]\n\nb[0] = 1\nb[1] = 0\n# b: [ 1, 1 ]\n\na |= b\n# a: [ 1, 1, 1 ]\n//! [9]\n\n\n//! [10]\na = QBitArray(3)\nb = QBitArray(2)\na[0] = 1\na[1] = 0\na[2] = 1\n# a: [ 1, 0, 1 ]\n\nb[0] = 1\nb[1] = 0\n# b: [ 1, 1 ]\n\na ^= b\n# a: [ 0, 1, 1 ]\n//! [10]\n\n\n//! [11]\na = QBitArray(3)\nb = QBitArray()\na[0] = 1\na[1] = 0\na[2] = 1\n# a: [ 1, 0, 1 ]\n\nb = ~a\n# b: [ 0, 1, 0 ]\n//! [11]\n\n\n//! [12]\na = QBitArray(3)\nb = QBitArray(2)\nc = QBitArray()\na[0] = 1\na[1] = 0\na[2] = 1\n# a: [ 1, 0, 1 ]\n\nb[0] = 1\nb[1] = 0\n# b: [ 1, 1 ]\n\nc = a & b\n# c: [ 1, 0, 0 ]\n//! [12]\n\n\n//! [13]\na = QBitArray(3)\nQBitArray b(2)\nQBitArray c\na[0] = 1\na[1] = 0\na[2] = 1\n# a: [ 1, 0, 1 ]\n\nb[0] = 1\nb[1] = 0\n# b: [ 1, 1 ]\n\nc = a | b\n# c: [ 1, 1, 1 ]\n//! [13]\n\n\n//! [14]\na = QBitArray(3)\nb = QBitArray(2)\nc = QBitArray()\na[0] = 1\na[1] = 0\na[2] = 1\n# a: [ 1, 0, 1 ]\n\nb[0] = 1\nb[1] = 0\n# b: [ 1, 1 ]\n\nc = a ^ b\n# c: [ 0, 1, 1 ]\n//! [14]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qbytearray.cpp",
    "content": "\nvoid wrapInFunction()\n{\n\n//! [0]\nba = QByteArray(\"Hello\")\n//! [0]\n\n\n//! [1]\nba = QByteArray()\nba.resize(5)\nba[0] = 'H'\nba[1] = 'e'\nba[2] = 'l'\nba[3] = 'l'\nba[4] = 'o'\n//! [1]\n\n\n//! [2]\nfor i in range(0, ba.size()):\n    if ba.at(i) >= 'a' and ba.at(i) <= 'f':\n        print \"Found character in range [a-f]\"\n//! [2]\n\n\n//! [3]\nx = QByteArray(\"and\")\nx.prepend(\"rock \")         # x == \"rock and\"\nx.append(\" roll\")          # x == \"rock and roll\"\nx.replace(5, 3, \"&\")       # x == \"rock & roll\"\n//! [3]\n\n\n//! [4]\nba = QByteArray(\"We must be <b>bold</b>, very <b>bold</b>\")\nj = 0\nwhile (j = ba.indexOf(\"<b>\", j)) != -1:\n    print \"Found <b> tag at index position %d\" % j\n    ++j\n//! [4]\n\n\n//! [5]\nQByteArray().isNull()          # returns true\nQByteArray().isEmpty()         # returns true\n\nQByteArray(\"\").isNull()        # returns false\nQByteArray(\"\").isEmpty()       # returns true\n\nQByteArray(\"abc\").isNull()     # returns false\nQByteArray(\"abc\").isEmpty()    # returns false\n//! [5]\n\n\n//! [6]\nba = QByteArray(\"Hello\")\nn = ba.size()          # n == 5\nba.data()[0]           # returns 'H'\nba.data()[4]           # returns 'o'\n//! [6]\n\n\n//! [7]\nQByteArray().isEmpty()         # returns true\nQByteArray(\"\").isEmpty()       # returns true\nQByteArray(\"abc\").isEmpty()    # returns false\n//! [7]\n\n\n//! [8]\nba = QByteArray(\"Hello world\");\nprint ba.data();\n//! [8]\n\n\n//! [9]\nba = QByteArray()\nfor i in range(0, 10):\n    ba[i] = 'A' + str(i)\n# ba == \"ABCDEFGHIJ\"\n//! [9]\n\n\n//! [10]\nba = QByteArray(\"Stockholm\")\nba.truncate(5)             # ba == \"Stock\"\n//! [10]\n\n\n//! [11]\nba = QByteArray(\"STARTTLS\\r\\n\")\nba.chop(2)                 # ba == \"STARTTLS\"\n//! [11]\n\n\n//! [12]\nx = QByteArray(\"free\")\ny = QByteArray(\"dom\");\nx += y\n# x == \"freedom\"\n//! [12]\n\n\n//! [13]\nQByteArray().isNull()          # returns true\nQByteArray(\"\").isNull()        # returns false\nQByteArray(\"abc\").isNull()     # returns false\n//! [13]\n\n\n//! [14]\nba = QByteArray(\"Istambul\")\nba.fill('o')\n# ba == \"oooooooo\"\n\nba.fill('X', 2)\n# ba == \"XX\"\n//! [14]\n\n\n//! [15]\nx = QByteArray(\"ship\")\ny = QByteArray(\"air\")\nx.prepend(y)\n# x == \"airship\"\n//! [15]\n\n\n//! [16]\nx = QByteArray(\"free\")\ny = QByteArray(\"dom\")\nx.append(y)\n# x == \"freedom\"\n//! [16]\n\n\n//! [17]\nba = QByteArray(\"Meal\")\nba.insert(1, QByteArray(\"ontr\"))\n# ba == \"Montreal\"\n//! [17]\n\n\n//! [18]\nba = QByteArray(\"Montreal\")\nba.remove(1, 4)\n# ba == \"Meal\"\n//! [18]\n\n\n//! [19]\nx = QByteArray(\"Say yes!\")\ny = QByteArray(\"no\")\nx.replace(4, 3, y)\n# x == \"Say no!\"\n//! [19]\n\n\n//! [20]\nba = QByteArray(\"colour behaviour flavour neighbour\")\nba.replace(QByteArray(\"ou\"), QByteArray(\"o\"))\n# ba == \"color behavior flavor neighbor\"\n//! [20]\n\n\n//! [21]\nx = QByteArray(\"sticky question\")\ny = QByteArray(\"sti\")\nx.indexOf(y)               # returns 0\nx.indexOf(y, 1)            # returns 10\nx.indexOf(y, 10)           # returns 10\nx.indexOf(y, 11)           # returns -1\n//! [21]\n\n\n//! [22]\nba = QByteArray(\"ABCBA\")\nba.indexOf(\"B\")            # returns 1\nba.indexOf(\"B\", 1)         # returns 1\nba.indexOf(\"B\", 2)         # returns 3\nba.indexOf(\"X\")            # returns -1\n//! [22]\n\n\n//! [23]\nx = QByteArray(\"crazy azimuths\")\ny = QByteArray(\"azy\")\nx.lastIndexOf(y)           # returns 6\nx.lastIndexOf(y, 6)        # returns 6\nx.lastIndexOf(y, 5)        # returns 2\nx.lastIndexOf(y, 1)        # returns -1\n//! [23]\n\n\n//! [24]\nba = QByteArray(\"ABCBA\")\nba.lastIndexOf(\"B\")        # returns 3\nba.lastIndexOf(\"B\", 3)     # returns 3\nba.lastIndexOf(\"B\", 2)     # returns 1\nba.lastIndexOf(\"X\")        # returns -1\n//! [24]\n\n\n//! [25]\nurl = QByteArray(\"ftp://ftp.trolltech.com/\")\nif url.startsWith(\"ftp:\"):\n    ...\n//! [25]\n\n\n//! [26]\nurl = QByteArray(\"http://qtsoftware.com/index.html\")\nif url.endsWith(\".html\"):\n    ...\n//! [26]\n\n\n//! [27]\nx = QByteArray(\"Pineapple\")\ny = x.left(4)\n# y == \"Pine\"\n//! [27]\n\n\n//! [28]\nx = QByteArray(\"Pineapple\")\ny = x.right(5)\n# y == \"apple\"\n//! [28]\n\n\n//! [29]\nx = QByteArray(\"Five pineapples\")\ny = x.mid(5, 4)     # y == \"pine\"\nz = x.mid(5)        # z == \"pineapples\"\n//! [29]\n\n\n//! [30]\nx = QByteArray(\"TROlltECH\")\ny = x.toLower()\n# y == \"trolltech\"\n//! [30]\n\n\n//! [31]\nx = QByteArray(\"TROlltECH\")\ny = x.toUpper()\n# y == \"TROLLTECH\"\n//! [31]\n\n\n//! [32]\nba = QByteArray(\"  lots\\t of\\nwhitespace\\r\\n \")\nba = ba.simplified()\n# ba == \"lots of whitespace\";\n//! [32]\n\n\n//! [33]\nba = QByteArray(\"  lots\\t of\\nwhitespace\\r\\n \");\nba = ba.trimmed();\n# ba == \"lots\\t of\\nwhitespace\";\n//! [33]\n\n\n//! [34]\nx = QByteArray(\"apple\")\ny = x.leftJustified(8, '.')   # y == \"apple...\"\n//! [34]\n\n\n//! [35]\nx = QByteArray(\"apple\")\ny = x.rightJustified(8, '.')    # y == \"...apple\"\n//! [35]\n\n\n//! [36]\nstring = QByteArray(\"FF\")\n(hex, ok) = string.toInt(16)   # hex == 255, ok == true\n(dec, ok) = string.toInt(10)   # dec == 0, ok == false\n//! [36]\n\n\n//! [37]\nstring = QByteArray(\"FF\")\n(hex, ok) = str.toLong(16);    # hex == 255, ok == true\n(dec, ok) = str.toLong(10);    # dec == 0, ok == false\n//! [37]\n\n\n//! [38]\nstring = QByteArray(\"1234.56\")\n(a, ok) = string.toDouble()   # a == 1234.56, ok == true\n//! [38]\n\n\n//! [39]\ntext = QByteArray(\"Qt is great!\")\ntext.toBase64()        # returns \"UXQgaXMgZ3JlYXQh\"\n//! [39]\n\n\n//! [40]\nba = QByteArray()\nn = 63\nba.setNum(n)           # ba == \"63\"\nba.setNum(n, 16)       # ba == \"3f\"\n//! [40]\n\n\n//! [41]\nn = 63;\nQByteArray.number(n)               # returns \"63\"\nQByteArray.number(n, 16)           # returns \"3f\"\nQByteArray.number(n, 16).toUpper() # returns \"3F\"\n//! [41]\n\n\n//! [42]\nba = QByteArray.number(12.3456, 'E', 3)\n# ba == 1.235E+01\n//! [42]\n\n\n//! [43]\nmydata = '\\x00\\x00\\x03\\x84\\x78\\x9c\\x3b\\x76'\\\n         '\\xec\\x18\\xc3\\x31\\x0a\\xf1\\xcc\\x99'\\\n         ...\n         '\\x6d\\x5b'\n\ndata = QByteArray.fromRawData(mydata)\nin_ = QDataStream(data, QIODevice.ReadOnly)\n...\n//! [43]\n\n\n//! [44]\ntext = QByteArray.fromBase64(\"UXQgaXMgZ3JlYXQh\")\ntext.data()            # returns \"Qt is great!\"\n//! [44]\n\n\n//! [45]\ntext = QByteArray.fromHex(\"517420697320677265617421\")\ntext.data()            # returns \"Qt is great!\"\n//! [45]\n\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qdatetime.cpp",
    "content": "//! [0]\nd1 = QDate(1995, 5, 17)  # May 17, 1995\nd2 = QDate(1995, 5, 20)  # May 20, 1995\nd1.daysTo(d2)          # returns 3\nd2.daysTo(d1)          # returns -3\n//! [0]\n\n\n//! [1]\ndate = QDate.fromString(\"1MM12car2003\", \"d'MM'MMcaryyyy\")\n# date is 1 December 2003\n//! [1]\n\n\n//! [2]\ndate = QDate.fromString(\"130\", \"Md\") # invalid\n//! [2]\n\n\n//! [3]\nQDate.fromString(\"1.30\", \"M.d\")           # January 30 1900\nQDate.fromString(\"20000110\", \"yyyyMMdd\")  # January 10, 2000\nQDate.fromString(\"20000110\", \"yyyyMd\")    # January 10, 2000\n//! [3]\n\n\n//! [4]\nQDate.isValid(2002, 5, 17)  # True\nQDate.isValid(2002, 2, 30)  # False (Feb 30 does not exist)\nQDate.isValid(2004, 2, 29)  # True (2004 is a leap year)\nQDate.isValid(2000, 2, 29)  # True (2000 is a leap year)\nQDate.isValid(2006, 2, 29)  # False (2006 is not a leap year)\nQDate.isValid(2100, 2, 29)  # False (2100 is not a leap year)\nQDate.isValid(1202, 6, 6)   # True (even though 1202 is pre-Gregorian)\n//! [4]\n\n\n//! [5]\nn = QTime(14, 0, 0)              # n == 14:00:00\nt = QTime()\nt = n.addSecs(70)                # t == 14:01:10\nt = n.addSecs(-70)               # t == 13:58:50\nt = n.addSecs(10 * 60 * 60 + 5)  # t == 00:00:05\nt = n.addSecs(-15 * 60 * 60)     # t == 23:00:00\n//! [5]\n\n\n//! [6]\ntime = QTime.fromString(\"1mm12car00\", \"m'mm'hcarss\")\n# time is 12:01.00\n//! [6]\n\n\n//! [7]\ntime = QTime.fromString(\"00:710\", \"hh:ms\") # invalid\n//! [7]\n\n\n//! [8]\ntime = QTime.fromString(\"1.30\", \"m.s\")\n# time is 00:01:30.000\n//! [8]\n\n\n//! [9]\nQTime.isValid(21, 10, 30) # returns True\nQTime.isValid(22, 5,  62) # returns False\n//! [9]\n\n\n//! [10]\nt = QTime()\nt.start()\nsome_lengthy_task()\nprint (\"Time elapsed: %d ms\" % t.elapsed())\n//! [10]\n\n\n//! [11]\nnow = QDateTime.currentDateTime()\nxmas(QDate(now.date().year(), 12, 25), QTime(0, 0))\nprint(\"There are %d seconds to Christmas\" % now.secsTo(xmas))\n//! [11]\n\n\n//! [12]\ntime1 = QTime.fromString(\"131\", \"HHh\")\n# time1 is 13:00:00\ntime1 = QTime.fromString(\"1apA\", \"1amAM\")\n# time1 is 01:00:00\n\ndateTime2 = QDateTime.fromString(\"M1d1y9800:01:02\",\n                                            \"'M'M'd'd'y'yyhh:mm:ss\")\n# dateTime is 1 January 1998 00:01:02\n//! [12]\n\n\n//! [13]\ndateTime = QDateTime.fromString(\"130\", \"Mm\") # invalid\n//! [13]\n\n\n//! [14]\ndateTime = QDateTime.fromString(\"1.30.1\", \"M.d.s\")\n# dateTime is January 30 in 1900 at 00:00:01.\n//! [14]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qhash.cpp",
    "content": "//! [0]\nQHash<QString, int> hash;\n//! [0]\n\n\n//! [1]\nhash[\"one\"] = 1;\nhash[\"three\"] = 3;\nhash[\"seven\"] = 7;\n//! [1]\n\n\n//! [2]\nhash.insert(\"twelve\", 12);\n//! [2]\n\n\n//! [3]\nint num1 = hash[\"thirteen\"];\nint num2 = hash.value(\"thirteen\");\n//! [3]\n\n\n//! [4]\nint timeout = 30;\nif (hash.contains(\"TIMEOUT\"))\n    timeout = hash.value(\"TIMEOUT\");\n//! [4]\n\n\n//! [5]\nint timeout = hash.value(\"TIMEOUT\", 30);\n//! [5]\n\n\n//! [6]\n// WRONG\nQHash<int, QWidget *> hash;\n...\nfor (int i = 0; i < 1000; ++i) {\n    if (hash[i] == okButton)\n        cout << \"Found button at index \" << i << endl;\n}\n//! [6]\n\n\n//! [7]\nQHashIterator<QString, int> i(hash);\nwhile (i.hasNext()) {\n    i.next();\n    cout << i.key() << \": \" << i.value() << endl;\n}\n//! [7]\n\n\n//! [8]\nQHash<QString, int>::const_iterator i = hash.constBegin();\nwhile (i != hash.constEnd()) {\n    cout << i.key() << \": \" << i.value() << endl;\n    ++i;\n}\n//! [8]\n\n\n//! [9]\nhash.insert(\"plenty\", 100);\nhash.insert(\"plenty\", 2000);\n// hash.value(\"plenty\") == 2000\n//! [9]\n\n\n//! [10]\nQList<int> values = hash.values(\"plenty\");\nfor (int i = 0; i < values.size(); ++i)\n    cout << values.at(i) << endl;\n//! [10]\n\n\n//! [11]\nQHash<QString, int>::iterator i = hash.find(\"plenty\");\nwhile (i != hash.end() && i.key() == \"plenty\") {\n    cout << i.value() << endl;\n    ++i;\n}\n//! [11]\n\n\n//! [12]\nQHash<QString, int> hash;\n...\nforeach (int value, hash)\n    cout << value << endl;\n//! [12]\n\n\n//! [13]\n#ifndef EMPLOYEE_H\n#define EMPLOYEE_H\n\nclass Employee\n{\npublic:\n    Employee() {}\n    Employee(const QString &name, const QDate &dateOfBirth);\n    ...\n\nprivate:\n    QString myName;\n    QDate myDateOfBirth;\n};\n\ninline bool operator==(const Employee &e1, const Employee &e2)\n{\n    return e1.name() == e2.name()\n           && e1.dateOfBirth() == e2.dateOfBirth();\n}\n\ninline uint qHash(const Employee &key)\n{\n    return qHash(key.name()) ^ key.dateOfBirth().day();\n}\n\n#endif // EMPLOYEE_H\n//! [13]\n\n\n//! [14]\nQHash<QString, int> hash;\nhash.reserve(20000);\nfor (int i = 0; i < 20000; ++i)\n    hash.insert(keys[i], values[i]);\n//! [14]\n\n\n//! [15]\nQHash<QObject *, int> objectHash;\n...\nQHash<QObject *, int>::iterator i = objectHash.find(obj);\nwhile (i != objectHash.end() && i.key() == obj) {\n    if (i.value() == 0) {\n        i = objectHash.erase(i);\n    } else {\n        ++i;\n    }\n}\n//! [15]\n\n\n//! [16]\nQHash<QString, int> hash;\n...\nQHash<QString, int>::const_iterator i = hash.find(\"HDR\");\nwhile (i != hash.end() && i.key() == \"HDR\") {\n    cout << i.value() << endl;\n    ++i;\n}\n//! [16]\n\n\n//! [17]\nQHash<QString, int> hash;\nhash.insert(\"January\", 1);\nhash.insert(\"February\", 2);\n...\nhash.insert(\"December\", 12);\n\nQHash<QString, int>::iterator i;\nfor (i = hash.begin(); i != hash.end(); ++i)\n    cout << i.key() << \": \" << i.value() << endl;\n//! [17]\n\n\n//! [18]\nQHash<QString, int>::iterator i;\nfor (i = hash.begin(); i != hash.end(); ++i)\n    i.value() += 2;\n//! [18]\n\n\n//! [19]\nQHash<QString, int>::iterator i = hash.begin();\nwhile (i != hash.end()) {\n    if (i.key().startsWith(\"_\"))\n        i = hash.erase(i);\n    else\n        ++i;\n}\n//! [19]\n\n\n//! [20]\nQHash<QString, int>::iterator i = hash.begin();\nwhile (i != hash.end()) {\n    QHash<QString, int>::iterator prev = i;\n    ++i;\n    if (prev.key().startsWith(\"_\"))\n        hash.erase(prev);\n}\n//! [20]\n\n\n//! [21]\n// WRONG\nwhile (i != hash.end()) {\n    if (i.key().startsWith(\"_\"))\n        hash.erase(i);\n    ++i;\n}\n//! [21]\n\n\n//! [22]\nif (i.key() == \"Hello\")\n    i.value() = \"Bonjour\";\n//! [22]\n\n\n//! [23]\nQHash<QString, int> hash;\nhash.insert(\"January\", 1);\nhash.insert(\"February\", 2);\n...\nhash.insert(\"December\", 12);\n\nQHash<QString, int>::const_iterator i;\nfor (i = hash.constBegin(); i != hash.constEnd(); ++i)\n    cout << i.key() << \": \" << i.value() << endl;\n//! [23]\n\n\n//! [24]\nQMultiHash<QString, int> hash1, hash2, hash3;\n\nhash1.insert(\"plenty\", 100);\nhash1.insert(\"plenty\", 2000);\n// hash1.size() == 2\n\nhash2.insert(\"plenty\", 5000);\n// hash2.size() == 1\n\nhash3 = hash1 + hash2;\n// hash3.size() == 3\n//! [24]\n\n\n//! [25]\nQList<int> values = hash.values(\"plenty\");\nfor (int i = 0; i < values.size(); ++i)\n    cout << values.at(i) << endl;\n//! [25]\n\n\n//! [26]\nQMultiHash<QString, int>::iterator i = hash.find(\"plenty\");\nwhile (i != hash.end() && i.key() == \"plenty\") {\n    cout << i.value() << endl;\n    ++i;\n}\n//! [26]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp",
    "content": "//! [0]\nQLinkedList<int> integerList;\nQLinkedList<QTime> timeList;\n//! [0]\n\n\n//! [1]\nQLinkedList<QString> list;\nlist << \"one\" << \"two\" << \"three\";\n// list: [\"one\", \"two\", \"three\"]\n//! [1]\n\n\n//! [2]\nQLinkedList<QWidget *> list;\n...\nwhile (!list.isEmpty())\n    delete list.takeFirst();\n//! [2]\n\n\n//! [3]\nQLinkedList<QString> list;\nlist.append(\"one\");\nlist.append(\"two\");\nlist.append(\"three\");\n// list: [\"one\", \"two\", \"three\"]\n//! [3]\n\n\n//! [4]\nQLinkedList<QString> list;\nlist.prepend(\"one\");\nlist.prepend(\"two\");\nlist.prepend(\"three\");\n// list: [\"three\", \"two\", \"one\"]\n//! [4]\n\n\n//! [5]\nQList<QString> list;\nlist << \"sun\" << \"cloud\" << \"sun\" << \"rain\";\nlist.removeAll(\"sun\");\n// list: [\"cloud\", \"rain\"]\n//! [5]\n\n\n//! [6]\nQList<QString> list;\nlist << \"sun\" << \"cloud\" << \"sun\" << \"rain\";\nlist.removeOne(\"sun\");\n// list: [\"cloud\", \"sun\", \"rain\"]\n//! [6]\n\n\n//! [7]\nQLinkedList<QString> list;\nlist.append(\"January\");\nlist.append(\"February\");\n...\nlist.append(\"December\");\n\nQLinkedList<QString>::iterator i;\nfor (i = list.begin(); i != list.end(); ++i)\n    cout << *i << endl;\n//! [7]\n\n\n//! [8]\nQLinkedList<QString> list;\n...\nQLinkedList<QString>::iterator it = qFind(list.begin(),\n                                          list.end(), \"Joel\");\nif (it != list.end())\n    cout << \"Found Joel\" << endl;\n//! [8]\n\n\n//! [9]\nQLinkedList<int>::iterator i;\nfor (i = list.begin(); i != list.end(); ++i)\n    *i += 2;\n//! [9]\n\n\n//! [10]\nQLinkedList<QString> list;\n...\nQLinkedList<QString>::iterator i = list.begin();\nwhile (i != list.end()) {\n    if ((*i).startsWith(\"_\"))\n        i = list.erase(i);\n    else\n        ++i;\n}\n//! [10]\n\n\n//! [11]\nQLinkedList<QString>::iterator i = list.begin();\nwhile (i != list.end()) {\n    QLinkedList<QString>::iterator previous = i;\n    ++i;\n    if ((*previous).startsWith(\"_\"))\n        list.erase(previous);\n}\n//! [11]\n\n\n//! [12]\n// WRONG\nwhile (i != list.end()) {\n    if ((*i).startsWith(\"_\"))\n        list.erase(i);\n    ++i;\n}\n//! [12]\n\n\n//! [13]\nif (*it == \"Hello\")\n    *it = \"Bonjour\";\n//! [13]\n\n\n//! [14]\nQLinkedList<QString> list;\nlist.append(\"January\");\nlist.append(\"February\");\n...\nlist.append(\"December\");\n\nQLinkedList<QString>::const_iterator i;\nfor (i = list.constBegin(); i != list.constEnd(); ++i)\n    cout << *i << endl;\n//! [14]\n\n\n//! [15]\nQLinkedList<QString> list;\n...\nQLinkedList<QString>::iterator it = qFind(list.constBegin(),\n                                          list.constEnd(), \"Joel\");\nif (it != list.constEnd())\n    cout << \"Found Joel\" << endl;\n//! [15]\n\n\n//! [16]\nstd::list<double> stdlist;\nlist.push_back(1.2);\nlist.push_back(0.5);\nlist.push_back(3.14);\n\nQLinkedList<double> list = QLinkedList<double>::fromStdList(stdlist);\n//! [16]\n\n\n//! [17]\nQLinkedList<double> list;\nlist << 1.2 << 0.5 << 3.14;\n\nstd::list<double> stdlist = list.toStdList();\n//! [17]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlistdata.cpp",
    "content": "//! [0]\nQList<int> integerList;\nQList<QDate> dateList;\n//! [0]\n\n\n//! [1]\nQList<QString> list;\nlist << \"one\" << \"two\" << \"three\";\n// list: [\"one\", \"two\", \"three\"]\n//! [1]\n\n\n//! [2]\nif (list[0] == \"Bob\")\n    list[0] = \"Robert\";\n//! [2]\n\n\n//! [3]\nfor (int i = 0; i < list.size(); ++i) {\n    if (list.at(i) == \"Jane\")\n        cout << \"Found Jane at position \" << i << endl;\n}\n//! [3]\n\n\n//! [4]\nQList<QWidget *> list;\n...\nwhile (!list.isEmpty())\n    delete list.takeFirst();\n//! [4]\n\n\n//! [5]\nint i = list.indexOf(\"Jane\");\nif (i != -1)\n    cout << \"First occurrence of Jane is at position \" << i << endl;\n//! [5]\n\n\n//! [6]\nQList<QString> list;\nlist.append(\"one\");\nlist.append(\"two\");\nlist.append(\"three\");\n// list: [\"one\", \"two\", \"three\"]\n//! [6]\n\n\n//! [7]\nQList<QString> list;\nlist.prepend(\"one\");\nlist.prepend(\"two\");\nlist.prepend(\"three\");\n// list: [\"three\", \"two\", \"one\"]\n//! [7]\n\n\n//! [8]\nQList<QString> list;\nlist << \"alpha\" << \"beta\" << \"delta\";\nlist.insert(2, \"gamma\");\n// list: [\"alpha\", \"beta\", \"gamma\", \"delta\"]\n//! [8]\n\n\n//! [9]\nQList<QString> list;\nlist << \"sun\" << \"cloud\" << \"sun\" << \"rain\";\nlist.removeAll(\"sun\");\n// list: [\"cloud\", \"rain\"]\n//! [9]\n\n\n//! [10]\nQList<QString> list;\nlist << \"sun\" << \"cloud\" << \"sun\" << \"rain\";\nlist.removeOne(\"sun\");\n// list: [\"cloud\", ,\"sun\", \"rain\"]\n//! [10]\n\n\n//! [11]\nQList<QString> list;\nlist << \"A\" << \"B\" << \"C\" << \"D\" << \"E\" << \"F\";\nlist.move(1, 4);\n// list: [\"A\", \"C\", \"D\", \"E\", \"B\", \"F\"]\n//! [11]\n\n\n//! [12]\nQList<QString> list;\nlist << \"A\" << \"B\" << \"C\" << \"D\" << \"E\" << \"F\";\nlist.swap(1, 4);\n// list: [\"A\", \"E\", \"C\", \"D\", \"B\", \"F\"]\n//! [12]\n\n\n//! [13]\nQList<QString> list;\nlist << \"A\" << \"B\" << \"C\" << \"B\" << \"A\";\nlist.indexOf(\"B\");          // returns 1\nlist.indexOf(\"B\", 1);       // returns 1\nlist.indexOf(\"B\", 2);       // returns 3\nlist.indexOf(\"X\");          // returns -1\n//! [13]\n\n\n//! [14]\nQList<QString> list;\nlist << \"A\" << \"B\" << \"C\" << \"B\" << \"A\";\nlist.lastIndexOf(\"B\");      // returns 3\nlist.lastIndexOf(\"B\", 3);   // returns 3\nlist.lastIndexOf(\"B\", 2);   // returns 1\nlist.lastIndexOf(\"X\");      // returns -1\n//! [14]\n\n\n//! [15]\nQList<QString> list;\nlist.append(\"January\");\nlist.append(\"February\");\n...\nlist.append(\"December\");\n\nQList<QString>::iterator i;\nfor (i = list.begin(); i != list.end(); ++i)\n    cout << *i << endl;\n//! [15]\n\n\n//! [16]\nQList<int>::iterator i;\nfor (i = list.begin(); i != list.end(); ++i)\n    *i += 2;\n//! [16]\n\n\n//! [17]\nQList<QWidget *> list;\n...\nqDeleteAll(list.begin(), list.end());\n//! [17]\n\n\n//! [18]\nif (*it == \"Hello\")\n    *it = \"Bonjour\";\n//! [18]\n\n\n//! [19]\nQList<QString> list;\nlist.append(\"January\");\nlist.append(\"February\");\n...\nlist.append(\"December\");\n\nQList<QString>::const_iterator i;\nfor (i = list.constBegin(); i != list.constEnd(); ++i)\n    cout << *i << endl;\n//! [19]\n\n\n//! [20]\nQList<QWidget *> list;\n...\nqDeleteAll(list.constBegin(), list.constEnd());\n//! [20]\n\n\n//! [21]\nQVector<double> vect;\nvect << 20.0 << 30.0 << 40.0 << 50.0;\n\nQList<double> list = QVector<T>::fromVector(vect);\n// list: [20.0, 30.0, 40.0, 50.0]\n//! [21]\n\n\n//! [22]\nQStringList list;\nlist << \"Sven\" << \"Kim\" << \"Ola\";\n\nQVector<QString> vect = list.toVector();\n// vect: [\"Sven\", \"Kim\", \"Ola\"]\n//! [22]\n\n\n//! [23]\nQSet<double> set;\nset << 20.0 << 30.0 << 40.0 << ... << 70.0;\n\nQList<double> list = QList<double>::fromSet(set);\nqSort(list);\n//! [23]\n\n\n//! [24]\nQStringList list;\nlist << \"Julia\" << \"Mike\" << \"Mike\" << \"Julia\" << \"Julia\";\n\nQSet<QString> set = list.toSet();\nset.contains(\"Julia\");  // returns true\nset.contains(\"Mike\");   // returns true\nset.size();             // returns 2\n//! [24]\n\n\n//! [25]\nstd::list<double> stdlist;\nlist.push_back(1.2);\nlist.push_back(0.5);\nlist.push_back(3.14);\n\nQList<double> list = QList<double>::fromStdList(stdlist);\n//! [25]\n\n\n//! [26]\nQList<double> list;\nlist << 1.2 << 0.5 << 3.14;\n\nstd::list<double> stdlist = list.toStdList();\n//! [26]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qlocale.cpp",
    "content": "//! [0]\negyptian = QLocale(QLocale.Arabic, QLocale.Egypt)\ns1 = egyptian.toString(1.571429E+07, 'e')\ns2 = egyptian.toString(10)\n\n(d, ok) = egyptian.toDouble(s1)\n(i, ok) = egyptian.toInt(s2)\n//! [0]\n\n\n//! [1]\nQLocale.setDefault(QLocale(QLocale.Hebrew, QLocale.Israel))\nhebrew = QLocale() # Constructs a default QLocale\ns1 = hebrew.toString(15714.3, 'e')\n\nQLocale.setDefault(QLocale(QLocale.C))\nc = QLocale()\n(d, ok) = c.toDouble(\"1234,56\")   # ok == false\n(d, ok) = c.toDouble(\"1234.56\")   # ok == true, d == 1234.56\n\nQLocale.setDefault(QLocale(QLocale.German))\ngerman = QLocale()\n(d, ok) = german.toDouble(\"1234,56\")   # ok == true, d == 1234.56\n(d, ok) = german.toDouble(\"1234.56\")   # ok == true, d == 1234.56\n\nQLocale.setDefault(QLocale(QLocale.English, QLocale.UnitedStates))\nenglish = QLocale()\nstring = '%s %s %10x' % (12345, english.toString(12345), 12345)\n# string == \"12345 12,345 3039\"\n//! [1]\n\n\n//! [2]\nkorean = QLocale(\"ko\")\nswiss = QLocale(\"de_CH\")\n//! [2]\n\n\n//! [3]\nc = QLocale(QLocale.C)\n(d, ok) = c.toDouble( \"1234.56\" )  # ok == true, d == 1234.56\n(d, ok) = c.toDouble( \"1,234.56\" ) # ok == true, d == 1234.56\n(d, ok) = c.toDouble( \"1234,56\" )  # ok == false\n\ngerman = QLocale(QLocale.German)\n(d, ok) = german.toDouble( \"1234,56\" )  # ok == true, d == 1234.56\n(d, ok) = german.toDouble( \"1.234,56\" ) # ok == true, d == 1234.56\n(d, ok) = german.toDouble( \"1234.56\" )  # ok == false\n\n(d, ok) = german.toDouble( \"1.234\" )    # ok == true, d == 1234.0\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qmap.cpp",
    "content": "//! [0]\nQMap<QString, int> map;\n//! [0]\n\n\n//! [1]\nmap[\"one\"] = 1;\nmap[\"three\"] = 3;\nmap[\"seven\"] = 7;\n//! [1]\n\n\n//! [2]\nmap.insert(\"twelve\", 12);\n//! [2]\n\n\n//! [3]\nint num1 = map[\"thirteen\"];\nint num2 = map.value(\"thirteen\");\n//! [3]\n\n\n//! [4]\nint timeout = 30;\nif (map.contains(\"TIMEOUT\"))\n    timeout = map.value(\"TIMEOUT\");\n//! [4]\n\n\n//! [5]\nint timeout = map.value(\"TIMEOUT\", 30);\n//! [5]\n\n\n//! [6]\n// WRONG\nQMap<int, QWidget *> map;\n...\nfor (int i = 0; i < 1000; ++i) {\n    if (map[i] == okButton)\n        cout << \"Found button at index \" << i << endl;\n}\n//! [6]\n\n\n//! [7]\nQMapIterator<QString, int> i(map);\nwhile (i.hasNext()) {\n    i.next();\n    cout << i.key() << \": \" << i.value() << endl;\n}\n//! [7]\n\n\n//! [8]\nQMap<QString, int>::const_iterator i = map.constBegin();\nwhile (i != map.constEnd()) {\n    cout << i.key() << \": \" << i.value() << endl;\n    ++i;\n}\n//! [8]\n\n\n//! [9]\nmap.insert(\"plenty\", 100);\nmap.insert(\"plenty\", 2000);\n// map.value(\"plenty\") == 2000\n//! [9]\n\n\n//! [10]\nQList<int> values = map.values(\"plenty\");\nfor (int i = 0; i < values.size(); ++i)\n    cout << values.at(i) << endl;\n//! [10]\n\n\n//! [11]\nQMap<QString, int>::iterator i = map.find(\"plenty\");\nwhile (i != map.end() && i.key() == \"plenty\") {\n    cout << i.value() << endl;\n    ++i;\n}\n//! [11]\n\n\n//! [12]\nQMap<QString, int> map;\n...\nforeach (int value, map)\n    cout << value << endl;\n//! [12]\n\n\n//! [13]\n#ifndef EMPLOYEE_H\n#define EMPLOYEE_H\n\nclass Employee\n{\npublic:\n    Employee() {}\n    Employee(const QString &name, const QDate &dateOfBirth);\n    ...\n\nprivate:\n    QString myName;\n    QDate myDateOfBirth;\n};\n\ninline bool operator<(const Employee &e1, const Employee &e2)\n{\n    if (e1.name() != e2.name())\n        return e1.name() < e2.name();\n    return e1.dateOfBirth() < e2.dateOfBirth();\n}\n\n#endif // EMPLOYEE_H\n//! [13]\n\n\n//! [14]\nQMap<QString, int> map;\n...\nQMap<QString, int>::const_iterator i = map.find(\"HDR\");\nwhile (i != map.end() && i.key() == \"HDR\") {\n    cout << i.value() << endl;\n    ++i;\n}\n//! [14]\n\n\n//! [15]\nQMap<int, QString> map;\nmap.insert(1, \"one\");\nmap.insert(5, \"five\");\nmap.insert(10, \"ten\");\n\nmap.lowerBound(0);      // returns iterator to (1, \"one\")\nmap.lowerBound(1);      // returns iterator to (1, \"one\")\nmap.lowerBound(2);      // returns iterator to (5, \"five\")\nmap.lowerBound(10);     // returns iterator to (10, \"ten\")\nmap.lowerBound(999);    // returns end()\n//! [15]\n\n\n//! [16]\nQMap<QString, int> map;\n...\nQMap<QString, int>::const_iterator i = map.lowerBound(\"HDR\");\nQMap<QString, int>::const_iterator upperBound = map.upperBound(\"HDR\");\nwhile (i != upperBound) {\n    cout << i.value() << endl;\n    ++i;\n}\n//! [16]\n\n\n//! [17]\nQMap<int, QString> map;\nmap.insert(1, \"one\");\nmap.insert(5, \"five\");\nmap.insert(10, \"ten\");\n\nmap.upperBound(0);      // returns iterator to (1, \"one\")\nmap.upperBound(1);      // returns iterator to (5, \"five\")\nmap.upperBound(2);      // returns iterator to (5, \"five\")\nmap.upperBound(10);     // returns end()\nmap.upperBound(999);    // returns end()\n//! [17]\n\n\n//! [18]\nQMap<QString, int> map;\nmap.insert(\"January\", 1);\nmap.insert(\"February\", 2);\n...\nmap.insert(\"December\", 12);\n\nQMap<QString, int>::iterator i;\nfor (i = map.begin(); i != map.end(); ++i)\n    cout << i.key() << \": \" << i.value() << endl;\n//! [18]\n\n\n//! [19]\nQMap<QString, int>::iterator i;\nfor (i = map.begin(); i != map.end(); ++i)\n    i.value() += 2;\n//! [19]\n\n\n//! [20]\nQMap<QString, int>::iterator i = map.begin();\nwhile (i != map.end()) {\n    if (i.key().startsWith(\"_\"))\n        i = map.erase(i);\n    else\n        ++i;\n}\n//! [20]\n\n\n//! [21]\nQMap<QString, int>::iterator i = map.begin();\nwhile (i != map.end()) {\n    QMap<QString, int>::iterator prev = i;\n    ++i;\n    if (prev.key().startsWith(\"_\"))\n        map.erase(prev);\n}\n//! [21]\n\n\n//! [22]\n// WRONG\nwhile (i != map.end()) {\n    if (i.key().startsWith(\"_\"))\n        map.erase(i);\n    ++i;\n}\n//! [22]\n\n\n//! [23]\nif (i.key() == \"Hello\")\n    i.value() = \"Bonjour\";\n//! [23]\n\n\n//! [24]\nQMap<QString, int> map;\nmap.insert(\"January\", 1);\nmap.insert(\"February\", 2);\n...\nmap.insert(\"December\", 12);\n\nQMap<QString, int>::const_iterator i;\nfor (i = map.constBegin(); i != map.constEnd(); ++i)\n    cout << i.key() << \": \" << i.value() << endl;\n//! [24]\n\n\n//! [25]\nQMultiMap<QString, int> map1, map2, map3;\n\nmap1.insert(\"plenty\", 100);\nmap1.insert(\"plenty\", 2000);\n// map1.size() == 2\n\nmap2.insert(\"plenty\", 5000);\n// map2.size() == 1\n\nmap3 = map1 + map2;\n// map3.size() == 3\n//! [25]\n\n\n//! [26]\nQList<int> values = map.values(\"plenty\");\nfor (int i = 0; i < values.size(); ++i)\n    cout << values.at(i) << endl;\n//! [26]\n\n\n//! [27]\nQMultiMap<QString, int>::iterator i = map.find(\"plenty\");\nwhile (i != map.end() && i.key() == \"plenty\") {\n    cout << i.value() << endl;\n    ++i;\n}\n//! [27]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qpoint.cpp",
    "content": "//! [0]\np = QPoint()\n\np.setX(p.x() + 1)\np += QPoint(1, 0)\n//! [0]\n\n\n//! [1]\np = QPoint(1, 2)\n#p.rx()--;   // p becomes (0, 2)\n//! [1]\n\n\n//! [2]\np = QPoint(1, 2)\n#p.ry()++;   // p becomes (1, 3)\n//! [2]\n\n\n//! [3]\np = QPoint( 3, 7)\nq = QPoint(-1, 4)\np += q    # p becomes (2, 11)\n//! [3]\n\n\n//! [4]\np = QPoint( 3, 7)\nq = QPoint(-1, 4)\np -= q    # p becomes (4, 3)\n//! [4]\n\n\n//! [5]\np = QPoint(-1, 4)\np *= 2.5  # p becomes (-3, 10)\n//! [5]\n\n\n//! [6]\np = QPoint(-3, 10)\np /= 2.5  # p becomes (-1, 4)\n//! [6]\n\n\n//! [7]\n\nclass MyWidget(QWidget):\n\n    self.oldPosition = QPointer()\n\n    # event : QMouseEvent\n    def mouseMoveEvent(QMouseEvent event):\n        point = event.pos() - self.oldPosition\n        if (point.manhattanLength() > 3):\n            # the mouse has moved more than 3 pixels since the oldPosition\n            pass\n//! [7]\n\n\n//! [8]\ntrueLength = sqrt(pow(x(), 2) + pow(y(), 2))\n//! [8]\n\n\n//! [9]\np = QPointF()\n\np.setX(p.x() + 1.0)\np += QPointF(1.0, 0.0)\n#p.rx()++;\n//! [9]\n\n\n//! [10]\n p = QPointF(1.1, 2.5)\n #p.rx()--;   // p becomes (0.1, 2.5)\n//! [10]\n\n\n//! [11]\np = QPointF(1.1, 2.5)\n#p.ry()++;   // p becomes (1.1, 3.5)\n//! [11]\n\n\n//! [12]\np = QPointF( 3.1, 7.1)\nq = QPointF(-1.0, 4.1)\np += q    # p becomes (2.1, 11.2)\n//! [12]\n\n\n//! [13]\np = QPointF( 3.1, 7.1)\nq = QPointF(-1.0, 4.1)\np -= q    # p becomes (4.1, 3.0)\n//! [13]\n\n\n//! [14]\np = QPointF(-1.1, 4.1)\np *= 2.5  # p becomes (-2.75, 10.25)\n//! [14]\n\n\n//! [15]\np = QPointF(-2.75, 10.25)\np /= 2.5  # p becomes (-1.1, 4.1)\n//! [15]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qqueue.cpp",
    "content": "//! [0]\nQQueue<int> queue;\nqueue.enqueue(1);\nqueue.enqueue(2);\nqueue.enqueue(3);\nwhile (!queue.isEmpty())\n    cout << queue.dequeue() << endl;\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qrect.cpp",
    "content": "//! [0]\nr1 = QRect(100, 200, 11, 16)\nr2 = QRect(QPoint(100, 200), QSize(11, 16))\n//! [0]\n\n\n//! [1]\nr1 = QRectF(100, 200, 11, 16)\nr2 = QRectF(QPoint(100, 200), QSize(11, 16))\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qregexp.cpp",
    "content": "//! [0]\nrx = QRegExp(\"(\\\\d+)\")\ntxt = \"Offsets: 12 14 99 231 7\"\nlst = []\n\npos = rx.indexIn(txt, 0)\n\nwhile pos != -1:\n    lst.append(rx.cap(1))\n    pos += rx.matchedLength()\n    pos = rx.indexIn(txt, pos)\n\n# lst: [\"12\", \"14\", \"99\", \"231\", \"7\"]\n//! [0]\n\n\n//! [1]\nrx = QRegExp(\"*.txt\")\nrx.setPatternSyntax(QRegExp.Wildcard)\nrx.exactMatch(\"README.txt\")        # returns True\nrx.exactMatch(\"welcome.txt.bak\")   # returns False\n//! [1]\n\n\n//! [2]\nrx = QRegExp(\"ro+m\")\nrx.setMinimal(True)\n//! [2]\n\n\n//! [3]\nmark = QRegExp(\"\\\\b\"       # word boundary\n               \"[Mm]ark\"   # the word we want to match\n              )\n//! [3]\n\n\n//! [4]\nrx = QRegExp(\"^\\\\d\\\\d?$\")  # match integers 0 to 99\nrx.indexIn(\"123\")          # returns -1 (no match)\nrx.indexIn(\"-6\")           # returns -1 (no match)\nrx.indexIn(\"6\")            # returns  0 (matched as position 0)\n//! [4]\n\n\n//! [5]\nrx = QRegExp(\"^\\\\S+$\")     # match strings without whitespace\nrx.indexIn(\"Hello world\")  # returns -1 (no match)\nrx.indexIn(\"This_is-OK\")   # returns  0 (matched at position 0)\n//! [5]\n\n\n//! [6]\nrx = QRegExp(\"\\\\b(mail|letter|correspondence)\\\\b\")\nrx.indexIn(\"I sent you an email\")     # returns -1 (no match)\nrx.indexIn(\"Please write the letter\") # returns 17\n//! [6]\n\n\n//! [7]\ncaptured = rx.cap(1) # captured == \"letter\"\n//! [7]\n\n\n//! [8]\nrx = QRegExp(\"&(?!amp;)\")                  # match ampersands but not &amp;\nline1 = QString(\"This & that\")\nline1.replace(rx, \"&amp;\")                 # line1 == \"This &amp; that\"\nline2 = QString(\"His &amp; hers & theirs\")\nline2.replace(rx, \"&amp;\")                 # line2 == \"His &amp; hers &amp; theirs\"\n//! [8]\n\n\n//! [9]\ntxt = QString(\"One Eric another Eirik, and an Ericsson. How many Eiriks, Eric?\")\nrx = QRegExp(\"\\\\b(Eric|Eirik)\\\\b\")  # match Eric or Eirik\npos = 0                             # where we are in the string\ncount = 0                           # how many Eric and Eirik's we've counted\n\nwhile pos >= 0:\n    pos = rx.indexIn(txt, pos)\n    if pos >= 0:\n        pos += 1                    # move along in str\n        count += 1                  # count our Eric or Eirik\n//! [9]\n\n\n//! [10]\ntxt = \"Nokia Corporation and/or its subsidiary(-ies)\\tqtsoftware.com\\tNorway\"\nrx.setPattern(\"^([^\\t]+)\\t([^\\t]+)\\t([^\\t]+)$\");\nif rx.indexIn(txt) != -1:\n    company = rx.cap(1)\n    web = rx.cap(2)\n    country = rx.cap(3)\n//! [10]\n\n\n//! [11]\nfield = txt.split(\"\\t\")\n//! [11]\n\n\n//! [12]\nrx = QRegExp(\"*.html\")\nrx.setPatternSyntax(QRegExp.Wildcard)\nrx.exactMatch(\"index.html\")             # returns True\nrx.exactMatch(\"default.htm\")            # returns False\nrx.exactMatch(\"readme.txt\")             # returns False\n//! [12]\n\n\n//! [13]\ntxt = QString(\"offsets: 1.23 .50 71.00 6.00\")\nrx = QRegExp(\"\\\\d*\\\\.\\\\d+\")             # primitive floating point matching\ncount = 0\npos = rx.indexIn(txt, 0)\nwhile pos != -1:\n    count += 1\n    pos += rx.matchedLength()\n    pos = rx.indexIn(txt, pos)\n\n# pos will be 9, 14, 18 and finally 24; count will end up as 4\n//! [13]\n\n\n//! [14]\nrx = QRegExp(\"(\\\\d+)(\\\\s*)(cm|inch(es)?)\")\npos = rx.indexIn(\"Length: 36 inches\")\nlst = rx.capturedTexts()\n# lst is now (\"36 inches\", \"36\", \" \", \"inches\", \"es\")\n//! [14]\n\n\n//! [15]\nrx = QRegExp(\"(\\\\d+)(?:\\\\s*)(cm|inch(?:es)?)\")\npos = rx.indexIn(\"Length: 36 inches\")\nlst = rx.capturedTexts()\n# lst is now (\"36 inches\", \"36\", \"inches\")\n//! [15]\n\n\n//! [16]\nfor a in rx.capturedTexts():\n    myProcessing(a)\n//! [16]\n\n\n//! [17]\nrxlen  = QRegExp(\"(\\\\d+)(?:\\\\s*)(cm|inch)\")\npos = rxlen.indexIn(\"Length: 189cm\")\nif pos > -1:\n    value = rxlen.cap(1) # \"189\"\n    unit = rxlen.cap(2)  # \"cm\"\n//! [17]\n\n\n//! [18]\nrx = QRegExp(\"/([a-z]+)/([a-z]+)\")\nrx.indexIn(\"Output /dev/null\")  # returns 7 (position of /dev/null)\nrx.pos(0)                       # returns 7 (position of /dev/null)\nrx.pos(1)                       # returns 8 (position of dev)\nrx.pos(2)                       # returns 12 (position of null)\n//! [18]\n\n\n//! [19]\ns1 = QRegExp.escape(\"bingo\")    # s1 == \"bingo\"\ns2 = QRegExp.escape(\"f(x)\")     # s2 == \"f\\\\(x\\\\)\"\n//! [19]\n\n\n//! [20]\nrx = QRegExp(\"(\" + QRegExp.escape(name) + \"|\" + QRegExp.escape(alias) + \")\")\n//! [20]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qsize.cpp",
    "content": "//! [0]\nt1 = QSize(10, 12)\nt1.scale(60, 60, Qt.IgnoreAspectRatio)\n# t1 is (60, 60)\n\nt2 = QSize(10, 12)\nt2.scale(60, 60, Qt.KeepAspectRatio)\n# t2 is (50, 60)\n\nt3 = QSize(10, 12)\nt3.scale(60, 60, Qt.KeepAspectRatioByExpanding)\n# t3 is (60, 72)\n//! [0]\n\n\n//! [1]\nsize = QSize(100, 10)\nsize.rwidth() += 20\n\n#size becomes (120,10)\n//! [1]\n\n\n//! [2]\nsize = QSize(100, 10)\nsize.rheight() += 5\n\n# size becomes (100,15)\n//! [2]\n\n\n//! [3]\ns = QSize( 3, 7)\nr = QSize(-1, 4)\ns += r\n\n# s becomes (2,11)\n//! [3]\n\n\n//! [4]\ns = QSize( 3, 7)\nr = QSize(-1, 4)\ns -= r\n\n# s becomes (4,3)\n//! [4]\n\n\n//! [5]\nt1 = QSizeF(10, 12)\nt1.scale(60, 60, Qt.IgnoreAspectRatio)\n# t1 is (60, 60)\n\nt2 = QSizeF(10, 12)\nt2.scale(60, 60, Qt.KeepAspectRatio)\n# t2 is (50, 60)\n\nt3 = QSizeF(10, 12)\nt3.scale(60, 60, Qt.KeepAspectRatioByExpanding)\n# t3 is (60, 72)\n//! [5]\n\n\n//! [6]\nsize = QSizeF(100.3, 10)\nsize.rwidth() += 20.5\n\n# size becomes (120.8,10)\n//! [6]\n\n\n//! [7]\nsize = QSizeF(100, 10.2)\nsize.rheight() += 5.5\n\n# size becomes (100,15.7)\n//! [7]\n\n\n//! [8]\ns = QSizeF( 3, 7)\nr = QSizeF(-1, 4)\ns += r\n\n# s becomes (2,11)\n//! [8]\n\n\n//! [9]\ns = QSizeF( 3, 7)\nr = QSizeF(-1, 4)\ns -= r\n\n# s becomes (4,3)\n//! [9]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qstring.cpp",
    "content": "//! [0]\nDEFINES += QT_NO_CAST_FROM_ASCII \\\n           QT_NO_CAST_TO_ASCII\n//! [0]\n\n\n//! [1]\nurl = QLatin1String(\"http://www.unicode.org/\")\n//! [1]\n\n\n//! [2]\nd = 12.34;\nstr = QString(\"delta: %1\").arg(d, 0, 'E', 3)\n# str == \"delta: 1.234E+01\"\n//! [2]\n\n\n//! [3]\nif str == \"auto\" || str == \"extern\" || str == \"static\" || str == \"register\":\n    ...\n//! [3]\n\n\n//! [4]\nif str == QString(\"auto\") ||\n   str == QString(\"extern\") ||\n   str == QString(\"static\") ||\n   str == QString(\"register\"):\n    ...\n//! [4]\n\n\n//! [5]\nif str == QLatin1String(\"auto\") ||\n   str == QLatin1String(\"extern\") ||\n   str == QLatin1String(\"static\") || \n   str == QLatin1String(\"register\"):\n    ...\n//! [5]\n\n\n//! [6]\nlabel = QLabel(QLatin1String(\"MOD\"), self)\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp",
    "content": "//! [0]\n...\nprogressBar = QProgressBar(self)\nprogressBar.setRange(0, 100)\n\n# Construct a 1-second timeline with a frame range of 0 - 100\ntimeLine = QTimeLine(1000, self)\ntimeLine.setFrameRange(0, 100)\ntimeLine.frameChanged[int].connect(progressBar.setValue)\n\n# Clicking the push button will start the progress bar animation\npushButton = QPushButton(QObject.tr(\"Start animation\"), self)\npushButton.clicked.connect(timeLine.start)\n...\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qvector.cpp",
    "content": "//! [0]\nQVector<int> integerVector;\nQVector<QString> stringVector;\n//! [0]\n\n\n//! [1]\nQVector<QString> vector(200);\n//! [1]\n\n\n//! [2]\nQVector<QString> vector(200, \"Pass\");\n//! [2]\n\n\n//! [3]\nif (vector[0] == \"Liz\")\n    vector[0] = \"Elizabeth\";\n//! [3]\n\n\n//! [4]\nfor (int i = 0; i < vector.size(); ++i) {\n    if (vector.at(i) == \"Alfonso\")\n        cout << \"Found Alfonso at position \" << i << endl;\n}\n//! [4]\n\n\n//! [5]\nint i = vector.indexOf(\"Harumi\");\nif (i != -1)\n    cout << \"First occurrence of Harumi is at position \" << i << endl;\n//! [5]\n\n\n//! [6]\nQVector<int> vector(10);\nint *data = vector.data();\nfor (int i = 0; i < 10; ++i)\n    data[i] = 2 * i;\n//! [6]\n\n\n//! [7]\nQVector<QString> vector(0);\nvector.append(\"one\");\nvector.append(\"two\");\nvector.append(\"three\");\n// vector: [\"one\", \"two\", \"three\"]\n//! [7]\n\n\n//! [8]\nQVector<QString> vector;\nvector.prepend(\"one\");\nvector.prepend(\"two\");\nvector.prepend(\"three\");\n// vector: [\"three\", \"two\", \"one\"]\n//! [8]\n\n\n//! [9]\nQVector<QString> vector;\nvector << \"alpha\" << \"beta\" << \"delta\";\nvector.insert(2, \"gamma\");\n// vector: [\"alpha\", \"beta\", \"gamma\", \"delta\"]\n//! [9]\n\n\n//! [10]\nQVector<double> vector;\nvector << 2.718 << 1.442 << 0.4342;\nvector.insert(1, 3, 9.9);\n// vector: [2.718, 9.9, 9.9, 9.9, 1.442, 0.4342]\n//! [10]\n\n\n//! [11]\nQVector<QString> vector(3);\nvector.fill(\"Yes\");\n// vector: [\"Yes\", \"Yes\", \"Yes\"]\n\nvector.fill(\"oh\", 5);\n// vector: [\"oh\", \"oh\", \"oh\", \"oh\", \"oh\"]\n//! [11]\n\n\n//! [12]\nQVector<QString> vector;\nvector << \"A\" << \"B\" << \"C\" << \"B\" << \"A\";\nvector.indexOf(\"B\");            // returns 1\nvector.indexOf(\"B\", 1);         // returns 1\nvector.indexOf(\"B\", 2);         // returns 3\nvector.indexOf(\"X\");            // returns -1\n//! [12]\n\n\n//! [13]\nQList<QString> vector;\nvector << \"A\" << \"B\" << \"C\" << \"B\" << \"A\";\nvector.lastIndexOf(\"B\");        // returns 3\nvector.lastIndexOf(\"B\", 3);     // returns 3\nvector.lastIndexOf(\"B\", 2);     // returns 1\nvector.lastIndexOf(\"X\");        // returns -1\n//! [13]\n\n\n//! [14]\nQVector<double> vect;\nvect << \"red\" << \"green\" << \"blue\" << \"black\";\n\nQList<double> list = vect.toList();\n// list: [\"red\", \"green\", \"blue\", \"black\"]\n//! [14]\n\n\n//! [15]\nQStringList list;\nlist << \"Sven\" << \"Kim\" << \"Ola\";\n\nQVector<QString> vect = QVector<QString>::fromList(list);\n// vect: [\"Sven\", \"Kim\", \"Ola\"]\n//! [15]\n\n\n//! [16]\nstd::vector<double> stdvector;\nvector.push_back(1.2);\nvector.push_back(0.5);\nvector.push_back(3.14);\n\nQVector<double> vector = QVector<double>::fromStdVector(stdvector);\n//! [16]\n\n\n//! [17]\nQVector<double> vector;\nvector << 1.2 << 0.5 << 3.14;\n\nstd::vector<double> stdvector = vector.toStdVector();\n//! [17]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp",
    "content": "//! [0]\nxml = QXmlStreamReader()\n...\nwhile not xml.atEnd():\n    xml.readNext();\n    ... # do processing\n\nif xml.hasError():\n    ... # do error handling\n\n//! [0]\n\n\n//! [1]\nwriteStartElement(qualifiedName)\nwriteCharacters(text)\nwriteEndElement()\n//! [1]\n\n\n//! [2]\nwriteStartElement(namespaceUri, name)\nwriteCharacters(text)\nwriteEndElement()\n//! [2]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_accessible_qaccessible.cpp",
    "content": "//! [0]\nchild = QAccessibleInterface()\ntargetChild = object.navigate(Accessible.Child, 1, child)\nif child:\n    # ...\n    del child\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp",
    "content": "//! [0]\nprintDialog = QPrintDialog(printer, parent)\nif printDialog.exec_() == QDialog.Accepted:\n    # print ...\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp",
    "content": "//! [0]\nfileName = QFileDialog.getOpenFileName(self,\n    tr(\"Open Image\"), \"/home/jana\", tr(\"Image Files (*.png *.jpg *.bmp)\"))\n//! [0]\n\n\n//! [1]\n\"Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)\"\n//! [1]\n\n\n//! [2]\ndialog = QFileDialog(self)\ndialog.setFileMode(QFileDialog.AnyFile)\n//! [2]\n\n\n//! [3]\ndialog.setNameFilter(tr(\"Images (*.png *.xpm *.jpg)\"))\n//! [3]\n\n\n//! [4]\ndialog.setViewMode(QFileDialog.Detail)\n//! [4]\n\n\n//! [5]\nif dialog.exec_():\n    fileNames = dialog.selectedFiles()\n//! [5]\n\n\n//! [6]\ndialog.setNameFilter(\"All C++ files (*.cpp *.cc *.C *.cxx *.c++)\")\ndialog.setNameFilter(\"*.cpp *.cc *.C *.cxx *.c++\")\n//! [6]\n\n\n//! [7]\nfilters = QStringList()\nfilters << \"Image files (*.png *.xpm *.jpg)\"\n        << \"Text files (*.txt)\"\n        << \"Any files (*)\"\n\ndialog = QFileDialog(this)\ndialog.setNameFilters(filters)\ndialog.exec_()\n//! [7]\n\n\n//! [8]\nfileName = QFileDialog.getOpenFileName(self, tr(\"Open File\"),\n                                       \"/home\",\n                                       tr(\"Images (*.png *.xpm *.jpg)\"))\n//! [8]\n\n\n//! [9]\nfiles = QFileDialog.getOpenFileNames(self,\n                                     \"Select one or more files to open\",\n                                     \"/home\",\n                                     \"Images (*.png *.xpm *.jpg)\")\n//! [9]\n\n\n//! [10]\nfor it in list:\n    myProcessing(it)\n    it++\n//! [10]\n\n\n//! [11]\nfileName = QFileDialog.getSaveFileName(self, tr(\"Save F:xile\"),\n                                       \"/home/jana/untitled.png\",\n                                       tr(\"Images (*.png *.xpm *.jpg)\"))\n//! [11]\n\n\n//! [12]\ndir = QFileDialog.getExistingDirectory(self, tr(\"Open Directory\"),\n                                       \"/home\",\n                                       QFileDialog.ShowDirsOnly\n                                       | QFileDialog.DontResolveSymlinks)\n//! [12]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qfontdialog.cpp",
    "content": "//! [0]\n\n(ok, font) = QFontDialog.getFont(QFont(\"Helvetica [Cronyx]\", 10), self)\nif ok:\n    # the user clicked OK and font is set to the font the user selected\nelse:\n    # the user canceled the dialog; font is set to the initial\n    # value, in this case Helvetica [Cronyx], 10\n//! [0]\n\n\n//! [1]\nmyWidget.setFont(QFontDialog.getFont(0, myWidget.font()))\n//! [1]\n\n\n//! [2]\n(ok, font) = QFontDialog.getFont(QFont(\"Times\", 12), self)\nif ok:\n    # font is set to the font the user selected\nelse:\n    # the user canceled the dialog; font is set to the initial\n    # value, in this case Times, 12.\n//! [2]\n\n\n//! [3]\nmyWidget.setFont(QFontDialog.getFont(0, myWidget.font()))\n//! [3]\n\n\n//! [4]\n\n(ok, font) = QFontDialog.getFont(self)\nif ok:\n    # font is set to the font the user selected\nelse:\n    # the user canceled the dialog; font is set to the default\n    # application font, QApplication.font()\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp",
    "content": "//! [0]\nret = QMessageBox.warning(self, self.tr(\"My Application\"),\n                               self.tr(\"The document has been modified.\\n\" + \\\n                                  \"Do you want to save your changes?\"),\n                               QMessageBox.Save | QMessageBox.Discard\n                               | QMessageBox.Cancel,\n                               QMessageBox.Save)\n//! [0]\n\n\n//! [1]\nmsgBox = QMessageBox()\nmsgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No)\nresult = msgBox.exec_()\n\nif result == QMessageBox.Yes:\n    # yes was clicked\nelif result == QMessageBox.No:\n    # no was clicked\nelse:\n    # should never be reached\n//! [1]\n\n\n//! [2]\nmsgBox = QMessageBox()\nconnectButton = msgBox.addButton(self.tr(\"Connect\"), QMessageBox.ActionRole)\nabortButton = msgBox.addButton(QMessageBox.Abort)\n\nmsgBox.exec_()\n\nif msgBox.clickedButton() == connectButton:\n    # connect\nelif msgBox.clickedButton() == abortButton:\n    # abort\n}\n//! [2]\n\n\n//! [3]\nmessageBox = QMessageBox(self)\ndisconnectButton = messageBox.addButton(self.tr(\"Disconnect\"),\n                                        QMessageBox.ActionRole)\n...\nmessageBox.exec_()\nif messageBox.clickedButton() == disconnectButton:\n    ...\n\n//! [3]\n\n\n//! [4]\n#include <QApplication>\n#include <QMessageBox>\n\nint main(int argc, char *argv[])\n{\n# Not Supported by PySide\n    QT_REQUIRE_VERSION(argc, argv, \"4.0.2\")\n\n    QApplication app(argc, argv);\n    ...\n    return app.exec();\n}\n//! [4]\n\n//! [5]\nmsgBox = QMessageBox()\nmsgBox.setText(\"The document has been modified.\")\nmsgBox.exec_()\n//! [5]\n\n//! [6]\nmsgBox = QMessageBox()\nmsgBox.setText(\"The document has been modified.\")\nmsgBox.setInformativeText(\"Do you want to save your changes?\")\nmsgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel)\nmsgBox.setDefaultButton(QMessageBox.Save)\nret = msgBox.exec_()\n//! [6]\n\n//! [7]\n\nif ret == QMessageBox.Save:\n    # Save was clicked\nelif ret == QMessageBox.Discard:\n    # Don't save was clicked\nelif ret == QMessageBox.Cancel:\n    # cancel was clicked\nelse:\n    # should never be reached\n\n//! [7]\n\n//! [9]\nmsgBox = QMessageBox(self)\nmsgBox.setText(tr(\"The document has been modified.\\n\" + \\\n                  \"Do you want to save your changes?\"))\nmsgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Discard\n                          | QMessageBox.Cancel)\nmsgBox.setDefaultButton(QMessageBox.Save)\n//! [9]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_dialogs_qwizard.cpp",
    "content": "//! [0]\ndef nextId(self):\n    id = self.currentId()\n    if id == Page_Intro:\n        if field(\"intro.evaluate\").toBool():\n            return Page_Evaluate\n        else:\n            return Page_Register\n    elif id == Page_Evaluate:\n        return Page_Conclusion\n    elif id == Page_Register:\n        if field(\"register.upgradeKey\").toString().isEmpty():\n            return Page_Details\n        else:\n            return Page_Conclusion\n    elif id == Page_Details:\n        return Page_Conclusion\n    else:\n        return -1\n//! [0]\n\n\n//! [1]\nclass MyWizard(QWizard):\n    def __init__(self, parent):\n        QWizard.__ini__(self, parent)\n        ...\n        layout = [QWizard.Stretch, QWizard.BackButton, QWizard.CancelButton, QWizard.NextButton, QWizard.FinishButton]\n        setButtonLayout(layout);\n        ...\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_effects_qgraphicseffect.cpp",
    "content": "//! [0]\ndef draw(self, painter):\n    # Fully opaque draw directly without going through a pixmap.\n    if qFuzzyCompare(self.opacity, 1):\n        drawSource(painter)\n        return\n    # ...\n//! [0]\n\n//! [1]\ndef draw(self, painter):\n    # ...\n    offset = QPoint()\n    if self.sourceIsPixmap():\n        # No point in drawing in device coordinates (pixmap will be scaled anyways).\n        pixmap = sourcePixmap(Qt.LogicalCoordinates, offset)\n        ...\n        painter.drawPixmap(offset, pixmap)\n    else:\n        # Draw pixmap in device coordinates to avoid pixmap scaling\n        pixmap = sourcePixmap(Qt.DeviceCoordinates, offset)\n        painter.setWorldTransform(QTransform())\n        # ...\n        painter.drawPixmap(offset, pixmap)\n    # ...\n//! [1]\n\n//! [2]\n# ...\nalphaGradient = QLinearGradient(rect.topLeft(), rect.bottomLeft())\nalphaGradient.setColorAt(0.0, Qt.transparent)\nalphaGradient.setColorAt(0.5, Qt.black)\nalphaGradient.setColorAt(1.0, Qt.transparent)\neffect = QGraphicsOpacityEffect()\neffect.setOpacityMask(alphaGradient)\n# ...\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsgridlayout.cpp",
    "content": "//! [0]\nscene = QGraphicsScene()\ntextEdit = scene.addWidget(QTextEdit())\npushButton = scene.addWidget(QPushButton())\n\nlayout = QGraphicsGridLayout()\nlayout.addItem(textEdit, 0, 0)\nlayout.addItem(pushButton, 0, 1)\n\nform = QGraphicsWidget()\nform.setLayout(layout)\nscene.addItem(form)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp",
    "content": "//! [0]\nclass SimpleItem(QGraphicsItem):\n\n    def boundingRect(self):\n        penWidth = 1.0\n        return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,\n                      20 + penWidth, 20 + penWidth)\n\n    def paint(self, painter, option, widget):\n        painter.drawRoundedRect(-10, -10, 20, 20, 5, 5)\n//! [0]\n\n\n//! [1]\nclass CustomItem(QGraphicsItem):\n   ...\n   self.Type = QGraphicsItem.UserType + 1\n\n   def type(self):\n       # Enable the use of qgraphicsitem_cast with this item.\n       return self.Type\n   ...\n\n//! [1]\n\n\n//! [2]\nitem.setCursor(Qt.IBeamCursor)\n//! [2]\n\n\n//! [3]\nitem.setCursor(Qt.IBeamCursor)\n//! [3]\n\n\n//! [4]\nrect = QGraphicsRectItem()\nrect.setPos(100, 100)\n\nrect.sceneTransform().map(QPointF(0, 0))\n# returns QPointF(100, 100)\n\nrect.sceneTransform().inverted().map(QPointF(100, 100))\n# returns QPointF(0, 0);\n//! [4]\n\n\n//! [5]\nrect = QGraphicsRectItem()\nrect.setPos(100, 100)\n\nrect.deviceTransform(view.viewportTransform()).map(QPointF(0, 0))\n# returns the item's (0, 0) point in view's viewport coordinates\n\nrect.deviceTransform(view.viewportTransform()).inverted().map(QPointF(100, 100))\n# returns view's viewport's (100, 100) coordinate in item coordinates\n//! [5]\n\n\n//! [6]\n# Rotate an item 45 degrees around (0, 0)\nitem.rotate(45)\n\n# Rotate an item 45 degrees around (x, y)\nitem.setTransform(QTransform().translate(x, y).rotate(45).translate(-x, -y))\n//! [6]\n\n\n//! [7]\n# Scale an item by 3x2 from its origin\nitem.scale(3, 2)\n\n# Scale an item by 3x2 from (x, y)\nitem.setTransform(QTransform().translate(x, y).scale(3, 2).translate(-x, -y))\n//! [7]\n\n\n//! [8]\ndef boundingRect(self):\n    penWidth = 1.0\n    return QRectF(-radius - penWidth / 2, -radius - penWidth / 2,\n                  diameter + penWidth, diameter + penWidth)\n//! [8]\n\n\n//! [9]\ndef shape(self):\n    path = QPainterPath()\n    path.addEllipse(boundingRect())\n    return path\n//! [9]\n\n\n//! [10]\ndef paint(self, painter, option, widget):\n    painter.drawRoundedRect(-10, -10, 20, 20, 5, 5)\n//! [10]\n\n\n//! [11]\nObjectName = 0;\n\nitem = scene.itemAt(100, 50)\nif len(item.data(ObjectName)) == 0:\n    if isinstance(ButtonItem, item):\n        item.setData(ObjectName, \"Button\")\n//! [11]\n\n\n//! [12]\nscene = QGraphicsScene()\nellipse = scene.addEllipse(QRectF(-10, -10, 20, 20))\nline = scene.addLine(QLineF(-10, -10, 20, 20))\n\nline.installSceneEventFilter(ellipse)\n# line's events are filtered by ellipse's sceneEventFilter() function.\n\nellipse.installSceneEventFilter(line)\n# ellipse's events are filtered by line's sceneEventFilter() function.\n//! [12]\n\n\n//! [13]\ndef contextMenuEvent(self, event):\n    menu = QMenu()\n    removeAction = menu.addAction(\"Remove\")\n    markAction = menu.addAction(\"Mark\")\n    selectedAction = menu.exec(event.screenPos())\n    // ...\n//! [13]\n\n\n//! [14]\ndef __init__(self):\n    self.setAcceptDrops(true)\n    ...\n\ndef dragEnterEvent(self, event):\n    event.setAccepted(event.mimeData().hasFormat(\"text/plain\"))\n//! [14]\n\n\n//! [15]\ndef itemChange(self, change, value):\n    if change == ItemPositionChange && scene():\n        # value is the new position.\n        rect = scene().sceneRect()\n        if !rect.contains(value):\n            # Keep the item inside the scene rect.\n            value.setX(qMin(rect.right(), qMax(value.x(), rect.left())))\n            value.setY(qMin(rect.bottom(), qMax(value.y(), rect.top())))\n            return value\n    return QGraphicsItem.itemChange(self, change, value)\n//! [15]\n\n\n//! [16]\ndef setRadius(self, newRadius):\n    if radius != newRadius:\n        prepareGeometryChange()\n        radius = newRadius\n//! [16]\n\n\n//! [17]\n# Group all selected items together\ngroup = scene.createItemGroup(scene.selecteditems())\n\n# Destroy the group, and delete the group item\nscene.destroyItemGroup(group)\n//! [17]\n\n\n//! [QGraphicsItem type]\nclass CustomItem(QGraphicsItem):\n    ...\n    self.Type = QGraphicsItem.UserType + 1\n\n    def type(self):\n       # Enable the use of qgraphicsitem_cast with this item.\n       return self.Type\n    ...\n//! [QGraphicsItem type]\n\n//! [18]\nclass QGraphicsPathItem (QAbstractGraphicsShapeItem):\n    Type = 2\n\n    def type(self):\n        return QGraphicsPathItem.Type\n# ...\n//! [18]\n\n//! [19]\nxform = item.deviceTransform(view.viewportTransform())\ndeviceRect = xform.mapRect(rect).toAlignedRect()\nview.viewport().scroll(dx, dy, deviceRect)\n//! [19]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicslinearlayout.cpp",
    "content": "//! [0]\nscene = QGraphicsScene()\ntextEdit = scene.addWidget(QTextEdit())\npushButton = scene.addWidget(QPushButton())\n\nlayout = QGraphicsLinearLayout()\nlayout.addItem(textEdit)\nlayout.addItem(pushButton)\n\nform = QGraphicsWidget()\nform.setLayout(layout)\nscene.addItem(form)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsproxywidget.cpp",
    "content": "//! [0]\nimport sys\n\nQApplication app(sys.argv)\n\ntabWidget = QTabWidget()\n\nscene = QGraphicsScene()\nproxy = scene.addWidget(tabWidget)\n\nview = QGraphicsView(scene)\nview.show()\n\nreturn app.exec_()\n//! [0]\n\n//! [1]\ngroupBox = QGroupBox(\"Contact Details\")\nnumberLabel = QLabel(\"Telephone number\")\nnumberEdit = QLineEdit()\n\nlayout = QFormLayout()\nlayout.addRow(numberLabel, numberEdit)\ngroupBox.setLayout(layout)\n\nscene = QGraphicsScene()\nproxy = scene.addWidget(groupBox)\n\nview = QGraphicsView(scene)\nview.show()\n//! [1]\n\n//! [2]\nscene = QGraphicsScene()\n\nedit = QLineEdit()\nproxy = scene.addWidget(edit)\n\nedit.isVisible()  // returns true\nproxy.isVisible() // also returns true\n\nedit.hide()\n\nedit.isVisible()  // returns false\nproxy.isVisible() // also returns false\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsscene.cpp",
    "content": "//! [0]\nscene = QGraphicsScene()\nscene.addText(\"Hello, world!\")\n\nview = QGraphicsView(&scene)\nview.show()\n//! [0]\n\n\n//! [1]\nscene = QGraphicsScene\nscene.addItem(...\n...\nprinter = QPrinter(QPrinter.HighResolution)\nprinter.setPaperSize(QPrinter.A4)\n\npainter = QPainter(printer)\nscene.render(&painter)\n//! [1]\n\n\n//! [2]\nsegmentSize = sceneRect().size() / math.pow(2, depth - 1)\n//! [2]\n\n\n//! [3]\nscene = QGraphicsScene()\nview = QGraphicsView(scene)\nview.show()\n\n# a blue background\nscene.setBackgroundBrush(Qt.blue)\n\n# a gradient background\ngradient = QRadialGradient(0, 0, 10)\ngradient.setSpread(QGradient.RepeatSpread)\nscene.setBackgroundBrush(gradient)\n//! [3]\n\n\n//! [4]\nscene = QGraphicsScene()\nview = QGraphicsView(scene)\nview.show()\n\n# a white semi-transparent foreground\nscene.setForegroundBrush(QColor(255, 255, 255, 127))\n\n# a grid foreground\nscene.setForegroundBrush(QBrush(Qt.lightGray, Qt.CrossPattern))\n//! [4]\n\n\n//! [5]\nclass TileScene (QGraphicsScene):\n    # ...\n    def rectForTile(x, y):\n        # Return the rectangle for the tile at position (x, y).\n        return QRectF(x * self.tileWidth, y * self.tileHeight, self.tileWidth, self.tileHeight)\n\n    def setTile(x, y, pixmap):\n        # Sets or replaces the tile at position (x, y) with pixmap.\n        if x >= 0 && x < self.numTilesH && y >= 0 && y < self.numTilesV:\n            self.tiles[y][x] = pixmap\n            invalidate(rectForTile(x, y), BackgroundLayer)\n\n    def drawBackground(painter, exposed):\n        # Draws all tiles that intersect the exposed area.\n        for y in range(0, self.numTilesV:\n            for x in range(0, self.numTilesH:\n                rect = rectForTile(x, y)\n                if exposed.intersects(rect):\n                    painter.drawPixmap(rect.topLeft(), tiles[y][x])\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicssceneevent.cpp",
    "content": "//! [0]\n\nsetDropAction(proposedAction())\n\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp",
    "content": "//! [0]\nscene = QGraphicsScene()\nscene.addText(\"Hello, world!\")\n\nview = QGraphicsView(scene)\nview.show()\n//! [0]\n\n\n//! [1]\nscene = QGraphicsScene()\nscene.addRect(QRectF(-10, -10, 20, 20))\n\nview = QGraphicsView(scene)\nview.setRenderHints(QPainter.Antialiasing | QPainter.SmoothPixmapTransform)\nview.show()\n//! [1]\n\n\n//! [2]\nview = QGraphicsView()\nview.setBackgroundBrush(QImage(\":/images/backgroundtile.png\"))\nview.setCacheMode(QGraphicsView.CacheBackground)\n//! [2]\n\n\n//! [3]\nscene = QGraphicsScene()\nscene.addText(\"GraphicsView rotated clockwise\")\n\nview = QGraphicsView(scene)\nview.rotate(90) # the text is rendered with a 90 degree clockwise rotation\nview.show()\n//! [3]\n\n\n//! [4]\nscene = QGraphicsScene()\nscene.addItem(...\n...\n\nview = QGraphicsView(scene)\nview.show()\n...\n\nprinter = QPrinter(QPrinter.HighResolution)\nprinter.setPageSize(QPrinter.A4)\npainter = QPainter(printer)\n\n# print, fitting the viewport contents into a full page\nview.render(painter)\n\n# print the upper half of the viewport into the lower.\n# half of the page.\nviewport = view.viewport()->rect()\nview.render(painter,\n            QRectF(0, printer.height() / 2,\n                   printer.width(), printer.height() / 2),\n            viewport.adjusted(0, 0, 0, -viewport.height() / 2))\n\n//! [4]\n\n\n//! [5]\ndef mousePressEvent(self, event):\n    print \"There are\", items(event->pos()).size(), \"items at position\", mapToScene(event->pos())\n//! [5]\n\n\n//! [6]\ndef mousePressEvent(self, event):\n    if (item = itemAt(event.pos()):\n        print \"You clicked on item\", item\n    else:\n        print \"You didn't click on an item.\"\n//! [6]\n\n\n//! [7]\nscene = QGraphicsScene()\nscene.addText(\"GraphicsView rotated clockwise\")\n\nview = QGraphicsView(scene)\nview.rotate(90) # the text is rendered with a 90 degree clockwise rotation\nview.show()\n//! [7]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_graphicsview_qgraphicswidget.cpp",
    "content": "//! [0]\nclass MyGroupBoxWidget (QStyleOptionGroupBox):\n    # ...\n    def initStyleOption(option):\n        QGraphicsWidget.initStyleOption(self, option)\n        if isinstance(option, QStyleOptionGroupBox):\n            # Add group box specific state.\n            box.flat = isFlat()\n            # ...\n//! [0]\n\n\n//! [1]\nsetTabOrder(a, b) # a to b\nsetTabOrder(b, c) # a to b to c\nsetTabOrder(c, d) # a to b to c to d\n//! [1]\n\n\n//! [2]\n# WRONG\nsetTabOrder(c, d) # c to d\nsetTabOrder(a, b) # a to b AND c to d\nsetTabOrder(b, c) # a to b to c, but not c to d\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qbitmap.cpp",
    "content": "//! [0]\nuchar arrow_bits[] = { 0x3f, 0x1f, 0x0f, 0x1f, 0x3b, 0x71, 0xe0, 0xc0 };\nQBitmap bm(8, 8, arrow_bits, true);\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qicon.cpp",
    "content": "//! [0]\nbutton = QToolButton()\nbutton.setIcon(QIcon(\"open.xpm\"))\n//! [0]\n\n\n//! [1]\nbutton.setIcon(QIcon())\n//! [1]\n\n\n//! [2]\ndef drawIcon(self, painter, pos):\n    enabledStatus = QIcon.Normal\n    if not isEnabled():\n        enabledStatus = QIcon::Disabled\n\n    onOff = QIcon.On\n    if not isOn():\n        onOff = QIcon.Off\n\n    pixmap = self.icon.pixmap(QSize(22, 22), enabledStatus, onOff)\n    painter.drawPixmap(pos, pixmap)\n//! [2]\n\n//! [3]\n    undoicon = QIcon.fromTheme(\"edit-undo\")\n//! [3]\n\n//! [4]\n    undoicon = QIcon.fromTheme(\"edit-undo\", QIcon(\":/undo.png\"))\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qimage.cpp",
    "content": "//! [0]\nimage = QImage(3, 3, QImage.Format_RGB32)\n\nvalue = qRgb(189, 149, 39)  # 0xffbd9527\nimage.setPixel(1, 1, value)\n\nvalue = qRgb(122, 163, 39)  # 0xff7aa327\nimage.setPixel(0, 1, value)\nimage.setPixel(1, 0, value)\n\nvalue = qRgb(237, 187, 51)  # 0xffedba31\nimage.setPixel(2, 1, value)\n//! [0]\n\n\n//! [1]\nimage = QImage(3, 3, QImage.Format_Indexed8)\nvalue = qRgb(122, 163, 39) # 0xff7aa327\nimage.setColor(0, value)\n\nvalue = qRgb(237, 187, 51) # 0xffedba31\nimage.setColor(1, value)\n\nvalue = qRgb(189, 149, 39) # 0xffbd9527\nimage.setColor(2, value)\n\nimage.setPixel(0, 1, 0)\nimage.setPixel(1, 0, 0)\nimage.setPixel(1, 1, 2)\nimage.setPixel(2, 1, 1)\n//! [1]\n\n\n//! [2]\nstart_xpm = [\"16 15 8 1\", \"a c #cec6bd\", ....\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagereader.cpp",
    "content": "//! [0]\nreader = QImageReader()\nreader.setFormat(\"png\") # same as reader.setFormat(\"PNG\")\n//! [0]\n\n\n//! [1]\nreader = QImageReader(\"image.png\")\n# reader.format() == \"png\"\n//! [1]\n\n\n//! [2]\nicon = QImage(64, 64, QImage.Format_RGB32)\nreader = QImageReader(\"icon_64x64.bmp\")\nif reader.read(icon):\n    # Display icon\n//! [2]\n\n\n//! [3]\nreader = QImageReader(\":/image.png\")\nif reader.supportsOption(QImageIOHandler.Size):\n    print \"Size:\", str(reader.size())\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qimagewriter.cpp",
    "content": "//! [0]\nwriter = QImageWriter()\nwriter.setFormat(\"png\") # same as writer.setFormat(\"PNG\")\n//! [0]\n\n\n//! [1]\nimage = QImage(\"some/image.jpeg\")\nwriter = QImageWriter(\"images/outimage.png\", \"png\")\nwriter.setText(\"Author\", \"John Smith\")\nwriter.write(image)\n//! [1]\n\n\n//! [2]\nwriter = QImageWriter(fileName)\nif writer.supportsOption(QImageIOHandler.Description):\n    writer.setText(\"Author\", \"John Smith\")\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qmovie.cpp",
    "content": "//! [0]\nlabel = QLabel()\nmovie = QMovie(\"animations/fire.gif\")\n\nlabel.setMovie(movie)\nmovie.start()\n//! [0]\n\n\n//! [1]\nmovie = QMovie(\"racecar.gif\")\nmovie.setSpeed(200) // 2x speed\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmap.cpp",
    "content": "//! [0]\nstatic const char * const start_xpm[]={\n    \"16 15 8 1\",\n    \"a c #cec6bd\",\n....\n//! [0]\n\n\n//! [1]\nmyPixmap = QPixmap()\nmyPixmap.setMask(myPixmap.createHeuristicMask())\n//! [1]\n\n//! [2]\npixmap = QPixmap(\"background.png\")\nexposed = QRegion()\npixmap.scroll(10, 10, pixmap.rect(), exposed)\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp",
    "content": "//! [0]\npm = QPixmap()\nif not QPixmapCache.find(\"my_big_image\", pm):\n    pm.load(\"bigimage.png\")\n    QPixmapCache.insert(\"my_big_image\", pm)\npainter.drawPixmap(0, 0, pm)\n//! [0]\n\n\n//! [1]\npm = QPixmap()\nif not QPixmapCache.find(\"my_big_image\", pm):\n    pm.load(\"bigimage.png\")\n    QPixmapCache.insert(\"my_big_image\", pm)\npainter.drawPixmap(0, 0, pm)\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_image_qpixmapfilter.cpp",
    "content": "//! [0]\nmyFilter = QPixmapColorFilter()\nmyFilter.setColor(QColor(128, 0, 0))\nmyFilter.draw(painter, QPoint(0, 0), originalPixmap)\n//! [0]\n\n//! [1]\nmyFilter = QPixmapConvolutionFilter()\nkernel = [\n     0.0,-1.0, 0.0,\n    -1.0, 5.0,-1.0,\n     0.0,-1.0, 0.0\n    ]\nmyFilter.setConvolutionKernel(kernel, 3, 3)\nmyFilter.sdraw(painter, QPoint(0, 0), originalPixmap)\n//! [1]\n\n//! [2]\nmyFilter = QPixmapDropShadowFilter()\nmyFilter.draw(painter, QPoint(0, 0), originalPixmap)\n//! [2]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qabstractitemview.cpp",
    "content": "//! [0]\ndef resizeEvent(self, event):\n    horizontalScrollBar().setRange(0, realWidth - width())\n    ...\n//! [0]\n\n//! [1]\nsetIndexWidget(index, QLineEdit())\n...\nsetIndexWidget(index, QTextEdit())\n//! [1]\n\n//! [2]\nm = view->selectionModel()\nview->setModel(model())\ndel m\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qdatawidgetmapper.cpp",
    "content": "//! [0]\nmapper = QDataWidgetMapper\nmapper.setModel(model)\nmapper.addMapping(mySpinBox, 0)\nmapper.addMapping(myLineEdit, 1)\nmapper.addMapping(myCountryChooser, 2)\nmapper.toFirst()\n//! [0]\n\n\n//! [1]\nmapper = QDataWidgetMapper()\nmapper.setModel(myModel)\nmapper.addMapping(nameLineEdit, 0)\nmapper.addMapping(ageSpinBox, 1)\n//! [1]\n\n\n//! [2]\nmapper = QDataWidgetMapper()\nconnect(myTableView.selectionModel(), SIGNAL(\"currentRowChanged(QModelIndex,QModelIndex)\"),\n        mapper, SLOT(setCurrentModelIndex(QModelIndex)))\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemeditorfactory.cpp",
    "content": "//! [0]\nQ_PROPERTY(QColor color READ color WRITE setColor USER true)\n//! [0]\n\n\n//! [1]\nQItemEditorCreator<MyEditor> *itemCreator =\n    new QItemEditorCreator<MyEditor>(\"myProperty\");\n\nQItemEditorFactory *factory = new QItemEditorFactory;\n//! [1]\n\n\n//! [2]\nQItemEditorFactory *editorFactory = new QItemEditorFactory;\nQItemEditorCreatorBase *creator = new QStandardItemEditorCreator<MyFancyDateTimeEdit>();\neditorFactory->registerEditor(QVariant::DateType, creator);\n//! [2]\n\n\n//! [3]\nQ_PROPERTY(QColor color READ color WRITE setColor USER true)\t\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp",
    "content": "//! [0]\nselection = QItemSelection(topLeft, bottomRight)\n//! [0]\n\n\n//! [1]\nselection = QItemSelection()\n...\nselection.select(topLeft, bottomRight)\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qstandarditemmodel.cpp",
    "content": "//! [0]\nmodel = QStandardItemModel (4, 4)\nfor row in range(4):\n    for column in range(4):\n        item = QStandardItem(\"row %d, column %d\" % (row, column))\n        model.setItem(row, column, item)\n//! [0]\n\n\n//! [1]\nmodel = QStandardItemModel()\nparentItem = model.invisibleRootItem()\nfor i in range(4):\n    item = QStandardItem(\"item %d\" % i)\n    parentItem.appendRow(item)\n    parentItem = item\n//! [1]\n\n\n//! [2]\ntreeView = QTreeView(self)\ntreeView.setModel(myStandardItemModel)\ntreeView.clicked[QModelIndex].connect(self.clicked)\n//! [2]\n\n\n//! [3]\ndef clicked(self, index):\n    item = myStandardItemModel.itemFromIndex(index)\n    # Do stuff with the item ...\n//! [3]\n\n\n//! [4]\ntreeView.scrollTo(item.index())\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtablewidget.cpp",
    "content": "//! [0]\nsetCellWidget(index, QLineEdit())\n...\nsetCellWidget(index, QTextEdit())\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_itemviews_qtreewidget.cpp",
    "content": "//! [0]\ntreeWidget = QTreeWidget()\ntreeWidget.setColumnCount(1)\nitems = []\nfor i in range(10):\n    items.append(QTreeWidgetItem(None, QStringList(QString(\"item: %1\").arg(i))))\ntreeWidget.insertTopLevelItems(None, items)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qaction.cpp",
    "content": "//! [0]\napp = QApplication(argv)\napp.setAttribute(Qt.AA_DontShowIconsInMenus)  # Icons are *no longer shown* in menus\n// ...\nmyAction = QAction()\n// ...\nmyAction.setIcon(SomeIcon)\nmyAction.setIconVisibleInMenu(True)   # Icon *will* be shown in menus for *this* action.\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication.cpp",
    "content": "//! [0]\ndef main():\n    if Qt.Q_WS_X11\n        useGUI = getenv(\"DISPLAY\") != 0\n    else:\n        useGUI = True\n\n    app = QApplication(sys.argv, useGUI)\n\n    if useGUI:\n       # start GUI version\n       ...\n    else:\n       # start non-GUI version\n       ...\n    return app.exec_()\n//! [0]\n\n\n//! [1]\nQApplication.setStyle(QWindowsStyle())\n//! [1]\n\n\n//! [2]\ndef main():\n    QApplication.setColorSpec(QApplication.ManyColor)\n    QApplication app(sys.argv)\n    ...\n    return app.exec_()\n\n//! [2]\n\n\n//! [3]\nclass MyWidget (QWidget):\n    # ...\n    def sizeHint(self):\n        return QSize(80, 25).expandedTo(QApplication.globalStrut())\n//! [3]\n\n\n//! [4]\ndef showAllHiddenTopLevelWidgets():\n    for widget in QApplication.topLevelWidgets():\n        if widget.isHidden():\n            widget.show()\n//! [4]\n\n\n//! [5]\ndef updateAllWidgets():\n    for widget in QApplication.allWidgets()\n        widget.update()\n//! [5]\n\n\n//! [6]\nif __name__ == '__main__':\n    QApplication.setDesktopSettingsAware(False)\n    app = QApplication(sys.argv)\n    # ...\n    return app.exec_()\n//! [6]\n\n\n//! [7]\nif (startPos - currentPos).manhattanLength() >= QApplication.startDragDistance():\n    startTheDrag()\n//! [7]\n\n\n//! [8]\nclass MyApplication (QApplication):\n# ...\n    def commitData(QSessionManager& manager)\n        if manager.allowsInteraction():\n            ret = QMessageBox.warning(\n                    mainWindow,\n                    QObject.tr(\"My Application\"),\n                    QObject.tr(\"Save changes to document?\"),\n                    QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel)\n\n            if ret == QMessageBox.Save:\n                manager.release()\n                if not saveDocument():\n                    manager.cancel()\n            elif ret == QMessageBox.Discard:\n                pass\n            else:\n                manager.cancel()\n        else:\n            # we did not get permission to interact, then\n            # do something reasonable instead\n            pass\n//! [8]\n\n\n//! [9]\nappname -session id\n//! [9]\n\n\n//! [10]\nfor command in mySession.restartCommand():\n    do_something(command)\n//! [10]\n\n\n//! [11]\nfor command in mySession.discardCommand():\n    do_something(command)\n//! [11]\n\n\n//! [12]\nwidget = qApp.widgetAt(x, y)\nif widget:\n    widget = widget.window()\n//! [12]\n\n\n//! [13]\nwidget = qApp.widgetAt(point)\nif widget:\n    widget = widget.window()\n//! [13]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qapplication_x11.cpp",
    "content": "//! [0]\nQApplication.setOverrideCursor(QCursor(Qt.WaitCursor))\ncalculateHugeMandelbrot()              # lunch time...\nQApplication.restoreOverrideCursor()\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qclipboard.cpp",
    "content": "//! [0]\nclipboard = QApplication.clipboard()\noriginalText = clipboard.text()\n...\nclipboard.setText(newText)\n//! [0]\n\n\n//! [1]\ndata = QMimeData()\ndata.setImageData(image)\nclipboard.setMimeData(data, mode)\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qevent.cpp",
    "content": "//! [0]\ndef wheelEvent(self, event):\n    numDegrees = event.delta() / 8\n    numSteps = numDegrees / 15\n\n    if event->orientation() == Qt.Horizontal:\n        scrollHorizontally(numSteps)\n    else:\n        scrollVertically(numSteps)\n    event.accept()\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qformlayout.cpp",
    "content": "//! [0]\nformLayout = QFormLayout()\nformLayout.addRow(self.tr(\"&Name:\"), nameLineEdit)\nformLayout.addRow(self.tr(\"&Email:\"), emailLineEdit)\nformLayout.addRow(self.tr(\"&Age:\"), ageSpinBox)\nsetLayout(formLayout)\n//! [0]\n\n\n//! [1]\nnameLabel = QLabel(self.tr(\"&Name:\"))\nnameLabel.setBuddy(nameLineEdit)\n\nemailLabel = QLabel(self.tr(\"&Name:\"))\nemailLabel.setBuddy(emailLineEdit)\n\nageLabel = QLabel(self.tr(\"&Name:\"))\nageLabel.setBuddy(ageSpinBox)\n\ngridLayout = QGridLayout()\ngridLayout.addWidget(nameLabel, 0, 0)\ngridLayout.addWidget(nameLineEdit, 0, 1)\ngridLayout.addWidget(emailLabel, 1, 0)\ngridLayout.addWidget(emailLineEdit, 1, 1)\ngridLayout.addWidget(ageLabel, 2, 0)\ngridLayout.addWidget(ageSpinBox, 2, 1)\nsetLayout(gridLayout)\n//! [1]\n\n\n//! [2]\nformLayout.trowWrapPolicy(QFormLayout.DontWrapRows)\nformLayout.setFieldGrowthPolicy(QFormLayout.FieldsStayAtSizeHint)\nformLayout.setFormAlignment(Qt.AlignHCenter | Qt.AlignTop)\nformLayout.setLabelAlignment(Qt.AlignLeft)\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qkeysequence.cpp",
    "content": "//! [0]\nQKeySequence(QKeySequence.Print)\nQKeySequence(tr(\"Ctrl+P\"))\nQKeySequence(tr(\"Ctrl+p\"))\nQKeySequence(Qt.CTRL + Qt.Key_P)\n//! [0]\n\n\n//! [1]\nQKeySequence(tr(\"Ctrl+X, Ctrl+C\"))\nQKeySequence(Qt.CTRL + Qt.Key_X, Qt.CTRL + Qt.Key_C)\n//! [1]\n\n\n//! [2]\nfile = QMenu(self)\nfile.addAction(tr(\"&Open...\"), self, SLOT(\"open()\"),\n               QKeySequence(tr(\"Ctrl+O\", \"File|Open\")))\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayout.cpp",
    "content": "//! [0]\n\ndef paintLayout(self, painter, item):\n    layout = item.layout()\n\n    if layout:\n        for layout_item in layout:\n            self.paintLayout(painter, layout_item)\n\n    painter.drawRect(item.geometry())\n\ndef paintEvent(self, event):\n    painter = QPainter(self)\n    if self.layout():\n        self.paintLayout(painter, self.layout())\n\n//! [0]\n\n\n//! [1]\nchild = layout.takeAt(0)\nwhile child:\n    ...\n    del child\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qlayoutitem.cpp",
    "content": "//! [0]\ndef heightForWidth(self, w):\n    if cache_dirty or cached_width != w:\n        h = calculateHeightForWidth(w)\n        self.cached_hfw = h\n        return h\n    return cached_hfw\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcut.cpp",
    "content": "//! [0]\nshortcut = QShortcut(QKeySequence(self.tr(\"Ctrl+O\", \"File|Open\")),\n                     parent)\n//! [0]\n\n\n//! [1]\nsetKey(0)                  # no signal emitted\nsetKey(QKeySequence())     # no signal emitted\nsetKey(0x3b1)              # Greek letter alpha\nsetKey(Qt.Key_D)           # 'd', e.g. to delete\nsetKey('q')                # 'q', e.g. to quit\nsetKey(Qt.CTRL + Qt.Key_P) # Ctrl+P, e.g. to print document\nsetKey(\"Ctrl+P\")           # Ctrl+P, e.g. to print document\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qshortcutmap.cpp",
    "content": "//! [0]\nkey = QKeySequence()\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qsound.cpp",
    "content": "//! [0]\nQSound.play(\"mysounds/bells.wav\")\n//! [0]\n\n\n//! [1]\nbells = QSound(\"mysounds/bells.wav\")\nbells.play()\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_kernel_qwidget.cpp",
    "content": "//! [0]\nw.setWindowState(w.windowState() ^ Qt.WindowFullScreen)\n//! [0]\n\n\n//! [1]\nw.setWindowState(w.windowState() & ~Qt.WindowMinimized | Qt.WindowActive)\n//! [1]\n\n\n//! [2]\nwidth = widget.baseSize().width() + i * widget.sizeIncrement().width()\nheight = widget.baseSize().height() + j * widget.sizeIncrement().height()\n//! [2]\n\n\n//! [3]\naWidget.window().setWindowTitle(\"New Window Title\")\n//! [3]\n\n\n//! [4]\nfont = QFont(\"Helvetica\", 12, QFont.Bold)\nwidget.setFont(font)\n//! [4]\n\n\n//! [5]\nfont = QFont()\nfont.setBold(false)\nwidget.setFont(font)\n//! [5]\n\n\n//! [6]\nwidget.setCursor(Qt.IBeamCursor)\n//! [6]\n\n\n//! [7]\npixmap = QPixmap(widget.size())\nwidget.render(&pixmap)\n//! [7]\n\n\n//! [8]\npainter = QPainter(self)\n...\npainter.end()\nmyWidget.render(self)\n//! [8]\n\n\n//! [9]\nwidget.setTabOrder(a, b) # a to b\nwidget.setTabOrder(b, c) # a to b to c\nwidge.tsetTabOrder(c, d) # a to b to c to d\n//! [9]\n\n\n//! [10]\n# WRONG\nwidget.setTabOrder(c, d) # c to d\nwidget.setTabOrder(a, b) # a to b AND c to d\nwidget.setTabOrder(b, c) # a to b to c, but not c to d\n//! [10]\n\n\n//! [11]\nclass MyWidget(QWidget):\n\n    self.settings = None\n\n    def closeEvent(event):\n        # event is a QCloseEvent\n        self.settings = QSettings(\"MyCompany\", \"MyApp\")\n        self.settings.setValue(\"geometry\", self.saveGeometry())\n        QWidget.closeEvent(self, event)\n//! [11]\n\n\n//! [12]\nsettings = QSettings(\"MyCompany\", \"MyApp\")\nmyWidget.restoreGeometry(settings.value(\"myWidget/geometry\").toByteArray())\n//! [12]\n\n\n//! [13]\nwidget.setUpdatesEnabled(False)\nwidget.bigVisualChanges()\nwidget.setUpdatesEnabled(True)\n//! [13]\n\n\n//! [14]\n...\nextern void qt_x11_set_global_double_buffer(bool);\nqt_x11_set_global_double_buffer(false);\n...\n//! [14]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qbrush.cpp",
    "content": "//! [0]\npainter = QPainter(self)\n\npainter.setBrush(Qt.cyan)\npainter.setPen(Qt.darkCyan)\npainter.drawRect(0, 0, 100,100)\n\npainter.setBrush(Qt.NoBrush)\npainter.setPen(Qt.darkGreen)\npainter.drawRect(40, 40, 100, 100)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qcolor.cpp",
    "content": "//! [0]\n# Specify semi-transparent red\npainter.setBrush(QColor(255, 0, 0, 127))\npainter.drawRect(0, 0, self.width()/2, self.height())\n\n# Specify semi-transparent blue\npainter.setBrush(QColor(0, 0, 255, 127))\npainter.drawRect(0, 0, self.width(), self.height()/2)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qdrawutil.cpp",
    "content": "//! [0]\nframe = QFrame()\nframe.setFrameStyle(QFrame.HLine | QFrame.Sunken)\n//! [0]\n\n\n//! [1]\nframe = QFrame()\nframe.setFrameStyle(QFrame.Box | QFrame.Raised)\n//! [1]\n\n\n//! [2]\nframe = QFrame()\nframe.setFrameStyle( QFrame.Panel | QFrame.Sunken)\n//! [2]\n\n\n//! [3]\nframe = QFrame()\nframe.setFrameStyle(QFrame.WinPanel | QFrame.Raised)\n//! [3]\n\n\n//! [4]\nframe = QFrame()\nframe.setFrameStyle(QFrame.Box | QFrame.Plain)\n//! [4]\n\n\n//! [5]\nframe = QFrame()\nframe.setFrameStyle(QFrame.HLine | QFrame.Sunken)\n//! [5]\n\n\n//! [6]\nframe = QFrame()\nframe.setFrameStyle(QFrame.Box | QFrame.Raised)\n//! [6]\n\n\n//! [7]\nframe = QFrame()\nframe.setFrameStyle( QFrame.Panel | QFrame.Sunken)\n//! [7]\n\n\n//! [8]\nframe = QFrame()\nframe.setFrameStyle(QFrame.WinPanel | QFrame.Raised)\n//! [8]\n\n\n//! [9]\nframe = QFrame()\nframe.setFrameStyle(QFrame.Box | QFrame.Plain)\n//! [9]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qmatrix.cpp",
    "content": "//! [0]\nx' = m11*x + m21*y + dx\ny' = m22*y + m12*x + dy\n//! [0]\n\n\n//! [1]\nx' = m11*x + m21*y + dx\ny' = m22*y + m12*x + dy\n//! [1]\n\n\n//! [2]\nx' = m11*x + m21*y + dx\ny' = m22*y + m12*x + dy\n//! [2]\n\n\n//! [3]\nx' = m11*x + m21*y + dx\ny' = m22*y + m12*x + dy\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp",
    "content": "//! [0]\ndef paintEvent(self, paintEvent):\n    painter = QPainter(self)\n    painter.setPen(Qt.blue)\n    painter.setFont(QFont(\"Arial\", 30))\n    painter.drawText(rect(), Qt.AlignCenter, \"Qt\")\n//! [0]\n\n\n//! [1]\ndef paintEvent(self, paintEvent):\n    p = QPainter()\n    p.begin(self)\n    p.drawLine(...)         # drawing code\n    p.end()\n//! [1]\n\n\n//! [2]\nself paintEvent(self, paintEvent):\n    p = QPainter(self)\n    p.drawLine(...)         # drawing code\n\n//! [2]\n\n\n//! [3]\npainter.begin(0)  # impossible - paint device cannot be 0\n\nimage = QPixmap(0, 0)\npainter.begin(&image) # impossible - image.isNull() == true\n\npainter.begin(myWidget)\npainter2.begin(myWidget) # impossible - only one painter at a time\n//! [3]\n\n\n//! [4]\ndef rotate(self, angle):\n    matrix = QMatrix()\n    matrix.rotate(angle)\n    setWorldMatrix(matrix, true)\n//! [4]\n\n\n//! [5]\npath = QPainterPath()\npath.moveTo(20, 80)\npath.lineTo(20, 30)\npath.cubicTo(80, 0, 50, 50, 80, 80)\n\npainter = QPainter(self)\npainter.drawPath(path)\n//! [5]\n\n\n//! [6]\nline = QLineF(10.0, 80.0, 90.0, 20.0)\n\npainter = QPainter(self)\npainter.drawLine(line)\n//! [6]\n\n\n//! [7]\nrectangle = QRectF(10.0, 20.0, 80.0, 60.0)\n\npainter = QPainter(self)\npainter.drawRect(rectangle)\n//! [7]\n\n\n//! [8]\nrectangle = QRectF(10.0, 20.0, 80.0, 60.0)\n\npainter = QPainter(self)\npainter.drawRoundedRect(rectangle, 20.0, 15.0)\n//! [8]\n\n\n//! [9]\nrectangle = QRectF(10.0, 20.0, 80.0, 60.0)\n\npainter = QPainter(self)\npainter.drawEllipse(rectangle)\n//! [9]\n\n\n//! [10]\nrectangle = QRectF(10.0, 20.0, 80.0, 60.0)\nstartAngle = 30 * 16\nspanAngle = 120 * 16\n\npainter = QPainter(self)\npainter.drawArc(rectangle, startAngle, spanAngle)\n//! [10]\n\n\n//! [11]\nrectangle = QRectF(10.0, 20.0, 80.0, 60.0)\nstartAngle = 30 * 16\nspanAngle = 120 * 16\n\npainter = QPainter(self)\npainter.drawPie(rectangle, startAngle, spanAngle)\n//! [11]\n\n\n//! [12]\nrectangle = QRectF(10.0, 20.0, 80.0, 60.0)\nstartAngle = 30 * 16\nspanAngle = 120 * 16\n\npainter = QPainter(self)\npainter.drawChord(rect, startAngle, spanAngle)\n//! [12]\n\n\n//! [13]\npoints = [\n    QPointF(10.0, 80.0),\n    QPointF(20.0, 10.0),\n    QPointF(80.0, 30.0),\n]\n\npainter = QPainter(self)\npainter.drawPolyline(points, 3)\n//! [13]\n\n\n//! [14]\npoints = [\n    QPointF(10.0, 80.0),\n    QPointF(20.0, 10.0),\n    QPointF(80.0, 30.0),\n    QPointF(90.0, 70.0)\n]\n\npainter = QPainter(self)\npainter.drawPolygon(points, 4)\n//! [14]\n\n\n//! [15]\npoints = [\n    QPointF(10.0, 80.0),\n    QPointF(20.0, 10.0),\n    QPointF(80.0, 30.0),\n    QPointF(90.0, 70.0)\n]\n\npainter = QPainter(self)\npainter.drawConvexPolygon(points, 4)\n//! [15]\n\n\n//! [16]\ntarget = QRectF(10.0, 20.0, 80.0, 60.0)\nsource = QRectF(0.0, 0.0, 70.0, 40.0)\npixmap = QPixmap(\":myPixmap.png\")\n\npainter = QPainter(self)\npainter.drawPixmap(target, image, source)\n//! [16]\n\n\n//! [17]\npainter = QPainter(self)\npainter.drawText(rect, Qt.AlignCenter, tr(\"Qt by\\nTrolltech\"))\n//! [17]\n\n\n//! [18]\npicture = QPicture()\npoint = QPointF(10.0, 20.0)\npicture.load(\"drawing.pic\")\n\npainter = QPainter(self)\npainter.drawPicture(0, 0, picture)\n//! [18]\n\n\n//! [19]\nfillRect(rectangle, background())\n//! [19]\n\n\n//! [20]\ntarget = QRectF(10.0, 20.0, 80.0, 60.0)\nsource = QRectF(0.0, 0.0, 70.0, 40.0)\nimage = QImage(\":/images/myImage.png\")\n\npainter = QPainter(self)\npainter.drawImage(target, image, source)\n//! [20]\n\n//! [21]\npainter = QPainter(self)\npainter.fillRect(0, 0, 128, 128, Qt.green)\npainter.beginNativePainting()\n\nglEnable(GL_SCISSOR_TEST)\nglScissor(0, 0, 64, 64)\n\nglClearColor(1, 0, 0, 1)\nglClear(GL_COLOR_BUFFER_BIT)\n\nglDisable(GL_SCISSOR_TEST)\n\npainter.endNativePainting()\n//! [21]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainterpath.cpp",
    "content": "//! [0]\npath = QPainterPath()\npath.addRect(20, 20, 60, 60)\n\npath.moveTo(0, 0)\npath.cubicTo(99, 0,  50, 50,  99, 99)\npath.cubicTo(0, 99,  50, 50,  0, 0)\n\nQPainter painter(self)\npainter.fillRect(0, 0, 100, 100, Qt.white)\npainter.setPen(QPen(QColor(79, 106, 25), 1, Qt.SolidLine,\n                    Qt.FlatCap, Qt.MiterJoin))\npainter.setBrush(QColor(122, 163, 39))\n\npainter.drawPath(path)\n//! [0]\n\n\n//! [1]\nmyGradient = QLinearGradient()\nmyPen = QPen()\n\nmyPath = QPainterPath()\nmyPath.cubicTo(c1, c2, endPoint)\n\npainter = QPainter(self)\npainter.setBrush(myGradient)\npainter.setPen(myPen)\npainter.drawPath(myPath)\n//! [1]\n\n\n//! [2]\nmyGradient = QLinearGradient()\nmyPen = QPen()\n\nstartPoint = QPointF()\ncenter = QPointF()\n\nmyPath = QPainterPath()\nmyPath.moveTo(center)\nmyPath.arcTo(boundingRect, startAngle,\n             sweepLength)\n\npainter = QPainter(self)\npainter.setBrush(myGradient)\npainter.setPen(myPen)\npainter.drawPath(myPath)\n//! [2]\n\n\n//! [3]\nmyGradient = QLinearGradient()\nmyPen = QPen()\nmyRectangle = QRectF()\n\nmyPath = QPainterPath()\nmyPath.addRect(myRectangle)\n\npainter = QPainter(self)\npainter.setBrush(myGradient)\npainter.setPen(myPen)\npainter.drawPath(myPath)\n//! [3]\n\n\n//! [4]\nmyGradient = QLinearGradient()\nmyPen = QPen()\nmyPolygon = QPolygonF()\n\nmyPath = QPainterPath()\nmyPath.addPolygon(myPolygon)\n\nQPainter painter(self)\npainter.setBrush(myGradient)\npainter.setPen(myPen)\npainter.drawPath(myPath)\n//! [4]\n\n\n//! [5]\nmyGradient = QLinearGradient()\nmyPen = QPen()\nboundingRectangle = QRectF()\n\nmyPath = QPainterPath()\nmyPath.addEllipse(boundingRectangle)\n\nQPainter painter(self)\npainter.setBrush(myGradient)\npainter.setPen(myPen)\npainter.drawPath(myPath)\n//! [5]\n\n\n//! [6]\nmyGradient = QLinearGradient()\nmyPen = QPen()\nmyFont = QFont()\nQPointF baseline(x, y)\n\nmyPath = QPainterPath()\nmyPath.addText(baseline, myFont, tr(\"Qt\"))\n\npainter QPainter(self)\npainter.setBrush(myGradient)\npainter.setPen(myPen)\npainter.drawPath(myPath)\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpen.cpp",
    "content": "//! [0]\npainter = QPainter(self)\npen = QPen(Qt.green, 3, Qt.DashDotLine, Qt.RoundCap, Qt.RoundJoin)\npainter.setPen(pen)\n//! [0]\n\n\n//! [1]\npainter = QPainter(self)\npen = QPen()  # creates a default pen\n\npen.setStyle(Qt.DashDotLine)\npen.setWidth(3)\npen.setBrush(Qt.green)\npen.setCapStyle(Qt.RoundCap)\npen.setJoinStyle(Qt.RoundJoin)\n\npainter.setPen(pen)\n//! [1]\n\n\n//! [2]\npen = QPen()\nspace = 4;\ndashes = [1, space, 3, space, 9, space, 27, space, 9, space]\npen.setDashPattern(dashes)\n//! [2]\n\n\n//! [3]\npen = QPen()\nspace = 4;\ndashes = [1, space, 3, space, 9, space, 27, space, 9, space]\npen.setDashPattern(dashes)\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion.cpp",
    "content": "//! [0]\nclass MyWidget (QWidget):\n    # ...\n    def paintEvent(self):\n        r1 = QRegion(QRect(100, 100, 200, 80), QRegion.Ellipse) # r1: elliptic region\n                )\n        r2 = QRect(100, 120, 90, 30)   # r2: rectangular region\n        r3 = r1.intersected(r2)        # r3: intersection\n\n        painter = QPainter(self)\n        painter.setClipRegion(r3)\n        ...                            # paint clipped graphics\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qregion_unix.cpp",
    "content": "//! [0]\nr1 = QRegion(10, 10, 20, 20)\nr1.isNull()                // false\nr1.isEmpty()               // false\n\nr2 = QRegion(40, 40, 20, 20)\nr3 = QRegion()\nr3.isNull()                // true\nr3.isEmpty()               // true\n\nr3 = r1.intersected(r2)    // r3: intersection of r1 and r2\nr3.isNull()                // false\nr3.isEmpty()               // true\n\nr3 = r1.united(r2)         // r3: union of r1 and r2\nr3.isNull()                // false\nr3.isEmpty()               // false\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_painting_qtransform.cpp",
    "content": "//! [0]\nx' = m11*x + m21*y + dx\ny' = m22*y + m12*x + dy\nif is not affine:\n    w' = m13*x + m23*y + m33\n    x' /= w'\n    y' /= w'\n//! [0]\n\n\n//! [1]\nx' = m11*x + m21*y + dx\ny' = m22*y + m12*x + dy\nif is not affine:\n    w' = m13*x + m23*y + m33\n    x' /= w'\n    y' /= w'\n//! [1]\n\n\n//! [2]\nx' = m11*x + m21*y + dx\ny' = m22*y + m12*x + dy\nif is not affine:\n    w' = m13*x + m23*y + m33\n    x' /= w'\n    y' /= w'\n//! [2]\n\n\n//! [3]\nx' = m11*x + m21*y + dx\ny' = m22*y + m12*x + dy\nif is not affine:\n    w' = m13*x + m23*y + m33\n    x' /= w'\n    y' /= w'\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyle.cpp",
    "content": "//! [0]\npython myapplication.py -style motif\n//! [0]\n\n\n//! [1]\npython myapplication.py -style custom\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_styles_qstyleoption.cpp",
    "content": "//! [0]\ndef styleHint(self, stylehint, opt, widget, returnData):\n    if stylehint == SH_RubberBand_Mask:\n        if isinstance(QStyleHintReturnMask, hint):\n            ...\n    ...\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_text_qfont.cpp",
    "content": "//! [0]\nserifFont = QFont(\"Times\", 10, QFont.Bold)\nsansFont = QFont(\"Helvetica [Cronyx]\", 12)\n//! [0]\n\n\n//! [1]\nf = QFont(\"Helvetica\")\n//! [1]\n\n\n//! [2]\nf = QFont(\"Helvetica [Cronyx]\")\n//! [2]\n\n\n//! [3]\ninfo = QFontInfo(f1)\nfamily = info.family()\n//! [3]\n\n\n//! [4]\nfm = QFontMetrics(f1)\ntextWidthInPixels = fm.width(\"How many pixels wide is this text?\")\ntextHeightInPixels = fm.height()\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_text_qfontmetrics.cpp",
    "content": "//! [0]\nfont = QFont(\"times\", 24)\nfm = QFontMetrics(font)\npixelsWide = fm.width(\"What's the width of this text?\")\npixelsHigh = fm.height()\n//! [0]\n\n\n//! [1]\nfont = QFont(\"times\", 24)\nfm = QFontMetricsF(font)\npixelsWide = fm.width(\"What's the width of this text?\")\npixelsHigh = fm.height()\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_text_qsyntaxhighlighter.cpp",
    "content": "//! [0]\neditor = QTextEdit()\nhighlighter = MyHighlighter(editor.document())\n//! [0]\n\n\n//! [1]\nclass MyHighlighter(QSyntaxHighlighter):\n    def highlightBlock(self, text):\n        myClassFormat = QTextCharFormat()\n        myClassFormat.setFontWeight(QFont.Bold)\n        myClassFormat.setForeground(Qt.darkMagenta)\n        pattern = QString(\"\\\\bMy[A-Za-z]+\\\\b\")\n\n        expression = QRegExp(pattern)\n        index = text.indexOf(expression)\n        while index >= 0:\n            length = expression.matchedLength()\n            setFormat(index, length, myClassFormat)\n            index = text.indexOf(expression, index + length)\n//! [1]\n\n\n//! [2]\nmultiLineCommentFormat = QTextCharFormat()\nmultiLineCommentFormat.setForeground(Qt.red)\n\nstartExpression = QRegExp(\"/\\\\*\")\nendExpression = QRegExp(\"\\\\*/\")\n\nsetCurrentBlockState(0)\n\nstartIndex = 0\nif previousBlockState() != 1:\n    startIndex = text.indexOf(startExpression)\n\nwhile startIndex >= 0:\n    endIndex = text.indexOf(endExpression, startIndex)\n    if endIndex == -1:\n       setCurrentBlockState(1)\n       commentLength = text.length() - startIndex\n    else:\n       commentLength = endIndex - startIndex\n                       + endExpression.matchedLength()\n\n    setFormat(startIndex, commentLength, multiLineCommentFormat)\n    startIndex = text.indexOf(startExpression,\n                              startIndex + commentLength)\n//! [2]\n\n\n//! [3]\nclass MyHighlighter(QSyntaxHighlighter):\n    def highlightBlock(self, text):\n        myClassFormat = QTextCharFormat()\n        myClassFormat.setFontWeight(QFont.Bold)\n        myClassFormat.setForeground(Qt.darkMagenta)\n        pattern = QString(\"\\\\bMy[A-Za-z]+\\\\b\")\n\n        expression = QRegExp(pattern)\n        index = text.indexOf(expression)\n        while index >= 0:\n            length = expression.matchedLength()\n            setFormat(index, length, myClassFormat)\n            index = text.indexOf(expression, index + length)\n//! [3]\n\n\n//! [4]\nclass BlockData(QTextBlockUserData):\n    def __init__(self):\n        # ...\n        self.parentheses = []\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextcursor.cpp",
    "content": "//! [0]\ncursor.clearSelection()\ncursor.movePosition(QTextCursor.NextWord, QTextCursor.KeepAnchor)\ncursor.insertText(\"Hello World\")\n//! [0]\n\n\n//! [1]\nimg = ... # A QImage\ntextDocument.addResource(QTextDocument.ImageResource, QUrl(\"myimage\"), img)\ncursor.insertImage(\"myimage\")\n//! [1]\n\n\n//! [2]\ncursor = QTextCursor(textDocument)\ncursor.beginEditBlock()\ncursor.insertText(\"Hello\")\ncursor.insertText(\"World\")\ncursor.endEditBlock()\n\ntextDocument.undo()\n//! [2]\n\n\n//! [3]\ncursor = QTextCursor(textDocument)\ncursor.beginEditBlock()\ncursor.insertText(\"Hello\")\ncursor.insertText(\"World\")\ncursor.endEditBlock()\n\n...\n\ncursor.joinPreviousEditBlock()\ncursor.insertText(\"Hey\")\ncursor.endEditBlock()\n\ntextDocument.undo()\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextdocument.cpp",
    "content": "//! [0]\nplain = QString(\"#include <QtCore>\")\nhtml = Qt::escape(plain)\n# html == \"#include &lt;QtCore&gt;\"\n//! [0]\n\n\n//! [1]\n<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body>...\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_text_qtextlayout.cpp",
    "content": "//! [0]\nleading = fontMetrics.leading()\nheight = 0\nwidthUsed = 0\ntextLayout.beginLayout()\nwhile True:\n    line = textLayout.createLine()\n    if not line.isValid():\n        break\n\n    line.setLineWidth(lineWidth)\n    height += leading\n    line.setPosition(QPointF(0, height))\n    height += line.height()\n    widthUsed = qMax(widthUsed, line.naturalTextWidth())\ntextLayout.endLayout()\n//! [0]\n\n\n//! [1]\npainter  = QPainter(self)\ntextLayout.draw(painter, QPoint(0, 0))\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_util_qcompleter.cpp",
    "content": "\n//! [0]\nwordList = [\"alpha\", \"omega\", \"omicron\", \"zeta\"]\n\nlineEdit = QLineEdit(self)\n\ncompleter = QCompleter(wordList, self)\ncompleter.setCaseSensitivity(Qt.CaseInsensitive)\nlineEdit.setCompleter(completer)\n//! [0]\n\n\n//! [1]\ncompleter = QCompleter(self)\ncompleter.setModel(QDirModel(completer))\nlineEdit.setCompleter(completer)\n//! [1]\n\n\n//! [2]\ni = 0\nwhile completer.setCurrentRow(i):\n    print \"%s is match number %d\" % (completer.currentCompletion(), i)\n    i += 1\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp",
    "content": "//! [0]\ndef showHelp(url):\n    # ...\n    pass\n\nQDesktopServices.setUrlHandler(\"help\", showHelp);\n//! [0]\n\n//! [1]\nmailto:user@foo.com?subject=Test&body=Just a test\n//! [1]\n\n//! [2]\nQDesktopServices.openUrl(QUrl(\"file:///C:/Documents and Settings/All Users/Desktop\", QUrl.TolerantMode))\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_util_qundostack.cpp",
    "content": "//! [0]\nclass AppendText(QUndoCommand):\n    self.m_document = ''\n    self.m_text = ''\n\n    def AppendText(self, doc, text):\n        self.m_document = doc\n        self.m_text = text\n        self.setText(\"append text\")\n\n    def undo(self):\n        self.m_document.chop(self.m_text.length())\n\n    def redo(self):\n        self.m_document->append(self.m_text)\n//! [0]\n\n\n//! [1]\ncommand1 = MyCommand()\nstack.push(command1)\ncommand2 = MyCommand()\nstack.push(command2)\n\nstack.undo()\n\ncommand3 = MyCommand()\nstack.push(command3) # command2 gets deleted\n//! [1]\n\n\n//! [2]\ninsertRed = QUndoCommand() # an empty command\ninsertRed.setText(\"insert red text\")\n\nInsertText(document, idx, text, insertRed) # becomes child of insertRed\nSetColor(document, idx, text.length(), Qt.red, insertRed)\n\nstack.push(insertRed)\n//! [2]\n\n\n//! [3]\nclass AppendText(QUndoCommand):\n    ...\n    def mergeWith(self, other):\n        if other.id() != self.id(): # make sure other is also an AppendText command\n            return False\n        m_text += other.m_text\n        return True\n//! [3]\n\n\n//! [4]\nstack.beginMacro(\"insert red text\")\nstack.push(InsertText(document, idx, text))\nstack.push(SetColor(document, idx, text.length(), Qt.red))\nstack.endMacro() # indexChanged() is emitted\n//! [4]\n\n\n//! [5]\ninsertRed = QUndoCommand() # an empty command\ninsertRed.setText(\"insert red text\")\n\nInsertText(document, idx, text, insertRed) # becomes child of insertRed\nSetColor(document, idx, text.length(), Qt.red, insertRed)\n\nstack.push(insertRed)\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp",
    "content": "//! [0]\nbutton = QPushButton(QObject.tr(\"Ro&ck && Roll\"), self)\n//! [0]\n\n\n//! [1]\nbutton.setIcon(QIcon(\":/images/print.png\"))\nbutton.setShortcut(tr(\"Alt+F7\"))\n//! [1]\n\n\n//! [2]\nclass MyWidget (QWidget):\n    #...\n    def reactToToggle(checked):\n        if checked:\n            // Examine the button states.\n            ...\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp",
    "content": "//! [0]\nspinBox = QSpinBox(self)\nspinBox.setRange(0, 100)\nspinBox.setWrapping(True)\nspinBox.setValue(100)\nspinBox.stepBy(1)\n// value is 0\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp",
    "content": "//! [0]\ncalendar.setGridVisible(True)\n//! [0]\n\n\n//! [1]\ncalendar.setGridVisible(True)\ncalendar.setMinimumDate(QDate(2006, 6, 19))\n//! [1]\n\n\n//! [2]\ncalendar.setGridVisible(True)\ncalendar.setMaximumDate(QDate(2006, 7, 3))\n//! [2]\n\n\n//! [3]\n\ncalendar.setDateRange(min, max)\n//! [3]\n\n\n//! [4]\n\ncalendar.setMinimumDate(min)\ncalendar.setMaximumDate(max)\n//! [4]\n\n\n//! [5]\ncalendar.setGridVisible(True)\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp",
    "content": "//! [0]\ncheckbox = QCheckBox(\"C&ase sensitive\", self)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp",
    "content": "//! [0]\ndateEdit = QDateTimeEdit(QDate.currentDate())\ndateEdit.setMinimumDate(QDate.currentDate().addDays(-365))\ndateEdit.setMaximumDate(QDate.currentDate().addDays(365))\ndateEdit.setDisplayFormat(\"yyyy.MM.dd\")\n//! [0]\n\n\n//! [1]\nsetDateTimeRange(min, max)\n//! [1]\n\n\n//! [2]\nsetMinimumDateTime(min)\nsetMaximumDateTime(max)\n//! [2]\n\n\n//! [3]\nsetDateRange(min, max)\n//! [3]\n\n\n//! [4]\nsetMinimumDate(min)\nsetMaximumDate(max)\n//! [4]\n\n\n//! [5]\nsetTimeRange(min, max)\n//! [5]\n\n\n//! [6]\nsetMinimumTime(min)\nsetMaximumTime(max)\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp",
    "content": "//! [0]\ndockWidget = parentWidget()\nif dockWidget.features() & QDockWidget.DockWidgetVerticalTitleBar:\n    # I need to be vertical\nelse:\n    # I need to be horizontal\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qframe.cpp",
    "content": "//! [0]\nlabel = QLabel()\nlabel.setFrameStyle(QFrame.Panel | QFrame.Raised)\nlabel.setLineWidth(2)\n\npbar = QProgressBar()\nlabel.setFrameStyle(QFrame.NoFrame)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp",
    "content": "//! [0]\ng.setTitle(\"&User information\")\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlabel.cpp",
    "content": "//! [0]\nlabel = QLabel(self)\nlabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)\nlabel.setText(\"first line\\nsecond line\")\nlabel.setAlignment(Qt.AlignBottom | Qt.AlignRight)\n//! [0]\n\n\n//! [1]\nphoneEdit = QLineEdit(self)\nphoneLabel = QLabel(\"&Phone:\", self)\nphoneLabel.setBuddy(phoneEdit)\n//! [1]\n\n\n//! [2]\nnameEd  = QLineEdit(self)\nnameLb  = QLabel(\"&Name:\", self)\nnameLb.setBuddy(nameEd)\nphoneEd = QLineEdit(self)\nphoneLb = QLabel(\"&Phone:\", self)\nphoneLb.setBuddy(phoneEd)\n# (layout setup not shown)\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qlineedit.cpp",
    "content": "//! [0]\ndef contextMenuEvent(event):\n    menu = createStandardContextMenu()\n    menu.addAction(QObject.tr(\"My Menu Item\"))\n    #...\n    menu.exec_(event.globalPos())\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp",
    "content": "//! [0]\ndef closeEvent(self, event):\n    settings = QSettings(\"MyCompany\", \"MyApp\")\n    settings.setValue(\"geometry\", self.saveGeometry())\n    settings.setValue(\"windowState\", self.saveState())\n    QMainWindow.closeEvent(self, event)\n//! [0]\n\n\n//! [1]\ndef readSettings(self):\n    settings = QSettings(\"MyCompany\", \"MyApp\")\n    restoreGeometry(settings.value(\"myWidget/geometry\"))\n    restoreState(settings.value(\"myWidget/windowState\"))\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenu.cpp",
    "content": "//! [0]\nexec_(QCursor.pos())\n//! [0]\n\n\n//! [1]\nexec_(somewidget.mapToGlobal(QPoint(0,0)))\n//! [1]\n\n\n//! [2]\nexec_(e.globalPos())\n//! [2]\n\n\n//! [3]\nexec_(QCursor.pos())\n//! [3]\n\n\n//! [4]\nexec_(somewidget.mapToGlobal(QPoint(0, 0)))\n//! [4]\n\n\n//! [5]\nexec_(e.globalPos())\n//! [5]\n\n\n//! [6]\nmenu = QMenu()\nat = actions[0] // Assumes actions is not empty\nfor a in actions:\n    menu.addAction(a)\nmenu.exec_(pos, at)\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qmenubar.cpp",
    "content": "//! [0]\nmenubar.addMenu(fileMenu)\n//! [0]\n\n\n//! [1]\nmenuBar = QMenuBar()\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp",
    "content": "//! [0]\nclass MyQPlainTextEdit(QPlainTextEdit):\n    def contextMenuEvent(self, event):\n        menu = createStandardContextMenu()\n        menu.addAction(tr(\"My Menu Item\"))\n        # ...\n        menu.exec_(event.globalPos())\n        del menu\n//! [0]\n\n\n//! [1]\nedit.textCursor().insertText(text)\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp",
    "content": "//! [0]\nbutton = QPushButton(\"&Download\", self)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp",
    "content": "//! [0]\nbutton = QRadioButton(\"Search from the &cursor\", self)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qrubberband.cpp",
    "content": "//! [0]\nclass Widget:\n    def mousePressEvent(self, event):\n        origin = event.pos()\n        if not self.rubberBand:\n            self.rubberBand = QRubberBand(QRubberBand.Rectangle, self)\n        rubberBand.setGeometry(QRect(origin, QSize()))\n        rubberBand.show()\n\n    def mouseMoveEvent(self, event):\n        rubberBand.setGeometry(QRect(origin, event.pos()).normalized())\n\n    def mouseReleaseEvent(self, event):\n        rubberBand.hide()\n        # determine selection, for example using QRect.intersects()\n        # and QRect.contains().\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp",
    "content": "//! [0]\nimageLabel = QLabel()\nimage = QImage(\"happyguy.png\")\nimageLabel.setPixmap(QPixmap.fromImage(image))\n\nscrollArea = QScrollArea()\nscrollArea.setBackgroundRole(QPalette.Dark)\nscrollArea.setWidget(imageLabel)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qspinbox.cpp",
    "content": "//! [0]\nsb.setPrefix(\"$\")\n//! [0]\n\n\n//! [1]\nsb.setSuffix(\" km\")\n//! [1]\n\n\n//! [2]\nsetRange(minimum, maximum)\n//! [2]\n\n\n//! [3]\nsetMinimum(minimum)\nsetMaximum(maximum)\n//! [3]\n\n\n//! [4]\nspinbox.setPrefix(\"$\")\n//! [4]\n\n\n//! [5]\nspinbox.setSuffix(\" km\")\n//! [5]\n\n\n//! [6]\nsetRange(minimum, maximum)\n//! [6]\n\n\n//! [7]\nsetMinimum(minimum)\nsetMaximum(maximum)\n//! [7]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp",
    "content": "//! [0]\npixmap = QPixmap(\":/splash.png\")\nsplash = QSplashScreen(pixmap)\nsplash.show()\n\n... # Loading some items\nsplash.showMessage(\"Loaded modules\")\n\nqApp.processEvents()\n\n... # Establishing connections\nsplash.showMessage(\"Established connections\")\n\nqApp.processEvents()\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qsplitter.cpp",
    "content": "//! [0]\nwidget = splitter.widget(index)\npolicy = widget.sizePolicy()\npolicy.setHorizontalStretch(stretch)\npolicy.setVerticalStretch(stretch)\nwidget.setSizePolicy(policy)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp",
    "content": "//! [0]\nstatusBar().addWidget(MyReadWriteIndication())\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp",
    "content": "//! [0]\nbackaction.setToolTip(browser.historyTitle(-1))\nforwardaction.setToolTip(browser.historyTitle(+1))\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qtextedit.cpp",
    "content": "//! [0]\nclass MyTextEdit(QTextEdit):\n    def contextMenuEvent(self, event):\n        menu = createStandardContextMenu()\n        menu.addAction(tr(\"My Menu Item\"))\n        #...\n        menu.exec_(event->globalPos())\n        del menu\n//! [0]\n\n\n//! [1]\nedit.textCursor().insertText(text)\n//! [1]\n\n\n//! [2]\nedit.textCursor().insertHtml(fragment)\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qvalidator.cpp",
    "content": "//! [0]\nvalidator = QIntValidator(100, 999, self)\nedit = QLineEdit(self)\n\n# the edit lineedit will only accept integers between 100 and 999\nedit.setValidator(validator)\n//! [0]\n\n\n//! [1]\npos = 0\nv = QIntValidator(100, 900, self)\n\nstr = \"1\"\nv.validate(str, pos)     # returns Intermediate\nstr = \"012\"\nv.validate(str, pos)     # returns Intermediate\n\nstr = \"123\"\nv.validate(str, pos)     # returns Acceptable\nstr = \"678\"\nv.validate(str, pos)     # returns Acceptable\n\nstr = \"999\"\nv.validate(str, pos)    # returns Intermediate\n\nstr = \"1234\"\nv.validate(str, pos)     # returns Invalid\nstr = \"-123\"\nv.validate(str, pos)     # returns Invalid\nstr = \"abc\"\nv.validate(str, pos)     # returns Invalid\nstr = \"12cm\"\nv.validate(str, pos)     # returns Invalid\n//! [1]\n\n\n//! [2]\npos = 0\n\ns = \"abc\"\nv.validate(s, pos)    # returns Invalid\n\ns = \"5\"\nv.validate(s, pos)    # returns Intermediate\n\ns = \"50\"\nv.validate(s, pos)    # returns Acceptable\n//! [2]\n\n\n//! [3]\n# regexp: optional '-' followed by between 1 and 3 digits\nrx = QRegExp(\"-?\\\\d{1,3}\")\nvalidator = QRegExpValidator(rx, self)\n\nedit = QLineEdit(self)\nedit.setValidator(validator)\n//! [3]\n\n\n//! [4]\n# integers 1 to 9999\nrx = QRegExp(\"[1-9]\\\\d{0,3}\")\n# the validator treats the regexp as \"^[1-9]\\\\d{0,3}$\"\nv = QRegExpValidator(rx, 0)\npos = 0\n\ns = \"0\"\nv.validate(s, pos)    # returns Invalid\ns = \"12345\"\nv.validate(s, pos)    # returns Invalid\ns = \"1\"\nv.validate(s, pos)    # returns Acceptable\n\nrx.setPattern(\"\\\\S+\")            # one or more non-whitespace characters\nv.setRegExp(rx)\ns = \"myfile.txt\"\nv.validate(s, pos) # Returns Acceptable\ns = \"my file.txt\"\nv.validate(s, pos) # Returns Invalid\n\n# A, B or C followed by exactly five digits followed by W, X, Y or Z\nrx.setPattern(\"[A-C]\\\\d{5}[W-Z]\")\nv.setRegExp(rx)\ns = \"a12345Z\"\nv.validate(s, pos)        # Returns Invalid\ns = \"A12345Z\"\nv.validate(s, pos)        # Returns Acceptable\ns = \"B12\"\nv.validate(s, pos)        # Returns Intermediate\n\n# match most 'readme' files\nrx.setPattern(\"read\\\\S?me(\\.(txt|asc|1st))?\")\nrx.setCaseSensitive(false)\nv.setRegExp(rx)\ns = \"readme\"\nv.validate(s, pos) # Returns Acceptable\ns = \"README.1ST\"\nv.validate(s, pos) # Returns Acceptable\ns = \"read me.txt\"\nv.validate(s, pos) # Returns Invalid\ns = \"readm\"\nv.validate(s, pos) # Returns Intermediate\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_gui_widgets_qworkspace.cpp",
    "content": "//! [0]\nclass MainWindow(...):\n    def __init__(self):\n        self.workspace = QWorkspace()\n        self.setCentralWidget(workspace)\n        ...\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_access_qftp.cpp",
    "content": "//! [0]\nftp = QFtp(parent)\nftp.connectToHost(\"ftp.trolltech.com\")\nftp.login()\n//! [0]\n\n\n//! [1]\nftp.connectToHost(\"ftp.trolltech.com\") # id == 1\nftp.login()                            # id == 2\nftp.cd(\"qt\")                           # id == 3\nftp.get(\"INSTALL\")                     # id == 4\nftp.close()                            # id == 5\n//! [1]\n\n\n//! [2]\nstart(1)\nstateChanged(HostLookup)\nstateChanged(Connecting)\nstateChanged(Connected)\nfinished(1, false)\n\nstart(2)\nstateChanged(LoggedIn)\nfinished(2, false)\n\nstart(3)\nfinished(3, false)\n\nstart(4)\ndataTransferProgress(0, 3798)\ndataTransferProgress(2896, 3798)\nreadyRead()\ndataTransferProgress(3798, 3798)\nreadyRead()\nfinished(4, false)\n\nstart(5)\nstateChanged(Closing)\nstateChanged(Unconnected)\nfinished(5, false)\n\ndone(false)\n//! [2]\n\n\n//! [3]\nstart(1)\nstateChanged(HostLookup)\nstateChanged(Connecting)\nstateChanged(Connected)\nfinished(1, false)\n\nstart(2)\nfinished(2, true)\n\ndone(true)\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_access_qhttp.cpp",
    "content": "//! [0]\ncontent-type: text/html\n//! [0]\n\n\n//! [1]\nheader.setValue(\"content-type\", \"text/html\")\ncontentType = header.value(\"content-type\")\n//! [1]\n\n\n//! [2]\nheader = QHttpRequestHeader(\"GET\", QUrl.toPercentEncoding(\"/index.html\"))\nheader.setValue(\"Host\", \"qtsoftware.com\")\nhttp.setHost(\"qtsoftware.com\")\nhttp.request(header)\n//! [2]\n\n\n//! [3]\nhttp.setHost(\"qtsoftware.com\")                  # id == 1\nhttp.get(QUrl.toPercentEncoding(\"/index.html\")) # id == 2\n//! [3]\n\n\n//! [4]\nrequestStarted(1)\nrequestFinished(1, False)\n\nrequestStarted(2)\nstateChanged(Connecting)\nstateChanged(Sending)\ndataSendProgress(77, 77)\nstateChanged(Reading)\nresponseHeaderReceived(responseheader)\ndataReadProgress(5388, 0)\nreadyRead(responseheader)\ndataReadProgress(18300, 0)\nreadyRead(responseheader)\nstateChanged(Connected)\nrequestFinished(2, False)\n\ndone(False)\n\nstateChanged(Closing)\nstateChanged(Unconnected)\n//! [4]\n\n\n//! [5]\nhttp.setHost(\"www.foo.bar\")       # id == 1\nhttp.get(\"/index.html\")           # id == 2\nhttp.post(\"register.html\", data)  # id == 3\n//! [5]\n\n\n//! [6]\nrequestStarted(1)\nrequestFinished(1, False)\n\nrequestStarted(2)\nstateChanged(HostLookup)\nrequestFinished(2, True)\n\ndone(True)\n\nstateChanged(Unconnected)\n//! [6]\n\n\n//! [7]\ndef getTicks(self):\n  http = QHttp(self)\n  self.connect(http, SIGNAL('done(bool)'), self, SLOT('showPage()'))\n  http.setProxy(\"proxy.example.com\", 3128)\n  http.setHost(\"ticker.example.com\")\n  http.get(\"/ticks.asp\")\n\ndef showPage(self):\n  self.display(http.readAll())\n\n//! [7]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkaccessmanager.cpp",
    "content": "//! [0]\nmanager = QNetworkAccessManager(self)\nmanager.finished[QNetworkReply].connect(self.replyFinished)\n\nmanager.get(QNetworkRequest(QUrl(\"http://qt.nokia.com\")))\n//! [0]\n\n\n//! [1]\nrequest = QNetworkRequest()\nrequest.setUrl(QUrl(\"http://qt.nokia.com\"))\nrequest.setRawHeader(\"User-Agent\", \"MyOwnBrowser 1.0\")\n\nreply = manager.get(request)\nreply.readyRead.connect(self.slotReadyRead)\nreply.error[QNetworkReply.NetworkError].connect(self..slotError)\nreply.sslErrors.connect(self.slotSslErrors)\n//! [1]\n\n//! [2]\nmanager = QNetworkConfigurationManager()\nnetworkAccessManager.setConfiguration(manager.defaultConfiguration())\n//! [2]\n\n//! [3]\nnetworkAccessManager.setConfiguration(QNetworkConfiguration())\n//! [3]\n\n//! [4]\nnetworkAccessManager.setNetworkAccessible(QNetworkAccessManager.NotAccessible)\n//! [4]\n\n//! [5]\nnetworkAccessManager.setNetworkAccessible(QNetworkAccessManager.Accessible)\n//! [5]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkdiskcache.cpp",
    "content": "//! [0]\nmanager = QNetworkAccessManager(self)\ndiskCache = QNetworkDiskCache(self)\ndiskCache.setCacheDirectory(\"cacheDir\")\nmanager.setCache(diskCache)\n//! [0]\n\n//! [1]\n# do a normal request (preferred from network, as this is the default)\nrequest = QNetworkRequest(QUrl(\"http://qt.nokia.com\"))\nmanager.get(request)\n\n# do a request preferred from cache\nrequest2 = QNetworkRequest(QUrl(\"http://qt.nokia.com\"))\nrequest2.setAttribute(QNetworkRequest.CacheLoadControlAttribute, QNetworkRequest.PreferCache)\nmanager.get(request2)\n//! [1]\n\n//! [2]\n@Slot(QNetworkReply)\ndef replyFinished(reply):\n    fromCache = reply.attribute(QNetworkRequest.SourceIsFromCacheAttribute)\n    print(\"page from cache? %d\" % fromCache)\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_access_qnetworkrequest.cpp",
    "content": "//! [0]\nrequest.setRawHeader(\"Last-Modified\", \"Sun, 06 Nov 1994 08:49:37 GMT\")\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_bearer_qnetworkconfigmanager.cpp",
    "content": "//! [0]\nmgr = QNetworkConfigurationManager()\nactiveConfigs = mgr.allConfigurations(QNetworkConfiguration.Active)\nif activeConfigs:\n    assert(mgr.isOnline())\nelse:\n    assert(not mgr.isOnline())\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostaddress.cpp",
    "content": "//! [0]\naddr = hostAddr.toIPv6Address()\n# addr contains 16 unsigned characters\n\nfor i in range(0, 16):\n    # process addr[i]\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_kernel_qhostinfo.cpp",
    "content": "//! [0]\n# To find the IP address of qtsoftware.com\nQHostInfo.lookupHost(\"qtsoftware.com\", self, SLOT(\"printResults(QHostInfo)\"))\n\n# To find the host name for 4.2.2.1\nQHostInfo.lookupHost(\"4.2.2.1\", self, SLOT(\"printResults(QHostInfo)\"))\n//! [0]\n\n\n//! [1]\ninfo = QHostInfo.fromName(\"qtsoftware.com\")\n//! [1]\n\n\n//! [2]\nQHostInfo.lookupHost(\"www.kde.org\", self.lookedUp)\n//! [2]\n\n\n//! [3]\ndef lookedUp(host):\n    if host.error() != QHostInfo.NoError:\n        print \"Lookup failed: %s\" % host.errorString()\n        return\n\n    for address in host.addresses():\n        print \"Found address: %s\" % address.toString()\n//! [3]\n\n\n//! [4]\nQHostInfo.lookupHost(\"4.2.2.1\", self.lookedUp)\n//! [4]\n\n\n//! [5]\ninfo = QHostInfo()\n...\nif not info.addresses().isEmpty():\n    address = info.addresses().first()\n    # use the first IP address\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_kernel_qnetworkproxy.cpp",
    "content": "//! [0]\nproxy = QNetworkProxy()\nproxy.setType(QNetworkProxy.Socks5Proxy)\nproxy.setHostName(\"proxy.example.com\")\nproxy.setPort(1080)\nproxy.setUser(\"username\")\nproxy.setPassword(\"password\")\nQNetworkProxy.setApplicationProxy(proxy)\n//! [0]\n\n\n//! [1]\nserverSocket.setProxy(QNetworkProxy.NoProxy)\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_socket_qabstractsocket.cpp",
    "content": "//! [0]\nsocket.connectToHost(\"imap\", 143)\nif socket.waitForConnected(1000):\n    print \"Connected!\"\n//! [0]\n\n\n//! [1]\nsocket.disconnectFromHost()\n    if socket.state() == QAbstractSocket.UnconnectedState or \\\n        socket.waitForDisconnected(1000):\n        print \"Disconnected!\"\n//! [1]\n\n\n//! [2]\nclass SocketClass(...):\n    def readyReadSlot(self):\n        # This slot is connected to QAbstractSocket::readyRead()\n        while not socket.atEnd():\n            data = socket.read(100)\n            ...\n//! [2]\n\n\n//! [3]\nsocket.setProxy(QNetworkProxy.NoProxy)\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_socket_qlocalsocket_unix.cpp",
    "content": "//! [0]\nsocket.connectToServer(\"market\")\nif (socket.waitForConnected(1000))\n    print(\"Connected!\")\n//! [0]\n\n\n//! [1]\nsocket.disconnectFromServer()\nif (socket.waitForDisconnected(1000))\n    print(\"Disconnected!\")\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_socket_qnativesocketengine.cpp",
    "content": "//! [0]\nsocketLayer = QNativeSocketEngine()\nsocketLayer.initialize(QAbstractSocket.TcpSocket, QAbstractSocket.IPv4Protocol)\nsocketLayer.connectToHost(QHostAddress.LocalHost, 22)\n# returns False\n\nsocketLayer.waitForWrite()\nsocketLayer.connectToHost(QHostAddress.LocalHost, 22)\n# returns True\n//! [0]\n\n\n//! [1]\nsocketLayer = QNativeSocketEngine()\nsocketLayer.bind(QHostAddress.Any, 4000)\nsocketLayer.listen()\nif socketLayer.waitForRead():\n    clientSocket = socketLayer.accept()\n    # a client is connected\n\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_socket_qtcpserver.cpp",
    "content": "//! [0]\nserver.setProxy(QNetworkProxy.NoProxy)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_socket_qudpsocket.cpp",
    "content": "//! [0]\ndef initSocket(self):\n    udpSocket = QUdpSocket(self)\n    udpSocket.bind(QHostAddress.LocalHost, 7755)\n\n    self.connect(udpSocket, SIGNAL('readyRead()'),\n                 self, SLOT('readPendingDatagrams()'))\n\ndef readPendingDatagrams(self):\n    while udpSocket.hasPendingDatagrams():\n        datagram = QByteArray()\n        datagram.resize(udpSocket.pendingDatagramSize())\n\n        (sender, senderPort) = udpSocket.readDatagram(datagram.data(), datagram.size())\n\n        processTheDatagram(datagram)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslcertificate.cpp",
    "content": "//! [0]\nfor cert in QSslCertificate.fromPath('C:/ssl/certificate.*.pem', QSsL.Pem, QRegExp.Wildcard):\n    print cert.issuerInfo(QSslCertificate.Organization)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslconfiguration.cpp",
    "content": "//! [0]\nconfig = sslSocket.sslConfiguration()\nconfig.setProtocol(QSsl.TlsV1)\nsslSocket.setSslConfiguration(config)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_network_ssl_qsslsocket.cpp",
    "content": "//! [0]\nsocket = QSslSocket(self)\nQObject.connect(socket, SIGNAL(\"encrypted()\"), self, SLOT(\"ready()\"))\n\nsocket.connectToHostEncrypted(\"imap.example.com\", 993)\n//! [0]\n\n\n//! [1]\ndef incomingConnection(socketDescriptor):\n    serverSocket = QSslSocket()\n    if serverSocket.setSocketDescriptor(socketDescriptor):\n        QObject.connect(serverSocket, SIGNAL(\"encrypted()\"), self, SLOT(\"ready()\"))\n        serverSocket.startServerEncryption()\n//! [1]\n\n\n//! [2]\nsocket = QSslSocket()\nsocket.connectToHostEncrypted(\"http.example.com\", 443)\nif not socket.waitForEncrypted():\n    print socket.errorString()\n    return false\n\nsocket.write(\"GET / HTTP/1.0\\r\\n\\r\\n\")\nwhile socket.waitForReadyRead():\n    print socket.readAll().data()\n//! [2]\n\n\n//! [3]\nsocket = QSslSocket()\nQObject.connect(socket, SIGNAL(\"encrypted()\"), receiver, SLOT(\"socketEncrypted()\"))\n\nsocket.connectToHostEncrypted(\"imap\", 993)\nsocket.write(\"1 CAPABILITY\\r\\n\")\n//! [3]\n\n\n//! [4]\nsocket = QSslSocket()\nsocket.setCiphers(\"DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA\")\n//! [4]\n\n\n//! [5]\nsocket.connectToHostEncrypted(\"imap\", 993)\nif socket.waitForEncrypted(1000):\n    print \"Encrypted!\"\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_opengl_qgl.cpp",
    "content": "//! [0]\nfmt = QGLFormat()\nfmt.setAlpha(True)\nfmt.setStereo(True)\nQGLFormat.setDefaultFormat(fmt)\n//! [0]\n\n\n//! [1]\nfmt = QGLFormat()\nfmt.setDoubleBuffer(False)                 # single buffer\nfmt.setDirectRendering(False)              # software rendering\nmyWidget = MyGLWidget(fmt, ...)\n//! [1]\n\n\n//! [2]\nfmt = QGLFormat()\nfmt.setOverlay(True)\nfmt.setStereo(True)\nmyWidget = MyGLWidget(fmt, ...)\nif !myWidget.format().stereo():\n    # ok, goggles off\n    if !myWidget.format().hasOverlay():\n        print \"Cool hardware required\"\n//! [2]\n\n\n//! [3]\n# The rendering in MyGLWidget depends on using\n# stencil buffer and alpha channel\n\nclass MyGLWidget(QGLWidget):\n    def __init__(self, parent):\n        QGLWidget.__init__(self, QGLFormat(QGL.StencilBuffer | QGL.AlphaChannel), parent)\n\n        if !format().stencil():\n            print \"Could not get stencil buffer results will be suboptimal\"\n        if !format().alpha():\n            print \"Could not get alpha channel results will be suboptimal\"\n    ...\n//! [3]\n\n\n//! [4]\na = QApplication([])\nf = QGLFormat()\nf.setDoubleBuffer(False)\nQGLFormat.setDefaultFormat(f)\n//! [4]\n\n\n//! [5]\nf = QGLFormat.defaultOverlayFormat()\nf.setDoubleBuffer(True)\nQGLFormat.setDefaultOverlayFormat(f)\n//! [5]\n\n\n//! [6]\n# ...continued from above\nmyWidget = MyGLWidget(QGLFormat(QGL.HasOverlay), ...)\nif myWidget.format().hasOverlay():\n    # Yes, we got an overlay, let's check _its_ format:\n    olContext = myWidget.overlayContext()\n    if olContext.format().doubleBuffer():\n         # yes, we got a double buffered overlay\n    else:\n         # no, only single buffered overlays are available\n//! [6]\n\n\n//! [7]\ncx = QGLContext()\n#  ...\nf = QGLFormat()\nf.setStereo(True)\ncx.setFormat(f)\nif !cx.create():\n    exit() # no OpenGL support, or cannot render on the specified paintdevice\nif !cx.format().stereo():\n    exit() # could not create stereo context\n//! [7]\n\n\n//! [8]\nclass MyGLDrawer(QGLWidget):\n\n    def __init__(self, parent):\n        QGLWidget.__init__(self, parent)\n        pass\n\n    def initializeGL(self):\n        # Set up the rendering context, define display lists etc.:\n        ...\n        glClearColor(0.0, 0.0, 0.0, 0.0)\n        glEnable(GL_DEPTH_TEST)\n        ...\n    \n    def resizeGL(self, w, h):\n        # setup viewport, projection etc.:\n        glViewport(0, 0, w, h)\n        ...\n        glFrustum(...)\n        ...\n\n    def paintGL(self):\n        # draw the scene:\n        ...\n        glRotatef(...)\n        glMaterialfv(...)\n        glBegin(GL_QUADS)\n        glVertex3f(...)\n        glVertex3f(...)\n        ...\n        glEnd()\n        ...\n//! [8]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_opengl_qglcolormap.cpp",
    "content": "//! [0]\nimport sys\n\nfrom PySide.QtGui import QApplication, qRgb\nfrom PySide.QtOpenGL import QGLColormap\n\ndef main(argv):\n    app = QApplication(argv)\n\n    widget = MySuperGLWidget()     # a QGLWidget in color-index mode\n    colormap = QGLColormap()\n\n    # This will fill the colormap with colors ranging from\n    # black to white.\n    for i in range(0, colormap.size()):\n        colormap.setEntry(i, qRgb(i, i, i))\n\n    widget.setColormap(colormap)\n    widget.show()\n    return app.exec_()\n\nif __name__ == \"__main__\":\n    main(sys.argv)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp",
    "content": "//! [0]\npbuffer QGLPixelBuffer(...)\n...\npbuffer.makeCurrent()\ndynamicTexture = pbuffer.generateDynamicTexture()\npbuffer.bindToDynamicTexture(dynamicTexture)\n...\npbuffer.releaseFromDynamicTexture()\n//! [0]\n\n\n//! [1]\npbuffer QGLPixelBuffer(...)\n...\npbuffer.makeCurrent()\ndynamicTexture = pbuffer.generateDynamicTexture()\n...\npbuffer.updateDynamicTexture(dynamicTexture)\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_opengl_qglshaderprogram.cpp",
    "content": "//! [0]\nshader = QGLShader(QGLShader.Vertex)\nshader.compileSourceCode(code)\n\nprogram = QGLShaderProgram(context)\nprogram.addShader(shader)\nprogram.link()\n\nprogram.bind()\n//! [0]\n\n//! [1]\nprogram.addShaderFromSourceCode(QGLShader.Vertex,\n    \"attribute highp vec4 vertex\\n\" \\\n    \"attribute mediump mat4 matrix\\n\" \\\n    \"void main(void)\\n\" \\\n    \"{\\n\" \\\n    \"   gl_Position = matrix * vertex\\n\" \\\n    \"}\")\nprogram.addShaderFromSourceCode(QGLShader.Fragment,\n    \"uniform mediump vec4 color\\n\" \\\n    \"void main(void)\\n\" \\\n    \"{\\n\" \\\n    \"   gl_FragColor = color\\n\" \\\n    \"}\")\nprogram.link()\nprogram.bind()\n\nvertexLocation = program.attributeLocation(\"vertex\")\nmatrixLocation = program.attributeLocation(\"matrix\")\ncolorLocation = program.uniformLocation(\"color\")\n//! [1]\n\n//! [2]\ntriangleVertices = (\n    60.0f,  10.0f,  0.0f,\n    110.0f, 110.0f, 0.0f,\n    10.0f,  110.0f, 0.0f)\n\ncolor = QColor(0, 255, 0, 255)\n\npmvMatrix = QMatrix4x4()\npmvMatrix.ortho(self.rect())\n\nprogram.enableAttributeArray(vertexLocation)\nprogram.setAttributeArray(vertexLocation, triangleVertices, 3)\nprogram.setUniformValue(matrixLocation, pmvMatrix)\nprogram.setUniformValue(colorLocation, color)\n\nglDrawArrays(GL_TRIANGLES, 0, 3)\n\nprogram.disableAttributeArray(vertexLocation)\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_qtestlib_qtestcase.cpp",
    "content": "\n//! [0]\nQVERIFY(1 + 1 == 2)\n//! [0]\n\n\n//! [1]\nQVERIFY2(1 + 1 == 2, \"A breach in basic arithmetic occured.\")\n//! [1]\n\n\n//! [2]\nQCOMPARE(QString(\"hello\").toUpper(), QString(\"HELLO\"))\n//! [2]\n\n\n//! [3]\nvoid TestQString.toInt_data()\n{\n    QTest.addColumn<QString>(\"aString\")\n    QTest.addColumn<int>(\"expected\")\n\n    QTest.newRow(\"positive value\") << \"42\" << 42\n    QTest.newRow(\"negative value\") << \"-42\" << -42\n    QTest.newRow(\"zero\") << \"0\" << 0\n}\n//! [3]\n\n\n//! [4]\nvoid TestQString.toInt()\n{\n     QFETCH(QString, aString)\n     QFETCH(int, expected)\n\n     QCOMPARE(aString.toInt(), expected)\n}\n//! [4]\n\n\n//! [5]\nif (sizeof(int) != 4)\n    QFAIL(\"This test has not been ported to this platform yet.\")\n//! [5]\n\n\n//! [6]\nQFETCH(QString, myString)\nQCOMPARE(QString(\"hello\").toUpper(), myString)\n//! [6]\n\n\n//! [7]\nQTEST(QString(\"hello\").toUpper(), \"myString\")\n//! [7]\n\n\n//! [8]\nif (!QSqlDatabase.drivers().contains(\"SQLITE\"))\n    QSKIP(\"This test requires the SQLITE database driver\", SkipAll)\n//! [8]\n\n\n//! [9]\nQEXPECT_FAIL(\"\", \"Will fix in the next release\", Continue)\nQCOMPARE(i, 42)\nQCOMPARE(j, 43)\n//! [9]\n\n\n//! [10]\nQEXPECT_FAIL(\"data27\", \"Oh my, this is soooo broken\", Abort)\nQCOMPARE(i, 42)\n//! [10]\n\n\n//! [11]\nclass TestQString: public QObject { ... }\nQTEST_MAIN(TestQString)\n//! [11]\n\n\n//! [12]\n#ifdef Q_WS_X11\n    QTEST_MAIN(MyX11Test)\n#else\n    // do nothing on non-X11 platforms\n    QTEST_NOOP_MAIN\n#endif\n//! [12]\n\n\n//! [13]\nQTest.keyClick(myWidget, 'a')\n//! [13]\n\n\n//! [14]\nQTest.keyClick(myWidget, Qt.Key_Escape)\n\nQTest.keyClick(myWidget, Qt.Key_Escape, Qt.ShiftModifier, 200)\n//! [14]\n\n\n//! [15]\nQTest.keyClicks(myWidget, \"hello world\")\n//! [15]\n\n\n//! [16]\nnamespace QTest {\n    template<>\n    char *toString(const MyPoint &point)\n    {\n        QByteArray ba = \"MyPoint(\"\n        ba += QByteArray.number(point.x()) + \", \" + QByteArray.number(point.y())\n        ba += \")\"\n        return qstrdup(ba.data())\n    }\n}\n//! [16]\n\n\n//! [17]\nint i = 0\nwhile (myNetworkServerNotResponding() && i++ < 50)\n    QTest.qWait(250)\n//! [17]\n\n\n//! [18]\nMyFirstTestObject test1\nQTest.qExec(&test1)\n\nMySecondTestObject test2\nQTest.qExec(&test2)\n//! [18]\n\n\n//! [19]\nQDir dir\n\nQTest.ignoreMessage(QtWarningMsg, \"QDir.mkdir: Empty or null file name(s)\")\ndir.mkdir(\"\")\n//! [19]\n\n\n//! [20]\nvoid myTestFunction_data()\n{\n    QTest.addColumn<QString>(\"aString\")\n    QTest.newRow(\"just hello\") << QString(\"hello\")\n    QTest.newRow(\"a null string\") << QString()\n}\n//! [20]\n\n\n//! [21]\nvoid myTestFunction_data() {\n    QTest.addColumn<int>(\"intval\")\n    QTest.addColumn<QString>(\"str\")\n    QTest.addColumn<double>(\"dbl\")\n\n    QTest.newRow(\"row1\") << 1 << \"hello\" << 1.5\n}\n//! [21]\n\n\n//! [22]\nvoid MyTestClass.cleanup()\n{\n    if (qstrcmp(currentTestFunction(), \"myDatabaseTest\") == 0) {\n        // clean up all database connections\n        closeAllDatabases()\n    }\n}\n//! [22]\n\n\n//! [23]\nQTest.qSleep(250)\n//! [23]\n\n//! [24]\nwidget = QWidget()\nwidget.show()\nQTest.qWaitForWindowShown(widget)\n//! [24]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_script_qscriptable.cpp",
    "content": "//! [0]\nclass MyScriptableObject(QObject, QScriptable):\n...\n    def doSomething(self):\n        ...\n    def doSomethingElse(self):\n        ...\n//! [0]\n\n\n//! [1]\n\ndef doSomething(self):\n    self.context().throwError('Threw an error from a slot')\n\ndef doSomethingElse(self):\n    return self.thisObject()\n\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_script_qscriptclass.cpp",
    "content": "//! [0]\nif extension == Callable:\n    context = argument\n    engine = context.engine()\n    sum = 0\n    for i in range(0, context.argumentCount()):\n        sum += context.argument(i).toNumber()\n    return sum\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_script_qscriptcontext.cpp",
    "content": "//! [0]\nfoo(20.5, \"hello\",  Object())\n//! [0]\n\n\n//! [1]\ndef Person_prototype_fullName(context, engine):\n    self = context.selfObject()\n    result = self.property(\"firstName\").toString()\n    result += QLatin1String(\" \")\n    result += self.property(\"lastName\").toString()\n    return result\n//! [1]\n\n\n//! [2]\ndef myInclude(ctx, eng):\n    fileName = ctx.argument(0).toString()\n    contents = readTheFile(fileName)\n    ctx.setActivationObject(ctx.parentContext().activationObject())\n    ctx.setThisObject(ctx.parentContext().selfObject())\n    return eng.evaluate(contents, fileName)\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_script_qscriptengine.cpp",
    "content": "//! [0]\nmyEngine = QScriptEngine()\nthree = myEngine.evaluate(\"1 + 2\")\n//! [0]\n\n\n//! [1]\nfun = myEngine.evaluate(\"function(a, b) { return a + b }\");\nargs = QScriptValueList()\nargs << 1 << 2\nthreeAgain = fun.call(QScriptValue(), args)\n//! [1]\n\n\n//! [2]\nfileName = \"helloworld.qs\"\nscriptFile = QFile(fileName)\nif !scriptFile.open(QIODevice.ReadOnly):\n    # handle error\nstream = QTextStream(scriptFile)\ncontents = stream.readAll()\nscriptFile.close()\nmyEngine.evaluate(contents, fileName)\n//! [2]\n\n\n//! [3]\nmyEngine.globalObject().setProperty(\"myNumber\", 123)\n...\nmyNumberPlusOne = myEngine.evaluate(\"myNumber + 1\")\n//! [3]\n\n\n//! [4]\nresult = myEngine.evaluate(...)\nif myEngine.hasUncaughtException():\n    line = myEngine.uncaughtExceptionLineNumber()\n    print \"uncaught exception at line\", line, \":\", result.toString()\n//! [4]\n\n\n//! [5]\nbutton = QPushButton()\nQScriptValue scriptButton = myEngine.QObject(button)\nmyEngine.globalObject().setProperty(\"button\", scriptButton)\n\nmyEngine.evaluate(\"button.checkable = True\")\n\nprint scriptButton.property(\"checkable\").toBoolean()\nscriptButton.property(\"show\").call() # call the show() slot\n//! [5]\n\n\n//! [6]\ndef myAdd(context, engine):\n   a = context.argument(0)\n   b = context.argument(1)\n   return a.toNumber() + b.toNumber()\n//! [6]\n\n\n//! [7]\nfun = myEngine.Function(myAdd)\nmyEngine.globalObject().setProperty(\"myAdd\", fun)\n//! [7]\n\n\n//! [8]\nresult = myEngine.evaluate(\"myAdd(myNumber, 1)\")\n//! [8]\n\n\n//! [9]\ndef Foo(context, engine):\n    if context.calledAsConstructor():\n        # initialize the  object\n        context.selfObject().setProperty(\"bar\", ...)\n        # ...\n        # return a non-object value to indicate that the\n        # selfObject() should be the result of the \" Foo()\" expression\n        return engine.undefinedValue()\n    else:\n        # not called as \" Foo()\", just \"Foo()\"\n        # create our own object and return that one\n        object = engine.Object()\n        object.setPrototype(context.callee().property(\"prototype\"))\n        object.setProperty(\"baz\", ...)\n        return object\n...\n\nfooProto = engine.Object()\nfooProto.setProperty(\"whatever\", ...)\nengine.globalObject().setProperty(\"Foo\", engine->Function(Foo, fooProto))\n//! [9]\n\n\n//! [10]\nclass Bar:\n     ... \n\ndef constructBar(context, engine):\n    bar = Bar()\n    # initialize from arguments in context, if desired\n    ...\n    return engine.toScriptValue(bar)\n\nclass BarPrototype(QObject, QScriptable):\n# provide the scriptable interface of self type using slots and properties\n...\n\n...\n\n# create and register the Bar prototype and constructor in the engine\nbarPrototypeObject =  BarPrototype(...)\nbarProto = engine.QObject(barPrototypeObject)\nengine.setDefaultPrototype(qMetaTypeId(Bar), barProto)\nbarCtor = engine.Function(constructBar, barProto)\nengine.globalObject().setProperty(\"Bar\", barCtor)\n//! [10]\n\n\n//! [11]\ndef getSetFoo(context,engine):\n    callee = context.callee()\n    if context.argumentCount() == 1: # writing?\n        callee.setProperty(\"value\", context.argument(0))\n    return callee.property(\"value\")\n}\n\n....\n\nobject = engine.Object()\nobject.setProperty(\"foo\", engine.Function(getSetFoo),\n    QScriptValue.PropertyGetter | QScriptValue::PropertySetter)\n//! [11]\n\n\n//! [12]\nobject = engine.Object()\nobject.setProperty(\"foo\", engine.Function(getFoo), QScriptValue.PropertyGetter)\nobject.setProperty(\"foo\", engine.Function(setFoo), QScriptValue.PropertySetter)\n//! [12]\n\n\n//! [13]\nQ_SCRIPT_DECLARE_QMETAOBJECT(QLineEdit, QWidget*)\n\n...\n\nlineEditClass = engine.scriptValueFromQMetaObject(QLineEdit)\nengine.globalObject().setProperty(\"QLineEdit\", lineEditClass)\n//! [13]\n\n\n//! [14]\nif hello && world:\n    print(\"hello world\")\n//! [14]\n\n\n//! [15]\nif hello &&\n//! [15]\n\n\n//! [16]\n0 = 0\n//! [16]\n\n\n//! [17]\n./test.js\n//! [17]\n\n\n//! [18]\nfoo[\"bar\"]\n//! [18]\n\n\n//! [19]\nengine = QScriptEngine()\ncontext = engine.pushContext()\ncontext.activationObject().setProperty(\"myArg\", 123)\nengine.evaluate(\"var tmp = myArg + 42\")\n...\nengine.popContext()\n//! [19]\n\n\n//! [20]\nclass MyStruct:\n    x = 0\n    y = 0\n//! [20]\n\n\n//! [21]\nQ_DECLARE_METATYPE(MyStruct)\n//! [21]\n\n\n//! [22]\ndef toScriptValue(engine, s):\n  obj = engine.Object()\n  obj.setProperty(\"x\", s.x)\n  obj.setProperty(\"y\", s.y)\n  return obj\n\ndef fromScriptValue(obj, s):\n  s.x = obj.property(\"x\").toInt32()\n  s.y = obj.property(\"y\").toInt32()\n//! [22]\n\n\n//! [23]\nqScriptRegisterMetaType(engine, toScriptValue, fromScriptValue)\n//! [23]\n\n\n//! [24]\ns = context.argument(0)\n...\ns2 = MyStruct()\ns2.x = s.x + 10\ns2.y = s.y + 20\nv = engine.toScriptValue(s2)\n//! [24]\n\n\n//! [25]\ndef createMyStruct(cx, engine):\n    s = MyStruct()\n    s.x = 123\n    s.y = 456\n    return engine.toScriptValue(s)\n...\n\nctor = engine.Function(createMyStruct)\nengine.globalObject().setProperty(\"MyStruct\", ctor)\n//! [25]\n\n\n//! [26]\nQ_DECLARE_METATYPE(QVector<int>)\n\n...\n\nqScriptRegisterSequenceMetaType<QVector<int> >(engine)\n...\nv = engine.evaluate(\"[5, 1, 3, 2]\")\nv.sort()\na = engine.toScriptValue(v)\nprint a.toString() # outputs \"[1, 2, 3, 5]\"\n//! [26]\n\n//! [27]\ndef mySpecialQObjectConstructor(context, engine):\n    parent = context.argument(0).toQObject()\n    object =  QObject(parent)\n    return engine.QObject(object, QScriptEngine.ScriptOwnership)\n\n...\n\nctor = engine.Function(mySpecialQObjectConstructor)\nmetaObject = engine.QMetaObject(QObject.staticMetaObject, ctor)\nengine.globalObject().setProperty(\"QObject\", metaObject)\n\nresult = engine.evaluate(\" QObject()\")\n//! [27]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_script_qscriptengineagent.cpp",
    "content": "//! [0]\nvar a = Math.random() + 2;\n//! [0]\n\n\n//! [1]\nfunction cube(a) {\n    return a * a * a;\n}\n\nvar a = cube(3);\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalue.cpp",
    "content": "//! [0]\nmyEngine = QScriptEngine()\nmyObject = myEngine.newObject()\nmyOtherObject = myEngine.newObject()\nmyObject.setProperty(\"myChild\", myOtherObject)\nmyObject.setProperty(\"name\", \"John Doe\")\n//! [0]\n\n\n//! [1]\nval = QScriptValue(myEngine, 123)\nmyObject.setProperty(\"myReadOnlyProperty\", val, QScriptValue.ReadOnly)\n//! [1]\n\n\n//! [2]\nengine = QScriptEngine()\nengine.evaluate(\"function fullName() { return this.firstName + ' ' + this.lastName; }\")\nengine.evaluate(\"somePerson = { firstName: 'John', lastName: 'Doe' }\")\n\nglobal_ = engine.globalObject()\nfullName = global_.property(\"fullName\")\nwho = global_.property(\"somePerson\")\nprint fullName.call(who).toString() # \"John Doe\"\n\nengine.evaluate(\"function cube(x) { return x * x * x; }\")\nQScriptValue cube = global_.property(\"cube\")\nargs = QScriptValueList()\nargs << 3\nprint cube.call(QScriptValue(), args).toNumber() # 27\n//! [2]\n\n\n//! [3]\n\ndef myNativeFunction(context, engine):\n    otherFunction = ...\n\n    return otherFunction.call(context.thisObject(), context.argumentsObject())\n\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_script_qscriptvalueiterator.cpp",
    "content": "//! [0]\nobject = QScriptValue()\n...\nit = QScriptValueIterator(object)\nwhile it.hasNext():\n    it.next()\n    print \"%s:%s\" % (it.name(), it.value().toString())\n//! [0]\n\n\n//! [1]\nQScriptValue obj = ... // the object to iterate over\nwhile obj.isObject():\n    it = QScriptValueIterator(obj)\n    while it.hasNext():\n        it.next()\n        print it.name()\n    obj = obj.prototype()\n//! [1]\n\n\n//! [2]\nwhile it.hasNext():\n    it.next()\n    if it.flags() & QScriptValue::SkipInEnumeration:\n        continue\n    print \"found enumerated property: %s\" % it.name()\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqldatabase.cpp",
    "content": "//! [0]\n# WRONG\ndb = QSqlDatabase.database(\"sales\")\nquery = QSqlQuery(\"SELECT NAME, DOB FROM EMPLOYEES\", db)\nQSqlDatabase.removeDatabase(\"sales\") # will output a warning\n\n# \"db\" is now a dangling invalid database connection,\n# \"query\" contains an invalid result set\n//! [0]\n\n\n//! [1]\ndb = QSqlDatabase.database(\"sales\")\nquery = QSqlQuery(\"SELECT NAME, DOB FROM EMPLOYEES\", db)\n# Both \"db\" and \"query\" are destroyed because they are out of scope\nQSqlDatabase.removeDatabase(\"sales\") # correct\n//! [1]\n\n\n//! [2]\nclass MyDatabaseDriverCreatorBase(QtSql.QSqlDriverCreatorBase):\n    ...\n    def createObject(self):\n        return MyDatabaseDriver()\n\nmydriver = MyDatabaseDriverCreatorBase()\nQtSql.QSqlDatabase.registerSqlDriver(\"MYDRIVER\", mydriver)\ndb = QtSql.QSqlDatabase.addDatabase(\"MYDRIVER\")\n//! [2]\n\n\n//! [3]\n...\ndb = QSqlDatabase.addDatabase(\"QODBC\")\ndb.setDatabaseName(\"DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=myaccessfile.mdb\")\nif db.open():\n    # success!\n    pass\n...\n//! [3]\n\n\n//! [4]\n...\n# MySQL connection\ndb.setConnectOptions(\"CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1\") # use an SSL connection to the server\nif not db.open():\n    db.setConnectOptions() # clears the connect option string\n    ...\n...\n# PostgreSQL connection\ndb.setConnectOptions(\"requiressl=1\")    # enable PostgreSQL SSL connections\nif not db.open():\n    db.setConnectOptions() # clear options\n    ...\n...\n# ODBC connection\n# set ODBC options\ndb.setConnectOptions(\"SQL_ATTR_ACCESS_MODE=SQL_MODE_READ_ONLY;SQL_ATTR_TRACE=SQL_OPT_TRACE_ON\")\nif not db.open():\n    db.setConnectOptions()              # don't try to set this option\n    ...\n//! [4]\n\n\n//! [5]\n#include \"qtdir/src/sql/drivers/psql/qsql_psql.cpp\"\n//! [5]\n\n\n//! [6]\ncon = PQconnectdb(\"host=server user=bart password=simpson dbname=springfield\")\ndrv = QPSQLDriver(con)\ndb = QSqlDatabase.addDatabase(drv) # becomes the new default connection\nquery = QSqlQuery()\nquery.exec_(\"SELECT NAME, ID FROM STAFF\")\n...\n//! [6]\n\n\n//! [7]\nunix:LIBS += -lpq\nwin32:LIBS += libpqdll.lib\n//! [7]\n\n\n//! [8]\ndb = QSqlDatabase()\nprint(db.isValid())         # Returns False\n\ndb = QSqlDatabase.database(\"sales\")\nprint(db.isValid())         # Returns True if \"sales\" connection exists\n\nQSqlDatabase.removeDatabase(\"sales\")\nprint(db.isValid())         # Returns False\n//! [8]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp",
    "content": "//! [0]\ndb = QSqlDatabase.addDatabase(\"SQLITE3\")\nv = QVariant(db.driver().handle())\nif v.isValid() && v.typeName() == \"sqlite3*\":\n    # v.data() returns a pointer to the handle\n    sqlite3 *handle = *static_cast<sqlite3 **>(v.data())\n    if handle != 0: # check that it is not NULL\n        doSomething()\n//! [0]\n\n\n//! [1]\n# Impossible to translate to python\nif (v.typeName() == \"PGconn*\") {\n    PGconn *handle = *static_cast<PGconn **>(v.data())\n    if (handle != 0) ...\n}\n\nif (v.typeName() == \"MYSQL*\") {\n    MYSQL *handle = *static_cast<MYSQL **>(v.data())\n    if (handle != 0) ...\n}\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlerror.cpp",
    "content": "//! [0]\nmodel = QSqlQueryModel()\nmodel.setQuery(\"select * from myTable\")\nif model.lastError().isValid():\n    print model.lastError()\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlindex.cpp",
    "content": "//! [0]\nstrlist = myIndex.toStringList()\nfor i in strlist:\n    myProcessing(i)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlquery.cpp",
    "content": "//! [0]\nSELECT forename, surname FROM people\n//! [0]\n\n\n//! [1]\nq = QSqlQuery(\"select * from employees\")\nrec = q.record()\n\nprint \"Number of columns: %d\" % rec.count()\n\nnameCol = rec.indexOf(\"name\") # index of the field \"name\"\nwhile q.next():\n    print q.value(nameCol) # output all names\n//! [1]\n\n\n//! [2]\nq = QSqlQuery()\nq.prepare(\"insert into myTable values (?, ?)\")\n\nints = [1, 2, 3, 4]\nq.addBindValue(ints)\n\nnames = [\"Harald\", \"Boris\", \"Trond\", \"\"]\nq.addBindValue(names)\n\nif not q.execBatch():\n    print q.lastError()\n//! [2]\n\n\n//! [3]\n1  Harald\n2  Boris\n3  Trond\n4  NULL\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_sql_kernel_qsqlresult.cpp",
    "content": "//! [0]\nq = QSqlQuery()\nq.prepare(\"insert into test (i1, i2, s) values (?, ?, ?)\")\n\ncol1 = [1, 3]\ncol2 = [2, 4]\ncol3 = [\"hello\", \"world\"]\n\nq.bindValue(0, col1)\nq.bindValue(1, col2)\nq.bindValue(2, col3)\n\nif not q.execBatch():\n    print q.lastError()\n//! [0]\n\n\n//! [1]\nquery = QSqlQuery ...\nv = query.result().handle()\nif v.isValid() and (v.typeName() == \"sqlite3_stmt*\"):\n    # v.data() returns a pointer to the handle\n    handle = v.data()\n    if handle != 0: # check that it is not NULL\n        ...\n//! [1]\n\n\n//! [2]\nif v.typeName() == \"PGresult*\":\n    handle = v.data()\n    if handle != 0 ...\n\nif v.typeName() == \"MYSQL_STMT*\":\n    handle = v.data()\n    if handle != 0 ...\n}\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp",
    "content": "//! [0]\nwhile myModel.canFetchMore():\n    myModel.fetchMore()\n//! [0]\n\n\n//! [1]\nmodel = QSqlQueryModel()\nmodel.setQuery(\"select * from MyTable\")\nif model.lastError().isValid():\n    print model.lastError()\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_svg_qgraphicssvgitem.cpp",
    "content": "//! [0]\nrenderer = QSvgRenderer(QLatin1String(\"SvgCardDeck.svg\"))\nblack = QGraphicsSvgItem()\nred   = QGraphicsSvgItem()\n\nblack.setSharedRenderer(renderer)\nblack.setElementId(QLatin1String(\"black_joker\"))\n\nred.setSharedRenderer(renderer)\nred.setElementId(QLatin1String(\"red_joker\"))\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xml_dom_qdom.cpp",
    "content": "//! [0]\ndoc = QDomDocument()\nimpl = QDomImplementation()\n\n# This will create the element, but the resulting XML document will\n# be invalid, because '~' is not a valid character in a tag name.\nimpl.setInvalidDataPolicy(QDomImplementation.AcceptInvalidData)\nelt1 = doc.createElement(\"foo~bar\")\n\n# This will create an element with the tag name \"foobar\".\nimpl.setInvalidDataPolicy(QDomImplementation.DropInvalidData)\nelt2 = doc.createElement(\"foo~bar\")\n\n# This will create a null element.\nimpl.setInvalidDataPolicy(QDomImplementation::ReturnNullNode)\nelt3 = doc.createElement(\"foo~bar\")\n//! [0]\n\n\n//! [1]\nd = QDomDocument()\nd.setContent(someXML)\nn = d.firstChild()\nwhile !n.isNull():\n    if n.isElement():\n        e = n.toElement()\n        print \"Element name: %s\" % e.tagName()\n        break\n    n = n.nextSibling()\n//! [1]\n\n\n//! [2]\nQDomDocument document\nQDomElement element1 = document.documentElement()\nQDomElement element2 = element1\n//! [2]\n\n\n//! [3]\nQDomElement element3 = document.createElement(\"MyElement\")\nQDomElement element4 = document.createElement(\"MyElement\")\n//! [3]\n\n\n//! [4]\n<body>\n<h1>Heading</h1>\n<p>Hello <b>you</b></p>\n</body>\n//! [4]\n\n\n//! [5]\n<h1>Heading</h1>\n<p>The text...</p>\n<h2>Next heading</h2>\n//! [5]\n\n\n//! [6]\n<h1>Heading</h1>\n<p>The text...</p>\n<h2>Next heading</h2>\n//! [6]\n\n\n//! [7]\n<link href=\"http://qtsoftware.com\" color=\"red\" />\n//! [7]\n\n\n//! [8]\ne = # some QDomElement...\n#...\na = e.attributeNode(\"href\")\nprint a.value()                         # prints \"http://qtsoftware.com\"\na.setValue(\"http://doc.trolltech.com\")  # change the node's attribute\na2 = e.attributeNode(\"href\")\nprint a2.value()                        # prints \"http://doc.trolltech.com\"\n//! [8]\n\n\n//! [9]\ne = # some QDomElement...\n#...\ns = e.text()\n//! [9]\n\n\n//! [10]\ntext = QString()\nelement = doc.documentElement()\n\nn = element.firstChild()\nwhile True:\n    if not n.isNull()\n        break\n    t = n.toText()\n    if !t.isNull():\n        text += t.data()\n\n    n = n.nextSibling()\n//! [10]\n\n\n//! [11]\ndoc = # some QDomDocument ...\nroot = doc.firstChildElement(\"database\")\nelt = root.firstChildElement(\"entry\")\nwhile True:\n    if not elt.isNull():\n        break\n    # ...\n    elt = elt.nextSiblingElement(\"entry\")\n//! [11]\n\n\n//! [12]\n<img src=\"myimg.png\">\n//! [12]\n\n\n//! [13]\n<h1>Hello <b>Qt</b> <![CDATA[<xml is cool>]]></h1>\n//! [13]\n\n\n//! [14]\nHello Qt <xml is cool>\n//! [14]\n\n\n//! [15]\n<!-- this is a comment -->\n//! [15]\n\n\n//! [16]\ndoc = QDomDocument(\"mydocument\")\nfile = QFile(\"mydocument.xml\")\nif not file.open(QIODevice::ReadOnly):\n    return\nif not doc.setContent(&file):\n    file.close()\n    return\nfile.close()\n\n# print out the element names of all elements that are direct children\n# of the outermost element.\ndocElem = doc.documentElement()\n\nn = docElem.firstChild()\nwhile not n.isNull():\n    e = n.toElement() # try to convert the node to an element.\n    if not e.isNull():\n        print e.tagName() # the node really is an element.\n    n = n.nextSibling()\n}\n\n# Here we append a new element to the end of the document\nelem = doc.createElement(\"img\")\nelem.setAttribute(\"src\", \"myimage.png\")\ndocElem.appendChild(elem)\n//! [16]\n\n\n//! [17]\ndoc = QDomDocument(\"MyML\")\nroot = doc.createElement(\"MyML\")\ndoc.appendChild(root)\n\ntag = doc.createElement(\"Greeting\")\nroot.appendChild(tag)\n\nt = doc.createTextNode(\"Hello World\")\ntag.appendChild(t)\n\nxml = doc.toString()\n//! [17]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xml_sax_qxml.cpp",
    "content": "//! [0]\nxmlReader.setFeature(\"http://xml.org/sax/features/namespace-prefixes\", True)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstracturiresolver.cpp",
    "content": "//! [0]\nreturn baseURI.resolved(relative);\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlforwarditerator.cpp",
    "content": "//! [0]\nOutputType inputToOutputItem(const InputType &inputType) const;\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlnodemodel.cpp",
    "content": "//! [0]\nmyInstance = QXmlNodeModelIndex();\n//! [0]\n\n//! [1]\nQFile queryFile(argv[1]);\nQFile chemistryData(argv[2]);\nQString moleculeName = argv[3];\n\nQXmlQuery query;\nquery.setQuery(&queryFile, QUrl::fromLocalFile(queryFile.fileName()));\n\nChemistryNodeModel myNodeModel(query.namePool(), chemistryData);\nQXmlNodeModelIndex startNode = myNodeModel.nodeFor(moleculeName);\nquery.bindVariable(\"queryRoot\", startNode);\n\nQFile out;\nout.open(stdout, QIODevice::WriteOnly);\n\nQXmlSerializer serializer(query, &out);\nquery.evaluateTo(&serializer);\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qabstractxmlreceiver.cpp",
    "content": "//! [0]\nQXmlQuery query;\nquery.setQuery(\"doc('index.html')/html/body/p[1]\");\n\nQXmlSerializer serializer(query, myOutputDevice);\nquery.evaluateTo(&serializer);\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qsimplexmlnodemodel.cpp",
    "content": "//! [0]\nQXmlNodeModelIndex MyTreeModel::nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &ni) const\n{\n    // Convert the QXmlNodeModelIndex to a value that is specific to what we represent.\n    const MyValue value = toMyValue(ni);\n\n    switch(axis)\n    {\n        case Parent:\n            return toNodeIndex(value.parent());\n        case FirstChild:\n        case PreviousSibling:\n        case NextSibling:\n            // and so on\n            ;\n    }\n    return QXmlNodeModelIndex();\n}\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlformatter.cpp",
    "content": "//! [0]\nQXmlQuery query;\nquery.setQuery(\"doc('index.html')/html/body/p[1]\");\n\nQXmlFormatter formatter(query, myOutputDevice);\nformatter.setIndentationDepth(2);\nquery.evaluateTo(&formatter);\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlname.cpp",
    "content": "// Fills the bits from begin to end with 1s and leaves the rest as 0.\n\ntemplate<typename IntegralT>\ninline IntegralT bitmask(IntegralT begin, IntegralT end)\n{\n   IntegralT filled_bits = (1 << (end - begin + 1)) - 1;\n   return filled_bits << begin;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlquery.cpp",
    "content": "//! [0]\n    QXmlNamePool namePool(query.namePool());\n    query.bindVariable(QXmlName(namePool, localName), value);\n//! [0]\n\n\n{\n//! [1]\n    QByteArray myDocument;\n    QBuffer buffer(&myDocument); // This is a QIODevice.\n    buffer.open(QIODevice::ReadOnly);\n    QXmlQuery query;\n    query.bindVariable(\"myDocument\", &buffer);\n    query.setQuery(\"doc($myDocument)\");\n//! [1]\n}\n\n\n{\n    QIODevice *device = 0;\n//! [2]\n    QXmlNamePool namePool(query.namePool());\n    query.bindVariable(QXmlName(namePool, localName), device);\n//! [2]\n\n}\n\n{\n    QIODevice *myOutputDevice = 0;\n//! [3]\n    QFile xq(\"myquery.xq\");\n\n    QXmlQuery query;\n    query.setQuery(&xq, QUrl::fromLocalFile(xq.fileName()));\n\n    QXmlSerializer serializer(query, myOutputDevice);\n    query.evaluateTo(&serializer);\n//! [3]\n}\n\n{\n    QIODevice *myOutputDevice = 0;\n//! [4]\n    QFile xq(\"myquery.xq\");\n    QString fileName(\"the filename\");\n    QString publisherName(\"the publisher\");\n    qlonglong year = 1234;\n\n    QXmlQuery query;\n\n    query.bindVariable(\"file\", QVariant(fileName));\n    query.bindVariable(\"publisher\", QVariant(publisherName));\n    query.bindVariable(\"year\", QVariant(year));\n\n    query.setQuery(&xq, QUrl::fromLocalFile(xq.fileName()));\n\n    QXmlSerializer serializer(query, myOutputDevice);\n    query.evaluateTo(&serializer);\n//! [4]\n}\n\n{\n//! [5]\n    QFile xq(\"myquery.xq\");\n    QString fileName(\"the filename\");\n    QString publisherName(\"the publisher\");\n    qlonglong year = 1234;\n\n    QXmlQuery query;\n\n    query.bindVariable(\"file\", QVariant(fileName));\n    query.bindVariable(\"publisher\", QVariant(publisherName));\n    query.bindVariable(\"year\", QVariant(year));\n\n    query.setQuery(&xq, QUrl::fromLocalFile(xq.fileName()));\n\n    QXmlResultItems result;\n    query.evaluateTo(&result);\n    QXmlItem item(result.next());\n    while (!item.isNull()) {\n        if (item.isAtomicValue()) {\n            QVariant v = item.toAtomicValue();\n            switch (v.type()) {\n                case QVariant::LongLong:\n                    // xs:integer\n                    break;\n                case QVariant::String:\n                    // xs:string\n                    break;\n                default:\n                    // error\n                    break;\n            }\n        }\n        else if (item.isNode()) {\n            QXmlNodeModelIndex i = item.toNodeModelIndex();\n            // process node\n        }\n        item = result.next();\n    }\n//! [5]\n}\n\n{\n//! [6]\n    QFile xq(\"myquery.xq\");\n\n    QXmlQuery query;\n    query.setQuery(&xq, QUrl::fromLocalFile(xq.fileName()));\n\n    QXmlResultItems result;\n    query.evaluateTo(&result);\n    QXmlItem item(result.next());\n    while (!item.isNull()) {\n        if (item.isAtomicValue()) {\n            QVariant v = item.toAtomicValue();\n            switch (v.type()) {\n                case QVariant::LongLong:\n                    // xs:integer\n                    break;\n                case QVariant::String:\n                    // xs:string\n                    break;\n                default:\n                    if (v.userType() == qMetaTypeId<QXmlName>()) {\n                        QXmlName n = qVariantValue<QXmlName>(v);\n                        // process QXmlName n...\n                    }\n                    else {\n                        // error\n                    }\n                    break;\n            }\n        }\n        else if (item.isNode()) {\n            QXmlNodeModelIndex i = item.toNodeModelIndex();\n            // process node\n        }\n        item = result.next();\n    }\n//! [6]\n}\n\n{\n    QIODevice *out = 0;\n//! [7]\n    QXmlQuery query(QXmlQuery::XSLT20);\n    query.setFocus(QUrl(\"myInput.xml\"));\n    query.setQuery(QUrl(\"myStylesheet.xsl\"));\n    query.evaluateTo(out);\n//! [7]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlresultitems.cpp",
    "content": "//! [0]\nQXmlQuery query;\nquery.setQuery(\"<e/>, 1, 'two'\");\nQXmlResultItems result;\n\nif (query.isValid()) {\n    query.evaluateTo(&result);\n    QXmlItem item(result.next());\n    while (!item.isNull()) {\n        // use item\n        item = result.next();\n    }\n    if (result.hasError())\n        /* Runtime error! */;\n}\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/src_xmlpatterns_api_qxmlserializer.cpp",
    "content": "//! [0]\nQXmlQuery query;\nquery.setQuery(\"doc('index.html')/html/body/p[1]\");\n\nQXmlSerializer serializer(query, myOutputDevice);\nquery.evaluateTo(&serializer);\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp",
    "content": "//! [0]\n        QProcess *process = new QProcess(this);\n        QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath)\n            + QLatin1String(\"/assistant\");\n        \n        process->start(app, QStringList() << QLatin1String(\"-enableRemoteControl\"));\n        if (!process->waitForStarted()) {\n            QMessageBox::critical(this, tr(\"Remote Control\"),\n                tr(\"Could not start Qt Assistant from %1.\").arg(app));\n            return;\n        }\n        \n        // show index page\n        QTextStream str(process);\n        str << QLatin1String(\"SetSource qthelp://mycompany.com/doc/index.html\")\n            << QLatin1Char('\\0') << endl;\n    }\n//! [0]\n\n\n//! [1]\n        CONFIG += assistant\n//! [1]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_default_extensionfactory.cpp",
    "content": "//! [0]\n        QObject *ANewExtensionFactory::createExtension(QObject *object,\n                const QString &iid, QObject *parent) const\n        {\n            if (iid != Q_TYPEID(QDesignerContainerExtension))\n                return 0;\n\n            if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*>\n                   (object))\n                return new MyContainerExtension(widget, parent);\n\n            return 0;\n        }\n//! [0]\n\n\n//! [1]\n        QObject *AGeneralExtensionFactory::createExtension(QObject *object,\n                const QString &iid, QObject *parent) const\n        {\n            MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object);\n\n            if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) {\n                return new MyTaskMenuExtension(widget, parent);\n\n            } else if (widget && (iid == Q_TYPEID(QDesignerContainerExtension))) {\n                return new MyContainerExtension(widget, parent);\n\n            } else {\n                return 0;\n            }\n        }\n//! [1]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_extension.cpp",
    "content": "//! [0]\n       QDesignerPropertySheetExtension *propertySheet;\n       QExtensionManager manager = formEditor->extensionManager();\n\n       propertySheet = qt_extension<QDesignerPropertySheetExtension*>(manager, widget);\n\n       if(propertySheet) {...}\n//! [0]\n\n\n//! [1]\n   Q_DECLARE_EXTENSION_INTERFACE(MyExtension, \"com.mycompany.myproduct.myextension\")\n//! [1]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_extension_qextensionmanager.cpp",
    "content": "//! [0]\n        void MyPlugin::initialize(QDesignerFormEditorInterface *formEditor)\n        {\n            if (initialized)\n                return;\n\n            QExtensionManager *manager = formEditor->extensionManager();\n            Q_ASSERT(manager != 0);\n\n            manager->registerExtensions(new MyExtensionFactory(manager),\n                                        Q_TYPEID(QDesignerTaskMenuExtension));\n\n            initialized = true;\n        }\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformeditor.cpp",
    "content": "//! [0]\n        QDesignerObjectInspectorInterface *objectInspector = 0;\n        objectInspector = formEditor->objectInspector();\n\n        QDesignerFormWindowManagerInterface *manager = 0;\n        manager = formEditor->formWindowManager();\n\n        objectInspector->setFormWindow(manager->formWindow(0));\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindow.cpp",
    "content": "//! [0]\n    QDesignerFormWindowInterface *formWindow;\n    formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget);\n//! [0]\n\n\n//! [1]\n    QList<QDesignerFormWindowInterface *> forms;\n    QDesignerFormWindowInterface *formWindow;\n\n    QDesignerFormWindowManagerInterface *manager = formEditor->formWindowManager();\n\n    for (int i = 0; i < manager->formWindowCount(); i++) {\n        formWindow = manager->formWindow(i);\n        forms.append(formWindow);\n    }\n//! [1]\n\n\n//! [2]\n        if (formWindow->isManaged(myWidget))\n            formWindow->manageWidget(myWidget->childWidget);\n//! [2]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowcursor.cpp",
    "content": "//! [0]\n    QDesignerFormWindowInterface *formWindow = 0;\n    formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget);\n\n    formWindow->cursor()->setProperty(myWidget, myProperty, newValue);\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractformwindowmanager.cpp",
    "content": "//! [0]\n        QDesignerFormWindowManagerInterface *manager = 0;\n        QDesignerFormWindowInterface *formWindow = 0;\n\n        manager = formEditor->formWindowManager();\n        formWindow = manager->formWindow(0);\n\n        manager->setActiveFormWindow(formWindow);\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractobjectinspector.cpp",
    "content": "//! [0]\n        QDesignerObjectInspectorInterface *objectInspector = 0;\n        objectInspector = formEditor->objectInspector();\n\n        QDesignerFormWindowManagerInterface *manager = 0;\n        manager = formEditor->formWindowManager();\n\n        objectInspector->setFormWindow(manager->formWindow(0));\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractpropertyeditor.cpp",
    "content": "//! [0]\n        QDesignerPropertyEditorInterface *propertyEditor = 0;\n        propertyEditor = formEditor->propertyEditor();\n\n        connect(propertyEditor, SIGNAL(propertyChanged(QString, QVariant)),\n                this, SLOT(checkProperty(QString, QVariant)));\n//! [0]\n\n\n//! [1]\n        void checkProperty(QString property, QVariant value) {\n            QDesignerPropertyEditorInterface *propertyEditor = 0;\n            propertyEditor = formEditor->propertyEditor();\n\n            QObject *object = propertyeditor->object();\n            MyCustomWidget *widget = qobject_cast<MyCustomWidget>(object);\n\n            if (widget && property == aProperty && value != expectedValue)\n                {...}\n        }\n//! [1]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_sdk_abstractwidgetbox.cpp",
    "content": "//! [0]\n        QDesignerWidgetBoxInterface *widgetBox = 0:\n        widgetBox = formEditor->widgetBox();\n\n        widgetBox->load();\n//! [0]\n\n\n//! [1]\n        QString originalFile = widgetBox->fileName();\n\n        widgetBox->setFileName(\"myWidgetBox.xml\");\n        widgetBox->save();\n//! [1]\n\n\n//! [2]\n        widgetBox->setFileName(originalFile);\n        widgetBox->load();\n//! [2]\n\n\n//! [3]\n        if (widgetBox->filename() != \"myWidgetBox.xml\") {\n            widgetBox->setFileName(\"myWidgetBox.xml\");\n            widgetBox->load();\n        }\n//! [3]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_abstractformbuilder.cpp",
    "content": "//! [0]\n        MyForm::MyForm(QWidget *parent)\n            : QWidget(parent)\n        {\n            QFormBuilder builder;\n            QFile file(\":/forms/myWidget.ui\");\n            file.open(QFile::ReadOnly);\n            QWidget *myWidget = builder.load(&file, this);\n            file.close();\n\n            QVBoxLayout *layout = new QVBoxLayout;\n            layout->addWidget(myWidget);\n            setLayout(layout);\n        }\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_designer_src_lib_uilib_formbuilder.cpp",
    "content": "//! [0]\n        MyForm::MyForm(QWidget *parent)\n            : QWidget(parent)\n        {\n            QFormBuilder builder;\n            QFile file(\":/forms/myWidget.ui\");\n            file.open(QFile::ReadOnly);\n            QWidget *myWidget = builder.load(&file, this);\n            file.close();\n\n            QVBoxLayout *layout = new QVBoxLayout;\n            layout->addWidget(myWidget);\n            setLayout(layout);\n        }\n//! [0]\n\n\n//! [1]\n    <!DOCTYPE RCC><RCC version=\"1.0\">\n    <qresource prefix=\"/forms\">\n       <file>mywidget.ui</file>\n    </qresource>\n    </RCC>\n//! [1]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_patternist_qapplicationargumentparser.cpp",
    "content": "//! [0]\n \\include main.cpp\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_shared_qtgradienteditor_qtgradientdialog.cpp",
    "content": "//! [0]\n    bool ok;\n    QGradient gradient = QtGradientDialog::getGradient(&ok, QRadialGradient(), this);\n    if (ok) {\n        // the user clicked OK and gradient is set to the gradient the user selected\n    } else {\n        // the user canceled the dialog; gradient is set to the initial\n        // value, in this case radial gradient\n    }\n//! [0]\n\n\n//! [1]\n    bool detailsVisible;\n    QColor::Spec spec;\n    QGradient gradient;\n\n    QtGradientDialog dlg(this);\n    dlg.setDetailsVisible(detailsVisible);\n    dlg.setSpec(spec);\n    dlg.setGradient(gradient);\n    if (dlg.exec() != QDialog::Accepted)\n        return;\n\n    gradient = dlg.gradient();\n    // detailsVisible and spec properties can be changed interactively by the user too,\n    // we store the values of these properties for the next time QtGradientDialog is executed.\n    detailsVisible = dlg.detailsVisible();\n    spec = dlg.spec();\n//! [1]\n\n\n//! [2]\n        QtGradientDialog dlg;\n        dlg.setBackgroundCheckered(true);\n//! [2]\n\n\n//! [3]\n        QtGradientDialog dlg;\n        dlg.setBackgroundCheckered(false);\n//! [3]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtpropertybrowser.cpp",
    "content": "//! [0]\n        QtSpinBoxFactory *factory;\n        QSet<QtIntPropertyManager *> managers = factory->propertyManagers();\n//! [0]\n\n\n//! [1]\n        QtBrowserItem *item;\n        QList<QtBrowserItem *> childrenItems = item->children();\n\n        QList<QtProperty *> childrenProperties = item->property()->subProperties();\n//! [1]\n\n\n//! [2]\n        QtProperty *property1, *property2, *property3;\n\n        property2->addSubProperty(property1);\n        property3->addSubProperty(property2);\n\n        QtAbstractPropertyBrowser *editor;\n\n        editor->addProperty(property1);\n        editor->addProperty(property2);\n        editor->addProperty(property3);\n//! [2]\n\n\n//! [3]\n        QtIntPropertyManager *intManager;\n        QtDoublePropertyManager *doubleManager;\n\n        QtProperty *myInteger = intManager->addProperty();\n        QtProperty *myDouble = doubleManager->addProperty();\n\n        QtSpinBoxFactory  *spinBoxFactory;\n        QtDoubleSpinBoxFactory *doubleSpinBoxFactory;\n\n        QtAbstractPropertyBrowser *editor;\n        editor->setFactoryForManager(intManager, spinBoxFactory);\n        editor->setFactoryForManager(doubleManager, doubleSpinBoxFactory);\n\n        editor->addProperty(myInteger);\n        editor->addProperty(myDouble);\n//! [3]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp",
    "content": "//! [0]\n        QtVariantPropertyManager *variantPropertyManager;\n        QtProperty *property;\n\n        variantPropertyManager->setValue(property, 10);\n//! [0]\n\n\n//! [1]\n        QtVariantPropertyManager *variantPropertyManager;\n        QtVariantProperty *property;\n\n        property->setValue(10);\n//! [1]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/code/tools_shared_qttoolbardialog_qttoolbardialog.cpp",
    "content": "//! [0]\n    QtToolBarManager *toolBarManager;\n\n    void MyMainWindow::customize()\n        {\n            QtToolBarDialog dialog(this);\n            dialog.setToolBarManager(toolBarManager);\n            dialog.exec();\n        }\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/console/dbus_pingpong.txt",
    "content": "[qtuser@workstation:~/dev/qt-4.4/examples/dbus/pingpong]$ ./pong &\n[qtuser@workstation:~/dev/qt-4.4/examples/dbus/pingpong]$ ./ping Hello\nReply was: ping(\"Hello\") got called\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/coordsys/coordsys.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nclass MyWidget : public QWidget\n{\npublic:\n    MyWidget();\n\nprotected:\n    void paintEvent(QPaintEvent *);\n};\n\nMyWidget::MyWidget()\n{\n    QPalette palette(MyWidget::palette());\n    palette.setColor(backgroundRole(), Qt::white);\n    setPalette(palette);\n}\n\nvoid MyWidget::paintEvent(QPaintEvent *)\n{\n    QPainter painter(this);\n    painter.setRenderHint(QPainter::Antialiasing);\n    painter.setPen(Qt::darkGreen);\n    painter.drawRect(1, 2, 6, 4);\n\n    //painter.setPen(Qt::darkGray);\n    //painter.drawLine(2, 8, 6, 2);\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MyWidget widget;\n    widget.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/customstyle/customstyle.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"customstyle.h\"\n\nCustomStyle::CustomStyle()\n{\n//! [0]\n    if widget:\n//! [0] //! [1]\n//! [1]\n}\n\n//! [2]\ndef drawPrimitive(element, option, painter, widget):\n    if element == PE_IndicatorSpinUp or element == PE_IndicatorSpinDown:\n        points = QPolygon(3)\n        x = option->rect.x()\n        y = option->rect.y()\n        w = option->rect.width() / 2\n        h = option->rect.height() / 2\n        x += (option->rect.width() - w) / 2\n        y += (option->rect.height() - h) / 2\n\n        if element == PE_IndicatorSpinUp:\n            points[0] = QPoint(x, y + h)\n            points[1] = QPoint(x + w, y + h)\n            points[2] = QPoint(x + w / 2, y)\n        else: # PE_SpinBoxDown\n            points[0] = QPoint(x, y)\n            points[1] = QPoint(x + w, y)\n            points[2] = QPoint(x + w / 2, y + h)\n\n        if option.state & State_Enabled:\n            painter.setPen(option.palette.mid().color())\n            painter.setBrush(option.palette.buttonText())\n        else:\n            painter.setPen(option.palette.buttonText().color())\n            painter.setBrush(option.palette.mid())\n\n        painter.drawPolygon(points)\n\n    else:\n        QWindowsStyle.drawPrimitive(element, option, painter, widget)\n//! [2] //! [3]\n\n//! [3] //! [4]\n}\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/customstyle/customstyle.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef CUSTOMSTYLE_H\n#define CUSTOMSTYLE_H\n\n#include <QWindowsStyle>\n\n//! [0]\nclass CustomStyle(QWindowsStyle):\n    ...\n\n    def drawPrimitive(PrimitiveElement element, const QStyleOption *option,\n                      QPainter *painter, const QWidget *widget) const;\n        # element : PrimitiveElement\n        # option  : QStyleOption\n        # painter : QPainter\n        # widget  : QWidget\n        ...\n//! [0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/customstyle/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [using a custom style]\n#include <QtGui>\n\n#include \"customstyle.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication::setStyle(new CustomStyle);\n    QApplication app(argc, argv);\n    QSpinBox spinBox;\n    spinBox.show();\n    return app.exec();\n}\n//! [using a custom style]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/customviewstyle.cpp",
    "content": "#include <QtGui>\n\n#include \"customviewstyle.h\"\n\n\n\nvoid CustomViewStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const\n{\n\n//![0]\n    switch (element) {\n        case (PE_PanelItemViewItem): {\n            painter->save();\n\n            QPoint topLeft = option->rect.topLeft();\n            QPoint bottomRight = option->rect.topRight();\n            QLinearGradient backgroundGradient(topLeft, bottomRight);\n            backgroundGradient.setColorAt(0.0, QColor(Qt::yellow).lighter(190));\n            backgroundGradient.setColorAt(1.0, Qt::white);\n            painter->fillRect(option->rect, QBrush(backgroundGradient));\n\n            painter->restore();\n        break;\n        }    \n        default:\n            QWindowsStyle::drawPrimitive(element, option, painter, widget);\n    }\n//![0]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"imagedialog.h\"\n\nImageDialog::ImageDialog(QWidget *parent)\n    : QDialog(parent)\n{\n    setupUi(this);\n    okButton->setAutoDefault(false);\n    cancelButton->setAutoDefault(false);\n\n    colorDepthCombo->addItem(tr(\"2 colors (1 bit per pixel)\"));\n    colorDepthCombo->addItem(tr(\"4 colors (2 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"16 colors (4 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"256 colors (8 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"65536 colors (16 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"16 million colors (24 bits per pixel)\"));\n\n    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));\n}\n\nvoid ImageDialog::on_okButton_clicked()\n{\n    if (nameLineEdit->text().isEmpty())\n        (void) QMessageBox::information(this, tr(\"No Image Name\"),\n            tr(\"Please supply a name for the image.\"), QMessageBox::Cancel);\n    else\n        accept();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef IMAGEDIALOG_H\n#define IMAGEDIALOG_H\n\n#include \"ui_imagedialog.h\"\n\n//! [0]\nclass ImageDialog : public QDialog, private Ui::ImageDialog\n{\n    Q_OBJECT\n\npublic:\n    ImageDialog(QWidget *parent = 0);\n\nprivate slots:\n    void on_okButton_clicked();\n};\n//! [0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/autoconnection/imagedialog.ui",
    "content": "<ui version=\"4.0\" >\n <comment></comment>\n <class>ImageDialog</class>\n <widget class=\"QDialog\" >\n  <property name=\"objectName\" >\n   <string notr=\"true\" >ImageDialog</string>\n  </property>\n  <property name=\"geometry\" >\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>320</width>\n    <height>180</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\" >\n   <string>Create Image</string>\n  </property>\n  <layout class=\"QVBoxLayout\" >\n   <property name=\"objectName\" >\n    <string notr=\"true\" />\n   </property>\n   <property name=\"margin\" >\n    <number>9</number>\n   </property>\n   <property name=\"spacing\" >\n    <number>6</number>\n   </property>\n   <item>\n    <layout class=\"QGridLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item row=\"1\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"widthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >widthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>27</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Width:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"heightLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >heightLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>55</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Height:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"1\" >\n      <widget class=\"QComboBox\" name=\"colorDepthCombo\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthCombo</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"insertPolicy\" >\n        <enum>QComboBox::InsertAtBottom</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"1\" >\n      <widget class=\"QLineEdit\" name=\"nameLineEdit\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLineEdit</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>1</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"text\" >\n        <string>Untitled image</string>\n       </property>\n       <property name=\"echoMode\" >\n        <enum>QLineEdit::Normal</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>1</y>\n         <width>227</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox_2\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox_2</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>27</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"nameLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>67</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Name:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"colorDepthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>83</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Color depth:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <spacer>\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"geometry\" >\n      <rect>\n       <x>9</x>\n       <y>121</y>\n       <width>302</width>\n       <height>18</height>\n      </rect>\n     </property>\n     <property name=\"orientation\" >\n      <enum>Qt::Vertical</enum>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item>\n      <spacer>\n       <property name=\"objectName\" >\n        <string notr=\"true\" />\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>128</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"orientation\" >\n        <enum>Qt::Horizontal</enum>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"okButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >okButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>135</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>OK</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"cancelButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >cancelButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>221</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>Cancel</string>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <pixmapfunction></pixmapfunction>\n <tabstops>\n  <tabstop>nameLineEdit</tabstop>\n  <tabstop>spinBox</tabstop>\n  <tabstop>spinBox_2</tabstop>\n  <tabstop>colorDepthCombo</tabstop>\n  <tabstop>okButton</tabstop>\n  <tabstop>cancelButton</tabstop>\n </tabstops>\n <connections>\n  <connection>\n   <sender>nameLineEdit</sender>\n   <signal>returnPressed()</signal>\n   <receiver>okButton</receiver>\n   <slot>animateClick()</slot>\n   <hints>\n    <hint type=\"sourcelabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n    <hint type=\"destinationlabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/autoconnection/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"imagedialog.h\"\n\n#include <QApplication>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    ImageDialog *dialog = new ImageDialog;\n    dialog->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/imagedialog/imagedialog.ui",
    "content": "<ui version=\"4.0\" >\n <comment></comment>\n <class>ImageDialog</class>\n <widget class=\"QDialog\" >\n  <property name=\"objectName\" >\n   <string notr=\"true\" >ImageDialog</string>\n  </property>\n  <property name=\"geometry\" >\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>320</width>\n    <height>180</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\" >\n   <string>Create Image</string>\n  </property>\n  <layout class=\"QVBoxLayout\" >\n   <property name=\"objectName\" >\n    <string notr=\"true\" />\n   </property>\n   <property name=\"margin\" >\n    <number>9</number>\n   </property>\n   <property name=\"spacing\" >\n    <number>6</number>\n   </property>\n   <item>\n    <layout class=\"QGridLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item row=\"1\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"widthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >widthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>27</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Width:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"heightLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >heightLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>55</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Height:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"1\" >\n      <widget class=\"QComboBox\" name=\"colorDepthCombo\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthCombo</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"insertPolicy\" >\n        <enum>QComboBox::InsertAtBottom</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"1\" >\n      <widget class=\"QLineEdit\" name=\"nameLineEdit\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLineEdit</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>1</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"text\" >\n        <string>Untitled image</string>\n       </property>\n       <property name=\"echoMode\" >\n        <enum>QLineEdit::Normal</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>1</y>\n         <width>227</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox_2\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox_2</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>27</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"nameLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>67</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Name:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"colorDepthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>83</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Color depth:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <spacer>\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"geometry\" >\n      <rect>\n       <x>9</x>\n       <y>121</y>\n       <width>302</width>\n       <height>18</height>\n      </rect>\n     </property>\n     <property name=\"orientation\" >\n      <enum>Qt::Vertical</enum>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item>\n      <spacer>\n       <property name=\"objectName\" >\n        <string notr=\"true\" />\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>128</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"orientation\" >\n        <enum>Qt::Horizontal</enum>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"okButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >okButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>135</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>OK</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"cancelButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >cancelButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>221</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>Cancel</string>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <pixmapfunction></pixmapfunction>\n <tabstops>\n  <tabstop>nameLineEdit</tabstop>\n  <tabstop>spinBox</tabstop>\n  <tabstop>spinBox_2</tabstop>\n  <tabstop>colorDepthCombo</tabstop>\n  <tabstop>okButton</tabstop>\n  <tabstop>cancelButton</tabstop>\n </tabstops>\n <connections>\n  <connection>\n   <sender>nameLineEdit</sender>\n   <signal>returnPressed()</signal>\n   <receiver>okButton</receiver>\n   <slot>animateClick()</slot>\n   <hints>\n    <hint type=\"sourcelabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n    <hint type=\"destinationlabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/imagedialog/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"ui_imagedialog.h\"\n#include <QApplication>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QDialog *window = new QDialog;\n    Ui::ImageDialog ui;\n    ui.setupUi(window);\n\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"imagedialog.h\"\n\nImageDialog::ImageDialog(QWidget *parent)\n    : QDialog(parent)\n{\n    setupUi(this);\n\n    colorDepthCombo->addItem(tr(\"2 colors (1 bit per pixel)\"));\n    colorDepthCombo->addItem(tr(\"4 colors (2 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"16 colors (4 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"256 colors (8 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"65536 colors (16 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"16 million colors (24 bits per pixel)\"));\n\n    connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));\n    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef IMAGEDIALOG_H\n#define IMAGEDIALOG_H\n\n#include \"ui_imagedialog.h\"\n\nclass ImageDialog : public QDialog, private Ui::ImageDialog\n{\n    Q_OBJECT\n\npublic:\n    ImageDialog(QWidget *parent = 0);\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/multipleinheritance/imagedialog.ui",
    "content": "<ui version=\"4.0\" >\n <comment></comment>\n <class>ImageDialog</class>\n <widget class=\"QDialog\" >\n  <property name=\"objectName\" >\n   <string notr=\"true\" >ImageDialog</string>\n  </property>\n  <property name=\"geometry\" >\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>320</width>\n    <height>180</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\" >\n   <string>Create Image</string>\n  </property>\n  <layout class=\"QVBoxLayout\" >\n   <property name=\"objectName\" >\n    <string notr=\"true\" />\n   </property>\n   <property name=\"margin\" >\n    <number>9</number>\n   </property>\n   <property name=\"spacing\" >\n    <number>6</number>\n   </property>\n   <item>\n    <layout class=\"QGridLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item row=\"1\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"widthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >widthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>27</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Width:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"heightLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >heightLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>55</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Height:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"1\" >\n      <widget class=\"QComboBox\" name=\"colorDepthCombo\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthCombo</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"insertPolicy\" >\n        <enum>QComboBox::InsertAtBottom</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"1\" >\n      <widget class=\"QLineEdit\" name=\"nameLineEdit\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLineEdit</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>1</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"text\" >\n        <string>Untitled image</string>\n       </property>\n       <property name=\"echoMode\" >\n        <enum>QLineEdit::Normal</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>1</y>\n         <width>227</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox_2\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox_2</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>27</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"nameLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>67</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Name:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"colorDepthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>83</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Color depth:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <spacer>\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"geometry\" >\n      <rect>\n       <x>9</x>\n       <y>121</y>\n       <width>302</width>\n       <height>18</height>\n      </rect>\n     </property>\n     <property name=\"orientation\" >\n      <enum>Qt::Vertical</enum>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item>\n      <spacer>\n       <property name=\"objectName\" >\n        <string notr=\"true\" />\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>128</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"orientation\" >\n        <enum>Qt::Horizontal</enum>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"okButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >okButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>135</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>OK</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"cancelButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >cancelButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>221</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>Cancel</string>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <pixmapfunction></pixmapfunction>\n <tabstops>\n  <tabstop>nameLineEdit</tabstop>\n  <tabstop>spinBox</tabstop>\n  <tabstop>spinBox_2</tabstop>\n  <tabstop>colorDepthCombo</tabstop>\n  <tabstop>okButton</tabstop>\n  <tabstop>cancelButton</tabstop>\n </tabstops>\n <connections>\n  <connection>\n   <sender>nameLineEdit</sender>\n   <signal>returnPressed()</signal>\n   <receiver>okButton</receiver>\n   <slot>animateClick()</slot>\n   <hints>\n    <hint type=\"sourcelabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n    <hint type=\"destinationlabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/multipleinheritance/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"imagedialog.h\"\n\n#include <QApplication>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    ImageDialog *dialog = new ImageDialog;\n    dialog->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"imagedialog.h\"\n\n//! [0]\nImageDialog::ImageDialog(QWidget *parent)\n    : QDialog(parent)\n{\n    setupUi(this);\n    okButton->setAutoDefault(false);\n    cancelButton->setAutoDefault(false);\n//! [0]\n\n    colorDepthCombo->addItem(tr(\"2 colors (1 bit per pixel)\"));\n    colorDepthCombo->addItem(tr(\"4 colors (2 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"16 colors (4 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"256 colors (8 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"65536 colors (16 bits per pixel)\"));\n    colorDepthCombo->addItem(tr(\"16 million colors (24 bits per pixel)\"));\n\n    connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));\n//! [1]\n    connect(okButton, SIGNAL(clicked()), this, SLOT(checkValues()));\n}\n//! [1]\n\n//! [2]\nvoid ImageDialog::checkValues()\n{\n    if (nameLineEdit->text().isEmpty())\n        (void) QMessageBox::information(this, tr(\"No Image Name\"),\n            tr(\"Please supply a name for the image.\"), QMessageBox::Cancel);\n    else\n        accept();\n}\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef IMAGEDIALOG_H\n#define IMAGEDIALOG_H\n\n#include \"ui_imagedialog.h\"\n\n//! [0]\nclass ImageDialog : public QDialog, private Ui::ImageDialog\n{\n    Q_OBJECT\n\npublic:\n    ImageDialog(QWidget *parent = 0);\n\nprivate slots:\n    void checkValues();\n};\n//! [0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/noautoconnection/imagedialog.ui",
    "content": "<ui version=\"4.0\" >\n <comment></comment>\n <class>ImageDialog</class>\n <widget class=\"QDialog\" >\n  <property name=\"objectName\" >\n   <string notr=\"true\" >ImageDialog</string>\n  </property>\n  <property name=\"geometry\" >\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>320</width>\n    <height>180</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\" >\n   <string>Create Image</string>\n  </property>\n  <layout class=\"QVBoxLayout\" >\n   <property name=\"objectName\" >\n    <string notr=\"true\" />\n   </property>\n   <property name=\"margin\" >\n    <number>9</number>\n   </property>\n   <property name=\"spacing\" >\n    <number>6</number>\n   </property>\n   <item>\n    <layout class=\"QGridLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item row=\"1\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"widthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >widthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>27</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Width:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"heightLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >heightLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>55</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Height:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"1\" >\n      <widget class=\"QComboBox\" name=\"colorDepthCombo\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthCombo</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"insertPolicy\" >\n        <enum>QComboBox::InsertAtBottom</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"1\" >\n      <widget class=\"QLineEdit\" name=\"nameLineEdit\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLineEdit</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>1</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"text\" >\n        <string>Untitled image</string>\n       </property>\n       <property name=\"echoMode\" >\n        <enum>QLineEdit::Normal</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>1</y>\n         <width>227</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox_2\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox_2</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>27</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"nameLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>67</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Name:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"colorDepthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>83</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Color depth:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <spacer>\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"geometry\" >\n      <rect>\n       <x>9</x>\n       <y>121</y>\n       <width>302</width>\n       <height>18</height>\n      </rect>\n     </property>\n     <property name=\"orientation\" >\n      <enum>Qt::Vertical</enum>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item>\n      <spacer>\n       <property name=\"objectName\" >\n        <string notr=\"true\" />\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>128</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"orientation\" >\n        <enum>Qt::Horizontal</enum>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"okButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >okButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>135</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>OK</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"cancelButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >cancelButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>221</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>Cancel</string>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <pixmapfunction></pixmapfunction>\n <tabstops>\n  <tabstop>nameLineEdit</tabstop>\n  <tabstop>spinBox</tabstop>\n  <tabstop>spinBox_2</tabstop>\n  <tabstop>colorDepthCombo</tabstop>\n  <tabstop>okButton</tabstop>\n  <tabstop>cancelButton</tabstop>\n </tabstops>\n <connections>\n  <connection>\n   <sender>nameLineEdit</sender>\n   <signal>returnPressed()</signal>\n   <receiver>okButton</receiver>\n   <slot>animateClick()</slot>\n   <hints>\n    <hint type=\"sourcelabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n    <hint type=\"destinationlabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/noautoconnection/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"imagedialog.h\"\n\n#include <QApplication>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    ImageDialog *dialog = new ImageDialog;\n    dialog->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"imagedialog.h\"\n\nImageDialog::ImageDialog(QWidget *parent)\n    : QDialog(parent)\n{\n    ui.setupUi(this);\n\n    ui.colorDepthCombo->addItem(tr(\"2 colors (1 bit per pixel)\"));\n    ui.colorDepthCombo->addItem(tr(\"4 colors (2 bits per pixel)\"));\n    ui.colorDepthCombo->addItem(tr(\"16 colors (4 bits per pixel)\"));\n    ui.colorDepthCombo->addItem(tr(\"256 colors (8 bits per pixel)\"));\n    ui.colorDepthCombo->addItem(tr(\"65536 colors (16 bits per pixel)\"));\n    ui.colorDepthCombo->addItem(tr(\"16 million colors (24 bits per pixel)\"));\n\n    connect(ui.okButton, SIGNAL(clicked()), this, SLOT(accept()));\n    connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject()));\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef IMAGEDIALOG_H\n#define IMAGEDIALOG_H\n\n#include \"ui_imagedialog.h\"\n\nclass ImageDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    ImageDialog(QWidget *parent = 0);\n\nprivate:\n    Ui::ImageDialog ui;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/singleinheritance/imagedialog.ui",
    "content": "<ui version=\"4.0\" >\n <comment></comment>\n <class>ImageDialog</class>\n <widget class=\"QDialog\" >\n  <property name=\"objectName\" >\n   <string notr=\"true\" >ImageDialog</string>\n  </property>\n  <property name=\"geometry\" >\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>320</width>\n    <height>180</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\" >\n   <string>Create Image</string>\n  </property>\n  <layout class=\"QVBoxLayout\" >\n   <property name=\"objectName\" >\n    <string notr=\"true\" />\n   </property>\n   <property name=\"margin\" >\n    <number>9</number>\n   </property>\n   <property name=\"spacing\" >\n    <number>6</number>\n   </property>\n   <item>\n    <layout class=\"QGridLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item row=\"1\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"widthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >widthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>27</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Width:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"heightLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >heightLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>55</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Height:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"1\" >\n      <widget class=\"QComboBox\" name=\"colorDepthCombo\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthCombo</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"insertPolicy\" >\n        <enum>QComboBox::InsertAtBottom</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"1\" >\n      <widget class=\"QLineEdit\" name=\"nameLineEdit\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLineEdit</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>83</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>1</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"text\" >\n        <string>Untitled image</string>\n       </property>\n       <property name=\"echoMode\" >\n        <enum>QLineEdit::Normal</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>1</y>\n         <width>227</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"1\" >\n      <widget class=\"QSpinBox\" name=\"spinBox_2\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >spinBox_2</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>74</x>\n         <y>27</y>\n         <width>227</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"sizePolicy\" >\n        <sizepolicy>\n         <hsizetype>5</hsizetype>\n         <vsizetype>0</vsizetype>\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"buttonSymbols\" >\n        <enum>QAbstractSpinBox::UpDownArrows</enum>\n       </property>\n       <property name=\"value\" >\n        <number>32</number>\n       </property>\n       <property name=\"maximum\" >\n        <number>1024</number>\n       </property>\n       <property name=\"minimum\" >\n        <number>1</number>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"nameLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >nameLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>67</width>\n         <height>20</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Name:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"0\" >\n      <widget class=\"QLabel\" name=\"colorDepthLabel\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >colorDepthLabel</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>83</y>\n         <width>67</width>\n         <height>22</height>\n        </rect>\n       </property>\n       <property name=\"frameShape\" >\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\" >\n        <enum>QFrame::Plain</enum>\n       </property>\n       <property name=\"text\" >\n        <string>Color depth:</string>\n       </property>\n       <property name=\"textFormat\" >\n        <enum>Qt::AutoText</enum>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <spacer>\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"geometry\" >\n      <rect>\n       <x>9</x>\n       <y>121</y>\n       <width>302</width>\n       <height>18</height>\n      </rect>\n     </property>\n     <property name=\"orientation\" >\n      <enum>Qt::Vertical</enum>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item>\n      <spacer>\n       <property name=\"objectName\" >\n        <string notr=\"true\" />\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>1</x>\n         <y>1</y>\n         <width>128</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"orientation\" >\n        <enum>Qt::Horizontal</enum>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"okButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >okButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>135</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>OK</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"cancelButton\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >cancelButton</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>221</x>\n         <y>1</y>\n         <width>80</width>\n         <height>24</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>Cancel</string>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <pixmapfunction></pixmapfunction>\n <tabstops>\n  <tabstop>nameLineEdit</tabstop>\n  <tabstop>spinBox</tabstop>\n  <tabstop>spinBox_2</tabstop>\n  <tabstop>colorDepthCombo</tabstop>\n  <tabstop>okButton</tabstop>\n  <tabstop>cancelButton</tabstop>\n </tabstops>\n <connections>\n  <connection>\n   <sender>nameLineEdit</sender>\n   <signal>returnPressed()</signal>\n   <receiver>okButton</receiver>\n   <slot>animateClick()</slot>\n   <hints>\n    <hint type=\"sourcelabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n    <hint type=\"destinationlabel\" >\n     <x>-1</x>\n     <y>7</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/designer/singleinheritance/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"imagedialog.h\"\n\n#include <QApplication>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    ImageDialog *dialog = new ImageDialog;\n    dialog->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dialogs/dialogs.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0]\ndef find(self)\n\n    if !self.findDialog:\n        self.findDialog = FindDialog(self)\n        connect(findDialog, SIGNAL(\"findNext()\"), self, SLOT(\"findNext()\"))\n    \n\n    self.findDialog.show()\n    self.findDialog.raise()\n    self.findDialog.activateWindow()\n\n//! [0]\n\n//! [1]\ndef countWords(self):\n    dialog = WordCountDialog(self)\n    dialog.setWordCount(document().wordCount())\n    dialog.exec_()\n\n//! [1]\n\n//! [2]\n        mb = QMessageBox(\"Application Name\",\n                        \"Hardware failure.\\n\\nDisk error detected\\nDo you want to stop?\",\n                       QMessageBox.Question,\n                       QMessageBox.Yes | QMessageBox.Default,\n                       QMessageBox.No | QMessageBox.Escape,\n                       QMessageBox.NoButton)\n        if mb.exec() == QMessageBox.No:\n            # try again\n//! [2]\n\n//! [3]\n    progress = QProgressDialog(\"Copying files...\", \"Abort Copy\", 0, numFiles, self)\n    progress.setWindowModality(Qt.WindowModal)\n\n    for i in rang(numFiles):\n        progress.setValue(i)\n\n        if progress.wasCanceled():\n            break\n        #... copy one file\n    \n    progress.setValue(numFiles)\n//! [3]\n\n//! [4]\n# Operation constructor\ndef __init__(self, parent):\n    QObject.__init__(self, parent)\n\n    pd =  QProgressDialog(\"Operation in progress.\", \"Cancel\", 0, 100)\n    connect(pd, SIGNAL(\"canceled()\"), self, SLOT(\"cancel()\"))\n    t =  QTimer(self)\n    connect(t, SIGNAL(\"timeout()\"), self, SLOT(\"perform()\"))\n    t.start(0)\n\n//! [4] //! [5]\n\ndef perform(self):\n\n    pd.setValue(steps)\n    #... perform one percent of the operation\n    steps++\n    if steps > pd.maximum():\n        t.stop()\n\n//! [5] //! [6]\n\ndef cancel(self):\n\n    t.stop()\n    #... cleanup\n\n//! [6]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/Resources/modules.html",
    "content": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html\n    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->\n<head>\n    <title>Qt 4.0: Qt Classes by Module</title>\n    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\na:link { color: #004faf; text-decoration: none }\na:visited { color: #672967; text-decoration: none }\ntd.postheader { font-family: sans-serif }\ntr.address { font-family: sans-serif }\nbody { background: #ffffff; color: black; }</style>\n    <link rel=\"next\" href=\"qtcore.html\" />\n    <link rel=\"start\" href=\"index.html\" />\n</head>\n<body>\n<h1 align=\"center\">Qt Classes by Module</h1>\n<table align=\"center\" cellpadding=\"2\" cellspacing=\"1\" border=\"0\">\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td>QtCore</td><td>Core classes used by other modules.</td></tr>\n<tr valign=\"top\" bgcolor=\"#e0e0e0\"><td>QtGui</td><td>Graphical User Interface components</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td>QtNetwork</td><td>Classes for network programming.</td></tr>\n<tr valign=\"top\" bgcolor=\"#e0e0e0\"><td>QtOpenGL</td><td>OpenGL support classes.</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td>QtSql</td><td>Classes for database integration using SQL.</td></tr>\n<tr valign=\"top\" bgcolor=\"#e0e0e0\"><td>QtXml</td><td>Classes for handling XML.</td></tr>\n</table>\n</body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtcore.html",
    "content": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html\n    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->\n<head>\n    <title>Qt 4.0: QtCore Classes</title>\n    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\na:link { color: #004faf; text-decoration: none }\na:visited { color: #672967; text-decoration: none }\ntd.postheader { font-family: sans-serif }\ntr.address { font-family: sans-serif }\nbody { background: #ffffff; color: black; }</style>\n    <link rel=\"prev\" href=\"modules.html\" />\n    <link rel=\"contents\" href=\"modules.html\" />\n    <link rel=\"next\" href=\"qtgui.html\" />\n</head>\n<body>\n<h1 align=\"center\">QtCore Classes</h1>\n<p><table width=\"100%\">\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractEventDispatcher</b></td><td>Manages Qt's event queue, excluding GUI-related events</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractItemModel</b></td><td>The abstract interface for item model classes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractListModel</b></td><td>Abstract model that can be subclassed to create one-dimensional list models</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractTableModel</b></td><td>Abstract model that can be subclassed to create table models</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QBasicTimer</b></td><td>Timer events for </td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QBitArray</b></td><td>Array of bits</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QBuffer</b></td><td>QIODevice interface for a QByteArray</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QByteArray</b></td><td>Array of bytes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QByteArrayMatcher</b></td><td>Holds a sequence of bytes that can be quickly matched in a byte array</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCache</b></td><td>Template class that provides a cache</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QChar</b></td><td>16-bit Unicode character</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QChildEvent</b></td><td>Event parameters for child object events</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCoreApplication</b></td><td>Event loop for Qt applications</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCustomEvent</b></td><td>Support for custom events</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDataStream</b></td><td>Serialization of binary data to a QIODevice</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDate</b></td><td>Date functions</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDateTime</b></td><td>Date and time functions</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDir</b></td><td>Access to directory structures and their contents</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QEvent</b></td><td>The base class of all event classes. Event objects contain event parameters</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFile</b></td><td>Interface for reading from and writing to files</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFileEngine</b></td><td>Abstraction for accessing the filesystem</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFileEngineHandler</b></td><td>Allows custom QFileEngines to be plugged into Qt</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFileInfo</b></td><td>System-independent file information</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHash</b></td><td>Template class that provides a hash-table-based dictionary</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QIODevice</b></td><td>The base interface class of all I/O devices in Qt</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLatin1Char</b></td><td>8-bit ASCII/Latin-1 character</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLatin1String</b></td><td>Thin wrapper around an ASCII/Latin-1 encoded string literal</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLibrary</b></td><td>Loads shared libraries at runtime</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLibraryInfo</b></td><td>Information about the Qt library</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLine</b></td><td>Two-dimensional vector that uses integer point coordinates for accuracy</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLineF</b></td><td>Two-dimensional vector that uses floating point coordinates for accuracy</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLinkedList</b></td><td>Template class that provides linked lists</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QList</b></td><td>Template class that provides lists</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLocale</b></td><td>Converts between numbers and their string representations in various languages</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMap</b></td><td>Template class that provides a skip-list-based dictionary</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMetaClassInfo</b></td><td>Additional information about a class</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMetaEnum</b></td><td>Meta data about an enumerator</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMetaMember</b></td><td>Meta data about a member function</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMetaObject</b></td><td>Meta information about Qt objects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMetaProperty</b></td><td>Meta data about a property</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMetaType</b></td><td>Manages named types in the meta object system</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMimeData</b></td><td>Container for data that records information about its MIME type</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QModelIndex</b></td><td>Used to locate data in a data model</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMultiHash</b></td><td>Convenience QHash subclass that provides multi-valued hashes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMultiMap</b></td><td>Convenience QMap subclass that provides multi-valued maps</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMutex</b></td><td>Access serialization between threads</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMutexLocker</b></td><td>Convenience class that simplifies locking and unlocking mutexes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QObject</b></td><td>The base class of all Qt objects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QObjectCleanupHandler</b></td><td>Watches the lifetime of multiple QObjects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPair</b></td><td>Template class that stores a pair of items</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPersistentModelIndex</b></td><td>Used to locate data in a data model</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPluginLoader</b></td><td>Loads a plugin at runtime</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPoint</b></td><td>Defines a point in the plane</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPointF</b></td><td>Point object that uses floating point coordinates for accuracy</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPointer</b></td><td>Template class that provides guarded pointers to QObjects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QProcess</b></td><td>Used to start external programs and to communicate with them</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QQueue</b></td><td>Generic container that provides a queue</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QReadLocker</b></td><td>Convenience class that simplifies locking and unlocking read-write locks for read access</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QReadWriteLock</b></td><td>Read-write locking</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QRect</b></td><td>Defines a rectangle in the plane</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QRectF</b></td><td>Defines a rectangle in the plane using floating point coordinates for accuracy</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QRegExp</b></td><td>Pattern matching using regular expressions</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QResource</b></td><td>Access to application resource data</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSemaphore</b></td><td>General counting semaphore</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSet</b></td><td>Template class that provides a hash-table-based set</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSettings</b></td><td>Persistent platform-independent application settings</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSharedData</b></td><td>Base class for shared data objects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSharedDataPointer</b></td><td>Pointer to a shared data object</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSignal</b></td><td>Can be used to send signals for classes that do not inherit QObject</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSignalMapper</b></td><td>Bundles signals from identifiable senders</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSize</b></td><td>Defines the size of a two-dimensional object</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSizeF</b></td><td>Defines the size of a two-dimensional object using floating point values for accuracy</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSocketNotifier</b></td><td>Support for monitoring activity on a file descriptor</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStack</b></td><td>Template class that provides a stack</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QString</b></td><td>Unicode character string</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStringList</b></td><td>List of strings</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTemporaryFile</b></td><td>I/O device that operates on temporary files</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextCodec</b></td><td>Conversions between text encodings</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextCodecPlugin</b></td><td>Abstract base for custom QTextCodec plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextDecoder</b></td><td>State-based decoder</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextEncoder</b></td><td>State-based encoder</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextIStream</b></td><td>Convenience class for input streams</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextOStream</b></td><td>Convenience class for output streams</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextStream</b></td><td>Convenient interface for reading and writing text</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QThread</b></td><td>Platform-independent threads</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QThreadStorage</b></td><td>Per-thread data storage</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTime</b></td><td>Clock time functions</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTimer</b></td><td>Repetitive and single-shot timers</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTimerEvent</b></td><td>Parameters that describe a timer event</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTranslator</b></td><td>Internationalization support for text output</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTranslatorMessage</b></td><td>Translator message and its properties</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTsciiCodec</b></td><td>Conversion to and from the Tamil TSCII encoding</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QUrl</b></td><td>Convenient interface for working with URLs</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QUuid</b></td><td>Defines a Universally Unique Identifier (UUID)</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QVarLengthArray</b></td><td>Low-level variable-length array</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QVariant</b></td><td>Acts like a union for the most common Qt data types</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QVector</b></td><td>Template class that provides a dynamic array</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWaitCondition</b></td><td>Condition variable for synchronizing threads</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWriteLocker</b></td><td>Convenience class that simplifies locking and unlocking read-write locks for write access</td></tr>\n</table></p>\n</body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtgui.html",
    "content": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html\n    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->\n<head>\n    <title>Qt 4.0: QtGui Classes</title>\n    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\na:link { color: #004faf; text-decoration: none }\na:visited { color: #672967; text-decoration: none }\ntd.postheader { font-family: sans-serif }\ntr.address { font-family: sans-serif }\nbody { background: #ffffff; color: black; }</style>\n    <link rel=\"prev\" href=\"qtcore.html\" />\n    <link rel=\"contents\" href=\"modules.html\" />\n    <link rel=\"next\" href=\"qtnetwork.html\" />\n</head>\n<body>\n<h1 align=\"center\">QtGui Classes</h1>\n<p><table width=\"100%\">\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractButton</b></td><td>The abstract base class of button widgets, providing functionality common to buttons</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractItemDelegate</b></td><td>Used to display and edit data items from a model</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractItemView</b></td><td>The basic functionality for item view classes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractScrollArea</b></td><td>Scrolling area with on-demand scroll bars</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractSlider</b></td><td>Integer value within a range</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractSpinBox</b></td><td>Spinwidget and a line edit to display values</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractTextDocumentLayout</b></td><td>Abstract base class used to implement custom layouts for QTextDocuments</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAccessible</b></td><td>Enums and static functions relating to accessibility</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAccessibleInterface</b></td><td>Defines an interface that exposes information about accessible objects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAccessibleObject</b></td><td>Implements parts of the QAccessibleInterface for QObjects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAccessiblePlugin</b></td><td>Abstract base for accessibility plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAccessibleWidget</b></td><td>Implements the QAccessibleInterface for QWidgets</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAction</b></td><td>Abstract user interface action that can be inserted into widgets with QWidget::addAction()</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QActionGroup</b></td><td>Groups actions together</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QApplication</b></td><td>Manages the GUI application's control flow and main settings</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QBitmap</b></td><td>Monochrome (1-bit depth) pixmaps</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QBoxLayout</b></td><td>Lines up child widgets horizontally or vertically</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QBrush</b></td><td>Defines the fill pattern of shapes drawn by a QPainter</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QButtonGroup</b></td><td>Container to organize groups of button widgets</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCDEStyle</b></td><td>CDE look and feel</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCheckBox</b></td><td>Checkbox with a text label</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QClipboard</b></td><td>Access to the window system clipboard</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCloseEvent</b></td><td>Parameters that describe a close event</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QColor</b></td><td>Colors based on RGB or HSV values</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QColorDialog</b></td><td>Dialog widget for specifying colors</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QColorGroup</b></td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QComboBox</b></td><td>Combined button and popup list</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCommonStyle</b></td><td>Encapsulates the common Look and Feel of a GUI</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QConicalGradient</b></td><td>Used in combination with QBrush to specify a conical gradient brush</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QContextMenuEvent</b></td><td>Parameters that describe a context menu event</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCopChannel</b></td><td>Communication capabilities between several clients</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QCursor</b></td><td>Mouse cursor with an arbitrary shape</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDateTimeEdit</b></td><td>Widget for editing dates and times</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDecoration</b></td><td>Allows the appearance of the Qtopia Core Window Manager to be customized</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDecorationFactory</b></td><td>Creates QDecoration objects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDecorationPlugin</b></td><td>Abstract base for custom QDecoration plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDesktopWidget</b></td><td>Access to screen information on multi-head systems</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDial</b></td><td>Rounded range control (like a speedometer or potentiometer)</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDialog</b></td><td>The base class of dialog windows</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDirModel</b></td><td>Data model for the local filesystem</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDirectPainter</b></td><td>Direct access to the video hardware</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDockWidget</b></td><td>Widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDoubleSpinBox</b></td><td>Spin box widget that takes doubles</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDoubleValidator</b></td><td>Range checking of floating-point numbers</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDrag</b></td><td>Support for MIME-based drag and drop data transfer</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDragEnterEvent</b></td><td>Event which is sent to a widget when a drag and drop action enters it</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDragLeaveEvent</b></td><td>Event that is sent to a widget when a drag and drop action leaves it</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDragMoveEvent</b></td><td>Event which is sent while a drag and drop action is in progress</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDropEvent</b></td><td>Event which is sent when a drag and drop action is completed</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QErrorMessage</b></td><td>Error message display dialog</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFileDialog</b></td><td>Dialog that allow users to select files or directories</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFileIconProvider</b></td><td>File icon for the QDirModel class</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFileOpenEvent</b></td><td>Event that will be sent when there is a request to open a file</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFocusEvent</b></td><td>Event parameters for widget focus events</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFocusFrame</b></td><td>Focus frame which can be outside of a widget's normal paintable area</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFont</b></td><td>Font used for drawing text</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFontDatabase</b></td><td>Information about the fonts available in the underlying window system</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFontDialog</b></td><td>Dialog widget for selecting a font</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFontInfo</b></td><td>General information about fonts</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFontMetrics</b></td><td>Font metrics information</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFontMetricsF</b></td><td>Font metrics information</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFrame</b></td><td>The base class of widgets that can have a frame</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGfxDriverFactory</b></td><td>Creates QScreen objects for Qtopia Core</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGfxDriverPlugin</b></td><td>Abstract base for Qtopia Core graphics driver plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGradient</b></td><td>Used in combination with QBrush to specify gradient fills</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGridLayout</b></td><td>Lays out widgets in a grid</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGridWidget</b></td><td>Simple geometry management of its children</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGroupBox</b></td><td>Group box frame with a title</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHBoxLayout</b></td><td>Lines up widgets horizontally</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHBoxWidget</b></td><td>Horizontal geometry management for its child widgets</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHeaderView</b></td><td>Header row or header column for item views</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHideEvent</b></td><td>Event which is sent after a widget is hidden</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHoverEvent</b></td><td>Parameters that describe a mouse event</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QIcon</b></td><td>Scalable icons in different modes and states</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QIconDragEvent</b></td><td>Indicates that a main icon drag has begun</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QIconEngine</b></td><td>Abstract base class for QIcon renderers</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QIconEnginePlugin</b></td><td>Abstract base for custom QIconEngine plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QImage</b></td><td>Hardware-independent pixmap that allows direct access to the pixel data, and can be used as a paint device</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QImageIOHandler</b></td><td>Defines the common image I/O interface for all image formats in Qt</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QImageIOHandlerFactoryInterface</b></td><td>The factory interface for QImageIOPlugin</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QImageIOPlugin</b></td><td>Defines an interface for writing an image format plugin</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QImageReader</b></td><td>Format independent interface for reading images from files or other devices</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QImageWriter</b></td><td>Format independent interface for writing images to files or other devices</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QInputContext</b></td><td>Abstracts the input method dependent data and composing state</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QInputContextPlugin</b></td><td>Abstract base for custom QInputContext plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QInputDialog</b></td><td>Simple convenience dialog to get a single value from the user</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QInputEvent</b></td><td>The base class for events that describe user input</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QInputMethodEvent</b></td><td>Parameters for input method events</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QIntValidator</b></td><td>Validator that ensures a string contains a valid integer within a specified range</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QItemDelegate</b></td><td>Display and editing facilities for data items from a model</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QItemSelection</b></td><td>Manages information about selected items in a model</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QItemSelectionModel</b></td><td>Keeps track of a view's selected items</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QItemSelectionRange</b></td><td>Manages information about a range of selected items in a model</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QKbdDriverFactory</b></td><td>Creates QWSKeyboardHandler objects for Qtopia Core</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QKbdDriverPlugin</b></td><td>Abstract base for Qtopia Core keyboard driver plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QKeyEvent</b></td><td>Describes a key event</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QKeySequence</b></td><td>Encapsulates a key sequence as used by shortcuts</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLCDNumber</b></td><td>Displays a number with LCD-like digits</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLabel</b></td><td>Text or image display</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLayout</b></td><td>The base class of geometry managers</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLayoutItem</b></td><td>Abstract item that a QLayout manipulates</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLineEdit</b></td><td>One-line text editor</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QLinearGradient</b></td><td>Used in combination with QBrush to specify a linear gradient brush</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QListView</b></td><td>Default model/view implementation of a list, and of an icon view</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QListWidget</b></td><td>Item-based list widget</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QListWidgetItem</b></td><td>Item for use with the QListWidget item view class</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMacMime</b></td><td>Maps open-standard MIME to Mac flavors</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMacStyle</b></td><td>Implements an Appearance Manager style</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMainWindow</b></td><td>Main application window</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMatrix</b></td><td>2D transformations of a coordinate system</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMenu</b></td><td>Menu widget for use in menu bars, context menus, and other popup menus</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMenuBar</b></td><td>Horizontal menu bar</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMenuItem</b></td><td>Represents an item in a menu</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMessageBox</b></td><td>Modal dialog with a short message, an icon, and some buttons</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMotifPlusStyle</b></td><td>More sophisticated Motif-ish look and feel</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMotifStyle</b></td><td>Motif look and feel</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMouseDriverFactory</b></td><td>Creates QWSMouseHandler objects for Qtopia Core</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMouseDriverPlugin</b></td><td>Abstract base for Qtopia Core mouse driver plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMouseEvent</b></td><td>Parameters that describe a mouse event</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMoveEvent</b></td><td>Event parameters for move events</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QMovie</b></td><td>Convenience class for playing movies with QImageReader</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPaintDevice</b></td><td>The base class of objects that can be painted</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPaintEngine</b></td><td>Abstract definition of how QPainter draws to a given device on a given platform</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPaintEvent</b></td><td>Event parameters for paint events</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPainter</b></td><td>Does low-level painting e.g. on widgets</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPainterPath</b></td><td>Container for painting operations, enabling graphical shapes to be constructed and reused</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPalette</b></td><td>Color groups for each widget state</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPen</b></td><td>Defines how a QPainter should draw lines and outlines of shapes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPicture</b></td><td>Paint device that records and replays QPainter commands</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPictureFormatPlugin</b></td><td>Abstract base for custom picture format plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPictureIO</b></td><td>Parameters for loading and saving pictures</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPixmap</b></td><td>Off-screen, pixel-based paint device</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPixmapCache</b></td><td>Application-wide cache for pixmaps</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPlatinumStyle</b></td><td>Mac/Platinum look and feel</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPolygon</b></td><td>Vector of points</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPolygonF</b></td><td>Vector of points</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPrintEngine</b></td><td>Defines an interface for how QPrinter interacts with a given printing subsystem</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPrinter</b></td><td>Paint device that paints on a printer</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QProgressBar</b></td><td>Horizontal progress bar</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QProgressDialog</b></td><td>Feedback on the progress of a slow operation</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QProxyModel</b></td><td>Support for filtering and sorting data that is passed between another model and a view</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QPushButton</b></td><td>Command button</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QRadialGradient</b></td><td>Used in combination with QBrush to specify a radial gradient brush</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QRadioButton</b></td><td>Radio button with a text label</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QRegExpValidator</b></td><td>Used to check a string against a regular expression</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QRegion</b></td><td>Clip region for a painter</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QResizeEvent</b></td><td>Event parameters for resize events</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QRubberBand</b></td><td>Rectangle or line that can indicate a selection or a boundary</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSGIStyle</b></td><td>SGI/Irix look and feel</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QScreen</b></td><td>And its descendants manage the framebuffer and palette</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QScrollArea</b></td><td>Scrolling view onto another widget</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QScrollBar</b></td><td>Vertical or horizontal scroll bar</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSessionManager</b></td><td>Access to the session manager</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QShortcut</b></td><td>Used to create keyboard shortcuts</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QShowEvent</b></td><td>Event that is sent when a widget is shown</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSizeGrip</b></td><td>Corner-grip for resizing a top-level window</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSizePolicy</b></td><td>Layout attribute describing horizontal and vertical resizing policy</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSlider</b></td><td>Vertical or horizontal slider</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSound</b></td><td>Access to the platform audio facilities</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSpacerItem</b></td><td>Blank space in a layout</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSpinBox</b></td><td>Spin box widget</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSplashScreen</b></td><td>Splash screen that can be shown during application startup</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSplitter</b></td><td>Implements a splitter widget</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSplitterHandle</b></td><td>Handle functionality of the splitter</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStackedLayout</b></td><td>Stack of widgets where only one widget is visible at a time</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStackedWidget</b></td><td>Stack of widgets where only one widget is visible at a time</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStandardItemModel</b></td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStatusBar</b></td><td>Horizontal bar suitable for presenting status information</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyle</b></td><td>Abstract base class that encapsulates the look and feel of a GUI</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleFactory</b></td><td>Creates QStyle objects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleHintReturn</b></td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOption</b></td><td>Stores the parameters used by QStyle functions</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionButton</b></td><td>Used to describe the parameters for drawing buttons</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionComboBox</b></td><td>Used to describe the parameter for drawing a combobox</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionComplex</b></td><td>Used to hold parameters that are common to all complex controls</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionDockWidget</b></td><td>Used to describe the parameters for drawing a dock window</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionFocusRect</b></td><td>Used to describe the parameters for drawing a focus rectangle with QStyle</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionFrame</b></td><td>Used to describe the parameters for drawing a frame</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionHeader</b></td><td>Used to describe the parameters for drawing a header</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionMenuItem</b></td><td>Used to describe the parameter necessary for drawing a menu item</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionProgressBar</b></td><td>Used to describe the parameters necessary for drawing a progress bar</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionQ3DockWindow</b></td><td>Used to describe the parameters for drawing various parts of a </td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionQ3ListView</b></td><td>Used to describe the parameters for drawing a Q3ListView</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionQ3ListViewItem</b></td><td>Used to describe an item drawn in a Q3ListView</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionSlider</b></td><td>Used to describe the parameters needed for drawing a slider</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionSpinBox</b></td><td>Used to describe the parameters necessary for drawing a spin box</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionTab</b></td><td>Used to describe the parameters for drawing a tab bar</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionTitleBar</b></td><td>Used to describe the parameters for drawing a title bar</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionToolBox</b></td><td>Used to describe the parameters needed for drawing a tool box</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionToolButton</b></td><td>Used to describe the parameters for drawing a tool button</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStyleOptionViewItem</b></td><td>Used to describe the parameters used to draw an item in a view widget</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStylePainter</b></td><td>Convenience class for drawing QStyle elements inside a widget</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QStylePlugin</b></td><td>Abstract base for custom QStyle plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTabBar</b></td><td>Tab bar, e.g. for use in tabbed dialogs</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTabWidget</b></td><td>Stack of tabbed widgets</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTableView</b></td><td>Default model/view implementation of a table view</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTableWidget</b></td><td>Item-based table view with a default model</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTableWidgetItem</b></td><td>Item for use with the QTableWidget class</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTableWidgetSelectionRange</b></td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTabletEvent</b></td><td>Parameters that describe a Tablet event</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextBlock</b></td><td>Container for text fragments in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextBlockFormat</b></td><td>Formatting information for blocks of text in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextBlockGroup</b></td><td>Container for text blocks within a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextBrowser</b></td><td>Rich text browser with hypertext navigation</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextCharFormat</b></td><td>Formatting information for characters in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextCursor</b></td><td>Offers an API to access and modify QTextDocuments</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextDocument</b></td><td>Holds formatted text that can be viewed and edited using a QTextEdit</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextDocumentFragment</b></td><td>Represents a piece of formatted text from a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextEdit</b></td><td>Widget that is used to edit and display both plain and rich text</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextFormat</b></td><td>Formatting information for a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextFragment</b></td><td>Holds a piece of text in a QTextDocument with a single QTextCharFormat</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextFrame</b></td><td>Represents a frame in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextFrameFormat</b></td><td>Formatting information for frames in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextImageFormat</b></td><td>Formatting information for images in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextInlineObject</b></td><td>Represents an inline object in a QTextLayout</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextLayout</b></td><td>Used to lay out and paint a single paragraph of text</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextLength</b></td><td>Encapsulates the different types of length used in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextLine</b></td><td>Represents a line of text inside a QTextLayout</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextList</b></td><td>Decorated list of items in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextListFormat</b></td><td>Formatting information for lists in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextObject</b></td><td>Base class for different kinds of objects that can group parts of a QTextDocument together</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextOption</b></td><td>Description of general rich text properties</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextTable</b></td><td>Represents a table in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextTableCell</b></td><td>Represents the properties of a cell in a QTextTable</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTextTableFormat</b></td><td>Formatting information for tables in a QTextDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QToolBar</b></td><td>Movable panel that contains a set of controls</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QToolBarChangeEvent</b></td><td>Event that is sent whenever a the toolbar button is clicked on Mac OS X</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QToolBox</b></td><td>Column of tabbed widget items</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QToolButton</b></td><td>Quick-access button to commands or options, usually used inside a QToolBar</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QToolTip</b></td><td>Tool tips (balloon help) for any widget</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTreeView</b></td><td>Default model/view implementation of a tree view</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTreeWidget</b></td><td>Tree view that uses a predefined tree model</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTreeWidgetItem</b></td><td>Item for use with the QTreeWidget convenience class</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QVBoxLayout</b></td><td>Lines up widgets vertically</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QVBoxWidget</b></td><td>Vertical geometry management of its child widgets</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QValidator</b></td><td>Validation of input text</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWSInputMethod</b></td><td>International input methods for Qtopia Core</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWSKeyboardHandler</b></td><td>Implements the keyboard driver for Qtopia Core</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWSMouseHandler</b></td><td>Mouse driver for Qtopia Core</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWSServer</b></td><td>Server-specific functionality in Qtopia Core</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWSWindow</b></td><td>Server-specific functionality in Qtopia Core</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWhatsThis</b></td><td>Simple description of any widget, i.e. answering the question &quot;What's this?&quot;</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWhatsThisAction</b></td><td>Ready-made action to invoke &quot;What's This&quot; context help</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWheelEvent</b></td><td>Parameters that describe a wheel event</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWidget</b></td><td>The base class of all user interface objects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWidgetContainerPlugin</b></td><td>Abstract base for complex custom container QWidget plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWidgetItem</b></td><td>Layout item that represents a widget</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWidgetPlugin</b></td><td>Abstract base for custom QWidget plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWindowsMime</b></td><td>Maps open-standard MIME to Window Clipboard formats</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWindowsStyle</b></td><td>Microsoft Windows-like look and feel</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWindowsXPStyle</b></td><td>Microsoft WindowsXP-like look and feel</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QWorkspace</b></td><td>Workspace window that be used in an MDI application</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QX11Info</b></td><td>Information about the X display configuration</td></tr>\n</table></p>\n</body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtnetwork.html",
    "content": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html\n    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->\n<head>\n    <title>Qt 4.0: QtNetwork Classes</title>\n    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\na:link { color: #004faf; text-decoration: none }\na:visited { color: #672967; text-decoration: none }\ntd.postheader { font-family: sans-serif }\ntr.address { font-family: sans-serif }\nbody { background: #ffffff; color: black; }</style>\n    <link rel=\"prev\" href=\"qtgui.html\" />\n    <link rel=\"contents\" href=\"modules.html\" />\n    <link rel=\"next\" href=\"qtopengl.html\" />\n</head>\n<body>\n<h1 align=\"center\">QtNetwork Classes</h1>\n<p><table width=\"100%\">\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QAbstractSocket</b></td><td>The base functionality common to all socket types</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QFtp</b></td><td>Implementation of the FTP protocol</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHostAddress</b></td><td>IP address</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHostInfo</b></td><td>Static functions for host name lookups</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHttp</b></td><td>Implementation of the HTTP protocol</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHttpHeader</b></td><td>Header information for HTTP</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHttpRequestHeader</b></td><td>Request header information for HTTP</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QHttpResponseHeader</b></td><td>Response header information for HTTP</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTcpServer</b></td><td>TCP-based server</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QTcpSocket</b></td><td>TCP socket</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QUdpSocket</b></td><td>UDP socket</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QUrlInfo</b></td><td>Stores information about URLs</td></tr>\n</table></p>\n</body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtopengl.html",
    "content": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html\n    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->\n<head>\n    <title>Qt 4.0: QtOpenGL Classes</title>\n    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\na:link { color: #004faf; text-decoration: none }\na:visited { color: #672967; text-decoration: none }\ntd.postheader { font-family: sans-serif }\ntr.address { font-family: sans-serif }\nbody { background: #ffffff; color: black; }</style>\n    <link rel=\"prev\" href=\"qtnetwork.html\" />\n    <link rel=\"contents\" href=\"modules.html\" />\n    <link rel=\"next\" href=\"qtsql.html\" />\n</head>\n<body>\n<h1 align=\"center\">QtOpenGL Classes</h1>\n<p><table width=\"100%\">\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGLColormap</b></td><td>Used for installing custom colormaps into QGLWidgets</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGLContext</b></td><td>Encapsulates an OpenGL rendering context</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGLFormat</b></td><td>The display format of an OpenGL rendering context</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QGLWidget</b></td><td>Widget for rendering OpenGL graphics</td></tr>\n</table></p>\n</body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtsql.html",
    "content": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html\n    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->\n<head>\n    <title>Qt 4.0: QtSql Classes</title>\n    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\na:link { color: #004faf; text-decoration: none }\na:visited { color: #672967; text-decoration: none }\ntd.postheader { font-family: sans-serif }\ntr.address { font-family: sans-serif }\nbody { background: #ffffff; color: black; }</style>\n    <link rel=\"prev\" href=\"qtopengl.html\" />\n    <link rel=\"contents\" href=\"modules.html\" />\n    <link rel=\"next\" href=\"qtxml.html\" />\n</head>\n<body>\n<h1 align=\"center\">QtSql Classes</h1>\n<p><table width=\"100%\">\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlDatabase</b></td><td>Represents a connection to a database</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlDriver</b></td><td>Abstract base class for accessing specific SQL databases</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlDriverCreator</b></td><td>Template class that provides a SQL driver factory for a specific driver type</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlDriverCreatorBase</b></td><td>The base class for SQL driver factories</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlDriverPlugin</b></td><td>Abstract base for custom QSqlDriver plugins</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlError</b></td><td>SQL database error information</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlField</b></td><td>Manipulates the fields in SQL database tables and views</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlIndex</b></td><td>Functions to manipulate and describe database indexes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlQuery</b></td><td>Means of executing and manipulating SQL statements</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlQueryModel</b></td><td>Read-only data model for SQL result sets</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlRecord</b></td><td>Encapsulates a database record</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlRelation</b></td><td>Stores information about an SQL foreign key</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlRelationalDelegate</b></td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlRelationalTableModel</b></td><td>Editable data model for a single database table, with foreign key support</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlResult</b></td><td>Abstract interface for accessing data from specific SQL databases</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QSqlTableModel</b></td><td>Editable data model for a single database table</td></tr>\n</table></p>\n</body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/Resources/qtxml.html",
    "content": "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html\n    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<!-- /home/dboddie/dev/qt-4.0/doc/src/classes.qdoc -->\n<head>\n    <title>Qt 4.0: QtXml Classes</title>\n    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\na:link { color: #004faf; text-decoration: none }\na:visited { color: #672967; text-decoration: none }\ntd.postheader { font-family: sans-serif }\ntr.address { font-family: sans-serif }\nbody { background: #ffffff; color: black; }</style>\n    <link rel=\"prev\" href=\"qtsql.html\" />\n    <link rel=\"contents\" href=\"modules.html\" />\n</head>\n<body>\n<h1 align=\"center\">QtXml Classes</h1>\n<p><table width=\"100%\">\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomAttr</b></td><td>Represents one attribute of a QDomElement</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomCDATASection</b></td><td>Represents an XML CDATA section</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomCharacterData</b></td><td>Represents a generic string in the DOM</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomComment</b></td><td>Represents an XML comment</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomDocument</b></td><td>Represents an XML document</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomDocumentFragment</b></td><td>Tree of QDomNodes which is not usually a complete QDomDocument</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomDocumentType</b></td><td>The representation of the DTD in the document tree</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomElement</b></td><td>Represents one element in the DOM tree</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomEntity</b></td><td>Represents an XML entity</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomEntityReference</b></td><td>Represents an XML entity reference</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomImplementation</b></td><td>Information about the features of the DOM implementation</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomNamedNodeMap</b></td><td>Collection of nodes that can be accessed by name</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomNode</b></td><td>The base class for all the nodes in a DOM tree</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomNodeList</b></td><td>List of QDomNode objects</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomNotation</b></td><td>Represents an XML notation</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomProcessingInstruction</b></td><td>Represents an XML processing instruction</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QDomText</b></td><td>Represents text data in the parsed XML document</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlAttributes</b></td><td>XML attributes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlContentHandler</b></td><td>Interface to report the logical content of XML data</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlDTDHandler</b></td><td>Interface to report DTD content of XML data</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlDeclHandler</b></td><td>Interface to report declaration content of XML data</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlDefaultHandler</b></td><td>Default implementation of all the XML handler classes</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlEntityResolver</b></td><td>Interface to resolve external entities contained in XML data</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlErrorHandler</b></td><td>Interface to report errors in XML data</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlInputSource</b></td><td>The input data for the QXmlReader subclasses</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlLexicalHandler</b></td><td>Interface to report the lexical content of XML data</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlLocator</b></td><td>The XML handler classes with information about the parsing position within a file</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlNamespaceSupport</b></td><td>Helper class for XML readers which want to include namespace support</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlParseException</b></td><td>Used to report errors with the QXmlErrorHandler interface</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlReader</b></td><td>Interface for XML readers (i.e. parsers)</td></tr>\n<tr valign=\"top\" bgcolor=\"#f0f0f0\"><td><b>QXmlSimpleReader</b></td><td>Implementation of a simple XML parser</td></tr>\n</table></p>\n</body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/Resources/titles.txt",
    "content": "Qt Classes by Module\t\t:/Resources/modules.html\nQtCore\t\t\t\t:/Resources/qtcore.html\nQtGui\t\t\t\t:/Resources/qtgui.html\nQtNetwork\t\t\t:/Resources/qtnetwork.html\nQtOpenGL\t\t\t:/Resources/qtopengl.html\nQtSql\t\t\t\t:/Resources/qtsql.html\nQtXml\t\t\t\t:/Resources/qtxml.html\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/dockwidgets.qrc",
    "content": "<RCC>\n    <qresource>\n        <file>Resources/titles.txt</file>\n        <file>Resources/modules.html</file>\n        <file>Resources/qtcore.html</file>\n        <file>Resources/qtgui.html</file>\n        <file>Resources/qtnetwork.html</file>\n        <file>Resources/qtopengl.html</file>\n        <file>Resources/qtsql.html</file>\n        <file>Resources/qtxml.html</file>\n    </qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QMainWindow *window = new MainWindow;\n    window->show();\n    window->resize(640, 480);\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow(QWidget *parent)\n    : QMainWindow(parent)\n{\n    setWindowTitle(\"Dock Widgets\");\n\n    setupDockWindow();\n    setupContents();\n    setupMenus();\n\n    textBrowser = new QTextBrowser(this);\n\n    connect(headingList, SIGNAL(itemClicked(QListWidgetItem *)),\n            this, SLOT(updateText(QListWidgetItem *)));\n\n    updateText(headingList->item(0));\n    headingList->setCurrentRow(0);\n    setCentralWidget(textBrowser);\n}\n\nvoid MainWindow::setupContents()\n{\n    QFile titlesFile(\":/Resources/titles.txt\");\n    titlesFile.open(QFile::ReadOnly);\n    int chapter = 0;\n\n    do {\n        QString line = titlesFile.readLine().trimmed();\n        QStringList parts = line.split(\"\\t\", QString::SkipEmptyParts);\n        if (parts.size() != 2)\n            break;\n\n        QString chapterTitle = parts[0];\n        QString fileName = parts[1];\n\n        QFile chapterFile(fileName);\n\n        chapterFile.open(QFile::ReadOnly);\n        QListWidgetItem *item = new QListWidgetItem(chapterTitle, headingList);\n        item->setData(Qt::DisplayRole, chapterTitle);\n        item->setData(Qt::UserRole, chapterFile.readAll());\n        item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);\n        chapterFile.close();\n\n        chapter++;\n    } while (titlesFile.isOpen());\n\n    titlesFile.close();\n}\n\nvoid MainWindow::setupDockWindow()\n{\n//! [0]\n    contentsWindow = QDockWidget(tr(\"Table of Contents\"), self)\n    contentsWindow.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)\n    addDockWidget(Qt.LeftDockWidgetArea, contentsWindow)\n\n    headingList = QListWidget(contentsWindow)\n    contentsWindow.setWidget(headingList)\n//! [0]\n}\n\nvoid MainWindow::setupMenus()\n{\n    QAction *exitAct = new QAction(tr(\"E&xit\"), this);\n    exitAct->setShortcut(tr(\"Ctrl+Q\"));\n    exitAct->setStatusTip(tr(\"Exit the application\"));\n    connect(exitAct, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));\n\n    QMenu *fileMenu = menuBar()->addMenu(tr(\"&File\"));\n    fileMenu->addAction(exitAct);\n}\n\nvoid MainWindow::updateText(QListWidgetItem *item)\n{\n    QString text = item->data(Qt::UserRole).toString();\n    textBrowser->setHtml(text);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dockwidgets/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include <QMainWindow>\n\nclass QDockWidget;\nclass QListWidget;\nclass QListWidgetItem;\nclass QTextBrowser;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\npublic:\n    MainWindow(QWidget *parent = 0);\n\nprivate slots:\n    void updateText(QListWidgetItem *item);\n\nprivate:\n    void setupContents();\n    void setupDockWindow();\n    void setupMenus();\n\n    QDockWidget *contentsWindow;\n    QListWidget *headingList;\n    QTextBrowser *textBrowser;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/draganddrop/dragwidget.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"dragwidget.h\"\n\nDragWidget::DragWidget(QWidget *parent)\n    : QFrame(parent)\n{\n    setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);\n    dragDropLabel = new QLabel(\"\", this);\n    dragDropLabel->setAlignment(Qt::AlignHCenter);\n\n    QHBoxLayout *layout = new QHBoxLayout(this);\n    layout->addStretch(0);\n    layout->addWidget(dragDropLabel);\n    layout->addStretch(0);\n\n    setAcceptDrops(true);\n}\n\n// Accept all actions, but deal with them separately later.\n//! [0]\nvoid DragWidget::dragEnterEvent(QDragEnterEvent *event)\n{\n    event->acceptProposedAction();\n}\n//! [0]\n\n//! [1]\nvoid DragWidget::dropEvent(QDropEvent *event)\n{\n    if (event->source() == this && event->possibleActions() & Qt::MoveAction)\n        return;\n//! [1]\n\n//! [2]\n    if (event->proposedAction() == Qt::MoveAction) {\n        event->acceptProposedAction();\n        // Process the data from the event.\n//! [2]\n        emit dragResult(tr(\"The data was moved here.\"));\n//! [3]\n    } else if (event->proposedAction() == Qt::CopyAction) {\n        event->acceptProposedAction();\n        // Process the data from the event.\n//! [3]\n        emit dragResult(tr(\"The data was copied here.\"));\n//! [4]\n    } else {\n        // Ignore the drop.\n        return;\n    }\n//! [4]\n    // End of quote\n\n    emit mimeTypes(event->mimeData()->formats());\n    setData(event->mimeData()->formats()[0],\n            event->mimeData()->data(event->mimeData()->formats()[0]));\n//! [5]\n}\n//! [5]\n\n//! [6]\nvoid DragWidget::mousePressEvent(QMouseEvent *event)\n{\n    if (event->button() == Qt::LeftButton)\n        dragStartPosition = event->pos();\n}\n//! [6]\n\n//! [7]\nvoid DragWidget::mouseMoveEvent(QMouseEvent *event)\n{\n    if (!(event->buttons() & Qt::LeftButton))\n        return;\n    if ((event->pos() - dragStartPosition).manhattanLength()\n         < QApplication::startDragDistance())\n        return;\n\n    QDrag *drag = new QDrag(this);\n    QMimeData *mimeData = new QMimeData;\n\n    mimeData->setData(mimeType, data);\n    drag->setMimeData(mimeData);\n\n    Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction);\n//! [7]\n\n    switch (dropAction) {\n        case Qt::CopyAction:\n            emit dragResult(tr(\"The text was copied.\"));\n            break;\n        case Qt::MoveAction:\n            emit dragResult(tr(\"The text was moved.\"));\n            break;\n        default:\n            emit dragResult(tr(\"Unknown action.\"));\n            break;\n    }\n//! [8]\n}\n//! [8]\n\nvoid DragWidget::setData(const QString &mimetype, const QByteArray &newData)\n{\n    mimeType = mimetype;\n    data = QByteArray(newData);\n\n    dragDropLabel->setText(tr(\"%1 bytes\").arg(data.size()));\n\n    QStringList formats;\n    formats << mimetype;\n    emit mimeTypes(formats);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/draganddrop/dragwidget.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef DRAGWIDGET_H\n#define DRAGWIDGET_H\n\n#include <QByteArray>\n#include <QFrame>\n#include <QString>\n#include <QStringList>\n\nclass QComboBox;\nclass QFrame;\nclass QLabel;\nclass QTextBrowser;\n\nclass DragWidget : public QFrame\n{\n    Q_OBJECT\n\npublic:\n    DragWidget(QWidget *parent);\n    void setData(const QString &mimetype, const QByteArray &newData);\n\nsignals:\n    void dragResult(const QString &actionText);\n    void mimeTypes(const QStringList &types);\n\nprotected:\n    void dragEnterEvent(QDragEnterEvent *event);\n    void dropEvent(QDropEvent *event);\n    void mouseMoveEvent(QMouseEvent *event);\n    void mousePressEvent(QMouseEvent *event);\n\nprivate:\n    QByteArray data;\n    QLabel *dragDropLabel;\n    QPoint dragStartPosition;\n    QString mimeType;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/draganddrop/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window1 = new MainWindow;\n    MainWindow *window2 = new MainWindow;\n    window1->show();\n    window2->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/draganddrop/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"dragwidget.h\"\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow(QWidget *parent)\n    : QMainWindow(parent)\n{\n    QFrame *centralWidget = new QFrame(this);\n\n    QLabel *mimeTypeLabel = new QLabel(tr(\"MIME types:\"), centralWidget);\n    mimeTypeCombo = new QComboBox(centralWidget);\n\n    QLabel *dataLabel = new QLabel(tr(\"Amount of data (bytes):\"), centralWidget);\n    dragWidget = new DragWidget(centralWidget);\n\n    connect(dragWidget, SIGNAL(mimeTypes(const QStringList &)),\n            this, SLOT(setMimeTypes(const QStringList &)));\n    connect(dragWidget, SIGNAL(dragResult(const QString &)),\n            this, SLOT(setDragResult(const QString &)));\n\n    QVBoxLayout *mainLayout = new QVBoxLayout(centralWidget);\n    mainLayout->addWidget(mimeTypeLabel);\n    mainLayout->addWidget(mimeTypeCombo);\n    mainLayout->addSpacing(32);\n    mainLayout->addWidget(dataLabel);\n    mainLayout->addWidget(dragWidget);\n\n    statusBar();\n    dragWidget->setData(QString(\"text/plain\"), QByteArray(\"Hello world\"));\n    setCentralWidget(centralWidget);\n    setWindowTitle(tr(\"Drag and Drop\"));\n}\n\nvoid MainWindow::setDragResult(const QString &actionText)\n{\n    statusBar()->showMessage(actionText);\n}\n\nvoid MainWindow::setMimeTypes(const QStringList &types)\n{\n    mimeTypeCombo->clear();\n    mimeTypeCombo->addItems(types);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/draganddrop/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include <QMainWindow>\n#include <QPixmap>\n#include <QPoint>\n\nclass QComboBox;\nclass QLabel;\nclass QLineEdit;\nclass QMouseEvent;\nclass QTextEdit;\nclass DragWidget;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow(QWidget *parent = 0);\n\npublic slots:\n    void setDragResult(const QString &actionText);\n    void setMimeTypes(const QStringList &types);\n\nprivate:\n    QComboBox *mimeTypeCombo;\n    DragWidget *dragWidget;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dragging/images.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n   <file>images/file.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dragging/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dragging/mainwindow.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0]\ndef mousePressEvent(self, event):\n    if event.button() == Qt.LeftButton\n       && iconLabel.geometry().contains(event.pos()):\n\n//! [1]\n        drag =  QDrag(self)\n        mimeData =  QMimeData()\n\n        mimeData.setText(commentEdit.toPlainText())\n        drag.setMimeData(mimeData)\n//! [1]\n        drag.setPixmap(iconPixmap)\n\n        dropAction = drag.exec_()\n//! [0]\n\n//! [2]\n    \n\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dragging/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include <QMainWindow>\n#include <QPixmap>\n#include <QPoint>\n\nclass QLabel;\nclass QLineEdit;\nclass QMouseEvent;\nclass QTextEdit;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow(QWidget *parent = 0);\n\nprotected:\n    void mousePressEvent(QMouseEvent *event);\n\nprivate:\n    QLabel *iconLabel;\n    QLineEdit *nameEdit;\n    QPixmap iconPixmap;\n    QPoint dragStartPosition;\n    QTextEdit *commentEdit;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dropactions/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Window *window = new Window;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dropactions/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\nWindow::Window(QWidget *parent)\n    : QWidget(parent)\n{\n    QLabel *textLabel = new QLabel(tr(\"Data:\"), this);\n    textBrowser = new QTextBrowser(this);\n\n    QLabel *mimeTypeLabel = new QLabel(tr(\"MIME types:\"), this);\n    mimeTypeCombo = new QComboBox(this);\n\n    QVBoxLayout *layout = new QVBoxLayout(this);\n    layout->addWidget(textLabel);\n    layout->addWidget(textBrowser);\n    layout->addWidget(mimeTypeLabel);\n    layout->addWidget(mimeTypeCombo);\n/*\n    ...\n    setAcceptDrops(true);\n*/\n    setAcceptDrops(true);\n    setWindowTitle(tr(\"Drop Actions\"));\n}\n\nvoid Window::dragEnterEvent(QDragEnterEvent *event)\n{\n    if (event->mimeData()->hasFormat(\"text/plain\"))\n        event->acceptProposedAction();\n}\n\nvoid Window::dropEvent(QDropEvent *event)\n{\n    QMenu actionMenu(this);\n    QAction *copyAction = 0;\n    QAction *moveAction = 0;\n    QAction *linkAction = 0;\n    QAction *ignoreAction = 0;\n    if (event->possibleActions() & Qt::CopyAction)\n        copyAction = actionMenu.addAction(tr(\"Copy\"));\n    if (event->possibleActions() & Qt::MoveAction)\n        moveAction = actionMenu.addAction(tr(\"Move\"));\n    if (event->possibleActions() & Qt::LinkAction)\n        linkAction = actionMenu.addAction(tr(\"Link\"));\n    if (event->possibleActions() & Qt::IgnoreAction)\n        ignoreAction = actionMenu.addAction(tr(\"Ignore\"));\n\n    QAction *result = actionMenu.exec(QCursor::pos());\n\n    if (copyAction && result == copyAction)\n        event->setDropAction(Qt::CopyAction);\n    else if (moveAction && result == moveAction)\n        event->setDropAction(Qt::MoveAction);\n    else if (linkAction && result == linkAction)\n        event->setDropAction(Qt::LinkAction);\n    else {\n        event->setDropAction(Qt::IgnoreAction);\n        return;\n    }\n\n    textBrowser->setPlainText(event->mimeData()->text());\n    mimeTypeCombo->clear();\n    mimeTypeCombo->addItems(event->mimeData()->formats());\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dropactions/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QString>\n#include <QStringList>\n#include <QWidget>\n\nclass QComboBox;\nclass QFrame;\nclass QTextBrowser;\n\nclass Window : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    Window(QWidget *parent = 0);\n\nprotected:\n    void dragEnterEvent(QDragEnterEvent *event);\n    void dropEvent(QDropEvent *event);\n\nprivate:\n    QComboBox *mimeTypeCombo;\n    QFrame *dropFrame;\n    QTextBrowser *textBrowser;\n    QString oldText;\n    QStringList oldMimeTypes;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/droparea.cpp",
    "content": "/############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################/\n\nfrom PySide.QtGui import *\n\n\nDropArea.DropArea(QWidget *parent)\n    : QLabel(parent)\n{\n    setMinimumSize(200, 200)\n    setFrameStyle(QFrame.Sunken | QFrame::StyledPanel)\n    setAlignment(Qt.AlignCenter)\n    setAcceptDrops(True)\n    setAutoFillBackground(True)\n    clear()\n}\n\nvoid DropArea.dragEnterEvent(QDragEnterEvent *event)\n{\n    setText(tr(\"<drop content>\"))\n    setBackgroundRole(QPalette.Highlight)\n\n    event.acceptProposedAction()\n    emit changed(event.mimeData())\n}\n\nvoid DropArea.dragMoveEvent(QDragMoveEvent *event)\n{\n    event.acceptProposedAction()\n}\n\nvoid DropArea.dropEvent(QDropEvent *event)\n{\n    const QMimeData *mimeData = event.mimeData()\n\n    if (mimeData.hasImage()) {\n        setPixmap(qvariant_cast<QPixmap>(mimeData.imageData()))\n    } else if (mimeData.hasHtml()) {\n        setText(mimeData.html())\n        setTextFormat(Qt.RichText)\n    } else if (mimeData.hasText()) {\n        setText(mimeData.text())\n        setTextFormat(Qt.PlainText)\n    } else {\n        setText(tr(\"Cannot display data\"))\n    }\n\n    setBackgroundRole(QPalette.Dark)\n    event.acceptProposedAction()\n}\n\n//![0]\ndef paste(self):\n    clipboard = QApplication.clipboard()\n    mimeData = clipboard.mimeData()\n\n    if mimeData.hasImage():\n        setPixmap(mimeData.imageData())\n    elif mimeData.hasHtml():\n        setText(mimeData.html())\n        setTextFormat(Qt.RichText)\n    elif (mimeData.hasText():\n        setText(mimeData.text())\n        setTextFormat(Qt.PlainText)\n    else:\n        setText(tr(\"Cannot display data\"))\n//![0]\n\n    emit changed(mimeData)\n    setBackgroundRole(QPalette.Dark)\n    //event.acceptProposedAction()\n}\n\nvoid DropArea.dragLeaveEvent(QDragLeaveEvent *event)\n{\n    clear()\n    event.accept()\n}\n\nvoid DropArea.clear()\n{\n    setText(tr(\"<drop content>\"))\n    setBackgroundRole(QPalette.Dark)\n\n    emit changed()\n}\n\nQPixmap DropArea.extractPixmap(const QByteArray &data, const QString &format)\n{\n    QList<QByteArray> imageFormats = QImageReader.supportedImageFormats()\n    QPixmap pixmap\n\n    foreach (QByteArray imageFormat, imageFormats) {\n        if (format.mid(6) == QString(imageFormat)) {\n            pixmap.loadFromData(data, imageFormat)\n            break\n        }\n    }\n    return pixmap\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dropevents/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    Window *window = new Window;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dropevents/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\n//! [0]\nWindow::Window(QWidget *parent)\n    : QWidget(parent)\n{\n//! [0]\n    QLabel *textLabel = new QLabel(tr(\"Data:\"), this);\n    textBrowser = new QTextBrowser(this);\n\n    QLabel *mimeTypeLabel = new QLabel(tr(\"MIME types:\"), this);\n    mimeTypeCombo = new QComboBox(this);\n\n    QVBoxLayout *layout = new QVBoxLayout(this);\n    layout->addWidget(textLabel);\n    layout->addWidget(textBrowser);\n    layout->addWidget(mimeTypeLabel);\n    layout->addWidget(mimeTypeCombo);\n\n//! [1]\n    setAcceptDrops(true);\n//! [1]\n    setWindowTitle(tr(\"Drop Events\"));\n//! [2]\n}\n//! [2]\n\n//! [3]\nvoid Window::dragEnterEvent(QDragEnterEvent *event)\n{\n    if (event->mimeData()->hasFormat(\"text/plain\"))\n        event->acceptProposedAction();\n}\n//! [3]\n\n//! [4]\nvoid Window::dropEvent(QDropEvent *event)\n{\n    textBrowser->setPlainText(event->mimeData()->text());\n    mimeTypeCombo->clear();\n    mimeTypeCombo->addItems(event->mimeData()->formats());\n\n    event->acceptProposedAction();\n}\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/dropevents/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QString>\n#include <QStringList>\n#include <QWidget>\n\nclass QComboBox;\nclass QFrame;\nclass QTextBrowser;\n\nclass Window : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    Window(QWidget *parent = 0);\n\nprotected:\n    void dragEnterEvent(QDragEnterEvent *event);\n    void dropEvent(QDropEvent *event);\n\nprivate:\n    QComboBox *mimeTypeCombo;\n    QFrame *dropFrame;\n    QTextBrowser *textBrowser;\n    QString oldText;\n    QStringList oldMimeTypes;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/droprectangle/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Window *window = new Window;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/droprectangle/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\nWindow::Window(QWidget *parent)\n    : QWidget(parent)\n{\n    QLabel *textLabel = new QLabel(tr(\"Data:\"), this);\n    textBrowser = new QTextBrowser(this);\n\n    QLabel *mimeTypeLabel = new QLabel(tr(\"MIME types:\"), this);\n    mimeTypeCombo = new QComboBox(this);\n\n    dropFrame = new QFrame(this);\n    dropFrame->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);\n    QLabel *dropLabel = new QLabel(tr(\"Drop items here\"), dropFrame);\n    dropLabel->setAlignment(Qt::AlignHCenter);\n\n    QVBoxLayout *dropFrameLayout = new QVBoxLayout(dropFrame);\n    dropFrameLayout->addWidget(dropLabel);\n\n    QHBoxLayout *dropLayout = new QHBoxLayout;\n    dropLayout->addStretch(0);\n    dropLayout->addWidget(dropFrame);\n    dropLayout->addStretch(0);\n\n    QVBoxLayout *mainLayout = new QVBoxLayout(this);\n    mainLayout->addWidget(textLabel);\n    mainLayout->addWidget(textBrowser);\n    mainLayout->addWidget(mimeTypeLabel);\n    mainLayout->addWidget(mimeTypeCombo);\n    mainLayout->addSpacing(32);\n    mainLayout->addLayout(dropLayout);\n\n    setAcceptDrops(true);\n    setWindowTitle(tr(\"Drop Rectangle\"));\n}\n\n//! [0]\nvoid Window::dragMoveEvent(QDragMoveEvent *event)\n{\n    if (event->mimeData()->hasFormat(\"text/plain\")\n        && event->answerRect().intersects(dropFrame->geometry()))\n\n        event->acceptProposedAction();\n}\n//! [0]\n\nvoid Window::dropEvent(QDropEvent *event)\n{\n    textBrowser->setPlainText(event->mimeData()->text());\n    mimeTypeCombo->clear();\n    mimeTypeCombo->addItems(event->mimeData()->formats());\n\n    event->acceptProposedAction();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/droprectangle/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QString>\n#include <QStringList>\n#include <QWidget>\n\nclass QComboBox;\nclass QFrame;\nclass QTextBrowser;\n\nclass Window : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    Window(QWidget *parent = 0);\n\nprotected:\n    void dragMoveEvent(QDragMoveEvent *event);\n    void dropEvent(QDropEvent *event);\n\nprivate:\n    QComboBox *mimeTypeCombo;\n    QFrame *dropFrame;\n    QTextBrowser *textBrowser;\n    QString oldText;\n    QStringList oldMimeTypes;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/eventfilters/filterobject.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"filterobject.h\"\n\nFilterObject::FilterObject(QObject *parent)\n    : QObject(parent), target(0)\n{\n}\n\n//! [0]\nbool FilterObject::eventFilter(QObject *object, QEvent *event)\n{\n    if (object == target && event->type() == QEvent::KeyPress) {\n        QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);\n        if (keyEvent->key() == Qt::Key_Tab) {\n            // Special tab handling\n            return true;\n        } else\n            return false;\n    }\n    return false;\n}\n//! [0]\n\nvoid FilterObject::setFilteredObject(QObject *object)\n{\n    if (target)\n        target->removeEventFilter(this);\n\n    target = object;\n\n    if (target)\n        target->installEventFilter(this);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/eventfilters/filterobject.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef FILTEROBJECT_H\n#define FILTEROBJECT_H\n\n#include <QObject>\n\nclass FilterObject : public QObject\n{\n    Q_OBJECT\n\npublic:\n    FilterObject(QObject *parent = 0);\n    bool eventFilter(QObject *object, QEvent *event);\n    void setFilteredObject(QObject *object);\n\nprivate:\n    QObject *target;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/eventfilters/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QTextEdit>\n\n#include \"filterobject.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QTextEdit editor;\n    FilterObject filter;\n    filter.setFilteredObject(&editor);\n    editor.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/events/events.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QCheckBox>\n#include <QMouseEvent>\n\nclass MyCheckBox : public QCheckBox\n{\npublic:\n    void mousePressEvent(QMouseEvent *event);\n};\n\n//! [0]\nvoid MyCheckBox::mousePressEvent(QMouseEvent *event)\n{\n    if (event->button() == Qt::LeftButton) {\n        // handle left mouse button here\n    } else {\n        // pass on other buttons to base class\n        QCheckBox::mousePressEvent(event);\n    }\n}\n//! [0]\n\nclass MyWidget : public QWidget\n{\npublic:\n    bool event(QEvent *event);\n};\n\nstatic const int MyCustomEventType = 1099;\n\nclass MyCustomEvent : public QEvent\n{\npublic:\n    MyCustomEvent() : QEvent((QEvent::Type)MyCustomEventType) {}\n};\n\n//! [1]\nbool MyWidget::event(QEvent *event)\n{\n    if (event->type() == QEvent::KeyPress) {\n\tQKeyEvent *ke = static_cast<QKeyEvent *>(event);\n\tif (ke->key() == Qt::Key_Tab) {\n\t    // special tab handling here\n\t    return true;\n\t}\n    } else if (event->type() == MyCustomEventType) {\n\tMyCustomEvent *myEvent = static_cast<MyCustomEvent *>(event);\n\t// custom event handling here\n\treturn true;\n    }\n\n    return QWidget::event(event);\n}\n//! [1]\n\nint main()\n{\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/explicitlysharedemployee/employee.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"employee.h\"\n\n//! [0]\nEmployeeData::EmployeeData()\n{\n    id = -1;\n    name = 0;\n}\n//! [0]\n\n//! [1]\nEmployeeData::EmployeeData(const EmployeeData &other)\n//! [1] //! [2]\n    : QSharedData(other)\n{\n    id = other.id;\n    if (other.name) {\n        name = new QString(*other.name);\n    } else {\n        name = 0;\n    }\n}\n//! [2]\n\n//! [3]\nEmployeeData::~EmployeeData()\n//! [3] //! [4]\n{\n    delete name;\n}\n//! [4]\n\n//! [5]\nEmployee::Employee()\n//! [5] //! [6]\n{\n    d = new EmployeeData;\n}\n//! [6]\n\n//! [7]\nEmployee::Employee(int id, const QString &name)\n//! [7] //! [8]\n{\n    d = new EmployeeData;\n    setId(id);\n    setName(name);\n}\n//! [8]\n\n//! [9]\nvoid Employee::setName(const QString &name)\n//! [9] //! [10]\n{\n    if (!d->name)\n        d->name = new QString;\n    *d->name = name;\n}\n//! [10]\n\n//! [11]\nQString Employee::name() const\n//! [11] //! [12]\n{\n    if (!d->name)\n        return QString();\n    return *d->name;\n}\n//! [12]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/explicitlysharedemployee/employee.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef EMPLOYEE_H\n#define EMPLOYEE_H\n\n#include <QSharedData>\n#include <QString>\n\nclass EmployeeData : public QSharedData\n{\npublic:\n    EmployeeData();\n    EmployeeData(const EmployeeData &other);\n    ~EmployeeData();\n\n    int id;\n    QString *name;\n};\n\nclass Employee\n{\npublic:\n    Employee();\n    Employee(int id, const QString &name);\n\n    void setId(int id) { d->id = id; }\n    void setName(const QString &name);\n\n    int id() const { return d->id; }\n    QString name() const;\n\nprivate:\n    QExplicitlySharedDataPointer<EmployeeData> d;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/explicitlysharedemployee/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"employee.h\"\n\nint main()\n{\n    {\n        Employee e1(10, \"Albrecht Durer\");\n        Employee e2 = e1;\n        e1.setName(\"Hans Holbein\");\n    }\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/file/file.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QFile>\n#include <QTextStream>\n\nstatic void process_line(const QByteArray &)\n{\n}\n\nstatic void process_line(const QString &)\n{\n}\n\nstatic void noStream_snippet()\n{\n//! [0]\n    file = QFile(\"in.txt\")\n    if not file.open(QIODevice.ReadOnly | QIODevice.Text):\n        return\n\n    while not file.atEnd():\n        line = file.readLine() # A QByteArray\n        process_line(line)\n//! [0]\n}\n\nstatic void readTextStream_snippet()\n{\n//! [1]\n    file = QFile(\"in.txt\")\n    if not file.open(QIODevice.ReadOnly | QIODevice.Text):\n        return\n\n    in = QTextStream(file)\n    while not in.atEnd():\n        line = in.readLine() # A QByteArray\n        process_line(line)\n//! [1]\n}\n\nstatic void writeTextStream_snippet()\n{\n//! [2]\n    file = QFile(\"out.txt\")\n    if not file.open(QIODevice.WriteOnly | QIODevice.Text):\n        return\n\n    out = QTextStream(file)\n    out << \"The magic number is: \" << 49 << \"\\n\"\n//! [2]\n}\n\nstatic void writeTextStream_snippet()\n{\n    QFile file(\"out.dat\");\n    if (!file.open(QIODevice.WriteOnly))\n        return;\n\n    QDataStream out(&file);\n    out << \"The magic number is: \" << 49 << \"\\n\";\n}\n\nstatic void readRegularEmptyFile_snippet()\n{\n//! [3]\n    file = QFile(\"/proc/modules\")\n    if not file.open(QIODevice.ReadOnly | QIODevice.Text):\n        return\n\n    in = QTextStream(file)\n    line = in.readLine()\n    while not line.isNull():\n        process_line(line)\n        line = in.readLine()\n//! [3]\n}\n\nint main()\n{\n    lineByLine_snippet();\n    writeStream_snippet();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/filedialogurls.cpp",
    "content": "\n#include <QtGui>\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n    \n//![0]\n    QList<QUrl> urls;\n    urls << QUrl::fromLocalFile(\"/home/gvatteka/dev/qt-45\")\n         << QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::MusicLocation));\n\n    QFileDialog dialog;\n    dialog.setSidebarUrls(urls);\n    dialog.setFileMode(QFileDialog::AnyFile);\n    if(dialog.exec()) {\n        // ...\n    }\n//![0]\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/fileinfo/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QPushButton>\n#include <QFileInfo>\n#include <QDir>\n#include <QGroupBox>\n#include <QVBoxLayout>\n#include <QDebug>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n//! [0]\n    fileInfo1 = QFileInfo(\"~/examples/191697/.\")\n    fileInfo2 = QFileInfo(\"~/examples/191697/..\")\n    fileInfo3 = QFileInfo(\"~/examples/191697/main.cpp\")\n//! [0]    \n//! [1]    \n    fileInfo4 = QFileInfo(\".\")\n    fileInfo5 = QFileInfo(\"..\")\n    fileInfo6 = QFileInfo(\"main.cpp\")\n//! [1]    \n\n    qDebug() << fileInfo1.fileName();\n    qDebug() << fileInfo2.fileName();\n    qDebug() << fileInfo3.fileName();\n    qDebug() << fileInfo4.fileName();\n    qDebug() << fileInfo5.fileName();\n    qDebug() << fileInfo6.fileName();\n\n    QPushButton* button1 = new QPushButton(fileInfo1.dir().path());\n    QPushButton* button2 = new QPushButton(fileInfo2.dir().path());\n    QPushButton* button3 = new QPushButton(fileInfo3.dir().path());\n    QPushButton* button4 = new QPushButton(fileInfo4.dir().path());\n    QPushButton* button5 = new QPushButton(fileInfo5.dir().path());\n    QPushButton* button6 = new QPushButton(fileInfo6.dir().path());\n\n    QVBoxLayout* vbox = new QVBoxLayout;\n    vbox->addWidget(button1);\n    vbox->addWidget(button2);\n    vbox->addWidget(button3);\n    vbox->addWidget(button4);\n    vbox->addWidget(button5);\n    vbox->addWidget(button6);\n    vbox->addStretch(1);\n\n    QGroupBox *groupBox = new QGroupBox(\"QFileInfo::dir() test\");\n    groupBox->setLayout(vbox);\n    groupBox->show();\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/graphicssceneadditemsnippet.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nclass CustomScene : public QGraphicsScene\n{\npublic:\n    CustomScene()\n        { addItem(new QGraphicsEllipseItem(QRect(10, 10, 30, 30))); }\n\n    void drawItems(QPainter *painter, int numItems, QGraphicsItem *items[],\n                   const QStyleOptionGraphicsItem options[],\n                   QWidget *widget = 0);\n};\n\n//! [0]\nvoid CustomScene::drawItems(QPainter *painter, int numItems,\n                            QGraphicsItem *items[],\n                            const QStyleOptionGraphicsItem options[],\n                            QWidget *widget)\n{\n    for (int i = 0; i < numItems; ++i) {\n         // Draw the item\n         painter->save();\n         painter->setMatrix(items[i]->sceneMatrix(), true);\n         items[i]->paint(painter, &options[i], widget);\n         painter->restore();\n     }\n}\n//! [0]\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n\n    CustomScene scene;\n    QGraphicsView view(&scene);\n\n    view.show();\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/i18n-non-qt-class/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtCore>\n#include \"myclass.h\"\n\nint main(int argc, char *argv[])\n{\n    QCoreApplication app(argc, argv);\n\n    QTranslator translator;\n    translator.load(\":/translations/i18n-non-qt-class_\" + QLocale::system().name());\n    app.installTranslator(&translator);\n\n    MyClass instance;\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <iostream>\n#include \"myclass.h\"\n\nMyClass::MyClass()\n{\n    std::cout << tr(\"Hello Qt!\\n\").toLocal8Bit().constData();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MYCLASS_H\n#define MYCLASS_H\n\n#include <QCoreApplication>\n\n//! [0]\nclass MyClass\n{\n    Q_DECLARE_TR_FUNCTIONS(MyClass)\n\npublic:\n    MyClass();\n//! [0]\n    /* ... */\n//! [1]\n};\n//! [1]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/i18n-non-qt-class/myclass.ts",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS><TS version=\"1.1\">\n<context>\n    <name>MyClass</name>\n    <message>\n        <location filename=\"myclass.cpp\" line=\"6\"/>\n        <source>Hello Qt!\n</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n</TS>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/i18n-non-qt-class/resources.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n    <file>translations/i18n-non-qt-class_en.qm</file>\n    <file>translations/i18n-non-qt-class_fr.qm</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_en.ts",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS><TS version=\"1.1\">\n<context>\n    <name>MyClass</name>\n    <message>\n        <location filename=\"../myclass.cpp\" line=\"6\"/>\n        <source>Hello Qt!\n</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n</TS>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/i18n-non-qt-class/translations/i18n-non-qt-class_fr.ts",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS><TS version=\"1.1\" language=\"fr\">\n<context>\n    <name>MyClass</name>\n    <message>\n        <location filename=\"../myclass.cpp\" line=\"6\"/>\n        <source>Hello Qt!\n</source>\n        <translation>Bonjour Qt!\n</translation>\n    </message>\n</context>\n</TS>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/image/image.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\n        image = QImage()\n        ba = QByteArray()\n        buffer(ba)\n        buffer.open(QIODevice.WriteOnly)\n        image.save(buffer, \"PNG\") # writes image into ba in PNG format\n//! [0]\n//! [1]\n        pixmap = QPixmap()\n        bytes = QByteArray()\n        buffer(bytes)\n        buffer.open(QIODevice.WriteOnly)\n        pixmap.save(buffer, \"PNG\") # writes pixmap into bytes in PNG format\n//! [1]\n//! [2]\n        alpha = QPixmap(\"image-with-alpha.png\")\n        alphacopy = alpha\n        alphacopy.setMask(alphacopy.mask())\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/image/supportedformat.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\n\twriter = QImageWriter()\n\twriter.setFormat(\"png\")\n\tif writer.supportsOption(QImageIOHandler.Description):\n\t    print \"Png supports embedded text\"\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/inherited-slot/button.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QDebug>\n#include \"button.h\"\n\nButton::Button(QWidget *parent)\n    : QPushButton(parent)\n{\n}\n\nvoid Button::animateClick()\n{\n    qDebug() << \"Extra code goes here...\";\n    QPushButton::animateClick();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/inherited-slot/button.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QPushButton>\n\n//! [Button class with reimplemented slot]\nclass Button : public QPushButton\n{\n    Q_OBJECT\n\npublic:\n    Button(QWidget *parent = 0);\n\npublic slots:\n    void animateClick();\n};\n//! [Button class with reimplemented slot]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/inherited-slot/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QDebug>\n#include <QHBoxLayout>\n#include <QLineEdit>\n#include <QMetaMethod>\n#include <QWidget>\n#include \"button.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QWidget window;\n    QHBoxLayout *layout = new QHBoxLayout(&window);\n    QLineEdit *lineEdit = new QLineEdit;\n    Button *button = new Button;\n\n    QObject::connect(lineEdit, SIGNAL(returnPressed()), button, SLOT(animateClick()));\n\n    layout->addWidget(lineEdit);\n    layout->addWidget(button);\n    window.show();\n\n    for (int i = 0; i < button->metaObject()->methodCount(); ++i)\n        qDebug() << i << button->metaObject()->method(i).signature();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/itemselection/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  main.cpp\n\n  A simple example that shows how selections can be used directly on a model.\n  It shows the result of some selections made using a table view.\n*/\n\n#include <QApplication>\n#include <QItemSelection>\n#include <QItemSelectionModel>\n#include <QTableView>\n\n#include \"model.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n//! [0]\n    TableModel *model = new TableModel(8, 4, &app);\n\n    QTableView *table = new QTableView(0);\n    table->setModel(model);\n\n    QItemSelectionModel *selectionModel = table->selectionModel();\n//! [0] //! [1]\n    QModelIndex topLeft;\n    QModelIndex bottomRight;\n\n    topLeft = model->index(0, 0, QModelIndex());\n    bottomRight = model->index(5, 2, QModelIndex());\n//! [1]\n\n//! [2]\n    QItemSelection selection(topLeft, bottomRight);\n    selectionModel->select(selection, QItemSelectionModel::Select);\n//! [2]\n\n//! [3]\n    QItemSelection toggleSelection;\n\n    topLeft = model->index(2, 1, QModelIndex());\n    bottomRight = model->index(7, 3, QModelIndex());\n    toggleSelection.select(topLeft, bottomRight);\n\n    selectionModel->select(toggleSelection, QItemSelectionModel::Toggle);\n//! [3]\n\n//! [4]\n    QItemSelection columnSelection;\n\n    topLeft = model->index(0, 1, QModelIndex());\n    bottomRight = model->index(0, 2, QModelIndex());\n\n    columnSelection.select(topLeft, bottomRight);\n\n    selectionModel->select(columnSelection,\n        QItemSelectionModel::Select | QItemSelectionModel::Columns);\n\n    QItemSelection rowSelection;\n\n    topLeft = model->index(0, 0, QModelIndex());\n    bottomRight = model->index(1, 0, QModelIndex());\n\n    rowSelection.select(topLeft, bottomRight);\n\n    selectionModel->select(rowSelection,\n        QItemSelectionModel::Select | QItemSelectionModel::Rows);\n//! [4]\n\n    table->setWindowTitle(\"Selected items in a table model\");\n    table->show();\n    table->resize(460, 280);\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/itemselection/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MODEL_H\n#define MODEL_H\n\n#include <QAbstractTableModel>\n#include <QStringList>\n#include <QVariant>\n\nclass TableModel : public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    TableModel(int rows = 1, int columns = 1, QObject *parent = 0);\n\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n    int columnCount(const QModelIndex &parent = QModelIndex()) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation,\n                        int role = Qt::DisplayRole) const;\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    bool setData(const QModelIndex &index, const QVariant &value,\n                 int role = Qt::EditRole);\n\n    bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());\n    bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());\n\nprivate:\n    QList<QStringList> rowList;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/javastyle.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"javastyle.h\"\n#include <math.h>\n\nstatic const int windowsItemFrame        =  2;\nstatic const int windowsSepHeight        =  2;\nstatic const int windowsItemHMargin      =  3;\nstatic const int windowsItemVMargin      =  2;\nstatic const int windowsArrowHMargin     =  6;\nstatic const int windowsTabSpacing       = 12;\nstatic const int windowsCheckMarkHMargin =  2;\nstatic const int windowsRightBorder      = 15;\nstatic const int windowsCheckMarkWidth   = 12;\n\nJavaStyle::JavaStyle()\n{\n    qApp->setPalette(standardPalette());\n}\n\n\ninline QPoint JavaStyle::adjustScrollPoint(const QPoint &point,\n                    Qt::Orientation orientation,\n                    bool add) const\n{\n    int adder = add ? -1 : 1;\n    QPoint retPoint;\n\n    if (orientation == Qt::Horizontal) {\n        retPoint = QPoint(point.y() * adder, point.x());\n    } else {\n        retPoint = QPoint(point.x(), point.y() * adder);\n    }\n\n    return retPoint;\n}\n\nQPalette JavaStyle::standardPalette() const\n{\n    QPalette palette = QWindowsStyle::standardPalette();\n\n    palette.setBrush(QPalette::Active, QPalette::Button,\n                     QColor(184, 207, 229));\n    palette.setBrush(QPalette::Active, QPalette::WindowText,\n                     Qt::black);\n    palette.setBrush(QPalette::Active, QPalette::Background,\n                     QColor(238, 238, 238));\n    palette.setBrush(QPalette::Active, QPalette::Window,\n                     QColor(238 ,238, 238));\n    palette.setBrush(QPalette::Active, QPalette::Base, Qt::white);\n    palette.setBrush(QPalette::Active, QPalette::AlternateBase, QColor(238, 238, 238));\n    palette.setBrush(QPalette::Active, QPalette::Text, Qt::black);\n    palette.setBrush(QPalette::Active, QPalette::BrightText, Qt::white);\n\n    palette.setBrush(QPalette::Active, QPalette::Light, QColor(163, 184, 204)); // focusFrameColor\n    palette.setBrush(QPalette::Active, QPalette::Midlight, QColor(99, 130, 191)); // tabBarBorderColor\n    palette.setBrush(QPalette::Active, QPalette::Dark, QColor(106, 104, 100));\n    palette.setBrush(QPalette::Active, QPalette::Mid, QColor(122, 138, 153)); //defaultFrameColor\n    palette.setBrush(QPalette::Active, QPalette::Shadow, QColor(122, 138, 153)); // defaultFrame\n\n    palette.setBrush(QPalette::Active, QPalette::Highlight, QColor(184, 207, 229));\n    palette.setBrush(QPalette::Active, QPalette::HighlightedText, Qt::black);\n\n    palette.setBrush(QPalette::Inactive, QPalette::Highlight, QColor(184, 207, 229));\n    palette.setBrush(QPalette::Inactive, QPalette::HighlightedText, Qt::black);\n    \n    palette.setBrush(QPalette::Disabled, QPalette::Button,\n                     QColor(238, 238, 238));\n    palette.setBrush(QPalette::Disabled, QPalette::WindowText,\n                     QColor(153, 153, 153));\n    palette.setBrush(QPalette::Disabled, QPalette::Background, QColor(238, 238, 238));\n\n    palette.setBrush(QPalette::Inactive, QPalette::Button,\n                     QColor(184, 207, 229));\n    palette.setBrush(QPalette::Inactive, QPalette::Background,\n                     QColor(238, 238, 238));\n    palette.setBrush(QPalette::Inactive, QPalette::Window,\n                     QColor(238 ,238, 238));\n    palette.setBrush(QPalette::Inactive, QPalette::Light, QColor(163, 184, 204)); // focusFrameColor\n    palette.setBrush(QPalette::Inactive, QPalette::Midlight, QColor(99, 130, 191)); // tabBarBorderColor\n    palette.setBrush(QPalette::Inactive, QPalette::Dark,QColor(106, 104, 100));\n    palette.setBrush(QPalette::Inactive, QPalette::Mid, QColor(122, 138, 153)); //defaultFrame\n    palette.setBrush(QPalette::Inactive, QPalette::Shadow, QColor(122, 138, 153)); // defaultFrame\n\n    return palette;\n}\n\ninline void JavaStyle::drawScrollBarArrow(const QRect &rect, QPainter *painter,\n                      const QStyleOptionSlider *option,\n                      bool add) const\n{\n\n    painter->save();\n\n    Qt::Orientation orient = option->orientation;\n    QPoint offset;\n\n    if (add) {\n        if (orient == Qt::Vertical) {\n            offset = rect.bottomLeft();\n        } else {\n            offset = rect.topRight();\n        }\n    } else {\n        offset = rect.topLeft();\n    }\n\n    QPainterPath arrow;\n    arrow.moveTo(offset + adjustScrollPoint(QPoint(4, 8), orient, add));\n    arrow.lineTo(offset + adjustScrollPoint(QPoint(7, 5), orient, add));\n    arrow.lineTo(offset + adjustScrollPoint(QPoint(8, 5), orient, add));\n    arrow.lineTo(offset + adjustScrollPoint(QPoint(11, 8), orient, add));\n    arrow.lineTo(offset + adjustScrollPoint(QPoint(4, 8), orient, add));\n\n    QColor fillColor;\n    if (option->state & State_Sunken)\n        fillColor = QColor(option->palette.color(QPalette::Button));\n    else\n        fillColor = option->palette.color(QPalette::Background);\n\n    painter->fillRect(rect, fillColor);\n\n    painter->setPen(option->palette.color(QPalette::Base));\n    int adjust = option->state & State_Sunken ? 0 : 1;\n    painter->drawRect(rect.adjusted(adjust, adjust, -1, -1));\n    painter->setPen(option->palette.color(QPalette::Mid));\n    painter->drawRect(rect.adjusted(0, 0, -1, -1));\n\n    painter->setPen(option->palette.color(QPalette::WindowText));\n    painter->setBrush(option->palette.color(QPalette::WindowText));\n    painter->drawPath(arrow);\n\n    painter->restore();\n}\n\ninline QPoint JavaStyle::adjustScrollHandlePoint(Qt::Orientation orig,\n                         const QPoint &point) const\n{\n    QPoint retPoint;\n\n    if (orig == Qt::Vertical)\n        retPoint = point;\n    else\n        retPoint = QPoint(point.y(), point.x());\n\n    return retPoint;\n}\n\nvoid JavaStyle::drawControl(ControlElement control, const QStyleOption *option,\n                            QPainter *painter, const QWidget *widget) const\n{\n\n    painter->save();\n\n    switch (control) {\n        case CE_ToolBoxTabShape: {\n            const QStyleOptionToolBox *box =\n            qstyleoption_cast<const QStyleOptionToolBox *>(option);\n\n            painter->save();\n\n            if (box->direction == Qt::RightToLeft) {\n                painter->rotate(1);\n                painter->translate(box->rect.width(), -box->rect.height());\n            }\n\n            int textWidth = box->fontMetrics.width(box->text) + 20;\n\n            QPolygon innerLine;\n            innerLine << (box->rect.topLeft() + QPoint(0, 1)) <<\n                (box->rect.topLeft() + QPoint(textWidth, 1)) <<\n                (box->rect.bottomLeft() + QPoint(textWidth + 15, -3)) <<\n                (box->rect.bottomRight() + QPoint(0, -3)) <<\n                box->rect.bottomRight() <<\n                box->rect.bottomLeft() <<\n                box->rect.topLeft();\n\n            painter->setPen(box->palette.color(QPalette::Base));\n            painter->setBrush(QColor(200, 221, 242));\n            painter->drawPolygon(innerLine);\n\n            QPolygon outerLine;\n            outerLine << (box->rect.bottomRight() + QPoint(0, -3)) <<\n               box->rect.bottomRight() <<\n               box->rect.bottomLeft() <<\n               box->rect.topLeft() <<\n               (box->rect.topLeft() + QPoint(textWidth, 0)) <<\n               (box->rect.bottomLeft() + QPoint(textWidth + 15, -4)) <<\n               (box->rect.bottomRight() + QPoint(0, -4));\n\n            painter->setPen(box->palette.color(QPalette::Midlight));\n            painter->setBrush(Qt::NoBrush);\n            painter->drawPolyline(outerLine);\n\n            painter->restore();\n            break;\n        }\n        case CE_DockWidgetTitle: {\n            const QStyleOptionDockWidgetV2 *docker =\n                new QStyleOptionDockWidgetV2(\n                *qstyleoption_cast<const QStyleOptionDockWidget *>(option));\n\n            QRect rect = docker->rect;\n            QRect titleRect = rect;\n            if (docker->verticalTitleBar) {\n                QRect r = rect;\n                QSize s = r.size();\n                s.transpose();\n                r.setSize(s);\n\n                titleRect = QRect(r.left() + rect.bottom()\n                                - titleRect.bottom(),\n                                r.top() + titleRect.left() - rect.left(),\n                                titleRect.height(), titleRect.width());\n\n                painter->translate(r.left(), r.top() + r.width());\n                painter->rotate(-90);\n                painter->translate(-r.left(), -r.top());\n\n                rect = r;\n            }\n\n            QLinearGradient gradient(rect.topLeft(),\n                                     rect.bottomLeft());\n            gradient.setColorAt(1.0, QColor(191, 212, 231));\n            gradient.setColorAt(0.3, Qt::white);\n            gradient.setColorAt(0.0, QColor(221, 232, 243));\n\n            painter->setPen(Qt::NoPen);\n            painter->setBrush(gradient);\n            painter->drawRect(rect.adjusted(0, 0, -1, -1));\n\n            if (!docker->title.isEmpty()) {\n                QRect textRect = docker->fontMetrics.boundingRect(docker->title);\n                textRect.moveCenter(rect.center());\n\n                QFont font = painter->font();\n                font.setPointSize(font.pointSize() - 1);\n                painter->setFont(font);\n                painter->setPen(docker->palette.text().color());\n                painter->drawText(textRect, docker->title,\n                                  QTextOption(Qt::AlignHCenter |\n                                  Qt::AlignVCenter));\n            }\n            break;\n        }\n        case CE_RubberBand: {\n            painter->setPen(option->palette.color(QPalette::Active,\n                            QPalette::WindowText));\n            painter->drawRect(option->rect.adjusted(0, 0, -1, -1));\n            break;\n        }\n        case CE_SizeGrip: {\n            break;\n        }\n        case CE_HeaderSection: {\n            const QStyleOptionHeader *header =\n                qstyleoption_cast<const QStyleOptionHeader *>(option);\n\n            painter->setPen(Qt::NoPen);\n            painter->setBrush(option->palette.color(QPalette::Active,\n                              QPalette::Background));\n            painter->drawRect(option->rect);\n\n            painter->setPen(header->palette.color(QPalette::Mid));\n            if (header->orientation == Qt::Horizontal) {\n                if (header->position == QStyleOptionHeader::Beginning ||\n                    header->position == QStyleOptionHeader::OnlyOneSection) {\n                    painter->drawRect(header->rect.adjusted(0, 0, -1, -1));\n                    painter->setPen(header->palette.color(QPalette::Base));\n                    painter->drawLine(header->rect.bottomLeft() + QPoint(1, -1),\n                                      header->rect.topLeft() + QPoint(1, 1));\n                    painter->drawLine(header->rect.topLeft() + QPoint(1, 1),\n                                      header->rect.topRight() + QPoint(-1, 1));\n                } else {\n                    painter->drawLine(header->rect.bottomRight(),\n                                      header->rect.topRight());\n                    painter->drawLine(header->rect.topLeft(),\n                                      header->rect.topRight());\n                    painter->drawLine(header->rect.bottomLeft(),\n                                      header->rect.bottomRight());\n                    painter->setPen(option->palette.color(QPalette::Base));\n                    painter->drawLine(header->rect.bottomLeft() + QPoint(0, -1),\n                                      header->rect.topLeft() + QPoint(0, 1));\n                    painter->drawLine(header->rect.topLeft() + QPoint(1, 1),\n                                      header->rect.topRight() + QPoint(-1, 1));\n                }\n            } else { // Vertical\n                if (header->position == QStyleOptionHeader::Beginning ||\n                    header->position == QStyleOptionHeader::OnlyOneSection) {\n                    painter->drawRect(header->rect.adjusted(0, 0, -1, -1));\n                    painter->setPen(header->palette.color(QPalette::Base));\n                    painter->drawLine(header->rect.bottomLeft() + QPoint(1, -1),\n                                  header->rect.topLeft() + QPoint(1, 1));\n                    painter->drawLine(header->rect.topLeft() + QPoint(1, 1),\n                                  header->rect.topRight() + QPoint(-1, 1));\n                } else {\n                    painter->drawLine(header->rect.bottomLeft(),\n                                      header->rect.bottomRight());\n                    painter->drawLine(header->rect.topLeft(),\n                                      header->rect.bottomLeft());\n                    painter->drawLine(header->rect.topRight(),\n                                      header->rect.bottomRight());\n                    painter->setPen(header->palette.color(QPalette::Base));\n                    painter->drawLine(header->rect.topLeft(),\n                                      header->rect.topRight() + QPoint(-1, 0));\n                    painter->drawLine(header->rect.bottomLeft() + QPoint(1, -1),\n                                      header->rect.topLeft() + QPoint(1, 0));\n                }\n            }\n            break;\n        }\n        case CE_ToolBar: {\n            QRect rect = option->rect;\n\n            QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());\n            gradient.setColorAt(1.0, QColor(221, 221, 221));\n            gradient.setColorAt(0.0, QColor(241, 241, 241));\n\n            if (option->state & State_Horizontal) {\n                painter->setPen(QColor(204, 204, 204));\n                painter->setBrush(gradient);\n            } else {\n                painter->setPen(Qt::NoPen);\n                painter->setBrush(option->palette.color(QPalette::Background));\n            }\n            painter->drawRect(rect.adjusted(0, 0, -1, -1));\n            break;\n        }\n        case CE_ProgressBar: {\n            const QStyleOptionProgressBar *bar1 =\n                qstyleoption_cast<const QStyleOptionProgressBar *>(option);\n\n            QStyleOptionProgressBarV2 *bar = new QStyleOptionProgressBarV2(*bar1);\n\n            QRect rect = bar->rect;\n            if (bar->orientation == Qt::Vertical) {\n                rect = QRect(rect.left(), rect.top(), rect.height(), rect.width());\n                QMatrix m;\n                m.translate(rect.height()-1, 0);\n                m.rotate(90.0);\n                painter->setMatrix(m);\n            }\n\n            painter->setPen(bar->palette.color(QPalette::Mid));\n            painter->drawRect(rect.adjusted(0, 0, -1, -1));\n\n            QRect grooveRect = subElementRect(SE_ProgressBarGroove, bar,\n                                              widget);\n            if (bar->orientation == Qt::Vertical) {\n                grooveRect = QRect(grooveRect.left(), grooveRect.top(),\n                                   grooveRect.height(), grooveRect.width());\n            }\n\n            QStyleOptionProgressBar grooveBar = *bar;\n            grooveBar.rect = grooveRect;\n\n            drawControl(CE_ProgressBarGroove, &grooveBar, painter, widget);\n\n            QRect progressRect = subElementRect(SE_ProgressBarContents, bar,\n                                                widget);\n            if (bar->orientation == Qt::Vertical) {\n                progressRect = QRect(progressRect.left(), progressRect.top(),\n                progressRect.height(), progressRect.width());\n                progressRect.adjust(0, 0, 0, -1);\n            }\n            QStyleOptionProgressBar progressOpt = *bar;\n            progressOpt.rect = progressRect;\n            drawControl(CE_ProgressBarContents, &progressOpt, painter, widget);\n\n            QRect labelRect = subElementRect(SE_ProgressBarLabel, bar, widget);\n            if (bar->orientation == Qt::Vertical) {\n                labelRect = QRect(labelRect.left(), labelRect.top(),\n                labelRect.height(), labelRect.width());\n            }\n            QStyleOptionProgressBar subBar = *bar;\n            subBar.rect = labelRect;\n            if (bar->textVisible)\n                drawControl(CE_ProgressBarLabel, &subBar, painter, widget);\n\n            delete bar;\n            break;\n        }\n        case CE_ProgressBarGroove: {\n            painter->setBrush(option->palette.color(QPalette::Background));\n            painter->setPen(Qt::NoPen);\n            painter->drawRect(option->rect.adjusted(0, 0, -1, -1));\n\n            painter->setPen(option->palette.color(QPalette::Button));\n            painter->drawLine(option->rect.topLeft() + QPoint(0, 0),\n                              option->rect.topRight() + QPoint(0, 0));\n            break;\n        }\n        case CE_ProgressBarContents: {\n            const QStyleOptionProgressBar *bar =\n                qstyleoption_cast<const QStyleOptionProgressBar *>(option);\n            int progress = int((double(bar->progress) /\n                                double(bar->maximum - bar->minimum)) *\n                                bar->rect.width());\n\n            painter->setBrush(bar->palette.color(QPalette::Light));\n            painter->setPen(Qt::NoPen);\n            QRect progressRect = QRect(bar->rect.topLeft(), QPoint(progress,\n            bar->rect.bottom()));\n            painter->drawRect(progressRect);\n\n            painter->setPen(bar->palette.color(QPalette::Midlight));\n            painter->setBrush(Qt::NoBrush);\n\n            painter->drawLine(bar->rect.bottomLeft(), bar->rect.topLeft());\n            painter->drawLine(bar->rect.topLeft(), QPoint(progress,\n                              bar->rect.top()));\n            break;\n        }\n        case CE_ProgressBarLabel: {\n            painter->save();\n            const QStyleOptionProgressBar *bar =\n                qstyleoption_cast<const QStyleOptionProgressBar *>(option);\n\n            QRect rect = bar->rect;\n                QRect leftRect;\n\n            int progressIndicatorPos = int((double(bar->progress) /\n                    double(bar->maximum - bar->minimum)) *\n                    bar->rect.width());\n\n            QFont font;\n            font.setBold(true);\n            painter->setFont(font);\n            painter->setPen(bar->palette.color(QPalette::Midlight));\n\n            if (progressIndicatorPos >= 0 &&\n                progressIndicatorPos <= rect.width()) {\n                leftRect = QRect(bar->rect.topLeft(),\n                                 QPoint(progressIndicatorPos,\n                bar->rect.bottom()));\n            } else if (progressIndicatorPos > rect.width()) {\n                painter->setPen(bar->palette.color(QPalette::Base));\n            } else {\n                painter->setPen(bar->palette.color(QPalette::Midlight));\n            }\n\n            QRect textRect = QFontMetrics(font).boundingRect(bar->text);\n            textRect.moveCenter(option->rect.center());\n            painter->drawText(textRect, bar->text,\n                              QTextOption(Qt::AlignCenter));\n            if (!leftRect.isNull()) {\n                painter->setPen(bar->palette.color(QPalette::Base));\n                painter->setClipRect(leftRect, Qt::IntersectClip);\n                painter->drawText(textRect, bar->text,\n                                  QTextOption(Qt::AlignCenter));\n            }\n\n            painter->restore();\n            break;\n        }\n        case CE_MenuBarEmptyArea: {\n            QRect emptyArea = option->rect.adjusted(0, 0, -1, -1);\n            QLinearGradient gradient(emptyArea.topLeft(), emptyArea.bottomLeft()\n                                     - QPoint(0, 1));\n            gradient.setColorAt(0.0, option->palette.color(QPalette::Base));\n            gradient.setColorAt(1.0, QColor(223, 223, 223));\n\n            painter->setPen(QColor(238, 238, 238));\n            painter->setBrush(gradient);\n            painter->drawRect(emptyArea.adjusted(0, 0, 0, -1));\n            break;\n        }\n        case CE_MenuBarItem: {\n            if (!(option->state & State_Sunken)) {\n                QLinearGradient gradient(option->rect.topLeft(),\n                                         option->rect.bottomLeft());\n                gradient.setColorAt(0.0, Qt::white);\n                gradient.setColorAt(1.0, QColor(223, 223, 223));\n\n                painter->setPen(Qt::NoPen);\n                painter->setBrush(gradient);\n            } else {\n                painter->setBrush(option->palette.color(QPalette::Light));\n            }\n\n            painter->drawRect(option->rect);\n            if (option->state & State_Sunken) {\n                painter->setPen(option->palette.color(QPalette::Mid));\n                painter->drawRect(option->rect.adjusted(0, 0, -1, -1));\n                painter->setPen(option->palette.color(QPalette::Base));\n                painter->setBrush(Qt::NoBrush);\n                painter->drawLine(option->rect.bottomRight() + QPoint(0, -1),\n                                  option->rect.topRight() + QPoint(0, -1));\n            }\n            QCommonStyle::drawControl(control, option, painter, widget);\n            break;\n        }\n        case CE_MenuItem: {\n            const QStyleOptionMenuItem *menuItem =\n                qstyleoption_cast<const QStyleOptionMenuItem *>(option);\n\n            bool selected = menuItem->state & State_Selected;\n            bool checkable = menuItem->checkType !=\n                             QStyleOptionMenuItem::NotCheckable;\n            bool checked = menuItem->checked;\n\n            if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {\n                QPoint center = menuItem->rect.center();\n\n                painter->setPen(menuItem->palette.color(QPalette::Midlight));\n                painter->drawLine(QPoint(menuItem->rect.left() - 2, center.y()),\n                                  QPoint(menuItem->rect.right(), center.y()));\n                painter->setPen(menuItem->palette.color(QPalette::Base));\n                painter->drawLine(QPoint(menuItem->rect.left() - 2,\n                                  center.y() + 1),\n                QPoint(menuItem->rect.right(),\n                      center.y() + 1));\n\n                break;\n            }\n\n            if (selected) {\n                painter->setBrush(menuItem->palette.color(QPalette::Light));\n                painter->setPen(Qt::NoPen);\n                painter->drawRect(menuItem->rect);\n                painter->setPen(menuItem->palette.color(QPalette::Midlight));\n                painter->drawLine(menuItem->rect.topLeft(),\n                                  menuItem->rect.topRight());\n                painter->setPen(menuItem->palette.color(QPalette::Base));\n                painter->drawLine(menuItem->rect.bottomLeft(),\n                                  menuItem->rect.bottomRight());\n            }\n\n            if (checkable) {\n                QRect checkRect(option->rect.left() + 5,\n                                option->rect.center().y() - 5, 10, 10);\n                if (menuItem->checkType & QStyleOptionMenuItem::Exclusive) {\n                    QStyleOptionButton button;\n                    button.rect = checkRect;\n                    button.state = menuItem->state;\n                    if (button.state & State_Sunken)\n                        button.state ^= State_Sunken;\n                    if (checked)\n                        button.state |= State_On;\n                    button.palette = menuItem->palette;\n                    drawPrimitive(PE_IndicatorRadioButton, &button, painter,\n                              widget);\n                } else {\n                    QBrush buttonBrush = gradientBrush(option->rect);\n                    painter->setBrush(buttonBrush);\n                    painter->setPen(option->palette.color(QPalette::Mid));\n\n                    painter->drawRect(checkRect);\n\n                    if (checked) {\n                        QImage image(\":/images/checkboxchecked.png\");\n                        painter->drawImage(QPoint(option->rect.left() + 5,\n                                           option->rect.center().y() - 8), image);\n                    }\n                }\n            }\n\n            bool dis = !(menuItem->state & State_Enabled);\n            bool act = menuItem->state & State_Selected;\n            const QStyleOption *opt = option;\n            const QStyleOptionMenuItem *menuitem = menuItem;\n            int checkcol = qMax(menuitem->maxIconWidth, 20);\n            if (menuItem->icon.isNull())\n                checkcol = 0;\n\n            QPainter *p = painter;\n            QRect vCheckRect = visualRect(opt->direction, menuitem->rect,\n                                          QRect(menuitem->rect.x(),\n                                          menuitem->rect.y(),\n                                          checkcol, menuitem->rect.height()));\n            if (!menuItem->icon.isNull()) {\n                QIcon::Mode mode = dis ? QIcon::Disabled : QIcon::Normal;\n                if (act && !dis)\n                    mode = QIcon::Active;\n                QPixmap pixmap;\n                if (checked)\n                    pixmap = menuItem->icon.pixmap(\n                    pixelMetric(PM_SmallIconSize), mode, QIcon::On);\n                else\n                    pixmap = menuItem->icon.pixmap(\n                        pixelMetric(PM_SmallIconSize), mode);\n                int pixw = pixmap.width();\n                int pixh = pixmap.height();\n\n                int adjustedIcon = checkable ? 15 : 0;\n                QRect pmr(0, 0, pixw, pixh);\n                pmr.moveCenter(vCheckRect.center());\n                painter->setPen(menuItem->palette.text().color());\n                if (checkable && checked)\n                    painter->drawPixmap(QPoint(pmr.left() +\n                    adjustedIcon, pmr.top() + 1), pixmap);\n                else\n                    painter->drawPixmap(pmr.topLeft() +\n                    QPoint(adjustedIcon, 0), pixmap);\n            }\n\n            if (selected) {\n                painter->setPen(menuItem->palette.highlightedText().color());\n            } else {\n                painter->setPen(menuItem->palette.text().color());\n            }\n            int x, y, w, h;\n            menuitem->rect.getRect(&x, &y, &w, &h);\n            int tab =  menuitem->tabWidth;\n            QColor discol;\n            if (dis) {\n                discol = menuitem->palette.text().color();\n                p->setPen(discol);\n            }\n            int xm = windowsItemFrame + checkcol + windowsItemHMargin;\n            int xpos = menuitem->rect.x() + xm;\n        QRect textRect;\n        if (!menuItem->icon.isNull())\n        textRect.setRect(xpos, y + windowsItemVMargin, w - xm -\n            windowsRightBorder - tab + 1, h - 2 * windowsItemVMargin);\n        else\n        textRect.setRect(menuItem->rect.left() + 9,\n                 y + windowsItemVMargin,\n                 w - xm - windowsRightBorder - tab,\n                 h - 2 * windowsItemVMargin);\n\n        if (checkable)\n        textRect.adjust(10, 0, 10, 0);\n\n            QRect vTextRect = visualRect(opt->direction, menuitem->rect,\n                     textRect);\n            QString s = menuitem->text;\n            if (!s.isEmpty()) {\n                int t = s.indexOf(QLatin1Char('\\t'));\n                int text_flags = Qt::AlignVCenter | Qt::TextShowMnemonic |\n                 Qt::TextDontClip | Qt::TextSingleLine;\n                if (!styleHint(SH_UnderlineShortcut, menuitem, widget))\n                    text_flags |= Qt::TextHideMnemonic;\n                text_flags |= Qt::AlignLeft;\n                if (t >= 0) {\n                    QRect vShortcutRect = visualRect(opt->direction,\n                             menuitem->rect,\n                        QRect(textRect.topRight(),\n            QPoint(menuitem->rect.right(), textRect.bottom())));\n                    if (dis && !act) {\n                        p->setPen(menuitem->palette.light().color());\n                        p->drawText(vShortcutRect.adjusted(1, 1, 1, 1),\n                    text_flags,\n                    s.mid(t + 1));\n                        p->setPen(discol);\n                    }\n                    p->drawText(vShortcutRect, text_flags, s.mid(t + 1));\n                    s = s.left(t);\n                }\n                QFont font = menuitem->font;\n                if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)\n                    font.setBold(true);\n                p->setFont(font);\n                if (dis && !act) {\n                    p->setPen(menuitem->palette.light().color());\n                    p->drawText(vTextRect.adjusted(1,1,1,1), text_flags,\n                s.left(t));\n                    p->setPen(discol);\n                }\n                p->drawText(vTextRect, text_flags, s.left(t));\n            }\n\n            if (menuItem->menuItemType & QStyleOptionMenuItem::SubMenu) {\n                QPoint center = menuItem->rect.center();\n                QPoint drawStart(menuItem->rect.right() - 6, center.y() + 4);\n\n                QPainterPath arrow;\n                arrow.moveTo(drawStart);\n                arrow.lineTo(drawStart + QPoint(0, -8));\n                arrow.lineTo(drawStart + QPoint(4, -5));\n                arrow.lineTo(drawStart + QPoint(4, -4));\n                arrow.lineTo(drawStart + QPoint(0, 0));\n\n                painter->save();\n                painter->setBrush(menuItem->palette.color(QPalette::Text));\n                painter->setPen(Qt::NoPen);\n                painter->drawPath(arrow);\n                painter->restore();\n            }\n\n            break;\n        }\n        case CE_MenuVMargin: {\n            break;\n        }\n        case CE_MenuHMargin: {\n            break;\n        }\n        case CE_Splitter: {\n            drawSplitter(option, painter, option->state & State_Horizontal);\n            break;\n        }\n        case CE_ScrollBarAddPage: {\n        case CE_ScrollBarSubPage:\n            const QStyleOptionSlider *scrollBar =\n                qstyleoption_cast<const QStyleOptionSlider *>(option);\n            QRect myRect;\n            if (scrollBar->orientation == Qt::Horizontal) {\n                myRect = QRect(option->rect.topLeft(),\n                option->rect.bottomRight()).adjusted(0, 0, 1, -1);\n            } else {\n                myRect = option->rect;\n            }\n\n            painter->setPen(Qt::NoPen);\n            painter->setBrush(option->palette.color(QPalette::Background));\n            painter->drawRect(myRect);\n\n            painter->setBrush(Qt::NoBrush);\n            painter->setPen(scrollBar->palette.color(QPalette::Mid));\n            painter->drawRect(myRect.adjusted(0, 0, -1, 0));\n            painter->setPen(scrollBar->palette.color(QPalette::Button));\n            painter->drawLine(myRect.bottomLeft() + QPoint(1, 0),\n                              myRect.topLeft() + QPoint(1, 1));\n            painter->drawLine(myRect.topLeft() + QPoint(1, 1),\n                              myRect.topRight() + QPoint(-1, 1));\n            break;\n        }\n        case CE_ScrollBarSubLine: {\n            const QStyleOptionSlider *scrollBar =\n                qstyleoption_cast<const QStyleOptionSlider *>(option);\n            int scrollBarExtent = pixelMetric(PM_ScrollBarExtent);\n            QRect scrollBarSubLine = option->rect;\n\n            QRect button1;\n            QRect button2;\n\n            if (scrollBar->orientation == Qt::Horizontal) {\n                button1.setRect(scrollBarSubLine.left(), scrollBarSubLine.top(),\n                16, scrollBarExtent);\n                button2.setRect(scrollBarSubLine.right() - 15,\n                scrollBarSubLine.top(), 16, scrollBarExtent);\n            } else {\n                button1.setRect(scrollBarSubLine.left(), scrollBarSubLine.top(),\n                scrollBarExtent, 16);\n                button2.setRect(scrollBarSubLine.left(),\n                scrollBarSubLine.bottom() - 15, scrollBarExtent, 16);\n            }\n\n            painter->fillRect(button2, Qt::blue);\n\n            drawScrollBarArrow(button1, painter, scrollBar);\n            drawScrollBarArrow(button2, painter, scrollBar);\n            break;\n        }\n        case CE_ScrollBarAddLine: {\n            const QStyleOptionSlider *scrollBar =\n                qstyleoption_cast<const QStyleOptionSlider *>(option);\n            QRect button(option->rect.left(), option->rect.top(), 16, 16);\n            drawScrollBarArrow(button, painter, scrollBar, true);\n            break;\n        }\n        case CE_ScrollBarSlider: {\n            const QStyleOptionSlider *scrollBar =\n                qstyleoption_cast<const QStyleOptionSlider *>(option);\n\n            painter->setPen(scrollBar->palette.color(QPalette::Midlight));\n            painter->drawRect(scrollBar->rect.adjusted(-1, 0, -3, -1));\n\n            QPoint g1, g2;\n            if (scrollBar->orientation == Qt::Horizontal) {\n                g1 = option->rect.topLeft();\n                g2 = option->rect.bottomLeft();\n            } else {\n                g1 = option->rect.topLeft();\n                g2 = option->rect.topRight();\n            }\n\n            if (scrollBar->state & State_Enabled) {\n                QLinearGradient gradient(g1, g2);\n                gradient.setColorAt(1.0, QColor(188, 210, 230));\n                gradient.setColorAt(0.3, Qt::white);\n                gradient.setColorAt(0.0, QColor(223, 233, 243));\n                painter->setBrush(gradient);\n            } else {\n                painter->setPen(scrollBar->palette.buttonText().color());\n                painter->setBrush(scrollBar->palette.button());\n            }\n            painter->drawRect(scrollBar->rect.adjusted(0, 0, -1, -1));\n\n            int sliderLength = option->rect.height();\n            int drawPos = scrollBar->orientation == Qt::Vertical ?\n                (sliderLength / 2) + 1 : 1 - ((option->rect.width() / 2));\n\n            QPoint origin;\n            if (scrollBar->orientation == Qt::Vertical)\n                origin = option->rect.bottomLeft();\n            else\n                origin = option->rect.topLeft();\n\n            painter->setPen(scrollBar->palette.color(QPalette::Base));\n            painter->drawLine(origin + adjustScrollHandlePoint(\n                             scrollBar->orientation,\n                    QPoint(4, -drawPos)),\n                    origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(13, -drawPos)));\n            painter->drawLine(origin + adjustScrollHandlePoint(\n                        scrollBar->orientation,\n                      QPoint(4,  2 - drawPos)),\n                      origin + adjustScrollHandlePoint(\n                      scrollBar->orientation,\n                      QPoint(13, 2 - drawPos)));\n            painter->drawLine(origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(4,  4 - drawPos)),\n                    origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(13, 4 - drawPos)));\n\n            painter->setPen(option->palette.color(QPalette::Midlight));\n            painter->drawLine(origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(3, -(drawPos + 1))),\n                    origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(12, -(drawPos + 1))));\n            painter->drawLine(origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(3, 1 - drawPos)),\n                    origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(12, 1 - drawPos)));\n            painter->drawLine(origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(3, 3 - drawPos)),\n                    origin + adjustScrollHandlePoint(\n                    scrollBar->orientation,\n                    QPoint(12, 3 - drawPos)));\n\n            break;\n        }\n        case CE_TabBarTabLabel: {\n            QStyleOptionTab copy =\n                *qstyleoption_cast<const QStyleOptionTab *>(option);\n            if (copy.state & State_HasFocus)\n                copy.state ^= State_HasFocus;\n                painter->setBrush(Qt::NoBrush);\n                QWindowsStyle::drawControl(CE_TabBarTabLabel, &copy, painter,\n                                           widget);\n            break;\n        }\n        case CE_TabBarTabShape: {\n            const QStyleOptionTab *tab =\n                qstyleoption_cast<const QStyleOptionTab *>(option);\n            QRect myRect = option->rect;\n            QPoint bottomLeft, bottomRight, topLeft, topRight;\n\n            if ((tab->position == QStyleOptionTab::Beginning) ||\n                (tab->position == QStyleOptionTab::OnlyOneTab)) {\n                if (tab->shape == QTabBar::RoundedSouth ||\n                    tab->shape == QTabBar::RoundedNorth) {\n                    myRect = myRect.adjusted(2, 0, 0, 0);\n                } else {\n                    myRect = myRect.adjusted(0, 2, 0, 0);\n                }\n            }\n\n            switch (tab->shape) {\n                case QTabBar::RoundedNorth:\n                    topLeft = myRect.topLeft();\n                    topRight = myRect.topRight();\n                    bottomLeft = myRect.bottomLeft();\n                    bottomRight = myRect.bottomRight();\n                    break;\n                case QTabBar::RoundedSouth:\n                    topLeft = myRect.bottomLeft();\n                    topRight = myRect.bottomRight();\n                    bottomLeft = myRect.topLeft();\n                    bottomRight = myRect.topRight();\n                    break;\n                case QTabBar::RoundedWest:\n                    topLeft = myRect.topLeft();\n                    topRight = myRect.bottomLeft();\n                    bottomLeft = myRect.topRight();\n                    bottomRight = myRect.bottomRight();\n                    break;\n                case QTabBar::RoundedEast:\n                    topLeft = myRect.topRight();\n                    topRight = myRect.bottomRight();\n                    bottomLeft = myRect.topLeft();\n                    bottomRight = myRect.bottomLeft();\n                    break;\n                default:\n                    ;\n            }\n\n            QPainterPath outerPath;\n            outerPath.moveTo(bottomLeft + adjustTabPoint(QPoint(0, -2),\n                             tab->shape));\n            outerPath.lineTo(bottomLeft + adjustTabPoint(QPoint(0, -14),\n                             tab->shape));\n            outerPath.lineTo(topLeft + adjustTabPoint(QPoint(6 , 0),\n                             tab->shape));\n            outerPath.lineTo(topRight + adjustTabPoint(QPoint(0, 0),\n                             tab->shape));\n            outerPath.lineTo(bottomRight + adjustTabPoint(QPoint(0, -2),\n                             tab->shape));\n\n            if (tab->state & State_Selected ||\n                tab->position == QStyleOptionTab::OnlyOneTab) {\n                QPainterPath innerPath;\n                innerPath.moveTo(topLeft + adjustTabPoint(QPoint(6, 2),\n                                 tab->shape));\n                innerPath.lineTo(topRight + adjustTabPoint(QPoint(-1, 2),\n                                 tab->shape));\n                innerPath.lineTo(bottomRight + adjustTabPoint(QPoint(-1 , -2),\n                                 tab->shape));\n                innerPath.lineTo(bottomLeft + adjustTabPoint(QPoint(2 , -2),\n                                 tab->shape));\n                innerPath.lineTo(bottomLeft + adjustTabPoint(QPoint(2 , -14),\n                                 tab->shape));\n                innerPath.lineTo(topLeft + adjustTabPoint(QPoint(6, 2),\n                                 tab->shape));\n\n                QPainterPath whitePath;\n                whitePath.moveTo(bottomLeft + adjustTabPoint(QPoint(1, -2),\n                                 tab->shape));\n                whitePath.lineTo(bottomLeft + adjustTabPoint(QPoint(1, -14),\n                                 tab->shape));\n                whitePath.lineTo(topLeft + adjustTabPoint(QPoint(6, 1),\n                                 tab->shape));\n                whitePath.lineTo(topRight + adjustTabPoint(QPoint(-1, 1),\n                                 tab->shape));\n\n                painter->setPen(tab->palette.color(QPalette::Midlight));\n                painter->setBrush(QColor(200, 221, 242));\n                painter->drawPath(outerPath);\n                painter->setPen(QColor(200, 221, 242));\n                painter->drawRect(QRect(bottomLeft + adjustTabPoint( \n                                        QPoint(2, -3), tab->shape),\n                                        bottomRight + adjustTabPoint(\n                                        QPoint(-2, 0), tab->shape)));\n                painter->setPen(tab->palette.color(QPalette::Base));\n                painter->setBrush(Qt::NoBrush);\n                painter->drawPath(whitePath);\n\n                if (option->state & State_HasFocus) { \n                    painter->setPen(option->palette.color(QPalette::Mid));\n                    painter->drawPath(innerPath);\n                }\n            } else {\n                painter->setPen(tab->palette.color(QPalette::Mid));\n                painter->drawPath(outerPath);\n            }\n            break;\n        }\n        case CE_PushButtonLabel:\n            painter->save();\n\n            if (const QStyleOptionButton *button =\n                qstyleoption_cast<const QStyleOptionButton *>(option)) {\n                QRect ir = button->rect;\n                uint tf = Qt::AlignVCenter | Qt::TextShowMnemonic;\n                if (!styleHint(SH_UnderlineShortcut, button, widget))\n                    tf |= Qt::TextHideMnemonic;\n\n                if (!button->icon.isNull()) {\n                    QPoint point;\n\n                    QIcon::Mode mode = button->state & State_Enabled ? QIcon::Normal\n                                                                  : QIcon::Disabled;\n                    if (mode == QIcon::Normal && button->state & State_HasFocus)\n                        mode = QIcon::Active;\n                    QIcon::State state = QIcon::Off;\n                    if (button->state & State_On)\n                        state = QIcon::On;\n\n                    QPixmap pixmap = button->icon.pixmap(button->iconSize, mode,\n                             state);\n                    int w = pixmap.width();\n                    int h = pixmap.height();\n\n                    if (!button->text.isEmpty())\n                        w += button->fontMetrics.width(button->text) + 2;\n\n                    point = QPoint(ir.x() + ir.width() / 2 - w / 2,\n                                   ir.y() + ir.height() / 2 - h / 2);\n\n                    if (button->direction == Qt::RightToLeft)\n                        point.rx() += pixmap.width();\n\n                    painter->drawPixmap(visualPos(button->direction, button->rect,\n                              point), pixmap);\n\n                    if (button->direction == Qt::RightToLeft)\n                        ir.translate(-point.x() - 2, 0);\n                    else\n                        ir.translate(point.x() + pixmap.width(), 0);\n\n                    if (!button->text.isEmpty())\n                        tf |= Qt::AlignLeft;\n\n                } else {\n                    tf |= Qt::AlignHCenter;\n                }\n\n                if (button->fontMetrics.height() > 14)\n                    ir.translate(0, 1);\n\n                drawItemText(painter, ir, tf, button->palette, (button->state &\n                                 State_Enabled),\n                             button->text, QPalette::ButtonText);\n            }\n\n            painter->restore();\n            break;\n\n        default:\n            QWindowsStyle::drawControl(control, option, painter, widget);\n    }\n    painter->restore();\n}\n\ninline QPoint JavaStyle::adjustTabPoint(const QPoint &point,\n                                        QTabBar::Shape shape) const\n{\n    QPoint rPoint;\n\n    switch (shape) {\n        case QTabBar::RoundedWest:\n            rPoint = QPoint(point.y(), point.x());\n            break;\n        case QTabBar::RoundedSouth:\n            rPoint = QPoint(point.x(), point.y() * -1);\n            break;\n        case QTabBar::RoundedEast:\n            rPoint = QPoint(point.y() * -1, point.x());\n            break;\n        default:\n            rPoint = point;\n    }\n    return rPoint;\n}\n\nQRect JavaStyle::subControlRect(ComplexControl control,\n                                const QStyleOptionComplex *option,\n                                SubControl subControl,\n                                const QWidget *widget) const\n{\n    QRect rect = QWindowsStyle::subControlRect(control, option, subControl,\n                                               widget);\n\n    switch (control) {\n        case CC_TitleBar: {\n            const QStyleOptionTitleBar *bar =\n            qstyleoption_cast<const QStyleOptionTitleBar *>(option);\n\n            switch (subControl) {\n                case SC_TitleBarMinButton: {\n                    rect = QRect(bar->rect.topRight() + QPoint(-68, 2),\n                    QSize(15, 15));\n                    break;\n                }\n                case SC_TitleBarMaxButton: {\n                    rect = QRect(bar->rect.topRight() + QPoint(-43, 3),\n                                 QSize(15, 15));\n                    break;\n                }\n                case SC_TitleBarCloseButton: {\n                    rect = QRect(bar->rect.topRight() + QPoint(-18, 3),\n                                 QSize(15, 15));\n                    break;\n                }\n                case SC_TitleBarLabel: {\n                    QRect labelRect = bar->fontMetrics.boundingRect(bar->text);\n                    rect = labelRect;\n                    rect.translate(bar->rect.left() + 30, 0);\n                    rect.moveTop(bar->rect.top());\n                    rect.adjust(0, 2, 2, 2);\n                    break;\n                }\n                case SC_TitleBarSysMenu: {\n                    rect = QRect(bar->rect.topLeft() + QPoint(6, 3),\n                                 QSize(16, 16));\n                    break;\n                }\n                default:\n                    ;\n            }\n            break;\n        }\n        case CC_GroupBox: {\n            const QStyleOptionGroupBox *box =\n                qstyleoption_cast<const QStyleOptionGroupBox *>(option);\n            bool hasCheckbox = box->subControls & SC_GroupBoxCheckBox;\n            int checkAdjust = 13;\n\n            QRect textRect = box->fontMetrics.boundingRect(box->text);\n\n            switch (subControl) {\n                case SC_GroupBoxFrame: {\n                    rect = box->rect;\n                    break;\n                }\n                case SC_GroupBoxCheckBox: {\n                    if (hasCheckbox) {\n                        rect = QRect(box->rect.topLeft() + QPoint(7, 4 +\n                                     (textRect.height() / 2 - checkAdjust / 2)),\n                        QSize(checkAdjust, checkAdjust));\n                    }\n                    else {\n                        rect = QRect();\n                    }\n                    break;\n                }\n                case SC_GroupBoxLabel: {\n                    rect = QRect(box->rect.topLeft() + QPoint(7 + (hasCheckbox ?\n                    checkAdjust + 2 : 0), 4), textRect.size());\n                    break;\n                }\n                case SC_GroupBoxContents: {\n                    rect = box->rect.adjusted(10, 10 + textRect.height(), -10,\n                                              -10);\n                    break;\n                }\n                default:\n                    ;\n            }\n            break;\n        }\n        case CC_SpinBox: {\n            const QStyleOptionSpinBox *spinBox =\n            qstyleoption_cast<const QStyleOptionSpinBox *>(option);\n            int spinnerWidth = 16;\n            QRect myRect = spinBox->rect;\n            QPoint center = myRect.center();\n            int frameWidth = pixelMetric(PM_SpinBoxFrameWidth, spinBox, widget);\n\n            switch (subControl) {\n                case SC_SpinBoxUp: {\n                    rect = QRect(myRect.topRight() + QPoint(-16, 0),\n                    QSize(16, center.y() - myRect.topRight().y()));\n                    break;\n                }\n                case SC_SpinBoxDown: {\n                    rect = QRect(QPoint(myRect.bottomRight().x() - 16,\n                                 center.y() + 1),\n                                 QSize(16, myRect.bottomRight().y() -\n                                       center.y() - 1));\n                    break;\n                }\n                case SC_SpinBoxFrame: {\n                    rect = QRect(myRect.topLeft(), myRect.bottomRight() +\n                                 QPoint(-16, 0));\n                    break;\n                }\n                case SC_SpinBoxEditField: {\n                    rect = QRect(myRect.topLeft() + QPoint(2, 2),\n                    myRect.bottomRight() + QPoint(-15 - frameWidth, -2));\n                    break;\n                }\n                default:\n                    ;\n            }\n            break;\n        }\n        case CC_ToolButton: {\n            const QStyleOptionToolButton *button =\n                qstyleoption_cast<const QStyleOptionToolButton *>(option);\n\n            switch (subControl) {\n                case SC_ToolButton: {\n                    rect = option->rect.adjusted(1, 1, -1, -1);\n                    break;\n                }\n                case SC_ToolButtonMenu: {\n                    rect = QRect(option->rect.bottomRight() +\n                                 QPoint(-11, -11), QSize(10, 10));\n                    break;\n                }\n            }\n            break;\n        }\n        case CC_ComboBox: {\n            const QStyleOptionComboBox *combo =\n                qstyleoption_cast<const QStyleOptionComboBox *>(option);\n\n            bool reverse = combo->direction == Qt::RightToLeft;\n\n            switch (subControl) {\n                case SC_ComboBoxFrame:\n                    rect = combo->rect;\n                    break;\n                case SC_ComboBoxArrow:\n                    if (reverse) {\n                        rect = QRect(combo->rect.topLeft(),\n                        combo->rect.bottomLeft() + QPoint(17, 0));\n                    } else {\n                        rect = QRect(combo->rect.topRight() + QPoint(-17, 0),\n                        combo->rect.bottomRight());\n                    }\n                    break;\n                case SC_ComboBoxEditField:\n                    if (reverse) {\n                        rect = QRect(combo->rect.topLeft() + QPoint(19, 2),\n                        combo->rect.bottomRight() + QPoint(-2, 2));\n                    } else {\n                        rect = QRect(combo->rect.topLeft() + QPoint(2, 2),\n                        combo->rect.bottomRight() + QPoint(-19, -2));\n                    }\n                    break;\n                case SC_ComboBoxListBoxPopup:\n                    rect = combo->rect;\n                    break;\n            }\n            break;\n        }\n        case CC_ScrollBar: {\n            const QStyleOptionSlider *scrollBar =\n                qstyleoption_cast<const QStyleOptionSlider *>(option);\n            int scrollBarExtent = pixelMetric(PM_ScrollBarExtent, scrollBar,\n                          widget);\n            int sliderMaxLength = ((scrollBar->orientation == Qt::Horizontal) ?\n                                   scrollBar->rect.width() :\n                                    scrollBar->rect.height()) - (16 * 3);\n            int sliderMinLength = pixelMetric(PM_ScrollBarSliderMin, scrollBar,\n                                              widget);\n            int sliderLength;\n\n            if (scrollBar->maximum != scrollBar->minimum) {\n                uint valueRange = scrollBar->maximum - scrollBar->minimum;\n                sliderLength = (scrollBar->pageStep * sliderMaxLength) /\n                (valueRange + scrollBar->pageStep);\n\n                if (sliderLength < sliderMinLength || valueRange > INT_MAX / 2)\n                    sliderLength = sliderMinLength;\n                if (sliderLength > sliderMaxLength)\n                    sliderLength = sliderMaxLength;\n            } else {\n                sliderLength = sliderMaxLength;\n            }\n            int sliderStart = 16 + sliderPositionFromValue(scrollBar->minimum,\n                                                           scrollBar->maximum,\n                                                    scrollBar->sliderPosition,\n                                                sliderMaxLength - sliderLength,\n                                                        scrollBar->upsideDown);\n            QRect scrollBarRect = scrollBar->rect;\n\n            switch (subControl) {\n                case SC_ScrollBarSubLine:\n                    if (scrollBar->orientation == Qt::Horizontal) {\n                        rect.setRect(scrollBarRect.left(), scrollBarRect.top(),\n                        scrollBarRect.width() - 16, scrollBarExtent);\n                    } else {\n                        rect.setRect(scrollBarRect.left(), scrollBarRect.top(),\n                        scrollBarExtent, scrollBarRect.height() - 16);\n                    }\n                    break;\n                case SC_ScrollBarAddLine:\n                    if (scrollBar->orientation == Qt::Horizontal) {\n                        rect.setRect(scrollBarRect.right() - 15,\n                        scrollBarRect.top(), 16, scrollBarExtent);\n                    } else {\n                        rect.setRect(scrollBarRect.left(), scrollBarRect.bottom()\n                                     - 15, scrollBarExtent, 16);\n                    }\n                    break;\n                case SC_ScrollBarSubPage:\n                    if (scrollBar->orientation == Qt::Horizontal) {\n                        rect.setRect(scrollBarRect.left() + 16, scrollBarRect.top(),\n                                     sliderStart - (scrollBarRect.left() + 16),\n                                     scrollBarExtent);\n                    } else {\n                        rect.setRect(scrollBarRect.left(), scrollBarRect.top() + 16,\n                                     scrollBarExtent,\n                        sliderStart - (scrollBarRect.left() + 16));\n                    }\n                    break;\n                case SC_ScrollBarAddPage:\n                    if (scrollBar->orientation == Qt::Horizontal)\n                        rect.setRect(sliderStart + sliderLength, 0,\n                                     sliderMaxLength - sliderStart -\n                        sliderLength + 16, scrollBarExtent);\n                    else\n                        rect.setRect(0, sliderStart + sliderLength,\n                                     scrollBarExtent, sliderMaxLength -\n                    sliderStart - sliderLength + 16);\n                    break;\n                case SC_ScrollBarGroove:\n                    if (scrollBar->orientation == Qt::Horizontal) {\n                        rect = scrollBarRect.adjusted(16, 0, -32, 0);\n                    } else {\n                        rect = scrollBarRect.adjusted(0, 16, 0, -32);\n                    }\n                    break;\n                case SC_ScrollBarSlider:\n                    if (scrollBar->orientation == Qt::Horizontal) {\n                        rect.setRect(sliderStart, 0, sliderLength,\n                                     scrollBarExtent);\n                    } else {\n                        rect.setRect(0, sliderStart, scrollBarExtent,\n                                     sliderLength);\n                    }\n                    break;\n                default:\n                    return QWindowsStyle::subControlRect(control, option,\n                                                         subControl, widget);\n            }\n            break;\n        }\n        case CC_Slider: {\n            const QStyleOptionSlider *slider =\n                qstyleoption_cast<const QStyleOptionSlider *>(option);\n            rect = slider->rect;\n            int tickSize = pixelMetric(PM_SliderTickmarkOffset, option, widget);\n            int handleSize = pixelMetric(PM_SliderControlThickness, option,\n                                         widget);\n\n            int dist = slider->orientation == Qt::Vertical ? slider->rect.height() :\n                                              slider->rect.width();\n            int pos = QStyle::sliderPositionFromValue(slider->minimum,\n                slider->maximum, slider->sliderValue, dist - handleSize);\n\n            switch (subControl) {\n                case SC_SliderGroove: {\n                    QPoint center = rect.center();\n\n                    if (slider->orientation == Qt::Horizontal) {\n                        rect.setHeight(handleSize);\n                        if (slider->tickPosition == QSlider::TicksBelow) {\n                            center.ry() -= tickSize;\n                        }\n                    } else {\n                        rect.adjust(0, 0, 0, 0);\n                        rect.setWidth(handleSize);\n                        if (slider->tickPosition == QSlider::TicksBelow) {\n                            center.rx() -= tickSize;\n                        }\n                    }\n                    rect.moveCenter(center);\n                    break;\n                }\n                case SC_SliderHandle: {\n                    QPoint center = rect.center();\n\n                    if (slider->orientation == Qt::Horizontal) {\n                        rect.setHeight(handleSize);\n                        if (slider->tickPosition == QSlider::TicksBelow) {\n                            center.ry() -= tickSize;\n                        }\n\n                        rect.moveCenter(center);\n\n                        if (slider->upsideDown)\n                            rect.setLeft(slider->rect.right() -\n                                         pos - (handleSize - 1));\n                        else\n                            rect.setLeft(pos);\n\n                        rect.setWidth(handleSize - 1);\n                    } else {\n                        rect.setWidth(handleSize);\n                        if (slider->tickPosition == QSlider::TicksBelow) {\n                            center.rx() -= tickSize;\n                        }\n\n                        rect.moveCenter(center);\n\n                        if (slider->upsideDown)\n                            rect.setTop(slider->rect.bottom() -\n                                        ((pos + handleSize) - 2));\n                        else\n                            rect.setTop(slider->rect.top() + pos);\n\n                        rect.setHeight(handleSize);\n                    }\n                    break;\n                }\n                case SC_SliderTickmarks: {\n                    QPoint center = slider->rect.center();\n\n                    if (slider->tickPosition & QSlider::TicksBelow) {\n                        if (slider->orientation == Qt::Horizontal) {\n                            rect.setHeight(tickSize);\n                            center.ry() += tickSize / 2;\n                            rect.adjust(6, 0, -10, 0);\n                        } else {\n                            rect.setWidth(tickSize);\n                            center.rx() += tickSize / 2;\n                            rect.adjust(0, 6, 0, -10);\n                        }\n                    } else {\n                        rect = QRect();\n                    }\n                    rect.moveCenter(center);\n                    break;\n                }\n                default:\n                    ;\n            }\n            break;\n        }\n        default:\n            return QWindowsStyle::subControlRect(control, option, subControl,\n                                                 widget);\n    }\n    return rect;\n}\n\nstatic const char * const sliderHandleImage[] = {\n    \"15 16 7 1\",\n    \"   c None\",\n    \"+  c #FFFFFF\",\n    \"@  c #FFFFFF\",\n    \"$  c #FFFFFF\",\n    \"(  c #E5EDF5\",\n    \")  c #F2F6FA\",\n    \"[  c #FFFFFF\",\n    \" +++++++++++++ \",\n    \"+@@@@@@@@@@@@@+\",\n    \"+@(((((((((((@+\",\n    \"+@(((((((((((@+\",\n    \"+@)))))))))))@+\",\n    \"+@[[[[[[[[[[[@+\",\n    \"+@[[[[[[[[[[[@+\",\n    \"+@)))))))))))@+\",\n    \"+@)))))))))))@+\",\n    \" +@)))))))))@+ \",\n    \"  +@(((((((@+  \",\n    \"   +@(((((@+   \",\n    \"    +@(((@+    \",\n    \"     +@(@+     \",\n    \"      +@+      \",\n    \"       +       \"};\n\n\nvoid JavaStyle::drawComplexControl(ComplexControl control,\n                                   const QStyleOptionComplex *option,\n                                   QPainter *painter,\n                                   const QWidget *widget) const\n{\n    painter->save();\n\n    switch (control) {\n        case CC_TitleBar: {\n            const QStyleOptionTitleBar *bar =\n                qstyleoption_cast<const QStyleOptionTitleBar *>(option);\n\n            bool sunken = bar->state & State_Sunken;\n\n            QLinearGradient gradient(bar->rect.bottomLeft(),\n                                     bar->rect.topLeft());\n            gradient.setColorAt(0.0, QColor(191, 212, 231));\n            gradient.setColorAt(0.7, Qt::white);\n            gradient.setColorAt(1.0, QColor(221, 232, 243));\n\n            painter->setPen(Qt::NoPen);\n            if (bar->titleBarState & State_Active) {\n                painter->setBrush(gradient);\n            }\n            else\n                painter->setBrush(bar->palette.color(QPalette::Active,\n                                  QPalette::Background));\n\n            painter->drawRect(bar->rect.adjusted(0, 0, -1, -1));\n\n            painter->setBrush(QColor(233, 233, 233));\n            painter->drawRect(QRect(bar->rect.bottomLeft() + QPoint(0, 1),\n                                    bar->rect.bottomRight() + QPoint(0, 2)));\n\n            QRect minButtonRect = subControlRect(control, bar,\n                                                 SC_TitleBarMinButton);\n            QRect maxButtonRect = subControlRect(control, bar,\n                                                 SC_TitleBarMaxButton);\n            QRect closeButtonRect = subControlRect(control, bar,\n                                                   SC_TitleBarCloseButton);\n            QRect systemButtonRect = subControlRect(control, bar,\n                                                    SC_TitleBarSysMenu);\n            QRect labelRect = subControlRect(control, bar, SC_TitleBarLabel);\n            QRect gripRect = QRect(QPoint(labelRect.right() + 5, bar->rect.top() + 5),\n                                   QPoint(minButtonRect.left() - 5,\n                                          bar->rect.bottom() - 4));\n\n            QColor textColor = option->palette.color(QPalette::Text);\n            painter->setPen(textColor);\n            painter->setBrush(Qt::NoBrush);\n\n            drawItemText(painter, labelRect, Qt::TextShowMnemonic |\n                         Qt::AlignHCenter | Qt::AlignCenter,\n                         bar->palette, bar->state & State_Enabled, bar->text,\n                         textColor.isValid() ? QPalette::NoRole :\n                         QPalette::WindowText);\n\n            for (int i = 0; i < gripRect.width(); ++i) {\n                painter->setPen(i % 2 ? bar->palette.color(QPalette::Midlight)\n                                      : Qt::white);\n\n                for (int j = 0; j < 4; ++j) {\n                    painter->drawPoint(i + gripRect.left(),\n                               gripRect.top() - 2 + i % 4 + 4 * j);\n                }\n            }\n\n            QPixmap maximizePixmap(\":/images/internalmaximize.png\");\n            QPixmap minimizePixmap(\":/images/internalminimize.png\");\n            QPixmap closePixmap(\":/images/internalclose.png\");\n            QPixmap internalPixmap(\":/images/internalsystem.png\");\n            QPixmap internalCloseDownPixmap(\":/images/internalclosedown.png\");\n            QPixmap minimizeDownPixmap(\":/images/internalminimizedown.png\");\n            QPixmap maximizeDownPixmap(\":/images/internalmaximizedown.png\");\n\n            if (bar->activeSubControls & SC_TitleBarCloseButton &&\n                bar->state & State_Sunken)\n                painter->drawPixmap(closeButtonRect.topLeft(),\n                                    internalCloseDownPixmap);\n            else\n                painter->drawPixmap(closeButtonRect.topLeft(), closePixmap);\n\n            if (bar->activeSubControls & SC_TitleBarMinButton &&\n                bar->state & State_Sunken)\n                painter->drawPixmap(minButtonRect.topLeft(),\n                                    minimizeDownPixmap);\n            else\n                painter->drawPixmap(minButtonRect.topLeft(), minimizePixmap);\n\n            if (bar->activeSubControls & SC_TitleBarMaxButton &&\n                bar->state & State_Sunken)\n                painter->drawPixmap(maxButtonRect.topLeft(),\n                                    maximizeDownPixmap);\n            else\n                painter->drawPixmap(maxButtonRect.topLeft(), maximizePixmap);\n\n            painter->drawPixmap(systemButtonRect.topLeft(), internalPixmap);\n\n            break;\n        }\n        case CC_GroupBox: {\n            const QStyleOptionGroupBox *box =\n                qstyleoption_cast<const QStyleOptionGroupBox *>(option);\n\n            QRect frameRect = subControlRect(control, box, SC_GroupBoxFrame);\n            QRect labelRect = subControlRect(control, box, SC_GroupBoxLabel);\n            QRect contentsRect = subControlRect(control, box,\n                                                SC_GroupBoxContents);\n            QRect checkerRect = subControlRect(control, box,\n                                               SC_GroupBoxCheckBox);\n\n            int y = labelRect.center().y();\n\n            painter->setPen(box->palette.color(QPalette::Button));\n            painter->drawRect(frameRect.adjusted(2, y - frameRect.top(), -2,\n                                                 -2));\n\n            painter->setPen(box->palette.color(QPalette::Background));\n\n            if (box->subControls & SC_GroupBoxCheckBox) {\n                painter->drawLine(checkerRect.left() - 1, y,\n                                  checkerRect.right() + 2, y);\n                QStyleOptionButton checker;\n                checker.QStyleOption::operator=(*box);\n                checker.rect = checkerRect;\n                drawPrimitive(PE_IndicatorCheckBox, &checker, painter, widget);\n            }\n\n            if (box->subControls & SC_GroupBoxLabel && !box->text.isEmpty()) {\n                painter->drawLine(labelRect.left() - 1, y,\n                              labelRect.right() +1, y);\n\n                QColor textColor = box->textColor;\n                if (textColor.isValid())\n                    painter->setPen(textColor);\n\n                drawItemText(painter, labelRect,  Qt::TextShowMnemonic |\n                Qt::AlignHCenter | int(box->textAlignment),\n                box->palette, box->state & State_Enabled,\n                box->text, textColor.isValid() ? QPalette::NoRole :\n                QPalette::WindowText);\n            }\n            break;\n        }\n        case CC_SpinBox: {\n            const QStyleOptionSpinBox *spinner =\n            qstyleoption_cast<const QStyleOptionSpinBox *>(option);\n\n            QRect frameRect = subControlRect(control, spinner, SC_SpinBoxFrame);\n            QRect upRect = subControlRect(control, spinner, SC_SpinBoxUp);\n            QRect downRect = subControlRect(control, spinner, SC_SpinBoxDown);\n\n            painter->setPen(Qt::white);\n            painter->drawRect(frameRect.adjusted(1, 1, -1, -1));\n            painter->drawPoint(frameRect.bottomLeft());\n\n            painter->setPen(spinner->palette.color(QPalette::Mid));\n            painter->drawRect(frameRect.adjusted(0, 0, -1, -2));\n\n            bool isEnabled = (spinner->state & State_Enabled);\n            bool hover = isEnabled && (spinner->state & State_MouseOver);\n            bool sunken = (spinner->state & State_Sunken);\n            bool upIsActive = (spinner->activeSubControls == SC_SpinBoxUp);\n            bool downIsActive = (spinner->activeSubControls == SC_SpinBoxDown);\n            bool stepUpEnabled = spinner->stepEnabled &\n                             QAbstractSpinBox::StepUpEnabled;\n            bool stepDownEnabled = spinner->stepEnabled &\n                               QAbstractSpinBox::StepDownEnabled;\n\n            painter->setBrush(spinner->palette.color(QPalette::Background));\n\n            painter->drawRect(upRect);\n            if (upIsActive && stepUpEnabled) {\n                if (sunken) {\n                    drawSunkenButtonShadow(painter, upRect,\n                                       spinner->palette.color(QPalette::Mid));\n                } else if (hover) {\n                    drawButtonHoverFrame(painter, upRect,\n                    spinner->palette.color(QPalette::Mid),\n                    spinner->palette.color(QPalette::Button));\n                }\n            }\n\n            QStyleOptionSpinBox upSpin = *spinner;\n            upSpin.rect = upRect;\n            drawPrimitive(PE_IndicatorSpinUp, &upSpin, painter, widget);\n\n            painter->drawRect(downRect);\n            if (downIsActive && stepDownEnabled) {\n                if (sunken) {\n                    drawSunkenButtonShadow(painter, downRect,\n                    spinner->palette.color(QPalette::Mid));\n                } else if (hover) {\n                    drawButtonHoverFrame(painter, downRect,\n                    spinner->palette.color(QPalette::Mid),\n                    spinner->palette.color(QPalette::Button));\n                }\n            }\n\n            QStyleOptionSpinBox downSpin = *spinner;\n            downSpin.rect = downRect;\n            drawPrimitive(PE_IndicatorSpinDown, &downSpin, painter, widget);\n\n            break;\n        }\n        case CC_ToolButton: {\n            const QStyleOptionToolButton *button =\n                qstyleoption_cast<const QStyleOptionToolButton *>(option);\n\n            painter->setPen(Qt::white);\n            painter->drawRect(button->rect.adjusted(1, 1, -1, -1));\n\n            QStyleOptionToolButton panelOption = *button;\n            QRect panelRect;\n            if (!(button->state & State_MouseOver) &&\n                !(button->state & State_On)) {\n                painter->setPen(QColor(153, 153, 153));\n                painter->drawRect(button->rect.adjusted(0, 0, -2, -2));\n\n                panelRect = subControlRect(control, option, SC_ToolButton);\n                panelOption.rect = panelRect;\n            } else {\n                panelOption.rect.adjust(0, 0, -1, -1);\n            }\n\n            QRect menuRect = subControlRect(control, option, SC_ToolButtonMenu);\n\n            drawPrimitive(PE_PanelButtonTool, &panelOption, painter, widget);\n\n            QStyleOptionToolButton menuOption = *button;\n            menuOption.rect = menuRect;\n\n            QStyleOptionToolButton label = *button;\n            int fw = 5; \n\n            drawControl(CE_ToolButtonLabel, &label, painter, widget);\n            if (button->subControls & SC_ToolButtonMenu) {\n                painter->setPen(button->palette.color(QPalette::WindowText));\n                drawPrimitive(PE_IndicatorArrowDown, &menuOption, painter, widget);\n            }\n\n            if (button->state & State_HasFocus) {\n                QStyleOptionToolButton focusOption = *button;\n                focusOption.rect = label.rect.adjusted(-1, -1, 1, 1);\n\n                drawPrimitive(PE_FrameFocusRect, &focusOption, painter, widget);\n            }\n            \n            break;\n        }\n        case CC_ComboBox: {\n            const QStyleOptionComboBox *combo =\n                qstyleoption_cast<const QStyleOptionComboBox *>(option);\n\n            QRect frameRect = subControlRect(control, option, SC_ComboBoxFrame,\n                                         widget);\n            painter->setPen(combo->palette.color(QPalette::Mid));\n\n            if (option->state & State_HasFocus)\n                painter->setBrush(option->palette.color(QPalette::Light));\n            else\n                painter->setBrush(combo->palette.color(QPalette::Background));\n\n            painter->drawRect(frameRect.adjusted(0, 0, -1, -1));\n\n            QRect arrowRect = subControlRect(control, option, SC_ComboBoxArrow,\n                                             widget);\n            painter->setPen(combo->palette.color(QPalette::Button));\n            painter->setBrush(Qt::NoBrush);\n\n            if (combo->direction == Qt::LeftToRight) {\n                painter->drawRect(QRect(frameRect.topLeft() + QPoint(1, 1),\n                                  arrowRect.bottomLeft() + QPoint(-2, -2)));\n            } else {\n                painter->drawRect(QRect(arrowRect.topLeft() + QPoint(1, 1),\n                                    frameRect.bottomRight() + QPoint(-2, -2)));\n            }\n\n            QStyleOptionButton button;\n            button.rect = arrowRect;\n            button.state = combo->state;\n            button.palette = combo->palette;\n\n            if (button.state & State_On)\n                button.state ^= State_On;\n\n            painter->save();\n            drawButtonBackground(&button, painter, false);\n            painter->restore();\n\n            QPoint center = arrowRect.center();\n            QPoint offset = QPoint(arrowRect.bottomLeft().x() + 1,\n                               center.y() + 7);\n            QPainterPath arrow;\n            arrow.moveTo(offset + QPoint(4, -8));\n            arrow.lineTo(offset + QPoint(7, -5));\n            arrow.lineTo(offset + QPoint(8, -5));\n            arrow.lineTo(offset + QPoint(11, -8));\n            arrow.lineTo(offset + QPoint(4, -8));\n\n            painter->setBrush(combo->palette.color(QPalette::WindowText));\n            painter->setPen(combo->palette.color(QPalette::WindowText));\n\n            painter->drawPath(arrow);\n\n            QRect fieldRect = subControlRect(control, option,\n                                             SC_ComboBoxEditField, widget);\n\n            break;\n        }\n        case CC_Slider: {\n            const QStyleOptionSlider *slider =\n                qstyleoption_cast<const QStyleOptionSlider *>(option);\n\n            bool horizontal = slider->orientation == Qt::Horizontal;\n\n            QRect groove = subControlRect(control, option, SC_SliderGroove,\n                                          widget);\n            QRect ticks = subControlRect(control, option, SC_SliderTickmarks,\n                                         widget);\n            QRect handle = subControlRect(control, option, SC_SliderHandle,\n                                          widget);\n\n            QRect afterHandle = QRect(handle.topLeft() + xySwitch(QPoint(4, 6), horizontal),\n                                      groove.bottomRight() + xySwitch(QPoint(-4, -6), horizontal));\n            QRect beforeHandle = QRect(groove.topLeft() + xySwitch(QPoint(4, 6), horizontal),\n                                       handle.bottomRight() + xySwitch(QPoint(-4, -6), horizontal));\n\n            if (slider->upsideDown || !horizontal) {\n                QRect remember;\n                remember = afterHandle;\n                afterHandle = beforeHandle;\n                beforeHandle = remember;\n            }\n\n            painter->setPen(slider->palette.color(QPalette::Mid));\n            painter->setBrush(option->palette.color(QPalette::Background));\n            painter->drawRect(afterHandle);\n            painter->setPen(slider->palette.color(QPalette::Light));\n            painter->drawLine(afterHandle.topLeft() + xySwitch(QPoint(0, 1), horizontal),\n                          afterHandle.topRight() + xySwitch(QPoint(0, 1), horizontal));\n            painter->setPen(option->palette.color(QPalette::Midlight));\n\n            if (horizontal) {\n                painter->setBrush(gradientBrush(QRect(QPoint(groove.x(),\n                                                handle.y() + 1),\n                                                QSize(groove.width(),\n                                                handle.height() + 1))));\n            } else {\n                QRect rect = QRect(QPoint(groove.x(),\n                                   handle.x() - 1),\n                                   QSize(groove.height(),\n                                   handle.width() + 1));\n                QLinearGradient gradient(groove.bottomLeft(),\n                                         groove.bottomRight());\n                gradient.setColorAt(1.0, QColor(188, 210, 230));\n                gradient.setColorAt(0.3, Qt::white);\n                gradient.setColorAt(0.0, QColor(223, 233, 243));\n\n                painter->setBrush(gradient);\n            }\n\n            painter->drawRect(beforeHandle);\n\n            QPainterPath handlePath;\n            QPainterPath innerPath;\n            QPoint topLeft, topRight, bottomLeft;\n            if (horizontal) {\n                topLeft = handle.topLeft();\n                topRight = handle.topRight();\n                bottomLeft = handle.bottomLeft();\n            } else {\n                topLeft = handle.bottomLeft();\n                topRight = handle.topLeft();\n                bottomLeft = handle.topRight();\n            }\n\n            if (horizontal) {\n                QImage image(sliderHandleImage);\n\n                image.setColor(1,\n                    option->palette.color(QPalette::Midlight).rgb());\n                image.setColor(2,\n                    option->palette.color(QPalette::Button).rgb());\n\n                if (!(slider->state & State_Enabled)) {\n                    image.setColor(4, slider->palette.color(QPalette::Background).rgb());\n                    image.setColor(5, slider->palette.color(QPalette::Background).rgb());\n                    image.setColor(6, slider->palette.color(QPalette::Background).rgb());\n                }\n\n                painter->drawImage(handle.topLeft(), image);\n            } else {\n                QImage image(\":/images/verticalsliderhandle.png\");\n                painter->drawImage(handle.topLeft(), image);\n            }\n\n            if (slider->tickPosition & QSlider::TicksBelow) {\n                painter->setPen(slider->palette.color(QPalette::Light));\n                int tickInterval = slider->tickInterval ? slider->tickInterval :\n                                                          slider->pageStep;\n\n                for (int i = 0; i <= slider->maximum; i += tickInterval) {\n                    if (horizontal) {\n                        int pos = int(((i / double(slider->maximum)) *\n                            ticks.width()) - 1);\n                        painter->drawLine(QPoint(ticks.left() + pos,\n                        ticks.top() + 2), QPoint(ticks.left() + pos, ticks.top() + 8));\n                    } else {\n                        int pos = int(((i / double(slider->maximum)) *\n                            ticks.height()) - 1);\n                        painter->drawLine(QPoint(ticks.left() + 2, ticks.bottom() - pos),\n                                          QPoint(ticks.right() - 2, ticks.bottom() - pos));\n                    }\n                }\n                if (horizontal) {\n                    painter->drawLine(QPoint(ticks.right(), ticks.top() + 2),\n                                      QPoint(ticks.right(), ticks.top() + 8));\n                } else {\n                    painter->drawLine(QPoint(ticks.left() + 2, ticks.top()),\n                              QPoint(ticks.right() - 2, ticks.top()));\n                }\n            }\n            break;\n        }\n        default:\n            QWindowsStyle::drawComplexControl(control, option, painter, widget);\n    }\n    painter->restore();\n}\n\ninline void JavaStyle::drawSunkenButtonShadow(QPainter *painter,\n                                              QRect rect,\n                                              const QColor &frameColor,\n                                              bool reverse) const\n{\n    painter->save();\n\n    painter->setPen(frameColor);\n\n    if (!reverse) {\n        painter->drawLine(QLine(QPoint(rect.x() + 1, rect.y() + 1),\n                                QPoint(rect.x() + rect.width() - 1, rect.y() + 1)));\n        painter->drawLine(QLine(QPoint(rect.x() + 1, rect.y()),\n                                QPoint(rect.x() + 1, rect.y() + rect.height())));\n    } else {\n        painter->drawLine(QLine(QPoint(rect.right(), rect.bottom()),\n                                QPoint(rect.right(), rect.top())));\n        painter->drawLine(QLine(QPoint(rect.left(), rect.top() + 1),\n                                QPoint(rect.right(), rect.top() + 1)));\n    }\n    painter->restore();\n}\n\ninline void JavaStyle::drawButtonHoverFrame(QPainter *painter, QRect rect,\n                                            const QColor &frameColor,\n                                            const QColor &activeFrame) const\n{\n    painter->save();\n\n    painter->setPen(activeFrame);\n    painter->drawRect(rect);\n    rect.adjust(1, 1, -1, -1);\n    painter->setPen(frameColor);\n    painter->drawRect(rect);\n    rect.adjust(1, 1, -1, -1);\n    painter->setPen(activeFrame);\n    painter->drawRect(rect);\n\n    painter->restore();\n}\n\nQStyle::SubControl JavaStyle::hitTestComplexControl(ComplexControl control,\n                                                    const QStyleOptionComplex *option,\n                                                    const QPoint &pos,\n                                                    const QWidget *widget) const\n{\n    SubControl ret = SC_None;\n\n    switch (control) {\n        case CC_TitleBar: {\n            const QStyleOptionTitleBar *bar =\n                qstyleoption_cast<const QStyleOptionTitleBar *>(option);\n\n            QRect maximize = subControlRect(control, bar, SC_TitleBarMaxButton);\n            if (maximize.contains(pos)) {\n                ret = SC_TitleBarMaxButton;\n                break;\n            }\n            QRect minimize = subControlRect(control, bar, SC_TitleBarMinButton);\n            if (minimize.contains(pos)) {\n                ret = SC_TitleBarMinButton;\n                break;\n            }\n            QRect close = subControlRect(control, bar, SC_TitleBarCloseButton);\n            if (close.contains(pos)) {\n                ret = SC_TitleBarCloseButton;\n                break;\n            }\n            QRect system = subControlRect(control, bar, SC_TitleBarSysMenu);\n            if (system.contains(pos)) {\n                ret = SC_TitleBarSysMenu;\n                break;\n            }\n            ret = SC_TitleBarLabel;\n            break;\n        }\n        case CC_ScrollBar:\n            if (const QStyleOptionSlider *scrollBar =\n                qstyleoption_cast<const QStyleOptionSlider *>(option)) {\n                    QRect slider = subControlRect(control, scrollBar,\n                                                  SC_ScrollBarSlider, widget);\n                if (slider.contains(pos)) {\n                    ret = SC_ScrollBarSlider;\n                    break;\n                }\n\n                QRect scrollBarAddLine = subControlRect(control, scrollBar,\n                    SC_ScrollBarAddLine, widget);\n                if (scrollBarAddLine.contains(pos)) {\n                    ret = SC_ScrollBarAddLine;\n                    break;\n                }\n\n                QRect scrollBarSubPage = subControlRect(control, scrollBar,\n                            SC_ScrollBarSubPage, widget);\n                if (scrollBarSubPage.contains(pos)) {\n                    ret = SC_ScrollBarSubPage;\n                    break;\n                }\n\n                QRect scrollBarAddPage = subControlRect(control, scrollBar,\n                            SC_ScrollBarAddPage, widget);\n                if (scrollBarAddPage.contains(pos)) {\n                    ret = SC_ScrollBarAddPage;\n                    break;\n                }\n\n                QRect scrollBarSubLine = subControlRect(control, scrollBar,\n                            SC_ScrollBarSubLine, widget);\n                if (scrollBarSubLine.contains(pos)) {\n                    ret = SC_ScrollBarSubLine;\n                    break;\n                }\n            }\n            break;\n\n        default:\n            ret = QWindowsStyle::hitTestComplexControl(control, option, pos,\n                                                       widget);\n    }\n    return ret;\n}\n\nvoid JavaStyle::polish(QWidget *widget)\n{\n    if (qobject_cast<QCheckBox *>(widget) ||\n        qobject_cast<QRadioButton *>(widget) ||\n        qobject_cast<QPushButton *>(widget) ||\n        qobject_cast<QToolButton *>(widget) ||\n        qobject_cast<QSpinBox *>(widget) ||\n        qobject_cast<QGroupBox *>(widget))\n            widget->setAttribute(Qt::WA_Hover, true);\n}\n\nvoid JavaStyle::unpolish(QWidget *widget)\n{\n    if (qobject_cast<QPushButton *>(widget) ||\n        qobject_cast<QCheckBox *>(widget) ||\n        qobject_cast<QRadioButton *>(widget) ||\n        qobject_cast<QToolButton *>(widget) ||\n        qobject_cast<QSpinBox *>(widget) ||\n        qobject_cast<QGroupBox *>(widget))\n            widget->setAttribute(Qt::WA_Hover, false);\n}\n\nvoid JavaStyle::drawSplitter(const QStyleOption *option, QPainter *painter,\n                 bool horizontal) const\n{\n    QRect rect = option->rect;\n\n    painter->setPen(Qt::NoPen);\n    painter->setBrush(option->palette.color(QPalette::Background));\n\n    painter->drawRect(rect);\n\n    QColor colors[] = { Qt::white, option->palette.color(QPalette::Mid) };\n    int iterations = horizontal ? rect.height() - 1 : rect.width() - 1;\n    for (int i = 0; i < iterations; ++i) {\n        painter->setPen(colors[i % 2]);\n        painter->drawPoint(xySwitch(QPoint(rect.x() + 0 + (i % 4),\n                                           rect.y() + i), horizontal));\n    }\n}\n\ninline QPoint JavaStyle::xySwitch(const QPoint &point, bool horizontal) const\n{\n    QPoint retPoint = point;\n\n    if (!horizontal) {\n        retPoint = QPoint(point.y(), point.x());\n    }\n\n    return retPoint;\n}\n\nvoid JavaStyle::drawPrimitive(PrimitiveElement element,\n                              const QStyleOption *option,\n                              QPainter *painter,\n                              const QWidget *widget) const\n{\n    painter->save();\n\n    switch (element) {\n        case PE_PanelButtonBevel:\n        case PE_FrameButtonBevel: {\n            painter->save();\n            painter->setBrush(option->palette.background());\n            painter->setPen(Qt::NoPen);\n            painter->drawRect(option->rect);\n            painter->restore();\n            break;\n        }\n        case PE_IndicatorBranch: {\n            painter->save();\n            QColor lineColor(204, 204, 255);\n            QPixmap openPixmap(\":/images/jtreeopen.png\");\n            QPixmap closedPixmap(\":/images/jtreeclosed.png\");\n            QRect pixmapRect(QPoint(0, 0), QSize(12, 12));\n            pixmapRect.moveCenter(option->rect.center());\n            pixmapRect.translate(2, 0);\n            QPoint center = option->rect.center();\n\n            painter->setPen(lineColor);\n            painter->setBrush(Qt::NoBrush);\n\n            if (option->state & State_Item) {\n                painter->drawLine(center,\n                                  QPoint(option->rect.right(), center.y()));\n\n                painter->drawLine(center, QPoint(center.x(),\n                                  option->rect.top()));\n\n                if (option->state & State_Sibling) {\n                    painter->drawLine(center, QPoint(center.x(),\n                                      option->rect.bottom()));\n                }\n                \n                if (option->state & State_Children)\n                    if (option->state & State_Open)\n                        painter->drawPixmap(pixmapRect.topLeft(), closedPixmap);\n                    else\n                        painter->drawPixmap(pixmapRect.topLeft(), openPixmap);\n            } else if (option->state & State_Sibling) {\n                painter->drawLine(center.x(), option->rect.top(), center.x(),\n                                  option->rect.bottom());\n            }\n\n            painter->restore();\n            break;\n        }\n        case PE_IndicatorViewItemCheck: {\n            break;\n        }\n        case PE_FrameWindow: {\n            painter->save();\n            bool active = option->state & State_Active;\n\n            painter->setPen(Qt::NoPen);\n            painter->setBrush(active ? option->palette.color(QPalette::Midlight)\n                                     : option->palette.color(QPalette::Mid));\n\n            painter->drawRect(QRect(option->rect.topLeft(), option->rect.bottomLeft() + QPoint(5, 0)));\n            painter->drawRect(QRect(option->rect.bottomLeft(), option->rect.bottomRight() + QPoint(0, -5)));\n            painter->drawRect(QRect(option->rect.bottomRight() + QPoint(-5, 0), option->rect.topRight()));\n            painter->drawRect(QRect(option->rect.topLeft(), option->rect.topRight() + QPoint(0, 4)));\n\n            painter->setBrush(Qt::NoBrush);\n            painter->setPen(option->palette.color(QPalette::Active, QPalette::WindowText));\n            painter->drawLine(option->rect.topLeft() + QPoint(2, 14),\n                              option->rect.bottomLeft() + QPoint(2, -14));\n\n            painter->drawLine(option->rect.topRight() + QPoint(-2, 14),\n                              option->rect.bottomRight() + QPoint(-2, -14));\n\n            painter->drawLine(option->rect.topLeft() + QPoint(14, 2),\n                              option->rect.topRight() + QPoint(-14, 2));\n\n            painter->drawLine(option->rect.bottomLeft() + QPoint(14, -2),\n                              option->rect.bottomRight() + QPoint(-14, -2));\n\n            painter->setPen(active ? option->palette.color(QPalette::Light) :\n                            option->palette.color(QPalette::Button));\n            painter->drawLine(option->rect.topLeft() + QPoint(3, 15),\n                              option->rect.bottomLeft() + QPoint(3, -13));\n\n            painter->drawLine(option->rect.topRight() + QPoint(-1, 15),\n                              option->rect.bottomRight() + QPoint(-1, -13));\n\n            painter->drawLine(option->rect.topLeft() + QPoint(15, 3),\n                              option->rect.topRight() + QPoint(-13, 3));\n\n            painter->drawLine(option->rect.bottomLeft() + QPoint(15, -1),\n                              option->rect.bottomRight() + QPoint(-13, -1));\n\n            painter->restore();\n            break;\n        }\n        case PE_IndicatorSpinUp: {\n            const QStyleOptionSpinBox *spinner =\n                qstyleoption_cast<const QStyleOptionSpinBox *>(option);\n            int add = spinner->state & State_Sunken &&\n                    spinner->activeSubControls & SC_SpinBoxUp ? 1 : 0;\n\n            QPoint center = option->rect.center();\n            painter->drawLine(center.x() + add, center.y() + 1 + add,\n                              center.x() + 2 + add, center.y() + 1 + add);\n            painter->drawPoint(center.x() + 1 + add, center.y() + add);\n            break;\n        }\n        case PE_IndicatorSpinDown: {\n            const QStyleOptionSpinBox *spinner =\n                qstyleoption_cast<const QStyleOptionSpinBox *>(option);\n\n            int add = spinner->state & State_Sunken &&\n                      spinner->activeSubControls & SC_SpinBoxDown ? 1 : 0;\n            QPoint center = option->rect.center();\n            painter->drawLine(center.x() + add, center.y() + add,\n                              center.x() + 2 + add, center.y() + add);\n            painter->drawPoint(center.x() + 1 + add, center.y() + 1 + add);\n            break;\n        }\n        case PE_FrameDockWidget: { \n            drawPrimitive(PE_FrameWindow, option, painter, widget);\n            break;\n        }\n        case PE_IndicatorToolBarHandle: {\n            QPoint offset;\n            bool horizontal = option->state & State_Horizontal;\n\n            if (horizontal)\n                offset = option->rect.topLeft();\n            else\n                offset = option->rect.topLeft();\n\n            int iterations = horizontal ? option->rect.height() :\n                                          option->rect.width();\n\n            for (int i = 0; i < iterations; ++i) {\n                painter->setPen(i % 2 ? Qt::white :\n                    option->palette.color(QPalette::Mid));\n                int add = i % 4;\n                painter->drawPoint(offset + xySwitch(QPoint(add, i),\n                                                     horizontal));\n                painter->drawPoint(offset + xySwitch(QPoint(add + 4, i),\n                                                     horizontal));\n                if (add + 8 < 10)\n                    painter->drawPoint(offset + xySwitch(QPoint(add + 8, i),\n                                       horizontal));\n            }\n            \n            break;\n        }\n        case PE_IndicatorToolBarSeparator: {\n            break;\n        }\n        case PE_PanelButtonTool: {\n            const QStyleOptionToolButton *button =\n            qstyleoption_cast<const QStyleOptionToolButton *>(option);\n\n            if (!button)  {\n                painter->setPen(Qt::red);\n                if (!(option->state & State_Enabled))\n                    painter->drawRect(option->rect.adjusted(0, 0, -1, -1));\n                drawButtonBackground(option, painter, false);\n                break;\n            }\n\n            if (button->state & State_MouseOver || button->state & State_On) {\n                QStyleOptionButton bevel;\n                bevel.state = button->state;\n                bevel.rect = button->rect;\n                bevel.palette = button->palette;\n\n                drawButtonBackground(&bevel, painter, false);\n            } else {\n                painter->setPen(Qt::NoPen);\n                painter->setBrush(button->palette.color(QPalette::Background));\n\n                painter->drawRect(button->rect.adjusted(0, 0, -1, -1));\n            }\n            break;\n        }\n        case PE_FrameMenu: {\n            painter->setPen(option->palette.color(QPalette::Midlight));\n            painter->drawRect(option->rect.adjusted(0, 0, -1, -1));\n            break;\n        }\n        case PE_PanelButtonCommand: {\n            const QStyleOptionButton *btn =\n                qstyleoption_cast<const QStyleOptionButton *>(option);\n            bool hover = (btn->state & State_Enabled) &&\n                         (btn->state & State_MouseOver);\n            bool sunken = btn->state & State_Sunken;\n            bool isDefault = btn->features & QStyleOptionButton::DefaultButton;\n            bool on = option->state & State_On;\n\n            drawButtonBackground(option, painter, false);\n\n            QRect rect = option->rect.adjusted(0, 0, -1, -1);\n            if (hover && !sunken && !isDefault && !on) {\n                drawButtonHoverFrame(painter, rect,\n                    btn->palette.color(QPalette::Mid),\n                    btn->palette.color(QPalette::Button));\n            } else if (isDefault) {\n                drawPrimitive(PE_FrameDefaultButton, option, painter, widget);\n            }\n            break;\n        }\n        case PE_FrameDefaultButton: {\n            painter->setPen(option->palette.color(QPalette::Mid));\n            QRect rect = option->rect.adjusted(0, 0, -1, -1);\n            painter->drawRect(rect);\n            painter->drawRect(rect.adjusted(1, 1, -1, -1));\n            break;\n        }\n//! [0]\n        case PE_IndicatorCheckBox: {\n            painter->save();\n            drawButtonBackground(option, painter, true);\n\n            if (option->state & State_Enabled &&\n                option->state & State_MouseOver &&\n                !(option->state & State_Sunken)) {\n                painter->setPen(option->palette.color(QPalette::Button));\n                QRect rect = option->rect.adjusted(1, 1, -2, -2);\n                painter->drawRect(rect);\n                rect = rect.adjusted(1, 1, -1, -1);\n                painter->drawRect(rect);\n            }\n\n            if (option->state & State_On) {\n                QImage image(\":/images/checkboxchecked.png\");\n                painter->drawImage(option->rect.topLeft(), image);\n            }\n            painter->restore();\n            break;\n//! [0]\n        }\n        case PE_IndicatorRadioButton: {\n            painter->save();\n            QBrush radioBrush = option->palette.button();\n\n            if (!(option->state & State_Sunken) &&\n                option->state & State_Enabled)\n                radioBrush = gradientBrush(option->rect);\n\n            painter->setBrush(radioBrush);\n            if (option->state & State_Enabled)\n                painter->setPen(option->palette.color(QPalette::Mid));\n            else\n                painter->setPen(option->palette.color(QPalette::Disabled,\n                                                      QPalette::WindowText));\n            painter->drawEllipse(option->rect.adjusted(0, 0, -1, -1));\n\n            if (option->state & State_MouseOver &&\n                option->state & State_Enabled &&\n                !(option->state & State_Sunken)) {\n                gradientBrush(option->rect);\n                painter->setPen(option->palette.color(QPalette::Button));\n                painter->setBrush(Qt::NoBrush);\n                QRect rect = option->rect.adjusted(1, 1, -2, -2);\n                painter->drawEllipse(rect);\n                rect = rect.adjusted(1, 1, -1, -1);\n                painter->drawEllipse(rect);\n            }\n\n            if (option->state & State_On) {\n                painter->setBrush(option->palette.color(QPalette::Text));\n                painter->setPen(Qt::NoPen);\n                painter->drawEllipse(option->rect.adjusted(3, 3, -3, -3));\n            }\n            if (option->state & State_Sunken &&\n                option->state & State_Enabled) {\n                painter->setPen(option->palette.color(QPalette::Mid));\n                painter->drawArc(option->rect.adjusted(1, 1, -2, -2), 80 * 16,\n                                 100 * 16);\n            }\n            painter->restore();\n            break;\n        }\n        case PE_FrameTabWidget: {\n            painter->setPen(option->palette.color(QPalette::Midlight));\n            painter->drawRect(option->rect.adjusted(0, 0, -1, -1));\n            painter->setPen(Qt::white);\n            painter->drawRect(option->rect.adjusted(1, 1, -2, -2));\n            break;\n        }\n        case PE_Frame:\n        case PE_FrameLineEdit: {\n            const QStyleOptionFrame *frame =\n                qstyleoption_cast<const QStyleOptionFrame *>(option);\n            const QStyleOptionFrameV2 frameV2(*frame);\n\n            painter->setPen(frame->palette.color(QPalette::Mid));\n            painter->drawRect(frameV2.rect.adjusted(0, 0, -2, -2));\n            painter->setPen(Qt::white);\n            painter->drawRect(frameV2.rect.adjusted(1, 1, -1, -1));\n            painter->setPen(frameV2.palette.color(QPalette::Active,\n                                                  QPalette::Background));\n            painter->drawLine(frameV2.rect.bottomLeft(),\n            frameV2.rect.bottomLeft() + QPoint(1, -1));\n            painter->drawLine(frameV2.rect.topRight(),\n            frameV2.rect.topRight() + QPoint(-1, 1));\n            break;\n        }\n        case PE_FrameFocusRect: {\n            painter->setPen(option->palette.color(QPalette::Light));\n            painter->setBrush(Qt::NoBrush);\n            QRect rect = option->rect;\n            rect = rect.adjusted(0,0, -1, -1);\n            painter->drawRect(rect);\n            break;\n        }\n        default:\n            QWindowsStyle::drawPrimitive(element, option, painter, widget);\n    }\n    painter->restore();\n}\n\n//! [1]\nvoid JavaStyle::drawButtonBackground(const QStyleOption *option,\n                                     QPainter *painter, bool isCheckbox) const\n{\n    QBrush buttonBrush = option->palette.button();\n    bool sunken = option->state & State_Sunken;\n    bool disabled = !(option->state & State_Enabled);\n    bool on = option->state & State_On;\n\n    if (!sunken && !disabled && (!on || isCheckbox))\n        buttonBrush = gradientBrush(option->rect);\n\n        painter->fillRect(option->rect, buttonBrush);\n\n        QRect rect = option->rect.adjusted(0, 0, -1, -1);\n\n        if (disabled)\n            painter->setPen(option->palette.color(QPalette::Disabled,\n                                                  QPalette::WindowText));\n        else\n            painter->setPen(option->palette.color(QPalette::Mid));\n\n        painter->drawRect(rect);\n\n        if (sunken && !disabled) {\n            drawSunkenButtonShadow(painter, rect,\n                   option->palette.color(QPalette::Mid),\n                   option->direction == Qt::RightToLeft);\n    }\n}\n//! [1]\n\nQBrush JavaStyle::gradientBrush(const QRect &rect) const\n{\n    QLinearGradient gradient(rect.topLeft(), rect.bottomLeft());\n    gradient.setColorAt(1.0, QColor(188, 210, 230));\n    gradient.setColorAt(0.3, Qt::white);\n    gradient.setColorAt(0.0, QColor(223, 233, 243));\n\n    return QBrush(gradient);\n}\n\nQRect JavaStyle::subElementRect(SubElement element,\n                                const QStyleOption *option,\n                                const QWidget *widget) const\n{\n    QRect rect;\n\n    switch (element) {\n        case SE_ToolBoxTabContents: {\n            const QStyleOptionToolBox *box =\n                qstyleoption_cast<const QStyleOptionToolBox *>(option);\n\n            rect.moveTopLeft(box->rect.topLeft() + QPoint(0, 2));\n            rect.setHeight(box->rect.height() - 4);\n            rect.setWidth(box->fontMetrics.width(box->text) + 15);\n            break;\n        }\n        case SE_ProgressBarLabel:\n        case SE_ProgressBarGroove:\n        case SE_ProgressBarContents: {\n            rect = option->rect.adjusted(1, 1, -1, -1);\n            break;\n        }\n        case SE_PushButtonFocusRect: {\n            const QStyleOptionButton *btn =\n                qstyleoption_cast<const QStyleOptionButton *>(option);\n\n            rect = btn->fontMetrics.boundingRect(btn->text);\n            rect = QRect(0, 0, btn->fontMetrics.width(btn->text),\n                         rect.height());\n\n            if (!btn->icon.isNull()) {\n                rect.adjust(0, 0, btn->iconSize.width(), btn->iconSize.height()\n                    > rect.height() ? btn->iconSize.height() - rect.height() : 0);\n                rect.translate(-btn->iconSize.width(), 0);\n                rect.adjust(-1, -1, 1, 1);\n            }\n            rect = QRect(int(ceil((btn->rect.width() - rect.width()) / 2.0)),\n                         int(ceil((btn->rect.height() - rect.height()) / 2.0)),\n                         rect.width() - 1, rect.height());\n            rect.adjust(-1, 0, 1, 0);\n\n            break;\n        }\n        default:\n            rect = QWindowsStyle::subElementRect(element, option, widget);\n    }\n    return rect;\n}\n\nint JavaStyle::pixelMetric(PixelMetric metric,\n                           const QStyleOption* /* option */,\n                           const QWidget* /*widget*/) const\n{\n    int value = 0;\n\n    switch (metric) {\n        case PM_ButtonShiftHorizontal:\n        case PM_ButtonShiftVertical:\n        case PM_TabBarTabShiftHorizontal:\n        case PM_ButtonDefaultIndicator:\n        case PM_TabBarTabShiftVertical:\n            value = 0;\n            break;\n        case PM_TabBarBaseOverlap:\n        case PM_DefaultFrameWidth:\n            value = 2;\n            break;\n        case PM_TabBarTabVSpace:\n            value = 4;\n            break;\n        case PM_ScrollBarExtent:\n            value = 16;\n            break;\n        case PM_ScrollBarSliderMin:\n            value = 26;\n            break;\n        case PM_SplitterWidth:\n            value = 8;\n            break;\n        case PM_SliderThickness:\n            value = 16;\n            break;\n        case PM_SliderControlThickness:\n            value = 16;\n            break;\n        case PM_SliderTickmarkOffset:\n            value = 10;\n            break;\n        case PM_SliderSpaceAvailable:\n            break;\n        case PM_MenuPanelWidth:\n            value = 1;\n            break;\n        case PM_MenuVMargin:\n            value = 2;\n            break;\n        case PM_MenuBarPanelWidth:\n            value = 1;\n            break;\n        case PM_MenuBarItemSpacing:\n            value = 0;\n            break;\n        case PM_MenuBarHMargin:\n            value = 3;\n            break;\n        case PM_MenuBarVMargin:\n            value = 0;\n            break;\n        case PM_ComboBoxFrameWidth:\n            value = 1;\n            break;\n        case PM_MenuButtonIndicator:\n            value = 15;\n            break;\n        case PM_ToolBarItemMargin:\n            value = 3;\n            break;\n        case PM_ToolBarHandleExtent:\n            value = 13;\n            break;\n        case PM_SpinBoxFrameWidth:\n            value = 2;\n            break;\n        case PM_TitleBarHeight: {\n            value = 21;\n            break;\n        case PM_MDIFrameWidth:\n            value = 6;\n            break;\n        }\n        case PM_DockWidgetFrameWidth: {\n            value = 5;\n            break;\n        }\n        default:\n            value = QWindowsStyle::pixelMetric(metric);\n    }\n    return value;\n}\n\n\nint JavaStyle::styleHint(StyleHint hint, const QStyleOption *option,\n                         const QWidget *widget,\n                         QStyleHintReturn *returnData) const\n{\n    int ret;\n\n    switch (hint) {\n        case SH_Table_GridLineColor: {\n            ret = static_cast<int>(option->palette.color(QPalette::Mid).rgb());\n            break;\n        }\n        case QStyle::SH_Menu_Scrollable:\n            ret = 1; \n            break;\n        default:\n            ret = QWindowsStyle::styleHint(hint, option, widget, returnData);\n    }\n    return ret;\n}\n\nQPixmap JavaStyle::standardPixmap(StandardPixmap standardPixmap,\n                  const QStyleOption *option,\n                  const QWidget *widget) const\n{\n    QPixmap pixmap = QWindowsStyle::standardPixmap(standardPixmap, option,\n                                                   widget);\n\n    QPixmap maximizePixmap(\":/images/internalmaximize.png\");\n    QPixmap minimizePixmap(\":/images/internalminimize.png\");\n    QPixmap closePixmap(\":/images/internalclose.png\");\n    QPixmap internalPixmap(\":/images/internalsystem.png\");\n    QPixmap internalCloseDownPixmap(\":/images/internalclosedown.png\");\n    QPixmap minimizeDownPixmap(\":/images/internalminimizedown.png\");\n    QPixmap maximizeDownPixmap(\":/images/internalmaximizedown.png\");\n    QPixmap dirOpenPixmap(\":/images/open24.png\");\n    QPixmap filePixmap(\":/images/file.png\");\n\n    switch (standardPixmap) {\n        case SP_DirLinkIcon:\n        case SP_DirClosedIcon:\n        case SP_DirIcon:\n        case SP_DirOpenIcon: {\n            pixmap = closePixmap;\n            break;\n        }\n        case SP_FileIcon: {\n            pixmap = filePixmap;\n            break;\n        }\n        case SP_FileDialogBack: {\n            pixmap = QPixmap(\":/images/fileback.png\");\n            break;\n        }\n        case SP_FileDialogToParent: {\n            pixmap = QPixmap(\":/images/fileparent.png\");\n            break;\n        }\n        case SP_FileDialogNewFolder: {\n            pixmap = QPixmap(\":/images/open24.png\");\n            break;\n        }\n        case SP_FileDialogListView: {\n            pixmap = QPixmap(\":/images/filelist.png\");\n            break;\n        }\n        case SP_FileDialogDetailedView: {\n            pixmap = QPixmap(\":/images/filedetail.png\");\n            break;\n        }\n        case SP_MessageBoxInformation: {\n            pixmap = QPixmap(\":/images/information.png\");\n            break;\n        }\n        case SP_MessageBoxWarning: {\n            pixmap = QPixmap(\":/images/warning.png\");\n        }\n        case SP_MessageBoxCritical: {\n            pixmap = QPixmap(\":/images/critical.png\");\n            break;\n        }\n        case SP_MessageBoxQuestion: {\n            pixmap = QPixmap(\":/images/question.png\");\n            break;\n        }\n        case SP_TitleBarNormalButton:\n            pixmap = maximizePixmap;\n            break;\n        case SP_TitleBarCloseButton:\n            pixmap = closePixmap;\n            break;\n        default:\n            ;\n    }\n\n    return pixmap;\n}\n\nQSize JavaStyle::sizeFromContents(ContentsType type,\n                                  const QStyleOption *option,\n                                  const QSize &contentsSize,\n                                  const QWidget *widget) const\n{\n    switch (type) {\n        case CT_ComboBox: {\n            return QSize(contentsSize.width() + 27, contentsSize.height());\n        }\n        case CT_Slider: {\n            const QStyleOptionSlider *slider =\n                qstyleoption_cast<const QStyleOptionSlider *>(option);\n            if (slider->tickPosition == QSlider::TicksBelow) {\n                return QSize(contentsSize.width(), contentsSize.height() + 15);\n            } else {\n                return contentsSize;\n            }\n        }\n        case CT_MenuBarItem: {\n            const QStyleOptionMenuItem *menuItem =\n                qstyleoption_cast<const QStyleOptionMenuItem *>(option);\n            QFontMetrics metrics(menuItem->font);\n            QRect boundingRect = metrics.boundingRect(menuItem->text);\n            int width = boundingRect.width() + 14;\n            int height = boundingRect.height() + 3;\n            if (height < 20)\n                height = 20;\n\n            return QSize(width, height);\n        }\n        case CT_MenuItem: {\n            const QStyleOptionMenuItem *menuItem =\n                qstyleoption_cast<const QStyleOptionMenuItem *>(option);\n            QSize defaultSize =  QWindowsStyle::sizeFromContents(type, option,\n                contentsSize, widget);\n\n            if (menuItem->menuItemType == QStyleOptionMenuItem::Separator)\n                return defaultSize;\n\n            int width = 30;\n            int height = 0;\n\n            if (!menuItem->icon.isNull()) {\n                width += 20; \n                height += 20;\n            }\n            if (!menuItem->text.isEmpty()) {\n                QFontMetrics metrics(menuItem->font);\n                QString text = menuItem->text;\n                text.remove(QLatin1Char('\\t'));\n                QRect textRect = metrics.boundingRect(text);\n                width += textRect.width();\n                if (height < textRect.height())\n                    height += textRect.height();\n            }\n            if (menuItem->checkType != QStyleOptionMenuItem::NotCheckable) {\n                width += 10;\n                if (height < 10)\n                    height = 10;\n            }\n            return QSize(width, height);\n        }\n        default:\n            return QWindowsStyle::sizeFromContents(type, option, contentsSize,\n                                                   widget);\n    }\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/layouts/layouts.cpp",
    "content": "/############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################/\n\n//! [0]\n    window = QWidget()\n//! [0] //! [1]\n    button1 = QPushButton(\"One\")\n//! [1] //! [2]\n    button2 = QPushButton(\"Two\")\n    button3 = QPushButton(\"Three\")\n    button4 = QPushButton(\"Four\")\n    button5 = QPushButton(\"Five\")\n//! [2]\n\n//! [3]\n    layout = QHBoxLayout()\n//! [3] //! [4]\n    layout.addWidget(button1)\n    layout.addWidget(button2)\n    layout.addWidget(button3)\n    layout.addWidget(button4)\n    layout.addWidget(button5)\n\n    window.setLayout(layout)\n//! [4] //! [5]\n    window.show()\n//! [5]\n\n//! [6]\n    window =  QWidget()\n//! [6] //! [7]\n    button1 =  QPushButton(\"One\")\n//! [7] //! [8]\n    button2 =  QPushButton(\"Two\")\n    button3 =  QPushButton(\"Three\")\n    button4 =  QPushButton(\"Four\")\n    button5 =  QPushButton(\"Five\")\n//! [8]\n\n//! [9]\n    layout =  QVBoxLayout()\n\n//! [9] //! [10]\n    layout.addWidget(button1)\n    layout.addWidget(button2)\n    layout.addWidget(button3)\n    layout.addWidget(button4)\n    layout.addWidget(button5)\n\n    window.setLayout(layout)\n//! [10] //! [11]\n    window.show()\n//! [11]\n\n//! [12]\n    window =  QWidget()\n//! [12] //! [13]\n    button1 =  QPushButton(\"One\")\n//! [13] //! [14]\n    button2 =  QPushButton(\"Two\")\n    button3 =  QPushButton(\"Three\")\n    button4 =  QPushButton(\"Four\")\n    button5 =  QPushButton(\"Five\")\n//! [14]\n\n//! [15]\n    layout =  QGridLayout()\n\n//! [15] //! [16]\n    layout.addWidget(button1, 0, 0)\n    layout.addWidget(button2, 0, 1)\n    layout.addWidget(button3, 1, 0, 1, 2)\n    layout.addWidget(button4, 2, 0)\n    layout.addWidget(button5, 2, 1)\n\n    window.setLayout(layout)\n//! [16] //! [17]\n    window.show()\n//! [17]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/mainwindowsnippet.cpp",
    "content": "/############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################/\n\n//! [0]\n    dockWidget = QDockWidget(tr(\"Dock Widget\"), self)\n    dockWidget.setAllowedAreas(Qt.LeftDockWidgetArea | \n                   \t\t\t   Qt.RightDockWidgetArea)\n    dockWidget.setWidget(dockWidgetContents)\n    addDockWidget(Qt.LeftDockWidgetArea, dockWidget) \n//! [0]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/matrix/matrix.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n//! [0]\ndef paintEvent(self, event):\n    painter = QPainter(self)\n    painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))\n    painter.drawRect(0, 0, 100, 100)\n\n    painter.rotate(45)\n\n    painter.setFont(QFont(\"Helvetica\", 24))\n    painter.setPen(QPen(Qt.black, 1))\n    painter.drawText(20, 10, \"QMatrix\")\n//! [0]\n\n\n//! [1]\ndef paintEvent(self, event)\n\n    painter = QPainter(self)\n    painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))\n    painter.drawRect(0, 0, 100, 100)\n\n    matrix = QMatrix()\n    matrix.translate(50, 50)\n    matrix.rotate(45)\n    matrix.scale(0.5, 1.0)\n    painter.setMatrix(matrix)\n\n    painter.setFont(QFont(\"Helvetica\", 24))\n    painter.setPen(QPen(Qt.black, 1))\n    painter.drawText(20, 10, \"QMatrix\")\n\n//! [1]\n\n\n//! [2]\ndef paintEvent(self, event)\n\n    pi = 3.14\n\n    a    = pi/180 * 45.0\n    sina = sin(a)\n    cosa = cos(a)\n\n    translationMatrix = QMatrix(1, 0, 0, 1, 50.0, 50.0)\n    rotationMatrix = QMatrix(cosa, sina, -sina, cosa, 0, 0)\n    scalingMatrix = QMatrix(0.5, 0, 0, 1.0, 0, 0)\n\n    matrix = QMatrix()\n    matrix =  scalingMatrix * rotationMatrix * translationMatrix\n\n    painter = QPainter(self)\n    painter.setPen(QPen(Qt.blue, 1, Qt::DashLine))\n    painter.drawRect(0, 0, 100, 100)\n\n    painter.setMatrix(matrix)\n\n    painter.setFont(QFont(\"Helvetica\", 24))\n    painter.setPen(QPen(Qt.black, 1))\n    painter.drawText(20, 10, \"QMatrix\")\n\n//! [2]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/mdiareasnippets.cpp",
    "content": "/############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################/\n\n//! [0]\n    mainWindow = QMainWindow()\n    mainWindow.setCentralWidget(mdiArea)\n//! [0]\n    \n//! [1]\n    mdiArea = QMdiArea()\n    subWindow1 = QMdiSubWindow()\n    subWindow1.setWidget(internalWidget1)\n    subWindow1.setAttribute(Qt.WA_DeleteOnClose)\n    mdiArea.addSubWindow(subWindow1)\n\n    subWindow2 = QMdiSubWindow()\n\tmdiArea.addSubWindow(internalWidget2)\n//! [1]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/medianodesnippet.cpp",
    "content": "#include <QtGui>\n\n#include <phonon/mediaobject.h>\n#include <phonon/audiooutput.h>\n#include <phonon/videowidget.h>\n#include <phonon/medianode.h>\n#include <phonon/path.h>\n\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n\n//![0]\n    Phonon::MediaObject *mediaObject = new Phonon::MediaObject;\n    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput;\n    Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget;\n\n    Phonon::createPath(mediaObject, audioOutput);\n    Phonon::createPath(mediaObject, videoWidget);\n\n    QList<Phonon::Path> inputPaths =\n        audioOutput->inputPaths();   // inputPaths = [ mediaObject ]\n    QList<Phonon::Path> outputPaths =\n        mediaObject->outputPaths(); // outputPaths = [ audioOutput, videoWidget ]\n//![0]\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/moc/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"myclass1.h\"\n\nMyClass::MyClass(QObject *) {}\nMyClass::~MyClass() {}\nvoid MyClass::mySlot() {}\n#undef MyClass\n\n#include \"myclass2.h\"\n\nMyClass::MyClass(QObject *) {}\nMyClass::~MyClass() {}\nvoid MyClass::setPriority(Priority) {}\nMyClass::Priority MyClass::priority() const { return High; }\n#undef MyClass\n\n#include \"myclass3.h\"\n\nMyClass::MyClass(QObject *) {}\nMyClass::~MyClass() {}\n#undef MyClass\n\nint main()\n{\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/moc/myclass1.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MYCLASS1_H\n#define MYCLASS1_H\n\n#include <QObject>\n\n#define MyClass MyClass1\n\n//! [0]\nclass MyClass : public QObject\n{\n    Q_OBJECT\n\npublic:\n    MyClass(QObject *parent = 0);\n    ~MyClass();\n\nsignals:\n    void mySignal();\n\npublic slots:\n    void mySlot();\n};\n//! [0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/moc/myclass2.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MYCLASS2_H\n#define MYCLASS2_H\n\n#include <QObject>\n\n#define MyClass MyClass2\n\n//! [0]\nclass MyClass : public QObject\n{\n    Q_OBJECT\n    Q_PROPERTY(Priority priority READ priority WRITE setPriority)\n    Q_ENUMS(Priority)\n\npublic:\n    enum Priority { High, Low, VeryHigh, VeryLow };\n\n    MyClass(QObject *parent = 0);\n    ~MyClass();\n\n    void setPriority(Priority priority);\n    Priority priority() const;\n};\n//! [0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/moc/myclass3.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MYCLASS3_H\n#define MYCLASS3_H\n\n#include <QObject>\n\n//! [0]\nclass MyClass : public QObject\n{\n    Q_OBJECT\n    Q_CLASSINFO(\"Author\", \"Oscar Peterson\")\n    Q_CLASSINFO(\"Status\", \"Active\")\n\npublic:\n    MyClass(QObject *parent = 0);\n    ~MyClass();\n};\n//! [0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/modelview-subclasses/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n    main.cpp\n\n    An example of a main window application that used a subclassed model\n    and view to display data from sound files.\n*/\n\n#include <QApplication>\n\n#include \"model.h\"\n#include \"view.h\"\n#include \"window.h\"\n\n/*!\n    The main function for the linear model example. This creates and\n    populates a model with long integers then displays the contents of the\n    model using a QListView widget.\n*/\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    MainWindow *window = new MainWindow;\n\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/modelview-subclasses/model.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  model.cpp\n\n  A simple model that uses a QVector as its data source.\n*/\n\n#include \"model.h\"\n\n/*!\n    Returns the number of items in the string list as the number of rows\n    in the model.\n*/\n\nint LinearModel::rowCount(const QModelIndex &parent) const\n{\n    Q_USING(parent);\n\n    return values.count();\n}\n\n/*\n    Returns an appropriate value for the requested data.\n    If the view requests an invalid index, an invalid variant is returned.\n    If a header is requested then we just return the column or row number,\n    depending on the orientation of the header.\n    Any valid index that corresponds to a string in the list causes that\n    string to be returned.\n*/\n\n/*!\n    Returns a model index for other component to use when referencing the\n    item specified by the given row, column, and type. The parent index\n    is ignored.\n*/\n\nQModelIndex LinearModel::index(int row, int column, const QModelIndex &parent) const\n{\n    if (parent == QModelIndex() && row >= 0 && row < rowCount()\n        && column == 0)\n        return createIndex(row, column, 0);\n    else\n        return QModelIndex();\n}\n\nQVariant LinearModel::data(const QModelIndex &index, int role) const\n{\n    Q_UNUSED(role);\n\n    if (!index.isValid())\n        return QVariant();\n\n    return values.at(index.row());\n}\n\n/*!\n    Returns Qt::ItemIsEditable so that all items in the vector can be edited.\n*/\n\nQt::ItemFlags LinearModel::flags(const QModelIndex &index) const\n{\n    // all items in the model are editable\n    return QAbstractListModel::flags(index) | Qt::ItemIsEditable;\n}\n\n/*!\n    Changes an item in the string list, but only if the following conditions\n    are met:\n\n    * The index supplied is valid.\n    * The index corresponds to an item to be shown in a view.\n    * The role associated with editing text is specified.\n\n    The dataChanged() signal is emitted if the item is changed.\n*/\n\nbool LinearModel::setData(const QModelIndex &index,\n                          const QVariant &value, int role)\n{\n    if (!index.isValid() || role != Qt::EditRole)\n        return false;\n    values.replace(index.row(), value.toInt());\n    emit dataChanged(index, index);\n    return true;\n}\n\n/*!\n    Inserts a number of rows into the model at the specified position.\n*/\n\nbool LinearModel::insertRows(int position, int rows, const QModelIndex &parent)\n{\n    beginInsertRows(parent, position, position + rows - 1);\n\n    values.insert(position, rows, 0);\n\n    endInsertRows();\n    return true;\n}\n\n/*!\n    Removes a number of rows from the model at the specified position.\n*/\n\nbool LinearModel::removeRows(int position, int rows, const QModelIndex &parent)\n{\n    beginRemoveRows(QModelIndex(), position, position+rows-1);\n\n    values.remove(position, rows);\n\n    endRemoveRows();\n    return true;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/modelview-subclasses/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MODEL_H\n#define MODEL_H\n\n#include <QAbstractListModel>\n#include <QObject>\n#include <qvector.h>\n\nclass LinearModel : public QAbstractListModel\n{\n    Q_OBJECT\npublic:\n    LinearModel(QObject *parent = 0)\n        : QAbstractListModel(parent) {}\n\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n    QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;\n    QVariant data(const QModelIndex &index, int role) const;\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    bool setData(const QModelIndex &index, const QVariant &value,\n                 int role = Qt::EditRole);\n\n    bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());\n    bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());\n\nprivate:\n    QVector<int> values;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/modelview-subclasses/view.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*!\n    view.cpp\n\n    Provides a view to represent a one-dimensional sequence of integers\n    obtained from a list model as a series of rows.\n*/\n\n#include <QAbstractItemModel>\n#include <QBrush>\n#include <QItemSelection>\n#include <QPainter>\n#include <QPaintEvent>\n#include <QPen>\n#include <QPoint>\n#include <QResizeEvent>\n#include <QScrollBar>\n#include <QSizePolicy>\n\n#include \"view.h\"\n\nLinearView::LinearView(QWidget *parent)\n    : QAbstractItemView(parent)\n{\n    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);\n}\n\n/*!\n    Returns the position of the item in viewport coordinates.\n*/\n\nQRect LinearView::itemViewportRect(const QModelIndex &index) const\n{\n    QRect rect = itemRect(index);\n    QRect result(rect.left() - horizontalScrollBar()->value(),\n                 rect.top() - verticalScrollBar()->value(),\n                 rect.width(), viewport()->height());\n\n    return result;\n}\n\n/*!\n    Returns the rectangle of the item at position \\a index in the\n    model. The rectangle is in contents coordinates.\n*/\n\nQRect LinearView::itemRect(const QModelIndex &index) const\n{\n    if (!index.isValid())\n        return QRect();\n    else\n        return QRect(index.row(), 0, 1, 1);\n}\n\n\nvoid LinearView::ensureVisible(const QModelIndex &index)\n{\n    QRect area = viewport()->rect();\n    QRect rect = itemViewportRect(index);\n\n    if (rect.left() < area.left())\n        horizontalScrollBar()->setValue(\n            horizontalScrollBar()->value() - rect.left());\n    else if (rect.right() > area.right())\n        horizontalScrollBar()->setValue(\n            horizontalScrollBar()->value() + rect.left() - area.width());\n}\n\n/*!\n    Returns the item that covers the coordinate given in the view.\n*/\n\nQModelIndex LinearView::itemAt(int x, int /* y */) const\n{\n    int row = x + horizontalScrollBar()->value();\n\n    return model()->index(row, 0, QModelIndex());\n}\n\n//void LinearView::dataChanged(const QModelIndex &/* topLeft */,\n//    const QModelIndex &/* bottomRight */)\n//{\n//    updateGeometries();\n//    if (isVisible())\n//        repaint();\n//}\n\nvoid LinearView::rowsInserted(const QModelIndex &/* parent */, int /* start */,\n    int /* end */)\n{\n    updateGeometries();\n    if (isVisible())\n        repaint();\n}\n\nvoid LinearView::rowsRemoved(const QModelIndex &/* parent */, int /* start */,\n    int /* end */)\n{\n    updateGeometries();\n    if (isVisible())\n        repaint();\n}\n/*\nvoid LinearView::verticalScrollbarAction(int action)\n{\n}\n\nvoid LinearView::horizontalScrollbarAction(int action)\n{\n}\n*/\n\n/*!\n    Select the items in the model that lie within the rectangle specified by\n    \\a rect, using the selection \\a command.\n*/\n\nvoid LinearView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)\n{\n    QModelIndex leftIndex = itemAt(rect.left(), 0);\n    QModelIndex rightIndex = itemAt(rect.right(), 0);\n\n    QItemSelection selection(leftIndex, rightIndex);\n\n    selectionModel()->select(selection, command);\n}\n\nQModelIndex LinearView::moveCursor(QAbstractItemView::CursorAction cursorAction,\n                                   Qt::KeyboardModifiers)\n{\n    QModelIndex current = currentIndex();\n\n    switch (cursorAction) {\n    case MoveLeft:{\n        if (current.row() > 0)\n            return model()->index(current.row() - 1, 0, QModelIndex());\n        else\n            return model()->index(0, 0, QModelIndex());\n        break;}\n    case MoveRight:{\n        if (current.row() < rows(current) - 1)\n            return model()->index(current.row() + 1, 0, QModelIndex());\n        else\n            return model()->index(rows(current) - 1, 0,QModelIndex());\n        break;}\n    case MoveUp:\n        return current;\n    case MoveDown:\n        return current;\n    case MovePageUp:\n        return current;\n    case MovePageDown:\n        return current;\n    case MoveHome:\n        return model()->index(0, 0, QModelIndex());\n    case MoveEnd:\n        return model()->index(rows(current) - 1, 0, QModelIndex());\n    default:\n        return current;\n    }\n}\n\nint LinearView::horizontalOffset() const\n{\n    return horizontalScrollBar()->value();\n}\n\nint LinearView::verticalOffset() const\n{\n    return verticalScrollBar()->value();\n}\n\n/*!\n    Returns a rectangle corresponding to the selection in viewport cooridinates.\n*/\n\nQRect LinearView::selectionViewportRect(const QItemSelection &selection) const\n{\n    int ranges = selection.count();\n\n    if (ranges == 0)\n        return QRect();\n\n    // Note that we use the top and bottom functions of the selection range\n    // since the data is stored in rows.\n\n    int firstRow = selection.at(0).top();\n    int lastRow = selection.at(0).top();\n\n    for (int i = 0; i < ranges; ++i) {\n        firstRow = qMin(firstRow, selection.at(i).top());\n        lastRow = qMax(lastRow, selection.at(i).bottom());\n    }\n\n    QModelIndex firstItem = model()->index(qMin(firstRow, lastRow), 0,\n        QModelIndex());\n    QModelIndex lastItem = model()->index(qMax(firstRow, lastRow), 0,\n        QModelIndex());\n\n    QRect firstRect = itemViewportRect(firstItem);\n    QRect lastRect = itemViewportRect(lastItem);\n\n    return QRect(firstRect.left(), firstRect.top(),\n        lastRect.right() - firstRect.left(), firstRect.height());\n}\n\nvoid LinearView::paintEvent(QPaintEvent *event)\n{\n    QPainter painter(viewport());\n\n    QRect updateRect = event->rect();\n    QBrush background(Qt::black);\n    QPen foreground(Qt::white);\n\n    painter.fillRect(updateRect, background);\n    painter.setPen(foreground);\n\n    QModelIndex firstItem = itemAt(updateRect.left(), updateRect.top());\n    if (!firstItem.isValid())\n        firstItem = model()->index(0, 0, QModelIndex());\n\n    QModelIndex lastItem = itemAt(updateRect.right(), updateRect.bottom());\n    if (!lastItem.isValid())\n        lastItem = model()->index(rows() - 1, 0, QModelIndex());\n\n    int x = updateRect.left();\n    //int top = updateRect.top();\n    //int bottom = updateRect.bottom();\n\n    int row = firstItem.row();\n    QModelIndex index = model()->index(row, 0, QModelIndex());\n    int value = model()->data(index, Qt::DisplayRole).toInt();\n    int midPoint = viewport()->height()/2;\n    int y2 = midPoint - int(value * midPoint/255.0);\n\n    while (row <= lastItem.row()) {\n\n        QModelIndex index = model()->index(row, 0, QModelIndex());\n        int value = model()->data(index, Qt::DisplayRole).toInt();\n\n        int y1 = y2;\n        y2 = midPoint - int(value * midPoint/255.0);\n\n        painter.drawLine(x-1, y1, x, y2);\n        ++row; ++x;\n    }\n}\n\nvoid LinearView::resizeEvent(QResizeEvent * /* event */)\n{\n    updateGeometries();\n}\n\nvoid LinearView::updateGeometries()\n{\n    if (viewport()->width() < rows()) {\n        horizontalScrollBar()->setPageStep(viewport()->width());\n        horizontalScrollBar()->setRange(0, rows() - viewport()->width() - 1);\n    }\n}\n\nQSize LinearView::sizeHint() const\n{\n    return QSize(rows(), 200);\n}\n\nint LinearView::rows(const QModelIndex &index) const\n{\n    return model()->rowCount(model()->parent(index));\n}\n\nbool LinearView::isIndexHidden(const QModelIndex &index) const\n{\n    return false;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/modelview-subclasses/view.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef VIEW_H\n#define VIEW_H\n\n#include <QAbstractItemView>\n#include <QItemSelection>\n#include <QItemSelectionModel>\n#include <QModelIndex>\n#include <QRect>\n#include <QSize>\n#include <QWidget>\n\nclass LinearView : public QAbstractItemView\n{\n    Q_OBJECT\npublic:\n    LinearView(QWidget *parent = 0);\n\n    QRect itemViewportRect(const QModelIndex &index) const;\n    void ensureVisible(const QModelIndex &index);\n    QModelIndex itemAt(int x, int y) const;\n\nprotected slots:\n    /*void dataChanged(const QModelIndex &topLeft, const QModelIndex\n    &bottomRight);*/\n    void rowsInserted(const QModelIndex &parent, int start, int end);\n    void rowsRemoved(const QModelIndex &parent, int start, int end);\n    /*void selectionChanged(const QItemSelection &deselected, const QItemSelection &selected);\n    void verticalScrollbarAction(int action);\n    void horizontalScrollbarAction(int action);*/\n\nprotected:\n    void setSelection(const QRect&, QItemSelectionModel::SelectionFlags command);\n    QRect selectionViewportRect(const QItemSelection &selection) const;\n    QRect itemRect(const QModelIndex &item) const;\n    bool isIndexHidden(const QModelIndex &index) const;\n    int horizontalOffset() const;\n    int verticalOffset() const;\n    QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction,\n                           Qt::KeyboardModifiers modifiers);\n\n    void paintEvent(QPaintEvent *event);\n    void resizeEvent(QResizeEvent *event);\n    QSize sizeHint() const;\n\nprivate:\n    int rows(const QModelIndex &index = QModelIndex()) const;\n    void updateGeometries();\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/modelview-subclasses/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QAction>\n#include <QDataStream>\n#include <QMenu>\n#include <QMenuBar>\n#include <QFile>\n#include <QFileDialog>\n#include <QListView>\n\n#include \"window.h\"\n\nMainWindow::MainWindow(QWidget *parent)\n    : QMainWindow(parent)\n{\n    setWindowTitle(\"Model/View example\");\n\n    setupModelView();\n\n    QAction *openAction = new QAction(tr(\"&Open\"), this);\n    QAction *quitAction = new QAction(tr(\"E&xit\"), this);\n    QMenu *fileMenu = new QMenu(tr(\"&File\"), this);\n    fileMenu->addAction(openAction);\n    fileMenu->addAction(quitAction);\n    menuBar()->addMenu(fileMenu);\n\n    connect(openAction, SIGNAL(triggered()), this, SLOT(selectOpenFile()));\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n\n    setCentralWidget(view);\n}\n\nvoid MainWindow::setupModelView()\n{\n    model = new LinearModel(this);\n    view = new LinearView(this);\n    view->setModel(model);\n}\n\nvoid MainWindow::selectOpenFile()\n{\n    QString fileName = QFileDialog::getOpenFileName(this,\n        tr(\"Select a file to open\"), \"\", tr(\"Sound files (*.wav)\"));\n    \n    if (!fileName.isEmpty())\n        openFile(fileName);\n}\n\nvoid MainWindow::openFile(const QString &fileName)\n{\n    QFile file(fileName);\n    int length = file.size();\n\n    if (file.open(QFile::ReadOnly)) {\n        model->removeRows(0, model->rowCount());\n\n        int rows = (length - 0x2c)/2;\n        model->insertRows(0, rows);\n\n        // Perform some dodgy tricks to extract the data from the file.\n        QDataStream stream(&file);\n        stream.setByteOrder(QDataStream::LittleEndian);\n\n        Q_INT16 left;\n        Q_INT16 right;\n\n        for (int row = 0; row < rows; ++row) {\n            QModelIndex index = model->index(row);\n\n            stream >> left >> right;\n            model->setData(index, int(left / 256));\n        }\n    }\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/modelview-subclasses/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n#include <QString>\n#include <QWidget>\n\n#include \"model.h\"\n#include \"view.h\"\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\npublic:\n    MainWindow::MainWindow(QWidget *parent = 0);\n\npublic slots:\n    void selectOpenFile();\n\nprivate:\n    void setupModelView();\n    void openFile(const QString &fileName);\n\n    LinearModel *model;\n    LinearView *view;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/myscrollarea.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nimport sys\n\nclass MyScrollArea (QAbstractScrollArea):\n    widget = None\n\n    def __init__(widget):\n        self.setWidget(widget);\n\n    def setWidget(w):\n        self.widget = w;\n        self.widget.setParent(viewport());\n        if not self.widget.testAttribute(Qt.WA_Resized):\n            self.widget.resize(widget.sizeHint())\n\n        self.verticalScrollBar().setValue(0)\n        self.verticalScrollBar().setValue(0)\n\n        self.updateArea()\n\n\n    def updateWidgetPosition():\n//! [0]\n        hvalue = self.horizontalScrollBar().value()\n        vvalue = self.verticalScrollBar().value()\n        topLeft = self.viewport().rect().topLeft()\n\n        self.widget.move(topLeft.x() - hvalue, topLeft.y() - vvalue)\n//! [0]\n\n\n    def scrollContentsBy(dx, dy):\n        self.updateWidgetPosition()\n\n    def updateArea():\n//! [1]\n        areaSize = viewport().size()\n        widgetSize = widget.size()\n\n        self.verticalScrollBar().setPageStep(widgetSize.height())\n        self.horizontalScrollBar().setPageStep(widgetSize.width())\n        self.verticalScrollBar().setRange(0, widgetSize.height() - areaSize.height())\n        self.horizontalScrollBar().setRange(0, widgetSize.width() - areaSize.width())\n        self.updateWidgetPosition()\n//! [1]\n\n    def resizeEvent(QResizeEvent):\n        self.updateArea()\n\napp = QApplication(sys.argv)\npixmap = QPixmap(\"mypixmap.png\")\nlabel = QLabel()\nlabel.setPixmap(pixmap)\narea = MyScrollArea(label)\narea.resize(300, 300)\narea.show()\n\narea.setWidget(label)\n\napp.exec_();\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/network/tcpwait.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nfrom PySide.QtGui import *\nfrom PySide.QtNetwork import QTcpSocket\n\ndef main():\n    app = QCoreApplication()\n\n    socket = QTcpSocket()\n    socket.connectToHost(\"localhost\", 1025)\n\n//! [0]\n    numRead = 0\n    numReadTotal = 0\n\n    while(True):\n        buffer  = socket.read(50)\n        # do whatever with array\n        numReadTotal += buffer.size()\n        if (buffer.size() == 0 && !socket.waitForReadyRead()):\n            break\n//! [0]\n    return app.exec_()\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/ntfsp.cpp",
    "content": "\n\n//! [0]\nextern Q_CORE_EXPORT int qt_ntfs_permission_lookup;\n//! [0]\n\n//! [1]\nqt_ntfs_permission_lookup += 1 // turn checking on\nqt_ntfs_permission_lookup += 1 // turn it off again\n//! [1]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/painterpath/painterpath.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n\n\nint main(int argc, char **argv)\n{\n    QApplication app(argc, argv);\n\n    QImage image(100, 100, QImage::Format_RGB32);\n\n    QPainterPath path;\n    path.addRect(20, 20, 60, 60);\n\n    path.moveTo(0, 0);\n    path.cubicTo(99, 0,  50, 50,  99, 99);\n    path.cubicTo(0, 99,  50, 50,  0, 0);\n\n    QPainter painter(&image);\n    painter.fillRect(0, 0, 100, 100, Qt::white);\n\n    painter.save();\n    painter.translate(0.5, 0.5);\n    painter.setPen(QPen(QColor(79, 106, 25), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));\n    painter.setBrush(QColor(122, 163, 39));\n    painter.setRenderHint(QPainter::Antialiasing);\n\n    painter.drawPath(path);\n\n    painter.restore();\n    painter.end();\n\n    QLabel lab;\n    lab.setPixmap(QPixmap::fromImage(image));\n    lab.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/anyHTMLElement.xq",
    "content": "doc('data.xml')/*:body\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/anyXLinkAttribute.xq",
    "content": "declare namespace xlink = \"http://www.w3.org/1999/xlink\";\ndoc('image.svg')//@xlink:*\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/bracesIncluded.xq",
    "content": "<e>{sum((1, 2, 3))}</e>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/bracesIncludedResult.xml",
    "content": "<e>6</e>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/bracesOmitted.xq",
    "content": "<e>sum({(1, 2, 3)})</e>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/bracesOmittedResult.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<e>sum(1 2 3)</e>"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/computedTreeFragment.xq",
    "content": "declare default element namespace \"http://example.com/Namespace\";\ndeclare variable $documentElementName := \"doc\";\n\nelement {$documentElementName}\n{\n    attribute xml:base {\"http://example.com/\"},\n    element anotherElement\n    {\n        comment {\" a comment \"},\n        processing-instruction target {\"data\"},\n        element anotherElement {()},\n        text {\"some text\"}\n    }\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/copyAttribute.xq",
    "content": "<html>\n    <body>\n        <p>\n        {\n            doc('feed.rss')/rss/@version\n        }\n        </p>\n    </body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/copyID.xq",
    "content": "(: Copy the value of xml:id attribute from other.html. This is a comment by the way! :)\n<html xmlns=\"http://www.w3.org/1999/xhtml/\"\n      xml:id=\"{doc(\"other.html\")/html/@xml:id}\"/>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/directTreeFragment.xq",
    "content": "<doc xmlns=\"http://example.com/Namespace\" xml:base=\"http://example.com/\">\n\n    <!-- a comment -->\n    <?target data?>\n    <anotherElement/>\n    some text\n</doc>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/doc.txt",
    "content": "<doc>\n  <p>\n    <span>1</span>\n    <span>2</span>\n  </p>\n  <p>\n    <span>3</span>\n    <span>4</span>\n  </p>\n  <p>\n    <span>5</span>\n    <span>6</span>\n  </p>\n  <p>\n    <span>7</span>\n    <span>8</span>\n  </p>\n  <p>\n    <span>9</span>\n    <span>a</span>\n  </p>\n  <p>\n    <span>b</span>\n    <span>c</span>\n  </p>\n  <p>\n    <span>d</span>\n    <span>e</span>\n  </p>\n  <p>\n    <span>f</span>\n    <span>0</span>\n  </p>\n</doc>\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/docPlainHTML.xq",
    "content": "doc(\"myPlainHTML.html\")/body\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/docPlainHTML2.xq",
    "content": "doc(\"myPlainHTML.html\")/html/body\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML.xq",
    "content": "declare default element namespace \"http://www.w3.org/1999/xhtml\";\n<html>\n    <body>\n        {\n            for $i in doc(\"testResult.xml\")/tests/test[@status = \"failure\"]\n            order by $i/@name\n            return <p>{$i/@name}</p>\n        }\n    </body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/embedDataInXHTML2.xq",
    "content": "declare namespace x = \"http://www.w3.org/1998/xhtml\";\n<x:html>\n    <x:body>\n        {\n            for $i in doc(\"testResult.xml\")/tests/test[@status = \"failure\"]\n            order by $i/@name\n            return <x:p>{$i/@name}</x:p>\n        }\n    </x:body>\n</x:html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/emptyParagraphs.xq",
    "content": "doc('index.html')//p[string-length(.) = 0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/escapeCurlyBraces.xq",
    "content": "<doc>\n    This is one left followed by one right curly brace: {{ }}\n    Here they are again, but with character references: &#x7B; &#x7D;\n</doc>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xml",
    "content": "<p>\"I hate quotations\" -- Ralph Waldo Emerson\" \n '\"I hate quotations\"\" -- Ralph Waldo Emerson\"', appeared above</p>"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/escapeStringLiterals.xq",
    "content": "<p>\n{\n    \"\"\"I hate quotations\"\" -- Ralph Waldo Emerson\"\"\",\n    \"&#xA;\",\n    '''\"I hate quotations\"\" -- Ralph Waldo Emerson\"'', appeared above'\n}\n</p>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/expressionInsideAttribute.xq",
    "content": "declare variable $additionalClass := \"example\";\n<p class=\"important {$additionalClass} obsolete\"/>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/filterOnPath.xq",
    "content": "let $doc := doc('doc.txt')\nreturn ($doc/doc/p/span)[1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/filterOnStep.xq",
    "content": "let $doc := doc('doc.txt')\nreturn $doc/doc/p/span[1]"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/firstParagraph.xq",
    "content": "doc(\"index.html\")/html/body/p[@xml:id = \"thatSpecialOne\"]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/fnStringOnAttribute.xq",
    "content": "<html>\n    <body>\n        <p>\n        {\n            string(doc('feed.rss')/rss/@version)\n        }\n        </p>\n    </body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/forClause.xq",
    "content": "for $i in(reverse(1 to 10)),\n    $d in xs:integer(doc(\"numbers.xml\")/numbers/number)\nreturn ($i + $d)\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/forClause2.xq",
    "content": "for $i in(reverse(1 to 10)),\n    $d in xs:integer(doc(\"numbers.xml\")/numbers/number)\nreturn $i + $d\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/forClauseOnFeed.xq",
    "content": "for $item in doc('feed.rss')//item\nreturn <p>\n        {\n            $item/description/node()\n        }\n       </p>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/indented.xml",
    "content": "<a>\n   <b/>\n   <c/>\n   <p>Some Text</p>\n</a>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/introAcneRemover.xq",
    "content": "<result>\n    <para>The following skin care products have shipped, ordered by shipping date(oldest first):</para>\n    {\n        for $i in doc(\"myOrders.xml\")/orders/order[@product = \"Acme Skin Care\"]\n        order by xs:date($i/@shippingDate) descending\n        return $i\n    }\n</result>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/introExample2.xq",
    "content": "<bibliography>\n{\n    doc($file)/bib/book[publisher = $publisher and @year > $year]/<book year=\"{@year}\">{title}</book>\n}\n</bibliography>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/introFileHierarchy.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<directory name=\"home\">\n\n    <file name=\"myNote.txt\" mimetype=\"text/plain\" size=\"8\" extension=\"txt\" uri=\"file:///home/frans/myNote.txt\">\n        <content asBase64Binary=\"TXkgTm90ZSE=\" asStringFromUTF-8=\"My Note!\"/>\n    </file>\n\n    <directory name=\"src\">\n        ...\n    </directory>\n\n    ...\n\n</directory>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/introNavigateFS.xq",
    "content": "declare variable $myRoot := <e/>; (: This line is a dummy and shouldn't appear in the documentation. :)\n<html>\n    <body>\n        {\n            $myRoot//file[@mimetype = 'text/xml' or @mimetype = 'application/xml']\n            /\n            (if(doc-available(@uri))\n             then ()\n             else <p>Failed to parse file {@uri}.</p>)\n        }\n    </body>\n</html>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/introductionExample.xq",
    "content": "<bibliography>\n{doc(\"library.xml\")/bib/book[publisher=\"Addison-Wesley\" and @year>1991]/<book year=\"{@year}\">{title}</book>}\n</bibliography> \n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/invalidLetOrderBy.xq",
    "content": "let $i := (2, 3, 1)\norder by $i[1]\nreturn $i\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/items.xq",
    "content": "<aNode/>,\nxs:base64Binary(\"FFFF\"),\ncurrent-date(),\n3e3, (: A floating point value :)\nattribute {\"name\"} {()}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/letOrderBy.xq",
    "content": "for $a in (8, -4, 2)\nlet $b := ($a * -1, $a)\norder by $a\nreturn $b\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/literalsAndOperators.xq",
    "content": "declare variable $date := fn:current-date(); (: This line should not be part of the example. It exists in order to make the query valid. :)\nfn:current-date() - $date > xs:dayTimeDuration(\"P365D\")\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/mobeyDick.xml",
    "content": "<book xmlns:dc='http://purl.org/dc/elements/1.1'\n      xmlns='http://example.com/MyDefault'>\n    <dc:title>Mobey Dick</dc:title> ...\n</book>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/nextLastParagraph.xq",
    "content": "doc('index.html')//p[last() - 1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsAreExpressions.xq",
    "content": "let $docURI := 'maybeNotWellformed.xml'\nreturn if(doc-available($docURI))\n       then doc($docURI)//p/<para>{./node()}</para>\n       else <para>Failed to load {$docURI}</para>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/nodeConstructorsInPaths.xq",
    "content": "doc('feed.rss')//item/<p>{description/node()}</p>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/nodeTestChildElement.xq",
    "content": "doc('index.html')/descendant-or-self::element(p)/child::element(span)\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/notIndented.xml",
    "content": "<a><b/><c/><p>Some Text</p></a>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/oneElementConstructor.xq",
    "content": "<myElement/>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/paragraphsExceptTheFiveFirst.xq",
    "content": "doc('index.html')//p[position() > 5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/paragraphsWithTables.xq",
    "content": "doc('index.html')/html/body/p[table]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/pathAB.xq",
    "content": "doc('index.html')//p/span\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/pathsAllParagraphs.xq",
    "content": "doc('index.html')//p\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/simpleHTML.xq",
    "content": "doc(\"index.html\")/html/body/p[@class=\"example\"]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/simpleXHTML.xq",
    "content": "declare namespace x = \"http://www.w3.org/1999/xhtml/\";\ndoc(\"index.html\")/x:html/x:body/x:p[@class=\"example\"]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/svgDocumentElement.xml",
    "content": "<svg xmlns=\"http://www.w3.org/2000/svg\"/>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/tablesInParagraphs.xq",
    "content": "doc('index.html')/html/body/p/table\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/twoSVGElements.xq",
    "content": "declare namespace s = \"http://www.w3.org/2000/svg\";\ndeclare default element namespace \"http://www.w3.org/2000/svg\";\nlet $doc := doc('image.svg')\nreturn ($doc/svg,\n        $doc/s:svg)\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/xmlStylesheet.xq",
    "content": "<?xml-stylesheet type=\"test/xsl\" href=\"formatter.xsl\"?>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/xsBooleanTrue.xq",
    "content": "xs:boolean(\"true\")\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/patternist/xsvgDocumentElement.xml",
    "content": "<x:svg xmlns:x=\"http://www.w3.org/2000/svg\"/>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/persistentindexes/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n#include \"model.h\"\n\n/*!\n    The main window constructor creates and populates a model with values\n    from a string list then displays the contents of the model using a\n    QListView widget.\n*/\n\nMainWindow::MainWindow(QWidget *parent)\n    : QMainWindow(parent)\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *itemsMenu = new QMenu(tr(\"&Items\"));\n\n    insertAction = itemsMenu->addAction(tr(\"&Insert Item\"));\n    removeAction = itemsMenu->addAction(tr(\"&Remove Item\"));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(itemsMenu);\n\n    QStringList numbers;\n    numbers << tr(\"One\") << tr(\"Two\") << tr(\"Three\") << tr(\"Four\") << tr(\"Five\")\n            << tr(\"Six\") << tr(\"Seven\") << tr(\"Eight\") << tr(\"Nine\") << tr(\"Ten\");\n\n    model = new StringListModel(numbers);\n    QListView *view = new QListView(this);\n    view->setModel(model);\n\n    selectionModel = view->selectionModel();\n\n    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));\n    connect(insertAction, SIGNAL(triggered()), this, SLOT(insertItem()));\n    connect(removeAction, SIGNAL(triggered()), this, SLOT(removeItem()));\n    connect(selectionModel,\n            SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),\n            this, SLOT(updateMenus(const QModelIndex &)));\n    \n    setCentralWidget(view);\n    setWindowTitle(\"View onto a string list model\");\n}\n\nvoid MainWindow::insertItem()\n{\n    if (!selectionModel->currentIndex().isValid())\n        return;\n\n    QString itemText = QInputDialog::getText(this, tr(\"Insert Item\"),\n        tr(\"Input text for the new item:\"));\n\n    if (itemText.isNull())\n        return;\n\n    int row = selectionModel->currentIndex().row();\n\n    if (model->insertRows(row, 1))\n        model->setData(model->index(row, 0), itemText, Qt::EditRole);\n}\n\nvoid MainWindow::removeItem()\n{\n    if (!selectionModel->currentIndex().isValid())\n        return;\n\n    int row = selectionModel->currentIndex().row();\n\n    model->removeRows(row, 1);\n}\n\nvoid MainWindow::updateMenus(const QModelIndex &currentIndex)\n{\n    insertAction->setEnabled(currentIndex.isValid());\n    removeAction->setEnabled(currentIndex.isValid());\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/persistentindexes/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include <QMainWindow>\n#include <QModelIndex>\n\nclass QAbstractItemModel;\nclass QAction;\nclass QItemSelectionModel;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow(QWidget *parent = 0);\n\nprivate slots:\n    void insertItem();\n    void removeItem();\n    void updateMenus(const QModelIndex &currentIndex);\n\nprivate:\n    QAbstractItemModel *model;\n    QAction *insertAction;\n    QAction *removeAction;\n    QItemSelectionModel *selectionModel;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/persistentindexes/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MODEL_H\n#define MODEL_H\n\n#include <QAbstractListModel>\n#include <QObject>\n#include <QStringList>\n\nclass StringListModel : public QAbstractListModel\n{\n    Q_OBJECT\npublic:\n    StringListModel(const QStringList &strings, QObject *parent = 0)\n        : QAbstractListModel(parent), stringList(strings) {}\n\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation,\n                        int role = Qt::DisplayRole) const;\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    bool setData(const QModelIndex &index, const QVariant &value,\n                 int role = Qt::EditRole);\n\n    bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());\n    bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());\n\nprivate:\n    QStringList stringList;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/phonon/samplebackend/main.cpp",
    "content": "//! [snippet]\nQObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args)\n{\n    switch (c) {\n    case MediaObjectClass:\n        return new MediaObject(parent);\n    case VolumeFaderEffectClass:\n        return new VolumeFaderEffect(parent);\n    case AudioOutputClass:\n        return new AudioOutput(parent);\n    case AudioDataOutputClass:\n        return new AudioDataOutput(parent);\n    case VisualizationClass:\n        return new Visualization(parent);\n    case VideoDataOutputClass:\n        return new VideoDataOutput(parent);\n    case EffectClass:\n        return new Effect(args[0].toInt(), parent);\n    case VideoWidgetClass:\n        return new VideoWidget(qobject_cast<QWidget *>(parent));\n    }\n    return 0;\n}\n\nQSet<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const\n{\n    QSet<int> set;\n    switch(type)\n    {\n    case Phonon::AudioOutputDeviceType:\n        // use AudioDeviceEnumerator to list ALSA and OSS devices\n        set << 10000 << 10001;\n        break;\n    case Phonon::AudioCaptureDeviceType:\n        set << 20000 << 20001;\n        break;\n    case Phonon::VideoOutputDeviceType:\n        break;\n    case Phonon::VideoCaptureDeviceType:\n        set << 30000 << 30001;\n        break;\n    case Phonon::VisualizationType:\n    case Phonon::AudioCodecType:\n    case Phonon::VideoCodecType:\n    case Phonon::ContainerFormatType:\n        break;\n    case Phonon::EffectType:\n        set << 0x7F000001;\n        break;\n    }\n    return set;\n}\n\nQHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescriptionType type, int index) const\n{\n    QHash<QByteArray, QVariant> ret;\n    switch (type) {\n    case Phonon::AudioOutputDeviceType:\n        switch (index) {\n        case 10000:\n            ret.insert(\"name\", QLatin1String(\"internal Soundcard\"));\n            break;\n        case 10001:\n            ret.insert(\"name\", QLatin1String(\"USB Headset\"));\n            ret.insert(\"icon\", KIcon(\"usb-headset\"));\n            ret.insert(\"available\", false);\n            break;\n        }\n        break;\n    case Phonon::AudioCaptureDeviceType:\n        switch (index) {\n        case 20000:\n            ret.insert(\"name\", QLatin1String(\"Soundcard\"));\n            ret.insert(\"description\", QLatin1String(\"first description\"));\n            break;\n        case 20001:\n            ret.insert(\"name\", QLatin1String(\"DV\"));\n            ret.insert(\"description\", QLatin1String(\"second description\"));\n            break;\n        }\n        break;\n    case Phonon::VideoOutputDeviceType:\n        break;\n    case Phonon::VideoCaptureDeviceType:\n        switch (index) {\n        case 30000:\n            ret.insert(\"name\", QLatin1String(\"USB Webcam\"));\n            ret.insert(\"description\", QLatin1String(\"first description\"));\n            break;\n        case 30001:\n            ret.insert(\"name\", QLatin1String(\"DV\"));\n            ret.insert(\"description\", QLatin1String(\"second description\"));\n            break;\n        }\n        break;\n    case Phonon::VisualizationType:\n        break;\n    case Phonon::AudioCodecType:\n        break;\n    case Phonon::VideoCodecType:\n        break;\n    case Phonon::ContainerFormatType:\n        break;\n    case Phonon::EffectType:\n        switch (index) {\n        case 0x7F000001:\n            ret.insert(\"name\", QLatin1String(\"Delay\"));\n            ret.insert(\"description\", QLatin1String(\"Simple delay effect with time, feedback and level controls.\"));\n            break;\n        }\n        break;\n    }\n    return ret;\n}\n//! [snippet]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/phonon.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n    \n\nWindow::Window()\n{\n    {\n//![0]\n    Phonon::MediaObject *music =\n        Phonon::createPlayer(Phonon::MusicCategory,\n                             Phonon::MediaSource(\"/path/mysong.wav\"));\n    music->play();\n//![0]\n    }\n\n    {\n    QWidget *parentWidget = new QWidget;\n    QUrl url(\"Myfancymusic\");\n//![1]\n    Phonon::VideoPlayer *player =\n        new Phonon::VideoPlayer(Phonon::VideoCategory, parentWidget);\n    player->play(url);\n//![1]\n    }\n\n    {\n//![2]\n    Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);\n    mediaObject->setCurrentSource(Phonon::MediaSource(\"/mymusic/barbiegirl.wav\"));\n    Phonon::AudioOutput *audioOutput =\n        new Phonon::AudioOutput(Phonon::MusicCategory, this);\n    Phonon::Path path = Phonon::createPath(mediaObject, audioOutput);\n//![2]\n    \n//![3]\n    Phonon::Effect *effect =\n        new Phonon::Effect(\n            Phonon::BackendCapabilities::availableAudioEffects()[0], this);\n    path.insertEffect(effect);\n//![3]    \n    }\n\n    {\n//![4]\n    Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);\n\n    Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget(this);\n    Phonon::createPath(mediaObject, videoWidget);\n\n    Phonon::AudioOutput *audioOutput =\n        new Phonon::AudioOutput(Phonon::VideoCategory, this);\n    Phonon::createPath(mediaObject, audioOutput);\n//![4]\n//![5]\n    mediaObject->play();\n//![5]\n    }\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/phononeffectparameter.cpp",
    "content": "#include <QtGui>\n\n#include <phonon/backendcapabilities.h>\n#include <phonon/phononnamespace.h>\n#include <phonon/effect.h>\n#include <phonon/effectparameter.h>\n#include <phonon/effectwidget.h>\n\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n    app.setApplicationName(\"effectsnippets\");\n\n    QList<Phonon::EffectDescription> effects =\n        Phonon::BackendCapabilities::availableAudioEffects();\n\n    Phonon::Effect *effect = new Phonon::Effect(effects.at(3));\n    \n//![0]\n    QList<Phonon::EffectParameter> parameters = effect->parameters();\n\n    foreach(Phonon::EffectParameter parameter, parameters) {\n        // Do something with parameter\n    }\n//![0]\n\n//![1]\n    Phonon::EffectWidget *effectWidget = new Phonon::EffectWidget(effect);\n//![1]\n    \n    effectWidget->show();\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/phononobjectdescription.cpp",
    "content": "#include <QtGui>\n\n#include <phonon/phononnamespace.h>\n#include <phonon/audiooutput.h>\n#include <phonon/seekslider.h>\n#include <phonon/mediaobject.h>\n#include <phonon/volumeslider.h>\n#include <phonon/backendcapabilities.h>\n#include <phonon/effect.h>\n#include <phonon/effectparameter.h>\n#include <phonon/objectdescriptionmodel.h>\n#include <QList>\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n    \n//![0]\n    QList<Phonon::EffectDescription> effectDescriptions =\n            Phonon::BackendCapabilities::availableAudioEffects();\n\n//![1]\n    QList<Phonon::AudioOutputDevice> audioOutputDevices =\n            Phonon::BackendCapabilities::availableAudioOutputDevices();\n\n//![1]\n    foreach (Phonon::EffectDescription effectDescription, effectDescriptions) {\n        Phonon::Effect *effect = new Phonon::Effect(effectDescription);\n\n        // ... Do something with the effect, like insert it into a media graph\n    }\n\n    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput;\n\n    audioOutput->setOutputDevice(audioOutputDevices[0]);\n//![0]\n\n    return app.exec();\n\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/picture/picture.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n//! [0]\n        picture = QPicture()\n        painter = QPainter()\n        painter.begin(picture)            # paint in picture\n        painter.drawEllipse(10,20, 80,70) # draw an ellipse\n        painter.end()                     # painting done\n        picture.save(\"drawing.pic\")       # save picture\n//! [0]\n\n//! [1]\n        picture = QPicture()\n        picture.load(\"drawing.pic\")           # load picture\n        painter = QPainter()\n        painter.begin(myImage)                # paint in myImage\n        painter.drawPicture(0, 0, picture)    # draw the picture at (0,0)\n        painter.end()                         # painting done\n//! [1]\n\n//! [2]\n        list = QPicture.inputFormatList()\n        for string in list:\n            myProcessing(string)\n//! [2]\n\n//! [3]\n        list = QPicture.outputFormatList()\n        for string in list:\n            myProcessing(string)\n//! [3]\n\n//! [4]\n        iio = QPictureIO()\n        pixmap = QPixmap()\n        iio.setFileName(\"vegeburger.pic\")\n        if iio.read():         # OK\n            picture = iio.picture()\n            painter = QPainter(pixmap)\n            painter.drawPicture(0, 0, picture)\n        \n//! [4]\n\n//! [5]\n        iio = QPictureIO()\n        picture = QPicture()\n        painter = QPainter(picture)\n        painter.drawPixmap(0, 0, pixmap)\n        iio.setPicture(picture)\n        iio.setFileName(\"vegeburger.pic\")\n        iio.setFormat(\"PIC\")\n        if iio.write():\n            return True # returned true if written successfully\n//! [5]\n\n//! [6]\ndef readSVG(picture):\n    # read the picture using the picture.ioDevice()\n\n//! [6]\n\n\n//! [7]\ndef writeSVG(picture):\n    # write the picture using the picture.ioDevice()\n\n//! [7]\n\n\n//! [8]\n    # add the SVG picture handler\n    # ...\n//! [8]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/plaintextlayout/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Window *window = new Window;\n    window->resize(337, 343);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/plaintextlayout/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <math.h>\n\n#include \"window.h\"\n\nWindow::Window(QWidget *parent)\n    : QWidget(parent)\n{\n    text = QString(\"Support for text rendering and layout in Qt 4 has been \"\n                   \"redesigned around a system that allows textual content to \"\n                   \"be represented in a more flexible way than was possible \"\n                   \"with Qt 3. Qt 4 also provides a more convenient \"\n                   \"programming interface for editing documents. These \"\n                   \"improvements are made available through a reimplementation \"\n                   \"of the existing text rendering engine, and the \"\n                   \"introduction of several new classes. \"\n                   \"See the relevant module overview for a detailed discussion \"\n                   \"of this framework. The following sections provide a brief \"\n                   \"overview of the main concepts behind Scribe.\");\n\n    setWindowTitle(tr(\"Plain Text Layout\"));\n}\n\nvoid Window::paintEvent(QPaintEvent *event)\n{\n//! [0]\n    QTextLayout textLayout(text, font);\n    qreal margin = 10;\n    qreal radius = qMin(width()/2.0, height()/2.0) - margin;\n    QFontMetrics fm(font);\n\n    qreal lineHeight = fm.height();\n    qreal y = 0;\n\n    textLayout.beginLayout();\n\n    while (1) {\n        // create a new line \n        QTextLine line = textLayout.createLine();\n        if (!line.isValid())\n            break;\n\n        qreal x1 = qMax(0.0, pow(pow(radius,2)-pow(radius-y,2), 0.5));\n        qreal x2 = qMax(0.0, pow(pow(radius,2)-pow(radius-(y+lineHeight),2), 0.5));\n        qreal x = qMax(x1, x2) + margin;\n        qreal lineWidth = (width() - margin) - x;\n\n        line.setLineWidth(lineWidth);\n        line.setPosition(QPointF(x, margin+y));\n        y += line.height();\n    }\n\n    textLayout.endLayout();\n\n    QPainter painter;\n    painter.begin(this);\n    painter.setRenderHint(QPainter::Antialiasing);\n    painter.fillRect(rect(), Qt::white);\n    painter.setBrush(QBrush(Qt::black));\n    painter.setPen(QPen(Qt::black));\n    textLayout.draw(&painter, QPoint(0,0));\n\n    painter.setBrush(QBrush(QColor(\"#a6ce39\")));\n    painter.setPen(QPen(Qt::black));\n    painter.drawEllipse(QRectF(-radius, margin, 2*radius, 2*radius));\n    painter.end();\n//! [0]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/plaintextlayout/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QWidget>\n\nclass Window : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    Window(QWidget *parent = 0);\n\nprotected:\n    void paintEvent(QPaintEvent *event);\n\nprivate:\n    QFont font;\n    QString text;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/pointer/pointer.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QLabel>\n#include <QPointer>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n//! [0]\n    QPointer<QLabel> label = new QLabel;\n    label->setText(\"&Status:\");\n//! [0]\n\n//! [1]\n    if (label)\n//! [1] //! [2]\n        label->show();\n//! [2]\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/polygon/polygon.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n//! [0]\n        polygon = QPolygon()\n        polygon << QPoint(10, 20) << QPoint(20, 30)\n//! [0]\n\n//! [1]\n        polygon = QPolygonF()\n        polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2)\n//! [1]\n\n//! [2]\n        points = [ 10, 20, 30, 40 ]\n        polygon = QPolygon()\n        polygon.setPoints(2, points)\n//! [2]\n\n//! [3]\n        polygon = QPolygon()\n        polygon.setPoints(2, 10, 20, 30, 40)\n//! [3]\n\n//! [4]\n        polygon = QPolygon(1)\n        polygon[0] = QPoint(4, 5)\n        polygon.putPoints(1, 2, 6,7, 8,9)\n//! [4]\n\n//! [5]\n        polygon = QPolygon(3)\n        polygon.putPoints(0, 3, 4,5, 0,0, 8,9)\n        polygon.putPoints(1, 1, 6,7)\n//! [5]\n\n//! [6]\n        polygon1 = QPolygon()\n        polygon1.putPoints(0, 3, 1,2, 0,0, 5,6)\n        # polygon1 is now the three-point polygon(1,2, 0,0, 5,6)\n\n        polygon2 = QPolygon()\n        polygon2.putPoints(0, 3, 4,4, 5,5, 6,6)\n        # polygon2 is now (4,4, 5,5, 6,6)\n\n        polygon1.putPoints(2, 3, polygon2)\n        # polygon1 is now the five-point polygon(1,2, 0,0, 4,4, 5,5, 6,6)\n//! [6]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/porting4-dropevents/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    MyWidget window;\n    window.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/porting4-dropevents/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"window.h\"\n\nMyWidget::MyWidget(QWidget *parent)\n    : QWidget(parent)\n{\n    QLabel *textLabel = new QLabel(tr(\"Data:\"), this);\n    dataLabel = new QLabel(this);\n    dataLabel->setFixedSize(200, 200);\n\n    QVBoxLayout *layout = new QVBoxLayout(this);\n    layout->addWidget(textLabel);\n    layout->addWidget(dataLabel);\n\n    setAcceptDrops(true);\n    setWindowTitle(tr(\"Drop Events\"));\n}\n\n//! [0]\nvoid MyWidget::dragEnterEvent(QDragEnterEvent *event)\n{\n    if (event->mimeData()->hasText() || event->mimeData()->hasImage())\n        event->acceptProposedAction();\n}\n//! [0]\n\n//! [1]\nvoid MyWidget::dropEvent(QDropEvent *event)\n{\n    if (event->mimeData()->hasText())\n        dataLabel->setText(event->mimeData()->text());\n    else if (event->mimeData()->hasImage()) {\n        QVariant imageData = event->mimeData()->imageData();\n        dataLabel->setPixmap(qvariant_cast<QPixmap>(imageData));\n    }\n    event->acceptProposedAction();\n}\n//! [1]\n\n//! [2]\nvoid MyWidget::mousePressEvent(QMouseEvent *event)\n{\n//! [2]\n    QString text = dataLabel->text();\n    QPixmap iconPixmap(32, 32);\n    iconPixmap.fill(qRgba(255, 0, 0, 127));\n    QImage image(100, 100, QImage::Format_RGB32);\n    image.fill(qRgb(0, 0, 255));\n\n//! [3]\n    if (event->button() == Qt::LeftButton) {\n\n        QDrag *drag = new QDrag(this);\n        QMimeData *mimeData = new QMimeData;\n\n        mimeData->setText(text);\n        mimeData->setImageData(image);\n        drag->setMimeData(mimeData);\n        drag->setPixmap(iconPixmap);\n\n        Qt::DropAction dropAction = drag->exec();\n//! [3]\n        // ...\n//! [4]\n        event->accept();\n    }\n//! [4]\n    else if (event->button() == Qt::MidButton) {\n\n        QDrag *drag = new QDrag(this);\n        QMimeData *mimeData = new QMimeData;\n\n        mimeData->setImageData(image);\n        drag->setMimeData(mimeData);\n        drag->setPixmap(iconPixmap);\n\n        Qt::DropAction dropAction = drag->exec();\n        // ...\n        event->accept();\n    }\n//! [5]\n}\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/porting4-dropevents/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QString>\n#include <QStringList>\n#include <QWidget>\n\nclass QComboBox;\nclass QFrame;\nclass QLabel;\n\nclass MyWidget : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    MyWidget(QWidget *parent = 0);\n\nprotected:\n    void dragEnterEvent(QDragEnterEvent *event);\n    void dropEvent(QDropEvent *event);\n    void mousePressEvent(QMouseEvent *event);\n\nprivate:\n    QComboBox *mimeTypeCombo;\n    QFrame *dropFrame;\n    QLabel *dataLabel;\n    QString oldText;\n    QStringList oldMimeTypes;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/printing-qprinter/errors.cpp",
    "content": "//! [0]\n    printer = QPrinter()\n    printer.setOutputFormat(QPrinter.PdfFormat)\n    printer.setOutputFileName(\"/foobar/nonwritable.pdf\")\n    QPainter painter\n    if painter.begin(printer):  # failed to open file\n        print \"failed to open file, is it writable?\"\n        return 1\n    \n    painter.drawText(10, 10, \"Test\")\n    if !printer.Page():\n        print \"failed in flushing page to disk, disk full?\"\n        return 1\n    \n    painter.drawText(10, 10, \"Test 2\")\n    painter.end()\n//! [0]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/printing-qprinter/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include \"object.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Object object;\n    QTimer timer;\n    timer.setSingleShot(true);\n    timer.connect(&timer, SIGNAL(timeout()), &object, SLOT(print()));\n    timer.start(0);\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/printing-qprinter/object.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include \"object.h\"\n\nObject::Object(QObject *parent)\n    : QObject(parent)\n{\n}\n\nvoid Object::print()\n{\n    int numberOfPages = 10;\n    int lastPage = numberOfPages - 1;\n\n//! [0]\n    QPrinter printer(QPrinter::HighResolution);\n    printer.setOutputFileName(\"print.ps\");\n    QPainter painter;\n    painter.begin(&printer);\n\n    for (int page = 0; page < numberOfPages; ++page) {\n\n        // Use the painter to draw on the page.\n\n        if (page != lastPage)\n            printer.newPage();\n    }\n\n    painter.end();\n//! [0]\n    qApp->quit();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/printing-qprinter/object.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QObject>\n\nclass Object : public QObject\n{\n    Q_OBJECT\n\npublic:\n    Object(QObject *parent = 0);\n\npublic slots:\n    void print();\n};\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/process/process.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QProcess>\n\nbool zip()\n{\n//! [0]\n    gzip = QProcess()\n    gzip.start(\"gzip\", [\"-c\"])\n    if not gzip.waitForStarted():\n        return False\n\n    gzip.write(\"Qt rocks!\")\n    gzip.closeWriteChannel()\n\n    if not gzip.waitForFinished():\n        return False\n\n    result = gzip.readAll()\n//! [0]\n\n    gzip.start(\"gzip\", QStringList() << \"-d\" << \"-c\");\n    gzip.write(result);\n    gzip.closeWriteChannel();\n\n    if (!gzip.waitForFinished())\n        return false;\n\n    qDebug(\"Result: %s\", gzip.readAll().data());\n    return true;\n}\n\n\nint main()\n{\n    zip();\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qabstractsliderisnippet.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nQAbstractSliderPrivate::QAbstractSliderPrivate()\n    : minimum(0), maximum(99), singleStep(1), pageStep(10),\n      value(0), position(0), pressValue(-1), tracking(true), blocktracking(false), pressed(false),\n      invertedAppearance(false), invertedControls(false),\n      orientation(Qt::Horizontal), repeatAction(QAbstractSlider::SliderNoAction)\n{\n}\n\nQAbstractSliderPrivate::~QAbstractSliderPrivate()\n{\n}\n\noid QAbstractSlider::setRange(int min, int max)\n{\n    Q_D(QAbstractSlider);\n    int oldMin = d->minimum;\n    int oldMax = d->maximum;\n    d->minimum = min;\n    d->maximum = qMax(min, max);\n    if (oldMin != d->minimum || oldMax != d->maximum) {\n        sliderChange(SliderRangeChange);\n        emit rangeChanged(d->minimum, d->maximum);\n        setValue(d->value); // re-bound\n    }\n}\n\n\nvoid QAbstractSliderPrivate::setSteps(int single, int page)\n{\n    Q_Q(QAbstractSlider);\n    singleStep = qAbs(single);\n    pageStep = qAbs(page);\n    q->sliderChange(QAbstractSlider::SliderStepsChange);\n}\n\nAbstractSlider::QAbstractSlider(QWidget *parent)\n    :QWidget(*new QAbstractSliderPrivate, parent, 0)\n{\n}\n\nQAbstractSlider::QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent)\n    :QWidget(dd, parent, 0)\n{\n}\n\nQAbstractSlider::~QAbstractSlider()\n{\n}\n\nvoid QAbstractSlider::setOrientation(Qt::Orientation orientation)\n{\n    Q_D(QAbstractSlider);\n    if (d->orientation == orientation)\n        return;\n\n    d->orientation = orientation;\n    if (!testAttribute(Qt::WA_WState_OwnSizePolicy)) {\n        QSizePolicy sp = sizePolicy();\n        sp.transpose();\n        setSizePolicy(sp);\n        setAttribute(Qt::WA_WState_OwnSizePolicy, false);\n    }\n    update();\n    updateGeometry();\n}\n\nQt::Orientation QAbstractSlider::orientation() const\n{\n    Q_D(const QAbstractSlider);\n    return d->orientation;\n}\n\n\nvoid QAbstractSlider::setMinimum(int min)\n{\n    Q_D(QAbstractSlider);\n    setRange(min, qMax(d->maximum, min));\n}\n\nint QAbstractSlider::minimum() const\n{\n    Q_D(const QAbstractSlider);\n    return d->minimum;\n}\n\n\nvoid QAbstractSlider::setMaximum(int max)\n{\n    Q_D(QAbstractSlider);\n    setRange(qMin(d->minimum, max), max);\n}\n\nint QAbstractSlider::maximum() const\n{\n    Q_D(const QAbstractSlider);\n    return d->maximum;\n}\n\n\n\nvoid QAbstractSlider::setSingleStep(int step)\n{\n    Q_D(QAbstractSlider);\n    d->setSteps(step, d->pageStep);\n}\n\nint QAbstractSlider::singleStep() const\n{\n    Q_D(const QAbstractSlider);\n    return d->singleStep;\n}\n\n\nvoid QAbstractSlider::setPageStep(int step)\n{\n    Q_D(QAbstractSlider);\n    d->setSteps(d->singleStep, step);\n}\n\nint QAbstractSlider::pageStep() const\n{\n    Q_D(const QAbstractSlider);\n    return d->pageStep;\n}\n\noid QAbstractSlider::setTracking(bool enable)\n{\n    Q_D(QAbstractSlider);\n    d->tracking = enable;\n}\n\nbool QAbstractSlider::hasTracking() const\n{\n    Q_D(const QAbstractSlider);\n    return d->tracking;\n}\n\n\n\nvoid QAbstractSlider::setSliderDown(bool down)\n{\n    Q_D(QAbstractSlider);\n    bool doEmit = d->pressed != down;\n\n    d->pressed = down;\n\n    if (doEmit) {\n        if (down)\n            emit sliderPressed();\n        else\n            emit sliderReleased();\n    }\n\n    if (!down && d->position != d->value)\n        triggerAction(SliderMove);\n}\n\nbool QAbstractSlider::isSliderDown() const\n{\n    Q_D(const QAbstractSlider);\n    return d->pressed;\n}\n\n\nvoid QAbstractSlider::setSliderPosition(int position)\n{\n    Q_D(QAbstractSlider);\n    position = d->bound(position);\n    if (position == d->position)\n        return;\n    d->position = position;\n    if (!d->tracking)\n        update();\n    if (d->pressed)\n        emit sliderMoved(position);\n    if (d->tracking && !d->blocktracking)\n        triggerAction(SliderMove);\n}\n\nint QAbstractSlider::sliderPosition() const\n{\n    Q_D(const QAbstractSlider);\n    return d->position;\n}\n\n\n\nint QAbstractSlider::value() const\n{\n    Q_D(const QAbstractSlider);\n    return d->value;\n}\n\n//! [0]\nvoid QAbstractSlider::setValue(int value)\n//! [0]\n{\n    Q_D(QAbstractSlider);\n    value = d->bound(value);\n    if (d->value == value && d->position == value)\n        return;\n    d->value = value;\n    if (d->position != value) {\n        d->position = value;\n        if (d->pressed)\n            emit sliderMoved((d->position = value));\n    }\n#ifndef QT_NO_ACCESSIBILITY\n//! [1]\n    QAccessible::updateAccessibility(this, 0, QAccessible::ValueChanged);\n//! [1]\n#endif\n    sliderChange(SliderValueChange);\n    emit valueChanged(value);\n//! [2]\n}\n//! [2]\n\nbool QAbstractSlider::invertedAppearance() const\n{\n    Q_D(const QAbstractSlider);\n    return d->invertedAppearance;\n}\n\nvoid QAbstractSlider::setInvertedAppearance(bool invert)\n{\n    Q_D(QAbstractSlider);\n    d->invertedAppearance = invert;\n    update();\n}\n\n\n\nbool QAbstractSlider::invertedControls() const\n{\n    Q_D(const QAbstractSlider);\n    return d->invertedControls;\n}\n\nvoid QAbstractSlider::setInvertedControls(bool invert)\n{\n    Q_D(QAbstractSlider);\n    d->invertedControls = invert;\n}\n\nvoid QAbstractSlider::triggerAction(SliderAction action)\n{\n    Q_D(QAbstractSlider);\n    d->blocktracking = true;\n    switch (action) {\n    case SliderSingleStepAdd:\n        setSliderPosition(d->value + d->singleStep);\n        break;\n    case SliderSingleStepSub:\n        setSliderPosition(d->value - d->singleStep);\n        break;\n    case SliderPageStepAdd:\n        setSliderPosition(d->value + d->pageStep);\n        break;\n    case SliderPageStepSub:\n        setSliderPosition(d->value - d->pageStep);\n        break;\n    case SliderToMinimum:\n        setSliderPosition(d->minimum);\n        break;\n    case SliderToMaximum:\n        setSliderPosition(d->maximum);\n        break;\n    case SliderMove:\n    case SliderNoAction:\n        break;\n    };\n    emit actionTriggered(action);\n    d->blocktracking = false;\n    setValue(d->position);\n}\n\nvoid QAbstractSlider::setRepeatAction(SliderAction action, int thresholdTime, int repeatTime)\n{\n    Q_D(QAbstractSlider);\n    if ((d->repeatAction = action) == SliderNoAction) {\n        d->repeatActionTimer.stop();\n    } else {\n        d->repeatActionTime = repeatTime;\n        d->repeatActionTimer.start(thresholdTime, this);\n    }\n}\n\nQAbstractSlider::SliderAction QAbstractSlider::repeatAction() const\n{\n    Q_D(const QAbstractSlider);\n    return d->repeatAction;\n}\n\nvoid QAbstractSlider::timerEvent(QTimerEvent *e)\n{\n    Q_D(QAbstractSlider);\n    if (e->timerId() == d->repeatActionTimer.timerId()) {\n        if (d->repeatActionTime) { // was threshold time, use repeat time next time\n            d->repeatActionTimer.start(d->repeatActionTime, this);\n            d->repeatActionTime = 0;\n        }\n        if (d->repeatAction == SliderPageStepAdd)\n            d->setAdjustedSliderPosition(d->value + d->pageStep);\n        else if (d->repeatAction == SliderPageStepSub)\n            d->setAdjustedSliderPosition(d->value - d->pageStep);\n        else\n            triggerAction(d->repeatAction);\n    }\n}\n\noid QAbstractSlider::sliderChange(SliderChange)\n{\n    update();\n}\n\n\n#ifndef QT_NO_WHEELEVENT\nvoid QAbstractSlider::wheelEvent(QWheelEvent * e)\n{\n    Q_D(QAbstractSlider);\n    e->ignore();\n    if (e->orientation() != d->orientation && !rect().contains(e->pos()))\n        return;\n\n    static qreal offset = 0;\n    static QAbstractSlider *offset_owner = 0;\n    if (offset_owner != this){\n        offset_owner = this;\n        offset = 0;\n    }\n\n    int step = qMin(QApplication::wheelScrollLines() * d->singleStep, d->pageStep);\n    if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier))\n        step = d->pageStep;\n    offset += e->delta() * step / 120;\n    if (d->invertedControls)\n        offset = -offset;\n\n    if (qAbs(offset) < 1)\n        return;\n\n    int prevValue = d->value;\n    d->position = d->value + int(offset); // value will be updated by triggerAction()\n    triggerAction(SliderMove);\n    if (prevValue == d->value) {\n        offset = 0;\n    } else {\n        offset -= int(offset);\n        e->accept();\n    }\n}\n#endif\nvoid QAbstractSlider::keyPressEvent(QKeyEvent *ev)\n{\n    Q_D(QAbstractSlider);\n    SliderAction action = SliderNoAction;\n    switch (ev->key()) {\n#ifdef QT_KEYPAD_NAVIGATION\n        case Qt::Key_Select:\n            if (QApplication::keypadNavigationEnabled())\n                setEditFocus(!hasEditFocus());\n            else\n                ev->ignore();\n            break;\n        case Qt::Key_Back:\n            if (QApplication::keypadNavigationEnabled() && hasEditFocus()) {\n                setValue(d->origValue);\n                setEditFocus(false);\n            } else\n                ev->ignore();\n            break;\n#endif\n\n        // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird.\n        case Qt::Key_Left:\n#ifdef QT_KEYPAD_NAVIGATION\n            if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {\n                ev->ignore();\n                return;\n            }\n            if (QApplication::keypadNavigationEnabled() && d->orientation == Qt::Vertical)\n                action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;\n            else\n#endif\n            action = !d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd;\n            break;\n        case Qt::Key_Right:\n#ifdef QT_KEYPAD_NAVIGATION\n            if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {\n                ev->ignore();\n                return;\n            }\n            if (QApplication::keypadNavigationEnabled() && d->orientation == Qt::Vertical)\n                action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;\n            else\n#endif\n            action = !d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub;\n            break;\n        case Qt::Key_Up:\n#ifdef QT_KEYPAD_NAVIGATION\n            if (QApplication::keypadNavigationEnabled()) {\n                ev->ignore();\n                break;\n            }\n#endif\n            action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;\n            break;\n        case Qt::Key_Down:\n#ifdef QT_KEYPAD_NAVIGATION\n            if (QApplication::keypadNavigationEnabled()) {\n                ev->ignore();\n                break;\n            }\n#endif\n            action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;\n            break;\n        case Qt::Key_PageUp:\n            action = d->invertedControls ? SliderPageStepSub : SliderPageStepAdd;\n            break;\n        case Qt::Key_PageDown:\n            action = d->invertedControls ? SliderPageStepAdd : SliderPageStepSub;\n            break;\n        case Qt::Key_Home:\n            action = SliderToMinimum;\n            break;\n        case Qt::Key_End:\n            action = SliderToMaximum;\n            break;\n        default:\n            ev->ignore();\n            break;\n    }\n    if (action)\n        triggerAction(action);\n}\n\nvoid QAbstractSlider::changeEvent(QEvent *ev)\n{\n    Q_D(QAbstractSlider);\n    switch (ev->type()) {\n    case QEvent::EnabledChange:\n        if (!isEnabled()) {\n            d->repeatActionTimer.stop();\n            setSliderDown(false);\n        }\n        // fall through...\n    default:\n        QWidget::changeEvent(ev);\n    }\n}\n\nbool QAbstractSlider::event(QEvent *e)\n{\n#ifdef QT_KEYPAD_NAVIGATION\n    Q_D(QAbstractSlider);\n    switch (e->type()) {\n    case QEvent::FocusIn:\n        d->origValue = d->value;\n        break;\n    default:\n        break;\n    }\n#endif\n    \n    return QWidget::event(e);\n}\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qcalendarwidget/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QCalendarWidget>\n\nint main(int argc, char **argv)\n{\n    QApplication app(argc, argv);\n\n    QCalendarWidget calendar;\n    calendar.setSelectedDate(calendar.selectedDate().addDays(3));\n    calendar.setGridVisible(true);\n    calendar.show();\n\n    QCalendarWidget calendarMin;\n    calendarMin.setMinimumDate(calendarMin.selectedDate().addDays(-7));\n    calendarMin.setGridVisible(true);\n    calendarMin.show();\n\n    QCalendarWidget calendarMax;\n    calendarMax.setMaximumDate(calendarMax.selectedDate().addDays(7));\n    calendarMax.setGridVisible(true);\n    calendarMax.show();\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qcolumnview/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QStandardItemModel model;\n\n    QStandardItem *name = new QStandardItem(\"Name\");\n    QStandardItem *firstName = new QStandardItem(\"First Name\");\n    QStandardItem *lastName = new QStandardItem(\"Last Name\");\n\n    name->appendRow(firstName);\n    name->appendRow(lastName);\n    model.appendRow(name);\n\n    QStandardItem *john = new QStandardItem(\"John\");\n    QStandardItem *smith = new QStandardItem(\"Smith\");\n\n    firstName->appendRow(john);\n    lastName->appendRow(smith);\n\n    QStandardItem *address = new QStandardItem(\"Address\");\n    QStandardItem *street = new QStandardItem(\"Street\");\n    QStandardItem *city = new QStandardItem(\"City\");\n    QStandardItem *state = new QStandardItem(\"State\");\n    QStandardItem *country = new QStandardItem(\"Country\");\n\n    address->appendRow(street);\n    address->appendRow(city);\n    address->appendRow(state);\n    address->appendRow(country);\n    model.appendRow(address);\n\n    QColumnView columnView;\n    columnView.setModel(&model);\n    columnView.show();\n\n    return app.exec();\n}"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qdebug/qdebugsnippet.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QtDebug>\n\nclass Coordinate : public QObject\n{\npublic:\n    int myX, myY;\n\n    int x() const { return myX; };\n    int y() const { return myY; };\n};\n\n//! [0]\nQDebug operator<<(QDebug dbg, const Coordinate &c)\n{\n    dbg.nospace() << \"(\" << c.x() << \", \" << c.y() << \")\";\n    \n    return dbg.space();\n}\n//! [0]\n\nint main(int argv, char **args)\n{\n    Coordinate coordinate;\n    coordinate.myX = 10;\n    coordinate.myY = 44;\n\n//! [1]\n    qDebug() << \"Date:\" << QDate::currentDate();\n    qDebug() << \"Types:\" << QString(\"String\") << QChar('x') << QRect(0, 10, 50, 40);\n    qDebug() << \"Custom coordinate type:\" << coordinate;\n//! [1]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qdir-filepaths/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QDir>\n#include <iostream>\n\nint main(int argc, char *argv[])\n{\n    QDir directory(\"Documents/Letters\");\n    QString path = directory.filePath(\"contents.txt\");\n    QString absolutePath = directory.absoluteFilePath(\"contents.txt\");\n\n    std::cout << qPrintable(directory.dirName()) << std::endl;\n    std::cout << qPrintable(path) << std::endl;\n    std::cout << qPrintable(absolutePath) << std::endl;\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qdir-listfiles/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\n\nfrom PySide.QtCore import QDir, QCoreApplication\nimport sys\n\napp = QCoreApplication(sys.argv)\ndirectory = QDir()\ndirectory.setFilter(QDir.Files | QDir.Hidden | QDir.NoSymLinks)\ndirectory.setSorting(QDir.Size | QDir.Reversed)\n\nfor entry in directory.entryInfoList():\n    print \"%s %s\" % (entry.size(), entry.fileName())\n\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qdir-namefilters/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nfrom PySide.QtCore import *\n\ndef main():\n    dir_ = QDir()\n    dir_.setFilter(QDir.Files | QDir.Hidden | QDir.NoSymLinks)\n    dir_.setSorting(QDir.Size | QDir.Reversed)\n\n//! [0]\n    filters = [\"*.cpp\", \"*.cxx\", \"*.cc\"]\n    dir_.setNameFilters(filters)\n//! [0]\n//\n    lst = d.entryInfoList()\n\n    print \"     Bytes Filename\"\n    for fileInfo in lst:\n        print '%d %s' % (fileInfo.size(), fileInfo.fileName())\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qelapsedtimer/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the QtNetwork module of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n#include <QtCore>\n\nvoid slowOperation1()\n{\n    static char buf[256];\n    for (int i = 0; i < (1<<20); ++i)\n        buf[i % sizeof buf] = i;\n}\n\nvoid slowOperation2(int) { slowOperation1(); }\n\nvoid startExample()\n{\n//![0]\n    timer = QElapsedTimer()\n    timer.start()\n\n    slowOperation1()\n\n    sys.stderr.write(\"The slow operation took\" + timer.elapsed() + \"milliseconds\")\n//![0]\n}\n\n//![1]\ndef executeSlowOperations(timeout):\n    timer = QElapsedTimer()\n    timer.start()\n    slowOperation1()\n\n    remainingTime = timeout - timer.elapsed()\n    if remainingTime > 0:\n        slowOperation2(remainingTime)\n//![1]\n\n//![2]\ndef executeOperationsForTime(ms):\n    timer = QElapsedTimer()\n    timer.start()\n\n    while not timer.hasExpired(ms):\n        slowOperation1()\n//![2]\n\nint restartExample()\n{\n//![3]\n    timer = QElapsedTimer()\n\n    count = 1\n    timer.start()\n\n    while True:\n        count *= 2\n        slowOperation2(count)\n        if timer.restart() < 250:\n            break\n\n    return count\n//![3]\n}\n\nint main(int argc, char **argv)\n{\n    QCoreApplication app(argc, argv);\n\n    startExample();\n    restartExample();\n    executeSlowOperations(5);\n    executeOperationsForTime(5);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qfontdatabase/main.cpp",
    "content": "/############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################/\n\n//! [0]\n    database = QFontDatabase()\n    fontTree = QTreeWidget()\n    fontTree.setColumnCount(2)\n    fontTree.setHeaderLabels(QStringList() << \"Font\" << \"Smooth Sizes\")\n\n    for family in database.families():\n        familyItem = QTreeWidgetItem(fontTree)\n        familyItem.setText(0, family)\n\n        for style in database.styles(family):\n            styleItem = QTreeWidgetItem(familyItem)\n            styleItem.setText(0, style)\n\n            sizes = 0\n            for points in database.smoothSizes(family, style):\n                sizes += QString.number(points) + \" \"\n\n            styleItem.setText(1, sizes.trimmed())\n        \n//! [0] //! [1]\n    \n//! [1]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qgl-namespace/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QGL>\n\nint main(int argc, char *argv[])\n{\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlabel/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nclass Updater : public QObject\n{\n    Q_OBJECT\n\npublic:\n    Updater(QWidget *widget);\n\npublic slots:\n    void adjustSize();\n\nprivate:\n    QWidget *widget;\n};\n\nUpdater::Updater(QWidget *widget)\n    : widget(widget)\n{\n}\n\nvoid Updater::adjustSize()\n{\n    widget->adjustSize();\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QLabel *label = new QLabel(\"My label\");\n    QLineEdit *editor = new QLineEdit(\"New text\");\n    QWidget window;\n    //Updater updater(&label);\n    QObject::connect(editor, SIGNAL(textChanged(const QString &)),\n                     label, SLOT(setText(const QString &)));\n    //QObject::connect(editor, SIGNAL(textChanged(const QString &)),\n    //                 &updater, SLOT(adjustSize()));\n    //editor.show();\n    //label.show();\n    QVBoxLayout *layout = new QVBoxLayout;\n    layout->addWidget(label);\n    layout->addWidget(editor);\n    window.setLayout(layout);\n    window.show();\n    return app.exec();\n}\n\n#include \"main.moc\"\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlineargradient/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include \"paintwidget.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    PaintWidget window;\n    window.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlineargradient/paintwidget.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include \"paintwidget.h\"\n\nPaintWidget::PaintWidget(QWidget *parent)\n    : QWidget(parent)\n{\n}\n\nvoid PaintWidget::paintEvent(QPaintEvent *event)\n{\n    QLinearGradient gradient1(rect().topLeft(), rect().bottomRight());\n    gradient1.setColorAt(0, QColor(\"#ffffcc\"));\n    gradient1.setColorAt(1, QColor(\"#ccccff\"));\n\n    QRectF ellipseRect(width()*0.25, height()*0.25, width()*0.5, height()*0.5);\n    QLinearGradient gradient2(ellipseRect.topLeft(), ellipseRect.bottomRight());\n    gradient2.setColorAt(0, QColor(\"#ccccff\"));\n    gradient2.setColorAt(1, QColor(\"#ffffcc\"));\n\n    QPainter painter;\n    painter.begin(this);\n    painter.setRenderHint(QPainter::Antialiasing);\n    painter.fillRect(rect(), QBrush(gradient1));\n    painter.setBrush(QBrush(gradient2));\n    painter.drawEllipse(ellipseRect);\n    painter.end();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlineargradient/paintwidget.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef PAINTWIDGET_H\n#define PAINTWIDGET_H\n\n#include <QWidget>\n\nclass QPaintEvent;\n\nclass PaintWidget : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    PaintWidget(QWidget *parent = 0);\n\nprotected:\n    void paintEvent(QPaintEvent *event);\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-dnd/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-dnd/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n#include \"model.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    menuBar()->addMenu(fileMenu);\n\n//  For convenient quoting:\n//! [0]\nQListView *listView = new QListView(this);\nlistView->setSelectionMode(QAbstractItemView::ExtendedSelection);\nlistView->setDragEnabled(true);\nlistView->setAcceptDrops(true);\nlistView->setDropIndicatorShown(true);\n//! [0]\n\n    this->listView = listView;\n\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n\n    setupListItems();\n\n    setCentralWidget(listView);\n    setWindowTitle(tr(\"List View\"));\n}\n\nvoid MainWindow::setupListItems()\n{\n    QStringList items;\n    items << tr(\"Oak\") << tr(\"Fir\") << tr(\"Pine\") << tr(\"Birch\") << tr(\"Hazel\")\n          << tr(\"Redwood\") << tr(\"Sycamore\") << tr(\"Chestnut\")\n          << tr(\"Mahogany\");\n\n    DragDropListModel *model = new DragDropListModel(items, this);\n    listView->setModel(model);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-dnd/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QListView;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\nprivate:\n    void setupListItems();\n\n    QListView *listView;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-dnd/model.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of an example program for Qt.\n** EDITIONS: NOLIMITS\n**\n****************************************************************************/\n\n/*\n  model.cpp\n\n  A simple model that uses a QStringList as its data source.\n*/\n\n#include <QtGui>\n\n#include \"model.h\"\n\nDragDropListModel::DragDropListModel(const QStringList &strings,\n                                     QObject *parent)\n    : QStringListModel(strings, parent)\n{\n}\n\n//! [0]\nbool DragDropListModel::dropMimeData(const QMimeData *data,\n    Qt::DropAction action, int row, int column, const QModelIndex &parent)\n{\n    if (action == Qt::IgnoreAction)\n        return true;\n\n    if (!data->hasFormat(\"application/vnd.text.list\"))\n        return false;\n\n    if (column > 0)\n//! [0] //! [1]\n        return false;\n//! [1]\n\n//! [2]\n    int beginRow;\n\n    if (row != -1)\n        beginRow = row;\n//! [2] //! [3]\n    else if (parent.isValid())\n        beginRow = parent.row();\n//! [3] //! [4]\n    else\n        beginRow = rowCount(QModelIndex());\n//! [4]\n\n//! [5]\n    QByteArray encodedData = data->data(\"application/vnd.text.list\");\n    QDataStream stream(&encodedData, QIODevice::ReadOnly);\n    QStringList newItems;\n    int rows = 0;\n\n    while (!stream.atEnd()) {\n        QString text;\n        stream >> text;\n        newItems << text;\n        ++rows;\n    }\n//! [5]\n\n//! [6]\n    insertRows(beginRow, rows, QModelIndex());\n    foreach (QString text, newItems) {\n        QModelIndex idx = index(beginRow, 0, QModelIndex());\n        setData(idx, text);\n        beginRow++;\n    }\n\n    return true;\n}\n//! [6]\n\n//! [7]\nQt::ItemFlags DragDropListModel::flags(const QModelIndex &index) const\n{\n    Qt::ItemFlags defaultFlags = QStringListModel::flags(index);\n\n    if (index.isValid())\n        return Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | defaultFlags;\n    else\n        return Qt::ItemIsDropEnabled | defaultFlags;\n}\n//! [7]\n\n//! [8]\ndef mimeData(self, indexes):\n    mimeData = QMimeData()\n    encodedData = QByteArray()\n    stream = QDataStream(encodedData, QIODevice.WriteOnly)\n\n    for index in indexes:\n        if index.isValid():\n            stream << data(index, Qt.DisplayRole)\n\n    mimeData.setData(\"application/vnd.text.list\", encodedData)\n    return mimeData;\n//! [8]\n\n//! [9]\nQStringList DragDropListModel::mimeTypes() const\n{\n    QStringList types;\n    types << \"application/vnd.text.list\";\n    return types;\n}\n//! [9]\n\n//! [10]\nQt::DropActions DragDropListModel::supportedDropActions() const\n{\n    return Qt::CopyAction | Qt::MoveAction;\n}\n//! [10]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-dnd/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of an example program for Qt.\n** EDITIONS: NOLIMITS\n**\n****************************************************************************/\n\n#ifndef MODEL_H\n#define MODEL_H\n\n#include <QObject>\n#include <QStringListModel>\n\nclass DragDropListModel : public QStringListModel\n{\n    Q_OBJECT\n\npublic:\n    DragDropListModel(const QStringList &strings, QObject *parent = 0);\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n\n    bool dropMimeData(const QMimeData *data, Qt::DropAction action,\n                      int row, int column, const QModelIndex &parent);\n    QMimeData *mimeData(const QModelIndexList &indexes) const;\n    QStringList mimeTypes() const;\n    Qt::DropActions supportedDropActions() const;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-using/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-using/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n#include \"model.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *itemsMenu = new QMenu(tr(\"&Items\"));\n\n    insertAction = itemsMenu->addAction(tr(\"&Insert Item\"));\n    removeAction = itemsMenu->addAction(tr(\"&Remove Item\"));\n    QAction *ascendingAction = itemsMenu->addAction(tr(\"Sort in &Ascending Order\"));\n    QAction *descendingAction = itemsMenu->addAction(tr(\"Sort in &Descending Order\"));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(itemsMenu);\n\n    QStringList strings;\n    strings << tr(\"Oak\") << tr(\"Fir\") << tr(\"Pine\") << tr(\"Birch\")\n            << tr(\"Hazel\") << tr(\"Redwood\") << tr(\"Sycamore\") << tr(\"Chestnut\");\n    model = new StringListModel(strings, this);\n/*  For convenient quoting:\n    QListView *listView = new QListView(this);\n*/\n    listView = new QListView(this);\n    listView->setModel(model);\n    listView->setSelectionMode(QAbstractItemView::SingleSelection);\n\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n    connect(ascendingAction, SIGNAL(triggered()), this, SLOT(sortAscending()));\n    connect(descendingAction, SIGNAL(triggered()), this, SLOT(sortDescending()));\n    connect(insertAction, SIGNAL(triggered()), this, SLOT(insertItem()));\n    connect(removeAction, SIGNAL(triggered()), this, SLOT(removeItem()));\n    connect(listView->selectionModel(),\n            SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),\n            this, SLOT(updateMenus(const QModelIndex &)));\n\n    updateMenus(listView->selectionModel()->currentIndex());\n\n    setCentralWidget(listView);\n    setWindowTitle(tr(\"List View\"));\n}\n\nvoid MainWindow::sortAscending()\n{\n    model->sort(0, Qt::AscendingOrder);\n}\n\nvoid MainWindow::sortDescending()\n{\n    model->sort(0, Qt::DescendingOrder);\n}\n\nvoid MainWindow::insertItem()\n{\n    QModelIndex currentIndex = listView->currentIndex();\n    if (!currentIndex.isValid())\n        return;\n\n    QString itemText = QInputDialog::getText(this, tr(\"Insert Item\"),\n        tr(\"Input text for the new item:\"));\n\n    if (itemText.isNull())\n        return;\n\n    if (model->insertRow(currentIndex.row(), QModelIndex())) {\n        QModelIndex newIndex = model->index(currentIndex.row(), 0, QModelIndex());\n        model->setData(newIndex, itemText, Qt::EditRole);\n\n        QString toolTipText = tr(\"Tooltip:\") + itemText;\n        QString statusTipText = tr(\"Status tip:\") + itemText;\n        QString whatsThisText = tr(\"What's This?:\") + itemText;\n        model->setData(newIndex, toolTipText, Qt::ToolTipRole);\n        model->setData(newIndex, toolTipText, Qt::StatusTipRole);\n        model->setData(newIndex, whatsThisText, Qt::WhatsThisRole);\n    }\n}\n\nvoid MainWindow::removeItem()\n{\n    QModelIndex currentIndex = listView->currentIndex();\n    if (!currentIndex.isValid())\n        return;\n\n    model->removeRow(currentIndex.row(), QModelIndex());\n}\n\nvoid MainWindow::updateMenus(const QModelIndex &current)\n{\n    insertAction->setEnabled(current.isValid());\n    removeAction->setEnabled(current.isValid());\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-using/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n#include <QModelIndex>\n\nclass QAction;\nclass QListView;\nclass StringListModel;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void insertItem();\n    void removeItem();\n    void sortAscending();\n    void sortDescending();\n    void updateMenus(const QModelIndex &current);\n\nprivate:\n    QAction *insertAction;\n    QAction *removeAction;\n    QListView *listView;\n    StringListModel *model;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistview-using/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of an example program for Qt.\n** EDITIONS: NOLIMITS\n**\n****************************************************************************/\n\n#ifndef MODEL_H\n#define MODEL_H\n\n#include <QAbstractListModel>\n#include <QObject>\n#include <QStringList>\n\nclass StringListModel : public QAbstractListModel\n{\n    Q_OBJECT\n\npublic:\n    StringListModel(const QStringList &strings, QObject *parent = 0)\n        : QAbstractListModel(parent), stringList(strings) {}\n\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation,\n                        int role = Qt::DisplayRole) const;\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    bool setData(const QModelIndex &index, const QVariant &value,\n                 int role = Qt::EditRole);\n\n    bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());\n    bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());\n\nprivate:\n    QStringList stringList;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistwidget-dnd/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistwidget-dnd/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    menuBar()->addMenu(fileMenu);\n\n//  For convenient quoting:\n//! [0]\nQListWidget *listWidget = new QListWidget(this);\nlistWidget->setSelectionMode(QAbstractItemView::SingleSelection);\nlistWidget->setDragEnabled(true);\nlistWidget->viewport()->setAcceptDrops(true);\nlistWidget->setDropIndicatorShown(true);\n//! [0] //! [1]\nlistWidget->setDragDropMode(QAbstractItemView::InternalMove);\n//! [1]\n\n    this->listWidget = listWidget;\n\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n\n    setupListItems();\n\n    setCentralWidget(listWidget);\n    setWindowTitle(tr(\"List Widget\"));\n}\n\nvoid MainWindow::setupListItems()\n{\n    QListWidgetItem *item;\n    item = new QListWidgetItem(tr(\"Oak\"), listWidget);\n    item = new QListWidgetItem(tr(\"Fir\"), listWidget);\n    item = new QListWidgetItem(tr(\"Pine\"), listWidget);\n    item = new QListWidgetItem(tr(\"Birch\"), listWidget);\n    item = new QListWidgetItem(tr(\"Hazel\"), listWidget);\n    item = new QListWidgetItem(tr(\"Redwood\"), listWidget);\n    item = new QListWidgetItem(tr(\"Sycamore\"), listWidget);\n    item = new QListWidgetItem(tr(\"Chestnut\"), listWidget);\n    item = new QListWidgetItem(tr(\"Mahogany\"), listWidget);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistwidget-dnd/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QListWidget;\nclass QListWidgetItem;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\nprivate:\n    void setupListItems();\n\n    QListWidget *listWidget;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistwidget-using/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistwidget-using/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *itemsMenu = new QMenu(tr(\"&Items\"));\n\n    insertAction = itemsMenu->addAction(tr(\"&Insert Item\"));\n    removeAction = itemsMenu->addAction(tr(\"&Remove Item\"));\n    QAction *ascendingAction = itemsMenu->addAction(tr(\"Sort in &Ascending Order\"));\n    QAction *descendingAction = itemsMenu->addAction(tr(\"Sort in &Descending Order\"));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(itemsMenu);\n\n/*  For convenient quoting:\n//! [0]\n    listWidget = QListWidget(self)\n//! [0]\n*/\n    listWidget = new QListWidget(this);\n    listWidget->setSelectionMode(QAbstractItemView::SingleSelection);\n\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n    connect(ascendingAction, SIGNAL(triggered()), this, SLOT(sortAscending()));\n    connect(descendingAction, SIGNAL(triggered()), this, SLOT(sortDescending()));\n    connect(insertAction, SIGNAL(triggered()), this, SLOT(insertItem()));\n    connect(removeAction, SIGNAL(triggered()), this, SLOT(removeItem()));\n    connect(listWidget,\n            SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),\n            this, SLOT(updateMenus(QListWidgetItem *)));\n\n    setupListItems();\n    updateMenus(listWidget->currentItem());\n\n    setCentralWidget(listWidget);\n    setWindowTitle(tr(\"List Widget\"));\n}\n\nvoid MainWindow::setupListItems()\n{\n//! [1]\n    QListWidgetItem(tr(\"Oak\"), listWidget)\n    QListWidgetItem(tr(\"Fir\"), listWidget)\n    QListWidgetItem(tr(\"Pine\"), listWidget)\n//! [1]\n    new QListWidgetItem(tr(\"Birch\"), listWidget);\n//! [2]\n    QListWidgetItem(tr(\"Hazel\"), listWidget)\n//! [2]\n    new QListWidgetItem(tr(\"Redwood\"), listWidget);\n//! [3]\n    QListWidgetItem(tr(\"Sycamore\"), listWidget)\n    QListWidgetItem(tr(\"Chestnut\"), listWidget)\n    QListWidgetItem(tr(\"Mahogany\"), listWidget)\n//! [3]\n}\n\nvoid MainWindow::sortAscending()\n{\n//! [4]\n    listWidget.sortItems(Qt.AscendingOrder)\n//! [4]\n}\n\nvoid MainWindow::sortDescending()\n{\n//! [5]\n    listWidget.sortItems(Qt.DescendingOrder)\n//! [5]\n}\n\nvoid MainWindow::insertItem()\n{\n    if (!listWidget->currentItem())\n        return;\n\n    QString itemText = QInputDialog::getText(this, tr(\"Insert Item\"),\n        tr(\"Input text for the new item:\"));\n\n    if (itemText.isNull())\n        return;\n\n//! [6]\n    newItem = QListWidgetItem()\n    newItem.setText(itemText)\n//! [6]\n    int row = listWidget->row(listWidget->currentItem());\n//! [7]\n    listWidget.insertItem(row, newItem)\n//! [7]\n\n    QString toolTipText = tr(\"Tooltip:\") + itemText;\n    QString statusTipText = tr(\"Status tip:\") + itemText;\n    QString whatsThisText = tr(\"What's This?:\") + itemText;\n//! [8]\n    newItem.setToolTip(toolTipText)\n    newItem.setStatusTip(toolTipText)\n    newItem.setWhatsThis(whatsThisText)\n//! [8]\n}\n\nvoid MainWindow::removeItem()\n{\n    listWidget->takeItem(listWidget->row(listWidget->currentItem()));\n}\n\nvoid MainWindow::updateMenus(QListWidgetItem *current)\n{\n    insertAction->setEnabled(current != 0);\n    removeAction->setEnabled(current != 0);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qlistwidget-using/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QAction;\nclass QListWidget;\nclass QListWidgetItem;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void insertItem();\n    void removeItem();\n    void sortAscending();\n    void sortDescending();\n    void updateMenus(QListWidgetItem *current);\n\nprivate:\n    void setupListItems();\n\n    QAction *insertAction;\n    QAction *removeAction;\n    QListWidget *listWidget;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmacnativewidget/main.mm",
    "content": "#include <QtGui/QtGui>\n#include <QtGui/qmacnativewidget_mac.h>\n#ifdef QT_MAC_USE_COCOA\n#import <Cocoa/Cocoa.h>\n#else\n#include <Carbon/Carbon.h>\n#endif\n\nint main(int argc, char **argv)\n{\n    QApplication app(argc, argv);\n#ifdef QT_MAC_USE_COCOA\n//![0]\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n    NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(200, app.desktop()->height() - 200, 239, 200)\n                        styleMask:NSTitledWindowMask | NSClosableWindowMask\n                                  | NSMiniaturizableWindowMask | NSResizableWindowMask\n                        backing:NSBackingStoreBuffered defer:NO];\n\n    QMacNativeWidget *nativeWidget = new QMacNativeWidget();\n    nativeWidget->move(0, 0);\n    nativeWidget->setPalette(QPalette(Qt::red));\n    nativeWidget->setAutoFillBackground(true);\n    QVBoxLayout *layout = new QVBoxLayout();\n    QPushButton *pushButton = new QPushButton(\"An Embedded Qt Button!\", nativeWidget);\n    pushButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // Don't use the layout rect calculated from QMacStyle.\n    layout->addWidget(pushButton);\n    nativeWidget->setLayout(layout);\n\n    // Adjust Cocoa layouts\n    NSView *nativeWidgetView = reinterpret_cast<NSView *>(nativeWidget->winId());\n    NSView *contentView = [window contentView];\n    [contentView setAutoresizesSubviews:YES];\n    [nativeWidgetView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];\n    [nativeWidgetView setAutoresizesSubviews:YES];\n    NSView *pushButtonView = reinterpret_cast<NSView *>(pushButton->winId());\n    [pushButtonView setAutoresizingMask:NSViewWidthSizable];\n\n    // Add the nativeWidget to the window.\n    [contentView addSubview:nativeWidgetView positioned:NSWindowAbove relativeTo:nil];\n    nativeWidget->show();\n    pushButton->show();\n\n    // Show the window.\n    [window makeKeyAndOrderFront:window];\n    [pool release];\n//![0]\n#else\n//![1]\n    Rect contentRect;\n    SetRect(&contentRect, 200, 200, 400, 400);\n    HIWindowRef windowRef;\n    CreateNewWindow(kDocumentWindowClass, kWindowStandardDocumentAttributes | kWindowCompositingAttribute | kWindowStandardHandlerAttribute | kWindowLiveResizeAttribute, &contentRect, &windowRef);\n    HIViewRef contentView = 0;\n    GetRootControl(windowRef, &contentView);\n\n    QMacNativeWidget *nativeWidget = new QMacNativeWidget();\n    nativeWidget->move(0, 0);\n    nativeWidget->setPalette(QPalette(Qt::red));\n    nativeWidget->setAutoFillBackground(true);\n    QVBoxLayout *layout = new QVBoxLayout();\n    QPushButton *pushButton = new QPushButton(\"An Embedded Qt Button!\", nativeWidget);\n    pushButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // Don't use the layout rect calculated from QMacStyle.\n    layout->addWidget(pushButton);\n    nativeWidget->setLayout(layout);\n    HIViewRef nativeWidgetView = reinterpret_cast<HIViewRef>(nativeWidget->winId());\n    // Add the nativeWidget to the window.\n    HIViewAddSubview(contentView, nativeWidgetView);\n\n    // Adjust Carbon layouts\n    HILayoutInfo layoutInfo;\n    layoutInfo.version = kHILayoutInfoVersionZero;\n    HIViewGetLayoutInfo(nativeWidgetView, &layoutInfo);\n\n    layoutInfo.binding.top.toView = contentView;\n    layoutInfo.binding.top.kind = kHILayoutBindTop;\n    layoutInfo.binding.left.toView = contentView;\n    layoutInfo.binding.left.kind = kHILayoutBindLeft;\n    layoutInfo.binding.right.toView = contentView;\n    layoutInfo.binding.right.kind = kHILayoutBindRight;\n    layoutInfo.binding.bottom.toView = contentView;\n    layoutInfo.binding.bottom.kind = kHILayoutBindBottom;\n\n    HIViewSetLayoutInfo(nativeWidgetView, &layoutInfo);\n    HIViewApplyLayout(nativeWidgetView);\n\n    pushButton->show();\n    nativeWidget->show();\n    // Show the window.\n    ShowWindow(windowRef);\n//![1]\n#endif\n    return app.exec(); // gives us the same behavior in both\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmake/delegate.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmake/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmake/model.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmake/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmake/paintwidget_unix.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nint main(int argc, char *argv[])\n{\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmake/view.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmetaobject-invokable/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QDebug>\n#include \"window.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Window window;\n    qDebug() << window.metaObject()->methodCount();\n    window.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmetaobject-invokable/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"window.h\"\n\nWindow::Window()\n{\n}\n\nvoid Window::normalMethod()\n{\n    // Cannot be called by the meta-object system.\n    show();\n}\n\nvoid Window::invokableMethod()\n{\n    // Can be called by the meta-object system.\n    show();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qmetaobject-invokable/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QWidget>\n\n//! [Window class with invokable method]\nclass Window : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    Window();\n    void normalMethod();\n    Q_INVOKABLE void invokableMethod();\n};\n//! [Window class with invokable method]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qprocess/qprocess-simpleexecution.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QtGui>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n//! [0]\n    ...\n//! [0]\n    parent = &app;\n\n//! [1]\n    program = \"./path/to/Qt/examples/widgets/analogclock\"\n//! [1]\n    program = \"./../../../../examples/widgets/analogclock/analogclock\";\n\n//! [2]\n    arguments = [\"-style\", \"motif\"]\n\n    myProcess = QProcess(parent)\n    myProcess.start(program, arguments)\n//! [2]\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qprocess-environment/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtCore>\n\nvoid startProcess()\n{\n    {\n//! [0]\nimport re\nfrom PySide.QtCore import QProcess\n\nprocess = QProcess()\n\nenv = QProcess.systemEnvironment()\nenv.append(\"TMPDIR=C:\\\\MyApp\\\\temp\") # Add an environment variable\nregex = re.compile(r'^PATH=(.*)', re.IGNORECASE)\nenv = [regex.sub(r'PATH=\\1;C:\\\\Bin', var) for var in env]\nprocess.setEnvironment(env)\nprocess.start(\"myapp\")\n//! [0]\n    }\n\n    {\n//! [1]\nprocess = QProcess()\nenv = QProcessEnvironment.systemEnvironment()\nenv.insert(\"TMPDIR\", \"C:\\\\MyApp\\\\temp\") # Add an environment variable\nenv.insert(\"PATH\", env.value(\"Path\") + \";C:\\\\Bin\")\nprocess.setProcessEnvironment(env)\nprocess.start(\"myapp\")\n//! [1]\n    }\n}\n\nint main(int argc, char *argv[])\n{\n    QCoreApplication app(argc, argv);\n    startProcess();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsignalmapper/buttonwidget.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"buttonwidget.h\"\n\n//! [0]\n\ndef __init__(self, texts, parent):\n    QWidget.__init__(self, parent)\n\n    self.signalMapper = QSignalMapper(self)\n\n    layout = QGridLayout()\n\n    for text, index in enumerate(texts):\n        button = QPushButton(text)\n        self.connect(SIGNAL(\"clicked()\"), self.signalMapper, SLOT(\"map()\"))\n//! [0] //! [1]\n        self.signalMapper.setMapping(button, text)\n        layout.addWidget(button, index / 3, index % 3)\n\n    self.signalMapper.connect(SIGNAL(\"mapped(const QString &)\"),\n//! [1] //! [2]\n            self, SLOT(\"clicked(const QString &)\"))\n\n    self.setLayout(layout)\n\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsignalmapper/buttonwidget.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef BUTTONWIDGET_H\n#define BUTTONWIDGET_H\n\n#include <qwidget.h>\n\nclass QSignalMapper;\nclass QString;\nclass QStringList;\n\n//! [0]\n\nclass ButtonWidget(QWidget):\n    def __init__(self, texts, parent=None):\n        QWidget.__init__(self, parent)\n        ...\n//! [0] //! [1]\n\n//! [1]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsignalmapper/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n\n#include \"buttonwidget.h\"\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QStringList texts;\n    texts << \"January\" << \"February\" << \"March\" << \"April\"\n          << \"May\" << \"June\" << \"July\" << \"August\"\n          << \"September\" << \"October\" << \"November\"\n          << \"December\";\n    MainWindow *mw = new MainWindow;\n    ButtonWidget *buttons = new ButtonWidget(texts, mw);\n    mw->setCentralWidget(buttons);\n    mw->show();\n    QObject::connect(buttons, SIGNAL(clicked(const QString &)),\n                     mw, SLOT(buttonPressed(const QString &)));\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsignalmapper/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QMainWindow>\n#include <QStatusBar>\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow()\n    {\n        statusBar()->showMessage(tr(\"Ready\"));\n    }\n\npublic slots:\n    void buttonPressed(const QString &text)\n    {\n        statusBar()->showMessage(tr(\"Chose %1\").arg(text));\n    }\n};\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsortfilterproxymodel/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QObject *parent = &app;\n\n    QStringList numbers;\n    numbers << \"One\" << \"Two\" << \"Three\" << \"Four\" << \"Five\";\n\n    QAbstractItemModel *stringListModel = new QStringListModel(numbers, parent);\n\n//! [0]\n    QSortFilterProxyModel *filterModel = new QSortFilterProxyModel(parent);\n    filterModel->setSourceModel(stringListModel);\n//! [0]\n\n    QWidget *window = new QWidget;\n\n//! [1]\n    QListView *filteredView = new QListView;\n    filteredView->setModel(filterModel);\n//! [1]\n    filteredView->setWindowTitle(\"Filtered view onto a string list model\");\n\n    QLineEdit *patternEditor = new QLineEdit;\n    QObject::\n    connect(patternEditor, SIGNAL(textChanged(const QString &)),\n            filterModel, SLOT(setFilterRegExp(const QString &)));\n\n    QVBoxLayout *layout = new QVBoxLayout(window);\n    layout->addWidget(filteredView);\n    layout->addWidget(patternEditor);\n\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsortfilterproxymodel-details/main.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0] //! [1]\n        treeView =  QTreeView()\n//! [0]\n        model =  MyItemModel(self)\n\n        treeView.setModel(model)\n//! [1]\n\n//! [2]\n        sourceModel =  MyItemModel(self)\n        proxyModel =  QSortFilterProxyModel(self)\n\n        proxyModel.setSourceModel(sourceModel)\n        treeView.setModel(proxyModel)\n//! [2]\n\n//! [3]\n        treeView.setSortingEnabled(True)\n//! [3]\n\n//! [4]\n        proxyModel.sort(2, Qt.AscendingOrder)\n//! [4] //! [5]\n        proxyModel.setFilterRegExp(QRegExp(\".png\", Qt.CaseInsensitive,\n                                            QRegExp.FixedString))\n        proxyModel.setFilterKeyColumn(1)\n//! [5]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsplashscreen/main.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0]\ndef main():\n    app = QApplication(sys.argv)\n    pixmap = QPixmap(\":/splash.png\")\n    splash = QSplashScreen(pixmap)\n    splash.show()\n    app.processEvents()\n//! [0]\n\n//! [1]\n    window = QMainWindow()\n    window.show()\n    splash.finish(&window)\n    return app.exec_()\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsplashscreen/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QLabel *label = new QLabel(tr(\"This is the main window.\"));\n    label->setAlignment(Qt::AlignCenter);\n    setCentralWidget(label);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsplashscreen/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include <QMainWindow>\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsplashscreen/qsplashscreen.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n   <file>splash.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsql-namespace/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QSql>\n\nint main(int argc, char *argv[])\n{\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qstack/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <iostream>\nusing namespace std;\n\nint main(int argc, char *argv[])\n{\n//! [0]\n    QStack<int> stack;\n    stack.push(1);\n    stack.push(2);\n    stack.push(3);\n    while (!stack.isEmpty())\n        cout << stack.pop() << endl;\n//! [0]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qstackedlayout/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QApplication>\n\nclass Widget : public QWidget\n{\npublic:\n    Widget(QWidget *parent = 0);\n};\n\nWidget::Widget(QWidget *parent)\n    : QWidget(parent)\n{\n//! [0]\n    QWidget *firstPageWidget = new QWidget;\n    QWidget *secondPageWidget = new QWidget;\n    QWidget *thirdPageWidget = new QWidget;\n\n    QStackedLayout *stackedLayout = new QStackedLayout;\n    stackedLayout->addWidget(firstPageWidget);\n    stackedLayout->addWidget(secondPageWidget);\n    stackedLayout->addWidget(thirdPageWidget);\n\n//! [0] //! [1]\n    QComboBox *pageComboBox = new QComboBox;\n    pageComboBox->addItem(tr(\"Page 1\"));\n    pageComboBox->addItem(tr(\"Page 2\"));\n    pageComboBox->addItem(tr(\"Page 3\"));\n    connect(pageComboBox, SIGNAL(activated(int)),\n            stackedLayout, SLOT(setCurrentIndex(int)));\n//! [1]\n\n//! [2]\n    QVBoxLayout *mainLayout = new QVBoxLayout;\n//! [2]\n    mainLayout->addWidget(pageComboBox);\n//! [3]\n    mainLayout->addLayout(stackedLayout);\n    setLayout(mainLayout);\n//! [3]\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Widget widget;\n    widget.show();\n    return app.exec();\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qstackedwidget/main.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0]\n    firstPageWidget =  QWidget()\n    secondPageWidget =  QWidget()\n    thirdPageWidget =  QWidget()\n\n    stackedWidget =  QStackedWidget()\n    stackedWidget.addWidget(firstPageWidget)\n    stackedWidget.addWidget(secondPageWidget)\n    stackedWidget.addWidget(thirdPageWidget)\n\n//! [0] //! [1]\n    pageComboBox = QComboBox()\n    pageComboBox.addItem(tr(\"Page 1\"))\n    pageComboBox.addItem(tr(\"Page 2\"))\n    pageComboBox.addItem(tr(\"Page 3\"))\n    connect(pageComboBox, SIGNAL(\"activated(int)\"),\n            stackedWidget, SLOT(\"setCurrentIndex(int)\"))\n\n//! [1] //! [2]\n    layout =  QVBoxLayout()\n//! [2]\n    layout.addWidget(pageComboBox)\n//! [3]\n    layout.addWidget(stackedWidget)\n    setLayout(layout)\n//! [3]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qstandarditemmodel/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QApplication>\n\nclass Widget : public QWidget\n{\npublic:\n    Widget(QWidget *parentWidget = 0);\n};\n\nWidget::Widget(QWidget *parentWidget)\n    : QWidget(parentWidget)\n{\n    QStandardItemModel *model = new QStandardItemModel();\n    QModelIndex parent;\n    for (int i = 0; i < 4; ++i) {\n        parent = model->index(0, 0, parent);\n        model->insertRows(0, 1, parent);\n        model->insertColumns(0, 1, parent);\n        QModelIndex index = model->index(0, 0, parent);\n        model->setData(index, i);\n    }\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Widget widget;\n    widget.show();\n    return app.exec();\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qstatustipevent/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0] //! [1]\ndef __init__(self, parent):\n    QMainWindow.__init__(self, parent)\n//! [0]\n    myWidget = QWidget()\n    myWidget.setStatusTip(tr(\"This is my widget.\"))\n\n    setCentralWidget(myWidget)\n//! [1]\n\n//! [2]\n    fileMenu = menuBar().addMenu(tr(\"File\"))\n\n    Act = QAction(self.tr(\"&New\"), self)\n    Act.setStatusTip(tr(\"Create a new file.\"))\n    fileMenu.addAction(Act)\n//! [2]\n\n    statusBar().showMessage(self.tr(\"Ready\"))\n    setWindowTitle(tr(\"QStatusTipEvent\"))\n//! [3]\n\n//! [3]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qstringlistmodel/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nclass Widget : public QWidget\n{\npublic:\n    Widget(QWidget *parent = 0);\n};\n\nWidget::Widget(QWidget *parent)\n    : QWidget(parent)\n{\n//! [0]\n    model = QStringListModel()\n    list = QStringList()\n    list.append(\"a\")\n    list.append(\"b\")\n    list.append(\"c\")\n    model.setStringList(list)\n//! [0]\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Widget widget;\n    widget.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qstyleoption/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\ndef paintEvent(self, qpaintevent):\n    option = QStyleOptionButton()\n    option.initFrom(self)\n    if isDown():\n        option.state = QStyle.State_Sunken\n    else:\n        option.state = QStyle.State_Raised\n\n    if self.isDefault():\n        option.features = option.features or QStyleOptionButton.DefaultButton\n    option.text = self.text()\n    option.icon = self.icon()\n\n    painter = QPainter(self)\n    self.style().drawControl(QStyle.CE_PushButton, option, painter, self)\n//! [0]\n//! [1]\n    option = QStyleOptionFrame()\n\n    if isinstance(option, QStyleOptionFrameV2):\n        frameOptionV2 = QStyleOptionFrameV2(option)\n\n        # draw the frame using frameOptionV2\n\n//! [1]\n\n//! [2]\n    if isinstance(option, QStyleOptionProgressBarV2):\n        progressBarV2 = QStyleOptionProgressBarV2(option)\n\n        # draw the progress bar using progressBarV2\n\n//! [2]\n\n//! [3]\n    if isinstance(option, QStyleOptionTabV2):\n        tabV2 = QStyleOptionTabV2(option)\n\n        # draw the tab using tabV2\n\n//! [3]\n\n\n//! [4]\ndef drawPrimitive(self, element, option, painter, widget):\n    if element == self.PE_FrameFocusRect:\n        focusRectOption =  QStyleOptionFocusRect(option)\n        if focusRectOption:\n            # ...\n\n\n    # ...\n\n//! [4]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qstyleplugin/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QtGui>\n\nclass MyStylePlugin : public QStylePlugin\n{\npublic:\n    MyStylePlugin(QObject *parent = 0);\n\n    QStyle *create(const QString &key);\n    QStringList keys() const;\n};\n\nclass RocketStyle : public QCommonStyle\n{\npublic:\n    RocketStyle() {};\n\n};\n\nclass StarBusterStyle : public QCommonStyle\n{\npublic:\n    StarBusterStyle() {};\n};\n\nMyStylePlugin::MyStylePlugin(QObject *parent)\n    : QStylePlugin(parent)\n{\n}\n\n//! [0]\nQStringList MyStylePlugin::keys() const\n{\n    return QStringList() << \"Rocket\" << \"StarBuster\";\n}\n//! [0]\n\n//! [1]\nQStyle *MyStylePlugin::create(const QString &key)\n{\n    QString lcKey = key;\n    if (lcKey == \"rocket\") {\n        return new RocketStyle;\n    } else if (lcKey == \"starbuster\") {\n        return new StarBusterStyle;\n    }\n    return 0;\n//! [1] //! [2]\n}\n//! [2]\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MyStylePlugin plugin;\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsvgwidget/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QtSvg>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n//! [0]\n    QSvgWidget window(\":/files/spheres.svg\");\n    window.show();\n//! [0]\n    QSvgRenderer *renderer = window.renderer();\n    QImage image(150, 150, QImage::Format_RGB32);\n    QPainter painter;\n    painter.begin(&image);\n    renderer->render(&painter);\n    painter.end();\n    image.save(\"spheres.png\", \"PNG\", 9);\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qsvgwidget/qsvgwidget.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource prefix=\"/files\" >\n   <file>spheres.svg</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qt-namespace/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <Qt>\n\nint main(int argc, char *argv[])\n{\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-dnd/images.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n   <file>Images/squared.png</file>\n   <file>Images/cubed.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-dnd/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-dnd/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include \"math.h\"\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *itemsMenu = new QMenu(tr(\"&Items\"));\n\n    QAction *sumItemsAction = itemsMenu->addAction(tr(\"&Sum Items\"));\n    QAction *averageItemsAction = itemsMenu->addAction(tr(\"&Average Items\"));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(itemsMenu);\n\n    tableWidget = new QTableWidget(12, 3, this);\n    tableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);\n    tableWidget->setDragEnabled(true);\n    tableWidget->setAcceptDrops(true);\n    tableWidget->setDropIndicatorShown(true);\n\n    QTableWidgetItem *valuesHeaderItem = new QTableWidgetItem(tr(\"Values\"));\n    tableWidget->setHorizontalHeaderItem(0, valuesHeaderItem);\n    valuesHeaderItem->setTextAlignment(Qt::AlignVCenter);\n    QTableWidgetItem *squaresHeaderItem = new QTableWidgetItem(tr(\"Squares\"));\n    squaresHeaderItem->setIcon(QIcon(QPixmap(\":/Images/squared.png\")));\n    squaresHeaderItem->setTextAlignment(Qt::AlignVCenter);\n    QTableWidgetItem *cubesHeaderItem = new QTableWidgetItem(tr(\"Cubes\"));\n    cubesHeaderItem->setIcon(QIcon(QPixmap(\":/Images/cubed.png\")));\n    cubesHeaderItem->setTextAlignment(Qt::AlignVCenter);\n    tableWidget->setHorizontalHeaderItem(1, squaresHeaderItem);\n    tableWidget->setHorizontalHeaderItem(2, cubesHeaderItem);\n\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n    connect(sumItemsAction, SIGNAL(triggered()), this, SLOT(sumItems()));\n    connect(averageItemsAction, SIGNAL(triggered()), this, SLOT(averageItems()));\n\n    setupTableItems();\n\n    setCentralWidget(tableWidget);\n    setWindowTitle(tr(\"Table Widget\"));\n}\n\nvoid MainWindow::setupTableItems()\n{\n    for (int row = 0; row < tableWidget->rowCount()-1; ++row) {\n        for (int column = 0; column < tableWidget->columnCount(); ++column) {\n    QTableWidgetItem *newItem = new QTableWidgetItem(tr(\"%1\").arg(\n        pow((float)row, (float)column+1)));\n    tableWidget->setItem(row, column, newItem);\n        }\n    }\n    for (int column = 0; column < tableWidget->columnCount(); ++column) {\n        QTableWidgetItem *newItem = new QTableWidgetItem;\n        newItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable);\n        tableWidget->setItem(tableWidget->rowCount()-1, column, newItem);\n    }\n}\n\nvoid MainWindow::averageItems()\n{\n    QList<QTableWidgetItem *> selected = tableWidget->selectedItems();\n    QTableWidgetItem *item;\n    int number = 0;\n    double total = 0;\n\n    foreach (item, selected) {\n        bool ok;\n        double value = item->text().toDouble(&ok);\n        \n        if (ok && !item->text().isEmpty()) {\n            total += value;\n            number++;\n        }\n    }\n    if (number > 0)\n        tableWidget->currentItem()->setText(QString::number(total/number));\n}\n\nvoid MainWindow::sumItems()\n{\n    QList<QTableWidgetItem *> selected = tableWidget->selectedItems();\n    QTableWidgetItem *item;\n    int number = 0;\n    double total = 0;\n\n    foreach (item, selected) {\n        bool ok;\n        double value = item->text().toDouble(&ok);\n\n        if (ok && !item->text().isEmpty()) {\n            total += value;\n            number++;\n        }\n    }\n    if (number > 0)\n        tableWidget->currentItem()->setText(QString::number(total));\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-dnd/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QAction;\nclass QTableWidget;\nclass QTableWidgetItem;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void averageItems();\n    void sumItems();\n\nprivate:\n    void setupTableItems();\n\n    QAction *removeAction;\n    QTableWidget *tableWidget;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-resizing/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-resizing/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *tableMenu = new QMenu(tr(\"&Table\"));\n\n    QAction *tableWidthAction = tableMenu->addAction(tr(\"Change Table &Width\"));\n    QAction *tableHeightAction = tableMenu->addAction(tr(\"Change Table &Height\"));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(tableMenu);\n\n//! [0]\n    tableWidget = QTableWidget()\n//! [0]\n    tableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);\n\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n    connect(tableWidthAction, SIGNAL(triggered()), this, SLOT(changeWidth()));\n    connect(tableHeightAction, SIGNAL(triggered()), this, SLOT(changeHeight()));\n\n    setupTableItems();\n\n    setCentralWidget(tableWidget);\n    setWindowTitle(tr(\"Table Widget Resizing\"));\n}\n\nvoid MainWindow::setupTableItems()\n{\n//! [1]\n    tableWidget.setRowCount(10)\n    tableWidget.setColumnCount(5)\n//! [1]\n\n    for (int row = 0; row < tableWidget->rowCount(); ++row) {\n        for (int column = 0; column < tableWidget->columnCount(); ++column) {\n//! [2]\n    newItem = QTableWidgetItem(tr(\"%s\" % ((row+1)*(column+1))))\n    tableWidget.setItem(row, column, newItem)\n//! [2]\n        }\n    }\n}\n\nvoid MainWindow::changeWidth()\n{\n    bool ok;\n\n    int newWidth = QInputDialog::getInteger(this, tr(\"Change table width\"),\n        tr(\"Input the number of columns required (1-20):\"),\n        tableWidget->columnCount(), 1, 20, 1, &ok);\n\n    if (ok)\n        tableWidget->setColumnCount(newWidth);\n}\n\nvoid MainWindow::changeHeight()\n{\n    bool ok;\n\n    int newHeight = QInputDialog::getInteger(this, tr(\"Change table height\"),\n        tr(\"Input the number of rows required (1-20):\"),\n        tableWidget->rowCount(), 1, 20, 1, &ok);\n\n    if (ok)\n        tableWidget->setRowCount(newHeight);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-resizing/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QAction;\nclass QTableWidget;\nclass QTableWidgetItem;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void changeHeight();\n    void changeWidth();\n\nprivate:\n    void setupTableItems();\n\n    QTableWidget *tableWidget;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-using/images.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n   <file>Images/squared.png</file>\n   <file>Images/cubed.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-using/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-using/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include \"math.h\"\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *itemsMenu = new QMenu(tr(\"&Items\"));\n\n    QAction *sumItemsAction = itemsMenu->addAction(tr(\"&Sum Items\"));\n    QAction *averageItemsAction = itemsMenu->addAction(tr(\"&Average Items\"));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(itemsMenu);\n\n//! [0]\n    tableWidget = QTableWidget(12, 3, self)\n//! [0]\n    tableWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);\n\n//! [1]\n    valuesHeaderItem = QTableWidgetItem(tr(\"Values\"))\n    tableWidget.setHorizontalHeaderItem(0, valuesHeaderItem)\n//! [1]\n    valuesHeaderItem->setTextAlignment(Qt::AlignVCenter);\n    QTableWidgetItem *squaresHeaderItem = new QTableWidgetItem(tr(\"Squares\"));\n    squaresHeaderItem->setIcon(QIcon(QPixmap(\":/Images/squared.png\")));\n    squaresHeaderItem->setTextAlignment(Qt::AlignVCenter);\n//! [2]\n    cubesHeaderItem = QTableWidgetItem(tr(\"Cubes\"))\n    cubesHeaderItem.setIcon(QIcon(QPixmap(\":/Images/cubed.png\")))\n    cubesHeaderItem.setTextAlignment(Qt::AlignVCenter)\n//! [2]\n    tableWidget->setHorizontalHeaderItem(1, squaresHeaderItem);\n    tableWidget->setHorizontalHeaderItem(2, cubesHeaderItem);\n\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n    connect(sumItemsAction, SIGNAL(triggered()), this, SLOT(sumItems()));\n    connect(averageItemsAction, SIGNAL(triggered()), this, SLOT(averageItems()));\n\n    setupTableItems();\n\n    setCentralWidget(tableWidget);\n    setWindowTitle(tr(\"Table Widget\"));\n}\n\nvoid MainWindow::setupTableItems()\n{\n    for (int row = 0; row < tableWidget->rowCount()-1; ++row) {\n        for (int column = 0; column < tableWidget->columnCount(); ++column) {\n//! [3]\n    newItem = QTableWidgetItem(tr(\"%s\" % pow(row, column+1)))\n    tableWidget.setItem(row, column, newItem)\n//! [3]\n        }\n    }\n    for (int column = 0; column < tableWidget->columnCount(); ++column) {\n        QTableWidgetItem *newItem = new QTableWidgetItem;\n        newItem->setFlags(Qt::ItemIsEnabled);\n        tableWidget->setItem(tableWidget->rowCount()-1, column, newItem);\n    }\n}\n\nvoid MainWindow::averageItems()\n{\n    QList<QTableWidgetItem *> selected = tableWidget->selectedItems();\n    QTableWidgetItem *item;\n    int number = 0;\n    double total = 0;\n\n    foreach (item, selected) {\n        bool ok;\n        double value = item->text().toDouble(&ok);\n        \n        if (ok && !item->text().isEmpty()) {\n            total += value;\n            number++;\n        }\n    }\n    if (number > 0)\n        tableWidget->currentItem()->setText(QString::number(total/number));\n}\n\nvoid MainWindow::sumItems()\n{\n//! [4]\n    QList<QTableWidgetItem *> selected = tableWidget->selectedItems();\n    QTableWidgetItem *item;\n    int number = 0;\n    double total = 0;\n\n    foreach (item, selected) {\n        bool ok;\n        double value = item->text().toDouble(&ok);\n\n        if (ok && !item->text().isEmpty()) {\n            total += value;\n            number++;\n        }\n    }\n//! [4]\n    if (number > 0)\n        tableWidget->currentItem()->setText(QString::number(total));\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtablewidget-using/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QAction;\nclass QTableWidget;\nclass QTableWidgetItem;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void averageItems();\n    void sumItems();\n\nprivate:\n    void setupTableItems();\n\n    QAction *removeAction;\n//! [0]\n    QTableWidget *tableWidget;\n//! [0]\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtcast/qtcast.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QLabel>\n#include <QPushButton>\n\n#include \"qtcast.h\"\n\nMyWidget::MyWidget()\n{\n//! [0]\n    QObject *obj = new MyWidget;\n//! [0]\n\n//! [1]\n    QWidget *widget = qobject_cast<QWidget *>(obj);\n//! [1]\n\n//! [2]\n    MyWidget *myWidget = qobject_cast<MyWidget *>(obj);\n//! [2]\n\n//! [3]\n    QLabel *label = qobject_cast<QLabel *>(obj);\n//! [3] //! [4]\n    // label is 0\n//! [4]\n\n//! [5]\n    if (QLabel *label = qobject_cast<QLabel *>(obj)) {\n//! [5] //! [6]\n        label->setText(tr(\"Ping\"));\n    } else if (QPushButton *button = qobject_cast<QPushButton *>(obj)) {\n        button->setText(tr(\"Pong!\"));\n    }\n//! [6]\n}\n\nint main()\n{\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtcast/qtcast.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef QTCAST_H\n#define QTCAST_H\n\n#include <QWidget>\n\nclass MyWidget : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    MyWidget();\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtest-namespace/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QTest>\n\nint main(int argc, char *argv[])\n{\n    QTest::qSleep(10);\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreeview-dnd/dragdropmodel.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of an example program for Qt.\n** EDITIONS: NOLIMITS\n**\n****************************************************************************/\n\n#ifndef DRAGDROPMODEL_H\n#define DRAGDROPMODEL_H\n\n#include \"treemodel.h\"\n\nclass DragDropModel : public TreeModel\n{\n    Q_OBJECT\n\npublic:\n    DragDropModel(const QStringList &strings, QObject *parent = 0);\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n\n    bool dropMimeData(const QMimeData *data, Qt::DropAction action,\n                      int row, int column, const QModelIndex &parent);\n    QMimeData *mimeData(const QModelIndexList &indexes) const;\n    QStringList mimeTypes() const;\n    Qt::DropActions supportedDropActions() const;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreeview-dnd/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreeview-dnd/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n#include \"dragdropmodel.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    menuBar()->addMenu(fileMenu);\n\n//  For convenient quoting:\n    QTreeView *treeView = new QTreeView(this);\n    treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);\n    treeView->setDragEnabled(true);\n    treeView->setAcceptDrops(true);\n    treeView->setDropIndicatorShown(true);\n\n    this->treeView = treeView;\n\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n\n    setupItems();\n\n    setCentralWidget(treeView);\n    setWindowTitle(tr(\"Tree View\"));\n}\n\nvoid MainWindow::setupItems()\n{\n    QStringList items;\n    items << tr(\"Widgets\\tUser interface objects used to create GUI applications.\")\n          << tr(\"  QWidget\\tThe basic building block for all other widgets.\")\n          << tr(\"  QDialog\\tThe base class for dialog windows.\")\n          << tr(\"Tools\\tUtilities and applications for Qt developers.\")\n          << tr(\"  Qt Designer\\tA GUI form designer for Qt applications.\")\n          << tr(\"  Qt Assistant\\tA documentation browser for Qt documentation.\");\n\n    DragDropModel *model = new DragDropModel(items, this);\n    QModelIndex index = model->index(0, 0, QModelIndex());\n    model->insertRows(2, 3, index);\n    index = model->index(0, 0, QModelIndex());\n    index = model->index(2, 0, index);\n    model->setData(index, QVariant(\"QFrame\"));\n    model->removeRows(3, 2, index.parent());\n    treeView->setModel(model);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreeview-dnd/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QTreeView;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\nprivate:\n    void setupItems();\n\n    QTreeView *treeView;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreeview-dnd/treeitem.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n    treeitem.cpp\n\n    A container for items of data supplied by the simple tree model.\n*/\n\n#include <QStringList>\n\n#include \"treeitem.h\"\n\nTreeItem::TreeItem(const QList<QVariant> &data, TreeItem *parent)\n{\n    parentItem = parent;\n    itemData = data;\n}\n\nTreeItem::~TreeItem()\n{\n    qDeleteAll(childItems);\n}\n\nvoid TreeItem::appendChild(TreeItem *item)\n{\n    childItems.append(item);\n}\n\nTreeItem *TreeItem::child(int row)\n{\n    return childItems.value(row);\n}\n\nint TreeItem::childCount() const\n{\n    return childItems.count();\n}\n\nint TreeItem::columnCount() const\n{\n    return itemData.count();\n}\n\nQVariant TreeItem::data(int column) const\n{\n    return itemData.value(column);\n}\n\nbool TreeItem::insertChild(int row, TreeItem *item)\n{\n    if (row < 0 || row > childItems.count())\n        return false;\n\n    childItems.insert(row, item);\n    return true;\n}\n\nTreeItem *TreeItem::parent()\n{\n    return parentItem;\n}\n\nbool TreeItem::removeChild(int row)\n{\n    if (row < 0 || row >= childItems.count())\n        return false;\n\n    delete childItems.takeAt(row);\n    return true;\n}\n\nint TreeItem::row() const\n{\n    if (parentItem)\n        return parentItem->childItems.indexOf(const_cast<TreeItem*>(this));\n\n    return 0;\n}\n\nbool TreeItem::setData(int column, const QVariant &data)\n{\n    if (column < 0 || column >= itemData.count())\n        return false;\n\n    itemData.replace(column, data);\n    return true;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreeview-dnd/treeitem.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef TREEITEM_H\n#define TREEITEM_H\n\n#include <QList>\n#include <QVariant>\n\nclass TreeItem\n{\npublic:\n    TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);\n    ~TreeItem();\n\n    void appendChild(TreeItem *child);\n\n    TreeItem *child(int row);\n    int childCount() const;\n    int columnCount() const;\n    QVariant data(int column) const;\n    bool insertChild(int row, TreeItem *item);\n    TreeItem *parent();\n    bool removeChild(int row);\n    int row() const;\n    bool setData(int column, const QVariant &data);\n\nprivate:\n    QList<TreeItem*> childItems;\n    QList<QVariant> itemData;\n    TreeItem *parentItem;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreeview-dnd/treemodel.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n    treemodel.cpp\n\n    Provides a simple tree model to show how to create and use hierarchical\n    models.\n*/\n\n#include <QtGui>\n\n#include \"treeitem.h\"\n#include \"treemodel.h\"\n\nTreeModel::TreeModel(const QStringList &strings, QObject *parent)\n    : QAbstractItemModel(parent)\n{\n    QList<QVariant> rootData;\n    rootData << \"Title\" << \"Summary\";\n    rootItem = new TreeItem(rootData);\n    setupModelData(strings, rootItem);\n}\n\nTreeModel::~TreeModel()\n{\n    delete rootItem;\n}\n\nint TreeModel::columnCount(const QModelIndex &parent) const\n{\n    if (parent.isValid())\n        return static_cast<TreeItem*>(parent.internalPointer())->columnCount();\n    else\n        return rootItem->columnCount();\n}\n\nQVariant TreeModel::data(const QModelIndex &index, int role) const\n{\n    if (!index.isValid())\n        return QVariant();\n\n    if (role != Qt::DisplayRole)\n        return QVariant();\n\n    TreeItem *item = static_cast<TreeItem*>(index.internalPointer());\n\n    return item->data(index.column());\n}\n\nQt::ItemFlags TreeModel::flags(const QModelIndex &index) const\n{\n    if (!index.isValid())\n        return Qt::ItemIsEnabled;\n\n    return Qt::ItemIsEnabled | Qt::ItemIsSelectable;\n}\n\nQVariant TreeModel::headerData(int section, Qt::Orientation orientation,\n                               int role) const\n{\n    if (orientation == Qt::Horizontal && role == Qt::DisplayRole)\n        return rootItem->data(section);\n\n    return QVariant();\n}\n\nQModelIndex TreeModel::index(int row, int column, const QModelIndex &parent)\n            const\n{\n    TreeItem *parentItem;\n\n    if (!parent.isValid())\n        parentItem = rootItem;\n    else\n        parentItem = static_cast<TreeItem*>(parent.internalPointer());\n\n    TreeItem *childItem = parentItem->child(row);\n    if (childItem)\n        return createIndex(row, column, childItem);\n    else\n        return QModelIndex();\n}\n\nbool TreeModel::insertRows(int position, int rows, const QModelIndex &parent)\n{\n    TreeItem *parentItem;\n\n    if (!parent.isValid())\n        parentItem = rootItem;\n    else\n        parentItem = static_cast<TreeItem*>(parent.internalPointer());\n\n    if (position < 0 || position > parentItem->childCount())\n        return false;\n\n    QList<QVariant> blankList;\n    for (int column = 0; column < columnCount(); ++column)\n        blankList << QVariant(\"\");\n\n    beginInsertRows(parent, position, position + rows - 1);\n\n    for (int row = 0; row < rows; ++row) {\n        TreeItem *newItem = new TreeItem(blankList, parentItem);\n        if (!parentItem->insertChild(position, newItem))\n            break;\n    }\n\n    endInsertRows();\n    return true;\n}\n\nQModelIndex TreeModel::parent(const QModelIndex &index) const\n{\n    if (!index.isValid())\n        return QModelIndex();\n\n    TreeItem *childItem = static_cast<TreeItem*>(index.internalPointer());\n    TreeItem *parentItem = childItem->parent();\n\n    if (parentItem == rootItem)\n        return QModelIndex();\n\n    return createIndex(parentItem->row(), 0, parentItem);\n}\n\nbool TreeModel::removeRows(int position, int rows, const QModelIndex &parent)\n{\n    TreeItem *parentItem;\n\n    if (!parent.isValid())\n        parentItem = rootItem;\n    else\n        parentItem = static_cast<TreeItem*>(parent.internalPointer());\n\n    if (position < 0 || position > parentItem->childCount())\n        return false;\n\n    beginRemoveRows(parent, position, position + rows - 1);\n\n    for (int row = 0; row < rows; ++row) {\n        if (!parentItem->removeChild(position))\n            break;\n    }\n\n    endRemoveRows();\n    return true;\n}\n\nint TreeModel::rowCount(const QModelIndex &parent) const\n{\n    TreeItem *parentItem;\n\n    if (!parent.isValid())\n        parentItem = rootItem;\n    else\n        parentItem = static_cast<TreeItem*>(parent.internalPointer());\n\n    return parentItem->childCount();\n}\n\nbool TreeModel::setData(const QModelIndex &index,\n                        const QVariant &value, int role)\n{\n    if (!index.isValid() || role != Qt::EditRole)\n        return false;\n\n    TreeItem *item = static_cast<TreeItem*>(index.internalPointer());\n\n    if (item->setData(index.column(), value))\n        emit dataChanged(index, index);\n    else\n        return false;\n\n    return true;\n}\n\nvoid TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)\n{\n    QList<TreeItem*> parents;\n    QList<int> indentations;\n    parents << parent;\n    indentations << 0;\n\n    int number = 0;\n\n    while (number < lines.count()) {\n        int position = 0;\n        while (position < lines[number].length()) {\n            if (lines[number].mid(position, 1) != \" \")\n                break;\n            position++;\n        }\n\n        QString lineData = lines[number].mid(position).trimmed();\n\n        if (!lineData.isEmpty()) {\n            // Read the column data from the rest of the line.\n            QStringList columnStrings = lineData.split(\"\\t\", QString::SkipEmptyParts);\n            QList<QVariant> columnData;\n            for (int column = 0; column < columnStrings.count(); ++column)\n                columnData << columnStrings[column];\n\n            if (position > indentations.last()) {\n                // The last child of the current parent is now the new parent\n                // unless the current parent has no children.\n\n                if (parents.last()->childCount() > 0) {\n                    parents << parents.last()->child(parents.last()->childCount()-1);\n                    indentations << position;\n                }\n            } else {\n                while (position < indentations.last() && parents.count() > 0) {\n                    parents.pop_back();\n                    indentations.pop_back();\n                }\n            }\n\n            // Append a new item to the current parent's list of children.\n            parents.last()->appendChild(new TreeItem(columnData, parents.last()));\n        }\n\n        number++;\n    }\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreeview-dnd/treemodel.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef TREEMODEL_H\n#define TREEMODEL_H\n\n#include <QAbstractItemModel>\n#include <QModelIndex>\n#include <QVariant>\n\nclass TreeItem;\n\nclass TreeModel : public QAbstractItemModel\n{\n    Q_OBJECT\n\npublic:\n    TreeModel(const QStringList &strings, QObject *parent = 0);\n    ~TreeModel();\n\n    QVariant data(const QModelIndex &index, int role) const;\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    QVariant headerData(int section, Qt::Orientation orientation,\n                        int role = Qt::DisplayRole) const;\n    QModelIndex index(int row, int column,\n                      const QModelIndex &parent = QModelIndex()) const;\n    QModelIndex parent(const QModelIndex &index) const;\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n    int columnCount(const QModelIndex &parent = QModelIndex()) const;\n\n    bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool setData(const QModelIndex &index, const QVariant &value,\n                 int role = Qt::EditRole);\n\nprivate:\n    void setupModelData(const QStringList &lines, TreeItem *parent);\n\n    TreeItem *rootItem;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreewidget-using/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.cpp",
    "content": "/############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################/\n\n//! [0]\n    treeWidget =  QTreeWidget(self)\n//! [0]\n\n//! [1]\n    treeWidget.setColumnCount(2)\n//! [1] //! [2]\n    headers = QStringList()\n    headers << tr(\"Subject\") << tr(\"Default\")\n    treeWidget.setHeaderLabels(headers)\n//! [2]\n\n//! [3]\n    cities =  QTreeWidgetItem(treeWidget)\n    cities.setText(0, tr(\"Cities\"))\n    osloItem =  QTreeWidgetItem(cities)\n    osloItem.setText(0, tr(\"Oslo\"))\n    osloItem.setText(1, tr(\"Yes\"))\n//! [3]\n\n//! [4] //! [5]\n    planets =  QTreeWidgetItem(treeWidget, cities)\n//! [4]\n    planets.setText(0, tr(\"Planets\"))\n//! [5]\n\n//! [6]\n    item = QTreeWidgetItem()\n//! [6]\n\n//! [7]\n    found = treeWidget.findItems(itemText, Qt.MatchWildcard)\n\n    for item in found:\n        treeWidget.setItemSelected(item, True)\n        # Show the item.text(0) for each item.\n\n//! [7]\n\n//! [8]\n    parent = currentItem.parent()\n    if parent:\n        Item = QTreeWidgetItem(parent, treeWidget.currentItem())\n    else\n//! [8] //! [9]\n        Item = QTreeWidgetItem(treeWidget, treeWidget.currentItem())\n//! [9]\n\n//! [10]\n    parent = currentItem.parent()\n\n    if parent:\n        index = parent.indexOfChild(treeWidget->currentItem())\n        delete parent.takeChild(index)\n    else:\n        index = treeWidget.indexOfTopLevelItem(treeWidget->currentItem())\n        delete treeWidget.takeTopLevelItem(index)\n//! [10] //! [11]\n    \n//! [11]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreewidget-using/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QAction;\nclass QTreeWidget;\nclass QTreeWidgetItem;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void findItems();\n    void insertItem();\n    void removeItem();\n    void sortAscending();\n    void sortDescending();\n    void updateMenus(QTreeWidgetItem *current);\n    void updateSortItems();\n\nprivate:\n    void setupTreeItems();\n\n    QAction *ascendingAction;\n    QAction *autoSortAction;\n    QAction *descendingAction;\n    QAction *insertAction;\n    QAction *removeAction;\n    QTreeWidget *treeWidget;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0]\n    it = QTreeWidgetItemIterator(treeWidget)\n    while it:\n        if it.text(0) == itemText:\n            *it.setSelected(True)\n        ++it\n//! [0]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtreewidgetitemiterator-using/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QAction;\nclass QTreeWidget;\nclass QTreeWidgetItem;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void findItems();\n    void insertItem();\n    void removeItem();\n    void sortAscending();\n    void sortDescending();\n    void updateMenus(QTreeWidgetItem *current);\n    void updateSortItems();\n\nprivate:\n    void setupTreeItems();\n\n    QAction *ascendingAction;\n    QAction *autoSortAction;\n    QAction *descendingAction;\n    QAction *insertAction;\n    QAction *removeAction;\n    QTreeWidget *treeWidget;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtscript/evaluation/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtScript>\n\nint main(int argc, char *argv[])\n{\n//! [0]\n    QScriptEngine engine;\n    qDebug() << \"the magic number is:\" << engine.evaluate(\"1 + 2\").toNumber();\n//! [0]\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QObject>\n#include <QtScript>\n#include \"myobject.h\"\n\nint main(int argc, char *argv[])\n{\n//! [0]\n    QScriptEngine engine;\n    QObject *someObject = new MyObject;\n    QScriptValue objectValue = engine.newQObject(someObject);\n    engine.globalObject().setProperty(\"myObject\", objectValue);\n//! [0]\n    qDebug() << \"myObject's calculate() function returns\"\n             << engine.evaluate(\"myObject.calculate(10)\").toNumber();\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/myobject.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"myobject.h\"\n\nMyObject::MyObject()\n{\n}\n\nint MyObject::calculate(int value) const\n{\n    int total = 0;\n    for (int i = 0; i <= value; ++i)\n        total += i;\n    return total;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtscript/registeringobjects/myobject.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MYOBJECT_H\n#define MYOBJECT_H\n\n#include <QObject>\n\nclass MyObject : public QObject\n{\n    Q_OBJECT\n\npublic:\n    MyObject();\n\npublic slots:\n    int calculate(int value) const;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtscript/registeringvalues/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtScript>\n\nint main(int argc, char *argv[])\n{\n    QScriptEngine engine;\n//! [0]\n    engine.globalObject().setProperty(\"foo\", 123);\n    qDebug() << \"foo times two is:\" << engine.evaluate(\"foo * 2\").toNumber();\n//! [0]\n    return 0;\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QTextEdit>\n#include <QTimer>\n#include <QtScript>\n#include \"myobject.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    QScriptEngine engine;\n    QFile scriptFile(\":/object.js\");\n    scriptFile.open(QFile::ReadOnly);\n    engine.evaluate(scriptFile.readAll());\n    scriptFile.close();\n\n    QTextEdit editor;\n    QTimer timer;\n    QScriptValue constructor = engine.evaluate(\"Object\");\n    QScriptValueList arguments;\n    arguments << engine.newQObject(&timer);\n    arguments << engine.newQObject(&editor);\n    QScriptValue object = constructor.construct(arguments);\n    if (engine.hasUncaughtException()) {\n        qDebug() << engine.uncaughtException().toString();\n    }\n\n    editor.show();\n    timer.start(1000);\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/object.js",
    "content": "function Object(timer, editor)\n{\n    this.editor = editor;\n    this.counter = 0;\n    timer.timeout.connect(notify);\n    timer.timeout.connect(this, this.addLine);\n}\n\nObject.prototype.addLine = function()\n{\n    this.editor.append(this.counter);\n    this.counter += 1;\n}\n\nfunction notify()\n{\n    print(\"timeout() received\");\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qtscript/scriptedslot/scriptedslot.qrc",
    "content": "<RCC>\n  <qresource prefix=\"/\" >\n    <file>object.js</file>\n  </qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/quiloader/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QtUiTools>\n\n#include \"mywidget.h\"\n\n//! [0]\ndef loadCustomWidget(parent):\n    loader = QUiLoader()\n\n    availableWidgets = loader.availableWidgets()\n\n    if availableWidgets.contains(\"AnalogClock\"):\n        myWidget = loader.createWidget(\"AnalogClock\", parent)\n\n    return myWidget\n//! [0]\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MyWidget widget;\n    widget.show();\n\n    QWidget *customWidget = loadCustomWidget(0);\n    customWidget->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/quiloader/myform.ui",
    "content": "<ui version=\"4.0\" >\n <author></author>\n <comment></comment>\n <exportmacro></exportmacro>\n <class>Form</class>\n <widget class=\"QWidget\" name=\"Form\" >\n  <property name=\"geometry\" >\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>258</width>\n    <height>224</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\" >\n   <string>Export Document</string>\n  </property>\n  <layout class=\"QVBoxLayout\" >\n   <property name=\"margin\" >\n    <number>8</number>\n   </property>\n   <property name=\"spacing\" >\n    <number>6</number>\n   </property>\n   <item>\n    <widget class=\"QGroupBox\" name=\"groupBox\" >\n     <property name=\"title\" >\n      <string>Export Options</string>\n     </property>\n     <layout class=\"QGridLayout\" >\n      <property name=\"margin\" >\n       <number>8</number>\n      </property>\n      <property name=\"spacing\" >\n       <number>6</number>\n      </property>\n      <item row=\"1\" column=\"0\" >\n       <widget class=\"QRadioButton\" name=\"radioButton_2\" >\n        <property name=\"text\" >\n         <string>&amp;DocBook</string>\n        </property>\n       </widget>\n      </item>\n      <item row=\"0\" column=\"0\" >\n       <widget class=\"QRadioButton\" name=\"radioButton\" >\n        <property name=\"text\" >\n         <string>&amp;LaTeX</string>\n        </property>\n        <property name=\"checked\" >\n         <bool>true</bool>\n        </property>\n       </widget>\n      </item>\n      <item row=\"1\" column=\"1\" >\n       <widget class=\"QCheckBox\" name=\"checkBox_2\" >\n        <property name=\"text\" >\n         <string>Include p&amp;ictures</string>\n        </property>\n        <property name=\"checked\" >\n         <bool>true</bool>\n        </property>\n       </widget>\n      </item>\n      <item row=\"5\" column=\"0\" >\n       <spacer>\n        <property name=\"orientation\" >\n         <enum>Qt::Vertical</enum>\n        </property>\n        <property name=\"sizeHint\" >\n         <size>\n          <width>20</width>\n          <height>40</height>\n         </size>\n        </property>\n       </spacer>\n      </item>\n      <item row=\"0\" column=\"1\" >\n       <widget class=\"QCheckBox\" name=\"checkBox\" >\n        <property name=\"text\" >\n         <string>&amp;Compress</string>\n        </property>\n       </widget>\n      </item>\n      <item row=\"2\" column=\"0\" >\n       <widget class=\"QRadioButton\" name=\"radioButton_2_2\" >\n        <property name=\"text\" >\n         <string>&amp;HTML</string>\n        </property>\n       </widget>\n      </item>\n      <item row=\"3\" column=\"0\" >\n       <widget class=\"QRadioButton\" name=\"radioButton_3\" >\n        <property name=\"text\" >\n         <string>&amp;PostScript</string>\n        </property>\n       </widget>\n      </item>\n      <item row=\"4\" column=\"0\" >\n       <widget class=\"QRadioButton\" name=\"radioButton_4\" >\n        <property name=\"text\" >\n         <string>PD&amp;F</string>\n        </property>\n       </widget>\n      </item>\n      <item row=\"2\" column=\"1\" >\n       <widget class=\"QCheckBox\" name=\"checkBox_3\" >\n        <property name=\"text\" >\n         <string>Include &amp;metadata</string>\n        </property>\n       </widget>\n      </item>\n      <item row=\"3\" column=\"1\" >\n       <widget class=\"QCheckBox\" name=\"checkBox_4\" >\n        <property name=\"text\" >\n         <string>Create inde&amp;x</string>\n        </property>\n        <property name=\"checked\" >\n         <bool>true</bool>\n        </property>\n       </widget>\n      </item>\n     </layout>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <pixmapfunction></pixmapfunction>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/quiloader/mywidget.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QtUiTools>\n\n#include \"mywidget.h\"\n\n//! [0]\nclass MyWidget(QWidget):\n    def __init__(self, parent):\n        super(QWidget, self).__init__(parent)\n        loader = QUiLoader()\n        file = QFile(\":/forms/myform.ui\")\n        file.open(QFile.ReadOnly)\n        myWidget = loader.load(file, self)\n        file.close()\n\n        layout = QVBoxLayout()\n        layout.addWidget(myWidget)\n        self.setLayout(layout)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/quiloader/mywidget.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MYWIDGET_H\n#define MYWIDGET_H\n\n#include <QWidget>\n\nclass MyWidget : public QWidget\n{\npublic:\n    MyWidget(QWidget *parent = 0);\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/quiloader/mywidget.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource prefix=\"/forms\">\n<file>myform.ui</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qx11embedcontainer/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QX11EmbedContainer>\n\n//! [0]\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    if (app.arguments().count() != 2) {\n        qFatal(\"Error - expected executable path as argument\");\n        return 1;\n    }\n\n    QX11EmbedContainer container;\n    container.show();\n\n    QProcess process(&container);\n    QString executable(app.arguments()[1]);\n    QStringList arguments;\n    arguments << QString::number(container.winId());\n    process.start(executable, arguments);\n\n    int status = app.exec();\n    process.close();\n    return status;\n}\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"embedwidget.h\"\n\nEmbedWidget::EmbedWidget(QWidget *parent)\n    : QX11EmbedWidget(parent)\n{\n    gradient = QRadialGradient(100, 100, 90, 60, 60);\n    gradient.setColorAt(0.0, Qt::white);\n    gradient.setColorAt(0.9, QColor(192, 192, 255));\n    gradient.setColorAt(1.0, QColor(0, 32, 64));\n}\n\nQSize EmbedWidget::sizeHint() const\n{\n    return QSize(200, 200);\n}\n\nvoid EmbedWidget::paintEvent(QPaintEvent *event)\n{\n    QPainter painter;\n    painter.begin(this);\n    painter.setRenderHint(QPainter::Antialiasing);\n    painter.fillRect(event->rect(), QBrush(gradient));\n    painter.end();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qx11embedwidget/embedwidget.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef EMBEDWIDGET_H\n#define EMBEDWIDGET_H\n\n#include <QRadialGradient>\n#include <QSize>\n#include <QX11EmbedWidget>\n\nclass QPaintEvent;\n\nclass EmbedWidget : public QX11EmbedWidget\n{\n    Q_OBJECT\n\npublic:\n    EmbedWidget(QWidget *parent = 0);\n    QSize sizeHint() const;\n\nprotected:\n    void paintEvent(QPaintEvent *event);\n\nprivate:\n    QRadialGradient gradient;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qx11embedwidget/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include \"embedwidget.h\"\n\n//! [0]\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    if (app.arguments().count() != 2) {\n        qFatal(\"Error - expected window id as argument\");\n        return 1;\n    }\n\n    QString windowId(app.arguments()[1]);\n    EmbedWidget window;\n    window.embedInto(windowId.toULong());\n    window.show();\n\n    return app.exec();\n}\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qxmlquery/bindingExample.cpp",
    "content": "//! [0]\n    QBuffer device;\n    device.setData(myQString.toUtf8());\n    device.open(QIODevice::ReadOnly);\n\n    QXmlQuery query;\n    query.setQuery(\"doc($inputDocument)/query[theDocument]\");\n    query.bindVariable(\"inputDocument\", &device);\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qxmlschema/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtCore>\n#include <QtXmlPatterns>\n\nclass Schema\n{\n    public:\n        void loadFromUrl() const;\n        void loadFromFile() const;\n        void loadFromData() const;\n};\n\nvoid Schema::loadFromUrl() const\n{\n//! [0]\n    url = QUrl(\"http://www.schema-example.org/myschema.xsd\")\n\n    schema = QXmlSchema()\n    if schema.load(url):\n        qDebug(\"schema is valid\")\n    else:\n        qDebug(\"schema is invalid\")\n//! [0]\n}\n\nvoid Schema::loadFromFile() const\n{\n//! [1]\n    file = QFile(\"myschema.xsd\")\n    file.open(QIODevice.ReadOnly)\n\n    schema = QXmlSchema()\n    schema.load(file, QUrl.fromLocalFile(file.fileName()))\n\n    if schema.isValid():\n        qDebug(\"schema is valid\")\n    else:\n        qDebug(\"schema is invalid\")\n//! [1]\n}\n\nvoid Schema::loadFromData() const\n{\n//! [2]\n    data = QByteArray(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\"\n                      + \"<xsd:schema\"\n                      + \"        xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\"\"\n                      + \"        xmlns=\\\"http://qt.nokia.com/xmlschematest\\\"\"\n                      + \"        targetNamespace=\\\"http://qt.nokia.com/xmlschematest\\\"\"\n                      + \"        version=\\\"1.0\\\"\"\n                      + \"        elementFormDefault=\\\"qualified\\\">\"\n                      + \"</xsd:schema>\" )\n\n    schema = QXmlSchema()\n    schema.load(data)\n\n    if schema.isValid():\n        qDebug(\"schema is valid\")\n    else:\n        qDebug(\"schema is invalid\")\n//! [2]\n}\n\nint main(int argc, char **argv)\n{\n    QCoreApplication app(argc, argv);\n\n    Schema schema;\n\n    schema.loadFromUrl();\n    schema.loadFromFile();\n    schema.loadFromData();\n\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qxmlschemavalidator/main.cpp",
    "content": "\ndef validateFromUrl():\n//! [0]\n    schema = getSchema()\n\n    url = QUrl(\"http://www.schema-example.org/test.xml\")\n\n    validator = QXmlSchemaValidator(schema)\n    if validator.validate(url):\n        print \"instance document is valid\"\n    else:\n        print \"instance document is invalid\"\n//! [0]\n\ndef validateFromFile():\n//! [1]\n    schema = getSchema()\n\n    file = QFile(\"test.xml\")\n    file.open(QIODevice.ReadOnly)\n\n    validator = QXmlSchemaValidator(schema)\n    if validator.validate(file, QUrl.fromLocalFile(file.fileName())):\n        print \"instance document is valid\"\n    else:\n        print \"instance document is invalid\"\n//! [1]\n}\n\ndef validateFromData():\n//! [2]\n    schema = getSchema()\n\n    data = QByteArray(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><test></test>\")\n\n    buffer = QBuffer(data)\n    buffer.open(QIODevice.ReadOnly)\n\n    QXmlSchemaValidator validator(schema)\n    if validator.validate(buffer):\n        print \"instance document is valid\"\n    else:\n        print \"instance document is invalid\"\n//! [2]\n\ndef validateComplete():\n//! [3]\n    schemaUrl = QUrl(\"file:///home/user/schema.xsd\")\n\n    schema = QXmlSchema()\n    schema.load(schemaUrl)\n\n    if schema.isValid():\n        file = QFile(\"test.xml\")\n        file.open(QIODevice.ReadOnly)\n\n        validator = QXmlSchemaValidator(schema)\n        if validator.validate(file, QUrl.fromLocalFile(file.fileName())):\n            print \"instance document is valid\"\n        else:\n            print \"instance document is invalid\"\n    }\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/qxmlstreamwriter/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QCoreApplication>\n#include <QFile>\n#include <QXmlStreamWriter>\n#include <stdio.h>\n\nint main(int argc, char *argv[])\n{\n    QCoreApplication app(argc, argv);\n    QFile output;\n    output.open(stdout, QIODevice::WriteOnly);\n//! [write output]\n//! [start stream]\n    QXmlStreamWriter stream(&output);\n    stream.setAutoFormatting(true);\n    stream.writeStartDocument();\n//! [start stream]\n    stream.writeDTD(\"<!DOCTYPE xbel>\");\n    stream.writeStartElement(\"xbel\");\n    stream.writeAttribute(\"version\", \"1.0\");\n    stream.writeStartElement(\"folder\");\n    stream.writeAttribute(\"folded\", \"no\");\n//! [write element]\n    stream.writeStartElement(\"bookmark\");\n    stream.writeAttribute(\"href\", \"http://www.qtsoftware.com/\");\n    stream.writeTextElement(\"title\", \"Qt Home\");\n    stream.writeEndElement(); // bookmark\n//! [write element]\n    stream.writeEndElement(); // folder\n    stream.writeEndElement(); // xbel\n//! [finish stream]\n    stream.writeEndDocument();\n//! [finish stream]\n//! [write output]\n    output.close();\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/reading-selections/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  main.cpp\n\n  A simple example that shows how selections can be used directly on a model.\n  It shows the result of some selections made using a table view.\n*/\n\n#include <QApplication>\n\n#include \"window.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QMainWindow *window = new MainWindow;\n    window->show();\n    window->resize(640, 480);\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/reading-selections/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MODEL_H\n#define MODEL_H\n\n#include <QAbstractTableModel>\n#include <QStringList>\n#include <QVariant>\n\nclass TableModel : public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    TableModel(int rows = 1, int columns = 1, QObject *parent = 0);\n\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n    int columnCount(const QModelIndex &parent = QModelIndex()) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation,\n                        int role = Qt::DisplayRole) const;\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    bool setData(const QModelIndex &index, const QVariant &value,\n                 int role = Qt::EditRole);\n\n    bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());\n    bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());\n\nprivate:\n    QList<QStringList> rowList;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/reading-selections/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  window.cpp\n\n  A minimal subclass of QTableView with slots to allow the selection model\n  to be monitored.\n*/\n\n#include <QAbstractItemModel>\n#include <QItemSelection>\n#include <QItemSelectionModel>\n#include <QMenu>\n#include <QMenuBar>\n#include <QStatusBar>\n\n#include \"model.h\"\n#include \"window.h\"\n\nMainWindow::MainWindow(QWidget *parent)\n    : QMainWindow(parent)\n{\n    setWindowTitle(\"Selected Items in a Table Model\");\n\n    model = new TableModel(8, 4, this);\n\n    table = new QTableView(this);\n    table->setModel(model);\n\n    QMenu *actionMenu = new QMenu(tr(\"&Actions\"), this);\n    QAction *fillAction = actionMenu->addAction(tr(\"&Fill Selection\"));\n    QAction *clearAction = actionMenu->addAction(tr(\"&Clear Selection\"));\n    QAction *selectAllAction = actionMenu->addAction(tr(\"&Select All\"));\n    menuBar()->addMenu(actionMenu);\n\n    connect(fillAction, SIGNAL(triggered()), this, SLOT(fillSelection()));\n    connect(clearAction, SIGNAL(triggered()), this, SLOT(clearSelection()));\n    connect(selectAllAction, SIGNAL(triggered()), this, SLOT(selectAll()));\n\n    selectionModel = table->selectionModel();\n\n    statusBar();\n    setCentralWidget(table);\n}\n\nvoid MainWindow::fillSelection()\n{\n//! [0]\n    QModelIndexList indexes = selectionModel->selectedIndexes();\n    QModelIndex index;\n\n    foreach(index, indexes) {\n        QString text = QString(\"(%1,%2)\").arg(index.row()).arg(index.column());\n        model->setData(index, text);\n    }\n//! [0]\n}\n\nvoid MainWindow::clearSelection()\n{\n    QModelIndexList indexes = selectionModel->selectedIndexes();\n    QModelIndex index;\n\n    foreach(index, indexes)\n        model->setData(index, \"\");\n}\n\nvoid MainWindow::selectAll()\n{\n//! [1]\n    QModelIndex parent = QModelIndex();\n//! [1] //! [2]\n    QModelIndex topLeft = model->index(0, 0, parent);\n    QModelIndex bottomRight = model->index(model->rowCount(parent)-1,\n        model->columnCount(parent)-1, parent);\n//! [2]\n\n//! [3]\n    QItemSelection selection(topLeft, bottomRight);\n    selectionModel->select(selection, QItemSelectionModel::Select);\n//! [3]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/reading-selections/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QItemSelection>\n#include <QMainWindow>\n#include <QAbstractItemModel>\n#include <QWidget>\n#include <QTableView>\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\npublic:\n    MainWindow(QWidget *parent = 0);\n\nprivate slots:\n    void fillSelection();\n    void clearSelection();\n    void selectAll();\n\nprivate:\n    QAbstractItemModel *model;\n    QItemSelectionModel *selectionModel;\n    QTableView *table;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/scribe-overview/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\nfrom PySide.QtGui import *\n\n# edit : QTextEdit\ndef mergeFormat(edit):\n//! [0]\n    document = edit.document()\n    cursor = QTextCursor(document)\n\n    cursor.movePosition(QTextCursor.Start)\n    cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.KeepAnchor)\n\n    format = QTextCharFormat()\n    format.setFontWeight(QFont.Bold)\n\n    cursor.mergeCharFormat(format)\n//! [0]\n\ndef main():\n    aStringContainingHTMLtext QString(\"<h1>Scribe Overview</h1>\")\n\n    app = QApplication(sys.argv)\n\n//! [1]\n    editor = QTextEdit(None)\n    editor.setHtml(aStringContainingHTMLtext)\n    editor.show()\n//! [1]\n\n    return app.exec_()\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/scriptdebugger.cpp",
    "content": "\n#include <QtGui>\n#include <QtScript>\n#include <QtScriptTools>\n\n// Perhaps shpw entire example for getting debugger up with script\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n\n     QString fileName(\"helloscript.qs\");\n     QFile scriptFile(fileName);\n     scriptFile.open(QIODevice::ReadOnly);\n     QTextStream stream(&scriptFile);\n     QString contents = stream.readAll();\n     scriptFile.close();\n\n    QScriptEngine *engine = new QScriptEngine();\n\n    QScriptEngineDebugger *debugger = new QScriptEngineDebugger();\n    debugger->attachTo(engine);\n\n    // Set up configuration with only stack and code\n    QWidget *widget = new QWidget;\n//![0]\n    codeWindow = debugger.widget(QScriptEngineDebugger.CodeWidget)\n    stackWidget = debugger.widget(QScriptEngineDebugger.StackWidget)\n\n    layout = QHBoxLayout()\n    layout.addWidget(codeWindow)\n    layout.addWidget(stackWidget)\n//![0]\n\n//![1]\n    continueAction = debugger.action(QScriptEngineDebugger.ContinueAction)\n    stepOverAction = debugger.action(QScriptEngineDebugger.StepOverAction)\n    stepIntoAction = debugger.action(QScriptEngineDebugger.StepIntoAction)\n\n    toolBar = QToolBar()\n    toolBar.addAction(continueAction)\n//![1]\n    toolBar->addAction(stepOverAction);\n    toolBar->addAction(stepIntoAction);\n\n    layout->addWidget(toolBar);\n    continueAction->setIcon(QIcon(\"copy.png\"));\n\n    debugger->setAutoShowStandardWindow(false);\n\n    widget->setLayout(layout);\n    widget->show();\n\n     QPushButton button;\n     QScriptValue scriptButton = engine->newQObject(&button);\n     engine->globalObject().setProperty(\"button\", scriptButton);\n\n//![2]\n     debugger.action(QScriptEngineDebugger.InterruptAction).trigger()\n     engine.evaluate(contents, fileName)\n//![2]\n\n    return app.exec();\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/seekslider.cpp",
    "content": "#include <QtGui>\n\n#include <phonon/audiooutput.h>\n#include <phonon/seekslider.h>\n#include <phonon/mediaobject.h>\n#include <phonon/audiooutput.h>\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args)\n\n//![0]\n    moo = Phonon.MediaObject()\n    device = Phonon.AudioOutput()\n    Phonon.createPath(moo, device)\n    moo.setCurrentSource(QString(\"/home/gvatteka/Music/Lumme-Badloop.ogg\"))\n\n    slider = Phonon.SeekSlider()\n    slider.setMediaObject(moo)\n\n    slider.show()\n    moo.play()\n//![0]\n\n    app.exec()\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/separations/finalwidget.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\nfinalwidget.cpp\n\nA widget to display an image and a label containing a description.\n*/\n\n#include <QtGui>\n#include \"finalwidget.h\"\n\nFinalWidget::FinalWidget(QWidget *parent, const QString &name,\n                         const QSize &labelSize)\n    : QFrame(parent)\n{\n    hasImage = false;\n    imageLabel = new QLabel;\n    imageLabel->setFrameShadow(QFrame::Sunken);\n    imageLabel->setFrameShape(QFrame::StyledPanel);\n    imageLabel->setMinimumSize(labelSize);\n    nameLabel = new QLabel(name);\n\n    QVBoxLayout *layout = new QVBoxLayout;\n    layout->addWidget(imageLabel, 1);\n    layout->addWidget(nameLabel, 0);\n    setLayout(layout);\n}\n\n/*!\n    If the mouse moves far enough when the left mouse button is held down,\n    start a drag and drop operation.\n*/\n\nvoid FinalWidget::mouseMoveEvent(QMouseEvent *event)\n{\n    if (!(event->buttons() & Qt::LeftButton))\n        return;\n    if ((event->pos() - dragStartPosition).manhattanLength()\n         < QApplication::startDragDistance())\n        return;\n    if (!hasImage)\n        return;\n\n    QDrag *drag = new QDrag(this);\n    QMimeData *mimeData = new QMimeData;\n\n//! [0]\n    output = QByteArray()\n    outputBuffer = QBuffer(output)\n    outputBuffer.open(QIODevice.WriteOnly)\n    imageLabel.pixmap().toImage().save(outputBuffer, \"PNG\")\n    mimeData.setData(\"image/png\", output)\n//! [0]\n/*\n//! [1]\n    mimeData.setImageData(QVariant(imageLabel.pixmap()))\n//! [1]\n*/\n    drag.setMimeData(mimeData)\n    drag.setPixmap(imageLabel.pixmap().scaled(64, 64, Qt.KeepAspectRatio))\n//! [2]\n    drag.setHotSpot(QPoint(drag.pixmap().width()/2,\n                           drag.pixmap().height()))\n//! [2]\n\n    drag->start();\n}\n\n/*!\n    Check for left mouse button presses in order to enable drag and drop.\n*/\n\nvoid FinalWidget::mousePressEvent(QMouseEvent *event)\n{\n    if (event->button() == Qt::LeftButton)\n        dragStartPosition = event->pos();\n}\n\nconst QPixmap* FinalWidget::pixmap() const\n{\n    return imageLabel->pixmap();\n}\n\nvoid FinalWidget::setPixmap(const QPixmap &pixmap)\n{\n    imageLabel->setPixmap(pixmap);\n    hasImage = true;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/separations/finalwidget.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef FINALWIDGET_H\n#define FINALWIDGET_H\n\n#include <QFrame>\n#include <QImage>\n#include <QPoint>\n#include <QSize>\n\nclass QGridLayout;\nclass QLabel;\nclass QMouseEvent;\nclass QWidget;\n\nclass FinalWidget : public QFrame\n{\n    Q_OBJECT\n\npublic:\n    FinalWidget(QWidget *parent, const QString &name, const QSize &labelSize);\n    void setPixmap(const QPixmap &pixmap);\n    const QPixmap *pixmap() const;\n\nprotected:\n    void mouseMoveEvent(QMouseEvent *event);\n    void mousePressEvent(QMouseEvent *event);\n\nprivate:\n    void createImage();\n\n    bool hasImage;\n    QImage originalImage;\n    QLabel *imageLabel;\n    QLabel *nameLabel;\n    QPoint dragStartPosition;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/separations/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include \"viewer.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Viewer viewer;\n    viewer.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/separations/screenwidget.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\nscreenwidget.cpp\n\nA widget to display colour components from an image using independently\nselected colors. Controls are provided to allow the image to be inverted, and\nthe color to be selection via a standard dialog. The image is displayed in a\nlabel widget.\n*/\n\n#include <QApplication>\n#include <QColorDialog>\n#include <QGridLayout>\n#include <QImage>\n#include <QLabel>\n#include <QMenu>\n#include <QMimeData>\n#include <QMouseEvent>\n#include <QPixmap>\n#include <QPushButton>\n#include <QWidget>\n\n#include \"screenwidget.h\"\n\n/*!\nInitializes the paint color, the mask color (cyan, magenta,\nor yellow), connects the color selector and invert checkbox to functions,\nand creates a two-by-two grid layout.\n*/\n\nScreenWidget::ScreenWidget(QWidget *parent, QColor initialColor,\n                           const QString &name, Separation mask,\n                           const QSize &labelSize)\n    : QFrame(parent)\n{\n    paintColor = initialColor;\n    maskColor = mask;\n    inverted = false;\n\n    imageLabel = new QLabel;\n    imageLabel->setFrameShadow(QFrame::Sunken);\n    imageLabel->setFrameShape(QFrame::StyledPanel);\n    imageLabel->setMinimumSize(labelSize);\n\n    nameLabel = new QLabel(name);\n    colorButton = new QPushButton(tr(\"Modify...\"));\n    colorButton->setBackgroundRole(QPalette::Button);\n    colorButton->setMinimumSize(32, 32);\n\n    QPalette palette(colorButton->palette());\n    palette.setColor(QPalette::Button, initialColor);\n    colorButton->setPalette(palette);\n\n    invertButton = new QPushButton(tr(\"Invert\"));\n    //invertButton->setToggleButton(true);\n    //invertButton->setOn(inverted);\n    invertButton->setEnabled(false);\n\n    connect(colorButton, SIGNAL(clicked()), this, SLOT(setColor()));\n    connect(invertButton, SIGNAL(clicked()), this, SLOT(invertImage()));\n\n    QGridLayout *gridLayout = new QGridLayout;\n    gridLayout->addWidget(imageLabel, 0, 0, 1, 2);\n    gridLayout->addWidget(nameLabel, 1, 0);\n    gridLayout->addWidget(colorButton, 1, 1);\n    gridLayout->addWidget(invertButton, 2, 1, 1, 1);\n    setLayout(gridLayout);\n}\n\n/*!\n    Creates a new image by separating out the cyan, magenta, or yellow\n    component, depending on the mask color specified in the constructor.\n\n    The amount of the component found in each pixel of the image is used\n    to determine how much of a user-selected ink is used for each pixel\n    in the new image for the label widget.\n*/\n\nvoid ScreenWidget::createImage()\n{\n    newImage = originalImage.copy();\n\n    // Create CMY components for the ink being used.\n    float cyanInk = (255 - paintColor.red())/255.0;\n    float magentaInk = (255 - paintColor.green())/255.0;\n    float yellowInk = (255 - paintColor.blue())/255.0;\n\n    int (*convert)(QRgb);\n\n    switch (maskColor) {\n        case Cyan:\n            convert = qRed;\n            break;\n        case Magenta:\n            convert = qGreen;\n            break;\n        case Yellow:\n            convert = qBlue;\n            break;\n    }\n\n    for (int y = 0; y < newImage.height(); ++y) {\n        for (int x = 0; x < newImage.width(); ++x) {\n            QRgb p(originalImage.pixel(x, y));\n\n            // Separate the source pixel into its cyan component.\n            int amount;\n\n            if (inverted)\n                amount = convert(p);\n            else\n                amount = 255 - convert(p);\n\n            QColor newColor(\n                255 - qMin(int(amount * cyanInk), 255),\n                255 - qMin(int(amount * magentaInk), 255),\n                255 - qMin(int(amount * yellowInk), 255));\n\n            newImage.setPixel(x, y, newColor.rgb());\n        }\n    }\n\n    imageLabel->setPixmap(QPixmap::fromImage(newImage));\n}\n\n/*!\n    Returns a pointer to the modified image.\n*/\n\nQImage* ScreenWidget::image()\n{\n    return &newImage;\n}\n\n/*!\n    Sets whether the amount of ink applied to the canvas is to be inverted\n    (subtracted from the maximum value) before the ink is applied.\n*/\n\nvoid ScreenWidget::invertImage()\n{\n    //inverted = invertButton->isOn();\n    inverted = !inverted;\n    createImage();\n    emit imageChanged();\n}\n\n/*!\n    Separate the current image into cyan, magenta, and yellow components.\n    Create a representation of how each component might appear when applied\n    to a blank white piece of paper.\n*/\n\nvoid ScreenWidget::setColor()\n{\n    QColor newColor = QColorDialog::getColor(paintColor);\n\n    if (newColor.isValid()) {\n        paintColor = newColor;\n        QPalette palette(colorButton->palette());\n        palette.setColor(QPalette::Button, paintColor);\n        colorButton->setPalette(palette);\n        createImage();\n        emit imageChanged();\n    }\n}\n\n/*!\n    Records the original image selected by the user, creates a color\n    separation, and enables the invert image checkbox.\n*/\n\nvoid ScreenWidget::setImage(QImage &image)\n{\n    originalImage = image;\n    createImage();\n    invertButton->setEnabled(true);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/separations/screenwidget.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef SCREENWIDGET_H\n#define SCREENWIDGET_H\n\n#include <QColor>\n#include <QFrame>\n#include <QImage>\n#include <QSize>\n\nclass QGridLayout;\nclass QLabel;\nclass QPushButton;\nclass QWidget;\n\nclass ScreenWidget : public QFrame\n{\n    Q_OBJECT\npublic:\n    enum Separation { Cyan, Magenta, Yellow };\n\n    ScreenWidget(QWidget *parent, QColor initialColor, const QString &name,\n                 Separation mask, const QSize &labelSize);\n    void setImage(QImage &image);\n    QImage* image();\n\nsignals:\n    void imageChanged();\n\npublic slots:\n    void setColor();\n    void invertImage();\n\nprivate:\n    void createImage();\n\n    bool inverted;\n    QColor paintColor;\n    QImage newImage;\n    QImage originalImage;\n    QLabel *imageLabel;\n    QLabel *nameLabel;\n    QPushButton *colorButton;\n    QPushButton *invertButton;\n    Separation maskColor;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/separations/viewer.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\nviewer.cpp\n\nProvides a main window for displaying a user-specified original image\nwith three color separations in a grid layout.\n\nA main menu provides entries for selecting files, and adjusting the\nbrightness of the separations.\n*/\n\n#include <QtGui>\n\n#include \"finalwidget.h\"\n#include \"screenwidget.h\"\n#include \"viewer.h\"\n\n/*\n    Constructor: initializes a default value for the brightness, creates\n    the main menu entries, and constructs a central widget that contains\n    enough space for images to be displayed.\n*/\n\nViewer::Viewer()\n{\n    setWindowTitle(tr(\"QImage Color Separations\"));\n\n    brightness = 255;\n\n    createMenus();\n    setCentralWidget(createCentralWidget());\n}\n\n/*\n    Creates a main menu with two entries: a File menu, to allow the image\n    to be selected, and a Brightness menu to allow the brightness of the\n    separations to be changed.\n\n    Initially, the Brightness menu items are disabled, but the first entry in\n    the menu is checked to reflect the default brightness.\n*/\n\nvoid Viewer::createMenus()\n{\n    fileMenu = new QMenu(tr(\"&File\"), this);\n    brightnessMenu = new QMenu(tr(\"&Brightness\"), this);\n\n    QAction *openAction = fileMenu->addAction(tr(\"&Open...\"));\n    openAction->setShortcut(QKeySequence(\"Ctrl+O\"));\n    saveAction = fileMenu->addAction(tr(\"&Save...\"));\n    saveAction->setShortcut(QKeySequence(\"Ctrl+S\"));\n    saveAction->setEnabled(false);\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(QKeySequence(\"Ctrl+Q\"));\n\n    QAction *noBrightness = brightnessMenu->addAction(tr(\"&0%\"));\n    noBrightness->setCheckable(true);\n    QAction *quarterBrightness = brightnessMenu->addAction(tr(\"&25%\"));\n    quarterBrightness->setCheckable(true);\n    QAction *halfBrightness = brightnessMenu->addAction(tr(\"&50%\"));\n    halfBrightness->setCheckable(true);\n    QAction *threeQuartersBrightness = brightnessMenu->addAction(tr(\"&75%\"));\n    threeQuartersBrightness->setCheckable(true);\n    QAction *fullBrightness = brightnessMenu->addAction(tr(\"&100%\"));\n    fullBrightness->setCheckable(true);\n\n    menuMap[noBrightness] = None;\n    menuMap[quarterBrightness] = Quarter;\n    menuMap[halfBrightness] = Half;\n    menuMap[threeQuartersBrightness] = ThreeQuarters;\n    menuMap[fullBrightness] = Full;\n\n    currentBrightness = fullBrightness;\n    currentBrightness->setChecked(true);\n    brightnessMenu->setEnabled(false);\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(brightnessMenu);\n\n    connect(openAction, SIGNAL(triggered()), this, SLOT(chooseFile()));\n    connect(saveAction, SIGNAL(triggered()), this, SLOT(saveImage()));\n    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));\n    connect(brightnessMenu, SIGNAL(triggered(QAction *)), this,\n            SLOT(setBrightness(QAction *)));\n}\n\n/*\n    Constructs a central widget for the window consisting of a two-by-two\n    grid of labels, each of which will contain an image. We restrict the\n    size of the labels to 256 pixels, and ensure that the window cannot\n    be resized.\n*/\n\nQFrame* Viewer::createCentralWidget()\n{\n    QFrame* frame = new QFrame(this);\n    grid = new QGridLayout(frame);\n    grid->setSpacing(8);\n    grid->setMargin(4);\n\n    layout()->setSizeConstraint(QLayout::SetFixedSize);\n\n    QSize labelSize(256, 256);\n\n    finalWidget = new FinalWidget(frame, tr(\"Final image\"), labelSize);\n\n    cyanWidget = new ScreenWidget(frame, Qt::cyan, tr(\"Cyan\"),\n                                  ScreenWidget::Cyan, labelSize);\n    magentaWidget = new ScreenWidget(frame, Qt::magenta, tr(\"Magenta\"),\n                                     ScreenWidget::Magenta, labelSize);\n    yellowWidget = new ScreenWidget(frame, Qt::yellow, tr(\"Yellow\"),\n                                    ScreenWidget::Yellow, labelSize);\n\n    connect(cyanWidget, SIGNAL(imageChanged()), this, SLOT(createImage()));\n    connect(magentaWidget, SIGNAL(imageChanged()), this, SLOT(createImage()));\n    connect(yellowWidget, SIGNAL(imageChanged()), this, SLOT(createImage()));\n\n    grid->addWidget(finalWidget, 0, 0, Qt::AlignTop | Qt::AlignHCenter);\n    grid->addWidget(cyanWidget, 0, 1, Qt::AlignTop | Qt::AlignHCenter);\n    grid->addWidget(magentaWidget, 1, 0, Qt::AlignTop | Qt::AlignHCenter);\n    grid->addWidget(yellowWidget, 1, 1, Qt::AlignTop | Qt::AlignHCenter);\n\n    return frame;\n}\n\n/*\n    Provides a dialog window to allow the user to specify an image file.\n    If a file is selected, the appropriate function is called to process\n    and display it.\n*/\n\nvoid Viewer::chooseFile()\n{\n    QString imageFile = QFileDialog::getOpenFileName(this,\n        tr(\"Choose an image file to open\"), path, tr(\"Images (*.*)\"));\n\n    if (!imageFile.isEmpty()) {\n        openImageFile(imageFile);\n        path = imageFile;\n    }\n}\n\n/*\n    Changes the value of the brightness according to the entry selected in the\n    Brightness menu. The selected entry is checked, and the previously selected\n    entry is unchecked.\n\n    The color separations are updated to use the new value for the brightness.\n*/\n\nvoid Viewer::setBrightness(QAction *action)\n{\n    if (!menuMap.contains(action) || scaledImage.isNull())\n        return;\n\n    Brightness amount = menuMap[action];\n\n    switch (amount) {\n        case None:\n            brightness = 0; break;\n        case Quarter:\n            brightness = 64; break;\n        case Half:\n            brightness = 128; break;\n        case ThreeQuarters:\n            brightness = 191; break;\n        case Full:\n            brightness = 255; break;\n        default: return;\n    }\n\n    currentBrightness->setChecked(false);\n    currentBrightness = action;\n    currentBrightness->setChecked(true);\n\n    createImage();\n}\n\n/*\n    Load the image from the file given, and create four pixmaps based\n    on the original image.\n\n    The window caption is set, and the Brightness menu enabled if the image file\n    can be loaded.\n*/\n\nvoid Viewer::openImageFile(QString &imageFile)\n{\n    QImage originalImage;\n\n    if (originalImage.load(imageFile)) {\n        setWindowTitle(imageFile);\n        //menuBar()->setItemEnabled(brightnessMenuId, true);\n        saveAction->setEnabled(true);\n        brightnessMenu->setEnabled(true);\n\n        /* Note: the ScaleMin value may be different for Qt 4. */\n        scaledImage = originalImage.scaled(256, 256, Qt::KeepAspectRatio);\n\n        cyanWidget->setImage(scaledImage);\n        magentaWidget->setImage(scaledImage);\n        yellowWidget->setImage(scaledImage);\n        createImage();\n    }\n    else\n        (void) QMessageBox::warning(this, tr(\"Cannot open file\"),\n            tr(\"The selected file could not be opened.\"),\n            QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton);\n}\n\n/*\n    Creates an image by combining the contents of the three screens\n    to present a page preview.\n\n    The image associated with each screen is separated into cyan,\n    magenta, and yellow components. We add up the values for each\n    component from the three screen images, and subtract the totals\n    from the maximum value for each corresponding primary color.\n*/\n\nvoid Viewer::createImage()\n{\n    QImage newImage = scaledImage.copy();\n\n    QImage *image1 = cyanWidget->image();\n    QImage *image2 = magentaWidget->image();\n    QImage *image3 = yellowWidget->image();\n    int darkness = 255 - brightness;\n\n    for (int y = 0; y < newImage.height(); ++y) {\n        for (int x = 0; x < newImage.width(); ++x) {\n\n            // Create three screens, using the quantities of the source\n            // CMY components to determine how much of each of the\n            // inks are to be put on each screen.\n            QRgb p1(image1->pixel(x, y));\n            float cyan1 = 255 - qRed(p1);\n            float magenta1 = 255 - qGreen(p1);\n            float yellow1 = 255 - qBlue(p1);\n\n            QRgb p2(image2->pixel(x, y));\n            float cyan2 = 255 - qRed(p2);\n            float magenta2 = 255 - qGreen(p2);\n            float yellow2 = 255 - qBlue(p2);\n\n            QRgb p3(image3->pixel(x, y));\n            float cyan3 = 255 - qRed(p3);\n            float magenta3 = 255 - qGreen(p3);\n            float yellow3 = 255 - qBlue(p3);\n\n            QColor newColor(\n                qMax(255 - int(cyan1+cyan2+cyan3) - darkness, 0),\n                qMax(255 - int(magenta1+magenta2+magenta3) - darkness, 0),\n                qMax(255 - int(yellow1+yellow2+yellow3) - darkness, 0));\n\n            newImage.setPixel(x, y, newColor.rgb());\n        }\n    }\n\n    finalWidget->setPixmap(QPixmap::fromImage(newImage));\n}\n\n/*\n    Provides a dialog window to allow the user to save the image file.\n*/\n\nvoid Viewer::saveImage()\n{\n    QString imageFile = QFileDialog::getSaveFileName(this,\n        tr(\"Choose a filename to save the image\"), \"\", tr(\"Images (*.png)\"));\n\n    QFileInfo info(imageFile);\n\n    if (!info.baseName().isEmpty()) {\n        QString newImageFile = QFileInfo(info.absoluteDir(),\n            info.baseName() + \".png\").absoluteFilePath();\n\n        if (!finalWidget->pixmap()->save(newImageFile, \"PNG\"))\n            (void) QMessageBox::warning(this, tr(\"Cannot save file\"),\n                tr(\"The file could not be saved.\"),\n                QMessageBox::Cancel, QMessageBox::NoButton,\n                QMessageBox::NoButton);\n    }\n    else\n        (void) QMessageBox::warning(this, tr(\"Cannot save file\"),\n            tr(\"Please enter a valid filename.\"),\n            QMessageBox::Cancel, QMessageBox::NoButton,\n            QMessageBox::NoButton);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/separations/viewer.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef VIEWER_H\n#define VIEWER_H\n\n#include <QImage>\n#include <QMainWindow>\n#include <QMap>\n\nclass QAction;\nclass QFrame;\nclass QGridLayout;\nclass QLabel;\nclass QMenu;\nclass FinalWidget;\nclass ScreenWidget;\n\nclass Viewer : public QMainWindow\n{\n    Q_OBJECT\npublic:\n    enum Brightness { None, Quarter, Half, ThreeQuarters, Full };\n    Viewer();\n\npublic slots:\n    void chooseFile();\n    void setBrightness(QAction *action);\n    void createImage();\n    void saveImage();\n\nprivate:\n    void createMenus();\n    QFrame *createCentralWidget();\n    void openImageFile(QString &filePath);\n\n    FinalWidget *finalWidget;\n    int brightness;\n    QAction *currentBrightness;\n    QAction *saveAction;\n    QGridLayout *grid;\n    QImage scaledImage;\n    QMap <QAction*,Brightness> menuMap;\n    QMenu *brightnessMenu;\n    QMenu *fileMenu;\n    QString path;\n    ScreenWidget *cyanWidget;\n    ScreenWidget *magentaWidget;\n    ScreenWidget *yellowWidget;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/settings/settings.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nQWidget *win\nQWidget *panel\n\nvoid snippet_ctor1()\n{\n//! [0]\n    settings = QSettings(\"MySoft\", \"Star Runner\")\n//! [0]\n}\n\nvoid snippet_ctor2()\n{\n//! [1]\n    QCoreApplication.setOrganizationName(\"MySoft\")\n//! [1] //! [2]\n    QCoreApplication.setOrganizationDomain(\"mysoft.com\")\n//! [2] //! [3]\n    QCoreApplication.setApplicationName(\"Star Runner\")\n//! [3]\n\n//! [4]\n    settings = QSettings()\n//! [4]\n\n//! [5]\n    settings.setValue(\"editor/wrapMargin\", 68)\n//! [5] //! [6]\n    margin = int(settings.value(\"editor/wrapMargin\"))\n//! [6]\n    {\n//! [7]\n    margin = int(settings.value(\"editor/wrapMargin\", 80))\n//! [7]\n    }\n\n//! [8]\n    settings.setValue(\"mainwindow/size\", win.size())\n//! [8] //! [9]\n    settings.setValue(\"mainwindow/fullScreen\", win.isFullScreen())\n//! [9] //! [10]\n    settings.setValue(\"outputpanel/visible\", panel.isVisible())\n//! [10]\n\n//! [11]\n    settings.beginGroup(\"mainwindow\")\n    settings.setValue(\"size\", win.size())\n    settings.setValue(\"fullScreen\", win.isFullScreen())\n    settings.endGroup()\n//! [11]\n\n//! [12]\n    settings.beginGroup(\"outputpanel\")\n    settings.setValue(\"visible\", panel.isVisible())\n    settings.endGroup()\n//! [12]\n}\n\nvoid snippet_locations()\n{\n//! [13]\n    obj1 = QSettings(\"MySoft\", \"Star Runner\")\n//! [13] //! [14]\n    obj2 = QSettings(\"MySoft\")\n    obj3 = QSettings(QSettings.SystemScope, \"MySoft\", \"Star Runner\")\n    obj4 = QSettings(QSettings.SystemScope, \"MySoft\")\n//! [14]\n\n    {\n//! [15]\n    settings = QSettings(QSettings.IniFormat, QSettings.UserScope,\n                         \"MySoft\", \"Star Runner\")\n//! [15]\n    }\n\n    {\n    QSettings settings(\"starrunner.ini\", QSettings.IniFormat)\n    }\n\n    {\n    QSettings settings(\"HKEY_CURRENT_USER\\\\Software\\\\Microsoft\",\n                       QSettings.NativeFormat)\n    }\n}\n\nclass MainWindow : public QMainWindow\n{\npublic:\n    MainWindow()\n\n    void writeSettings()\n    void readSettings()\n\nprotected:\n    void closeEvent(QCloseEvent *event)\n}\n\n//! [16]\nclass MainWindow(QMainWindow):\n    ...\n    def writeSettings(self):\n        self.settings = QSettings(\"Moose Soft\", \"Clipper\")\n        self.settings.beginGroup(\"MainWindow\")\n        self.settings.setValue(\"size\", self.size())\n        self.settings.setValue(\"pos\", self.pos())\n        self.settings.endGroup()\n//! [16]\n\n//! [17]\n    def readSettings(self):\n        self.settings = QSettings(\"Moose Soft\", \"Clipper\")\n        self.settings.beginGroup(\"MainWindow\")\n        self.resize(settings.value(\"size\", QSize(400, 400)).toSize())\n        self.move(settings.value(\"pos\", QPoint(200, 200)).toPoint())\n        self.settings.endGroup()\n//! [17]\n\n//! [18]\n    def __init__(self):\n        self.settings = None\n//! [18] //! [19]\n        self.readSettings()\n//! [19] //! [20]\n\n//! [20]\n\nbool userReallyWantsToQuit() { return true; }\n\n//! [21]\n    # event : QCloseEvent\n    def closeEvent(self, event):\n        if self.userReallyWantsToQuit():\n            self.writeSettings()\n            event.accept()\n        else:\n            event.ignore()\n//! [21]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/shareddirmodel/main.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\"\"\"\n  main.cpp\n\n  A simple example of how to view a model in several views, and share a\n  selection model.\n\"\"\"\n\nfrom PySide.QtGui import *\n\n\n//! [0] //! [1]\ndef main():\n    app = QApplication(sys.argv)\n    splitter = QSplitter()\n\n//! [2] //! [3]\n    model = QFileSystemModel()\n    model.setRootPath(QDir.currentPath())\n//! [0] //! [2] //! [4] //! [5]\n    tree =  QTreeView()\n//! [3] //! [6]\n    tree.setModel(model)\n//! [4] //! [6] //! [7]\n    tree.setRootIndex(model.index(QDir.currentPath()))\n//! [7]\n\n    list =  QListView(splitter)\n    list.setModel(model)\n    list.setRootIndex(model.index(QDir.currentPath()))\n\n//! [5]\n    selection = QItemSelectionModel(model)\n    tree.setSelectionModel(selection)\n    list.setSelectionModel(selection)\n\n//! [8]\n    splitter.setWindowTitle(\"Two views onto the same directory model\")\n    splitter.show()\n    return app.exec_()\n//! [1] //! [8]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/sharedemployee/employee.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"employee.h\"\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/sharedemployee/employee.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef EMPLOYEE_H\n#define EMPLOYEE_H\n\n//! [0]\n#include <QSharedData>\n#include <QString>\n\nclass EmployeeData : public QSharedData\n{\n  public:\n    EmployeeData() : id(-1) { name.clear(); }\n    EmployeeData(const EmployeeData &other)\n        : QSharedData(other), id(other.id), name(other.name) { }\n    ~EmployeeData() { }\n\n    int id;\n    QString name;\n};\n\nclass Employee\n{\n  public:\n//! [1]\n    Employee() { d = new EmployeeData; }\n//! [1] //! [2]\n    Employee(int id, QString name) {\n        d = new EmployeeData;\n        setId(id);\n        setName(name);\n    }\n//! [2] //! [7]\n    Employee(const Employee &other) \n          : d (other.d) \n    { \n    } \n//! [7]  \n//! [3]\n    void setId(int id) { d->id = id; }\n//! [3] //! [4]\n    void setName(QString name) { d->name = name; }\n//! [4]\n\n//! [5]\n    int id() const { return d->id; }\n//! [5] //! [6]\n    QString name() const { return d->name; }\n//! [6]\n\n  private:\n    QSharedDataPointer<EmployeeData> d;\n};\n//! [0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/sharedemployee/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\n#include \"employee.h\"\n\nint main()\n{\n    Employee e1(1001, \"Albrecht Durer\");\n    Employee e2 = e1;\n    e1.setName(\"Hans Holbein\");\n}\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/sharedtablemodel/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  main.cpp\n\n  A simple example that shows how a single model can be shared between\n  multiple views.\n*/\n\n#include <QApplication>\n#include <QHeaderView>\n#include <QItemSelectionModel>\n#include <QTableView>\n\n#include \"model.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    TableModel *model = new TableModel(4, 2, &app);\n\n//! [0]\n    QTableView *firstTableView = new QTableView;\n    QTableView *secondTableView = new QTableView;\n//! [0]\n\n//! [1]\n    firstTableView->setModel(model);\n    secondTableView->setModel(model);\n//! [1]\n\n    firstTableView->horizontalHeader()->setModel(model);\n\n    for (int row = 0; row < 4; ++row) {\n        for (int column = 0; column < 2; ++column) {\n            QModelIndex index = model->index(row, column, QModelIndex());\n            model->setData(index, QVariant(QString(\"(%1, %2)\").arg(row).arg(column)));\n        }\n    }\n\n//! [2]\n    secondTableView->setSelectionModel(firstTableView->selectionModel());\n//! [2]\n\n    firstTableView->setWindowTitle(\"First table view\");\n    secondTableView->setWindowTitle(\"Second table view\");\n    firstTableView->show();\n    secondTableView->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/sharedtablemodel/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MODEL_H\n#define MODEL_H\n\n#include <QAbstractTableModel>\n#include <QStringList>\n#include <QVariant>\n\nclass TableModel : public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    TableModel(int rows = 1, int columns = 1, QObject *parent = 0);\n\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n    int columnCount(const QModelIndex &parent = QModelIndex()) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation,\n                        int role = Qt::DisplayRole) const;\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    bool setData(const QModelIndex &index, const QVariant &value,\n                 int role = Qt::EditRole);\n\n    bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());\n    bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());\n\nprivate:\n    QList<QStringList> rowList;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalmapper/accountsfile.txt",
    "content": "1 + 1 = 2\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalmapper/filereader.cpp",
    "content": "#include <QtGui>\n#include \"filereader.h\"\n\n\nFileReader::FileReader(QWidget *parent)\n    : QWidget(parent)\n{\n    textEdit = new QTextEdit;\n\n    taxFileButton = new QPushButton(\"Tax File\");\n    accountFileButton = new QPushButton(\"Accounts File\");\n    reportFileButton = new QPushButton(\"Report File\");\n\n//! [0]\n    signalMapper = new QSignalMapper(this);\n    signalMapper->setMapping(taxFileButton, QString(\"taxfile.txt\"));\n    signalMapper->setMapping(accountFileButton, QString(\"accountsfile.txt\"));\n    signalMapper->setMapping(reportFileButton, QString(\"reportfile.txt\"));\n\n    connect(taxFileButton, SIGNAL(clicked()),\n        signalMapper, SLOT (map()));\n    connect(accountFileButton, SIGNAL(clicked()),\n        signalMapper, SLOT (map()));\n    connect(reportFileButton, SIGNAL(clicked()),\n        signalMapper, SLOT (map()));\n//! [0]\n\n//! [1]\n    connect(signalMapper, SIGNAL(mapped(const QString &)),\n        this, SLOT(readFile(const QString &)));\n//! [1]\n\n    QHBoxLayout *buttonLayout = new QHBoxLayout;\n    buttonLayout->addWidget(taxFileButton);\n    buttonLayout->addWidget(accountFileButton);\n    buttonLayout->addWidget(reportFileButton);\n\n    QVBoxLayout *mainLayout = new QVBoxLayout;\n    mainLayout->addWidget(textEdit);\n    mainLayout->addLayout(buttonLayout);\n\n    setLayout(mainLayout);\n}\n\nvoid FileReader::readFile(const QString &filename)\n{\n    QFile file(filename);\n    \n    if (!file.open(QIODevice::ReadOnly)) {\n        QMessageBox::information(this, tr(\"Unable to open file\"),\n            file.errorString());\n        return;\n    }\n\n\n    QTextStream in(&file);\n    textEdit->setPlainText(in.readAll());\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalmapper/filereader.h",
    "content": "#ifndef FILEREADER_H\n#define FILEREADER_H\n\n#include <QTextEdit>\n#include <QPushButton>\n#include <QSignalMapper>\n\nclass FileReader : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    FileReader(QWidget *parent=0);\n    void readFromFile(QString filename);\n\npublic slots:\n    void readFile(const QString &);\n\nprivate:\n    QTextEdit *textEdit;\n    QPushButton *taxFileButton;\n    QPushButton *accountFileButton;\n    QPushButton *reportFileButton;\n    QSignalMapper *signalMapper;\n};\n\n#endif\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalmapper/main.cpp",
    "content": "#include <QtGui>\n#include \"filereader.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    FileReader *reader = new FileReader;\n    reader->show();\n\n    return app.exec();\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalmapper/reportfile.txt",
    "content": "Tax this year = 50%\nTotal profit = 2\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalmapper/taxfile.txt",
    "content": "Tax this year = 50%\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalsandslots/lcdnumber.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"lcdnumber.h\"\n\nLcdNumber::LcdNumber(QWidget *parent)\n{\n}\n\nvoid LcdNumber::display(int)\n{\n}\n\nvoid LcdNumber::display(double)\n{\n}\n\nvoid LcdNumber::display(const QString &)\n{\n}\n\nvoid LcdNumber::setHexMode()\n{\n}\n\nvoid LcdNumber::setDecMode()\n{\n}\n\nvoid LcdNumber::setOctMode()\n{\n}\n\nvoid LcdNumber::setBinMode()\n{\n}\n\nvoid LcdNumber::setSmallDecimalPoint(bool)\n{\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalsandslots/lcdnumber.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\n#ifndef LCDNUMBER_H\n//! [0] //! [1]\n#define LCDNUMBER_H\n//! [1]\n\n//! [2]\n#include <QFrame>\n//! [2]\n\n//! [3]\nclass LcdNumber : public QFrame\n//! [3] //! [4]\n{\n//! [4] //! [5]\n    Q_OBJECT\n//! [5]\n\n//! [6]\npublic:\n//! [6] //! [7]\n    LcdNumber(QWidget *parent = 0);\n//! [7]\n\n//! [8]\nsignals:\n//! [8] //! [9]\n    void overflow();\n//! [9]\n\n//! [10]\npublic slots:\n//! [10] //! [11]\n    void display(int num);\n    void display(double num);\n    void display(const QString &str);\n    void setHexMode();\n    void setDecMode();\n    void setOctMode();\n    void setBinMode();\n    void setSmallDecimalPoint(bool point);\n//! [11] //! [12]\n};\n//! [12]\n\n//! [13]\n#endif\n//! [13]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalsandslots/signalsandslots.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QAbstractButton>\n\n#include \"signalsandslots.h\"\n\n//! [0]\nvoid Counter::setValue(int value)\n{\n    if (value != m_value) {\n        m_value = value;\n        emit valueChanged(value);\n    }\n}\n//! [0]\n\nint main()\n{\n//! [1]\n    Counter a, b;\n//! [1] //! [2]\n    QObject::connect(&a, SIGNAL(valueChanged(int)),\n                     &b, SLOT(setValue(int)));\n//! [2]\n\n//! [3]\n    a.setValue(12);     // a.value() == 12, b.value() == 12\n//! [3] //! [4]\n    b.setValue(48);     // a.value() == 12, b.value() == 48\n//! [4]\n\n\n    QWidget *widget = reinterpret_cast<QWidget *>(new QObject(0));\n//! [5]\n    if (widget->inherits(\"QAbstractButton\")) {\n        QAbstractButton *button = static_cast<QAbstractButton *>(widget);\n        button->toggle();\n//! [5] //! [6]\n    }\n//! [6]\n\n//! [7]\n    if (QAbstractButton *button = qobject_cast<QAbstractButton *>(widget))\n        button->toggle();\n//! [7]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/signalsandslots/signalsandslots.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef SIGNALSANDSLOTS_H\n#define SIGNALSANDSLOTS_H\n\n#define Counter PlainCounter\n\n//! [0]\nclass Counter\n{\npublic:\n    Counter() { m_value = 0; }\n\n    int value() const { return m_value; }\n    void setValue(int value);\n\nprivate:\n    int m_value;\n};\n//! [0]\n\n#undef Counter\n#define Counter ObjectCounter\n\n//! [1]\n#include <QObject>\n//! [1]\n\n//! [2]\nclass Counter : public QObject\n//! [2] //! [3]\n{\n    Q_OBJECT\n\npublic:\n    Counter() { m_value = 0; }\n\n    int value() const { return m_value; }\n\npublic slots:\n    void setValue(int value);\n\nsignals:\n    void valueChanged(int newValue);\n\nprivate:\n    int m_value;\n};\n//! [3]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/simplemodel-use/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  main.cpp\n\n  A simple example of how to access items from an existing model.\n*/\n\n#include <QtGui>\n\n/*!\n    Create a default directory model and, using the index-based interface to\n    the model and some QLabel widgets, populate the window's layout with the\n    names of objects in the directory.\n\n    Note that we only want to read the filenames in the highest level of the\n    directory, so we supply a default (invalid) QModelIndex to the model in\n    order to indicate that we want top-level items.\n*/\n\ndef main():\n    app = QApplication(sys.argc, sys.argv)\n\n    window = QWidget()\n    layout = QVBoxLayout(window)\n    title = QLabel(\"Some items from the directory model\", window)\n    title.setBackgroundRole(QPalette.Base)\n    title.setMargin(8)\n    layout.addWidget(title)\n\n//! [0]\n    model = QFileSystemModel()\n    parentIndex = model.index(QDir.currentPath())\n    numRows = model.rowCount(parentIndex)\n//! [0]\n\n//! [1]\n    for row in range(numRows):\n        index = model.index(row, 0, parentIndex)\n//! [1]\n\n//! [2]\n        text = model.data(index, Qt.DisplayRole)\n        // Display the text in a widget.\n//! [2]\n\n        label = QLabel(text, window)\n        layout.addWidget(label)\n//! [3]\n//! [3]\n\n    window.setWindowTitle(\"A simple model example\")\n    window.show()\n    return app.exec_()\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/splitter/splitter.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0]\n    splitter =  QSplitter(parent)\n    listview =  QListView()\n    treeview =  QTreeView()\n    textedit =  QTextEdit()\n    splitter.addWidget(listview)\n    splitter.addWidget(treeview)\n    splitter.addWidget(textedit)\n//! [0]\n\n//! [1]\n    settings = QSettings()\n    settings.setValue(\"splitterSizes\", splitter.saveState())\n//! [1]\n\n//! [2]\n    settings = QSettings()\n    splitter.restoreState(settings.value(\"splitterSizes\").toByteArray())\n//! [2]\n\n//! [3]\n    for it in splitter.sizes():\n        processSize(it.next())\n//! [3]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/splitterhandle/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QLabel>\n\n#include \"splitter.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    Splitter splitter(Qt::Horizontal);\n    splitter.addWidget(new QLabel(\"Hello\"));\n    splitter.addWidget(new QLabel(\"World\"));\n    Splitter verticalSplitter(Qt::Vertical, &splitter);\n    verticalSplitter.addWidget(new QLabel(\"A\"));\n    verticalSplitter.addWidget(new QLabel(\"B\"));\n    splitter.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/splitterhandle/splitter.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"splitter.h\"\n\nSplitterHandle::SplitterHandle(Qt::Orientation orientation, QSplitter *parent)\n    : QSplitterHandle(orientation, parent)\n{\n    gradient.setColorAt(0.0, Qt::darkGreen);\n    gradient.setColorAt(0.25, Qt::white);\n    gradient.setColorAt(1.0, Qt::darkGreen);\n}\n\n//! [0]\nvoid SplitterHandle::paintEvent(QPaintEvent *event)\n{\n    QPainter painter(this);\n    if (orientation() == Qt::Horizontal) {\n        gradient.setStart(rect().left(), rect().height()/2);\n        gradient.setFinalStop(rect().right(), rect().height()/2);\n    } else {\n        gradient.setStart(rect().width()/2, rect().top());\n        gradient.setFinalStop(rect().width()/2, rect().bottom());\n    }\n    painter.fillRect(event->rect(), QBrush(gradient));\n}\n//! [0]\n\nSplitter::Splitter(Qt::Orientation orientation, QWidget *parent)\n    : QSplitter(orientation, parent)\n{\n}\n\n//! [1]\nQSplitterHandle *Splitter::createHandle()\n{\n    return new SplitterHandle(orientation(), this);\n}\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/splitterhandle/splitter.h",
    "content": "/############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################/\n\n//! [0]\nclass Splitter(QSplitter):\n    def __init__(self, orientation, parent):\n        ...\n\n    def createHandle(self):\n        ...\n}\n//! [0]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/sqldatabase/sqldatabase.cpp",
    "content": "######################################\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n# Contact: http://www.qt-project.org/legal\n#\n# This file is part of the documentation of the Qt Toolkit.\n#\n# $QT_BEGIN_LICENSE:LGPL$\n# Commercial License Usage\n# Licensees holding valid commercial Qt licenses may use this file in\n# accordance with the commercial license agreement provided with the\n# Software or, alternatively, in accordance with the terms contained in\n# a written agreement between you and Digia.  For licensing terms and\n# conditions see http://qt.digia.com/licensing.  For further information\n# use the contact form at http://qt.digia.com/contact-us.\n#\n# GNU Lesser General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU Lesser\n# General Public License version 2.1 as published by the Free Software\n# Foundation and appearing in the file LICENSE.LGPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU Lesser General Public License version 2.1 requirements\n# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n#\n# In addition, as a special exception, Digia gives you certain additional\n# rights.  These rights are described in the Digia Qt LGPL Exception\n# version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n#\n# GNU General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU\n# General Public License version 3.0 as published by the Free Software\n# Foundation and appearing in the file LICENSE.GPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU General Public License version 3.0 requirements will be\n# met: http://www.gnu.org/copyleft/gpl.html.\n#\n#\n# $QT_END_LICENSE$\n#\n######################################\n\nfrom PySide.QtGui import *\nfrom PySide.QtSql import *\n\n\ndef tr(text):\n    return QApplication.translate(text, text)\n\ndef QSqlDatabase_snippets():\n//! [0]\n    db = QSqlDatabase.addDatabase(\"QPSQL\")\n    db.setHostName(\"acidalia\")\n    db.setDatabaseName(\"customdb\")\n    db.setUserName(\"mojito\")\n    db.setPassword(\"J0a1m8\")\n    ok = db.open()\n//! [0]\n\n//! [1]\n    db = QSqlDatabase.database()\n//! [1]\n\ndef QSqlField_snippets():\n//! [2]\n    field = QSqlField(\"age\", QVariant.Int)\n    field.setValue(QPixmap())  # WRONG\n//! [2]\n\n//! [3]\n    field = QSqlField(\"age\", QVariant.Int)\n    field.setValue(QString(\"123\"))  # casts QString to int\n//! [3]\n\n//! [4]\n    query = QSqlQuery()\n//! [4] //! [5]\n    record = query.record()\n//! [5] //! [6]\n    field = record.field(\"country\")\n//! [6]\n\ndef doSomething(str):\n    pass\n\ndef QSqlQuery_snippets():\n    # typical loop\n//! [7]\n    query = QSqlQuery(\"SELECT country FROM artist\")\n    while query.next():\n        country = query.value(0)\n        doSomething(country)\n//! [7]\n\n\n    # field index lookup\n//! [8]\n    query = QSqlQuery(\"SELECT * FROM artist\")\n    fieldNo = query.record().indexOf(\"country\")\n    while query.next():\n        country = query.value(fieldNo)\n        doSomething(country)\n//! [8]\n\n    # named with named\n//! [9]\n    query = QSqlQuery()\n    query.prepare(\"INSERT INTO person (id, forename, surname) \"\n                  \"VALUES (:id, :forename, :surname)\")\n    query.bindValue(\":id\", 1001)\n    query.bindValue(\":forename\", \"Bart\")\n    query.bindValue(\":surname\", \"Simpson\")\n    query.exec_()\n//! [9]\n\n    # positional with named\n//! [10]\n    query = QSqlQuery()\n    query.prepare(\"INSERT INTO person (id, forename, surname) \"\n                  \"VALUES (:id, :forename, :surname)\")\n    query.bindValue(0, 1001)\n    query.bindValue(1, \"Bart\")\n    query.bindValue(2, \"Simpson\")\n    query.exec_()\n//! [10]\n\n    # positional 1\n//! [11]\n    query = QSqlQuery()\n    query.prepare(\"INSERT INTO person (id, forename, surname) \"\n                  \"VALUES (?, ?, ?)\")\n    query.bindValue(0, 1001)\n    query.bindValue(1, \"Bart\")\n    query.bindValue(2, \"Simpson\")\n    query.exec_()\n//! [11]\n\n    # positional 2\n//! [12]\n    query = QSqlQuery()\n    query.prepare(\"INSERT INTO person (id, forename, surname) \"\n                  \"VALUES (?, ?, ?)\")\n    query.addBindValue(1001)\n    query.addBindValue(\"Bart\")\n    query.addBindValue(\"Simpson\")\n    query.exec_()\n//! [12]\n\n    # stored\n//! [13]\n    query = QSqlQuery()\n    query.prepare(\"CALL AsciiToInt(?, ?)\")\n    query.bindValue(0, \"A\")\n    query.bindValue(1, 0, QSql.Out)\n    query.exec_()\n    i = query.boundValue(1) # i is 65\n//! [13]\n\n    query = QSqlQuery()\n\n    # examine with named binding\n//! [14]\n    i = query.boundValues()\n    while i.hasNext():\n        i.next()\n        print i.key(), \": \", i.value()\n//! [14]\n\n    # examine with positional binding\n//! [15]\n    list_ = query.boundValues().values()\n    for item in list:\n        print item\n//! [15]\n\ndef QSqlQueryModel_snippets():\n\n//! [16]\n    model =  QSqlQueryModel()\n    model.setQuery(\"SELECT name, salary FROM employee\")\n    model.setHeaderData(0, Qt.Horizontal, tr(\"Name\"))\n    model.setHeaderData(1, Qt.Horizontal, tr(\"Salary\"))\n\n//! [17]\n    view =  QTableView()\n//! [17] //! [18]\n    view.setModel(model)\n//! [18] //! [19]\n    view.show()\n//! [16] //! [19] //! [20]\n    view.setEditTriggers(QAbstractItemView.NoEditTriggers)\n//! [20]\n\n//! [21]\n    model = QSqlQueryModel()\n    model.setQuery(\"SELECT * FROM employee\")\n    salary = model.record(4).value(\"salary\")\n//! [21]\n\n//! [22]\n    salary = model.data(model.index(4, 2))\n//! [22]\n\n    for row in range(model.rowCount()):\n        for (col in range(model.columnCount())):\n            print model.data(model.index(row, col))\n\n\nclass MyModel(QSqlQueryModel)\n    m_specialColumnNo = 0\n    def data(item, role):\n//! [23]\n        if item.column() == self.m_specialColumnNo:\n            # handle column separately\n            pass\n\n        return QSqlQueryModel.data(item, role)\n\n//! [23]\n\n\ndef QSqlTableModel_snippets():\n\n//! [24]\n    model =  QSqlTableModel()\n    model.setTable(\"employee\")\n    model.setEditStrategy(QSqlTableModel.OnManualSubmit)\n    model.select()\n    model.removeColumn(0) # don't show the ID\n    model.setHeaderData(0, Qt.Horizontal, tr(\"Name\"))\n    model.setHeaderData(1, Qt.Horizontal, tr(\"Salary\"))\n\n    view =  QTableView()\n    view.setModel(model)\n    view.show()\n//! [24]\n\n\n//! [25]\n    model = QSqlTableModel()\n    model.setTable(\"employee\")\n    QString name = model.record(4).value(\"name\")\n//! [25]\n\ndef sql_intro_snippets():\n\n//! [26]\n    db = QSqlDatabase.addDatabase(\"QMYSQL\")\n    db.setHostName(\"bigblue\")\n    db.setDatabaseName(\"flightdb\")\n    db.setUserName(\"acarlson\")\n    db.setPassword(\"1uTbSbAs\")\n    ok = db.open()\n//! [26]\n\n//! [27]\n    firstDB = QSqlDatabase.addDatabase(\"QMYSQL\", \"first\")\n    secondDB = QSqlDatabase.addDatabase(\"QMYSQL\", \"second\")\n//! [27]\n\n//! [28]\n    defaultDB = QSqlDatabase.database()\n//! [28] //! [29]\n    firstDB = QSqlDatabase.database(\"first\")\n//! [29] //! [30]\n    secondDB = QSqlDatabase.database(\"second\")\n//! [30]\n\n    # SELECT1\n//! [31]\n    query = QSqlQuery()\n    query.exec_(\"SELECT name, salary FROM employee WHERE salary > 50000\")\n//! [31]\n\n//! [32]\n    while query.next():\n        name = query.value(0)\n        salary = query.value(1)\n        print name, salary\n//! [32]\n\n    # FEATURE\n//! [33]\n    query = QSqlQuery()\n    query.exec_(\"SELECT name, salary FROM employee WHERE salary > 50000\")\n\n    defaultDB = QSqlDatabase.database()\n    if defaultDB.driver().hasFeature(QSqlDriver.QuerySize):\n        numRows = query.size()\n    else:\n        # self can be very slow\n        query.last()\n        numRows = query.at() + 1\n//! [33]\n\n    # INSERT1\n//! [34]\n    query = QSqlQuery()\n    query.exec_(\"INSERT INTO employee (id, name, salary) \"\n                \"VALUES (1001, 'Thad Beaumont', 65000)\")\n//! [34]\n\n    # NAMED BINDING\n//! [35]\n    query = QSqlQuery()\n    query.prepare(\"INSERT INTO employee (id, name, salary) \"\n                  \"VALUES (:id, :name, :salary)\")\n    query.bindValue(\":id\", 1001)\n    query.bindValue(\":name\", \"Thad Beaumont\")\n    query.bindValue(\":salary\", 65000)\n    query.exec_()\n//! [35]\n\n    # POSITIONAL BINDING\n//! [36]\n    query = QSqlQuery()\n    query.prepare(\"INSERT INTO employee (id, name, salary) \"\n                  \"VALUES (?, ?, ?)\")\n    query.addBindValue(1001)\n    query.addBindValue(\"Thad Beaumont\")\n    query.addBindValue(65000)\n    query.exec_()\n//! [36]\n\n    # UPDATE1\n//! [37]\n    query = QSqlQuery()\n    query.exec_(\"UPDATE employee SET salary = 70000 WHERE id = 1003\")\n//! [37]\n\n    # DELETE1\n//! [38]\n    query = QSqlQuery()\n    query.exec_(\"DELETE FROM employee WHERE id = 1007\")\n//! [38]\n\n    # TRANSACTION\n//! [39]\n    QSqlDatabase.database().transaction()\n    query = QSqlQuery()\n    query.exec_(\"SELECT id FROM employee WHERE name = 'Torild Halvorsen'\")\n    if query.next():\n        employeeId = query.value(0)\n        query.exec_(\"INSERT INTO project (id, name, ownerid) \"\n                    \"VALUES (201, 'Manhattan Project', \"\n                    + QString.number(employeeId) + ')')\n\n    QSqlDatabase.database().commit()\n//! [39]\n\n    # SQLQUERYMODEL1\n//! [40]\n    model = QSqlQueryModel()\n    model.setQuery(\"SELECT * FROM employee\")\n\n    for i in range(model.rowCount()):\n        _id = model.record(i).value(\"id\")\n        name = model.record(i).value(\"name\")\n        print _id, name\n\n//! [40]\n    }\n\n    {\n    # SQLTABLEMODEL1\n//! [41]\n    model = QSqlTableModel()\n    model.setTable(\"employee\")\n    model.setFilter(\"salary > 50000\")\n    model.setSort(2, Qt.DescendingOrder)\n    model.select()\n\n    for i in range(model.rowCount()):\n        name = model.record(i).value(\"name\")\n        salary = model.record(i).value(\"salary\")\n        print \"%s: %d\" % (name, salary)\n\n//! [41]\n\n    # SQLTABLEMODEL2\n    model = QSqlTableModel()\n    model.setTable(\"employee\")\n\n//! [42]\n    for i in range(model.rowCount()):\n        record = model.record(i)\n        salary = record.value(\"salary\")\n        salary *= 1.1\n        record.setValue(\"salary\", salary)\n        model.setRecord(i, record)\n\n    model.submitAll()\n//! [42]\n\n    # SQLTABLEMODEL3\n    row = 1\n    column = 2\n//! [43]\n    model.setData(model.index(row, column), 75000)\n    model.submitAll()\n//! [43]\n\n    # SQLTABLEMODEL4\n//! [44]\n    model.insertRows(row, 1)\n    model.setData(model.index(row, 0), 1013)\n    model.setData(model.index(row, 1), \"Peter Gordon\")\n    model.setData(model.index(row, 2), 68500)\n    model.submitAll()\n//! [44]\n\n//! [45]\n    model.removeRows(row, 5)\n//! [45]\n\n//! [46]\n    model.submitAll()\n//! [46]\n\n//! [47]\nclass XyzResult(QSqlResult):\n    def __init__(driver):\n        QSqlResult.__init__(self, driver)\n        pass\n\n    def data(self, index):\n        return QVariant()\n\n    def isNull(self, index):\n        return False\n\n    def reset(self, query):\n        return False\n\n    def fetch(self, index):\n        return False\n\n    def fetchFirst(self):\n        return False\n\n    def fetchLast(self):\n        return False\n\n    def size(self):\n        return 0\n\n    def numRowsAffected(self):\n        return 0\n\n    def record(self):\n        return QSqlRecord()\n\n//! [47]\n\n//! [48]\nclass XyzDriver(QSqlDriver)\n    def hasFeature(self, feature):\n        return False\n\n    def open(self, db, user, password, host, port, options):\n        return False\n\n    def close(self):\n        pass\n\n    def createResult(self):\n        return XyzResult(self)\n\n//! [48]\n\ndef main():\n    app = QApplication([])\n\n    QSqlDatabase_snippets()\n    QSqlField_snippets()\n    QSqlQuery_snippets()\n    QSqlQueryModel_snippets()\n    QSqlTableModel_snippets()\n\n    driver = XyzDriver()\n    result = XyzResult(driver)\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/streaming/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QByteArray>\n#include <QDataStream>\n\n//! [0]\nstruct Movie\n{\n    int id;\n    QString title;\n    QDate releaseDate;\n};\n//! [0]\n\n//! [1]\nQDataStream &operator<<(QDataStream &out, const Movie &movie)\n{\n    out << (quint32)movie.id << movie.title\n        << movie.releaseDate;\n    return out;\n}\n//! [1]\n\n//! [2]\nQDataStream &operator>>(QDataStream &in, Movie &movie)\n{\n    quint32 id;\n    QDate date;\n\n    in >> id >> movie.title >> date;\n    movie.id = (int)id;\n    movie.releaseDate = date;\n    return in;\n}\n//! [2]\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n    Movie m;\n    m.id = 0001;\n    m.title = \"Happy Meal\";\n    m.releaseDate = QDate(1995, 5, 17);\n\n    QByteArray byteArray;\n    QDataStream stream(&byteArray, QIODevice::WriteOnly);\n    stream << m;\n    \n    // display\n    qDebug() << m.id << m.releaseDate << m.title;\n\n    Movie m2;\n    \n    int id2;\n    QString title2;\n    QDate date2;\n\n    QDataStream stream2(byteArray);\n    stream2 >> id2 >> title2 >> date2;\n\n    m2.id = id2;\n    m2.title = title2;\n    m2.releaseDate = date2;\n\n    qDebug() << id2 << \" \" << date2 << \" \" << title2;\n\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/stringlistmodel/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*!\n    The main function for the string list model example. This creates and\n    populates a model with values from a string list then displays the\n    contents of the model using a QListView widget.\n*/\n\n#include <QAbstractItemModel>\n#include <QApplication>\n#include <QListView>\n\n#include \"model.h\"\n\n//! [0]\n\napp = QApplication(sys.argv)\n\n// Unindented for quoting purposes:\n//! [1]\nnumbers = [\"One\", \"Two\", \"Three\", \"Four\", \"Five\"]\n\nmodel = StringListModel(numbers)\n//! [0] //! [1] //! [2] //! [3]\nview = QListView()\n//! [2]\nview.setWindowTitle(\"View onto a string list model\")\n//! [4]\nview.setModel(model)\n//! [3] //! [4]\n\n    model.insertRows(5, 7, QModelIndex())\n\n    for row in range(5, 12):\n        index = model.index(row, 0, QModelIndex())\n        model.setData(index, str(row+1))\n\n//! [5]\n    view.show()\n    sys.exit(app.exec_())\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/stringlistmodel/model.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  model.cpp\n\n  A simple model that uses a QStringList as its data source.\n*/\n\n/*!\n    Returns the number of items in the string list as the number of rows\n    in the model.\n*/\n\n//! [0]\ndef rowCount(self, parent):\n    return len(self.stringList)\n//! [0]\n\n/*!\n    Returns an appropriate value for the requested data.\n    If the view requests an invalid index, an invalid variant is returned.\n    Any valid index that corresponds to a string in the list causes that\n    string to be returned.\n*/\n\n//! [1]\ndef data(self, index, role):\n    if not index.isValid():\n        return None\n\n    if index.row() >= stringList.size():\n        return None\n\n    if role == Qt.DisplayRole:\n        return stringList[index.row()]\n    else\n        return None\n//! [1]\n\n/*!\n    Returns the appropriate header string depending on the orientation of\n    the header and the section. If anything other than the display role is\n    requested, we return an invalid variant.\n*/\n\n//! [2]\ndef headerData(self, section, orientation, role):\n    if role != Qt::DisplayRole:\n        return None\n\n    if orientation == Qt::Horizontal:\n        return \"Column %s\" % section\n    else:\n        return \"Row %s\" % section\n//! [2]\n\n/*!\n    Returns an appropriate value for the item's flags. Valid items are\n    enabled, selectable, and editable.\n*/\n\n//! [3]\ndef flags(self, index):\n    if not index.isValid()\n        return Qt.ItemIsEnabled\n\n    return QAbstractItemModel.flags(index) | Qt.ItemIsEditable\n//! [3]\n\n/*!\n    Changes an item in the string list, but only if the following conditions\n    are met:\n\n    * The index supplied is valid.\n    * The index corresponds to an item to be shown in a view.\n    * The role associated with editing text is specified.\n\n    The dataChanged() signal is emitted if the item is changed.\n*/\n\n//! [4]\ndef setData(self, index, value, role):\n    if index.isValid() and role == Qt.EditRole:\n        self.stringList[index.row()] = value\n        self.dataChanged.emit(index, index)\n        return True;\n//! [4] //! [5]\n    return False;\n}\n//! [5]\n\n/*!\n    Inserts a number of rows into the model at the specified position.\n*/\n\n//! [6]\ndef insertRows(self, position, rows, parent):\n    self.beginInsertRows(QModelIndex(), position, position+rows-1)\n\n    for row in range(0, rows):\n        self.stringList.insert(position, \"\")\n\n    self.endInsertRows()\n    return True;\n//! [6] //! [7]\n//! [7]\n\n/*!\n    Removes a number of rows from the model at the specified position.\n*/\n\n//! [8]\ndef removeRows(self, position, rows, parent):\n    self.beginRemoveRows(QModelIndex(), position, position+rows-1)\n\n    for row in range(0, rows):\n        del self.stringList[position]\n\n    self.endRemoveRows()\n    return True;\n//! [8] //! [9]\n//! [9]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/stringlistmodel/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\nclass StringListModel (QAbstractListModel):\n    def __init__(strings, parent = None):\n        QAbstractListModel.__init__(self, parent)\n//! [5]\n        self.stringList = strings\n//! [5]\n\n    def rowCount(self, parent = QModelIndex()):\n        # ...\n    def data(self, index, role):\n        # ...\n    def headerData(self, section, orientation,\n//! [0] //! [1]\n                        role = Qt.DisplayRole):\n//! [1]\n\n//! [2]\n    def flags(self, index):\n        # ...\n    def setData(self, index, value,\n//! [2] //! [3]\n                 role = Qt.EditRole)\n//! [3]\n\n//! [4]\n    def insertRows(self, position, rows, index = QModelIndex()):\n        # ...\n    def removeRows(self, position, rows, index = QModelIndex()):\n        # ...\n//! [4]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/styles/styles.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0] //! [1]\ndef paintEvent(self, event):\n//! [0]\n//! [2]\n    painter = QPainter(self)\n//! [2]\n\n    option = QStyleOptionFocusRect()\n    option.initFrom(self)\n    option.backgroundColor = palette().color(QPalette.Background)\n\n//! [3]\n    style().drawPrimitive(QStyle.PE_FrameFocusRect, option, painter, self)\n//! [3]\n//! [1]\n\ndef paintEvent2(event):\n//! [4]\n//! [4] //! [5] //! [6]\n    painter = QStylePainter(self)\n//! [5]\n\n    option = QStyleOptionFocusRect()\n    option.initFrom(self)\n    option.backgroundColor = palette().color(QPalette.Background)\n\n//! [7]\n    painter.drawPrimitive(QStyle.PE_FrameFocusRect, option)\n//! [7]\n//! [6]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/stylesheet/common-mistakes.cpp",
    "content": "//! [1]\n        QPushButton {\n            color: grey;\n            border-image: url(/home/kamlie/code/button.png) 3 10 3 10;\n            border-top: 3px transparent;\n            border-bottom: 3px transparent;\n            border-right: 10px transparent;\n            border-left: 10px transparent;\n        }\n//! [1]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textblock-formats/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nQString tr(const char *text)\n{\n    return QApplication::translate(text, text);\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n\n//! [0]\n    QTextEdit *editor = new QTextEdit();\n    QTextCursor cursor(editor->textCursor());\n//! [0]\n    cursor.movePosition(QTextCursor::Start); \n\n    QTextBlockFormat blockFormat = cursor.blockFormat();\n    blockFormat.setTopMargin(4);\n    blockFormat.setLeftMargin(4);\n    blockFormat.setRightMargin(4);\n    blockFormat.setBottomMargin(4);\n\n    cursor.setBlockFormat(blockFormat);\n    cursor.insertText(tr(\"This contains plain text inside a \"\n                         \"text block with margins to keep it separate \"\n                         \"from other parts of the document.\"));\n\n    cursor.insertBlock();\n\n//! [1]\n    QTextBlockFormat backgroundFormat = blockFormat;\n    backgroundFormat.setBackground(QColor(\"lightGray\"));\n\n    cursor.setBlockFormat(backgroundFormat);\n//! [1]\n    cursor.insertText(tr(\"The background color of a text block can be \"\n                         \"changed to highlight text.\"));\n\n    cursor.insertBlock();\n\n    QTextBlockFormat rightAlignedFormat = blockFormat;\n    rightAlignedFormat.setAlignment(Qt::AlignRight);\n\n    cursor.setBlockFormat(rightAlignedFormat);\n    cursor.insertText(tr(\"The alignment of the text within a block is \"\n                         \"controlled by the alignment properties of \"\n                         \"the block itself. This text block is \"\n                         \"right-aligned.\"));\n\n    cursor.insertBlock();\n\n    QTextBlockFormat paragraphFormat = blockFormat;\n    paragraphFormat.setAlignment(Qt::AlignJustify);\n    paragraphFormat.setTextIndent(32);\n\n    cursor.setBlockFormat(paragraphFormat);\n    cursor.insertText(tr(\"Text can be formatted so that the first \"\n                         \"line in a paragraph has its own margin. \"\n                         \"This makes the text more readable.\"));\n\n    cursor.insertBlock();\n\n    QTextBlockFormat reverseFormat = blockFormat;\n    reverseFormat.setAlignment(Qt::AlignJustify);\n    reverseFormat.setTextIndent(32);\n\n    cursor.setBlockFormat(reverseFormat);\n    cursor.insertText(tr(\"The direction of the text can be reversed. \"\n                         \"This is useful for right-to-left \"\n                         \"languages.\"));\n\n    editor->setWindowTitle(tr(\"Text Block Formats\"));\n    editor->resize(480, 480);\n    editor->show();\n    \n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textblock-fragments/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->resize(640, 480);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textblock-fragments/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n#include \"xmlwriter.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *saveAction = fileMenu->addAction(tr(\"&Save...\"));\n    saveAction->setShortcut(tr(\"Ctrl+S\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *insertMenu = new QMenu(tr(\"&Insert\"));\n\n    QAction *calendarAction = insertMenu->addAction(tr(\"&Calendar\"));\n    calendarAction->setShortcut(tr(\"Ctrl+I\"));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(insertMenu);\n\n    editor = new QTextEdit(this);\n\n    connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n    connect(calendarAction, SIGNAL(triggered()), this, SLOT(insertCalendar()));\n\n    setCentralWidget(editor);\n    setWindowTitle(tr(\"Text Document Writer\"));\n}\n\nvoid MainWindow::saveFile()\n{\n    QString fileName = QFileDialog::getSaveFileName(this,\n        tr(\"Save document as:\"), \"\", tr(\"XML (*.xml)\"));\n\n    if (!fileName.isEmpty()) {\n        if (writeXml(fileName))\n            setWindowTitle(fileName);\n        else\n            QMessageBox::warning(this, tr(\"Warning\"),\n                tr(\"Failed to save the document.\"), QMessageBox::Cancel,\n                QMessageBox::NoButton);\n    }\n}\n\nvoid MainWindow::insertCalendar()\n{\n    QTextCursor cursor(editor->textCursor());\n    cursor.movePosition(QTextCursor::Start); \n\n    QTextCharFormat format(cursor.charFormat());\n    format.setFontFamily(\"Courier\");\n    \n    QTextCharFormat boldFormat = format;\n    boldFormat.setFontWeight(QFont::Bold);\n\n    cursor.insertBlock();\n    cursor.insertText(\" \", boldFormat);\n\n    QDate date = QDate::currentDate();\n    int year = date.year(), month = date.month();\n\n    for (int weekDay = 1; weekDay <= 7; ++weekDay) {\n        cursor.insertText(QString(\"%1 \").arg(QDate::shortDayName(weekDay), 3),\n            boldFormat);\n    }\n\n    cursor.insertBlock();\n    cursor.insertText(\" \", format);\n\n    for (int column = 1; column < QDate(year, month, 1).dayOfWeek(); ++column) {\n        cursor.insertText(\"    \", format);\n    }\n\n    for (int day = 1; day <= date.daysInMonth(); ++day) {\n        int weekDay = QDate(year, month, day).dayOfWeek();\n\n        if (QDate(year, month, day) == date)\n            cursor.insertText(QString(\"%1 \").arg(day, 3), boldFormat);\n        else\n            cursor.insertText(QString(\"%1 \").arg(day, 3), format);\n\n        if (weekDay == 7) {\n            cursor.insertBlock();\n            cursor.insertText(\" \", format);\n        }\n    }\n}\n\nbool MainWindow::writeXml(const QString &fileName)\n{\n    XmlWriter documentWriter(editor->document());\n\n    QDomDocument *domDocument = documentWriter.toXml();\n    QFile file(fileName);\n\n    if (file.open(QFile::WriteOnly)) {\n        QTextStream textStream(&file);\n        \n        textStream << domDocument->toByteArray(1);\n        return true;\n    }\n    else\n        return false;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textblock-fragments/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QTextEdit;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void insertCalendar();\n    void saveFile();\n\nprivate:\n    bool writeXml(const QString &fileName);\n\n    QTextEdit *editor;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textblock-fragments/xmlwriter.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"xmlwriter.h\"\n\nQDomDocument *XmlWriter::toXml()\n{\n    QDomImplementation implementation;\n    QDomDocumentType docType = implementation.createDocumentType(\n        \"scribe-document\", \"scribe\", \"qtsoftware.com/scribe\");\n\n    document = new QDomDocument(docType);\n\n    // ### This processing instruction is required to ensure that any kind\n    // of encoding is given when the document is written.\n    QDomProcessingInstruction process = document->createProcessingInstruction(\n        \"xml\", \"version=\\\"1.0\\\" encoding=\\\"utf-8\\\"\");\n    document->appendChild(process);\n\n    QDomElement documentElement = document->createElement(\"document\");\n    document->appendChild(documentElement);\n\n//! [0]\n    QTextBlock currentBlock = textDocument->begin();\n\n    while (currentBlock.isValid()) {\n//! [0]\n        QDomElement blockElement = document->createElement(\"block\");\n        document->appendChild(blockElement);\n\n        readFragment(currentBlock, blockElement, document);\n\n//! [1]\n        processBlock(currentBlock);\n//! [1]\n\n//! [2]\n        currentBlock = currentBlock.next();\n    }\n//! [2]\n\n    return document;\n}\n\nvoid XmlWriter::readFragment(const QTextBlock &currentBlock,\n                             QDomElement blockElement,\n                             QDomDocument *document)\n{\n//! [3] //! [4]\n    QTextBlock::iterator it;\n    for (it = currentBlock.begin(); !(it.atEnd()); ++it) {\n        QTextFragment currentFragment = it.fragment();\n        if (currentFragment.isValid())\n//! [3] //! [5]\n            processFragment(currentFragment);\n//! [4] //! [5]\n\n        if (currentFragment.isValid()) {\n            QDomElement fragmentElement = document->createElement(\"fragment\");\n            blockElement.appendChild(fragmentElement);\n\n            fragmentElement.setAttribute(\"length\", currentFragment.length());\n            QDomText fragmentText = document->createTextNode(currentFragment.text());\n\n            fragmentElement.appendChild(fragmentText);\n//! [6]\n        }\n//! [7]\n    }\n//! [6] //! [7]\n}\n\nvoid XmlWriter::processBlock(const QTextBlock &currentBlock)\n{\n}\n\nvoid XmlWriter::processFragment(const QTextFragment &currentFragment)\n{\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textblock-fragments/xmlwriter.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef XMLWRITER_H\n#define XMLWRITER_H\n\n#include <QDomDocument>\n\nclass QTextDocument;\n\nclass XmlWriter\n{\npublic:\n    XmlWriter(QTextDocument *document) : textDocument(document) {}\n    QDomDocument *toXml();\n\nprivate:\n    void readFragment(const QTextBlock &currentBlock, QDomElement blockElement,\n                      QDomDocument *document);\n    void processBlock(const QTextBlock &currentBlock);\n    void processFragment(const QTextFragment &currentFragment);\n\n    QDomDocument *document;\n    QTextDocument *textDocument;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-blocks/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->resize(640, 480);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-blocks/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n#include \"xmlwriter.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *saveAction = fileMenu->addAction(tr(\"&Save...\"));\n    saveAction->setShortcut(tr(\"Ctrl+S\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *insertMenu = new QMenu(tr(\"&Insert\"));\n\n    QAction *calendarAction = insertMenu->addAction(tr(\"&Calendar\"));\n    calendarAction->setShortcut(tr(\"Ctrl+I\"));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(insertMenu);\n\n//! [0]\n    editor = new QTextEdit(this);\n//! [0]\n\n    connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n    connect(calendarAction, SIGNAL(triggered()), this, SLOT(insertCalendar()));\n\n    setCentralWidget(editor);\n    setWindowTitle(tr(\"Text Document Writer\"));\n}\n\nvoid MainWindow::saveFile()\n{\n    QString fileName = QFileDialog::getSaveFileName(this,\n        tr(\"Save document as:\"), \"\", tr(\"XML (*.xml)\"));\n\n    if (!fileName.isEmpty()) {\n        if (writeXml(fileName))\n            setWindowTitle(fileName);\n        else\n            QMessageBox::warning(this, tr(\"Warning\"),\n                tr(\"Failed to save the document.\"), QMessageBox::Cancel,\n                QMessageBox::NoButton);\n    }\n}\n\nvoid MainWindow::insertCalendar()\n{\n//! [1]\n    QTextCursor cursor(editor->textCursor());\n    cursor.movePosition(QTextCursor::Start); \n\n    QTextCharFormat format(cursor.charFormat());\n    format.setFontFamily(\"Courier\");\n    \n    QTextCharFormat boldFormat = format;\n    boldFormat.setFontWeight(QFont::Bold);\n\n    cursor.insertBlock();\n    cursor.insertText(\" \", boldFormat);\n\n    QDate date = QDate::currentDate();\n    int year = date.year(), month = date.month();\n\n    for (int weekDay = 1; weekDay <= 7; ++weekDay) {\n        cursor.insertText(QString(\"%1 \").arg(QDate::shortDayName(weekDay), 3),\n            boldFormat);\n    }\n\n    cursor.insertBlock();\n    cursor.insertText(\" \", format);\n\n    for (int column = 1; column < QDate(year, month, 1).dayOfWeek(); ++column) {\n        cursor.insertText(\"    \", format);\n    }\n\n    for (int day = 1; day <= date.daysInMonth(); ++day) {\n//! [1] //! [2]\n        int weekDay = QDate(year, month, day).dayOfWeek();\n\n        if (QDate(year, month, day) == date)\n            cursor.insertText(QString(\"%1 \").arg(day, 3), boldFormat);\n        else\n            cursor.insertText(QString(\"%1 \").arg(day, 3), format);\n\n        if (weekDay == 7) {\n            cursor.insertBlock();\n            cursor.insertText(\" \", format);\n        }\n//! [2] //! [3]\n    }\n//! [3]\n}\n\nbool MainWindow::writeXml(const QString &fileName)\n{\n    XmlWriter documentWriter(editor->document());\n\n    QDomDocument *domDocument = documentWriter.toXml();\n    QFile file(fileName);\n\n    if (file.open(QFile::WriteOnly)) {\n        QTextStream textStream(&file);\n        textStream.setCodec(QTextCodec::codecForName(\"UTF-8\"));\n        \n        textStream << domDocument->toString(1).toUtf8();\n        file.close();\n        return true;\n    }\n    else\n        return false;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-blocks/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QTextEdit;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void insertCalendar();\n    void saveFile();\n\nprivate:\n    bool writeXml(const QString &fileName);\n\n    QTextEdit *editor;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-blocks/xmlwriter.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"xmlwriter.h\"\n\nQDomDocument *XmlWriter::toXml()\n{\n    QDomImplementation implementation;\n    QDomDocumentType docType = implementation.createDocumentType(\n        \"scribe-document\", \"scribe\", \"qtsoftware.com/scribe\");\n\n    document = new QDomDocument(docType);\n\n    // ### This processing instruction is required to ensure that any kind\n    // of encoding is given when the document is written.\n    QDomProcessingInstruction process = document->createProcessingInstruction(\n        \"xml\", \"version=\\\"1.0\\\" encoding=\\\"utf-8\\\"\");\n    document->appendChild(process);\n\n    QDomElement documentElement = document->createElement(\"document\");\n    document->appendChild(documentElement);\n\n    QTextBlock firstBlock = textDocument->begin();\n    createItems(documentElement, firstBlock);\n\n    return document;\n}\n\nvoid XmlWriter::createItems(QDomElement &parent, const QTextBlock &block)\n{\n    QTextBlock currentBlock = block;\n\n    while (currentBlock.isValid()) {\n        QDomElement blockElement = document->createElement(\"block\");\n        blockElement.setAttribute(\"length\", currentBlock.length());\n        parent.appendChild(blockElement);\n\n        if (!(currentBlock.text().isNull())) {\n            QDomText textNode = document->createTextNode(currentBlock.text());\n            blockElement.appendChild(textNode);\n        }\n\n        currentBlock = currentBlock.next();\n    }\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-blocks/xmlwriter.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef XMLWRITER_H\n#define XMLWRITER_H\n\n#include <QDomDocument>\n\nclass QTextDocument;\n\nclass XmlWriter\n{\npublic:\n    XmlWriter(QTextDocument *document) : textDocument(document) {}\n    QDomDocument *toXml();\n\nprivate:\n    void createItems(QDomElement &parent, const QTextBlock &block);\n\n    QDomDocument *document;\n    QTextDocument *textDocument;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-charformats/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nQString tr(const char *text)\n{\n    return QApplication::translate(text, text);\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QTextEdit *editor = new QTextEdit();\n\n    QTextCursor cursor(editor->textCursor());\n    cursor.movePosition(QTextCursor::Start); \n\n    QTextCharFormat plainFormat(cursor.charFormat());\n\n    QTextCharFormat headingFormat = plainFormat;\n    headingFormat.setFontWeight(QFont::Bold);\n    headingFormat.setFontPointSize(16);\n\n    QTextCharFormat emphasisFormat = plainFormat;\n    emphasisFormat.setFontItalic(true);\n\n    QTextCharFormat qtFormat = plainFormat;\n    qtFormat.setForeground(QColor(\"#990000\"));\n\n    QTextCharFormat underlineFormat = plainFormat;\n    underlineFormat.setFontUnderline(true);\n\n//! [0]\n    cursor.insertText(tr(\"Character formats\"),\n                      headingFormat);\n\n    cursor.insertBlock();\n\n    cursor.insertText(tr(\"Text can be displayed in a variety of \"\n                                  \"different character formats. \"), plainFormat);\n    cursor.insertText(tr(\"We can emphasize text by \"));\n    cursor.insertText(tr(\"making it italic\"), emphasisFormat);\n//! [0]\n    cursor.insertText(tr(\", give it a \"), plainFormat);\n    cursor.insertText(tr(\"different color \"), qtFormat);\n    cursor.insertText(tr(\"to the default text color, \"), plainFormat);\n    cursor.insertText(tr(\"underline it\"), underlineFormat);\n    cursor.insertText(tr(\", and use many other effects.\"), plainFormat);\n\n    editor->setWindowTitle(tr(\"Text Document Character Formats\"));\n    editor->resize(320, 480);\n    editor->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-css/main.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0]\n    browser = QTextBrowser()\n    linkColor = QColor(Qt.red)\n    sheet = QString.fromLatin1(\"a { text-decoration: underline color: %1 }\").arg(linkColor.name())\n    browser.document().setDefaultStyleSheet(sheet)\n//! [0]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-cursors/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nQString tr(const char *text)\n{\n    return QApplication::translate(text, text);\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QTextEdit *editor = new QTextEdit;\n\n//! [0]\n    QTextDocument *document = editor->document();\n    QTextCursor redCursor(document);\n//! [0] //! [1]\n    QTextCursor blueCursor(document);\n//! [1]\n\n    QTextCharFormat redFormat(redCursor.charFormat());\n    redFormat.setForeground(Qt::red);\n    QTextCharFormat blueFormat(blueCursor.charFormat());\n    blueFormat.setForeground(Qt::blue);\n\n    redCursor.setCharFormat(redFormat);\n    blueCursor.setCharFormat(blueFormat);\n\n    for (int i = 0; i < 20; ++i) {\n        if (i % 2 == 0)\n            redCursor.insertText(tr(\"%1 \").arg(i), redFormat);\n        if (i % 5 == 0)\n            blueCursor.insertText(tr(\"%1 \").arg(i), blueFormat);\n    }\n\n    editor->setWindowTitle(tr(\"Text Document Cursors\"));\n    editor->resize(320, 480);\n    editor->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-find/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nQString tr(const char *text)\n{\n    return QApplication::translate(text, text);\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QTextEdit *editor = new QTextEdit();\n\n    QTextCursor cursor(editor->textCursor());\n    cursor.movePosition(QTextCursor::Start);\n\n    QTextCharFormat plainFormat(cursor.charFormat());\n    QTextCharFormat colorFormat = plainFormat;\n    colorFormat.setForeground(Qt::red);\n\n    cursor.insertText(tr(\"Text can be displayed in a variety of \"\n                                  \"different character \"\n                                  \"formats. \"), plainFormat);\n    cursor.insertText(tr(\"We can emphasize text by making it \"));\n    cursor.insertText(tr(\"italic, give it a different color \"));\n    cursor.insertText(tr(\"to the default text color, underline it, \"));\n    cursor.insertText(tr(\"and use many other effects.\"));\n\n    QString searchString = tr(\"text\");\n\n    QTextDocument *document = editor->document();\n//! [0]\n    QTextCursor newCursor(document);\n\n    while (!newCursor.isNull() && !newCursor.atEnd()) {\n        newCursor = document->find(searchString, newCursor);\n\n        if (!newCursor.isNull()) {\n            newCursor.movePosition(QTextCursor::WordRight,\n                                   QTextCursor::KeepAnchor);\n\n            newCursor.mergeCharFormat(colorFormat);\n        }\n//! [0] //! [1]\n    }\n//! [1]\n\n    editor->setWindowTitle(tr(\"Text Document Find\"));\n    editor->resize(320, 480);\n    editor->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-frames/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->resize(480, 480);\n    window->show();\n    return app.exec();\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-frames/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n#include \"xmlwriter.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    QAction *saveAction = fileMenu->addAction(tr(\"&Save...\"));\n    saveAction->setShortcut(tr(\"Ctrl+S\"));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    menuBar()->addMenu(fileMenu);\n    editor = new QTextEdit();\n\n    QTextCursor cursor(editor->textCursor());\n    cursor.movePosition(QTextCursor::Start); \n\n    QTextFrame *mainFrame = cursor.currentFrame();\n    \n    QTextCharFormat plainCharFormat;\n    QTextCharFormat boldCharFormat;\n    boldCharFormat.setFontWeight(QFont::Bold);\n/*  main frame\n//! [0]\n    QTextFrame *mainFrame = cursor.currentFrame();\n    cursor.insertText(...);\n//! [0]\n*/\n    cursor.insertText(\"Text documents are represented by the \"\n                      \"QTextDocument class, rather than by QString objects. \"\n                      \"Each QTextDocument object contains information about \"\n                      \"the document's internal representation, its structure, \"\n                      \"and keeps track of modifications to provide undo/redo \"\n                      \"facilities. This approach allows features such as the \"\n                      \"layout management to be delegated to specialized \"\n                      \"classes, but also provides a focus for the framework.\",\n                      plainCharFormat);\n\n//! [1]\n    QTextFrameFormat frameFormat;\n    frameFormat.setMargin(32);\n    frameFormat.setPadding(8);\n    frameFormat.setBorder(4);\n//! [1]\n    cursor.insertFrame(frameFormat);\n\n/*  insert frame\n//! [2]\n    cursor.insertFrame(frameFormat);\n    cursor.insertText(...);\n//! [2]\n*/\n    cursor.insertText(\"Documents are either converted from external sources \"\n                      \"or created from scratch using Qt. The creation process \"\n                      \"can done by an editor widget, such as QTextEdit, or by \"\n                      \"explicit calls to the Scribe API.\", boldCharFormat);\n\n    cursor = mainFrame->lastCursorPosition();\n/*  last cursor\n//! [3]\n    cursor = mainFrame->lastCursorPosition();\n    cursor.insertText(...);\n//! [3]\n*/\n    cursor.insertText(\"There are two complementary ways to visualize the \"\n                      \"contents of a document: as a linear buffer that is \"\n                      \"used by editors to modify the contents, and as an \"\n                      \"object hierarchy containing structural information \"\n                      \"that is useful to layout engines. In the hierarchical \"\n                      \"model, the objects generally correspond to visual \"\n                      \"elements such as frames, tables, and lists. At a lower \"\n                      \"level, these elements describe properties such as the \"\n                      \"style of text used and its alignment. The linear \"\n                      \"representation of the document is used for editing and \"\n                      \"manipulation of the document's contents.\",\n                      plainCharFormat);\n\n\n    connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));\n    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));\n\n    setCentralWidget(editor);\n    setWindowTitle(tr(\"Text Document Frames\"));\n}\n\nvoid MainWindow::saveFile()\n{\n    QString fileName = QFileDialog::getSaveFileName(this,\n        tr(\"Save document as:\"), \"\", tr(\"XML (*.xml)\"));\n\n    if (!fileName.isEmpty()) {\n        if (writeXml(fileName))\n            setWindowTitle(fileName);\n        else\n            QMessageBox::warning(this, tr(\"Warning\"),\n                tr(\"Failed to save the document.\"), QMessageBox::Cancel,\n                QMessageBox::NoButton);\n    }\n}\nbool MainWindow::writeXml(const QString &fileName)\n{\n    XmlWriter documentWriter(editor->document());\n\n    QDomDocument *domDocument = documentWriter.toXml();\n    QFile file(fileName);\n\n    if (file.open(QFile::WriteOnly)) {\n        QTextStream textStream(&file);\n        textStream.setCodec(QTextCodec::codecForName(\"UTF-8\"));\n        \n        textStream << domDocument->toString(1).toUtf8();\n        file.close();\n        return true;\n    }\n    else\n        return false;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-frames/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QTextEdit;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void saveFile();\n\nprivate:\n    bool writeXml(const QString &fileName);\n\n    QTextEdit *editor;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-frames/xmlwriter.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"xmlwriter.h\"\n\nQDomDocument *XmlWriter::toXml()\n{\n    QDomImplementation implementation;\n    QDomDocumentType docType = implementation.createDocumentType(\n        \"scribe-document\", \"scribe\", \"qtsoftware.com/scribe\");\n\n    document = new QDomDocument(docType);\n\n    // ### This processing instruction is required to ensure that any kind\n    // of encoding is given when the document is written.\n    QDomProcessingInstruction process = document->createProcessingInstruction(\n        \"xml\", \"version=\\\"1.0\\\" encoding=\\\"utf-8\\\"\");\n    document->appendChild(process);\n\n    QDomElement documentElement = document->createElement(\"document\");\n    document->appendChild(documentElement);\n\n//! [0]\n    QTextFrame *root = textDocument->rootFrame();\n//! [0]\n    \n    if (root)\n        processFrame(documentElement, root);\n\n    return document;\n}\n\nvoid XmlWriter::processBlock(QDomElement &parent, const QTextBlock &block)\n{\n    QDomElement blockElement = document->createElement(\"block\");\n    blockElement.setAttribute(\"position\", block.position());\n    blockElement.setAttribute(\"length\", block.length());\n    parent.appendChild(blockElement);\n\n    QTextBlock::iterator it;\n    for (it = block.begin(); !(it.atEnd()); ++it) {\n        QTextFragment fragment = it.fragment();\n\n        if (fragment.isValid()) {\n            QDomElement fragmentElement = document->createElement(\"fragment\");\n            blockElement.appendChild(fragmentElement);\n\n            fragmentElement.setAttribute(\"length\", fragment.length());\n            QDomText fragmentText = document->createTextNode(fragment.text());\n\n            fragmentElement.appendChild(fragmentText);\n        }\n    }\n}\n\nvoid XmlWriter::processFrame(QDomElement &parent, QTextFrame *frame)\n{\n    QDomElement frameElement = document->createElement(\"frame\");\n    frameElement.setAttribute(\"begin\", frame->firstPosition());\n    frameElement.setAttribute(\"end\", frame->lastPosition());\n    parent.appendChild(frameElement);\n\n//! [1]\n    QTextFrame::iterator it;\n    for (it = frame->begin(); !(it.atEnd()); ++it) {\n\n        QTextFrame *childFrame = it.currentFrame();\n        QTextBlock childBlock = it.currentBlock();\n\n        if (childFrame)\n//! [1] //! [2]\n            processFrame(frameElement, childFrame);\n        else if (childBlock.isValid())\n            processBlock(frameElement, childBlock);\n    }\n//! [2]\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-frames/xmlwriter.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef XMLWRITER_H\n#define XMLWRITER_H\n\n#include <QDomDocument>\n\nclass QTextDocument;\n\nclass XmlWriter\n{\npublic:\n    XmlWriter(QTextDocument *document) : textDocument(document) {}\n    QDomDocument *toXml();\n\nprivate:\n    void processBlock(QDomElement &parent, const QTextBlock &block);\n    void processFrame(QDomElement &parent, QTextFrame *frame);\n\n    QDomDocument *document;\n//! [0]\n    QTextDocument *textDocument;\n//! [0]\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-imagedrop/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include \"textedit.h\"\n\nint main(int argc, char * argv[])\n{\n    QApplication app(argc, argv);\n\n    TextEdit *textEdit = new TextEdit;\n    textEdit->show();\n\n    return app.exec();\n}"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-imagedrop/textedit.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include \"textedit.h\"\n#include <QtGui>\n\nTextEdit::TextEdit(QWidget *parent)\n\t: QTextEdit(parent)\n{\n}\n\n//! [0]\n\ndef canInsertFromMimeData(source):\n    if source.hasImage:\n        return True\n    else:\n        return QTextEdit.canInsertFromMimeData(source)\n\n//! [0]\n\n//! [1]\nvoid TextEdit::insertFromMimeData( const QMimeData *source )\n{\n    if (source->hasImage())\n    {\n        QImage image = qvariant_cast<QImage>(source->imageData());\n        QTextCursor cursor = this->textCursor();\n        QTextDocument *document = this->document();\n        document->addResource(QTextDocument::ImageResource, QUrl(\"image\"), image);\n        cursor.insertImage(\"image\");\n    }\n}\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-imagedrop/textedit.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef TEXTEDIT_H\n#define TEXTEDIT_H\n\n#include <QTextEdit>\n\nclass TextEdit : public QTextEdit\n{\n    Q_OBJECT\n    \npublic: \n    TextEdit(QWidget *parent=0);\n    bool canInsertFromMimeData( const QMimeData *source ) const;\n    void insertFromMimeData( const QMimeData *source );\n};\n\n#endif"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-imageformat/images.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n   <file>images/advert.png</file>\n   <file>images/newimage.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-imageformat/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nQString tr(const char *text)\n{\n    return QApplication::translate(text, text);\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QTextEdit *editor = new QTextEdit;\n\n    QTextDocument *document = new QTextDocument(editor);\n    QTextCursor cursor(document);\n\n    QTextImageFormat imageFormat;\n    imageFormat.setName(\":/images/advert.png\");\n    cursor.insertImage(imageFormat);\n\n    QTextBlock block = cursor.block();\n    QTextFragment fragment;\n    QTextBlock::iterator it;\n\n    for (it = block.begin(); !(it.atEnd()); ++it) {\n        fragment = it.fragment();\n\n        if (fragment.contains(cursor.position()))\n            break;\n    }\n\n//! [0]\n    if (fragment.isValid()) {\n        QTextImageFormat newImageFormat = fragment.charFormat().toImageFormat();\n\n        if (newImageFormat.isValid()) {\n            newImageFormat.setName(\":/images/newimage.png\");\n            QTextCursor helper = cursor;\n\n            helper.setPosition(fragment.position());\n            helper.setPosition(fragment.position() + fragment.length(),\n                                QTextCursor::KeepAnchor);\n            helper.setCharFormat(newImageFormat);\n//! [0] //! [1]\n        }\n//! [1] //! [2]\n    }\n//! [2]\n\n    cursor.insertBlock();\n    cursor.insertText(\"Code less. Create more.\");\n\n    editor->setDocument(document);\n    editor->setWindowTitle(tr(\"Text Document Image Format\"));\n    editor->resize(320, 480);\n    editor->show();\n    \n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-images/images.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n   <file>images/advert.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-images/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nQString tr(const char *text)\n{\n    return QApplication::translate(text, text);\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QTextEdit *editor = new QTextEdit;\n\n//! [0]\n    QTextDocument *document = new QTextDocument(editor);\n    QTextCursor cursor(document);\n//! [0]\n\n//! [1]\n    QTextImageFormat imageFormat;\n    imageFormat.setName(\":/images/advert.png\");\n    cursor.insertImage(imageFormat);\n//! [1]\n\n    cursor.insertBlock();\n    cursor.insertText(\"Code less. Create more.\");\n\n    editor->setDocument(document);\n    editor->setWindowTitle(tr(\"Text Document Images\"));\n    editor->resize(320, 480);\n    editor->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-listitems/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->resize(640, 480);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-listitems/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    fileMenu->addAction(tr(\"E&xit\"), this, SLOT(close()),\n        QKeySequence(tr(\"Ctrl+Q\", \"File|Exit\")));\n\n    QMenu *actionsMenu = new QMenu(tr(\"&Actions\"));\n    actionsMenu->addAction(tr(\"&Highlight List Items\"),\n                        this, SLOT(highlightListItems()));\n    actionsMenu->addAction(tr(\"&Show Current List\"), this, SLOT(showList()));\n\n    QMenu *insertMenu = new QMenu(tr(\"&Insert\"));\n\n    insertMenu->addAction(tr(\"&List\"), this, SLOT(insertList()),\n        QKeySequence(tr(\"Ctrl+L\", \"Insert|List\")));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(insertMenu);\n    menuBar()->addMenu(actionsMenu);\n\n    editor = new QTextEdit(this);\n    document = new QTextDocument(this);\n    editor->setDocument(document);\n\n    setCentralWidget(editor);\n    setWindowTitle(tr(\"Text Document List Items\"));\n}\n\nvoid MainWindow::highlightListItems()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextList *list = cursor.currentList();\n\n    if (!list)\n        return;\n\n    cursor.beginEditBlock();\n//! [0]\n    for (int index = 0; index < list->count(); ++index) {\n        QTextBlock listItem = list->item(index);\n//! [0]\n        QTextBlockFormat newBlockFormat = listItem.blockFormat();\n        newBlockFormat.setBackground(Qt::lightGray);\n        QTextCursor itemCursor = cursor;\n        itemCursor.setPosition(listItem.position());\n        //itemCursor.movePosition(QTextCursor::StartOfBlock);\n        itemCursor.movePosition(QTextCursor::EndOfBlock,\n                                QTextCursor::KeepAnchor);\n        itemCursor.setBlockFormat(newBlockFormat);\n        /*\n//! [1]\n        processListItem(listItem);\n//! [1]\n        */\n//! [2]\n    }\n//! [2]\n    cursor.endEditBlock();\n}\n\nvoid MainWindow::showList()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextFrame *frame = cursor.currentFrame();\n\n    if (!frame)\n        return;\n\n    QTreeWidget *treeWidget = new QTreeWidget;\n    treeWidget->setColumnCount(1);\n    QStringList headerLabels;\n    headerLabels << tr(\"Lists\");\n    treeWidget->setHeaderLabels(headerLabels);\n\n    QTreeWidgetItem *parentItem = 0;\n    QTreeWidgetItem *item;\n    QTreeWidgetItem *lastItem = 0;\n    parentItems.clear();\n    previousItems.clear();\n\n//! [3]\n    QTextFrame::iterator it;\n    for (it = frame->begin(); !(it.atEnd()); ++it) {\n\n        QTextBlock block = it.currentBlock();\n\n        if (block.isValid()) {\n\n            QTextList *list = block.textList();\n\n            if (list) {\n                int index = list->itemNumber(block);\n//! [3]\n                if (index == 0) {\n                    parentItems.append(parentItem);\n                    previousItems.append(lastItem);\n                    listStructures.append(list);\n                    parentItem = lastItem;\n                    lastItem = 0;\n\n                    if (parentItem != 0)\n                        item = new QTreeWidgetItem(parentItem, lastItem);\n                    else\n                        item = new QTreeWidgetItem(treeWidget, lastItem);\n\n                } else {\n\n                    while (parentItem != 0 && listStructures.last() != list) {\n                        listStructures.pop_back();\n                        parentItem = parentItems.takeLast();\n                        lastItem = previousItems.takeLast();\n                    }\n                    if (parentItem != 0)\n                        item = new QTreeWidgetItem(parentItem, lastItem);\n                    else\n                        item = new QTreeWidgetItem(treeWidget, lastItem);\n                }\n                item->setText(0, block.text());\n                lastItem = item;\n                /*\n//! [4]\n                processListItem(list, index);\n//! [4]\n                */\n//! [5]\n            }\n//! [5] //! [6]\n        }\n//! [6] //! [7]\n    }\n//! [7]\n\n    treeWidget->setWindowTitle(tr(\"List Contents\"));\n    treeWidget->show();\n}\n\nvoid MainWindow::insertList()\n{\n    QTextCursor cursor = editor->textCursor();\n    cursor.beginEditBlock();\n\n    QTextList *list = cursor.currentList();\n    QTextListFormat listFormat;\n    if (list)\n        listFormat = list->format();\n\n    listFormat.setStyle(QTextListFormat::ListDisc);\n    listFormat.setIndent(listFormat.indent() + 1);\n    cursor.insertList(listFormat);\n\n    cursor.endEditBlock();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-listitems/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QList>\n#include <QMainWindow>\n#include <QString>\n\nclass QAction;\nclass QTextDocument;\nclass QTextEdit;\nclass QTextList;\nclass QTreeWidgetItem;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void insertList();\n    void highlightListItems();\n    void showList();\n\nprivate:\n    QString currentFile;\n    QTextEdit *editor;\n    QTextDocument *document;\n    QList<QTextList*> listStructures;\n    QList<QTreeWidgetItem*> previousItems;\n    QList<QTreeWidgetItem*> parentItems;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-lists/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->resize(640, 480);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-lists/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    fileMenu->addAction(tr(\"E&xit\"), this, SLOT(close()),\n        QKeySequence(tr(\"Ctrl+Q\", \"File|Exit\")));\n\n    QMenu *editMenu = new QMenu(tr(\"&Edit\"));\n\n    cutAction = editMenu->addAction(tr(\"Cu&t\"), this, SLOT(cutSelection()),\n        QKeySequence(tr(\"Ctrl+X\", \"Edit|Cut\")));\n    copyAction = editMenu->addAction(tr(\"&Copy\"), this, SLOT(copySelection()),\n        QKeySequence(tr(\"Ctrl+C\", \"Edit|Copy\")));\n    pasteAction = editMenu->addAction(tr(\"&Paste\"), this,\n        SLOT(pasteSelection()), QKeySequence(tr(\"Ctrl+V\", \"Edit|Paste\")));\n\n    QMenu *selectMenu = new QMenu(tr(\"&Select\"));\n    selectMenu->addAction(tr(\"&Word\"), this, SLOT(selectWord()));\n    selectMenu->addAction(tr(\"&Line\"), this, SLOT(selectLine()));\n    selectMenu->addAction(tr(\"&Block\"), this, SLOT(selectBlock()));\n    selectMenu->addAction(tr(\"&Frame\"), this, SLOT(selectFrame()));\n\n    QMenu *insertMenu = new QMenu(tr(\"&Insert\"));\n\n    insertMenu->addAction(tr(\"&List\"), this, SLOT(insertList()),\n        QKeySequence(tr(\"Ctrl+L\", \"Insert|List\")));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(editMenu);\n    menuBar()->addMenu(selectMenu);\n    menuBar()->addMenu(insertMenu);\n\n    editor = new QTextEdit(this);\n    document = new QTextDocument(this);\n    editor->setDocument(document);\n\n    connect(editor, SIGNAL(selectionChanged()), this, SLOT(updateMenus()));\n\n    updateMenus();\n\n    setCentralWidget(editor);\n    setWindowTitle(tr(\"Text Document Writer\"));\n}\n\nvoid MainWindow::cutSelection()\n{\n    QTextCursor cursor = editor->textCursor();\n    if (cursor.hasSelection()) {\n        selection = cursor.selection();\n        cursor.removeSelectedText();\n    }\n}\n\nvoid MainWindow::copySelection()\n{\n    QTextCursor cursor = editor->textCursor();\n    if (cursor.hasSelection()) {\n        selection = cursor.selection();\n        cursor.clearSelection();\n    }\n}\n\nvoid MainWindow::pasteSelection()\n{\n    QTextCursor cursor = editor->textCursor();\n    cursor.insertFragment(selection);\n}\n\nvoid MainWindow::selectWord()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextBlock block = cursor.block();\n\n    cursor.beginEditBlock();\n    cursor.movePosition(QTextCursor::StartOfWord);\n    cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);\n    cursor.endEditBlock();\n\n    editor->setTextCursor(cursor);\n}\n\nvoid MainWindow::selectLine()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextBlock block = cursor.block();\n\n    cursor.beginEditBlock();\n    cursor.movePosition(QTextCursor::StartOfLine);\n    cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);\n    cursor.endEditBlock();\n\n    editor->setTextCursor(cursor);\n}\n\nvoid MainWindow::selectBlock()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextBlock block = cursor.block();\n\n    cursor.beginEditBlock();\n    cursor.movePosition(QTextCursor::StartOfBlock);\n    cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);\n    cursor.endEditBlock();\n\n    editor->setTextCursor(cursor);\n}\n\nvoid MainWindow::selectFrame()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextFrame *frame = cursor.currentFrame();\n\n    cursor.beginEditBlock();\n    cursor.setPosition(frame->firstPosition());\n    cursor.setPosition(frame->lastPosition(), QTextCursor::KeepAnchor);\n    cursor.endEditBlock();\n\n    editor->setTextCursor(cursor);\n}\n\nvoid MainWindow::insertList()\n{\n    QTextCursor cursor = editor->textCursor();\n    cursor.beginEditBlock();\n\n    QTextList *list = cursor.currentList();\n//! [0]\n    listFormat = QTextListFormat()\n    if list:\n        listFormat = list.format()\n        listFormat.setIndent(listFormat.indent() + 1)\n\n    listFormat.setStyle(QTextListFormat.ListDisc)\n    cursor.insertList(listFormat)\n//! [0]\n\n    cursor.endEditBlock();\n}\n\nvoid MainWindow::updateMenus()\n{\n    QTextCursor cursor = editor->textCursor();\n    cutAction->setEnabled(cursor.hasSelection());\n    copyAction->setEnabled(cursor.hasSelection());\n\n    pasteAction->setEnabled(!selection.isEmpty());\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-lists/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n#include <QTextDocumentFragment>\n\nclass QAction;\nclass QTextDocument;\nclass QTextEdit;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void cutSelection();\n    void copySelection();\n    void insertList();\n    void pasteSelection();\n    void selectWord();\n    void selectLine();\n    void selectBlock();\n    void selectFrame();\n    void updateMenus();\n\nprivate:\n    QAction *cutAction;\n    QAction *copyAction;\n    QAction *pasteAction;\n    QString currentFile;\n    QTextEdit *editor;\n    QTextDocument *document;\n    QTextDocumentFragment selection;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-printing/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->resize(640, 480);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-printing/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    fileMenu->addAction(tr(\"&Open...\"), this, SLOT(openFile()),\n                        QKeySequence(tr(\"Ctrl+O\", \"File|Open\")));\n\n    printAction = fileMenu->addAction(tr(\"&Print...\"), this, SLOT(printFile()));\n    printAction->setEnabled(false);\n\n    pdfPrintAction = fileMenu->addAction(tr(\"Print as P&DF...\"), this, SLOT(printPdf()));\n    pdfPrintAction->setEnabled(false);\n\n    fileMenu->addAction(tr(\"E&xit\"), this, SLOT(close()),\n                        QKeySequence(tr(\"Ctrl+Q\", \"File|Exit\")));\n\n    menuBar()->addMenu(fileMenu);\n\n    editor = new QTextEdit(this);\n    document = new QTextDocument(this);\n    editor->setDocument(document);\n\n    connect(editor, SIGNAL(selectionChanged()), this, SLOT(updateMenus()));\n\n    setCentralWidget(editor);\n    setWindowTitle(tr(\"Text Document Writer\"));\n}\n\nvoid MainWindow::openFile()\n{\n    QString fileName = QFileDialog::getOpenFileName(this,\n        tr(\"Open file\"), currentFile, \"HTML files (*.html);;Text files (*.txt)\");\n    \n    if (!fileName.isEmpty()) {\n        QFileInfo info(fileName);\n        if (info.completeSuffix() == \"html\") {\n            QFile file(fileName);\n            \n            if (file.open(QIODevice::ReadOnly)) {\n                editor->setHtml(file.readAll());\n                file.close();\n                currentFile = fileName;\n            }\n        } else if (info.completeSuffix() == \"txt\") {\n            QFile file(fileName);\n            \n            if (file.open(QIODevice::ReadOnly)) {\n                editor->setPlainText(file.readAll());\n                file.close();\n                currentFile = fileName;\n            }\n        }\n        printAction->setEnabled(true);\n        pdfPrintAction->setEnabled(true);\n    }\n}\n\nvoid MainWindow::printFile()\n{\n//! [0]\n    QTextDocument *document = editor->document();\n    QPrinter printer;\n\n    QPrintDialog *dlg = new QPrintDialog(&printer, this);\n    if (dlg->exec() != QDialog::Accepted)\n        return;\n\n    document->print(&printer);\n//! [0]\n}\n\nvoid MainWindow::printPdf()\n{\n    QPrinter printer(QPrinter::HighResolution);\n    printer.setOutputFormat(QPrinter::PdfFormat);\n\n    QPrintDialog *printDialog = new QPrintDialog(&printer, this);\n    if (printDialog->exec() == QDialog::Accepted)\n        editor->document()->print(&printer);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-printing/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include <QHash>\n#include <QMainWindow>\n#include <QTextDocumentFragment>\n\nclass QAction;\nclass QTextDocument;\nclass QTextEdit;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void openFile();\n    void printFile();\n    void printPdf();\n\nprivate:\n    QAction *printAction;\n    QAction *pdfPrintAction;\n    QString currentFile;\n    QTextEdit *editor;\n    QTextDocument *document;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-selections/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->resize(640, 480);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-selections/mainwindow.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nMainWindow::MainWindow()\n{\n    QMenu *fileMenu = new QMenu(tr(\"&File\"));\n\n    fileMenu->addAction(tr(\"&Open...\"), this, SLOT(openFile()),\n                        QKeySequence(tr(\"Ctrl+O\", \"File|Open\")));\n\n    QAction *quitAction = fileMenu->addAction(tr(\"E&xit\"), this, SLOT(close()));\n    quitAction->setShortcut(tr(\"Ctrl+Q\"));\n\n    QMenu *editMenu = new QMenu(tr(\"&Edit\"));\n\n    cutAction = editMenu->addAction(tr(\"Cu&t\"), this, SLOT(cutSelection()));\n    cutAction->setShortcut(tr(\"Ctrl+X\"));\n    cutAction->setEnabled(false);\n\n    copyAction = editMenu->addAction(tr(\"&Copy\"), this, SLOT(copySelection()));\n    copyAction->setShortcut(tr(\"Ctrl+C\"));\n    copyAction->setEnabled(false);\n\n    pasteAction = editMenu->addAction(tr(\"&Paste\"), this, SLOT(pasteSelection()));\n    pasteAction->setShortcut(tr(\"Ctrl+V\"));\n    pasteAction->setEnabled(false);\n\n    QMenu *selectMenu = new QMenu(tr(\"&Select\"));\n    selectMenu->addAction(tr(\"&Word\"), this, SLOT(selectWord()));\n    selectMenu->addAction(tr(\"&Line\"), this, SLOT(selectLine()));\n    selectMenu->addAction(tr(\"&Block\"), this, SLOT(selectBlock()));\n    selectMenu->addAction(tr(\"&Frame\"), this, SLOT(selectFrame()));\n\n    menuBar()->addMenu(fileMenu);\n    menuBar()->addMenu(editMenu);\n    menuBar()->addMenu(selectMenu);\n\n    editor = new QTextEdit(this);\n    document = new QTextDocument(this);\n    editor->setDocument(document);\n\n    connect(editor, SIGNAL(selectionChanged()), this, SLOT(updateMenus()));\n\n    setCentralWidget(editor);\n    setWindowTitle(tr(\"Text Document Writer\"));\n}\n\nvoid MainWindow::openFile()\n{\n    QString fileName = QFileDialog::getOpenFileName(this,\n        tr(\"Open file\"), currentFile, \"HTML files (*.html);;Text files (*.txt)\");\n    \n    if (!fileName.isEmpty()) {\n        QFileInfo info(fileName);\n        if (info.completeSuffix() == \"html\") {\n            QFile file(fileName);\n            \n            if (file.open(QFile::ReadOnly)) {\n                editor->setHtml(QString(file.readAll()));\n                file.close();\n                currentFile = fileName;\n            }\n        } else if (info.completeSuffix() == \"txt\") {\n            QFile file(fileName);\n            \n            if (file.open(QFile::ReadOnly)) {\n                editor->setPlainText(file.readAll());\n                file.close();\n                currentFile = fileName;\n            }\n        }\n    }\n}\n\nvoid MainWindow::cutSelection()\n{\n    QTextCursor cursor = editor->textCursor();\n    if (cursor.hasSelection()) {\n        selection = cursor.selection();\n        cursor.removeSelectedText();\n    }\n}\n\nvoid MainWindow::copySelection()\n{\n    QTextCursor cursor = editor->textCursor();\n    if (cursor.hasSelection()) {\n        selection = cursor.selection();\n        cursor.clearSelection();\n    }\n}\n\nvoid MainWindow::pasteSelection()\n{\n    QTextCursor cursor = editor->textCursor();\n    cursor.insertFragment(selection);\n}\n\nvoid MainWindow::selectWord()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextBlock block = cursor.block();\n\n//! [0]\n    cursor.beginEditBlock();\n//! [1]\n    cursor.movePosition(QTextCursor::StartOfWord);\n    cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);\n//! [1]\n    cursor.endEditBlock();\n//! [0]\n\n    editor->setTextCursor(cursor);\n}\n\nvoid MainWindow::selectLine()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextBlock block = cursor.block();\n\n    cursor.beginEditBlock();\n    cursor.movePosition(QTextCursor::StartOfLine);\n    cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);\n    cursor.endEditBlock();\n\n    editor->setTextCursor(cursor);\n}\n\nvoid MainWindow::selectBlock()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextBlock block = cursor.block();\n\n    cursor.beginEditBlock();\n    cursor.movePosition(QTextCursor::StartOfBlock);\n    cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);\n    cursor.endEditBlock();\n\n    editor->setTextCursor(cursor);\n}\n\nvoid MainWindow::selectFrame()\n{\n    QTextCursor cursor = editor->textCursor();\n    QTextFrame *frame = cursor.currentFrame();\n\n    cursor.beginEditBlock();\n    cursor.setPosition(frame->firstPosition());\n    cursor.setPosition(frame->lastPosition(), QTextCursor::KeepAnchor);\n    cursor.endEditBlock();\n\n    editor->setTextCursor(cursor);\n}\n\nvoid MainWindow::updateMenus()\n{\n    QTextCursor cursor = editor->textCursor();\n    cutAction->setEnabled(cursor.hasSelection());\n    copyAction->setEnabled(cursor.hasSelection());\n\n    pasteAction->setEnabled(!selection.isEmpty());\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-selections/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n#include <QTextDocumentFragment>\n\nclass QAction;\nclass QTextDocument;\nclass QTextEdit;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void cutSelection();\n    void copySelection();\n    void openFile();\n    void pasteSelection();\n    void selectWord();\n    void selectLine();\n    void selectBlock();\n    void selectFrame();\n    void updateMenus();\n\nprivate:\n    QAction *cutAction;\n    QAction *copyAction;\n    QAction *pasteAction;\n    QString currentFile;\n    QTextEdit *editor;\n    QTextDocument *document;\n    QTextDocumentFragment selection;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-tables/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"mainwindow.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    MainWindow *window = new MainWindow;\n    window->resize(480, 480);\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n###########################################################################\n\n//! [0] //! [1]\n    cursor = QTextCursor(editor.textCursor())\n//! [0]\n    cursor.movePosition(QTextCursor.Start)\n//! [1]\n\n//! [2]\n    tableFormat = QTextTableFormat()\n    tableFormat.setBackground(QColor(\"#e0e0e0\"))\n    QVector<QTextLength> constraints\n    constraints << QTextLength(QTextLength.PercentageLength, 16)\n    constraints << QTextLength(QTextLength.PercentageLength, 28)\n    constraints << QTextLength(QTextLength.PercentageLength, 28)\n    constraints << QTextLength(QTextLength.PercentageLength, 28)\n    tableFormat.setColumnWidthConstraints(constraints)\n//! [3]\n    table = cursor.insertTable(rows, columns, tableFormat)\n//! [2] //! [3]\n\n//! [4]\n    cell = table.cellAt(0, 0)\n    cellCursor = cell.firstCursorPosition()\n    cellCursor.insertText(tr(\"Week\"), charFormat)\n//! [4]\n\n//! [5]\n    for column  in range(columns):\n        cell = table.cellAt(0, column)\n        cellCursor = cell.firstCursorPosition()\n        cellCursor.insertText(tr(\"Team %1\").arg(column), charFormat)\n    \n\n    for row in range(rows):\n        cell = table.cellAt(row, 0)\n        cellCursor = cell.firstCursorPosition()\n        cellCursor.insertText(tr(\"%1\").arg(row), charFormat)\n\n        for column in range(columns)\n            if (row-1) % 3 == column-1:\n//! [5] //! [6]\n                cell = table.cellAt(row, column)\n                cellCursor = cell.firstCursorPosition()\n                cellCursor.insertText(tr(\"On duty\"), charFormat)\n\n//! [6] //! [7]\n\n//! [7] //! [8]\n\n//! [8]\n\n//! [9]\n    for row in range(table.rows()):\n        for column in range(table.columns()):\n            tableCell = table.cellAt(row, column)\n//! [9]\n            QTextFrame.iterator it\n            QString text\n            for (it = tableCell.begin() !(it.atEnd()); ++it):\n                QTextBlock childBlock = it.currentBlock()\n                if (childBlock.isValid())\n                    text += childBlock.text()\n\n            Item = QTableWidgetItem(text)\n            tableWidget.setItem(row, column, Item)\n            \n//! [10]\n            processTableCell(tableCell)\n//! [10]\n            \n//! [11]\n\n//! [11] //! [12]\n\n//! [12]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-tables/mainwindow.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QMainWindow>\n\nclass QTextEdit;\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    MainWindow();\n\npublic slots:\n    void saveFile();\n    void showTable();\n\nprivate:\n    bool writeXml(const QString &fileName);\n\n    QTextEdit *editor;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-tables/xmlwriter.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"xmlwriter.h\"\n\nQDomDocument *XmlWriter::toXml()\n{\n    QDomImplementation implementation;\n    QDomDocumentType docType = implementation.createDocumentType(\n        \"scribe-document\", \"scribe\", \"qtsoftware.com/scribe\");\n\n    document = new QDomDocument(docType);\n\n    // ### This processing instruction is required to ensure that any kind\n    // of encoding is given when the document is written.\n    QDomProcessingInstruction process = document->createProcessingInstruction(\n        \"xml\", \"version=\\\"1.0\\\" encoding=\\\"utf-8\\\"\");\n    document->appendChild(process);\n\n    QDomElement documentElement = document->createElement(\"document\");\n    document->appendChild(documentElement);\n\n    QTextFrame *root = textDocument->rootFrame();\n    \n    if (root)\n        processFrame(documentElement, root);\n\n    return document;\n}\n\nvoid XmlWriter::processBlock(QDomElement &parent, const QTextBlock &block)\n{\n    QDomElement blockElement = document->createElement(\"block\");\n    blockElement.setAttribute(\"position\", block.position());\n    blockElement.setAttribute(\"length\", block.length());\n    parent.appendChild(blockElement);\n\n    QTextBlock::iterator it;\n    for (it = block.begin(); !(it.atEnd()); ++it) {\n        QTextFragment fragment = it.fragment();\n\n        if (fragment.isValid()) {\n            QDomElement fragmentElement = document->createElement(\"fragment\");\n            blockElement.appendChild(fragmentElement);\n\n            fragmentElement.setAttribute(\"length\", fragment.length());\n            QDomText fragmentText = document->createTextNode(fragment.text());\n\n            fragmentElement.appendChild(fragmentText);\n        }\n    }\n}\n\nvoid XmlWriter::processFrame(QDomElement &parent, QTextFrame *frame)\n{\n    QDomElement frameElement = document->createElement(\"frame\");\n    frameElement.setAttribute(\"begin\", frame->firstPosition());\n    frameElement.setAttribute(\"end\", frame->lastPosition());\n    parent.appendChild(frameElement);\n\n//! [0]\n    QTextFrame::iterator it;\n    for (it = frame->begin(); !(it.atEnd()); ++it) {\n\n        QTextFrame *childFrame = it.currentFrame();\n        QTextBlock childBlock = it.currentBlock();\n\n        if (childFrame) {\n            QTextTable *childTable = qobject_cast<QTextTable*>(childFrame);\n\n            if (childTable)\n                processTable(frameElement, childTable);\n            else\n                processFrame(frameElement, childFrame);\n\n        } else if (childBlock.isValid())\n//! [0] //! [1]\n            processBlock(frameElement, childBlock);\n    }\n//! [1]\n}\n\nvoid XmlWriter::processTable(QDomElement &parent, QTextTable *table)\n{\n    QDomElement element = document->createElement(\"table\");\n\n    for (int row = 0; row < table->rows(); ++row) {\n        for (int column = 0; column < table->columns(); ++column) {\n            QTextTableCell cell = table->cellAt(row, column);\n            processTableCell(element, cell);\n        }\n    }\n    parent.appendChild(element);\n}\n\nvoid XmlWriter::processTableCell(QDomElement &parent, const QTextTableCell &cell)\n{\n    QDomElement element = document->createElement(\"cell\");\n    element.setAttribute(\"row\", cell.row());\n    element.setAttribute(\"column\", cell.column());\n    \n    QTextFrame::iterator it;\n    for (it = cell.begin(); !(it.atEnd()); ++it) {\n\n        QTextFrame *childFrame = it.currentFrame();\n        QTextBlock childBlock = it.currentBlock();\n\n        if (childFrame)\n            processFrame(element, childFrame);\n        else if (childBlock.isValid())\n            processBlock(element, childBlock);\n    }\n    parent.appendChild(element);\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-tables/xmlwriter.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef XMLWRITER_H\n#define XMLWRITER_H\n\n#include <QDomDocument>\n\nclass QTextDocument;\n\nclass XmlWriter\n{\npublic:\n    XmlWriter(QTextDocument *document) : textDocument(document) {}\n    QDomDocument *toXml();\n\nprivate:\n    void processBlock(QDomElement &parent, const QTextBlock &block);\n    void processFrame(QDomElement &parent, QTextFrame *frame);\n    void processTable(QDomElement &parent, QTextTable *table);\n    void processTableCell(QDomElement &parent, const QTextTableCell &cell);\n\n    QDomDocument *document;\n    QTextDocument *textDocument;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocument-texttable/main.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n//! [0]\n    table.mergeCells(0, 0, 1, 2)\n//! [0] //! [1]\n    table.splitCell(0, 0, 1, 1)\n//! [1]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/textdocumentendsnippet.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <iostream.h>\n\nint main(int argv, char **args)\n{\n    QString contentString(\"One\\nTwp\\nThree\");\n\n    QTextDocument *doc = new QTextDocument(contentString);\n\n//! [0]\n    it = doc.begin()\n    while it != doc.end():\n        print it.text()\n        it = it.next()\n//! [0]\n\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/threads/threads.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QCache>\n#include <QMutex>\n#include <QThreadStorage>\n\n#include \"threads.h\"\n\n//! [0]\nvoid MyThread::run()\n//! [0] //! [1]\n{\n//! [1] //! [2]\n}\n//! [2]\n\n#define Counter ReentrantCounter\n\n//! [3]\nclass Counter\n//! [3] //! [4]\n{\npublic:\n    Counter() { n = 0; }\n\n    void increment() { ++n; }\n    void decrement() { --n; }\n    int value() const { return n; }\n\nprivate:\n    int n;\n};\n//! [4]\n\n#undef Counter\n#define Counter ThreadSafeCounter\n\n//! [5]\nclass Counter\n//! [5] //! [6]\n{\npublic:\n    Counter() { n = 0; }\n\n    void increment() { QMutexLocker locker(&mutex); ++n; }\n    void decrement() { QMutexLocker locker(&mutex); --n; }\n    int value() const { QMutexLocker locker(&mutex); return n; }\n\nprivate:\n    mutable QMutex mutex;\n    int n;\n};\n//! [6]\n\ntypedef int SomeClass;\n\n//! [7]\nQThreadStorage<QCache<QString, SomeClass> *> caches;\n\nvoid cacheObject(const QString &key, SomeClass *object)\n//! [7] //! [8]\n{\n    if (!caches.hasLocalData())\n        caches.setLocalData(new QCache<QString, SomeClass>);\n\n    caches.localData()->insert(key, object);\n}\n\nvoid removeFromCache(const QString &key)\n//! [8] //! [9]\n{\n    if (!caches.hasLocalData())\n        return;\n\n    caches.localData()->remove(key);\n}\n//! [9]\n\nint main()\n{\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/threads/threads.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QThread>\n\n//! [0]\nclass MyThread : public QThread\n{\n    Q_OBJECT\n\nprotected:\n    void run();\n};\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/timeline/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <math.h>\n\nint main(int argv, char *args[])\n{\n    QApplication app(argv, args)\n\n//! [0]\n    ball = QGraphicsEllipseItem(0, 0, 20, 20)\n    \n    timer = QTimeLine(5000)\n    timer.setFrameRange(0, 100)\n    \n    animation = QGraphicsItemAnimation()\n    animation.setItem(ball)\n    animation.setTimeLine(timer)\n\n    for i in range(200):\n        animation.setPosAt(i / 200.0, QPointF(i, i))\n\n    scene = QGraphicsScene()\n    scene.setSceneRect(0, 0, 250, 250)\n    scene.addItem(ball)\n\n    view = QGraphicsView(scene)\n    view.show()\n\n    timer.start()\n//! [0]\n\n    return app.exec()\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/timers/timers.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nfrom PySide.QtCore import QTimer\n\nclass Foo : public QObject\n{\npublic:\n    Foo()\n}\n\nFoo::Foo()\n{\n//! [0]\n    timer = QTimer(self)\n//! [0] //! [1]\n    timer.timeout.connect(self.updateCaption)\n//! [1] //! [2]\n    timer.start(1000)\n//! [2]\n\n//! [3]\n    QTimer.singleShot(200, self.updateCaption)\n//! [3]\n\n    {\n    // ZERO-CASE\n//! [4]\n    timer = QTimer(self)\n//! [4] //! [5]\n    timer.timeout.connect(self.processOneThing)\n//! [5] //! [6]\n    timer.start()\n//! [6]\n    }\n}\n\nint main()\n{\n\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/transform/main.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n###########################################################################\n\n\n//! [0]\ndef paintEvent(self, event)\n    painter = QPainter(self)\n    painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))\n    painter.drawRect(0, 0, 100, 100)\n\n    painter.rotate(45)\n\n    painter.setFont(QFont(\"Helvetica\", 24))\n    painter.setPen(QPen(Qt.black, 1))\n    painter.drawText(20, 10, \"QTransform\")\n//! [0]\n\n//! [1]\ndef paintEvent(self, event)\n    painter = QPainter(self)\n    painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))\n    painter.drawRect(0, 0, 100, 100)\n\n    transform = QTransform()\n    transform.translate(50, 50)\n    transform.rotate(45)\n    transform.scale(0.5, 1.0)\n    painter.setTransform(transform)\n\n    painter.setFont(QFont(\"Helvetica\", 24))\n    painter.setPen(QPen(Qt.black, 1))\n    painter.drawText(20, 10, \"QTransform\")\n//! [1]\n\n\n//! [2]\ndef paintEvent(self, event)\n    pi = 3.14\n\n    a    = pi/180 * 45.0\n    sina = sin(a)\n    cosa = cos(a)\n\n    translationTransform = QTransform(1, 0, 0, 1, 50.0, 50.0)\n    rotationTransform = QTransform(cosa, sina, -sina, cosa, 0, 0)\n    scalingTransform = QTransform(0.5, 0, 0, 1.0, 0, 0)\n\n    transform = QTransform()\n    transform = scalingTransform * rotationTransform * translationTransform\n\n    painter = QPainter(self)\n    painter.setPen(QPen(Qt.blue, 1, Qt.DashLine))\n    painter.drawRect(0, 0, 100, 100)\n\n    painter.setTransform(transform)\n\n    painter.setFont(QFont(\"Helvetica\", 24))\n    painter.setPen(QPen(Qt.black, 1))\n    painter.drawText(20, 10, \"QTransform\")\n\n//! [2]\n\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/uitools/calculatorform/calculatorform.ui",
    "content": "<ui version=\"4.0\" >\n <author></author>\n <comment></comment>\n <exportmacro></exportmacro>\n <class>CalculatorForm</class>\n <widget class=\"QWidget\" name=\"CalculatorForm\" >\n  <property name=\"objectName\" >\n   <string notr=\"true\" >CalculatorForm</string>\n  </property>\n  <property name=\"geometry\" >\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>276</width>\n    <height>98</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\" >\n   <sizepolicy>\n    <hsizetype>5</hsizetype>\n    <vsizetype>5</vsizetype>\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"windowTitle\" >\n   <string>Calculator Builder</string>\n  </property>\n  <layout class=\"QGridLayout\" >\n   <property name=\"objectName\" >\n    <string notr=\"true\" />\n   </property>\n   <property name=\"margin\" >\n    <number>9</number>\n   </property>\n   <property name=\"spacing\" >\n    <number>6</number>\n   </property>\n   <item row=\"0\" column=\"0\" >\n    <layout class=\"QHBoxLayout\" >\n     <property name=\"objectName\" >\n      <string notr=\"true\" />\n     </property>\n     <property name=\"margin\" >\n      <number>1</number>\n     </property>\n     <property name=\"spacing\" >\n      <number>6</number>\n     </property>\n     <item>\n      <layout class=\"QVBoxLayout\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" />\n       </property>\n       <property name=\"margin\" >\n        <number>1</number>\n       </property>\n       <property name=\"spacing\" >\n        <number>6</number>\n       </property>\n       <item>\n        <widget class=\"QLabel\" name=\"label\" >\n         <property name=\"objectName\" >\n          <string notr=\"true\" >label</string>\n         </property>\n         <property name=\"geometry\" >\n          <rect>\n           <x>1</x>\n           <y>1</y>\n           <width>45</width>\n           <height>19</height>\n          </rect>\n         </property>\n         <property name=\"text\" >\n          <string>Input 1</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QSpinBox\" name=\"inputSpinBox1\" >\n         <property name=\"objectName\" >\n          <string notr=\"true\" >inputSpinBox1</string>\n         </property>\n         <property name=\"geometry\" >\n          <rect>\n           <x>1</x>\n           <y>26</y>\n           <width>45</width>\n           <height>25</height>\n          </rect>\n         </property>\n         <property name=\"mouseTracking\" >\n          <bool>true</bool>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <widget class=\"QLabel\" name=\"label_3\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >label_3</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>54</x>\n         <y>1</y>\n         <width>7</width>\n         <height>52</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>+</string>\n       </property>\n       <property name=\"alignment\" >\n        <set>Qt::AlignCenter</set>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <layout class=\"QVBoxLayout\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" />\n       </property>\n       <property name=\"margin\" >\n        <number>1</number>\n       </property>\n       <property name=\"spacing\" >\n        <number>6</number>\n       </property>\n       <item>\n        <widget class=\"QLabel\" name=\"label_2\" >\n         <property name=\"objectName\" >\n          <string notr=\"true\" >label_2</string>\n         </property>\n         <property name=\"geometry\" >\n          <rect>\n           <x>1</x>\n           <y>1</y>\n           <width>45</width>\n           <height>19</height>\n          </rect>\n         </property>\n         <property name=\"text\" >\n          <string>Input 2</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QSpinBox\" name=\"inputSpinBox2\" >\n         <property name=\"objectName\" >\n          <string notr=\"true\" >inputSpinBox2</string>\n         </property>\n         <property name=\"geometry\" >\n          <rect>\n           <x>1</x>\n           <y>26</y>\n           <width>45</width>\n           <height>25</height>\n          </rect>\n         </property>\n         <property name=\"mouseTracking\" >\n          <bool>true</bool>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <widget class=\"QLabel\" name=\"label_3_2\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" >label_3_2</string>\n       </property>\n       <property name=\"geometry\" >\n        <rect>\n         <x>120</x>\n         <y>1</y>\n         <width>7</width>\n         <height>52</height>\n        </rect>\n       </property>\n       <property name=\"text\" >\n        <string>=</string>\n       </property>\n       <property name=\"alignment\" >\n        <set>Qt::AlignCenter</set>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <layout class=\"QVBoxLayout\" >\n       <property name=\"objectName\" >\n        <string notr=\"true\" />\n       </property>\n       <property name=\"margin\" >\n        <number>1</number>\n       </property>\n       <property name=\"spacing\" >\n        <number>6</number>\n       </property>\n       <item>\n        <widget class=\"QLabel\" name=\"label_2_2_2\" >\n         <property name=\"objectName\" >\n          <string notr=\"true\" >label_2_2_2</string>\n         </property>\n         <property name=\"geometry\" >\n          <rect>\n           <x>1</x>\n           <y>1</y>\n           <width>37</width>\n           <height>17</height>\n          </rect>\n         </property>\n         <property name=\"text\" >\n          <string>Output</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QLabel\" name=\"outputWidget\" >\n         <property name=\"objectName\" >\n          <string notr=\"true\" >outputWidget</string>\n         </property>\n         <property name=\"geometry\" >\n          <rect>\n           <x>1</x>\n           <y>24</y>\n           <width>37</width>\n           <height>27</height>\n          </rect>\n         </property>\n         <property name=\"frameShape\" >\n          <enum>QFrame::Box</enum>\n         </property>\n         <property name=\"frameShadow\" >\n          <enum>QFrame::Sunken</enum>\n         </property>\n         <property name=\"text\" >\n          <string>0</string>\n         </property>\n         <property name=\"alignment\" >\n          <set>Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask</set>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n    </layout>\n   </item>\n   <item row=\"1\" column=\"0\" >\n    <spacer>\n     <property name=\"objectName\" >\n      <string notr=\"true\" >verticalSpacer</string>\n     </property>\n     <property name=\"geometry\" >\n      <rect>\n       <x>85</x>\n       <y>69</y>\n       <width>20</width>\n       <height>20</height>\n      </rect>\n     </property>\n     <property name=\"orientation\" >\n      <enum>Qt::Vertical</enum>\n     </property>\n     <property name=\"sizeHint\" >\n      <size>\n       <width>20</width>\n       <height>40</height>\n      </size>\n     </property>\n    </spacer>\n   </item>\n   <item row=\"0\" column=\"1\" >\n    <spacer>\n     <property name=\"objectName\" >\n      <string notr=\"true\" >horizontalSpacer</string>\n     </property>\n     <property name=\"geometry\" >\n      <rect>\n       <x>188</x>\n       <y>26</y>\n       <width>79</width>\n       <height>20</height>\n      </rect>\n     </property>\n     <property name=\"orientation\" >\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name=\"sizeHint\" >\n      <size>\n       <width>40</width>\n       <height>20</height>\n      </size>\n     </property>\n    </spacer>\n   </item>\n  </layout>\n </widget>\n <pixmapfunction></pixmapfunction>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/uitools/calculatorform/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\n#include \"ui_calculatorform.h\"\n//! [0]\n#include <QApplication>\n\n//! [1]\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QWidget *widget = new QWidget;\n    Ui::CalculatorForm ui;\n    ui.setupUi(widget);\n\n    widget->show();\n    return app.exec();\n}\n//! [1]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/updating-selections/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  main.cpp\n\n  A simple example that shows how selections can be used directly on a model.\n  It shows the result of some selections made using a table view.\n*/\n\n#include <QApplication>\n\n#include \"window.h\"\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QMainWindow *window = new MainWindow;\n    window->show();\n    window->resize(640, 480);\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/updating-selections/model.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef MODEL_H\n#define MODEL_H\n\n#include <QAbstractTableModel>\n#include <QStringList>\n#include <QVariant>\n\nclass TableModel : public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    TableModel(int rows = 1, int columns = 1, QObject *parent = 0);\n\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n    int columnCount(const QModelIndex &parent = QModelIndex()) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation,\n                        int role = Qt::DisplayRole) const;\n\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    bool setData(const QModelIndex &index, const QVariant &value,\n                 int role = Qt::EditRole);\n\n    bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());\n    bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());\n    bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());\n\nprivate:\n    QList<QStringList> rowList;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/updating-selections/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\n  window.cpp\n\n  A minimal subclass of QTableView with slots to allow the selection model\n  to be monitored.\n*/\n\n#include <QAbstractItemModel>\n#include <QItemSelection>\n#include <QItemSelectionModel>\n#include <QStatusBar>\n\n#include \"model.h\"\n#include \"window.h\"\n\nMainWindow::MainWindow(QWidget *parent)\n    : QMainWindow(parent)\n{\n    setWindowTitle(\"Selected items in a table model\");\n\n    model = new TableModel(8, 4, this);\n\n    table = new QTableView(this);\n    table->setModel(model);\n\n    selectionModel = table->selectionModel();\n    connect(selectionModel,\n        SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),\n        this, SLOT(updateSelection(const QItemSelection &, const QItemSelection &)));\n    connect(selectionModel,\n        SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),\n        this, SLOT(changeCurrent(const QModelIndex &, const QModelIndex &)));\n\n    statusBar();\n    setCentralWidget(table);\n}\n\n//! [0]\nvoid MainWindow::updateSelection(const QItemSelection &selected,\n    const QItemSelection &deselected)\n{\n    QModelIndex index;\n    QModelIndexList items = selected.indexes();\n\n    foreach (index, items) {\n        QString text = QString(\"(%1,%2)\").arg(index.row()).arg(index.column());\n        model->setData(index, text);\n//! [0] //! [1]\n    }\n//! [1]\n\n//! [2]\n    items = deselected.indexes();\n\n    foreach (index, items)\n        model->setData(index, \"\");\n}\n//! [2]\n\n//! [3]\nvoid MainWindow::changeCurrent(const QModelIndex &current,\n    const QModelIndex &previous)\n{\n    statusBar()->showMessage(\n        tr(\"Moved from (%1,%2) to (%3,%4)\")\n            .arg(previous.row()).arg(previous.column())\n            .arg(current.row()).arg(current.column()));\n}\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/updating-selections/window.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef WINDOW_H\n#define WINDOW_H\n\n#include <QItemSelection>\n#include <QMainWindow>\n#include <QModelIndex>\n#include <QWidget>\n#include <QTableView>\n\nclass MainWindow : public QMainWindow\n{\n    Q_OBJECT\npublic:\n    MainWindow(QWidget *parent = 0);\n\npublic slots:\n    void updateSelection(const QItemSelection &selected,\n                         const QItemSelection &deselected);\n    void changeCurrent(const QModelIndex &current, const QModelIndex &previous);\n\nprivate:\n    QAbstractItemModel *model;\n    QItemSelectionModel *selectionModel;\n    QTableView *table;\n};\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/videomedia.cpp",
    "content": "\n\n#include <QtGui>\n#include <phonon>\n\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n\n    Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, 0);\n\n//![0]\n    player->mediaObject()->isSeekable();\n//![0]\n\n    return app.exec();\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/volumeslider.cpp",
    "content": "#include <QtGui>\n\n#include <phonon/audiooutput.h>\n#include <phonon/mediaobject.h>\n#include <phonon/volumeslider.h>\n\nint main(int argv, char **args)\n{\n    QApplication app(argv, args);\n    app.setApplicationName(\"Volume slider tester\");\n\n    Phonon::MediaObject *mediaObject = new Phonon::MediaObject;\n    mediaObject->setCurrentSource(QString(\"/home/gvatteka/Music/Lumme-Badloop.ogg\"));\n\n//! [0]\n    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory);\n    Phonon::createPath(mediaObject, audioOutput);\n\n    Phonon::VolumeSlider *volumeSlider = new Phonon::VolumeSlider;\n    volumeSlider->setAudioOutput(audioOutput);\n//! [0]\n\n    mediaObject->play();\n    \n    volumeSlider->show();\n\n    return app.exec();\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/webkit/webpage/main.cpp",
    "content": "\nfrom PySide.QtGui import *\nfrom PySide.QWebKit import QWebPage\nfrom PySide.QWebKit import QWebFrame\n\n\n//! [0]\nclass Thumbnailer(QObject):\n    page = QWebPage()\n//! [1]\n    def __init__(self, url):\n        page.mainFrame().load(url)\n        connect(page, SIGNAL(\"loadFinished(bool)\"),\n                self, SLOT(\"render()\"))\n//! [1]\n\n//! [2]\n    def render(self):\n        page.setViewportSize(page.mainFrame().contentsSize())\n        image = QImage(page.viewportSize(), QImage.Format_ARGB32)\n        painter = QPainter(image)\n\n        page.mainFrame().render(painter)\n        painter.end()\n\n        thumbnail = image.scaled(400, 400)\n        thumbnail.save(\"thumbnail.png\")\n\n        self.finished()\n//! [2]\n\n//! [0]\n\ndef main():\n    app = QApplication([])\n    thumbnail = Thumbnailer(QUrl(\"http://qtsoftware.com\"))\n    QObject.connect(thumbnail, SIGNAL(\"finished()\"),\n                    app, SLOT(\"quit()\"))\n\n    return app.exec_()\n\n\n\n#include \"main.moc\"\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/whatsthis/whatsthis.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the documentation of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n//! [0]\n    Act = QAction(tr(\"&New\"), self)\n    Act.setShortcut(tr(\"Ctrl+N\"))\n    Act.setStatusTip(QObject.tr(\"Create a new file\"))\n    Act.setWhatsThis(QObject.tr(\"Click self option to create a new file.\"))\n//! [0]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/widget-mask/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n//! [0]\n    QLabel topLevelLabel;\n    QPixmap pixmap(\":/images/tux.png\");\n    topLevelLabel.setPixmap(pixmap);\n    topLevelLabel.setMask(pixmap.mask());\n//! [0]\n    topLevelLabel.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/widget-mask/mask.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource prefix=\"/images\" >\n   <file>tux.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/widgetdelegate.cpp",
    "content": "\n//![0]\nclass WidgetDelegate (QStyledItemDelegate):\n    # ...\n\n    def paint(painter, option, index):\n        if index.column() == 1:\n            progress = index.data().toInt()\n\n            progressBarOption = QStyleOptionProgressBar()\n            progressBarOption.rect = option.rect\n            progressBarOption.minimum = 0\n            progressBarOption.maximum = 100\n            progressBarOption.progress = progress\n            progressBarOption.text = QString::number(progress) + \"%\"\n            progressBarOption.textVisible = True\n\n            QApplication.style().drawControl(QStyle.CE_ProgressBar, progressBarOption, painter)\n        else:\n            QStyledItemDelegate.paint(self, painter, option, index)\n\n//![0]\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/widgets-tutorial/childwidget/main.cpp",
    "content": "#include <QtGui>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QWidget *window = new QWidget();\n    window->resize(320, 240);\n    window->setWindowTitle(tr(\"Child widget\"));\n    window->show();\n\n//! [create, position and show]\n    QPushButton *button = new QPushButton(tr(\"Press me\"), window);\n    button->move(100, 100);\n    button->show();\n//! [create, position and show]\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/widgets-tutorial/nestedlayouts/main.cpp",
    "content": "#include <QtGui>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QWidget *window = new QWidget();\n//! [create, lay out widgets and show]\n    QLabel *queryLabel = new QLabel(tr(\"Query:\"));\n    QLineEdit *queryEdit = new QLineEdit();\n    QTableView *resultView = new QTableView();\n\n    QHBoxLayout *queryLayout = new QHBoxLayout();\n    queryLayout->addWidget(queryLabel);\n    queryLayout->addWidget(queryEdit);\n\n    QVBoxLayout *mainLayout = new QVBoxLayout();\n    mainLayout->addLayout(queryLayout);\n    mainLayout->addWidget(resultView);\n    window->setLayout(mainLayout);\n//! [create, lay out widgets and show]\n\n    QStandardItemModel model;\n    model.setHorizontalHeaderLabels(QStringList() << tr(\"Name\") << tr(\"Office\"));\n    QList<QStringList> rows = QList<QStringList>()\n        << (QStringList() << \"Verne Nilsen\" << \"123\")\n        << (QStringList() << \"Carlos Tang\" << \"77\")\n        << (QStringList() << \"Bronwyn Hawcroft\" << \"119\")\n        << (QStringList() << \"Alessandro Hanssen\" << \"32\")\n        << (QStringList() << \"Andrew John Bakken\" << \"54\")\n        << (QStringList() << \"Vanessa Weatherley\" << \"85\")\n        << (QStringList() << \"Rebecca Dickens\" << \"17\")\n        << (QStringList() << \"David Bradley\" << \"42\")\n        << (QStringList() << \"Knut Walters\" << \"25\")\n        << (QStringList() << \"Andrea Jones\" << \"34\");\n    foreach (QStringList row, rows) {\n        QList<QStandardItem *> items;\n        foreach (QString text, row)\n            items.append(new QStandardItem(text));\n        model.appendRow(items);\n    }\n\n    resultView->setModel(&model);\n    resultView->verticalHeader()->hide();\n    resultView->horizontalHeader()->setStretchLastSection(true);\n    window->setWindowTitle(tr(\"Nested layouts\"));\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/widgets-tutorial/toplevel/main.cpp",
    "content": "#include <QtGui>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n//! [create, resize and show]\n    QWidget *window = new QWidget();\n    window->resize(320, 240);\n    window->show();\n//! [create, resize and show]\n    window->setWindowTitle(tr(\"Top-level widget\"));\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/widgets-tutorial/windowlayout/main.cpp",
    "content": "#include <QtGui>\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QWidget *window = new QWidget();\n//! [create, lay out widgets and show]\n    QLabel *label = new QLabel(tr(\"Name:\"));\n    QLineEdit *lineEdit = new QLineEdit();\n\n    QHBoxLayout *layout = new QHBoxLayout();\n    layout->addWidget(label);\n    layout->addWidget(lineEdit);\n    window->setLayout(layout);\n//! [create, lay out widgets and show]\n    window->setWindowTitle(tr(\"Window layout\"));\n    window->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/xml/rsslisting/handler.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\nhandler.cpp\n\nProvides a handler for processing XML elements found by the reader.\n\nThe handler looks for <title> and <link> elements within <item> elements,\nand records the text found within them. Link information stored within\nrdf:about attributes of <item> elements is also recorded when it is\navailable.\n\nFor each item found, a signal is emitted which specifies its title and\nlink information. This may be used by user interfaces for the purpose of\ndisplaying items as they are read.\n*/\n\n#include <QtGui>\n\n#include \"handler.h\"\n\n/*\n    Reset the state of the handler to ensure that new documents are\n    read correctly.\n\n    We return true to indicate that parsing should continue.\n*/\n\nbool Handler::startDocument()\n{\n    inItem = false;\n    inTitle = false;\n    inLink = false;\n\n    return true;\n}\n\n/*\n    Process each starting element in the XML document.\n\n    Nested item, title, or link elements are not allowed, so we return false\n    if we encounter any of these. We also prohibit multiple definitions of\n    title strings.\n\n    Link destinations are read by this function if they are specified as\n    attributes in item elements.\n\n    For all cases not explicitly checked for, we return true to indicate that\n    the element is acceptable, and that parsing should continue. By doing\n    this, we can ignore elements in which we are not interested.\n*/\n\nbool Handler::startElement(const QString &, const QString &,\n    const QString & qName, const QXmlAttributes &attr)\n{\n    if (qName == \"item\") {\n\n        if (inItem)\n            return false;\n        else {\n            inItem = true;\n            linkString = attr.value(\"rdf:about\");\n        }\n    }\n    else if (qName == \"title\") {\n\n        if (inTitle)\n            return false;\n        else if (!titleString.isEmpty())\n            return false;\n        else if (inItem)\n            inTitle = true;\n    }\n    else if (qName == \"link\") {\n\n        if (inLink)\n            return false;\n        else if (inItem)\n            inLink = true;\n    }\n\n    return true;\n}\n\n/*\n    Process each ending element in the XML document.\n\n    For recognized elements, we reset flags to ensure that we can read new\n    instances of these elements. If we have read an item element, emit a\n    signal to indicate that a new item is available for display.\n\n    We return true to indicate that parsing should continue.\n*/\n\nbool Handler::endElement(const QString &, const QString &,\n    const QString & qName)\n{\n    if (qName == \"title\" && inTitle)\n        inTitle = false;\n    else if (qName == \"link\" && inLink)\n        inLink = false;\n    else if (qName == \"item\") {\n        if (!titleString.isEmpty() && !linkString.isEmpty())\n            emit newItem(titleString, linkString);\n        inItem = false;\n        titleString = \"\";\n        linkString = \"\";\n    }\n\n    return true;\n}\n\n/*\n    Collect characters when reading the contents of title or link elements\n    when they occur within an item element.\n\n    We return true to indicate that parsing should continue.\n*/\n\nbool Handler::characters (const QString &chars)\n{\n    if (inTitle)\n        titleString += chars;\n    else if (inLink)\n        linkString += chars;\n\n    return true;\n}\n\n/*\n    Report a fatal parsing error, and return false to indicate to the reader\n    that parsing should stop.\n*/\n\n//! [0]\ndef fatalError(self, exception):\n    qWarning(\"Fatal error on line %d, column %d:%s\" % (exception.lineNumber(), exception.columnNumber(), exception.message())\n\n    return False\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/xml/rsslisting/handler.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef HANDLER_H\n#define HANDLER_H\n\n#include <QObject>\n#include <QString>\n#include <QXmlDefaultHandler>\n\n/* Note that QObject must precede QXmlDefaultHandler in the following list. */\n\nclass Handler : public QObject, public QXmlDefaultHandler\n{\n    Q_OBJECT\npublic:\n    bool startDocument();\n    bool startElement(const QString &, const QString &, const QString &qName,\n                       const QXmlAttributes &attr);\n    bool endElement(const QString &, const QString &, const QString &qName);\n    bool characters(const QString &chars);\n\n    bool fatalError(const QXmlParseException &exception);\n\nsignals:\n    void newItem(QString &title, QString &link);\n\nprivate:\n    QString titleString;\n    QString linkString;\n    bool inItem;\n    bool inTitle;\n    bool inLink;\n};\n\n#endif\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/xml/rsslisting/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\nmain.cpp\n\nProvides the main function for the RSS news reader example.\n*/\n\n#include <QtGui>\n\n#include \"rsslisting.h\"\n\n/*!\n    Create an application and a main widget. Open the main widget for\n    user input, and exit with an appropriate return value when it is\n    closed.\n*/\n\nint main(int argc, char **argv)\n{\n    QApplication app(argc, argv);\n    RSSListing *rsslisting = new RSSListing;\n    rsslisting->show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/xml/rsslisting/rsslisting.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\nrsslisting.cpp\n\nProvides a widget for displaying news items from RDF news sources.\nRDF is an XML-based format for storing items of information (see\nhttp://www.w3.org/RDF/ for details).\n\nThe widget itself provides a simple user interface for specifying\nthe URL of a news source, and controlling the downloading of news.\n\nThe widget downloads and parses the XML asynchronously, feeding the\ndata to an XML reader in pieces. This allows the user to interrupt\nits operation, and also allows very large data sources to be read.\n*/\n\n\n#include <QtCore>\n#include <QtGui>\n#include <QtNetwork>\n#include <QtXml>\n\n#include \"rsslisting.h\"\n\n\n/*\n    Constructs an RSSListing widget with a simple user interface, and sets\n    up the XML reader to use a custom handler class.\n\n    The user interface consists of a line edit, two push buttons, and a\n    list view widget. The line edit is used for entering the URLs of news\n    sources; the push buttons start and abort the process of reading the\n    news.\n*/\n\nRSSListing::RSSListing(QWidget *parent)\n    : QWidget(parent)\n{\n    lineEdit = new QLineEdit(this);\n\n    fetchButton = new QPushButton(tr(\"Fetch\"), this);\n    abortButton = new QPushButton(tr(\"Abort\"), this);\n    abortButton->setEnabled(false);\n\n    treeWidget = new QTreeWidget(this);\n    QStringList headerLabels;\n    headerLabels << tr(\"Title\") << tr(\"Link\");\n    treeWidget->setHeaderLabels(headerLabels);\n\n    handler = 0;\n\n    connect(&http, SIGNAL(readyRead(const QHttpResponseHeader &)),\n             this, SLOT(readData(const QHttpResponseHeader &)));\n\n    connect(&http, SIGNAL(requestFinished(int, bool)),\n             this, SLOT(finished(int, bool)));\n\n    connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(fetch()));\n    connect(fetchButton, SIGNAL(clicked()), this, SLOT(fetch()));\n    connect(abortButton, SIGNAL(clicked()), &http, SLOT(abort()));\n\n    QVBoxLayout *layout = new QVBoxLayout(this);\n\n    QHBoxLayout *hboxLayout = new QHBoxLayout;\n\n    hboxLayout->addWidget(lineEdit);\n    hboxLayout->addWidget(fetchButton);\n    hboxLayout->addWidget(abortButton);\n\n    layout->addLayout(hboxLayout);\n    layout->addWidget(treeWidget);\n\n    setWindowTitle(tr(\"RSS listing example\"));\n}\n\n/*\n    Starts fetching data from a news source specified in the line\n    edit widget.\n\n    The line edit is made read only to prevent the user from modifying its\n    contents during the fetch; this is only for cosmetic purposes.\n    The fetch button is disabled, and the abort button is enabled to allow\n    the user to interrupt processing. The list view is cleared, and we\n    define the last list view item to be 0, meaning that there are no\n    existing items in the list.\n\n    We reset the flag used to determine whether parsing should begin again\n    or continue. A new handler is created, if required, and made available\n    to the reader.\n\n    The HTTP handler is supplied with the raw contents of the line edit and\n    a fetch is initiated. We keep the ID value returned by the HTTP handler\n    for future reference.\n*/\n\nvoid RSSListing::fetch()\n{\n    lineEdit->setReadOnly(true);\n    fetchButton->setEnabled(false);\n    abortButton->setEnabled(true);\n    treeWidget->clear();\n\n    lastItemCreated = 0;\n\n    newInformation = true;\n\n    if (handler != 0)\n        delete handler;\n    handler = new Handler;\n\n//! [0]\n    xmlReader.setContentHandler(handler)\n    xmlReader.setErrorHandler(handler)\n//! [0]\n\n    connect(handler, SIGNAL(newItem(QString &, QString &)),\n             this, SLOT(addItem(QString &, QString &)));\n\n    QUrl url(lineEdit->text());\n\n    http.setHost(url.host());\n    connectionId = http.get(url.path());\n}\n\n/*\n    Reads data received from the RDF source.\n\n    We read all the available data, and pass it to the XML\n    input source. The first time we receive new information,\n    the reader is set up for a new incremental parse;\n    we continue parsing using a different function on\n    subsequent calls involving the same data source.\n\n    If parsing fails for any reason, we abort the fetch.\n*/\n\n//! [1]\ndef readData(self, resp):\n    if resp.statusCode() != 200:\n        self.http.abort()\n    else:\n        xmlInput.setData(self.http.readAll())\n\n        if newInformation:\n            ok = xmlReader.parse(xmlInput, True)\n            newInformation = False\n        else:\n            ok = xmlReader.parseContinue()\n\n        if not ok:\n            self.http.abort()\n//! [1]\n\n/*\n    Finishes processing an HTTP request.\n\n    The default behavior is to keep the text edit read only.\n\n    If an error has occurred, the user interface is made available\n    to the user for further input, allowing a new fetch to be\n    started.\n\n    If the HTTP get request has finished, we perform a final\n    parsing operation on the data returned to ensure that it was\n    well-formed. Whether this is successful or not, we make the\n    user interface available to the user for further input.\n*/\n\nvoid RSSListing::finished(int id, bool error)\n{\n    if (error) {\n        qWarning(\"Received error during HTTP fetch.\");\n        lineEdit->setReadOnly(false);\n        abortButton->setEnabled(false);\n        fetchButton->setEnabled(true);\n    }\n    else if (id == connectionId) {\n\n        bool ok = xmlReader.parseContinue();\n        if (!ok)\n            qWarning(\"Parse error at the end of input.\");\n\n        lineEdit->setReadOnly(false);\n        abortButton->setEnabled(false);\n        fetchButton->setEnabled(true);\n    }\n}\n\n/*\n    Adds an item to the list view as it is reported by the handler.\n\n    We keep a record of the last item created to ensure that the\n    items are created in sequence.\n*/\n\nvoid RSSListing::addItem(QString &title, QString &link)\n{\n    QTreeWidgetItem *item;\n\n    item = new QTreeWidgetItem(treeWidget, lastItemCreated);\n    item->setText(0, title);\n    item->setText(1, link);\n\n    lastItemCreated = item;\n}\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/xml/rsslisting/rsslisting.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef RSSLISTING_H\n#define RSSLISTING_H\n\n#include <QHttp>\n#include <QWidget>\n#include <QXmlInputSource>\n#include <QXmlSimpleReader>\n\n#include \"handler.h\"\n\nclass QLineEdit;\nclass QTreeWidget;\nclass QTreeWidgetItem;\nclass QPushButton;\n\nclass RSSListing : public QWidget\n{\n    Q_OBJECT\npublic:\n    RSSListing(QWidget *widget = 0);\n\npublic slots:\n    void addItem(QString &title, QString &link);\n    void fetch();\n    void finished(int id, bool error);\n    void readData(const QHttpResponseHeader &);\n\nprivate:\n    Handler *handler;\n    QXmlInputSource xmlInput;\n    QXmlSimpleReader xmlReader;\n\n    bool newInformation;\n\n    QHttp http;\n    int connectionId;\n\n    QLineEdit *lineEdit;\n    QTreeWidget *treeWidget;\n    QTreeWidgetItem *lastItemCreated;\n    QPushButton *abortButton;\n    QPushButton *fetchButton;\n};\n\n#endif\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/xml/simpleparse/handler.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n/*\nhandler.cpp\n\nProvides a handler for processing XML elements found by the reader.\n\nThe handler stores the names of elements it finds and their indentation\nlevels. The indentation level is initially set to zero.\nWhen a starting element is found, the indentation level is increased;\nwhen an ending element is found, the indentation level is decreased.\n*/\n\n#include <QDebug>\n#include \"handler.h\"\n\n/*!\n    Reset the state of the handler to ensure that new documents are\n    read correctly.\n\n    We return true to indicate that parsing should continue.\n*/\n\nbool Handler::startDocument()\n{\n    elementName.clear();\n    elementIndentation.clear();\n    indentationLevel = 0;\n\n    return true;\n}\n\n/*!\n    Process each starting element in the XML document.\n\n    Append the element name to the list of elements found; add its\n    corresponding indentation level to the list of indentation levels.\n\n    Increase the level of indentation by one column.\n\n    We return true to indicate that parsing should continue.\n*/\n\nbool Handler::startElement(const QString &, const QString &,\n    const QString & qName, const QXmlAttributes &)\n{\n    elementName.append(qName);\n    elementIndentation.append(indentationLevel);\n    indentationLevel += 1;\n\n    return true;\n}\n\n/*!\n    Process each ending element in the XML document.\n\n    Decrease the level of indentation by one column.\n\n    We return true to indicate that parsing should continue.\n*/\n\nbool Handler::endElement(const QString &, const QString &,\n    const QString &)\n{\n    indentationLevel -= 1;\n\n    return true;\n}\n\n/*!\n    Report a fatal parsing error, and return false to indicate to the reader\n    that parsing should stop.\n*/\n\nbool Handler::fatalError (const QXmlParseException & exception)\n{\n    qWarning() << QString(\"Fatal error on line %1, column %2: %3\").arg(\n        exception.lineNumber()).arg(exception.columnNumber()).arg(\n        exception.message());\n\n    return false;\n}\n\n/*!\n    Return the list of element names found.\n*/\n\nQStringList& Handler::names ()\n{\n    return elementName;\n}\n\n/*!\n    Return the list of indentations used for each element found.\n*/\n\nQList<int>& Handler::indentations ()\n{\n    return elementIndentation;\n}\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/xml/simpleparse/handler.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef HANDLER_H\n#define HANDLER_H\n\n#include <qstring.h>\n#include <qxml.h>\n\nclass Handler : public QXmlDefaultHandler\n{\npublic:\n    bool startDocument();\n    bool startElement(const QString &, const QString &, const QString &qName,\n                       const QXmlAttributes &);\n    bool endElement(const QString &, const QString &, const QString &);\n\n    bool fatalError(const QXmlParseException &exception);\n\n    QStringList& names();\n    QList<int>& indentations();\n\nprivate:\n    int indentationLevel;\n    QStringList elementName;\n    QList<int> elementIndentation;\n};\n\n#endif\n\n"
  },
  {
    "path": "doc/codesnippets/doc/src/snippets/xml/simpleparse/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <qfile.h>\n#include <qxml.h>\n#include \"handler.h\"\n\n#include <iostream>\n\nint main(int argc, char **argv)\n{\n    if (argc != 2) {\n        std::cout << \"Usage: \" << argv[0] << \" <filename>\" << std::endl;\n        return 1;\n    }\n\n    QFile *file = new QFile(argv[1]);\n\n//! [0]\n    xmlReader = QXmlSimpleReader()\n    source = QXmlInputSource(filename)\n//! [0]\n\n//! [1]\n    handler = Handler()\n    xmlReader.setContentHandler(handler)\n    xmlReader.setErrorHandler(handler)\n//! [1]\n\n//! [2]\n    ok = xmlReader.parse(source)\n\n    if not ok:\n        print \"Parsing failed.\"\n//! [2]\n    else {\n        QStringList names = handler->names();\n        QList<int> indentations = handler->indentations();\n\n        int items = names.count();\n\n        for (int i = 0; i < items; ++i) {\n            for (int j = 0; j < indentations[i]; ++j)\n                std::cout << \" \";\n            std::cout << names[i].toLocal8Bit().constData() << std::endl;\n        }\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "doc/codesnippets/examples/dbus/example-client.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# DBUS Client using PySide integration\n\nimport sys\nfrom traceback import print_exc\n\n# import python dbus module\nimport dbus\n# import python dbus GLib mainloop support\nimport dbus.mainloop.glib\n# import QtCore\nfrom PySide.QtCore import *\n\n# signal handler\ndef button_clicked():\n    print \"button clicked\"\n\n# main function\nif __name__ == '__main__':\n\n    # Enable glib main loop support\n    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n    # Get the session bus\n    bus = dbus.SessionBus()\n\n    try:\n        # Get the remote object\n        remote_object = bus.get_object(\"com.example.SampleService\",\n                                       \"/DBusWidget\")\n        # Get the remote interface for the remote object\n        iface = dbus.Interface(remote_object, \"com.example.SampleWidget\")\n    except dbus.DBusException:\n        print_exc()\n        sys.exit(1)\n\n    # Start the application\n    app = QCoreApplication([])\n\n    # Call some methods of the remote interface\n    iface.show()\n    iface.setText(\"Emit signal\")\n    # connect the DBus signal clicked to the function button_clicked\n    iface.connect_to_signal(\"clicked\", button_clicked)\n    iface.connect_to_signal(\"lastWindowClosed\", app.quit)\n\n    # enter in the main loop\n    app.exec_()\n"
  },
  {
    "path": "doc/codesnippets/examples/dbus/example-server.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# DBUS Server Example of use PySide with PyDBus library\n\nimport dbus\nimport dbus.service\nimport dbus.mainloop.glib\nimport random\n\nfrom PySide.QtCore import *\nfrom PySide.QtGui import QPushButton, QApplication\n\n# The adaptor, MUST inherit dbus.service.Object\nclass DBusWidget(dbus.service.Object):\n    def __init__(self, name, session):\n        # export this object to dbus\n        dbus.service.Object.__init__(self, name, session)\n\n        # create a simple widget\n        self.widget = QPushButton()\n        self.widget.resize(200, 50)\n\n        # To export a Qt signal as a DBus-signal, you need to connect it to a method in this class.\n        # The method MUST have the signal annotation, so python-dbus will export it as a dbus-signal\n        QObject.connect(self.widget, SIGNAL(\"clicked()\"), self.clicked)\n        QObject.connect(QApplication.instance(), SIGNAL(\"lastWindowClosed()\"), self.lastWindowClosed)\n\n    # You can export methods to dbus like you do in python-dbus.\n    @dbus.service.method(\"com.example.SampleWidget\", in_signature='', out_signature='')\n    def show(self):\n        self.widget.show()\n\n    # Another method... now with a parameter\n    @dbus.service.method(\"com.example.SampleWidget\", in_signature='s', out_signature='')\n    def setText(self, value):\n        self.widget.setText(value)\n\n    # Another one...\n    @dbus.service.method(\"com.example.SampleWidget\", in_signature='', out_signature='')\n    def exit(self):\n        qApp().quit()\n\n    # A signal that will be exported to dbus\n    @dbus.service.signal(\"com.example.SampleWidget\", signature='')\n    def clicked(self):\n        pass\n\n    # Another signal that will be exported to dbus\n    @dbus.service.signal(\"com.example.SampleWidget\", signature='')\n    def lastWindowClosed(self):\n        pass\n\n\nif __name__ == '__main__':\n    app = QApplication([])\n    # Use qt/glib mainloop integration to get dbus mainloop working\n    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n\n    session_bus = dbus.SessionBus()\n    # Export the service\n    name = dbus.service.BusName(\"com.example.SampleService\", session_bus)\n    # Export the object\n    widget = DBusWidget(session_bus, '/DBusWidget')\n\n    print \"Running example service.\"\n    app.exec_()\n\n"
  },
  {
    "path": "doc/codesnippets/examples/declarative/cppextensions/imageprovider/imageprovider-example.qml",
    "content": "import QtQuick 1.0\nimport \"ImageProviderCore\" // import the plugin that registers the color image provider\n\n//![0]\nColumn {\n    Image { source: \"image://colors/yellow\" }\n    Image { source: \"image://colors/red\" }\n}\n//![0]\n"
  },
  {
    "path": "doc/codesnippets/examples/declarative/cppextensions/imageprovider/imageprovider.cpp",
    "content": "//![0]\nclass ColorImageProvider (QDeclarativeImageProvider):\n    def __init__(self):\n        QDeclarativeImageProvider.__init__(self, QDeclarativeImageProvider.Pixmap)\n\n    def requestPixmap(id, size, requestedSize):\n        width = 100\n        height = 50\n\n        if size:\n            size.setWidth(width)\n            size.setHeight(height)\n\n        if requestedSize.width() > 0:\n            width = requestedSize.width()\n        if requestedSize.height() > 0:\n            height = requestedSize.height()\n\n        pixmap = QPixmap(width, height)\n        pixmap.fill(QColor(id).rgba())\n//![0]\n        # write the color name\n        painter = QPainter(pixmap)\n        f = painter.font()\n        f.setPixelSize(20)\n        painter.setFont(f)\n        painter.setPen(Qt.black)\n        if requestedSize.isValid():\n            painter.scale(requestedSize.width() / width, requestedSize.height() / height)\n        painter.drawText(QRectF(0, 0, width, height), Qt.AlignCenter, id)\n//![1]\n        return pixmap\n//![1]\n"
  },
  {
    "path": "doc/codesnippets/examples/declarative/cppextensions/plugins/plugin.cpp",
    "content": "\n//![0]\nclass TimeModel (QObject):\n    hour = Property(int, getHour, notify = timeChanged)\n    minute = Property(int, getMinute, notify = timeChanged)\n//![0]\n\n//![plugin]\nclass QExampleQmlPlugin (QDeclarativeExtensionPlugin):\n\n    def registerTypes(self, uri):\n        assert(uri == \"com.nokia.TimeExample\")\n        qmlRegisterType(TimeModel, uri, 1, 0, \"Time\")\n//![plugin]\n\n//![export]\n# This isn't supported by PySide yet.\n# Q_EXPORT_PLUGIN2(qmlqtimeexampleplugin, QExampleQmlPlugin);\n//![export]\n"
  },
  {
    "path": "doc/codesnippets/examples/declarative/cppextensions/plugins/plugins.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n//![0]\nimport com.nokia.TimeExample 1.0 // import types from the plugin\n\nClock { // this class is defined in QML (com/nokia/TimeExample/Clock.qml)\n\n    Time { // this class is defined in C++ (plugin.cpp)\n        id: time\n    }\n\n    hours: time.hour\n    minutes: time.minute\n}\n//![0]\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/classwizard/classwizard.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0] //! [1]\ndef __init__(self, parent):\n    QWizard.__init__(self, parent):\n    self.addPage(IntroPage())\n    self.addPage(ClassInfoPage())\n    self.addPage(CodeStylePage())\n    self.addPage(OutputFilesPage())\n    self.addPage(ConclusionPage())\n//! [0]\n\n    self.setPixmap(QWizard.BannerPixmap, QPixmap(\":/images/banner.png\"))\n    self.setPixmap(QWizard.BackgroundPixmap, QPixmap(\":/images/background.png\"))\n\n    self.setWindowTitle(self.tr(\"Class Wizard\"))\n//! [2]\n\n//! [1] //! [2]\n\n//! [3]\ndef accept(self):\n//! [3] //! [4]\n    className = self.field(\"className\")\n    baseClass = self.field(\"baseClass\")\n    macroName = self.field(\"macroName\")\n    baseInclude = self.field(\"baseInclude\")\n\n    outputDir = self.field(\"outputDir\")\n    header = self.field(\"header\")\n    implementation = self.field(\"implementation\")\n//! [4]\n\n...\n\n//! [5]\n    QDialog.accept(self)\n//! [5] //! [6]\n}\n//! [6]\n\n//! [7]\nclass IntroPage (QWizardPage):\n\n    def __init__(self, parent):\n        QWizardPage.__init__(self, parent)\n\n        self.setTitle(tr(\"Introduction\"))\n        self.setPixmap(QWizard.WatermarkPixmap, QPixmap(\":/images/watermark1.png\"))\n\n        label = QLabel(self.tr(\"This wizard will generate a skeleton C++ class \" \\\n                                    \"definition, including a few functions. You simply \" \\\n                                    \"need to specify the class name and set a few \" \\\n                                    \"options to produce a header file and an \" \\\n                                    \"implementation file for your new C++ class.\"))\n        label.setWordWrap(True)\n\n        layout = QVBoxLayout()\n        layout.addWidget(label)\n        self.setLayout(layout)\n}\n//! [7]\n\n//! [8] //! [9]\nclass ClassInfoPage(QWizardPage):\n\n    def __init__(self, parent):\n        QWizardPage.__init__(self, parent)\n//! [8]\n        self.setTitle(self.tr(\"Class Information\"))\n        self.setSubTitle(self.tr(\"Specify basic information about the class for which you \" \\\n                                 \"want to generate skeleton source code files.\"))\n        self.setPixmap(QWizard.LogoPixmap, QPixmap(\":/images/logo1.png\"))\n\n//! [10]\n        classNameLabel = QLabel(self.tr(\"&Class name:\"))\n        classNameLineEdit = QLineEdit()\n        classNameLabel.setBuddy(classNameLineEdit)\n\n        baseClassLabel = QLabel(self.tr(\"B&ase class:\"))\n        baseClassLineEdit = QLineEdit()\n        baseClassLabel.setBuddy(baseClassLineEdit)\n\n        qobjectMacroCheckBox = QCheckBox(self.tr(\"Generate Q_OBJECT &macro\"))\n\n//! [10]\n        groupBox = QGroupBox(self.tr(\"C&onstructor\"))\n//! [9]\n\n        qobjectCtorRadioButton = QRadioButton(self.tr(\"&QObject-style constructor\"))\n        qwidgetCtorRadioButton = QRadioButton(self.tr(\"Q&Widget-style constructor\"))\n        defaultCtorRadioButton = QRadioButton(self.tr(\"&Default constructor\"))\n        copyCtorCheckBox = QCheckBox(self.tr(\"&Generate copy constructor and operator=\"))\n\n        defaultCtorRadioButton.setChecked(True)\n\n        self.connect(defaultCtorRadioButton, SIGNAL(\"toggled(bool)\"),\n                copyCtorCheckBox, SLOT(\"setEnabled(bool)\"))\n\n//! [11] //! [12]\n        registerField(\"className*\", classNameLineEdit)\n        registerField(\"baseClass\", baseClassLineEdit)\n        registerField(\"qobjectMacro\", qobjectMacroCheckBox)\n//! [11]\n        registerField(\"qobjectCtor\", qobjectCtorRadioButton)\n        registerField(\"qwidgetCtor\", qwidgetCtorRadioButton)\n        registerField(\"defaultCtor\", defaultCtorRadioButton)\n        registerField(\"copyCtor\", copyCtorCheckBox)\n\n        groupBoxLayout = QVBoxLayout()\n//! [12]\n        groupBoxLayout.addWidget(qobjectCtorRadioButton)\n        groupBoxLayout.addWidget(qwidgetCtorRadioButton)\n        groupBoxLayout.addWidget(defaultCtorRadioButton)\n        groupBoxLayout.addWidget(copyCtorCheckBox)\n        groupBox.setLayout(groupBoxLayout)\n\n        layout = QGridLayout()\n        layout.addWidget(classNameLabel, 0, 0)\n        layout.addWidget(classNameLineEdit, 0, 1)\n        layout.addWidget(baseClassLabel, 1, 0)\n        layout.addWidget(baseClassLineEdit, 1, 1)\n        layout.addWidget(qobjectMacroCheckBox, 2, 0, 1, 2)\n        layout.addWidget(groupBox, 3, 0, 1, 2)\n        self.setLayout(layout)\n//! [13]\n\n//! [13]\n\n//! [14]\nclass CodeStylePage(QWizardPage):\n\n    def __init__(self, parent):\n        QWizardPage.__init__(self, parent)\n        self.setTitle(tr(\"Code Style Options\"))\n        self.setSubTitle(tr(\"Choose the formatting of the generated code.\"))\n        self.setPixmap(QWizard.LogoPixmap, QPixmap(\":/images/logo2.png\"))\n\n        commentCheckBox = QCheckBox(self.tr(\"&Start generated files with a comment\"))\n//! [14]\n        commentCheckBox.setChecked(True)\n\n        protectCheckBox = QCheckBox(self.tr(\"&Protect header file against multiple \" \\\n                                        \"inclusions\"))\n        protectCheckBox.setChecked(True)\n\n        macroNameLabel = QLabel(self.tr(\"&Macro name:\"))\n        macroNameLineEdit = QLineEdit()\n        macroNameLabel.setBuddy(macroNameLineEdit)\n\n        includeBaseCheckBox = QCheckBox(self.tr(\"&Include base class definition\"))\n        baseIncludeLabel = QLabel(self.tr(\"Base class include:\"))\n        baseIncludeLineEdit = QLineEdit()\n        baseIncludeLabel.setBuddy(baseIncludeLineEdit)\n\n        self.connect(protectCheckBox, SIGNAL(\"toggled(bool)\"),\n                    macroNameLabel, SLOT(\"setEnabled(bool)\"))\n        self.connect(protectCheckBox, SIGNAL(\"toggled(bool)\"),\n                    macroNameLineEdit, SLOT(\"setEnabled(bool)\"))\n        self.connect(includeBaseCheckBox, SIGNAL(\"toggled(bool)\"),\n                    baseIncludeLabel, SLOT(\"setEnabled(bool)\"))\n        self.connect(includeBaseCheckBox, SIGNAL(toggled(bool)),\n                    baseIncludeLineEdit, SLOT(\"setEnabled(bool)\"))\n\n        self.registerField(\"comment\", commentCheckBox)\n        self.registerField(\"protect\", protectCheckBox)\n        self.registerField(\"macroName\", macroNameLineEdit)\n        self.registerField(\"includeBase\", includeBaseCheckBox)\n        self.registerField(\"baseInclude\", baseIncludeLineEdit)\n\n        layout = QGridLayout()\n        layout.setColumnMinimumWidth(0, 20)\n        layout.addWidget(commentCheckBox, 0, 0, 1, 3)\n        layout.addWidget(protectCheckBox, 1, 0, 1, 3)\n        layout.addWidget(macroNameLabel, 2, 1)\n        layout.addWidget(macroNameLineEdit, 2, 2)\n        layout.addWidget(includeBaseCheckBox, 3, 0, 1, 3)\n        layout.addWidget(baseIncludeLabel, 4, 1)\n        layout.addWidget(baseIncludeLineEdit, 4, 2)\n//! [15]\n        self.setLayout(layout)\n}\n//! [15]\n\n//! [16]\n    def initializePage(self):\n        className = self.field(\"className\")\n        self.macroNameLineEdit.setText(className.upper() + \"_H\")\n\n        baseClass = self.field(\"baseClass\")\n\n        self.includeBaseCheckBox.setChecked(len(baseClass))\n        self.includeBaseCheckBox.setEnabled(len(baseClass))\n        self.baseIncludeLabel.setEnabled(len(baseClass))\n        self.baseIncludeLineEdit.setEnabled(len(baseClass))\n\n        if not baseClass:\n            self.baseIncludeLineEdit.clear()\n        elsif QRegExp(\"Q[A-Z].*\").exactMatch(baseClass):\n            baseIncludeLineEdit.setText(\"<\" + baseClass + \">\")\n        else:\n            baseIncludeLineEdit.setText(\"\\\"\" + baseClass.lower() + \".h\\\"\")\n//! [16]\n\n//! [17]\n    def initializePage(self):\n        className = field(\"className\")\n        self.headerLineEdit.setText(className.lower() + \".h\")\n        self.implementationLineEdit.setText(className.lower() + \".cpp\")\n        self.outputDirLineEdit.setText(QDir.convertSeparators(QDir.tempPath()))\n//! [17]\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/classwizard/classwizard.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n    <file>images/background.png</file>\n    <file>images/banner.png</file>\n    <file>images/logo1.png</file>\n    <file>images/logo2.png</file>\n    <file>images/logo3.png</file>\n    <file>images/watermark1.png</file>\n    <file>images/watermark2.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/classwizard/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QTranslator>\n#include <QLocale>\n#include <QLibraryInfo>\n\n#include \"classwizard.h\"\n\nint main(int argc, char *argv[])\n{\n    Q_INIT_RESOURCE(classwizard);\n    \n    QApplication app(argc, argv);\n\n    QString translatorFileName = QLatin1String(\"qt_\");\n    translatorFileName += QLocale::system().name();\n    QTranslator *translator = new QTranslator(&app);\n    if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))\n        app.installTranslator(translator);\n\n    ClassWizard wizard;\n    wizard.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/extension/finddialog.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the example classes of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\nfrom PySide.QtGui import *\n\n//! [0]\ndef __init__(self, parent):\n    QDialog.__init__(self, parent)\n    label = QLabel(self.tr(\"Find &what:\"))\n    lineEdit = QLineEdit()\n    label.setBuddy(lineEdit)\n\n    caseCheckBox = QCheckBox(self.tr(\"Match &case\"))\n    fromStartCheckBox = QCheckBox(self.tr(\"Search from &start\"))\n    fromStartCheckBox.setChecked(True)\n\n//! [1]\n    findButton = QPushButton(self.tr(\"&Find\"))\n    findButton.setDefault(True)\n\n    moreButton = QPushButton(self.tr(\"&More\"))\n    moreButton.setCheckable(True)\n//! [0]\n    moreButton.setAutoDefault(False)\n\n    buttonBox = QDialogButtonBox(Qt.Vertical)\n    buttonBox.addButton(findButton, QDialogButtonBox.ActionRole)\n    buttonBox.addButton(moreButton, QDialogButtonBox.ActionRole)\n//! [1]\n\n//! [2]\n    extension = QWidget()\n\n    wholeWordsCheckBox =  QCheckBox(self.tr(\"&Whole words\"))\n    backwardCheckBox =  QCheckBox(self.tr(\"Search &backward\"))\n    searchSelectionCheckBox =  QCheckBox(self.tr(\"Search se&lection\"))\n//! [2]\n\n//! [3]\n    connect(moreButton, SIGNAL(\"toggled(bool)\"), extension, SLOT(\"setVisible(bool)\"))\n\n    extensionLayout =  QVBoxLayout()\n    extensionLayout.setMargin(0)\n    extensionLayout.addWidget(wholeWordsCheckBox)\n    extensionLayout.addWidget(backwardCheckBox)\n    extensionLayout.addWidget(searchSelectionCheckBox)\n    extension.setLayout(extensionLayout)\n//! [3]\n\n//! [4]\n    topLeftLayout = QHBoxLayout()\n    topLeftLayout.addWidget(label)\n    topLeftLayout.addWidget(lineEdit)\n\n    leftLayout = QVBoxLayout()\n    leftLayout.addLayout(topLeftLayout)\n    leftLayout.addWidget(caseCheckBox)\n    leftLayout.addWidget(fromStartCheckBox)\n    leftLayout.addSself.tretch(1)\n\n    mainLayout = QGridLayout()\n    mainLayout.setSizeConsself.traint(QLayout.SetFixedSize)\n    mainLayout.addLayout(leftLayout, 0, 0)\n    mainLayout.addWidget(buttonBox, 0, 1)\n    mainLayout.addWidget(extension, 1, 0, 1, 2)\n    setLayout(mainLayout)\n\n    setWindowTitle(self.tr(\"Extension\"))\n//! [4] //! [5]\n    extension.hide()\n//! [5]\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/licensewizard/licensewizard.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"licensewizard.h\"\n\n//! [0] //! [1] //! [2]\n# class LicenseWizard\ndef __init__(self, parent)\n    QWizard(self, parent)\n//! [0]\n    self.setPage(self.Page_Intro, IntroPage())\n    self.setPage(self.Page_Evaluate, EvaluatePage())\n    self.setPage(self.Page_Register, RegisterPage())\n    self.setPage(self.Page_Details, DetailsPage())\n    self.setPage(self.Page_Conclusion, ConclusionPage())\n//! [1]\n\n    self.setStartId(self.Page_Intro);\n//! [2]\n\n//! [3]\n\n//! [3] //! [4]\n    self.setWizardStyle(QWizard.ModernStyle);\n\n//! [4] //! [5]\n    self.setOption(HaveHelpButton, True);\n//! [5] //! [6]\n    self.setPixmap(QWizard.LogoPixmap, QPixmap(\":/images/logo.png\"));\n\n//! [7]\n    connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));\n//! [7]\n\n    setWindowTitle(tr(\"License Wizard\"));\n//! [8]\n}\n//! [6] //! [8]\n\n//! [9] //! [10]\nvoid LicenseWizard::showHelp()\n//! [9] //! [11]\n{\n    static QString lastHelpMessage;\n\n    message = \"\"\n\n    switch (currentId()) {\n    case Page_Intro:\n        message = tr(\"The decision you make here will affect which page you \"\n                     \"get to see next.\");\n        break;\n//! [10] //! [11]\n    case Page_Evaluate:\n        message = tr(\"Make sure to provide a valid email address, such as \"\n                     \"toni.buddenbrook@example.de.\");\n        break;\n    case Page_Register:\n        message = tr(\"If you don't provide an upgrade key, you will be \"\n                     \"asked to fill in your details.\");\n        break;\n    case Page_Details:\n        message = tr(\"Make sure to provide a valid email address, such as \"\n                     \"thomas.gradgrind@example.co.uk.\");\n        break;\n    case Page_Conclusion:\n        message = tr(\"You must accept the terms and conditions of the \"\n                     \"license to proceed.\");\n        break;\n//! [12] //! [13]\n    default:\n        message = tr(\"This help is likely not to be of any help.\");\n    }\n//! [12]\n\n    if (lastHelpMessage == message)\n        message = tr(\"Sorry, I already gave what help I could. \"\n                     \"Maybe you should try asking a human?\");\n\n//! [14]\n    QMessageBox::information(this, tr(\"License Wizard Help\"), message);\n//! [14]\n\n    lastHelpMessage = message;\n//! [15]\n}\n//! [13] //! [15]\n\n//! [16]\nIntroPage::IntroPage(QWidget *parent)\n    : QWizardPage(parent)\n{\n    setTitle(tr(\"Introduction\"));\n    setPixmap(QWizard::WatermarkPixmap, QPixmap(\":/images/watermark.png\"));\n\n    topLabel = new QLabel(tr(\"This wizard will help you register your copy of \"\n                             \"<i>Super Product One</i>&trade; or start \"\n                             \"evaluating the product.\"));\n    topLabel->setWordWrap(true);\n\n    registerRadioButton = new QRadioButton(tr(\"&Register your copy\"));\n    evaluateRadioButton = new QRadioButton(tr(\"&Evaluate the product for 30 \"\n                                              \"days\"));\n    registerRadioButton->setChecked(true);\n\n    QVBoxLayout *layout = new QVBoxLayout;\n    layout->addWidget(topLabel);\n    layout->addWidget(registerRadioButton);\n    layout->addWidget(evaluateRadioButton);\n    setLayout(layout);\n}\n//! [16] //! [17]\n\n//! [18]\n# class IntroPage\ndef nextId(self):\n//! [17] //! [19]\n    if evaluateRadioButton.isChecked():\n        return LicenseWizard.Page_Evaluate\n    else:\n        return LicenseWizard.Page_Register\n//! [18] //! [19]\n\n//! [20]\nEvaluatePage::EvaluatePage(QWidget *parent)\n    : QWizardPage(parent)\n{\n    setTitle(tr(\"Evaluate <i>Super Product One</i>&trade;\"));\n    setSubTitle(tr(\"Please fill both fields. Make sure to provide a valid \"\n                   \"email address (e.g., john.smith@example.com).\"));\n\n    nameLabel = new QLabel(tr(\"N&ame:\"));\n    nameLineEdit = new QLineEdit;\n//! [20]\n    nameLabel->setBuddy(nameLineEdit);\n\n    emailLabel = new QLabel(tr(\"&Email address:\"));\n    emailLineEdit = new QLineEdit;\n    emailLineEdit->setValidator(new QRegExpValidator(QRegExp(\".*@.*\"), this));\n    emailLabel->setBuddy(emailLineEdit);\n\n//! [21]\n    registerField(\"evaluate.name*\", nameLineEdit);\n    registerField(\"evaluate.email*\", emailLineEdit);\n//! [21]\n\n    QGridLayout *layout = new QGridLayout;\n    layout->addWidget(nameLabel, 0, 0);\n    layout->addWidget(nameLineEdit, 0, 1);\n    layout->addWidget(emailLabel, 1, 0);\n    layout->addWidget(emailLineEdit, 1, 1);\n    setLayout(layout);\n//! [22]\n}\n//! [22]\n\n//! [23]\n# class EvaluatePage\ndef nextId(self):\n    return LicenseWizard.Page_Conclusion\n//! [23]\n\nRegisterPage::RegisterPage(QWidget *parent)\n    : QWizardPage(parent)\n{\n    setTitle(tr(\"Register Your Copy of <i>Super Product One</i>&trade;\"));\n    setSubTitle(tr(\"If you have an upgrade key, please fill in \"\n                   \"the appropriate field.\"));\n\n    nameLabel = new QLabel(tr(\"N&ame:\"));\n    nameLineEdit = new QLineEdit;\n    nameLabel->setBuddy(nameLineEdit);\n\n    upgradeKeyLabel = new QLabel(tr(\"&Upgrade key:\"));\n    upgradeKeyLineEdit = new QLineEdit;\n    upgradeKeyLabel->setBuddy(upgradeKeyLineEdit);\n\n    registerField(\"register.name*\", nameLineEdit);\n    registerField(\"register.upgradeKey\", upgradeKeyLineEdit);\n\n    QGridLayout *layout = new QGridLayout;\n    layout->addWidget(nameLabel, 0, 0);\n    layout->addWidget(nameLineEdit, 0, 1);\n    layout->addWidget(upgradeKeyLabel, 1, 0);\n    layout->addWidget(upgradeKeyLineEdit, 1, 1);\n    setLayout(layout);\n}\n\n//! [24]\n# class RegisterPage\ndef nextId(self):\n    if self.upgradeKeyLineEdit.text().isEmpty():\n        return LicenseWizard::Page_Details\n    else:\n        return LicenseWizard::Page_Conclusion\n//! [24]\n\nDetailsPage::DetailsPage(QWidget *parent)\n    : QWizardPage(parent)\n{\n    setTitle(tr(\"Fill In Your Details\"));\n    setSubTitle(tr(\"Please fill all three fields. Make sure to provide a valid \"\n                   \"email address (e.g., tanaka.aya@example.co.jp).\"));\n\n    companyLabel = new QLabel(tr(\"&Company name:\"));\n    companyLineEdit = new QLineEdit;\n    companyLabel->setBuddy(companyLineEdit);\n\n    emailLabel = new QLabel(tr(\"&Email address:\"));\n    emailLineEdit = new QLineEdit;\n    emailLineEdit->setValidator(new QRegExpValidator(QRegExp(\".*@.*\"), this));\n    emailLabel->setBuddy(emailLineEdit);\n\n    postalLabel = new QLabel(tr(\"&Postal address:\"));\n    postalLineEdit = new QLineEdit;\n    postalLabel->setBuddy(postalLineEdit);\n\n    registerField(\"details.company*\", companyLineEdit);\n    registerField(\"details.email*\", emailLineEdit);\n    registerField(\"details.postal*\", postalLineEdit);\n\n    QGridLayout *layout = new QGridLayout;\n    layout->addWidget(companyLabel, 0, 0);\n    layout->addWidget(companyLineEdit, 0, 1);\n    layout->addWidget(emailLabel, 1, 0);\n    layout->addWidget(emailLineEdit, 1, 1);\n    layout->addWidget(postalLabel, 2, 0);\n    layout->addWidget(postalLineEdit, 2, 1);\n    setLayout(layout);\n}\n\n//! [25]\n# class DetailsPage\ndef nextId(self):\n    return LicenseWizard.Page_Conclusion\n//! [25]\n\nConclusionPage::ConclusionPage(QWidget *parent)\n    : QWizardPage(parent)\n{\n    setTitle(tr(\"Complete Your Registration\"));\n    setPixmap(QWizard::WatermarkPixmap, QPixmap(\":/images/watermark.png\"));\n\n    bottomLabel = new QLabel;\n    bottomLabel->setWordWrap(true);\n\n    agreeCheckBox = new QCheckBox(tr(\"I agree to the terms of the license\"));\n\n    registerField(\"conclusion.agree*\", agreeCheckBox);\n\n    QVBoxLayout *layout = new QVBoxLayout;\n    layout->addWidget(bottomLabel);\n    layout->addWidget(agreeCheckBox);\n    setLayout(layout);\n}\n\n//! [26]\n#class ConclusionPage\ndef nextId(self):\n    return -1\n//! [26]\n\n//! [27]\n# class ConclusionPage\ndef initializePage(self):\n    if wizard().hasVisitedPage(LicenseWizard::Page_Evaluate):\n        licenseText = self.tr(\"<u>Evaluation License Agreement:</u> \" \\\n                         \"You can use this software for 30 days and make one \" \\\n                         \"backup, but you are not allowed to distribute it.\")\n    elsif wizard().hasVisitedPage(LicenseWizard.Page_Details):\n        licenseText = self.tr(\"<u>First-Time License Agreement:</u> \" \\\n                         \"You can use this software subject to the license \" \\\n                         \"you will receive by email.\")\n    else:\n        licenseText = self.tr(\"<u>Upgrade License Agreement:</u> \" \\\n                         \"This software is licensed under the terms of your \" \\\n                         \"current license.\")\n    }\n    bottomLabel.setText(licenseText)\n//! [27]\n\n//! [28]\nvoid ConclusionPage::setVisible(bool visible)\n{\n    QWizardPage::setVisible(visible);\n\n    if (visible) {\n//! [29]\n        self.wizard().setButtonText(QWizard.CustomButton1, self.tr(\"&Print\"))\n        self.wizard().setOption(QWizard.HaveCustomButton1, True)\n        self.connect(wizard(), SIGNAL(\"customButtonClicked(int)\"), self, SLOT(\"printButtonClicked()\"))\n//! [29]\n    } else {\n        wizard()->setOption(QWizard::HaveCustomButton1, false);\n        disconnect(wizard(), SIGNAL(customButtonClicked(int)),\n                   this, SLOT(printButtonClicked()));\n    }\n}\n//! [28]\n\nvoid ConclusionPage::printButtonClicked()\n{\n    QPrinter printer;\n    QPrintDialog dialog(&printer, this);\n    if (dialog.exec())\n        QMessageBox::warning(this, tr(\"Print License\"),\n                             tr(\"As an environmentally friendly measure, the \"\n                                \"license text will not actually be printed.\"));\n}\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/licensewizard/licensewizard.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef LICENSEWIZARD_H\n#define LICENSEWIZARD_H\n\n#include <QWizard>\n\nQT_BEGIN_NAMESPACE\nclass QCheckBox;\nclass QLabel;\nclass QLineEdit;\nclass QRadioButton;\nQT_END_NAMESPACE\n\n//! [0] //! [1]\nclass LicenseWizard (QWizard):\n//! [0]\n//! [2]\n    Page_Intro = 1\n    Page_Evaluate = 2\n    Page_Register = 3\n    Page_Details = 4\n    Page_Conclusion = 5\n//! [2]\n\n    def __init__(self, parent):\n        ...\n\n    def showHelp(self):\n        ...\n//! [3]\n\n//! [1] //! [3]\n\n//! [4]\nclass IntroPage : public QWizardPage\n{\n    Q_OBJECT\n\npublic:\n    IntroPage(QWidget *parent = 0);\n\n    int nextId() const;\n\nprivate:\n    QLabel *topLabel;\n    QRadioButton *registerRadioButton;\n    QRadioButton *evaluateRadioButton;\n};\n//! [4]\n\n//! [5]\nclass EvaluatePage : public QWizardPage\n{\n    Q_OBJECT\n\npublic:\n    EvaluatePage(QWidget *parent = 0);\n\n    int nextId() const;\n\nprivate:\n    QLabel *nameLabel;\n    QLabel *emailLabel;\n    QLineEdit *nameLineEdit;\n    QLineEdit *emailLineEdit;\n};\n//! [5]\n\nclass RegisterPage : public QWizardPage\n{\n    Q_OBJECT\n\npublic:\n    RegisterPage(QWidget *parent = 0);\n\n    int nextId() const;\n\nprivate:\n    QLabel *nameLabel;\n    QLabel *upgradeKeyLabel;\n    QLineEdit *nameLineEdit;\n    QLineEdit *upgradeKeyLineEdit;\n};\n\nclass DetailsPage : public QWizardPage\n{\n    Q_OBJECT\n\npublic:\n    DetailsPage(QWidget *parent = 0);\n\n    int nextId() const;\n\nprivate:\n    QLabel *companyLabel;\n    QLabel *emailLabel;\n    QLabel *postalLabel;\n    QLineEdit *companyLineEdit;\n    QLineEdit *emailLineEdit;\n    QLineEdit *postalLineEdit;\n};\n\n//! [6]\nclass ConclusionPage : public QWizardPage\n{\n    Q_OBJECT\n\npublic:\n    ConclusionPage(QWidget *parent = 0);\n\n    void initializePage();\n    int nextId() const;\n    void setVisible(bool visible);\n\nprivate slots:\n    void printButtonClicked();\n\nprivate:\n    QLabel *bottomLabel;\n    QCheckBox *agreeCheckBox;\n};\n//! [6]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/licensewizard/licensewizard.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource>\n    <file>images/logo.png</file>\n    <file>images/watermark.png</file>\n</qresource>\n</RCC>\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/licensewizard/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QTranslator>\n#include <QLocale>\n#include <QLibraryInfo>\n\n#include \"licensewizard.h\"\n\nint main(int argc, char *argv[])\n{\n    Q_INIT_RESOURCE(licensewizard);\n\n    QApplication app(argc, argv);\n\n    QString translatorFileName = QLatin1String(\"qt_\");\n    translatorFileName += QLocale::system().name();\n    QTranslator *translator = new QTranslator(&app);\n    if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))\n        app.installTranslator(translator);\n    \n    LicenseWizard wizard;\n    wizard.show();\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the example classes of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\n    i = QInputDialog().getInteger(self, self.tr(\"QInputDialog().getInteger()\"),\n                                     self.tr(\"Percentage:\"), 25, 0, 100, 1, ok)\n    if ok:\n        self.integerLabel.setText(self.tr(\"%1%\").arg(i))\n//! [0]\n\n//! [1]\n    d = QInputDialog().getDouble(self, self.tr(\"QInputDialog().getDouble()\"),\n                                       self.tr(\"Amount:\"), 37.56, -10000, 10000, 2, ok)\n    if ok:\n        doubleLabel.setText(QString(\"$%1\").arg(d))\n//! [1]\n\n//! [2]\n    items = [self.tr(\"Spring\"), self.tr(\"Summer\"), self.tr(\"Fall\"), self.tr(\"Winter\")]\n\n    item = QInputDialog().getItem(self, self.tr(\"QInputDialog().getItem()\"),\n                                         selftr(\"Season:\"), items, 0, False, ok)\n    if ok and not item.isEmpty():\n        itemLabel.setText(item)\n//! [2]\n\n//! [3]\n    text = QInputDialog::getText(self, self.tr(\"QInputDialog().getText()\"),\n                                         self.tr(\"User name:\"), QLineEdit.Normal,\n                                         QDir().home().dirName(), ok)\n    if ok and text:\n        textLabel.setText(text)\n//! [3]\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/tabdialog/tabdialog.cpp",
    "content": "\n//! [0]\nclass TabDialog (QDialog):\n    def __init__(self, fileName, parent = None):\n        QDialog.__init__(self, parent)\n        fileInfo = QFileInfo(fileName)\n\n        self.tabWidget = QTabWidget()\n        self.tabWidget.addTab(GeneralTab(fileInfo), \"General\")\n        self.tabWidget.addTab(PermissionsTab(fileInfo), \"Permissions\")\n        self.tabWidget.addTab(ApplicationsTab(fileInfo), \"Applications\")\n//! [0]\n\n//! [1] //! [2]\n        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok\n//! [1] //! [3]\n                                     | QDialogButtonBox.Cancel)\n\n        self.buttonBox.accepted.connect(self.accept)\n        self.buttonBox.rejected.connect(self.reject)\n//! [2] //! [3]\n\n//! [4]\n        mainLayout = QVBoxLayout()\n        mainLayout.addWidget(tabWidget)\n        mainLayout.addWidget(buttonBox)\n        self.setLayout(mainLayout)\n//! [4]\n\n//! [5]\n        self.setWindowTitle(\"Tab Dialog\")\n//! [5]\n\n//! [6]\nclass GeneralTab (QWidget):\n    def __init__(self, fileInfo, parent = None):\n        QWidget.__init__(self, parent)\n        fileNameLabel = QLabel(\"File Name:\")\n        fileNameEdit = QLineEdit(fileInfo.fileName())\n\n        pathLabel = QLabel(\"Path:\")\n        pathValueLabel = QLabel(fileInfo.absoluteFilePath())\n        pathValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)\n\n        sizeLabel = QLabel(\"Size:\")\n        size = fileInfo.size()/1024\n        sizeValueLabel = QLabel(\"%d K\" % size)\n        sizeValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)\n\n        lastReadLabel = QLabel(\"Last Read:\")\n        lastReadValueLabel = QLabel(fileInfo.lastRead().toString())\n        lastReadValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)\n\n        lastModLabel = QLabel(\"Last Modified:\")\n        lastModValueLabel = QLabel(fileInfo.lastModified().toString())\n        lastModValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)\n\n        mainLayout = QVBoxLayout()\n        mainLayout.addWidget(fileNameLabel)\n        mainLayout.addWidget(fileNameEdit)\n        mainLayout.addWidget(pathLabel)\n        mainLayout.addWidget(pathValueLabel)\n        mainLayout.addWidget(sizeLabel)\n        mainLayout.addWidget(sizeValueLabel)\n        mainLayout.addWidget(lastReadLabel)\n        mainLayout.addWidget(lastReadValueLabel)\n        mainLayout.addWidget(lastModLabel)\n        mainLayout.addWidget(lastModValueLabel)\n        mainLayout.addStretch(1)\n        self.setLayout(mainLayout)\n//! [6]\n\n//! [7]\nclass PermissionsTab (QWidget):\n    def __init__(self, fileInfo, parent = None):\n        QWidget.__init__(self, parent)\n        permissionsGroup = QGroupBox(\"Permissions\")\n\n        readable = QCheckBox(\"Readable\")\n        if fileInfo.isReadable():\n            readable.setChecked(True)\n\n        writable = QCheckBox(\"Writable\")\n        if fileInfo.isWritable():\n            writable.setChecked(True)\n\n        executable = QCheckBox(\"Executable\")\n        if fileInfo.isExecutable():\n            executable.setChecked(True)\n\n        ownerGroup = QGroupBox(\"Ownership\")\n\n        ownerLabel = QLabel(\"Owner\")\n        ownerValueLabel = QLabel(fileInfo.owner())\n        ownerValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)\n\n        groupLabel = QLabel(\"Group\")\n        groupValueLabel = QLabel(fileInfo.group())\n        groupValueLabel.setFrameStyle(QFrame.Panel | QFrame.Sunken)\n\n        permissionsLayout = QVBoxLayout()\n        permissionsLayout.addWidget(readable)\n        permissionsLayout.addWidget(writable)\n        permissionsLayout.addWidget(executable)\n        permissionsGroup.setLayout(permissionsLayout)\n\n        ownerLayout = QVBoxLayout()\n        ownerLayout.addWidget(ownerLabel)\n        ownerLayout.addWidget(ownerValueLabel)\n        ownerLayout.addWidget(groupLabel)\n        ownerLayout.addWidget(groupValueLabel)\n        ownerGroup.setLayout(ownerLayout)\n\n        mainLayout = QVBoxLayout()\n        mainLayout.addWidget(permissionsGroup)\n        mainLayout.addWidget(ownerGroup)\n        mainLayout.addStretch(1)\n        self.setLayout(mainLayout)\n//! [7]\n\n//! [8]\nclass ApplicationsTab (QWidget):\n    def __init__(self, fileInfo, parent = None):\n        QWidget.__init__(self, parent)\n        topLabel = QLabel(\"Open with:\")\n\n        applicationsListBox = QListWidget()\n        applications = []\n\n        for i in range(30):\n            applications.append(\"Application %d\" %s i)\n        applicationsListBox.insertItems(0, applications)\n\n        if fileInfo.suffix().isEmpty():\n            alwaysCheckBox = QCheckBox(\"Always use this application to open this type of file\")\n        else:\n            alwaysCheckBox = QCheckBox(\"Always use this application to open files with the extension '%s'\" % fileInfo.suffix())\n\n        layout = QVBoxLayout()\n        layout.addWidget(topLabel)\n        layout.addWidget(applicationsListBox)\n        layout.addWidget(alwaysCheckBox)\n        self.setLayout(layout)\n//! [8]\n"
  },
  {
    "path": "doc/codesnippets/examples/dialogs/trivialwizard/trivialwizard.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QTranslator>\n#include <QLocale>\n#include <QLibraryInfo>\n\n//! [0] //! [1]\ndef createIntroPage(self):\n    page = QWizardPage()\n    page.setTitle(\"Introduction\")\n\n    label = QLabel(\"This wizard will help you register your copy of Super Product Two.\")\n    label.setWordWrap(True)\n\n    layout = QVBoxLayout()\n    layout.addWidget(label)\n    page.setLayout(layout)\n\n    return page\n//! [0]\n\n//! [2]\nQWizardPage *createRegistrationPage()\n//! [1] //! [3]\n\n//! [3]\n    QWizardPage *page = new QWizardPage;\n    page->setTitle(\"Registration\");\n    page->setSubTitle(\"Please fill both fields.\");\n\n    QLabel *nameLabel = new QLabel(\"Name:\");\n    QLineEdit *nameLineEdit = new QLineEdit;\n\n    QLabel *emailLabel = new QLabel(\"Email address:\");\n    QLineEdit *emailLineEdit = new QLineEdit;\n\n    QGridLayout *layout = new QGridLayout;\n    layout->addWidget(nameLabel, 0, 0);\n    layout->addWidget(nameLineEdit, 0, 1);\n    layout->addWidget(emailLabel, 1, 0);\n    layout->addWidget(emailLineEdit, 1, 1);\n    page->setLayout(layout);\n\n    return page;\n//! [4]\n\n//! [2] //! [4]\n\n//! [5] //! [6]\ndef createConclusionPage(self):\n//! [5] //! [7]\n\n//! [7]\n    QWizardPage *page = new QWizardPage;\n    page->setTitle(\"Conclusion\");\n\n    QLabel *label = new QLabel(\"You are now successfully registered. Have a \"\n                               \"nice day!\");\n    label->setWordWrap(true);\n\n    QVBoxLayout *layout = new QVBoxLayout;\n    layout->addWidget(label);\n    page->setLayout(layout);\n\n    return page;\n//! [8]\n\n//! [6] //! [8]\n\n//! [9] //! [10]\n\n//! [9] //! [11]\ndef main():\n    app = QApplication(sys.argv)\n\n    translatorFileName = \"qt_\"\n    translatorFileName += QLocale.system().name()\n    translator = QTranslator(app)\n    if translator.load(translatorFileName, QLibraryInfo.location(QLibraryInfo.TranslationsPath)):\n        app.installTranslator(translator)\n\n    wizard = QWizard()\n    wizard.addPage(createIntroPage())\n    wizard.addPage(createRegistrationPage())\n    wizard.addPage(createConclusionPage())\n\n    wizard.setWindowTitle(\"Trivial Wizard\")\n    wizard.show()\n\n    return app.exec_()\n\nif __name__ == \"__main__\":\n    main()\n//! [10] //! [11]\n"
  },
  {
    "path": "doc/codesnippets/examples/graphicsview/simpleanchorlayout/main.cpp",
    "content": "\n//! [adding a corner anchor in two steps]\nlayout.addAnchor(a, Qt.AnchorTop, layout, Qt.AnchorTop)\nlayout.addAnchor(a, Qt.AnchorLeft, layout, Qt.AnchorLeft)\n//! [adding a corner anchor in two steps]\n\n//! [adding a corner anchor]\nlayout.addCornerAnchors(a, Qt.TopLeftCorner, layout, Qt.TopLeftCorner)\n//! [adding a corner anchor]\n\n//! [adding anchors]\nlayout.addAnchor(b, Qt.AnchorLeft, a, Qt.AnchorRight)\nlayout.addAnchor(b, Qt.AnchorTop, a, Qt.AnchorBottom)\n//! [adding anchors]\n\n//! [adding anchors to match sizes in two steps]\nlayout.addAnchor(b, Qt.AnchorLeft, c, Qt.AnchorLeft)\nlayout.addAnchor(b, Qt.AnchorRight, c, Qt.AnchorRight)\n//! [adding anchors to match sizes in two steps]\n\n//! [adding anchors to match sizes]\nlayout.addAnchors(b, c, Qt.Horizontal)\n//! [adding anchors to match sizes]\n"
  },
  {
    "path": "doc/codesnippets/examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the example classes of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n//! [0]\ndef __init__(self, parent):\n    QSortFilterProxyModel.__init__(self, parent)\n//! [0]\n\n//! [1]\ndef setFilterMinimumDate(self, date):\n    self.minDate = date\n    self.invalidateFilter()\n\n//! [1]\n\n//! [2]\ndef setFilterMaximumDate(self, date):\n    self.maxDate = date\n    self.invalidateFilter()\n\n//! [2]\n\n//! [3]\ndef filterAcceptsRow(self, sourceRow, sourceParent):\n    index0 = sourceModel().index(sourceRow, 0, sourceParent)\n    index1 = sourceModel().index(sourceRow, 1, sourceParent)\n    index2 = sourceModel().index(sourceRow, 2, sourceParent)\n\n    regex = filterRegExp()\n    return (regex.indexIn(sourceModel().data(index0)) != -1\n            or regex.indexIn(sourceModel().data(index1)) != -1\n           and dateInRange(sourceModel().data(index2))\n//! [3]\n\n//! [4] //! [5]\ndef lessThan(self, left, right):\n    leftData = sourceModel().data(left)\n    rightData = sourceModel().data(right)\n//! [4]\n\n//! [6]\n    if isinstance(leftData, QDateTime):\n        return leftData < rightData\n    else:\n        emailPattern = QRegExp(\"([\\\\w\\\\.]*@[\\\\w\\\\.]*)\")\n\n        if left.column() == 1 && emailPattern.indexIn(leftData) != -1:\n            leftData = emailPattern.cap(1)\n\n        if right.column() == 1 && emailPattern.indexIn(rightData) != -1:\n            rightData = emailPattern.cap(1)\n\n        return leftString < rightString\n\n//! [5] //! [6]\n\n//! [7]\ndef dateInRange(self, date):\n    return (!minDate.isValid() || date > minDate)\n           && (!maxDate.isValid() || date < maxDate)\n\n//! [7]\n"
  },
  {
    "path": "doc/codesnippets/examples/itemviews/pixelator/pixeldelegate.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the example classes of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//! [0]\ndef __init__(self, parent):\n    QAbstractItemDelegate.__init__(self, parent)\n    self.pixelSize = 12\n//! [0]\n\n//! [1]\ndef paint(self, painter, option, index):\n//! [2]\n    if option.state and QStyle.State_Selected:\n        painter.fillRect(option.rect, option.palette.highlight())\n//! [1]\n\n//! [3]\n    size = qMin(option.rect.width(), option.rect.height())\n//! [3] //! [4]\n    brightness = index.model().data(index, Qt.DisplayRole).toInt()\n    radius = (size/2.0) - (brightness/255.0 * size/2.0)\n    if radius == 0.0:\n        return\n//! [4]\n\n//! [5]\n    painter.save()\n//! [5] //! [6]\n    painter.setRenderHint(QPainter.Antialiasing, true)\n//! [6] //! [7]\n    painter.setPen(Qt.NoPen)\n//! [7] //! [8]\n    if option.state and QStyle.State_Selected:\n//! [8] //! [9]\n        painter.setBrush(option.palette.highlightedText())\n    else\n//! [2]\n        painter.setBrush(QBrush(Qt.black))\n//! [9]\n\n//! [10]\n    painter.drawEllipse(QRectF(option.rect.x() + option.rect.width()/2 - radius,\n                                option.rect.y() + option.rect.height()/2 - radius,\n                                2*radius, 2*radius))\n    painter.restore()\n//! [10]\n\n//! [11]\ndef sizeHint(self, option, index):\n    return QSize(self.pixelSize, self.pixelSize)\n//! [11]\n\n//! [12]\ndef setPixelSize(self, size):\n    self.pixelSize = size\n//! [12]\n"
  },
  {
    "path": "doc/codesnippets/examples/itemviews/simpledommodel/dommodel.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n#include <QtXml>\n\n#include \"domitem.h\"\n#include \"dommodel.h\"\n\n//! [0]\nDomModel::DomModel(QDomDocument document, QObject *parent)\n    : QAbstractItemModel(parent), domDocument(document)\n{\n    rootItem = new DomItem(domDocument, 0);\n}\n//! [0]\n\n//! [1]\nDomModel::~DomModel()\n{\n    delete rootItem;\n}\n//! [1]\n\n//! [2]\ndef columnCount(self, parent):\n    return 3\n//! [2]\n\n//! [3]\nQVariant DomModel::data(const QModelIndex &index, int role) const\n{\n    if (!index.isValid())\n        return QVariant();\n\n    if (role != Qt::DisplayRole)\n        return QVariant();\n\n    DomItem *item = static_cast<DomItem*>(index.internalPointer());\n\n    QDomNode node = item->node();\n//! [3] //! [4]\n    QStringList attributes;\n    QDomNamedNodeMap attributeMap = node.attributes();\n\n    switch (index.column()) {\n        case 0:\n            return node.nodeName();\n        case 1:\n            for (int i = 0; i < attributeMap.count(); ++i) {\n                QDomNode attribute = attributeMap.item(i);\n                attributes << attribute.nodeName() + \"=\\\"\"\n                              +attribute.nodeValue() + \"\\\"\";\n            }\n            return attributes.join(\" \");\n        case 2:\n            return node.nodeValue().split(\"\\n\").join(\" \");\n        default:\n            return QVariant();\n    }\n}\n//! [4]\n\n//! [5]\nQt::ItemFlags DomModel::flags(const QModelIndex &index) const\n{\n    if (!index.isValid())\n        return 0;\n\n    return Qt::ItemIsEnabled | Qt::ItemIsSelectable;\n}\n//! [5]\n\n//! [6]\nQVariant DomModel::headerData(int section, Qt::Orientation orientation,\n                              int role) const\n{\n    if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {\n        switch (section) {\n            case 0:\n                return tr(\"Name\");\n            case 1:\n                return tr(\"Attributes\");\n            case 2:\n                return tr(\"Value\");\n            default:\n                return QVariant();\n        }\n    }\n\n    return QVariant();\n}\n//! [6]\n\n//! [7]\nQModelIndex DomModel::index(int row, int column, const QModelIndex &parent)\n            const\n{\n    if (!hasIndex(row, column, parent))\n        return QModelIndex();\n\n    DomItem *parentItem;\n\n    if (!parent.isValid())\n        parentItem = rootItem;\n    else\n        parentItem = static_cast<DomItem*>(parent.internalPointer());\n//! [7]\n\n//! [8]\n    DomItem *childItem = parentItem->child(row);\n    if (childItem)\n        return createIndex(row, column, childItem);\n    else\n        return QModelIndex();\n}\n//! [8]\n\n//! [9]\nQModelIndex DomModel::parent(const QModelIndex &child) const\n{\n    if (!child.isValid())\n        return QModelIndex();\n\n    DomItem *childItem = static_cast<DomItem*>(child.internalPointer());\n    DomItem *parentItem = childItem->parent();\n\n    if (!parentItem || parentItem == rootItem)\n        return QModelIndex();\n\n    return createIndex(parentItem->row(), 0, parentItem);\n}\n//! [9]\n\n//! [10]\nint DomModel::rowCount(const QModelIndex &parent) const\n{\n    if (parent.column() > 0)\n        return 0;\n\n    DomItem *parentItem;\n\n    if (!parent.isValid())\n        parentItem = rootItem;\n    else\n        parentItem = static_cast<DomItem*>(parent.internalPointer());\n\n    return parentItem->node().childNodes().count();\n}\n//! [10]\n"
  },
  {
    "path": "doc/codesnippets/examples/linguist/hellotr/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QApplication>\n#include <QPushButton>\n//! [0]\nfrom PySide.QtCore import QTranslator\n//! [0]\n\n//! [1] //! [2]\ndef main(args):\n//! [1] //! [3] //! [4]\n    app = QApplication(args)\n//! [3]\n\n//! [5]\n    translator = QTranslator()\n//! [5] //! [6]\n    translator.load(\"hellotr_la\")\n//! [6] //! [7]\n    app.installTranslator(translator)\n//! [4] //! [7]\n\n//! [8]\n    hello = QPushButton(QPushButton.tr(\"Hello world!\"))\n//! [8]\n    hello.resize(100, 30)\n\n    hello.show()\n    return app.exec_()\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/examples/mainwindows/application/mainwindow.cpp",
    "content": "######################################\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n# Contact: http://www.qt-project.org/legal\n#\n# This file is part of the example classes of the Qt Toolkit.\n#\n# $QT_BEGIN_LICENSE:LGPL$\n# Commercial License Usage\n# Licensees holding valid commercial Qt licenses may use this file in\n# accordance with the commercial license agreement provided with the\n# Software or, alternatively, in accordance with the terms contained in\n# a written agreement between you and Digia.  For licensing terms and\n# conditions see http://qt.digia.com/licensing.  For further information\n# use the contact form at http://qt.digia.com/contact-us.\n#\n# GNU Lesser General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU Lesser\n# General Public License version 2.1 as published by the Free Software\n# Foundation and appearing in the file LICENSE.LGPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU Lesser General Public License version 2.1 requirements\n# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n#\n# In addition, as a special exception, Digia gives you certain additional\n# rights.  These rights are described in the Digia Qt LGPL Exception\n# version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n#\n# GNU General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU\n# General Public License version 3.0 as published by the Free Software\n# Foundation and appearing in the file LICENSE.GPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU General Public License version 3.0 requirements will be\n# met: http://www.gnu.org/copyleft/gpl.html.\n#\n#\n# $QT_END_LICENSE$\n#\n######################################\n\n//! [0]\nfrom PySide.QtGui import *\n//! [0]\n\n//! [1]\ndef __init__(self):\n    QMainWindow.__init__(self)\n//! [1] //! [2]\n    textEdit =  QPlainTextEdit()\n    setCentralWidget(textEdit)\n\n    createActions()\n    createMenus()\n    createToolBars()\n    createStatusBar()\n\n    readSettings()\n\n    connect(textEdit.document(), SIGNAL(\"contentsChanged()\"),\n            self, SLOT(\"documentWasModified()\"))\n\n    setCurrentFile(\"\")\n    setUnifiedTitleAndToolBarOnMac(True)\n\n//! [2]\n\n//! [3]\ndef closeEvent(self, event):\n//! [3] //! [4]\n    if maybeSave():\n        writeSettings()\n        event.accept()\n    else:\n        event.ignore()\n//! [4]\n\n//! [5]\ndef File(self):\n//! [5] //! [6]\n    if maybeSave():\n        textEdit.clear()\n        setCurrentFile(\"\")\n//! [6]\n\n//! [7]\ndef open(self):\n//! [7] //! [8]\n    if maybeSave():\n        fileName = QFileDialog.getOpenFileName(self)\n        if !fileName.isEmpty():\n            loadFile(fileName)\n//! [8]\n\n//! [9]\ndef save(self):\n//! [9] //! [10]\n    if curFile.isEmpty():\n        return saveAs()\n    else:\n        return saveFile(curFile)\n//! [10]\n\n//! [11]\ndef saveAs(self):\n//! [11] //! [12]\n    fileName = QFileDialog.getSaveFileName(self)\n    if fileName.isEmpty():\n        return False\n\n    return saveFile(fileName)\n//! [12]\n\n//! [13]\ndef about(self):\n//! [13] //! [14]\n   QMessageBox.about(self, tr(\"About Application\"),\n            tr(\"The <b>Application</b> example demonstrates how to \"\n               \"write modern GUI applications using Qt, with a menu bar, \"\n               \"toolbars, and a status bar.\"))\n\n//! [14]\n\n//! [15]\ndef documentWasModified(self):\n//! [15] //! [16]\n    setWindowModified(textEdit.document().isModified())\n//! [16]\n\n//! [17]\ndef MainWindow.createActions(self):\n//! [17] //! [18]\n    Act = QAction(QIcon(\":/images/new.png\"), tr(\"&New\"), self)\n    Act.setShortcuts(QKeySequence.New)\n    Act.setStatusTip(tr(\"Create a new file\"))\n    connect(Act, SIGNAL(\"triggered()\"), self, SLOT(\"newFile()\"))\n\n//! [19]\n    openAct =  QAction(QIcon(\":/images/open.png\"), tr(\"&Open...\"), self)\n    openAct.setShortcuts(QKeySequence.Open)\n    openAct.setStatusTip(tr(\"Open an existing file\"))\n    connect(openAct, SIGNAL(\"triggered()\"), self, SLOT(\"open()\"))\n//! [18] //! [19]\n\n    saveAct =  QAction(QIcon(\":/images/save.png\"), tr(\"&Save\"), self)\n    saveAct.setShortcuts(QKeySequence.Save)\n    saveAct.setStatusTip(tr(\"Save the document to disk\"))\n    connect(saveAct, SIGNAL(\"triggered()\"), self, SLOT(\"save()\"))\n\n    saveAsAct =  QAction(tr(\"Save &As...\"), self)\n    saveAsAct.setShortcuts(QKeySequence.SaveAs)\n    saveAsAct.setStatusTip(tr(\"Save the document under a  name\"))\n    connect(saveAsAct, SIGNAL(\"triggered()\"), self, SLOT(\"saveAs()\"))\n\n//! [20]\n    exitAct =  QAction(tr(\"E&xit\"), self)\n    exitAct.setShortcut(tr(\"Ctrl+Q\"))\n//! [20]\n    exitAct.setStatusTip(tr(\"Exit the application\"))\n    connect(exitAct, SIGNAL(\"triggered()\"), self, SLOT(\"close()\"))\n\n//! [21]\n    cutAct =  QAction(QIcon(\":/images/cut.png\"), tr(\"Cu&t\"), self)\n//! [21]\n    cutAct.setShortcuts(QKeySequence.Cut)\n    cutAct.setStatusTip(tr(\"Cut the current selection's contents to the \"\n                            \"clipboard\"))\n    connect(cutAct, SIGNAL(\"triggered()\"), textEdit, SLOT(\"cut()\"))\n\n    copyAct =  QAction(QIcon(\":/images/copy.png\"), tr(\"&Copy\"), self)\n    copyAct.setShortcuts(QKeySequence.Copy)\n    copyAct.setStatusTip(tr(\"Copy the current selection's contents to the \"\n                             \"clipboard\"))\n    connect(copyAct, SIGNAL(\"triggered()\"), textEdit, SLOT(\"copy()\"))\n\n    pasteAct =  QAction(QIcon(\":/images/paste.png\"), tr(\"&Paste\"), self)\n    pasteAct.setShortcuts(QKeySequence.Paste)\n    pasteAct.setStatusTip(tr(\"Paste the clipboard's contents into the current \"\n                              \"selection\"))\n    connect(pasteAct, SIGNAL(\"triggered()\"), textEdit, SLOT(\"paste()\"))\n\n    aboutAct =  QAction(tr(\"&About\"), self)\n    aboutAct.setStatusTip(tr(\"Show the application's About box\"))\n    connect(aboutAct, SIGNAL(\"triggered()\"), self, SLOT(\"about()\"))\n\n//! [22]\n    aboutQtAct =  QAction(tr(\"About &Qt\"), self)\n    aboutQtAct.setStatusTip(tr(\"Show the Qt library's About box\"))\n    connect(aboutQtAct, SIGNAL(\"triggered()\"), qApp, SLOT(\"aboutQt()\"))\n//! [22]\n\n//! [23]\n    cutAct.setEnabled(False)\n//! [23] //! [24]\n    copyAct.setEnabled(False)\n    connect(textEdit, SIGNAL(\"copyAvailable(bool)\"),\n            cutAct, SLOT(\"setEnabled(bool)\"))\n    connect(textEdit, SIGNAL(\"copyAvailable(bool)\"),\n            copyAct, SLOT(\"setEnabled(bool)\"))\n}\n//! [24]\n\n//! [25] //! [26]\ndef createMenus(self):\n//! [25] //! [27]\n    fileMenu = menuBar().addMenu(tr(\"&File\"))\n    fileMenu.addAction(Act)\n//! [28]\n    fileMenu.addAction(openAct)\n//! [28]\n    fileMenu.addAction(saveAct)\n//! [26]\n    fileMenu.addAction(saveAsAct)\n    fileMenu.addSeparator()\n    fileMenu.addAction(exitAct)\n\n    editMenu = menuBar().addMenu(tr(\"&Edit\"))\n    editMenu.addAction(cutAct)\n    editMenu.addAction(copyAct)\n    editMenu.addAction(pasteAct)\n\n    menuBar().addSeparator()\n\n    helpMenu = menuBar().addMenu(tr(\"&Help\"))\n    helpMenu.addAction(aboutAct)\n    helpMenu.addAction(aboutQtAct)\n\n//! [27]\n\n//! [29] //! [30]\ndef createToolBars(self):\n    fileToolBar = addToolBar(tr(\"File\"))\n    fileToolBar.addAction(Act)\n//! [29] //! [31]\n    fileToolBar.addAction(openAct)\n//! [31]\n    fileToolBar.addAction(saveAct)\n\n    editToolBar = addToolBar(tr(\"Edit\"))\n    editToolBar.addAction(cutAct)\n    editToolBar.addAction(copyAct)\n    editToolBar.addAction(pasteAct)\n//! [30]\n\n//! [32]\ndef createStatusBar(self):\n//! [32] //! [33]\n    statusBar().showMessage(tr(\"Ready\"))\n\n//! [33]\n\n//! [34] //! [35]\ndef readSettings(self):\n//! [34] //! [36]\n    settings(\"Trolltech\", \"Application Example\")\n    pos = settings.value(\"pos\", QPoint(200, 200)).toPoint()\n    size = settings.value(\"size\", QSize(400, 400)).toSize()\n    resize(size)\n    move(pos)\n\n//! [35] //! [36]\n\n//! [37] //! [38]\ndef writeSettings(self):\n//! [37] //! [39]\n    settings = QSettings(\"Trolltech\", \"Application Example\")\n    settings.setValue(\"pos\", pos())\n    settings.setValue(\"size\", size())\n\n//! [38] //! [39]\n\n//! [40]\ndef maybeSave(self):\n//! [40] //! [41]\n    if textEdit.document()->isModified():\n        ret = QMessageBox.warning(self, tr(\"Application\"),\n                                  tr(\"The document has been modified.\\n\"\n                                     \"Do you want to save your changes?\"),\n                                 QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel)\n        if ret == QMessageBox.Save:\n            return save()\n        elif ret == QMessageBox.Cancel:\n            return False\n    return True\n//! [41]\n\n//! [42]\ndef loadFile(self, fileName):\n//! [42] //! [43]\n    file = QFile(fileName)\n    if !file.open(QFile.ReadOnly | QFile.Text):\n        QMessageBox.warning(self, tr(\"Application\"),\n                             tr(\"Cannot read file %1:\\n%2.\")\n                             .arg(fileName)\n                             .arg(file.errorString()))\n        return\n\n    in = QTextStream(file)\n    QApplication.setOverrideCursor(Qt::WaitCursor)\n    textEdit.setPlainText(in.readAll())\n    QApplication.restoreOverrideCursor()\n\n    setCurrentFile(fileName)\n    statusBar().showMessage(tr(\"File loaded\"), 2000)\n\n//! [43]\n\n//! [44]\ndef saveFile(self, fileName):\n//! [44] //! [45]\n    file = QFile(fileName)\n    if !file.open(QFile.WriteOnly | QFile::Text):\n        QMessageBox.warning(self, tr(\"Application\"),\n                             tr(\"Cannot write file %1:\\n%2.\")\n                             .arg(fileName)\n                             .arg(file.errorString()))\n        return False\n\n    out = QTextStream(file)\n    QApplication.setOverrideCursor(Qt.WaitCursor)\n    out << textEdit.toPlainText()\n    QApplication.restoreOverrideCursor()\n\n    setCurrentFile(fileName)\n    statusBar().showMessage(tr(\"File saved\"), 2000)\n    return True\n\n//! [45]\n\n//! [46]\ndef setCurrentFile(fileName):\n//! [46] //! [47]\n    curFile = fileName\n    textEdit.document().setModified(False)\n    setWindowModified(False)\n\n    if curFile.isEmpty():\n        shownName = \"untitled.txt\"\n    else:\n        shownName = strippedName(curFile)\n\n    setWindowTitle(tr(\"%1[*] - %2\").arg(shownName).arg(tr(\"Application\")))\n\n//! [47]\n\n//! [48]\ndef strippedName(self, fullFileName):\n//! [48] //! [49]\n    return QFileInfo(fullFileName).fileName()\n//! [49]\n"
  },
  {
    "path": "doc/codesnippets/examples/mainwindows/dockwidgets/mainwindow.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the example classes of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n//! [0]\nfrom PySide.QtGui import *\n//! [0]\n\n//! [1]\ndef __init__(self):\n    textEdit =  QTextEdit()\n    setCentralWidget(textEdit)\n\n    createActions()\n    createMenus()\n    createToolBars()\n    createStatusBar()\n    createDockWindows()\n\n    setWindowTitle(tr(\"Dock Widgets\"))\n\n    Letter()\n    setUnifiedTitleAndToolBarOnMac(True)\n//! [1]\n\n//! [2]\ndef Letter(self)\n    textEdit.clear()\n\n    cursor = QTextCursor(textEdit.textCursor())\n    cursor.movePosition(QTextCursor.Start)\n    topFrame = cursor.currentFrame()\n    topFrameFormat = topFrame.frameFormat()\n    topFrameFormat.setPadding(16)\n    topFrame.setFrameFormat(topFrameFormat)\n\n    textFormat = QTextCharFormat()\n    boldFormat = QTextCharFormat()\n    boldFormat.setFontWeight(QFont.Bold)\n    italicFormat = QTextCharFormat()\n    italicFormat.setFontItalic(True)\n\n    tableFormat = QTextTableFormat()\n    tableFormat.setBorder(1)\n    tableFormat.setCellPadding(16)\n    tableFormat.setAlignment(Qt.AlignRight)\n    cursor.insertTable(1, 1, tableFormat)\n    cursor.insertText(\"The Firm\", boldFormat)\n    cursor.insertBlock()\n    cursor.insertText(\"321 City Street\", textFormat)\n    cursor.insertBlock()\n    cursor.insertText(\"Industry Park\")\n    cursor.insertBlock()\n    cursor.insertText(\"Some Country\")\n    cursor.setPosition(topFrame.lastPosition())\n    cursor.insertText(QDate.currentDate().toString(\"d MMMM yyyy\"), textFormat)\n    cursor.insertBlock()\n    cursor.insertBlock()\n    cursor.insertText(\"Dear \", textFormat)\n    cursor.insertText(\"NAME\", italicFormat)\n    cursor.insertText(\",\", textFormat)\n    for i in range(3):\n        cursor.insertBlock()\n    cursor.insertText(tr(\"Yours sincerely,\"), textFormat)\n    for i in range(3):\n        cursor.insertBlock()\n    cursor.insertText(\"The Boss\", textFormat)\n    cursor.insertBlock()\n    cursor.insertText(\"ADDRESS\", italicFormat)\n//! [2]\n\n//! [3]\ndef print(self)\n    document = textEdit.document()\n    printer = QPrinter()\n\n    dlg =  QPrintDialog(&printer, self)\n    if dlg.exec() != QDialog.Accepted:\n        return\n\n    document.print(printer)\n    statusBar().showMessage(tr(\"Ready\"), 2000)\n//! [3]\n\n//! [4]\ndef save(self):\n    fileName = QFileDialog.getSaveFileName(self,\n                        tr(\"Choose a file name\"), \".\",\n                        tr(\"HTML (*.html *.htm)\"))\n    if fileName.isEmpty():\n        return\n    file = QFile(fileName)\n    if !file.open(QFile.WriteOnly | QFile::Text):\n        QMessageBox.warning(self, tr(\"Dock Widgets\"),\n                             tr(\"Cannot write file %1:\\n%2.\")\n                             .arg(fileName)\n                             .arg(file.errorString()))\n        return\n    \n\n    out = QTextStream(file)\n    QApplication.setOverrideCursor(Qt::WaitCursor)\n    out << textEdit.toHtml()\n    QApplication.restoreOverrideCursor()\n\n    statusBar().showMessage(tr(\"Saved '%1'\").arg(fileName), 2000)\n\n//! [4]\n\n//! [5]\ndef undo(self):\n    document = textEdit.document()\n    document.undo()\n\n//! [5]\n\n//! [6]\ndef insertCustomer(self, customer):\n    if customer.isEmpty():\n        return\n\n    customerList = customer.split(\", \")\n    document = textEdit.document()\n    cursor = document.find(\"NAME\")\n    if not cursor.isNull():\n        cursor.beginEditBlock()\n        cursor.insertText(customerList.at(0))\n        oldcursor = cursor\n        cursor = document.find(\"ADDRESS\")\n        if not cursor.isNull():\n            for i in range(customerList.size()):\n                cursor.insertBlock()\n                cursor.insertText(customerList.at(i))\n            \n            cursor.endEditBlock()\n        else:\n            oldcursor.endEditBlock()\n//! [6]\n\n//! [7]\ndef addParagraph(self, paragraph):\n    if (paragraph.isEmpty())\n        return\n\n    document = textEdit.document()\n    cursor = document.find(tr(\"Yours sincerely,\"))\n    if cursor.isNull():\n        return\n    cursor.beginEditBlock()\n    cursor.movePosition(QTextCursor.PreviousBlock, QTextCursor.MoveAnchor, 2)\n    cursor.insertBlock()\n    cursor.insertText(paragraph)\n    cursor.insertBlock()\n    cursor.endEditBlock()\n\n//! [7]\n\n\n//! [8]\ndef createStatusBar(self):\n    statusBar().showMessage(tr(\"Ready\"))\n\n//! [8]\n\n//! [9]\ndef createDockWindows(self):\n    dock =  QDockWidget(tr(\"Customers\"), self)\n    dock.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)\n    customerList =  QListWidget(dock)\n    customerList.addItems(QStringList()\n            << \"John Doe, Harmony Enterprises, 12 Lakeside, Ambleton\"\n            << \"Jane Doe, Memorabilia, 23 Watersedge, Beaton\"\n            << \"Tammy Shea, Tiblanka, 38 Sea Views, Carlton\"\n            << \"Tim Sheen, Caraba Gifts, 48 Ocean Way, Deal\"\n            << \"Sol Harvey, Chicos Coffee, 53 New Springs, Eccleston\"\n            << \"Sally Hobart, Tiroli Tea, 67 Long River, Fedula\")\n    dock.setWidget(customerList)\n    addDockWidget(Qt.RightDockWidgetArea, dock)\n    viewMenu.addAction(dock.toggleViewAction())\n\n    dock =  QDockWidget(tr(\"Paragraphs\"), self)\n    paragraphsList =  QListWidget(dock)\n    paragraphsList.addItems(QStringList()\n            << \"Thank you for your payment which we have received today.\"\n            << \"Your order has been dispatched and should be with you \"\n               \"within 28 days.\"\n            << \"We have dispatched those items that were in stock. The \"\n               \"rest of your order will be dispatched once all the \"\n               \"remaining items have arrived at our warehouse. No \"\n               \"additional shipping charges will be made.\"\n            << \"You made a small overpayment (less than $5) which we \"\n               \"will keep on account for you, or return at your request.\"\n            << \"You made a small underpayment (less than $1), but we have \"\n               \"sent your order anyway. We'll add self underpayment to \"\n               \"your next bill.\"\n            << \"Unfortunately you did not send enough money. Please remit \"\n               \"an additional $. Your order will be dispatched as soon as \"\n               \"the complete amount has been received.\"\n            << \"You made an overpayment (more than $5). Do you wish to \"\n               \"buy more items, or should we return the excess to you?\")\n    dock.setWidget(paragraphsList)\n    addDockWidget(Qt.RightDockWidgetArea, dock)\n    viewMenu.addAction(dock.toggleViewAction())\n\n    connect(customerList, SIGNAL(\"currentTextChanged(const QString &)\"),\n            self, SLOT(\"insertCustomer(const QString &)\"))\n    connect(paragraphsList, SIGNAL(\"currentTextChanged(const QString &)\"),\n            self, SLOT(\"addParagraph(const QString &)\"))\n//! [9]\n"
  },
  {
    "path": "doc/codesnippets/examples/mainwindows/mainwindow.cpp",
    "content": "######################################\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n# Contact: http://www.qt-project.org/legal\n#\n# This file is part of the example classes of the Qt Toolkit.\n#\n# $QT_BEGIN_LICENSE:LGPL$\n# Commercial License Usage\n# Licensees holding valid commercial Qt licenses may use this file in\n# accordance with the commercial license agreement provided with the\n# Software or, alternatively, in accordance with the terms contained in\n# a written agreement between you and Digia.  For licensing terms and\n# conditions see http://qt.digia.com/licensing.  For further information\n# use the contact form at http://qt.digia.com/contact-us.\n#\n# GNU Lesser General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU Lesser\n# General Public License version 2.1 as published by the Free Software\n# Foundation and appearing in the file LICENSE.LGPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU Lesser General Public License version 2.1 requirements\n# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n#\n# In addition, as a special exception, Digia gives you certain additional\n# rights.  These rights are described in the Digia Qt LGPL Exception\n# version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n#\n# GNU General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU\n# General Public License version 3.0 as published by the Free Software\n# Foundation and appearing in the file LICENSE.GPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU General Public License version 3.0 requirements will be\n# met: http://www.gnu.org/copyleft/gpl.html.\n#\n#\n# $QT_END_LICENSE$\n#\n######################################\n\nfrom PySide.QtGui import *\n\n//! [0]\ndef __init__(self):\n    Q__init__(self)\n\n    widget =  QWidget()\n    setCentralWidget(widget)\n//! [0]\n\n//! [1]\n    topFiller =  QWidget()\n    topFiller.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)\n\n    infoLabel =  QLabel(tr(\"<i>Choose a menu option, or right-click to \"\n                              \"invoke a context menu</i>\"))\n    infoLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)\n    infoLabel.setAlignment(Qt.AlignCenter)\n\n    bottomFiller = QWidget()\n    bottomFiller.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)\n\n    layout =  QVBoxLayout()\n    layout.setMargin(5)\n    layout.addWidget(topFiller)\n    layout.addWidget(infoLabel)\n    layout.addWidget(bottomFiller)\n    widget.setLayout(layout)\n//! [1]\n\n//! [2]\n    createActions()\n    createMenus()\n\n    message = tr(\"A context menu is available by right-clicking\")\n    statusBar().showMessage(message)\n\n    setWindowTitle(tr(\"Menus\"))\n    setMinimumSize(160, 160)\n    resize(480, 320)\n\n//! [2]\n\n//! [3]\ndef contextMenuEvent(self, event):\n    menu = QMenu(self)\n    menu.addAction(cutAct)\n    menu.addAction(copyAct)\n    menu.addAction(pasteAct)\n    menu.exec_(event.globalPos()\")\n\n//! [3]\n\ndef File(self):\n    infoLabel.setText(tr(\"Invoked <b>File|New</b>\"))\n\n\ndef open(self):\n    infoLabel.setText(tr(\"Invoked <b>File|Open</b>\"))\n\n\ndef save(self):\n    infoLabel.setText(tr(\"Invoked <b>File|Save</b>\"))\n\ndef print_(self):\n    infoLabel.setText(tr(\"Invoked <b>File|Print</b>\"))\n\ndef undo(self):\n    infoLabel.setText(tr(\"Invoked <b>Edit|Undo</b>\"))\n\ndef redo(self):\n    infoLabel.setText(tr(\"Invoked <b>Edit|Redo</b>\"))\n\ndef cut(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Cut</b>\"))\n\n\ndef copy(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Copy</b>\"))\n\n\ndef paste(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Paste</b>\"))\n\n\ndef bold(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Bold</b>\"))\n\n\ndef italic(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Italic</b>\"))\n\n\ndef leftAlign(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Left Align</b>\"))\n\n\ndef rightAlign(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Right Align</b>\"))\n\n\ndef justify(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Justify</b>\"))\n\n\ndef center(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Center</b>\"))\n\n\ndef setLineSpacing(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Set Line Spacing</b>\"))\n\n\ndef setParagraphSpacing(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Set Paragraph Spacing</b>\"))\n\n\ndef about(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Help|About</b>\"))\n    QMessageBox.about(self, tr(\"About Menu\"),\n            tr(\"The <b>Menu</b> example shows how to create \"\n               \"menu-bar menus and context menus.\"))\n\n\ndef aboutQt(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Help|About Qt</b>\"))\n\n\n//! [4]\ndef createActions(self):\n\n//! [5]\n    Act = new QAction(tr(\"&New\"), self)\n    Act.setShortcuts(QKeySequence.New)\n    Act.setStatusTip(tr(\"Create a new file\"))\n    connect(Act, SIGNAL(\"triggered()\"), self, SLOT(\"newFile()\"))\n//! [4]\n\n    openAct =  QAction(tr(\"&Open...\"), self)\n    openAct.setShortcuts(QKeySequence.Open)\n    openAct.setStatusTip(tr(\"Open an existing file\"))\n    connect(openAct, SIGNAL(\"triggered()\"), self, SLOT(\"open()\"))\n//! [5]\n\n    saveAct =  QAction(tr(\"&Save\"), self)\n    saveAct.setShortcuts(QKeySequence.Save)\n    saveAct.setStatusTip(tr(\"Save the document to disk\"))\n    connect(saveAct, SIGNAL(\"triggered()\"), self, SLOT(\"save()\"))\n\n    printAct =  QAction(tr(\"&Print...\"), self)\n    printAct.setShortcuts(QKeySequence.Print)\n    printAct.setStatusTip(tr(\"Print the document\"))\n    connect(printAct, SIGNAL(\"triggered()\"), self, SLOT(\"print_()\"))\n\n    exitAct =  QAction(tr(\"E&xit\"), self)\n    exitAct.setShortcut(tr(\"Ctrl+Q\"))\n    exitAct.setStatusTip(tr(\"Exit the application\"))\n    connect(exitAct, SIGNAL(\"triggered()\"), self, SLOT(\"close()\"))\n\n    undoAct =  QAction(tr(\"&Undo\"), self)\n    undoAct.setShortcuts(QKeySequence.Undo)\n    undoAct.setStatusTip(tr(\"Undo the last operation\"))\n    connect(undoAct, SIGNAL(\"triggered()\"), self, SLOT(\"undo()\"))\n\n    redoAct =  QAction(tr(\"&Redo\"), self)\n    redoAct.setShortcuts(QKeySequence.Redo)\n    redoAct.setStatusTip(tr(\"Redo the last operation\"))\n    connect(redoAct, SIGNAL(\"triggered()\"), self, SLOT(\"redo()\"))\n\n    cutAct =  QAction(tr(\"Cu&t\"), self)\n    cutAct.setShortcuts(QKeySequence.Cut)\n    cutAct.setStatusTip(tr(\"Cut the current selection's contents to the \"\n                            \"clipboard\"))\n    connect(cutAct, SIGNAL(\"triggered()\"), self, SLOT(\"cut()\"))\n\n    copyAct =  QAction(tr(\"&Copy\"), self)\n    copyAct.setShortcut(tr(\"Ctrl+C\"))\n    copyAct.setStatusTip(tr(\"Copy the current selection's contents to the \"\n                             \"clipboard\"))\n    connect(copyAct, SIGNAL(\"triggered()\"), self, SLOT(\"copy()\"))\n\n    pasteAct =  QAction(tr(\"&Paste\"), self)\n    pasteAct.setShortcuts(QKeySequence.Paste)\n    pasteAct.setStatusTip(tr(\"Paste the clipboard's contents into the current \"\n                              \"selection\"))\n    connect(pasteAct, SIGNAL(\"triggered()\"), self, SLOT(\"paste()\"))\n\n    boldAct =  QAction(tr(\"&Bold\"), self)\n    boldAct.setCheckable(True)\n    boldAct.setShortcut(tr(\"Ctrl+B\"))\n    boldAct.setStatusTip(tr(\"Make the text bold\"))\n    connect(boldAct, SIGNAL(\"triggered()\"), self, SLOT(\"bold()\"))\n\n    QFont boldFont = boldAct.font()\n    boldFont.setBold(True)\n    boldAct.setFont(boldFont)\n\n    italicAct =  QAction(tr(\"&Italic\"), self)\n    italicAct.setCheckable(True)\n    italicAct.setShortcut(tr(\"Ctrl+I\"))\n    italicAct.setStatusTip(tr(\"Make the text italic\"))\n    connect(italicAct, SIGNAL(\"triggered()\"), self, SLOT(\"italic()\"))\n\n    QFont italicFont = italicAct.font()\n    italicFont.setItalic(True)\n    italicAct.setFont(italicFont)\n\n    setLineSpacingAct =  QAction(tr(\"Set &Line Spacing...\"), self)\n    setLineSpacingAct.setStatusTip(tr(\"Change the gap between the lines of a \"\n                                       \"paragraph\"))\n    connect(setLineSpacingAct, SIGNAL(\"triggered()\"), self, SLOT(\"setLineSpacing()\"))\n\n    setParagraphSpacingAct =  QAction(tr(\"Set &Paragraph Spacing...\"), self)\n    setLineSpacingAct.setStatusTip(tr(\"Change the gap between paragraphs\"))\n    connect(setParagraphSpacingAct, SIGNAL(\"triggered()\"),\n            self, SLOT(\"setParagraphSpacing()\"))\n\n    aboutAct =  QAction(tr(\"&About\"), self)\n    aboutAct.setStatusTip(tr(\"Show the application's About box\"))\n    connect(aboutAct, SIGNAL(\"triggered()\"), self, SLOT(\"about()\"))\n\n    aboutQtAct =  QAction(tr(\"About &Qt\"), self)\n    aboutQtAct.setStatusTip(tr(\"Show the Qt library's About box\"))\n    connect(aboutQtAct, SIGNAL(\"triggered()\"), qApp, SLOT(\"aboutQt()\"))\n    connect(aboutQtAct, SIGNAL(\"triggered()\"), self, SLOT(\"aboutQt()\"))\n\n    leftAlignAct =  QAction(tr(\"&Left Align\"), self)\n    leftAlignAct.setCheckable(True)\n    leftAlignAct.setShortcut(tr(\"Ctrl+L\"))\n    leftAlignAct.setStatusTip(tr(\"Left align the selected text\"))\n    connect(leftAlignAct, SIGNAL(\"triggered()\"), self, SLOT(\"leftAlign()\"))\n\n    rightAlignAct =  QAction(tr(\"&Right Align\"), self)\n    rightAlignAct.setCheckable(True)\n    rightAlignAct.setShortcut(tr(\"Ctrl+R\"))\n    rightAlignAct.setStatusTip(tr(\"Right align the selected text\"))\n    connect(rightAlignAct, SIGNAL(\"triggered()\"), self, SLOT(\"rightAlign()\"))\n\n    justifyAct =  QAction(tr(\"&Justify\"), self)\n    justifyAct.setCheckable(True)\n    justifyAct.setShortcut(tr(\"Ctrl+J\"))\n    justifyAct.setStatusTip(tr(\"Justify the selected text\"))\n    connect(justifyAct, SIGNAL(\"triggered()\"), self, SLOT(\"justify()\"))\n\n    centerAct =  QAction(tr(\"&Center\"), self)\n    centerAct.setCheckable(True)\n    centerAct.setShortcut(tr(\"Ctrl+E\"))\n    centerAct.setStatusTip(tr(\"Center the selected text\"))\n    connect(centerAct, SIGNAL(\"triggered()\"), self, SLOT(\"center()\"))\n\n//! [6] //! [7]\n    alignmentGroup =  QActionGroup(self)\n    alignmentGroup.addAction(leftAlignAct)\n    alignmentGroup.addAction(rightAlignAct)\n    alignmentGroup.addAction(justifyAct)\n    alignmentGroup.addAction(centerAct)\n    leftAlignAct.setChecked(True)\n//! [6]\n\n//! [7]\n\n//! [8]\ndef createMenus(self):\n\n//! [9] //! [10]\n    fileMenu = menuBar().addMenu(tr(\"&File\"))\n    fileMenu.addAction(Act)\n//! [9]\n    fileMenu.addAction(openAct)\n//! [10]\n    fileMenu.addAction(saveAct)\n    fileMenu.addAction(printAct)\n//! [11]\n    fileMenu.addSeparator()\n//! [11]\n    fileMenu.addAction(exitAct)\n\n    editMenu = menuBar().addMenu(tr(\"&Edit\"))\n    editMenu.addAction(undoAct)\n    editMenu.addAction(redoAct)\n    editMenu.addSeparator()\n    editMenu.addAction(cutAct)\n    editMenu.addAction(copyAct)\n    editMenu.addAction(pasteAct)\n    editMenu.addSeparator()\n\n    helpMenu = menuBar().addMenu(tr(\"&Help\"))\n    helpMenu.addAction(aboutAct)\n    helpMenu.addAction(aboutQtAct)\n//! [8]\n\n//! [12]\n    formatMenu = editMenu.addMenu(tr(\"&Format\"))\n    formatMenu.addAction(boldAct)\n    formatMenu.addAction(italicAct)\n    formatMenu.addSeparator()->setText(tr(\"Alignment\"))\n    formatMenu.addAction(leftAlignAct)\n    formatMenu.addAction(rightAlignAct)\n    formatMenu.addAction(justifyAct)\n    formatMenu.addAction(centerAct)\n    formatMenu.addSeparator()\n    formatMenu.addAction(setLineSpacingAct)\n    formatMenu.addAction(setParagraphSpacingAct)\n//! [12]\n"
  },
  {
    "path": "doc/codesnippets/examples/mainwindows/mdi/mainwindow.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the example classes of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\nfrom PySide.QtGui import *\n\ndef __init__(self):\n\n    mdiArea =  QMdiArea()\n    mdiArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)\n    mdiArea.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)\n    setCentralWidget(mdiArea)\n    connect(mdiArea, SIGNAL(\"subWindowActivated(QMdiSubWindow *)\"),\n            self, SLOT(\"updateMenus()\"))\n    windowMapper =  QSignalMapper(self)\n    connect(windowMapper, SIGNAL(\"mapped(QWidget *)\"),\n            self, SLOT(\"setActiveSubWindow(QWidget *)\"))\n\n    createActions()\n    createMenus()\n    createToolBars()\n    createStatusBar()\n    updateMenus()\n\n    readSettings()\n\n    setWindowTitle(tr(\"MDI\"))\n    setUnifiedTitleAndToolBarOnMac(True)\n\n\ndef closeEvent(self, event):\n    mdiArea.closeAllSubWindows()\n    if self.activeMdiChild():\n        event.ignore()\n    else:\n        self.writeSettings()\n        event.accept()\n\ndef File(self):\n    child = self.createMdiChild()\n    child.File()\n    child.show()\n\n\ndef open(self):\n    fileName = QFileDialog.getOpenFileName(self)\n    if !fileName.isEmpty()):\n        existing = self.findMdiChild(fileName)\n        if existing:\n            mdiArea.setActiveSubWindow(existing)\n            return\n\n        child = createMdiChild()\n        if child.loadFile(fileName)):\n            statusBar().showMessage(tr(\"File loaded\"), 2000)\n            child.show()\n        else:\n            child.close()\n\ndef save(self):\n    if self.activeMdiChild() && self.activeMdiChild().save():\n        self.statusBar().showMessage(tr(\"File saved\"), 2000)\n\ndef saveAs(self):\n    if self.activeMdiChild() && self.activeMdiChild().saveAs():\n        self.statusBar().showMessage(tr(\"File saved\"), 2000)\n\ndef cut(self):\n    if self.activeMdiChild():\n        self.activeMdiChild().cut()\n\ndef copy(self):\n    if self.activeMdiChild():\n        activeMdiChild().copy()\n\ndef paste(self):\n    if self.activeMdiChild():\n        activeMdiChild().paste()\n\ndef about(self):\n   QMessageBox.about(self, tr(\"About MDI\"),\n                           tr(\"The <b>MDI</b> example demonstrates how to write multiple \"\n                              \"document interface applications using Qt.\")\")\n\ndef updateMenus(self):\n    hasMdiChild = (activeMdiChild() != 0)\n    self.saveAct.setEnabled(hasMdiChild)\n    self.saveAsAct.setEnabled(hasMdiChild)\n    self.pasteAct.setEnabled(hasMdiChild)\n    self.closeAct.setEnabled(hasMdiChild)\n    self.closeAllAct.setEnabled(hasMdiChild)\n    self.tileAct.setEnabled(hasMdiChild)\n    self.cascadeAct.setEnabled(hasMdiChild)\n    self.nextAct.setEnabled(hasMdiChild)\n    self.previousAct.setEnabled(hasMdiChild)\n    self.separatorAct.setVisible(hasMdiChild)\n\n    hasSelection = (self.activeMdiChild() &&\n                    self.activeMdiChild().textCursor().hasSelection()\")\n    self.cutAct.setEnabled(hasSelection)\n    self.copyAct.setEnabled(hasSelection)\n\ndef updateWindowMenu(self):\n    self.windowMenu.clear()\n    self.windowMenu.addAction(closeAct)\n    self.windowMenu.addAction(closeAllAct)\n    self.windowMenu.addSeparator()\n    self.windowMenu.addAction(tileAct)\n    self.windowMenu.addAction(cascadeAct)\n    self.windowMenu.addSeparator()\n    self.windowMenu.addAction(nextAct)\n    self.windowMenu.addAction(previousAct)\n    self.windowMenu.addAction(separatorAct)\n\n    windows = mdiArea.subWindowList()\n    separatorAct.setVisible(!windows.isEmpty()\")\n\n    for i in range((int i = 0 i < windows.size(); ++i) \n        MdiChild *child = qobject_cast<MdiChild *>(windows.at(i).widget()\")\n\n        QString text\n        if (i < 9) \n            text = tr(\"&%1 %2\").arg(i + 1)\n                               .arg(child.userFriendlyCurrentFile()\")\n         else \n            text = tr(\"%1 %2\").arg(i + 1)\n                              .arg(child.userFriendlyCurrentFile()\")\n        \n        QAction *action  = windowMenu.addAction(text)\n        action.setCheckable(True)\n        action .setChecked(child == activeMdiChild()\")\n        connect(action, SIGNAL(\"triggered()\"), windowMapper, SLOT(\"map()\"))\n        windowMapper.setMapping(action, windows.at(i)\")\n    \n\n\nMdiChild *createMdiChild()\n\n    MdiChild *child =  MdiChild\n    mdiArea.addSubWindow(child)\n\n    connect(child, SIGNAL(\"copyAvailable(bool)\"),\n            cutAct, SLOT(\"setEnabled(bool)\"))\n    connect(child, SIGNAL(\"copyAvailable(bool)\"),\n            copyAct, SLOT(\"setEnabled(bool)\"))\n\n    return child\n\n\ndef createActions()\n\n    Act = new QAction(QIcon(\":/images/new.png\"), tr(\"&New\"), self)\n    Act.setShortcuts(QKeySequence.New)\n    Act.setStatusTip(tr(\"Create a new file\")\")\n    connect(Act, SIGNAL(\"triggered()\"), self, SLOT(\"newFile()\"))\n\n    openAct =  QAction(QIcon(\":/images/open.png\"), tr(\"&Open...\"), self)\n    openAct.setShortcuts(QKeySequence.Open)\n    openAct.setStatusTip(tr(\"Open an existing file\")\")\n    connect(openAct, SIGNAL(\"triggered()\"), self, SLOT(\"open()\"))\n\n    saveAct =  QAction(QIcon(\":/images/save.png\"), tr(\"&Save\"), self)\n    saveAct.setShortcuts(QKeySequence.Save)\n    saveAct.setStatusTip(tr(\"Save the document to disk\")\")\n    connect(saveAct, SIGNAL(\"triggered()\"), self, SLOT(\"save()\"))\n\n    saveAsAct =  QAction(tr(\"Save &As...\"), self)\n    saveAsAct.setShortcuts(QKeySequence.SaveAs)\n    saveAsAct.setStatusTip(tr(\"Save the document under a  name\")\")\n    connect(saveAsAct, SIGNAL(\"triggered()\"), self, SLOT(\"saveAs()\"))\n\n//! [0]\n    exitAct = QAction(tr(\"E&xit\"), self)\n    exitAct.setShortcut(tr(\"Ctrl+Q\")\")\n    exitAct.setStatusTip(tr(\"Exit the application\")\")\n    connect(exitAct, SIGNAL(\"triggered()\"), qApp, SLOT(\"closeAllWindows()\"))\n//! [0]\n\n    cutAct =  QAction(QIcon(\":/images/cut.png\"), tr(\"Cu&t\"), self)\n    cutAct.setShortcuts(QKeySequence.Cut)\n    cutAct.setStatusTip(tr(\"Cut the current selection's contents to the \"\n                            \"clipboard\")\")\n    connect(cutAct, SIGNAL(\"triggered()\"), self, SLOT(\"cut()\"))\n\n    copyAct =  QAction(QIcon(\":/images/copy.png\"), tr(\"&Copy\"), self)\n    copyAct.setShortcuts(QKeySequence.Copy)\n    copyAct.setStatusTip(tr(\"Copy the current selection's contents to the \"\n                             \"clipboard\")\")\n    connect(copyAct, SIGNAL(\"triggered()\"), self, SLOT(\"copy()\"))\n\n    pasteAct =  QAction(QIcon(\":/images/paste.png\"), tr(\"&Paste\"), self)\n    pasteAct.setShortcuts(QKeySequence.Paste)\n    pasteAct.setStatusTip(tr(\"Paste the clipboard's contents into the current \"\n                              \"selection\")\")\n    connect(pasteAct, SIGNAL(\"triggered()\"), self, SLOT(\"paste()\"))\n\n    closeAct =  QAction(tr(\"Cl&ose\"), self)\n    closeAct.setShortcut(tr(\"Ctrl+F4\")\")\n    closeAct.setStatusTip(tr(\"Close the active window\")\")\n    connect(closeAct, SIGNAL(\"triggered()\"),\n            mdiArea, SLOT(\"closeActiveSubWindow()\"))\n\n    closeAllAct =  QAction(tr(\"Close &All\"), self)\n    closeAllAct.setStatusTip(tr(\"Close all the windows\")\")\n    connect(closeAllAct, SIGNAL(\"triggered()\"),\n            mdiArea, SLOT(\"closeAllSubWindows()\"))\n\n    tileAct =  QAction(tr(\"&Tile\"), self)\n    tileAct.setStatusTip(tr(\"Tile the windows\")\")\n    connect(tileAct, SIGNAL(\"triggered()\"), mdiArea, SLOT(\"tileSubWindows()\"))\n\n    cascadeAct =  QAction(tr(\"&Cascade\"), self)\n    cascadeAct.setStatusTip(tr(\"Cascade the windows\")\")\n    connect(cascadeAct, SIGNAL(\"triggered()\"), mdiArea, SLOT(\"cascadeSubWindows()\"))\n\n    nextAct =  QAction(tr(\"Ne&xt\"), self)\n    nextAct.setShortcuts(QKeySequence.NextChild)\n    nextAct.setStatusTip(tr(\"Move the focus to the next window\")\")\n    connect(nextAct, SIGNAL(\"triggered()\"),\n            mdiArea, SLOT(\"activateNextSubWindow()\"))\n\n    previousAct =  QAction(tr(\"Pre&vious\"), self)\n    previousAct.setShortcuts(QKeySequence.PreviousChild)\n    previousAct.setStatusTip(tr(\"Move the focus to the previous \"\n                                 \"window\")\")\n    connect(previousAct, SIGNAL(\"triggered()\"),\n            mdiArea, SLOT(\"activatePreviousSubWindow()\"))\n\n    separatorAct =  QAction(self)\n    separatorAct.setSeparator(True)\n\n    aboutAct =  QAction(tr(\"&About\"), self)\n    aboutAct.setStatusTip(tr(\"Show the application's About box\")\")\n    connect(aboutAct, SIGNAL(\"triggered()\"), self, SLOT(\"about()\"))\n\n    aboutQtAct =  QAction(tr(\"About &Qt\"), self)\n    aboutQtAct.setStatusTip(tr(\"Show the Qt library's About box\")\")\n    connect(aboutQtAct, SIGNAL(\"triggered()\"), qApp, SLOT(\"aboutQt()\"))\n\n\ndef createMenus()\n\n    fileMenu = menuBar().addMenu(tr(\"&File\")\")\n    fileMenu.addAction(Act)\n    fileMenu.addAction(openAct)\n    fileMenu.addAction(saveAct)\n    fileMenu.addAction(saveAsAct)\n    fileMenu.addSeparator()\n    QAction *action = fileMenu.addAction(tr(\"Switch layout direction\")\")\n    connect(action, SIGNAL(\"triggered()\"), self, SLOT(\"switchLayoutDirection()\"))\n    fileMenu.addAction(exitAct)\n\n    editMenu = menuBar().addMenu(tr(\"&Edit\")\")\n    editMenu.addAction(cutAct)\n    editMenu.addAction(copyAct)\n    editMenu.addAction(pasteAct)\n\n    windowMenu = menuBar().addMenu(tr(\"&Window\")\")\n    updateWindowMenu()\n    connect(windowMenu, SIGNAL(\"aboutToShow()\"), self, SLOT(\"updateWindowMenu()\"))\n\n    menuBar().addSeparator()\n\n    helpMenu = menuBar().addMenu(tr(\"&Help\")\")\n    helpMenu.addAction(aboutAct)\n    helpMenu.addAction(aboutQtAct)\n\n\ndef createToolBars()\n\n    fileToolBar = addToolBar(tr(\"File\")\")\n    fileToolBar.addAction(Act)\n    fileToolBar.addAction(openAct)\n    fileToolBar.addAction(saveAct)\n\n    editToolBar = addToolBar(tr(\"Edit\")\")\n    editToolBar.addAction(cutAct)\n    editToolBar.addAction(copyAct)\n    editToolBar.addAction(pasteAct)\n\n\ndef createStatusBar()\n\n    statusBar().showMessage(tr(\"Ready\")\")\n\n\ndef readSettings()\n\n    QSettings settings(\"Trolltech\", \"MDI Example\")\n    QPoint pos = settings.value(\"pos\", QPoint(200, 200)\").toPoint()\n    QSize size = settings.value(\"size\", QSize(400, 400)\").toSize()\n    move(pos)\n    resize(size)\n\n\ndef writeSettings()\n\n    QSettings settings(\"Trolltech\", \"MDI Example\")\n    settings.setValue(\"pos\", pos()\")\n    settings.setValue(\"size\", size()\")\n\n\nMdiChild *activeMdiChild()\n\n    if (QMdiSubWindow *activeSubWindow = mdiArea.activeSubWindow()\")\n        return qobject_cast<MdiChild *>(activeSubWindow.widget()\")\n    return 0\n\n\nQMdiSubWindow *findMdiChild(const QString &fileName)\n\n    QString canonicalFilePath = QFileInfo(fileName).canonicalFilePath()\n\n    foreach (QMdiSubWindow *window, mdiArea.subWindowList()\") \n        MdiChild *mdiChild = qobject_cast<MdiChild *>(window.widget()\")\n        if (mdiChild.currentFile() == canonicalFilePath)\n            return window\n    \n    return 0\n\n\ndef switchLayoutDirection()\n\n    if (layoutDirection() == Qt.LeftToRight)\n        qApp.setLayoutDirection(Qt.RightToLeft)\n    else\n        qApp.setLayoutDirection(Qt.LeftToRight)\n\n\ndef setActiveSubWindow(QWidget *window)\n\n    if (!window)\n        return\n    mdiArea.setActiveSubWindow(qobject_cast<QMdiSubWindow *>(window)\")\n\n"
  },
  {
    "path": "doc/codesnippets/examples/mainwindows/menus/mainwindow.cpp",
    "content": "######################################\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n# Contact: http://www.qt-project.org/legal\n#\n# This file is part of the example classes of the Qt Toolkit.\n#\n# $QT_BEGIN_LICENSE:LGPL$\n# Commercial License Usage\n# Licensees holding valid commercial Qt licenses may use this file in\n# accordance with the commercial license agreement provided with the\n# Software or, alternatively, in accordance with the terms contained in\n# a written agreement between you and Digia.  For licensing terms and\n# conditions see http://qt.digia.com/licensing.  For further information\n# use the contact form at http://qt.digia.com/contact-us.\n#\n# GNU Lesser General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU Lesser\n# General Public License version 2.1 as published by the Free Software\n# Foundation and appearing in the file LICENSE.LGPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU Lesser General Public License version 2.1 requirements\n# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n#\n# In addition, as a special exception, Digia gives you certain additional\n# rights.  These rights are described in the Digia Qt LGPL Exception\n# version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n#\n# GNU General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU\n# General Public License version 3.0 as published by the Free Software\n# Foundation and appearing in the file LICENSE.GPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU General Public License version 3.0 requirements will be\n# met: http://www.gnu.org/copyleft/gpl.html.\n#\n#\n# $QT_END_LICENSE$\n#\n######################################\n\nfrom PySide.QtGui import *\n\n//! [0]\ndef __init__(self):\n    Q__init__(self)\n\n    widget =  QWidget()\n    setCentralWidget(widget)\n//! [0]\n\n//! [1]\n    topFiller =  QWidget()\n    topFiller.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)\n\n    infoLabel =  QLabel(tr(\"<i>Choose a menu option, or right-click to \"\n                              \"invoke a context menu</i>\"))\n    infoLabel.setFrameStyle(QFrame.StyledPanel | QFrame.Sunken)\n    infoLabel.setAlignment(Qt.AlignCenter)\n\n    bottomFiller = QWidget()\n    bottomFiller.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)\n\n    layout =  QVBoxLayout()\n    layout.setMargin(5)\n    layout.addWidget(topFiller)\n    layout.addWidget(infoLabel)\n    layout.addWidget(bottomFiller)\n    widget.setLayout(layout)\n//! [1]\n\n//! [2]\n    createActions()\n    createMenus()\n\n    message = tr(\"A context menu is available by right-clicking\")\n    statusBar().showMessage(message)\n\n    setWindowTitle(tr(\"Menus\"))\n    setMinimumSize(160, 160)\n    resize(480, 320)\n\n//! [2]\n\n//! [3]\ndef contextMenuEvent(self, event):\n    menu = QMenu(self)\n    menu.addAction(cutAct)\n    menu.addAction(copyAct)\n    menu.addAction(pasteAct)\n    menu.exec_(event.globalPos()\")\n\n//! [3]\n\ndef File(self):\n    infoLabel.setText(tr(\"Invoked <b>File|New</b>\"))\n\n\ndef open(self):\n    infoLabel.setText(tr(\"Invoked <b>File|Open</b>\"))\n\n\ndef save(self):\n    infoLabel.setText(tr(\"Invoked <b>File|Save</b>\"))\n\ndef print_(self):\n    infoLabel.setText(tr(\"Invoked <b>File|Print</b>\"))\n\ndef undo(self):\n    infoLabel.setText(tr(\"Invoked <b>Edit|Undo</b>\"))\n\ndef redo(self):\n    infoLabel.setText(tr(\"Invoked <b>Edit|Redo</b>\"))\n\ndef cut(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Cut</b>\"))\n\n\ndef copy(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Copy</b>\"))\n\n\ndef paste(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Paste</b>\"))\n\n\ndef bold(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Bold</b>\"))\n\n\ndef italic(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Italic</b>\"))\n\n\ndef leftAlign(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Left Align</b>\"))\n\n\ndef rightAlign(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Right Align</b>\"))\n\n\ndef justify(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Justify</b>\"))\n\n\ndef center(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Center</b>\"))\n\n\ndef setLineSpacing(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Set Line Spacing</b>\"))\n\n\ndef setParagraphSpacing(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Edit|Format|Set Paragraph Spacing</b>\"))\n\n\ndef about(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Help|About</b>\"))\n    QMessageBox.about(self, tr(\"About Menu\"),\n            tr(\"The <b>Menu</b> example shows how to create \"\n               \"menu-bar menus and context menus.\"))\n\n\ndef aboutQt(self):\n\n    infoLabel.setText(tr(\"Invoked <b>Help|About Qt</b>\"))\n\n\n//! [4]\ndef createActions(self):\n\n//! [5]\n    Act = new QAction(tr(\"&New\"), self)\n    Act.setShortcuts(QKeySequence.New)\n    Act.setStatusTip(tr(\"Create a new file\"))\n    connect(Act, SIGNAL(\"triggered()\"), self, SLOT(\"newFile()\"))\n//! [4]\n\n    openAct =  QAction(tr(\"&Open...\"), self)\n    openAct.setShortcuts(QKeySequence.Open)\n    openAct.setStatusTip(tr(\"Open an existing file\"))\n    connect(openAct, SIGNAL(\"triggered()\"), self, SLOT(\"open()\"))\n//! [5]\n\n    saveAct =  QAction(tr(\"&Save\"), self)\n    saveAct.setShortcuts(QKeySequence.Save)\n    saveAct.setStatusTip(tr(\"Save the document to disk\"))\n    connect(saveAct, SIGNAL(\"triggered()\"), self, SLOT(\"save()\"))\n\n    printAct =  QAction(tr(\"&Print...\"), self)\n    printAct.setShortcuts(QKeySequence.Print)\n    printAct.setStatusTip(tr(\"Print the document\"))\n    connect(printAct, SIGNAL(\"triggered()\"), self, SLOT(\"print_()\"))\n\n    exitAct =  QAction(tr(\"E&xit\"), self)\n    exitAct.setShortcut(tr(\"Ctrl+Q\"))\n    exitAct.setStatusTip(tr(\"Exit the application\"))\n    connect(exitAct, SIGNAL(\"triggered()\"), self, SLOT(\"close()\"))\n\n    undoAct =  QAction(tr(\"&Undo\"), self)\n    undoAct.setShortcuts(QKeySequence.Undo)\n    undoAct.setStatusTip(tr(\"Undo the last operation\"))\n    connect(undoAct, SIGNAL(\"triggered()\"), self, SLOT(\"undo()\"))\n\n    redoAct =  QAction(tr(\"&Redo\"), self)\n    redoAct.setShortcuts(QKeySequence.Redo)\n    redoAct.setStatusTip(tr(\"Redo the last operation\"))\n    connect(redoAct, SIGNAL(\"triggered()\"), self, SLOT(\"redo()\"))\n\n    cutAct =  QAction(tr(\"Cu&t\"), self)\n    cutAct.setShortcuts(QKeySequence.Cut)\n    cutAct.setStatusTip(tr(\"Cut the current selection's contents to the \"\n                            \"clipboard\"))\n    connect(cutAct, SIGNAL(\"triggered()\"), self, SLOT(\"cut()\"))\n\n    copyAct =  QAction(tr(\"&Copy\"), self)\n    copyAct.setShortcut(tr(\"Ctrl+C\"))\n    copyAct.setStatusTip(tr(\"Copy the current selection's contents to the \"\n                             \"clipboard\"))\n    connect(copyAct, SIGNAL(\"triggered()\"), self, SLOT(\"copy()\"))\n\n    pasteAct =  QAction(tr(\"&Paste\"), self)\n    pasteAct.setShortcuts(QKeySequence.Paste)\n    pasteAct.setStatusTip(tr(\"Paste the clipboard's contents into the current \"\n                              \"selection\"))\n    connect(pasteAct, SIGNAL(\"triggered()\"), self, SLOT(\"paste()\"))\n\n    boldAct =  QAction(tr(\"&Bold\"), self)\n    boldAct.setCheckable(True)\n    boldAct.setShortcut(tr(\"Ctrl+B\"))\n    boldAct.setStatusTip(tr(\"Make the text bold\"))\n    connect(boldAct, SIGNAL(\"triggered()\"), self, SLOT(\"bold()\"))\n\n    QFont boldFont = boldAct.font()\n    boldFont.setBold(True)\n    boldAct.setFont(boldFont)\n\n    italicAct =  QAction(tr(\"&Italic\"), self)\n    italicAct.setCheckable(True)\n    italicAct.setShortcut(tr(\"Ctrl+I\"))\n    italicAct.setStatusTip(tr(\"Make the text italic\"))\n    connect(italicAct, SIGNAL(\"triggered()\"), self, SLOT(\"italic()\"))\n\n    QFont italicFont = italicAct.font()\n    italicFont.setItalic(True)\n    italicAct.setFont(italicFont)\n\n    setLineSpacingAct =  QAction(tr(\"Set &Line Spacing...\"), self)\n    setLineSpacingAct.setStatusTip(tr(\"Change the gap between the lines of a \"\n                                       \"paragraph\"))\n    connect(setLineSpacingAct, SIGNAL(\"triggered()\"), self, SLOT(\"setLineSpacing()\"))\n\n    setParagraphSpacingAct =  QAction(tr(\"Set &Paragraph Spacing...\"), self)\n    setLineSpacingAct.setStatusTip(tr(\"Change the gap between paragraphs\"))\n    connect(setParagraphSpacingAct, SIGNAL(\"triggered()\"),\n            self, SLOT(\"setParagraphSpacing()\"))\n\n    aboutAct =  QAction(tr(\"&About\"), self)\n    aboutAct.setStatusTip(tr(\"Show the application's About box\"))\n    connect(aboutAct, SIGNAL(\"triggered()\"), self, SLOT(\"about()\"))\n\n    aboutQtAct =  QAction(tr(\"About &Qt\"), self)\n    aboutQtAct.setStatusTip(tr(\"Show the Qt library's About box\"))\n    connect(aboutQtAct, SIGNAL(\"triggered()\"), qApp, SLOT(\"aboutQt()\"))\n    connect(aboutQtAct, SIGNAL(\"triggered()\"), self, SLOT(\"aboutQt()\"))\n\n    leftAlignAct =  QAction(tr(\"&Left Align\"), self)\n    leftAlignAct.setCheckable(True)\n    leftAlignAct.setShortcut(tr(\"Ctrl+L\"))\n    leftAlignAct.setStatusTip(tr(\"Left align the selected text\"))\n    connect(leftAlignAct, SIGNAL(\"triggered()\"), self, SLOT(\"leftAlign()\"))\n\n    rightAlignAct =  QAction(tr(\"&Right Align\"), self)\n    rightAlignAct.setCheckable(True)\n    rightAlignAct.setShortcut(tr(\"Ctrl+R\"))\n    rightAlignAct.setStatusTip(tr(\"Right align the selected text\"))\n    connect(rightAlignAct, SIGNAL(\"triggered()\"), self, SLOT(\"rightAlign()\"))\n\n    justifyAct =  QAction(tr(\"&Justify\"), self)\n    justifyAct.setCheckable(True)\n    justifyAct.setShortcut(tr(\"Ctrl+J\"))\n    justifyAct.setStatusTip(tr(\"Justify the selected text\"))\n    connect(justifyAct, SIGNAL(\"triggered()\"), self, SLOT(\"justify()\"))\n\n    centerAct =  QAction(tr(\"&Center\"), self)\n    centerAct.setCheckable(True)\n    centerAct.setShortcut(tr(\"Ctrl+E\"))\n    centerAct.setStatusTip(tr(\"Center the selected text\"))\n    connect(centerAct, SIGNAL(\"triggered()\"), self, SLOT(\"center()\"))\n\n//! [6] //! [7]\n    alignmentGroup =  QActionGroup(self)\n    alignmentGroup.addAction(leftAlignAct)\n    alignmentGroup.addAction(rightAlignAct)\n    alignmentGroup.addAction(justifyAct)\n    alignmentGroup.addAction(centerAct)\n    leftAlignAct.setChecked(True)\n//! [6]\n\n//! [7]\n\n//! [8]\ndef createMenus(self):\n\n//! [9] //! [10]\n    fileMenu = menuBar().addMenu(tr(\"&File\"))\n    fileMenu.addAction(Act)\n//! [9]\n    fileMenu.addAction(openAct)\n//! [10]\n    fileMenu.addAction(saveAct)\n    fileMenu.addAction(printAct)\n//! [11]\n    fileMenu.addSeparator()\n//! [11]\n    fileMenu.addAction(exitAct)\n\n    editMenu = menuBar().addMenu(tr(\"&Edit\"))\n    editMenu.addAction(undoAct)\n    editMenu.addAction(redoAct)\n    editMenu.addSeparator()\n    editMenu.addAction(cutAct)\n    editMenu.addAction(copyAct)\n    editMenu.addAction(pasteAct)\n    editMenu.addSeparator()\n\n    helpMenu = menuBar().addMenu(tr(\"&Help\"))\n    helpMenu.addAction(aboutAct)\n    helpMenu.addAction(aboutQtAct)\n//! [8]\n\n//! [12]\n    formatMenu = editMenu.addMenu(tr(\"&Format\"))\n    formatMenu.addAction(boldAct)\n    formatMenu.addAction(italicAct)\n    formatMenu.addSeparator()->setText(tr(\"Alignment\"))\n    formatMenu.addAction(leftAlignAct)\n    formatMenu.addAction(rightAlignAct)\n    formatMenu.addAction(justifyAct)\n    formatMenu.addAction(centerAct)\n    formatMenu.addSeparator()\n    formatMenu.addAction(setLineSpacingAct)\n    formatMenu.addAction(setParagraphSpacingAct)\n//! [12]\n"
  },
  {
    "path": "doc/codesnippets/examples/mainwindows/sdi/mainwindow.cpp",
    "content": "\n//! [implicit tr context]\ndef createMenus(self):\n    fileMenu = menuBar().addMenu(\"&File\")\n//! [implicit tr context]\n\n//! [0]\n    fileToolBar = addToolBar(\"File\")\n    fileToolBar.addAction(newAct)\n    fileToolBar.addAction(openAct)\n//! [0]\n"
  },
  {
    "path": "doc/codesnippets/examples/painting/svggenerator/window.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QColorDialog>\n#include <QFileDialog>\n#include <QPainter>\n#include <QSvgGenerator>\n#include \"window.h\"\n#include \"displaywidget.h\"\n\nWindow::Window(QWidget *parent)\n    : QWidget(parent)\n{\n    setupUi(this);\n}\n\nvoid Window::updateBackground(int background)\n{\n    displayWidget->setBackground(DisplayWidget::Background(background));\n}\n\nvoid Window::updateColor()\n{\n    QColor color = QColorDialog::getColor(displayWidget->color());\n    if (color.isValid())\n        displayWidget->setColor(color);\n}\n\nvoid Window::updateShape(int shape)\n{\n    displayWidget->setShape(DisplayWidget::Shape(shape));\n}\n\n//! [save SVG]\ndef saveSvg(self):\n    newPath = QFileDialog.getSaveFileName(self, QObject.tr(\"Save SVG\"), path, QObject.tr(\"SVG files (*.svg)\"))\n\n    if newPath.isEmpty():\n        return\n\n    path = newPath\n\n//![configure SVG generator]\n    generator = QSvgGenerator()\n    generator.setFileName(path)\n    generator.setSize(QSize(200, 200))\n    generator.setViewBox(QRect(0, 0, 200, 200))\n    generator.setTitle(QObject.tr(\"SVG Generator Example Drawing\"))\n    generator.setDescription(QObject.tr(\"An SVG drawing created by the SVG Generator Example provided with Qt.\"))\n//![configure SVG generator]\n//![begin painting]\n    painter = QPainter()\n    painter.begin(generator)\n//![begin painting]\n    displayWidget->paint(painter)\n//![end painting]\n    painter.end()\n//![end painting]\n\n//! [save SVG]\n"
  },
  {
    "path": "doc/codesnippets/examples/richtext/textobject/svgtextobject.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the example classes of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef SVGTEXTOBJECT_H\n#define SVGTEXTOBJECT_H\n\n#include <QTextObjectInterface>\n\nQT_BEGIN_NAMESPACE\nclass QTextDocument;\nclass QTextFormat;\nclass QPainter;\nclass QRectF;\nclass QSizeF;\nQT_END_NAMESPACE\n\n//![0] //![1]\nclass SvgTextObject(QObject, QTextObjectInterface):\n    def __init__(self,...):\n        super(SvgTextObject, self).__init__(...)\n        ...\n//![1]\n\npublic:        \n    QSizeF intrinsicSize(QTextDocument *doc, int posInDocument,\n                         const QTextFormat &format);\n    void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc,\n                    int posInDocument, const QTextFormat &format);\n};\n//![0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/examples/sql/querymodel/editablesqlmodel.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtSql>\n\n#include \"editablesqlmodel.h\"\n\nEditableSqlModel::EditableSqlModel(QObject *parent)\n    : QSqlQueryModel(parent)\n{\n}\n\n//! [0]\ndef flags(self, index):\n    flags = QSqlQueryModel.flags(index)\n    if index.column() == 1 or index.column() == 2:\n        flags |= Qt.ItemIsEditable\n    return flags\n//! [0]\n\n//! [1]\ndef setData(self, index, value, role):\n    if index.column() < 1 or index.column() > 2:\n        return False\n\n    primaryKeyIndex = QSqlQueryModel.index(index.row(), 0)\n    id = self.data(primaryKeyIndex).toInt()\n\n    self.clear()\n\n    ok = False\n    if index.column() == 1:\n        ok = self.setFirstName(id, value)\n    else:\n        ok = self.setLastName(id, value)\n    self.refresh()\n    return ok\n}\n//! [1]\n\nvoid EditableSqlModel::refresh()\n{\n    setQuery(\"select * from person\");\n    setHeaderData(0, Qt::Horizontal, QObject::tr(\"ID\"));\n    setHeaderData(1, Qt::Horizontal, QObject::tr(\"First name\"));\n    setHeaderData(2, Qt::Horizontal, QObject::tr(\"Last name\"));\n}\n\n//! [2]\ndef setFirstName(self, personId, firstName):\n    query = QSqlQuery()\n    query.prepare(\"update person set firstname = ? where id = ?\")\n    query.addBindValue(firstName)\n    query.addBindValue(personId)\n    return query.exec()\n//! [2]\n\nbool EditableSqlModel::setLastName(int personId, const QString &lastName)\n{\n    QSqlQuery query;\n    query.prepare(\"update person set lastname = ? where id = ?\");\n    query.addBindValue(lastName);\n    query.addBindValue(personId);\n    return query.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/examples/sql/relationaltablemodel/relationaltablemodel.cpp",
    "content": "######################################\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n# Contact: http://www.qt-project.org/legal\n#\n# This file is part of the example classes of the Qt Toolkit.\n#\n# $QT_BEGIN_LICENSE:LGPL$\n# Commercial License Usage\n# Licensees holding valid commercial Qt licenses may use this file in\n# accordance with the commercial license agreement provided with the\n# Software or, alternatively, in accordance with the terms contained in\n# a written agreement between you and Digia.  For licensing terms and\n# conditions see http://qt.digia.com/licensing.  For further information\n# use the contact form at http://qt.digia.com/contact-us.\n#\n# GNU Lesser General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU Lesser\n# General Public License version 2.1 as published by the Free Software\n# Foundation and appearing in the file LICENSE.LGPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU Lesser General Public License version 2.1 requirements\n# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n#\n# In addition, as a special exception, Digia gives you certain additional\n# rights.  These rights are described in the Digia Qt LGPL Exception\n# version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n#\n# GNU General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU\n# General Public License version 3.0 as published by the Free Software\n# Foundation and appearing in the file LICENSE.GPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU General Public License version 3.0 requirements will be\n# met: http://www.gnu.org/copyleft/gpl.html.\n#\n#\n# $QT_END_LICENSE$\n#\n######################################\n\nfrom PySide.QtGui import *\nfrom PySide.QtSql import *\n\ndef initializeModel(model):\n//! [0]\n    model.setTable(\"employee\")\n//! [0]\n\n    model.setEditStrategy(QSqlTableModel.OnManualSubmit)\n//! [1]\n    model.setRelation(2, QSqlRelation(\"city\", \"id\", \"name\"))\n//! [1] //! [2]\n    model.setRelation(3, QSqlRelation(\"country\", \"id\", \"name\"))\n//! [2]\n\n//! [3]\n    model.setHeaderData(0, Qt.Horizontal, QObject::tr(\"ID\"))\n    model.setHeaderData(1, Qt.Horizontal, QObject::tr(\"Name\"))\n    model.setHeaderData(2, Qt.Horizontal, QObject::tr(\"City\"))\n    model.setHeaderData(3, Qt.Horizontal, QObject::tr(\"Country\"))\n//! [3]\n\n    model.select()\n\n\ndef createView(title, model):\n//! [4]\n    view =  QTableView()\n    view.setModel(model)\n    view.setItemDelegate(QSqlRelationalDelegate(view))\n//! [4]\n    view.setWindowTitle(title)\n    return view\n\n\ndef createRelationalTables():\n    query = QSqlQuery()\n    query.exec_(\"create table employee(id int primary key, name varchar(20), city int, country int)\")\n    query.exec_(\"insert into employee values(1, 'Espen', 5000, 47)\")\n    query.exec_(\"insert into employee values(2, 'Harald', 80000, 49)\")\n    query.exec_(\"insert into employee values(3, 'Sam', 100, 1)\")\n\n    query.exec_(\"create table city(id int, name varchar(20))\")\n    query.exec_(\"insert into city values(100, 'San Jose')\")\n    query.exec_(\"insert into city values(5000, 'Oslo')\")\n    query.exec_(\"insert into city values(80000, 'Munich')\")\n\n    query.exec_(\"create table country(id int, name varchar(20))\")\n    query.exec_(\"insert into country values(1, 'USA')\")\n    query.exec_(\"insert into country values(47, 'Norway')\")\n    query.exec_(\"insert into country values(49, 'Germany')\")\n\n\ndef main():\n\n    app = QApplication([])\n    if !createConnection():\n        return 1\n\n    createRelationalTables()\n\n    model = QSqlRelationalTableModel()\n\n    initializeModel(model)\n\n    view = createView(QObject.tr(\"Relational Table Model\"), model)\n    view.show()\n\n    return app.exec_()\n\n"
  },
  {
    "path": "doc/codesnippets/examples/uitools/textfinder/textfinder.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtUiTools>\n#include <QtGui>\n#include \"textfinder.h\"\n\n//! [0]\ndef __init__(self, parent = None):\n    QWidget.__init__(self. parent)\n    formWidget = self.loadUiFile()\n\n//! [1]\n    self.ui_findButton = qFindChild(QPushButton, self, \"findButton\")\n    self.ui_textEdit = qFindChild(QTextEdit, self, \"textEdit\")\n    self.ui_lineEdit = qFindChild(QLineEdit, self, \"lineEdit\")\n//! [0] //! [1]\n\n//! [2]\n    QMetaObject.connectSlotsByName(self)\n//! [2]\n\n//! [3a]\n    self.loadTextFile()\n//! [3a]\n\n//! [3b]\n    layout = QVBoxLayout()\n    layout.addWidget(formWidget)\n    self.setLayout(layout)\n//! [3b]\n\n//! [3c]\n    self.setWindowTitle(\"Text Finder\")\n    self.isFirstTime = True\n//! [3c]\n\n//! [4]\ndef loadUiFile(self):\n    loader = QUiLoader()\n    return loader.load(\":/forms/textfinder.ui\", self)\n//! [4]\n\n//! [5]\ndef loadTextFile(self):\n    inputFile = QFile(\":/forms/input.txt\")\n    inputFile.open(QIODevice.ReadOnly)\n    in = QTextStream(inputFile)\n    line = in.readAll()\n    inputFile.close()\n\n    self.ui_textEdit.append(line)\n    self.ui_textEdit.setUndoRedoEnabled(False)\n    self.ui_textEdit.setUndoRedoEnabled(True)\n//! [5]\n\n//! [6] //! [7]\n@Slot()\ndef on_findButton_clicked(self):\n    searchString = self.ui_lineEdit.text()\n    document = self.ui_textEdit.document()\n\n    found = False\n\n    if not self.isFirstTime:\n        document.undo()\n\n    if not searchString:\n        QMessageBox.information(self, \"Empty Search Field\",\n                \"The search field is empty. Please enter a word and click Find.\")\n    else:\n        highlightCursor = QTextCursor(document)\n        cursor = QTextCursor(document)\n        cursor.beginEditBlock()\n//! [6]\n        plainFormat = QTextCharFormat(highlightCursor.charFormat())\n        colorFormat = QTextCharFormat(plainFormat)\n        colorFormat.setForeground(Qt.red)\n\n        while not highlightCursor.isNull() and not highlightCursor.atEnd():\n            highlightCursor = document.find(searchString, highlightCursor, QTextDocument.FindWholeWords)\n\n            if not highlightCursor.isNull():\n                found = True\n                highlightCursor.movePosition(QTextCursor.WordRight, QTextCursor.KeepAnchor)\n                highlightCursor.mergeCharFormat(colorFormat)\n//! [8]\n        cursor.endEditBlock()\n//! [7] //! [9]\n        self.isFirstTime = False\n\n        if not found:\n            QMessageBox.information(self, \"Word Not Found\", \"Sorry, the word cannot be found.\");\n//! [8] //! [9]\n"
  },
  {
    "path": "doc/codesnippets/examples/widgets/analogclock/analogclock.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"analogclock.h\"\n\n//! [0] //! [1]\nAnalogClock::AnalogClock(QWidget *parent)\n//! [0] //! [2]\n    : QWidget(parent)\n//! [2] //! [3]\n{\n//! [3] //! [4]\n    timer = QTimer(self)\n//! [4] //! [5]\n    self.connect(timer, SIGNAL(\"timeout()\"), self.update)\n//! [5] //! [6]\n    timer.start(1000)\n//! [6]\n\n    setWindowTitle(tr(\"Analog Clock\"));\n    resize(200, 200);\n//! [7]\n}\n//! [1] //! [7]\n\n//! [8] //! [9]\nvoid AnalogClock::paintEvent(QPaintEvent *)\n//! [8] //! [10]\n{\n    static const QPoint hourHand[3] = {\n        QPoint(7, 8),\n        QPoint(-7, 8),\n        QPoint(0, -40)\n    };\n    static const QPoint minuteHand[3] = {\n        QPoint(7, 8),\n        QPoint(-7, 8),\n        QPoint(0, -70)\n    };\n\n    QColor hourColor(127, 0, 127);\n    QColor minuteColor(0, 127, 127, 191);\n\n    int side = qMin(width(), height());\n    QTime time = QTime::currentTime();\n//! [10]\n\n//! [11]\n    QPainter painter(this);\n//! [11] //! [12]\n    painter.setRenderHint(QPainter::Antialiasing);\n//! [12] //! [13]\n    painter.translate(width() / 2, height() / 2);\n//! [13] //! [14]\n    painter.scale(side / 200.0, side / 200.0);\n//! [9] //! [14]\n\n//! [15]\n    painter.setPen(Qt::NoPen);\n//! [15] //! [16]\n    painter.setBrush(hourColor);\n//! [16]\n\n//! [17] //! [18]\n    painter.save();\n//! [17] //! [19]\n    painter.rotate(30.0 * ((time.hour() + time.minute() / 60.0)));\n    painter.drawConvexPolygon(hourHand, 3);\n    painter.restore();\n//! [18] //! [19]\n\n//! [20]\n    painter.setPen(hourColor);\n//! [20] //! [21]\n\n    for (int i = 0; i < 12; ++i) {\n        painter.drawLine(88, 0, 96, 0);\n        painter.rotate(30.0);\n    }\n//! [21]\n\n//! [22]\n    painter.setPen(Qt::NoPen);\n//! [22] //! [23]\n    painter.setBrush(minuteColor);\n\n//! [24]\n    painter.save();\n    painter.rotate(6.0 * (time.minute() + time.second() / 60.0));\n    painter.drawConvexPolygon(minuteHand, 3);\n    painter.restore();\n//! [23] //! [24]\n\n//! [25]\n    painter.setPen(minuteColor);\n//! [25] //! [26]\n\n//! [27]\n    for (int j = 0; j < 60; ++j) {\n        if ((j % 5) != 0)\n            painter.drawLine(92, 0, 96, 0);\n        painter.rotate(6.0);\n    }\n//! [27]\n}\n//! [26]\n"
  },
  {
    "path": "doc/codesnippets/examples/widgets/groupbox/window.cpp",
    "content": "\n//! [0]\ndef __init__(self, parent = None):\n    QWidget.__init__(self, parent)\n\n    grid = QGridLayout()\n    grid.addWidget(createFirstExclusiveGroup(), 0, 0)\n    grid.addWidget(createSecondExclusiveGroup(), 1, 0)\n    grid.addWidget(createNonExclusiveGroup(), 0, 1)\n    grid.addWidget(createPushButtonGroup(), 1, 1)\n    setLayout(grid)\n\n    setWindowTitle(\"Group Boxes\")\n    resize(480, 320)\n\n//! [0]\n\n//! [1]\ndef createFirstExclusiveGroup(self):\n//! [2]\n    groupBox = QGroupBox(\"Exclusive Radio Buttons\")\n\n    radio1 = QRadioButton(\"&Radio button 1\")\n    radio2 = QRadioButton(\"R&adio button 2\")\n    radio3 = QRadioButton(\"Ra&dio button 3\")\n\n    radio1.setChecked(True)\n//! [1] //! [3]\n\n    vbox = QVBoxLayout()\n    vbox.addWidget(radio1)\n    vbox.addWidget(radio2)\n    vbox.addWidget(radio3)\n    vbox.addStretch(1)\n    groupBox.setLayout(vbox)\n//! [2]\n    return groupBox\n//! [3]\n\n//! [4]\ndef createSecondExclusiveGroup(self):\n    groupBox = QGroupBox(\"E&xclusive Radio Buttons\")\n    groupBox.setCheckable(True)\n    groupBox.setChecked(False)\n//! [4]\n\n//! [5]\n    radio1 = QRadioButton(\"Rad&io button 1\")\n    radio2 = QRadioButton(\"Radi&o button 2\")\n    radio3 = QRadioButton(\"Radio &button 3\")\n    radio1.setChecked(True)\n    checkBox = QCheckBox(\"Ind&ependent checkbox\")\n    checkBox.setChecked(True)\n//! [5]\n\n//! [6]\n    vbox = QVBoxLayout()\n    vbox.addWidget(radio1)\n    vbox.addWidget(radio2)\n    vbox.addWidget(radio3)\n    vbox.addWidget(checkBox)\n    vbox.addStretch(1)\n    groupBox.setLayout(vbox)\n\n    return groupBox\n//! [6]\n\n//! [7]\ndef createNonExclusiveGroup(self):\n    groupBox = QGroupBox(\"Non-Exclusive Checkboxes\")\n    groupBox.setFlat(True)\n//! [7]\n\n//! [8]\n    checkBox1 = QCheckBox(\"&Checkbox 1\")\n    checkBox2 = QCheckBox(\"C&heckbox 2\")\n    checkBox2.setChecked(True)\n    tristateBox = QCheckBox(\"Tri-&state button\")\n    tristateBox.setTristate(True)\n//! [8]\n    tristateBox.setCheckState(Qt.PartiallyChecked)\n\n//! [9]\n    vbox = QVBoxLayout()\n    vbox.addWidget(checkBox1)\n    vbox.addWidget(checkBox2)\n    vbox.addWidget(tristateBox)\n    vbox.addStretch(1)\n    groupBox.setLayout(vbox)\n\n    return groupBox\n//! [9]\n\n//! [10]\ndef createPushButtonGroup(self):\n    groupBox = QGroupBox(\"&Push Buttons\")\n    groupBox.setCheckable(True)\n    groupBox.setChecked(True)\n//! [10]\n\n//! [11]\n    pushButton = QPushButton(\"&Normal Button\")\n    toggleButton = QPushButton(\"&Toggle Button\")\n    toggleButton.setCheckable(True)\n    toggleButton.setChecked(True)\n    flatButton = QPushButton(\"&Flat Button\")\n    flatButton.setFlat(True)\n//! [11]\n\n//! [12]\n    popupButton = QPushButton(\"Pop&up Button\")\n    menu = QMenu(self)\n    menu.addAction(\"&First Item\")\n    menu.addAction(\"&Second Item\")\n    menu.addAction(\"&Third Item\")\n    menu.addAction(\"F&ourth Item\")\n    popupButton.setMenu(menu)\n//! [12]\n\n    newAction = menu.addAction(\"Submenu\")\n    QMenu *subMenu = QMenu(\"Popup Submenu\")\n    subMenu.addAction(\"Item 1\")\n    subMenu.addAction(\"Item 2\")\n    subMenu.addAction(\"Item 3\")\n    newAction.setMenu(subMenu)\n\n//! [13]\n    vbox = QVBoxLayout()\n    vbox.addWidget(pushButton)\n    vbox.addWidget(toggleButton)\n    vbox.addWidget(flatButton)\n    vbox.addWidget(popupButton)\n    vbox.addStretch(1)\n    groupBox.setLayout(vbox)\n\n    return groupBox\n}\n//! [13]\n"
  },
  {
    "path": "doc/codesnippets/examples/widgets/icons/iconsizespinbox.cpp",
    "content": "############################################################################\n##\n## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n## Contact: http://www.qt-project.org/legal\n##\n## This file is part of the example classes of the Qt Toolkit.\n##\n## $QT_BEGIN_LICENSE:LGPL$\n## Commercial License Usage\n## Licensees holding valid commercial Qt licenses may use this file in\n## accordance with the commercial license agreement provided with the\n## Software or, alternatively, in accordance with the terms contained in\n## a written agreement between you and Digia.  For licensing terms and\n## conditions see http://qt.digia.com/licensing.  For further information\n## use the contact form at http://qt.digia.com/contact-us.\n##\n## GNU Lesser General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU Lesser\n## General Public License version 2.1 as published by the Free Software\n## Foundation and appearing in the file LICENSE.LGPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU Lesser General Public License version 2.1 requirements\n## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n##\n## In addition, as a special exception, Digia gives you certain additional\n## rights.  These rights are described in the Digia Qt LGPL Exception\n## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n##\n## GNU General Public License Usage\n## Alternatively, this file may be used under the terms of the GNU\n## General Public License version 3.0 as published by the Free Software\n## Foundation and appearing in the file LICENSE.GPL included in the\n## packaging of this file.  Please review the following information to\n## ensure the GNU General Public License version 3.0 requirements will be\n## met: http://www.gnu.org/copyleft/gpl.html.\n##\n##\n## $QT_END_LICENSE$\n##\n############################################################################\n\n\n//! [0]\ndef __init__(self, parent):\n    QSpinBox.__init__(self, parent)\n\n//! [0]\n\n//! [1]\ndef valueFromText(self, text):\n    regExp = QRegExp(tr(\"(\\\\d+)(\\\\s*[xx]\\\\s*\\\\d+)?\"))\n\n    if regExp.exactMatch(text):\n        return regExp.cap(1).toInt()\n    else:\n        return 0\n//! [1]\n\n//! [2]\ndef textFromValue(self, value):\n    return self.tr(\"%1 x %1\").arg(value)\n\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/examples/widgets/spinboxes/window.cpp",
    "content": "######################################\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n# Contact: http://www.qt-project.org/legal\n#\n# This file is part of the example classes of the Qt Toolkit.\n#\n# $QT_BEGIN_LICENSE:LGPL$\n# Commercial License Usage\n# Licensees holding valid commercial Qt licenses may use this file in\n# accordance with the commercial license agreement provided with the\n# Software or, alternatively, in accordance with the terms contained in\n# a written agreement between you and Digia.  For licensing terms and\n# conditions see http://qt.digia.com/licensing.  For further information\n# use the contact form at http://qt.digia.com/contact-us.\n#\n# GNU Lesser General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU Lesser\n# General Public License version 2.1 as published by the Free Software\n# Foundation and appearing in the file LICENSE.LGPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU Lesser General Public License version 2.1 requirements\n# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n#\n# In addition, as a special exception, Digia gives you certain additional\n# rights.  These rights are described in the Digia Qt LGPL Exception\n# version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n#\n# GNU General Public License Usage\n# Alternatively, this file may be used under the terms of the GNU\n# General Public License version 3.0 as published by the Free Software\n# Foundation and appearing in the file LICENSE.GPL included in the\n# packaging of this file.  Please review the following information to\n# ensure the GNU General Public License version 3.0 requirements will be\n# met: http://www.gnu.org/copyleft/gpl.html.\n#\n#\n# $QT_END_LICENSE$\n#\n######################################\n\nfrom PySide.QtGui import *\n\n//! [0]\ndef __init__(self):\n    createSpinBoxes()\n    createDateTimeEdits()\n    createDoubleSpinBoxes()\n\n    layout =  QHBoxLayout()\n    layout.addWidget(spinBoxesGroup)\n    layout.addWidget(editsGroup)\n    layout.addWidget(doubleSpinBoxesGroup)\n    setLayout(layout)\n\n    setWindowTitle(tr(\"Spin Boxes\"))\n//! [0]\n\n//! [1]\ndef createSpinBoxes(self):\n    spinBoxesGroup =  QGroupBox(tr(\"Spinboxes\"))\n\n    integerLabel = QLabel(tr(\"Enter a value between \"\n                             \"%1 and %2:\").arg(-20).arg(20))\n    integerSpinBox = QSpinBox()\n    integerSpinBox.setRange(-20, 20)\n    integerSpinBox.setSingleStep(1)\n    integerSpinBox.setValue(0)\n//! [1]\n\n//! [2]\n    zoomLabel = QLabel(tr(\"Enter a zoom value between \"\n                          \"%1 and %2:\").arg(0).arg(1000))\n//! [3]\n    zoomSpinBox =  QSpinBox()\n    zoomSpinBox.setRange(0, 1000)\n    zoomSpinBox.setSingleStep(10)\n    zoomSpinBox.setSuffix(\"%\")\n    zoomSpinBox.setSpecialValueText(tr(\"Automatic\"))\n    zoomSpinBox.setValue(100)\n//! [2] //! [3]\n\n//! [4]\n    priceLabel = QLabel(tr(\"Enter a price between \"\n                           \"%1 and %2:\").arg(0).arg(999))\n    priceSpinBox = QSpinBox()\n    priceSpinBox.setRange(0, 999)\n    priceSpinBox.setSingleStep(1)\n    priceSpinBox.setPrefix(\"$\")\n    priceSpinBox.setValue(99)\n//! [4] //! [5]\n\n    spinBoxLayout =  QVBoxLayout()\n    spinBoxLayout.addWidget(integerLabel)\n    spinBoxLayout.addWidget(integerSpinBox)\n    spinBoxLayout.addWidget(zoomLabel)\n    spinBoxLayout.addWidget(zoomSpinBox)\n    spinBoxLayout.addWidget(priceLabel)\n    spinBoxLayout.addWidget(priceSpinBox)\n    spinBoxesGroup.setLayout(spinBoxLayout)\n\n//! [5]\n\n//! [6]\ndef createDateTimeEdits(self):\n    editsGroup =  QGroupBox(tr(\"Date and time spin boxes\"))\n\n    dateLabel = QLabel()\n    dateEdit = QDateEdit(QDate.currentDate())\n    dateEdit.setDateRange(QDate(2005, 1, 1), QDate(2010, 12, 31))\n    dateLabel.setText(tr(\"Appointment date (between %0 and %1):\")\n                       .arg(dateEdit.minimumDate().toString(Qt.ISODate))\n                       .arg(dateEdit.maximumDate().toString(Qt.ISODate)))\n//! [6]\n\n//! [7]\n    timeLabel =  QLabel()\n    timeEdit =  QTimeEdit(QTime.currentTime())\n    timeEdit.setTimeRange(QTime(9, 0, 0, 0), QTime(16, 30, 0, 0))\n    timeLabel.setText(tr(\"Appointment time (between %0 and %1):\")\n                       .arg(timeEdit.minimumTime().toString(Qt.ISODate))\n                       .arg(timeEdit.maximumTime().toString(Qt.ISODate)))\n//! [7]\n\n//! [8]\n    meetingLabel = QLabel()\n    meetingEdit = QDateTimeEdit(QDateTime.currentDateTime())\n//! [8]\n\n//! [9]\n    formatLabel = QLabel(tr(\"Format string for the meeting date \"\n                            \"and time:\"))\n    formatComboBox = QComboBox()\n    formatComboBox.addItem(\"yyyy-MM-dd hh:mm:ss (zzz 'ms')\")\n    formatComboBox.addItem(\"hh:mm:ss MM/dd/yyyy\")\n    formatComboBox.addItem(\"hh:mm:ss dd/MM/yyyy\")\n    formatComboBox.addItem(\"hh:mm:ss\")\n    formatComboBox.addItem(\"hh:mm ap\")\n//! [9] //! [10]\n\n    connect(formatComboBox, SIGNAL(\"activated(const QString &)\"),\n            self, SLOT(\"setFormatString(const QString &)\"))\n//! [10]\n\n    setFormatString(formatComboBox.currentText())\n\n//! [11]\n    editsLayout = QVBoxLayout()\n    editsLayout.addWidget(dateLabel)\n    editsLayout.addWidget(dateEdit)\n    editsLayout.addWidget(timeLabel)\n    editsLayout.addWidget(timeEdit)\n    editsLayout.addWidget(meetingLabel)\n    editsLayout.addWidget(meetingEdit)\n    editsLayout.addWidget(formatLabel)\n    editsLayout.addWidget(formatComboBox)\n    editsGroup.setLayout(editsLayout)\n//! [11]\n\n//! [12]\ndef setFormatString(self, formatString):\n    meetingEdit.setDisplayFormat(formatString)\n//! [12] //! [13]\n    if meetingEdit.displayedSections() & QDateTimeEdit.DateSections_Mask:\n        meetingEdit.setDateRange(QDate(2004, 11, 1), QDate(2005, 11, 30))\n        meetingLabel.setText(tr(\"Meeting date (between %0 and %1):\")\n            .arg(meetingEdit.minimumDate().toString(Qt.ISODate))\n\t    .arg(meetingEdit.maximumDate().toString(Qt.ISODate)))\n    else:\n        meetingEdit.setTimeRange(QTime(0, 7, 20, 0), QTime(21, 0, 0, 0))\n        meetingLabel.setText(tr(\"Meeting time (between %0 and %1):\")\n            .arg(meetingEdit.minimumTime().toString(Qt.ISODate))\n\t    .arg(meetingEdit.maximumTime().toString(Qt.ISODate)))\n//! [13]\n\n//! [14]\ndef createDoubleSpinBoxes():\n    doubleSpinBoxesGroup =  QGroupBox(tr(\"Double precision spinboxes\"))\n\n    precisionLabel = QLabel(tr(\"Number of decimal places \"\n                               \"to show:\"))\n    precisionSpinBox = QSpinBox()\n    precisionSpinBox.setRange(0, 100)\n    precisionSpinBox.setValue(2)\n//! [14]\n\n//! [15]\n    doubleLabel = QLabel(tr(\"Enter a value between \"\n                            \"%1 and %2:\").arg(-20).arg(20))\n    doubleSpinBox =  QDoubleSpinBox ()\n    doubleSpinBox.setRange(-20.0, 20.0)\n    doubleSpinBox.setSingleStep(1.0)\n    doubleSpinBox.setValue(0.0)\n//! [15]\n\n//! [16]\n    scaleLabel = QLabel(tr(\"Enter a scale factor between \"\n                           \"%1 and %2:\").arg(0).arg(1000.0))\n    scaleSpinBox =  QDoubleSpinBox()\n    scaleSpinBox.setRange(0.0, 1000.0)\n    scaleSpinBox.setSingleStep(10.0)\n    scaleSpinBox.setSuffix(\"%\")\n    scaleSpinBox.setSpecialValueText(tr(\"No scaling\"))\n    scaleSpinBox.setValue(100.0)\n//! [16]\n\n//! [17]\n    priceLabel = QLabel(tr(\"Enter a price between \"\n                           \"%1 and %2:\").arg(0).arg(1000))\n    priceSpinBox = QDoubleSpinBox()\n    priceSpinBox.setRange(0.0, 1000.0)\n    priceSpinBox.setSingleStep(1.0)\n    priceSpinBox.setPrefix(\"$\")\n    priceSpinBox.setValue(99.99)\n\n    connect(precisionSpinBox, SIGNAL(\"valueChanged(int)\"),\n//! [17]\n            self, SLOT(\"changePrecision(int))\")\n\n//! [18]\n    spinBoxLayout =  QVBoxLayout()\n    spinBoxLayout.addWidget(precisionLabel)\n    spinBoxLayout.addWidget(precisionSpinBox)\n    spinBoxLayout.addWidget(doubleLabel)\n    spinBoxLayout.addWidget(doubleSpinBox)\n    spinBoxLayout.addWidget(scaleLabel)\n    spinBoxLayout.addWidget(scaleSpinBox)\n    spinBoxLayout.addWidget(priceLabel)\n    spinBoxLayout.addWidget(priceSpinBox)\n    doubleSpinBoxesGroup.setLayout(spinBoxLayout)\n}\n//! [18]\n\n//! [19]\ndef changePrecision(self, int)\n    doubleSpinBox.setDecimals(decimals)\n    scaleSpinBox.setDecimals(decimals)\n    priceSpinBox.setDecimals(decimals)\n\n//! [19]\n"
  },
  {
    "path": "doc/codesnippets/examples/xml/streambookmarks/xbelreader.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"xbelreader.h\"\n\n//! [0]\nXbelReader::XbelReader(QTreeWidget *treeWidget)\n    : treeWidget(treeWidget)\n{\n    QStyle *style = treeWidget->style();\n\n    folderIcon.addPixmap(style->standardPixmap(QStyle::SP_DirClosedIcon),\n                         QIcon::Normal, QIcon::Off);\n    folderIcon.addPixmap(style->standardPixmap(QStyle::SP_DirOpenIcon),\n                         QIcon::Normal, QIcon::On);\n    bookmarkIcon.addPixmap(style->standardPixmap(QStyle::SP_FileIcon));\n}\n//! [0]\n\n//! [1]\ndef read(self, device):\n    self.setDevice(device)\n\n    while not atEnd():\n        readNext()\n\n        if isStartElement():\n            if self.name() == \"xbel\" and self.attributes().value(\"version\") == \"1.0\":\n                self.readXBEL()\n            else:\n                self.raiseError(QObject.tr(\"The file is not an XBEL version 1.0 file.\"));\n\n    return not self.error();\n//! [1]\n\n//! [2]\nvoid XbelReader::readUnknownElement()\n{\n    Q_ASSERT(isStartElement());\n\n    while (!atEnd()) {\n        readNext();\n\n        if (isEndElement())\n            break;\n\n        if (isStartElement())\n            readUnknownElement();\n    }\n}\n//! [2]\n\n//! [3]\nvoid XbelReader::readXBEL()\n{\n    Q_ASSERT(isStartElement() && name() == \"xbel\");\n\n    while (!atEnd()) {\n        readNext();\n\n        if (isEndElement())\n            break;\n\n        if (isStartElement()) {\n            if (name() == \"folder\")\n                readFolder(0);\n            else if (name() == \"bookmark\")\n                readBookmark(0);\n            else if (name() == \"separator\")\n                readSeparator(0);\n            else\n                readUnknownElement();\n        }\n    }\n}\n//! [3]\n\n//! [4]\nvoid XbelReader::readTitle(QTreeWidgetItem *item)\n{\n    Q_ASSERT(isStartElement() && name() == \"title\");\n\n    QString title = readElementText();\n    item->setText(0, title);\n}\n//! [4]\n\n//! [5]\nvoid XbelReader::readSeparator(QTreeWidgetItem *item)\n{\n    QTreeWidgetItem *separator = createChildItem(item);\n    separator->setFlags(item->flags() & ~Qt::ItemIsSelectable);\n    separator->setText(0, QString(30, 0xB7));\n    readElementText();\n}\n//! [5]\n\nvoid XbelReader::readFolder(QTreeWidgetItem *item)\n{\n    Q_ASSERT(isStartElement() && name() == \"folder\");\n\n    QTreeWidgetItem *folder = createChildItem(item);\n    bool folded = (attributes().value(\"folded\") != \"no\");\n    treeWidget->setItemExpanded(folder, !folded);\n\n    while (!atEnd()) {\n        readNext();\n\n        if (isEndElement())\n            break;\n\n        if (isStartElement()) {\n            if (name() == \"title\")\n                readTitle(folder);\n            else if (name() == \"folder\")\n                readFolder(folder);\n            else if (name() == \"bookmark\")\n                readBookmark(folder);\n            else if (name() == \"separator\")\n                readSeparator(folder);\n            else\n                readUnknownElement();\n        }\n    }\n}\n\nvoid XbelReader::readBookmark(QTreeWidgetItem *item)\n{\n    Q_ASSERT(isStartElement() && name() == \"bookmark\");\n\n    QTreeWidgetItem *bookmark = createChildItem(item);\n    bookmark->setFlags(bookmark->flags() | Qt::ItemIsEditable);\n    bookmark->setIcon(0, bookmarkIcon);\n    bookmark->setText(0, QObject::tr(\"Unknown title\"));\n    bookmark->setText(1, attributes().value(\"href\").toString());\n    while (!atEnd()) {\n        readNext();\n\n        if (isEndElement())\n            break;\n\n        if (isStartElement()) {\n            if (name() == \"title\")\n                readTitle(bookmark);\n            else\n                readUnknownElement();\n        }\n    }\n}\n\nQTreeWidgetItem *XbelReader::createChildItem(QTreeWidgetItem *item)\n{\n    QTreeWidgetItem *childItem;\n    if (item) {\n        childItem = new QTreeWidgetItem(item);\n    } else {\n        childItem = new QTreeWidgetItem(treeWidget);\n    }\n    childItem->setData(0, Qt::UserRole, name().toString());\n    return childItem;\n}\n"
  },
  {
    "path": "doc/codesnippets/examples/xml/streambookmarks/xbelreader.h",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef XBELREADER_H\n#define XBELREADER_H\n\n#include <QIcon>\n#include <QXmlStreamReader>\n\nQT_BEGIN_NAMESPACE\nclass QTreeWidget;\nclass QTreeWidgetItem;\nQT_END_NAMESPACE\n\n//! [0]\nclass XbelReader (QXmlStreamReader):\n//! [1]\n    def __init__(self, treeWidget):\n        ...\n//! [1]\n\n    def read(self, device);\n        ...\n\n//! [2]\n    def readUnknownElement(self):\n        ...\n    def readXBEL(self):\n        ...\n    def readTitle(self, item):\n        ...\n    def readSeparator(self, item):\n        ...\n    def readFolder(self, item):\n        ...\n    def readBookmark(self, item):\n        ...\n    def createChildItem(self, item):\n        ...\n//! [2]\n//! [0]\n\n#endif\n"
  },
  {
    "path": "doc/codesnippets/examples/xml/streambookmarks/xbelwriter.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\n#include \"xbelwriter.h\"\n\n//! [0]\nXbelWriter::XbelWriter(QTreeWidget *treeWidget)\n    : treeWidget(treeWidget)\n{\n    setAutoFormatting(true);\n}\n//! [0]\n\n//! [1]\ndef writeFile(self, device):\n    self.setDevice(device)\n\n    self.writeStartDocument()\n    self.writeDTD(\"<!DOCTYPE xbel>\")\n    self.writeStartElement(\"xbel\")\n    self.writeAttribute(\"version\", \"1.0\")\n    for i in range(0, self.treeWidget.topLevelItemCount()):\n        self.writeItem(self.treeWidget.topLevelItem(i))\n\n    self.writeEndDocument()\n    return True;\n//! [1]\n\n//! [2]\nvoid XbelWriter::writeItem(QTreeWidgetItem *item)\n{\n    QString tagName = item->data(0, Qt::UserRole).toString();\n    if (tagName == \"folder\") {\n        bool folded = !treeWidget->isItemExpanded(item);\n        writeStartElement(tagName);\n        writeAttribute(\"folded\", folded ? \"yes\" : \"no\");\n        writeTextElement(\"title\", item->text(0));\n        for (int i = 0; i < item->childCount(); ++i)\n            writeItem(item->child(i));\n        writeEndElement();\n    } else if (tagName == \"bookmark\") {\n        writeStartElement(tagName);\n        if (!item->text(1).isEmpty())\n            writeAttribute(\"href\", item->text(1));\n        writeTextElement(\"title\", item->text(0));\n        writeEndElement();\n    } else if (tagName == \"separator\") {\n        writeEmptyElement(tagName);\n    }\n}\n//! [2]\n"
  },
  {
    "path": "doc/codesnippets/snippets/customstyle/main.cpp",
    "content": "\n//! [using a custom style]\nimport sys\nfrom PySide.QtGui import *\n\nQApplication.setStyle(CustomStyle())\napp = QApplication(sys.argv)\nspinBox = QSpinBox()\nspinBox.show()\nsys.exit(app.exec_())\n\n//! [using a custom style]\n"
  },
  {
    "path": "doc/codesnippets/snippets/phonon/samplebackend/main.cpp",
    "content": "\n//! [snippet]\ndef createObject(self, c, parent, args):\n    if c == BackendInterface.MediaObjectClass:\n        return MediaObject(parent)\n    elif c == BackendInterface.VolumeFaderEffectClass:\n        return VolumeFaderEffect(parent)\n    elif c == BackendInterface.AudioOutputClass:\n        return AudioOutput(parent)\n    elif c == BackendInterface.AudioDataOutputClass:\n        return AudioDataOutput(parent)\n    elif c == BackendInterface.VisualizationClass:\n        return Visualization(parent)\n    elif c == BackendInterface.VideoDataOutputClass:\n        return VideoDataOutput(parent)\n    elif c == BackendInterface.EffectClass:\n        return Effect(args[0].toInt(), parent)\n    elif c == BackendInterface.VideoWidgetClass:\n        return VideoWidget(parent)\n    return None\n\ndef objectDescriptionIndexes(self, type_):\n    retval = set()\n\n    if type_ == Phonon.AudioOutputDeviceType:\n        # use AudioDeviceEnumerator to list ALSA and OSS devices\n        retval.add(10000)\n        retval.add(10001)\n    elif type_ == Phonon.AudioCaptureDeviceType:\n        retval.add(20000)\n        retval.add(20001)\n    elif type_ == Phonon.VideoCaptureDeviceType:\n        retval.add(30000)\n        retval.add(30001)\n    elif type_ == Phonon.EffectType:\n        retval.add(0x7F000001)\n    return retval\n\ndef objectDescriptionProperties(self, type_, index):\n    ret = {}\n    if type_ == Phonon.AudioOutputDeviceType:\n        if index == 10000:\n            ret[\"name\"] = \"internal Soundcard\"\n        elif index == 10001:\n            ret[\"name\"] = \"USB Headset\"\n            ret[\"available\"] = False\n    elif type_ == Phonon.AudioCaptureDeviceType:\n        if index == 20000:\n            ret[\"name\"] = \"Soundcard\"\n            ret[\"description\"] = \"first description\"\n        elif index == 20001:\n            ret[\"name\"] = \"DV\"\n            ret[\"description\"] = \"second description\"\n    elif type_ == Phonon.VideoCaptureDeviceType:\n        elif index == 30000:\n            ret[\"name\"] = \"USB Webcam\"\n            ret[\"description\"] = \"first description\"\n        elif index == 30001:\n            ret[\"name\"] = \"DV\"))\n            ret[\"description\"] = \"second description\"\n    elif type_ == Phonon.EffectType:\n        if index == 0x7F000001:\n            ret[\"name\"] = \"Delay\"\n            ret[\"description\"] = \"Simple delay effect with time, feedback and level controls.\"\n    return ret\n//! [snippet]\n"
  },
  {
    "path": "doc/codesnippets/snippets/phonon.cpp",
    "content": "\n//![0]\nmusic = Phonon.createPlayer(Phonon.MusicCategory, Phonon.MediaSource(\"/path/mysong.wav\"))\nmusic.play()\n//![0]\n\nparentWidget = QWidget()\nurl = QUrl(\"Myfancymusic\")\n\n//![1]\nplayer = Phonon.VideoPlayer(Phonon.VideoCategory, parentWidget)\nplayer.play(url)\n//![1]\n\n//![2]\nmediaObject = Phonon.MediaObject(self)\nmediaObject.setCurrentSource(Phonon.MediaSource(\"/mymusic/barbiegirl.wav\"))\naudioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)\npath = Phonon.createPath(mediaObject, audioOutput)\n//![2]\n\n//![3]\neffect = Phonon.Effect(Phonon.BackendCapabilities.availableAudioEffects()[0], self)\npath.insertEffect(effect)\n//![3]\n\n//![4]\nmediaObject = Phonon.MediaObject(self)\n\nvideoWidget = Phonon.VideoWidget(self)\nPhonon.createPath(mediaObject, videoWidget)\n\naudioOutput = Phonon.AudioOutput(Phonon.VideoCategory, self)\nPhonon.createPath(mediaObject, audioOutput)\n//![4]\n\n//![5]\nmediaObject.play()\n//![5]\n"
  },
  {
    "path": "doc/codesnippets/snippets/textdocument-resources/main.cpp",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the documentation of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and Digia.  For licensing terms and\n** conditions see http://qt.digia.com/licensing.  For further information\n** use the contact form at http://qt.digia.com/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 2.1 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU Lesser General Public License version 2.1 requirements\n** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n**\n** In addition, as a special exception, Digia gives you certain additional\n** rights.  These rights are described in the Digia Qt LGPL Exception\n** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 3.0 as published by the Free Software\n** Foundation and appearing in the file LICENSE.GPL included in the\n** packaging of this file.  Please review the following information to\n** ensure the GNU General Public License version 3.0 requirements will be\n** met: http://www.gnu.org/copyleft/gpl.html.\n**\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#include <QtGui>\n\nQString tr(const char *text)\n{\n    return QApplication::translate(text, text);\n}\n\nint main(int argc, char *argv[])\n{\n    QApplication app(argc, argv);\n    QTextEdit *editor = new QTextEdit;\n\n    QTextDocument *document = new QTextDocument(editor);\n    QTextCursor cursor(document);\n\n    QImage image(64, 64, QImage::Format_RGB32);\n    image.fill(qRgb(255, 160, 128));\n\n//! [Adding a resource]\n    document.addResource(QTextDocument.ImageResource,\n        QUrl(\"mydata://image.png\"), image)\n//! [Adding a resource]\n\n//! [Inserting an image with a cursor]\n    imageFormat = QTextImageFormat()\n    imageFormat.setName(\"mydata://image.png\")\n    cursor.insertImage(imageFormat)\n//! [Inserting an image with a cursor]\n\n    cursor.insertBlock();\n    cursor.insertText(\"Code less. Create more.\");\n\n    editor->setDocument(document);\n    editor->setWindowTitle(tr(\"Text Document Images\"));\n    editor->resize(320, 480);\n    editor->show();\n\n//! [Inserting an image using HTML]\n    editor.append(\"<img src=\\\"mydata://image.png\\\" />\")\n//! [Inserting an image using HTML]\n\n    return app.exec();\n}\n"
  },
  {
    "path": "doc/codesnippets/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp",
    "content": "\ndef wrapInFunction():\n//! [0]\n    # ...\n    page = QWebPage()\n    # ...\n\n    inspector = QWebInspector()\n    inspector.setPage(page)\n//! [0]\n\n"
  },
  {
    "path": "doc/codesnippets/webkitsnippets/qtwebkit_qwebview_snippet.cpp",
    "content": "\ndef wrapInFunction():\n//! [0]\n    view.page().history()\n//! [0]\n\n\n//! [1]\n    view.page().settings()\n//! [1]\n\n\n//! [2]\n    view.triggerAction(QWebPage.Copy)\n//! [2]\n\n\n//! [3]\n    view.page().triggerPageAction(QWebPage.Stop)\n//! [3]\n\n\n//! [4]\n    view.page().triggerPageAction(QWebPage.GoBack)\n//! [4]\n\n\n//! [5]\n    view.page().triggerPageAction(QWebPage.GoForward)\n//! [5]\n\n"
  },
  {
    "path": "doc/codesnippets/webkitsnippets/simple/main.cpp",
    "content": "\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtWebKit import *\nimport sys\n\napp = QApplication(sys.argv)\nparent = None\n//! [Using QWebView]\nview = QWebView(parent)\nview.load(QUrl(\"http://qt.nokia.com/\"))\nview.show()\n//! [Using QWebView]\nsys.exit(app.exec_())\n"
  },
  {
    "path": "doc/codesnippets/webkitsnippets/webelement/main.cpp",
    "content": "\ndef traverse():\n//! [Traversing with QWebElement]\n    frame.setHtml(\"<html><body><p>First Paragraph</p><p>Second Paragraph</p></body></html>\")\n    doc = frame.documentElement()\n    body = doc.firstChild()\n    firstParagraph = body.firstChild()\n    secondParagraph = firstParagraph.nextSibling()\n//! [Traversing with QWebElement]\n\ndef findButtonAndClick():\n    frame.setHtml(\"<form name=\\\"myform\\\" action=\\\"submit_form.asp\\\" method=\\\"get\\\">\" \\\n                   \"<input type=\\\"text\\\" name=\\\"myfield\\\">\" \\\n                   \"<input type=\\\"submit\\\" value=\\\"Submit\\\">\" \\\n                   \"</form>\")\n\n//! [Calling a DOM element method]\n\n    document = frame.documentElement()\n    # Assume that the document has the following structure:\n    #\n    #    <form name=\"myform\" action=\"submit_form.asp\" method=\"get\">\n    #        <input type=\"text\" name=\"myfield\">\n    #        <input type=\"submit\" value=\"Submit\">\n    #    </form>\n\n    button = document.findFirst(\"input[type=submit]\")\n    button.evaluateJavaScript(\"click()\")\n\n//! [Calling a DOM element method]\n\ndef autocomplete1():\n    document = frame.documentElement()\n//! [autocomplete1]\n    firstTextInput = document.findFirst(\"input[type=text]\")\n    storedText = firstTextInput.attribute(\"value\")\n//! [autocomplete1]\n\ndef autocomplete2():\n    document = frame.documentElement()\n    storedText = \"text\"\n\n//! [autocomplete2]\n    firstTextInput = document.findFirst(\"input[type=text]\")\n    textInput.setAttribute(\"value\", storedText)\n//! [autocomplete2]\n\ndef findAll():\n//! [FindAll]\n    document = frame.documentElement()\n    # Assume the document has the following structure:\n    #\n    #   <p class=intro>\n    #     <span>Intro</span>\n    #     <span>Snippets</span>\n    #   </p>\n    #   <p>\n    #     <span>Content</span>\n    #     <span>Here</span>\n    #   </p>\n\n//! [FindAll intro]\n    allSpans = document.findAll(\"span\")\n    introSpans = document.findAll(\"p.intro span\")\n//! [FindAll intro] //! [FindAll]\n"
  },
  {
    "path": "doc/codesnippets/webkitsnippets/webpage/main.cpp",
    "content": "//! [0]\nclass Thumbnailer (QObject):\n    def __init__(self, url):\n//! [1]\n        QObject.__init__(self)\n        self.page = QWebPage()\n        self.page.mainFrame().load(url)\n        page.loadFinished[bool].connect(self.render)\n//! [1]\n\n    finished = Signal()\n\n//! [2]\n    def render(self):\n        self.page.setViewportSize(self.page.mainFrame().contentsSize())\n        image = QImage(self.page.viewportSize(), QImage.Format_ARGB32)\n        painter = QPainter(image)\n\n        self.page.mainFrame().render(painter)\n        painter.end()\n\n        thumbnail = image.scaled(400, 400)\n        thumbnail.save(\"thumbnail.png\")\n\n        self.finished.emit()\n//! [2]\n//! [0]\n\napp = QApplication(sys.argv)\n\nthumbnail = Thumbnailer(QUrl(\"http://qt.nokia.com\"))\nthumbnail.finished.connect(app.quit)\nsys.exit(app.exec_())\n"
  },
  {
    "path": "doc/conf.py.in",
    "content": "# -*- coding: utf-8 -*-\n#\n# PySide documentation build configuration file, created by\n# sphinx-quickstart on Wed Apr 22 15:04:20 2009.\n#\n# This file is execfile()d with the current directory set to its containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys, os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\nsys.path.append('@CMAKE_CURRENT_SOURCE_DIR@')\nsys.path.append('@pyside_BINARY_DIR@')\n\n# -- General configuration -----------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be extensions\n# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.\nextensions = ['sphinx.ext.todo', 'sphinx.ext.graphviz', 'inheritance_diagram', 'pysideinclude']\n\nrst_epilog = \"\"\"\n.. |project| replace:: PySide\n\"\"\"\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\nsource_encoding = 'utf-8'\n\n# The master toctree document.\nmaster_doc = 'contents'\n\n# General information about the project.\nproject = u'PySide'\ncopyright = u'2009-2011, Nokia Corporation'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '@BINDING_API_VERSION@'\n# The full version, including alpha/beta/rc tags.\nrelease = '@BINDING_API_VERSION_FULL@'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of documents that shouldn't be included in the build.\n#unused_docs = []\n\n# List of directories, relative to source directory, that shouldn't be searched\n# for source files.\nexclude_trees = ['_build', 'extras']\n\n# The reST default role (used for this markup: `text`) to use for all documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\nadd_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n\n# -- Options for HTML output ---------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  Major themes that come with\n# Sphinx are currently 'default' and 'sphinxdoc'.\nhtml_theme = 'pysidedocs'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {\n#}\n\n# Add any paths that contain custom themes here, relative to this directory.\nhtml_theme_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_themes']\n\n# The name for this set of Sphinx documents.  If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar.  Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\n#html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_static']\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\nhtml_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = { '' : ''}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\nhtml_additional_pages = { 'index' : 'index.html'}\n\n# If false, no module index is generated.\n#html_use_modindex = True\n\n# If false, no index is generated.\nhtml_use_index = False\n\n# If true, the index is split into individual pages for each letter.\nhtml_split_index = False\n\n# If true, links to the reST sources are added to the pages.\nhtml_show_sourcelink = False\n\nhtml_add_permalinks = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it.  The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# If nonempty, this is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = ''\n\n# Output file base name for HTML help builder.\n#htmlhelp_basename = 'PySideDoc'\n"
  },
  {
    "path": "doc/contents.rst",
    "content": "PySide Documentation contents\n*****************************\n\n.. toctree::\n    :maxdepth: 2\n\n    modules.rst\n\nTutorials\n=========\n\n.. toctree::\n    :maxdepth: 2\n\n    tutorials/index.rst\n\nOther stuff\n===========\n\n.. toctree::\n    :maxdepth: 1\n\n    pysideapi2.rst\n    pysideversion.rst\n\nModule Index\n============\n\n* :ref:`modindex`\n\n"
  },
  {
    "path": "doc/extras/PySide.QtCore.ClassInfo.rst",
    "content": ".. module:: PySide.QtCore\n.. _ClassInfo:\n\nClassInfo\n*********\n\nThis class is used to associates extra information to the class, which is available\nusing QObject.metaObject(). Qt and PySide doesn't use this information.\n\nThe extra information takes the form of a dictionary with key and value in a literal string.\n\n.. note:: This Class is a implementation of Q_CLASSINFO macro.\n   \n\nExample\n-------\n\n::\n\n    @ClassInfo(Author='PySide Team', URL='http://www.pyside.org')\n    class MyObject(QObject):\n        ...\n\n"
  },
  {
    "path": "doc/extras/PySide.QtCore.Signal.rst",
    "content": ".. module:: PySide.QtCore\n.. _Signal:\n\nSignal\n******\n\nSynopsis\n--------\n\nFunctions\n^^^^^^^^^\n\n+---------------------------------------------------------------------------------------------+\n|def :meth:`connect<Signal.connect>` (receiver)                                               |\n+---------------------------------------------------------------------------------------------+\n|def :meth:`disconnect<Signal.disconnect>` (receiver)                                         |\n+---------------------------------------------------------------------------------------------+\n|def :meth:`emit<Signal.disconnect>` (\\*args)                                                 |\n+---------------------------------------------------------------------------------------------+\n\nDetailed Description\n--------------------\n\n    The :class:`~.Signal` class provides a way to declare and connect Qt signals in a pythonic way.\n\n    PySide adopt PyQt's new signal and slot syntax as-is. The PySide implementation is functionally compatible with the PyQt 4.5 one, with the exceptions listed bellow.\n\n.. method:: Signal.connect(receiver[, type=Qt.AutoConnection])\n\n    Create a connection between this signal and a `receiver`, the `receiver` can be a Python callable, a :class:`Slot` or a :class:`Signal`.\n\n.. method:: Signal.disconnect(receiver)\n\n    Disconnect this signal from a `receiver`, the `receiver` can be a Python callable, a :class:`Slot` or a :class:`Signal`.\n\n.. method:: Signal.emit(*args)\n\n    `args` is the arguments to pass to any connected slots, if any.\n\n"
  },
  {
    "path": "doc/extras/PySide.QtCore.Slot.rst",
    "content": ".. module:: PySide.QtCore\n.. _Slot:\n\nSlot\n****\n\nDetailed Description\n--------------------\n\n    PySide adopt PyQt's new signal and slot syntax as-is. The PySide\n    implementation is functionally compatible with the PyQt 4.5 one, with the\n    exceptions listed bellow.\n\n    PyQt's new signal and slot style utilizes method and decorator names\n    specific to their implementation. These will be generalized according to\n    the table below:\n\n    =======  ======================  =============\n    Module   PyQt factory function   PySide class\n    =======  ======================  =============\n    QtCore   pyqtSignal              Signal\n    QtCore   pyqtSlot                Slot\n    =======  ======================  =============\n\nQ_INVOKABLE\n-----------\n\n    PySide doesn't offer something identical to Q_INVOKABLE macro of Qt, the\n    reason is simple, PySide slots can have return values, so if you need to\n    create a invokable method that returns some value, declare it as a slot,\n    e.g.:\n\n    ::\n\n        class Foo(QObject):\n\n            @Slot(result=int, float)\n            def getFloatReturnInt(self, f):\n                return int(f)\n"
  },
  {
    "path": "doc/extras/PySide.QtCore.rst",
    "content": "All other Qt modules rely on this module. To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtCore\n"
  },
  {
    "path": "doc/extras/PySide.QtDeclarative.ListProperty.rst",
    "content": ".. module:: PySide.QtDeclarative\n.. _ListProperty:\n\nListProperty\n************\n\nSynopsis\n--------\n\n    The The :class:`~.ListProperty` class allows applications to expose list-like properties to QML.\n\nDetailed Description\n--------------------\n\n    The :class:`~.ListProperty` class provides a replacement to QDeclarativeListProperty.\n\n    :class:`~.ListProperty` is a subclass of :class:`QtCore.Property`, that support the following keywords.\n\n    `type`      the type used in the list\n    `append`    Function used to append itens\n    `at`        Function used to retrieve item from the list\n    `clear`     Function used to clear the list\n    `count`     Function used to retrieve the list size\n\n\n    QML has many list properties, where more than one object value can be assigned. The use of a list property from QML looks like this:\n\n    ::\n        FruitBasket {\n             fruit: [\n                 Apple {},\n                 Orange{},\n                 Banana{}\n             ]\n        }\n\n    The :class:`~.ListProperty` encapsulates a group of callbacks that represent the set of actions QML can perform on the list - adding items, retrieving items and clearing the list. In the future, additional operations may be supported. All list properties must implement the append operation, but the rest are optional.\n    To provide a list property, a class must implement the operation callbacks, and then return an appropriate value from the property getter. List properties should have no setter. In the example above, the  ListProperty declarative will look like this:\n\n    ::\n        slices = ListProperty(PieSlice, append=appendSlice)\n\n\n    Note: :class:`~.ListProperty` can only be used for lists of QObject-derived object pointers.\n\n\n"
  },
  {
    "path": "doc/extras/PySide.QtDeclarative.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtDeclarative\n"
  },
  {
    "path": "doc/extras/PySide.QtGui.rst",
    "content": "To include the definitions of modules classes, use the following directive:\n\n::\n\n    import PySide.QtGui\n\n.. seealso:: :mod:`PySide.QtCore`\n"
  },
  {
    "path": "doc/extras/PySide.QtHelp.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtHelp\n\nLicense Information\n-------------------\n\nThe QtHelp module uses the CLucene indexing library to provide full-text searching capabilities for Qt Assistant and applications that use the features of QtHelp.\n\nQt Commercial Edition licensees that wish to distribute applications that use these features of the QtHelp module need to be aware of their obligations under the GNU Lesser General Public License (LGPL).\n\nDevelopers using the Open Source Edition can choose to redistribute the module under the appropriate version of the GNU LGPL; version 2.1 for applications and libraries licensed under the GNU GPL version 2, or version 3 for applications and libraries licensed under the GNU GPL version 3.\n\nCopyright (C) 2003-2006 Ben van Klinken and the CLucene Team\n\nChanges are Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n\nThis library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n"
  },
  {
    "path": "doc/extras/PySide.QtMultimedia.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtMultimedia\n\n\n"
  },
  {
    "path": "doc/extras/PySide.QtNetwork.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtNetwork\n"
  },
  {
    "path": "doc/extras/PySide.QtOpenGL.rst",
    "content": "OpenGL is a standard API for rendering 3D graphics. OpenGL only deals with 3D rendering and provides little or no support for GUI programming issues. The user interface for an OpenGL application must be created with another toolkit, such as Motif on the X platform, Microsoft Foundation Classes (MFC) under Windows, or Qt on both platforms.\n\n.. note:: OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.\n\nThe Qt OpenGL module makes it easy to use OpenGL in Qt applications. It provides an OpenGL widget class that can be used just like any other Qt widget, except that it opens an OpenGL display buffer where you can use the OpenGL API to render the contents.\nTo include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtOpenGL\n\nThe Qt OpenGL module is implemented as a platform-independent wrapper around the platform-dependent GLX (version 1.3 or later), WGL, or AGL C APIs. Although the basic functionality provided is very similar to Mark Kilgard's GLUT library, applications using the Qt OpenGL module can take advantage of the whole Qt API for non-OpenGL-specific GUI functionality.\n\nThe QtOpenGL module is available on Windows, X11 and Mac OS X. Qt for Embedded Linux and OpenGL supports OpenGL ES (OpenGL for Embedded Systems)."
  },
  {
    "path": "doc/extras/PySide.QtScript.rst",
    "content": "The QtScript module only provides core scripting facilities; the QtScriptTools module provides additional Qt Script-related components that application developers may find useful.\n\nTo include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtScript\n\nLicense Information\n-------------------\n\nQt Commercial Edition licensees that wish to distribute applications that use the QtScript module need to be aware of their obligations under the GNU Library General Public License (LGPL).\n\nDevelopers using the Open Source Edition can choose to redistribute the module under the appropriate version of the GNU LGPL.\nQtScript is licensed under the GNU Library General Public License. Individual contributor names and copyright dates can be found inline in the code.\n\nThis library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.\n\nYou should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
  },
  {
    "path": "doc/extras/PySide.QtScriptTools.rst",
    "content": "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:\n\n::\n\n    import PySide.QtScriptTools\n"
  },
  {
    "path": "doc/extras/PySide.QtSql.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtSql\n"
  },
  {
    "path": "doc/extras/PySide.QtSvg.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtSvg\n\nLicense Information\n-------------------\n\nSome code for arc handling in this module is derived from code with the following license:\n\nCopyright 2002 USC/Information Sciences Institute\n\nPermission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Information Sciences Institute not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Information Sciences Institute makes no representations about the suitability of this software for any purpose. It is provided \"as is\" without express or implied warranty.\n\nINFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n"
  },
  {
    "path": "doc/extras/PySide.QtTest.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtTest\n\n.. 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.\n"
  },
  {
    "path": "doc/extras/PySide.QtUiTools.rst",
    "content": "These forms are processed at run-time to produce dynamically-generated user interfaces. In order to generate a form at run-time, a resource file containing a UI file is needed.\n\nA form loader object, provided by the QUiLoader class, is used to construct the user interface. This user interface can be retrieved from any QIODevice; for example, a QFile object can be used to obtain a form stored in a project's resources. The :meth:`PySide.QtUiTools.QUiLoader.load` function takes the user interface description contained in the file and constructs the form widget.\n\nTo include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide..QtUiTools\n"
  },
  {
    "path": "doc/extras/PySide.QtWebKit.rst",
    "content": "QtWebKit provides a Web browser engine that makes it easy to embed content from the World Wide Web into your Qt application. At the same time Web content can be enhanced with native controls.\n\nQtWebKit provides facilities for rendering of HyperText Markup Language (HTML), Extensible HyperText Markup Language (XHTML) and Scalable Vector Graphics (SVG) documents, styled using Cascading Style Sheets (CSS) and scripted with JavaScript.\n\nA bridge between the JavaScript execution environment and the Qt object model makes it possible for custom QObjects to be scripted. Integration with the Qt networking module enables Web pages to be transparently loaded from Web servers, the local file system or even the Qt resource system.\n\nIn addition to providing pure rendering features, HTML documents can be made fully editable to the user through the use of the contenteditable attribute on HTML elements.\n\nQtWebKit is based on the Open Source WebKit engine. More information about WebKit itself can be found on the _`WebKit Open Source Project <http://webkit.org/>` Web site.\n\nIncluding In Your Project\n-------------------------\n\nTo include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtWebKit\n\n\n.. note:: Web site icons, also known as \"FavIcons\", are currently not supported on Windows. We plan to address this in a future release.\n\nArchitecture\n------------\n\nThe easiest way to render content is through the QWebView class. As a widget it can be embedded into your forms or a graphics view, and it provides convenience functions for downloading and rendering web sites.\n\n::\n\n    view = QWebView(parent)\n    view.load(QUrl(\"http://qt.nokia.com/\"))\n    view.show()\n\nQWebView is used to view Web pages. An instance of QWebView has one QWebPage. QWebPage provides access to the document structure in a page, describing features such as frames, the navigation history, and the undo/redo stack for editable content.\n\nHTML documents can be nested using frames in a frameset. An individual frame in HTML is represented using the QWebFrame class. This class includes the bridge to the JavaScript window object and can be painted using QPainter. Each QWebPage has one QWebFrame object as its main frame, and the main frame may contain many child frames.\n\nIndividual elements of an HTML document can be accessed via DOM JavaScript interfaces from within a web page. The equivalent of this API in QtWebKit is represented by QWebElement. QWebElement objects are obtained using QWebFrame's findAllElements() and findFirstElement() functions with CSS selector queries.\n\nCommon web browser features, defaults and other settings can be configured through the QWebSettings class. It is possible to provide defaults for all QWebPage instances through the default settings. Individual attributes can be overidden by the page specific settings object.\n\nNetscape Plugin Support\n-----------------------\n\n.. note:: Netscape plugin support is only available on desktop platforms.\n\nSince WebKit supports the Netscape Plugin API, Qt applications can display Web pages that embed common plugins on platforms for which those plugins are available. To enable plugin support, the user must have the appropriate binary files for those plugins installed and the ``QWebSettings.PluginsEnabled`` attribute must be enabled for the application.\n\nThe following locations are searched for plugins:\n\n* Linux/Unix (X11)\n    * .mozilla/plugins in the user's home directory\n    * .netscape/plugins in the user's home directory\n    * System locations, such as\n        * /usr/lib/browser/plugins\n        * /usr/local/lib/mozilla/plugins\n        * /usr/lib/firefox/plugins\n        * /usr/lib64/browser-plugins\n        * /usr/lib/browser-plugins\n        * /usr/lib/mozilla/plugins\n        * /usr/local/netscape/plugins\n        * /opt/mozilla/plugins\n        * /opt/mozilla/lib/plugins\n        * /opt/netscape/plugins\n        * /opt/netscape/communicator/plugins\n        * /usr/lib/netscape/plugins\n        * /usr/lib/netscape/plugins-libc5\n        * /usr/lib/netscape/plugins-libc6\n        * /usr/lib64/netscape/plugins\n        * /usr/lib64/mozilla/plugins\n    * Locations specified by environment variables:\n        * $MOZILLA_HOME/plugins\n        * $MOZ_PLUGIN_PATH\n        * $QTWEBKIT_PLUGIN_PATH\n* Windows\n    * The user's Application Data\\Mozilla\\plugins directory\n    * Standard system locations of plugins for Quicktime, Flash, etc.\n* Mac OS X\n    * Library/Internet Plug-Ins in the user's home directory\n    * The system /Library/Internet Plug-Ins directory\n\nLicense Information\n-------------------\n\nQt Commercial Edition licensees that wish to distribute applications that use the QtWebKit module need to be aware of their obligations under the GNU Library General Public License (LGPL).\n\nDevelopers using the Open Source Edition can choose to redistribute the module under the appropriate version of the GNU LGPL.\nWebKit is licensed under the GNU Library General Public License. Individual contributor names and copyright dates can be found inline in the code.\n\nThis library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.\n\nYou should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA."
  },
  {
    "path": "doc/extras/PySide.QtXml.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtXml\n"
  },
  {
    "path": "doc/extras/PySide.QtXmlPatterns.rst",
    "content": "To include the definitions of the module's classes, use the following directive:\n\n::\n\n    import PySide.QtXmlPatterns\n\nFurther Reading\n---------------\n\nGeneral overviews of XQuery and XSchema can be found in the XQuery document.\n\nAn introduction to the XQuery language can be found in A Short Path to XQuery.\n\nLicense Information\n-------------------\n\nThe XML Schema implementation provided by this module contains the xml.xsd file (located in src/xmlpatterns/schema/schemas) which is licensed under the terms given below. This module is always built with XML Schema support enabled.\n\nW3C© SOFTWARE NOTICE AND LICENSE\n\nThis license came from: http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231\n\nThis work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license. By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.\n\nPermission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:\n\n* The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.\n* Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.\n* Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)\n\nTHIS SOFTWARE AND DOCUMENTATION IS PROVIDED \"AS IS,\" AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.\n\nCOPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.\n\nThe name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.\n"
  },
  {
    "path": "doc/extras/PySide.phonon.rst",
    "content": "Phonon is a cross-platform multimedia framework that enables the use of audio and video content in Qt applications. The Phonon Overview document provides an introduction to the architecture and features included in Phonon. The Phonon namespace contains a list of all classes, functions and namespaces provided by the module.\n\nTo include the definitions of modules classes, use the following directive:\n\n::\n\n    import PySide.phonon\n\nQt Backends\n-----------\n\nQt Backends are currently developed for Phonon version 4.1. The Phonon project has moved on and introduced new features that the Qt Backends do not implement. We have chosen not to document the part of Phonon that we do not support. Any class or function not appearing in our documentation can be considered unsupported.\n\nLicense Information\n-------------------\n\nQt Commercial Edition licensees that wish to distribute applications that use the Phonon module need to be aware of their obligations under the GNU Lesser General Public License (LGPL).\n\nDevelopers using the Open Source Edition can choose to redistribute the module under the appropriate version of the GNU LGPL; version 2.1 for applications and libraries licensed under the GNU GPL version 2, or version 3 for applications and libraries licensed under the GNU GPL version 3.\n\nThis file is part of the KDE project\n\n* Copyright (C) 2004-2009 Matthias Kretz <kretz@kde.org>\n* Copyright (C) 2008 Ian Monroe <ian@monroe.nu>\n* Copyright (C) 2007-2008 Trolltech ASA\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n\nContact: http://www.qt-project.org/legal\n\nThis library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.\n\nYou should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n"
  },
  {
    "path": "doc/inheritance_diagram.py",
    "content": "# -*- coding: utf-8 -*-\nr\"\"\"\n    sphinx.ext.inheritance_diagram\n    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n    Defines a docutils directive for inserting inheritance diagrams.\n\n    Provide the directive with one or more classes or modules (separated\n    by whitespace).  For modules, all of the classes in that module will\n    be used.\n\n    Example::\n\n       Given the following classes:\n\n       class A: pass\n       class B(A): pass\n       class C(A): pass\n       class D(B, C): pass\n       class E(B): pass\n\n       .. inheritance-diagram: D E\n\n       Produces a graph like the following:\n\n                   A\n                  / \\\n                 B   C\n                / \\ /\n               E   D\n\n    The graph is inserted as a PNG+image map into HTML and a PDF in\n    LaTeX.\n\n    :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.\n    :copyright: Copyright 2010-2011 by the PySide team.\n    :license: BSD, see LICENSE for details.\n\"\"\"\n\nimport os\nimport re\nimport sys\nimport inspect\ntry:\n    from hashlib import md5\nexcept ImportError:\n    from md5 import md5\n\nfrom docutils import nodes\nfrom docutils.parsers.rst import directives\n\nfrom sphinx.ext.graphviz import render_dot_html, render_dot_latex\nfrom sphinx.util.compat import Directive\n\n\nclass_sig_re = re.compile(r'''^([\\w.]*\\.)?    # module names\n                          (\\w+)  \\s* $        # class/final module name\n                          ''', re.VERBOSE)\n\n\nclass InheritanceException(Exception):\n    pass\n\n\nclass InheritanceGraph(object):\n    \"\"\"\n    Given a list of classes, determines the set of classes that they inherit\n    from all the way to the root \"object\", and then is able to generate a\n    graphviz dot graph from them.\n    \"\"\"\n    def __init__(self, class_names, currmodule, show_builtins=False, parts=0):\n        \"\"\"\n        *class_names* is a list of child classes to show bases from.\n\n        If *show_builtins* is True, then Python builtins will be shown\n        in the graph.\n        \"\"\"\n        self.class_names = class_names\n        classes = self._import_classes(class_names, currmodule)\n        self.class_info = self._class_info(classes, show_builtins, parts)\n        if not self.class_info:\n            raise InheritanceException('No classes found for '\n                                       'inheritance diagram')\n\n    def _import_class_or_module(self, name, currmodule):\n        \"\"\"\n        Import a class using its fully-qualified *name*.\n        \"\"\"\n        try:\n            path, base = class_sig_re.match(name).groups()\n        except (AttributeError, ValueError):\n            raise InheritanceException('Invalid class or module %r specified '\n                                       'for inheritance diagram' % name)\n\n        fullname = (path or '') + base\n        path = (path and path.rstrip('.') or '')\n\n        # two possibilities: either it is a module, then import it\n        try:\n            __import__(fullname)\n            todoc = sys.modules[fullname]\n        except ImportError:\n            # else it is a class, then import the module\n            if not path:\n                if currmodule:\n                    # try the current module\n                    path = currmodule\n                else:\n                    raise InheritanceException(\n                        'Could not import class %r specified for '\n                        'inheritance diagram' % base)\n            try:\n                __import__(path)\n                todoc = getattr(sys.modules[path], base)\n            except (ImportError, AttributeError):\n                raise InheritanceException(\n                    'Could not import class or module %r specified for '\n                    'inheritance diagram' % (path + '.' + base))\n\n        # If a class, just return it\n        if inspect.isclass(todoc):\n            return [todoc]\n        elif inspect.ismodule(todoc):\n            classes = []\n            for cls in todoc.__dict__.values():\n                if inspect.isclass(cls) and cls.__module__ == todoc.__name__:\n                    classes.append(cls)\n            return classes\n        raise InheritanceException('%r specified for inheritance diagram is '\n                                   'not a class or module' % name)\n\n    def _import_classes(self, class_names, currmodule):\n        \"\"\"Import a list of classes.\"\"\"\n        classes = []\n        for name in class_names:\n            classes.extend(self._import_class_or_module(name, currmodule))\n        return classes\n\n    def _class_info(self, classes, show_builtins, parts):\n        \"\"\"Return name and bases for all classes that are ancestors of\n        *classes*.\n\n        *parts* gives the number of dotted name parts that is removed from the\n        displayed node names.\n        \"\"\"\n        all_classes = {}\n        builtins = __builtins__.values()\n\n        def recurse(cls):\n            if not show_builtins and cls in builtins:\n                return\n\n            nodename = self.class_name(cls, parts)\n            fullname = self.class_name(cls, 0)\n\n            baselist = []\n            all_classes[cls] = (nodename, fullname, baselist)\n            for base in cls.__bases__:\n                if not show_builtins and base in builtins:\n                    continue\n                if  base.__name__ == \"Object\" and base.__module__ == \"Shiboken\":\n                    continue\n                baselist.append(self.class_name(base, parts))\n                if base not in all_classes:\n                    recurse(base)\n\n        for cls in classes:\n            recurse(cls)\n\n        return all_classes.values()\n\n    def class_name(self, cls, parts=0):\n        \"\"\"Given a class object, return a fully-qualified name.\n\n        This works for things I've tested in matplotlib so far, but may not be\n        completely general.\n        \"\"\"\n        module = cls.__module__\n        if module == '__builtin__':\n            fullname = cls.__name__\n        else:\n            fullname = '%s.%s' % (module, cls.__name__)\n        if parts == 0:\n            return fullname\n        name_parts = fullname.split('.')\n        return '.'.join(name_parts[-parts:])\n\n    def get_all_class_names(self):\n        \"\"\"\n        Get all of the class names involved in the graph.\n        \"\"\"\n        return [fullname for (_, fullname, _) in self.class_info]\n\n    # These are the default attrs for graphviz\n    default_graph_attrs = {\n        'rankdir': 'LR',\n        'size': '\"8.0, 12.0\"',\n    }\n    default_node_attrs = {\n        'shape': 'box',\n        'fontsize': 10,\n        'height': 0.25,\n        'fontname': 'Vera Sans, DejaVu Sans, Liberation Sans, '\n                    'Arial, Helvetica, sans',\n        'style': '\"setlinewidth(0.5)\"',\n    }\n    default_edge_attrs = {\n        'arrowsize': 0.5,\n        'style': '\"setlinewidth(0.5)\"',\n    }\n\n    def _format_node_attrs(self, attrs):\n        return ','.join(['%s=%s' % x for x in attrs.items()])\n\n    def _format_graph_attrs(self, attrs):\n        return ''.join(['%s=%s;\\n' % x for x in attrs.items()])\n\n    def generate_dot(self, name, urls={}, env=None,\n                     graph_attrs={}, node_attrs={}, edge_attrs={}):\n        \"\"\"\n        Generate a graphviz dot graph from the classes that\n        were passed in to __init__.\n\n        *name* is the name of the graph.\n\n        *urls* is a dictionary mapping class names to HTTP URLs.\n\n        *graph_attrs*, *node_attrs*, *edge_attrs* are dictionaries containing\n        key/value pairs to pass on as graphviz properties.\n        \"\"\"\n        g_attrs = self.default_graph_attrs.copy()\n        n_attrs = self.default_node_attrs.copy()\n        e_attrs = self.default_edge_attrs.copy()\n        g_attrs.update(graph_attrs)\n        n_attrs.update(node_attrs)\n        e_attrs.update(edge_attrs)\n        if env:\n            g_attrs.update(env.config.inheritance_graph_attrs)\n            n_attrs.update(env.config.inheritance_node_attrs)\n            e_attrs.update(env.config.inheritance_edge_attrs)\n\n        res = []\n        res.append('digraph %s {\\n' % name)\n        res.append(self._format_graph_attrs(g_attrs))\n\n        for name, fullname, bases in self.class_info:\n            # Write the node\n            this_node_attrs = n_attrs.copy()\n            url = urls.get(fullname)\n            if url is not None:\n                this_node_attrs['URL'] = '\"%s\"' % url\n            res.append('  \"%s\" [%s];\\n' %\n                       (name, self._format_node_attrs(this_node_attrs)))\n\n            # Write the edges\n            for base_name in bases:\n                res.append('  \"%s\" -> \"%s\" [%s];\\n' %\n                           (base_name, name,\n                            self._format_node_attrs(e_attrs)))\n        res.append('}\\n')\n        return ''.join(res)\n\n\nclass inheritance_diagram(nodes.General, nodes.Element):\n    \"\"\"\n    A docutils node to use as a placeholder for the inheritance diagram.\n    \"\"\"\n    pass\n\n\nclass InheritanceDiagram(Directive):\n    \"\"\"\n    Run when the inheritance_diagram directive is first encountered.\n    \"\"\"\n    has_content = False\n    required_arguments = 1\n    optional_arguments = 0\n    final_argument_whitespace = True\n    option_spec = {\n        'parts': directives.nonnegative_int,\n    }\n\n    def run(self):\n        node = inheritance_diagram()\n        node.document = self.state.document\n        env = self.state.document.settings.env\n        class_names = self.arguments[0].split()\n        class_role = env.get_domain('py').role('class')\n        # Store the original content for use as a hash\n        node['parts'] = self.options.get('parts', 0)\n        node['content'] = ', '.join(class_names)\n\n        # Create a graph starting with the list of classes\n        try:\n            graph = InheritanceGraph(\n                class_names, env.temp_data.get('py:module'),\n                parts=node['parts'])\n        except InheritanceException, err:\n            return [node.document.reporter.warning(err.args[0],\n                                                   line=self.lineno)]\n\n        # Create xref nodes for each target of the graph's image map and\n        # add them to the doc tree so that Sphinx can resolve the\n        # references to real URLs later.  These nodes will eventually be\n        # removed from the doctree after we're done with them.\n        for name in graph.get_all_class_names():\n            refnodes, x = class_role(\n                'class', ':class:`%s`' % name, name, 0, self.state)\n            node.extend(refnodes)\n        # Store the graph object so we can use it to generate the\n        # dot file later\n        node['graph'] = graph\n        return [node]\n\n\ndef get_graph_hash(node):\n    return md5(node['content'] + str(node['parts'])).hexdigest()[-10:]\n\n\ndef html_visit_inheritance_diagram(self, node):\n    \"\"\"\n    Output the graph for HTML.  This will insert a PNG with clickable\n    image map.\n    \"\"\"\n    graph = node['graph']\n\n    graph_hash = get_graph_hash(node)\n    name = 'inheritance%s' % graph_hash\n\n    # Create a mapping from fully-qualified class names to URLs.\n    urls = {}\n    for child in node:\n        if child.get('refuri') is not None:\n            urls[child['reftitle']] = child.get('refuri')\n        elif child.get('refid') is not None:\n            urls[child['reftitle']] = '#' + child.get('refid')\n\n    dotcode = graph.generate_dot(name, urls, env=self.builder.env)\n    render_dot_html(self, node, dotcode, [], 'inheritance', 'inheritance',\n                    alt='Inheritance diagram of ' + node['content'])\n    raise nodes.SkipNode\n\n\ndef latex_visit_inheritance_diagram(self, node):\n    \"\"\"\n    Output the graph for LaTeX.  This will insert a PDF.\n    \"\"\"\n    graph = node['graph']\n\n    graph_hash = get_graph_hash(node)\n    name = 'inheritance%s' % graph_hash\n\n    dotcode = graph.generate_dot(name, env=self.builder.env,\n                                 graph_attrs={'size': '\"6.0,6.0\"'})\n    render_dot_latex(self, node, dotcode, [], 'inheritance')\n    raise nodes.SkipNode\n\n\ndef skip(self, node):\n    raise nodes.SkipNode\n\n\ndef setup(app):\n    app.setup_extension('sphinx.ext.graphviz')\n    app.add_node(\n        inheritance_diagram,\n        latex=(latex_visit_inheritance_diagram, None),\n        html=(html_visit_inheritance_diagram, None),\n        text=(skip, None),\n        man=(skip, None))\n    app.add_directive('inheritance-diagram', InheritanceDiagram)\n    app.add_config_value('inheritance_graph_attrs', {}, False),\n    app.add_config_value('inheritance_node_attrs', {}, False),\n    app.add_config_value('inheritance_edge_attrs', {}, False),\n"
  },
  {
    "path": "doc/modules.rst",
    "content": "PySide modules\n**************\n\nQt is splitted in several modules.\n\n.. toctree::\n    :maxdepth: 1\n\n    PySide/QtCore/index.rst\n    PySide/QtDeclarative/index.rst\n    PySide/QtGui/index.rst\n    PySide/QtHelp/index.rst\n    PySide/QtMaemo5/index.rst\n    PySide/QtMultimedia/index.rst\n    PySide/QtNetwork/index.rst\n    PySide/QtOpenGL/index.rst\n    PySide/QtScript/index.rst\n    PySide/QtScriptTools/index.rst\n    PySide/QtSql/index.rst\n    PySide/QtSvg/index.rst\n    PySide/QtUiTools/index.rst\n    PySide/QtXml/index.rst\n    PySide/QtWebKit/index.rst\n    PySide/phonon/index.rst\n"
  },
  {
    "path": "doc/pyhtml2devhelp.py",
    "content": "\"\"\"\n  This script is based on Python2.6 Ubuntu package script:\n  Copyright (C) 2009 Matthias Klose <doko@debian.org>\n  Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n\n  This program is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public License\n  version 2.1 as published by the Free Software Foundation. Please\n  review the following information to ensure the GNU Lesser General\n  Public License version 2.1 requirements will be met:\n  http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n\n  This program is distributed in the hope that it will be useful, but\n  WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this program; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n   02110-1301 USA\n\"\"\"\n#! /usr/bin/python\n\nimport formatter, htmllib\nimport os, sys, re\n\nclass PyHTMLParser(htmllib.HTMLParser):\n    pages_to_include = set(('index.html', 'PySide/QtHelp/index.html', 'PySide/QtSvg/index.html',\n                        'PySide/QtGui/index.html', 'PySide/QtNetwork/index.html', 'PySide/QtWebKit/index.html',\n                        'PySide/QtUiTools/index.html', 'PySide/QtXml/index.html', 'PySide/QtCore/index.html',\n                        'PySide/QtScriptTools/index.html', 'PySide/QtOpenGL/index.html', 'PySide/QtScript/index.html',\n                        'PySide/QtSql/index.html', 'howto-build/index.html'))\n\n    def __init__(self, formatter, basedir, fn, indent, parents=set()):\n        htmllib.HTMLParser.__init__(self, formatter)\n        self.basedir = basedir\n        self.dir, self.fn = os.path.split(fn)\n        self.data = ''\n        self.parents = parents\n        self.link = {}\n        self.indent = indent\n        self.last_indent = indent - 1\n        self.sub_indent = 0\n        self.sub_count = 0\n        self.next_link = False\n\n    def process_link(self):\n        new_href = os.path.join(self.dir, self.link['href'])\n        text = self.link['text']\n        indent = self.indent + self.sub_indent\n        if self.last_indent == indent:\n            print '%s</sub>' % ('  ' * self.last_indent)\n            self.sub_count -= 1\n        print '%s<sub link=\"%s\" name=\"%s\">' % ('  ' * indent, new_href, text)\n        self.sub_count += 1\n        self.last_indent = self.indent + self.sub_indent\n\n    def start_li(self, attrs):\n        self.sub_indent += 1\n        self.next_link = True\n\n    def end_li(self):\n        indent = self.indent + self.sub_indent\n        if self.sub_count > 0:\n            print '%s</sub>' % ('  ' * self.last_indent)\n            self.sub_count -= 1\n            self.last_indent -= 1\n        self.sub_indent -= 1\n\n    def start_a(self, attrs):\n        self.link = {}\n        for attr in attrs:\n            self.link[attr[0]] = attr[1]\n        self.data = ''\n\n    def end_a(self):\n        process = False\n        text = self.data.replace('\\t', '').replace('\\n', ' ').replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')\n        self.link['text'] = text\n        # handle a tag without href attribute\n        try:\n            href = self.link['href']\n        except KeyError:\n            return\n\n        abs_href = os.path.join(self.basedir, href)\n        if abs_href in self.parents:\n            return\n        if href.startswith('..') or href.startswith('http:') \\\n               or href.startswith('mailto:') or href.startswith('news:'):\n            return\n        if href in ('', 'about.html', 'modindex.html', 'genindex.html', 'glossary.html',\n                    'search.html', 'contents.html', 'download.html', 'bugs.html',\n                    'license.html', 'copyright.html'):\n            return\n\n        if self.link.has_key('class'):\n            if self.link['class'] in ('biglink'):\n                process = True\n            if self.link['class'] in ('reference external'):\n                if self.next_link:\n                    process = True\n                    next_link = False\n\n        if process == True:\n            self.process_link()\n            if href in self.pages_to_include:\n                self.parse_file(os.path.join(self.dir, href))\n\n    def finish(self):\n        if self.sub_count > 0:\n            print '%s</sub>' % ('  ' * self.last_indent)\n\n    def handle_data(self, data):\n        self.data += data\n\n    def parse_file(self, href):\n        # TODO basedir bestimmen\n        parent = os.path.join(self.basedir, self.fn)\n        self.parents.add(parent)\n        parser = PyHTMLParser(formatter.NullFormatter(),\n                              self.basedir, href, self.indent + 1,\n                              self.parents)\n        text = file(self.basedir + '/' + href).read()\n        parser.feed(text)\n        parser.finish()\n        parser.close()\n        if parent in self.parents:\n            self.parents.remove(parent)\n\nclass PyIdxHTMLParser(htmllib.HTMLParser):\n    def __init__(self, formatter, basedir, fn, indent):\n        htmllib.HTMLParser.__init__(self, formatter)\n        self.basedir = basedir\n        self.dir, self.fn = os.path.split(fn)\n        self.data = ''\n        self.link = {}\n        self.indent = indent\n        self.active = False\n        self.indented = False\n        self.nolink = False\n        self.header = ''\n        self.last_letter = 'Z'\n        self.last_text = ''\n\n    def process_link(self):\n        new_href = os.path.join(self.dir, self.link['href'])\n        text = self.link['text']\n        if not self.active:\n            return\n        if text.startswith('['):\n            return\n        if self.link.get('rel', None) in ('prev', 'parent', 'next', 'contents', 'index'):\n            return\n        if self.indented:\n            text = self.last_text + ' ' + text\n        else:\n            # Save it in case we need it again\n            self.last_text = re.sub(' \\([\\w\\-\\.\\s]+\\)', '', text)\n        indent = self.indent\n        print '%s<function link=\"%s\" name=\"%s\"/>' % ('  ' * indent, new_href, text)\n\n    def start_dl(self, attrs):\n        if self.last_text:\n            # Looks like we found the second part to a command\n            self.indented = True\n\n    def end_dl(self):\n        self.indented = False\n\n    def start_dt(self, attrs):\n        self.data = ''\n        self.nolink = True\n\n    def end_dt(self):\n        if not self.active:\n            return\n        if self.nolink == True:\n            # Looks like we found the first part to a command\n            self.last_text = re.sub(' \\([\\w\\-\\.\\s]+\\)', '', self.data)\n            self.nolink = False\n\n    def start_h2(self, attrs):\n        for k, v in attrs:\n            if k == 'id':\n                self.header = v\n                if v == '_':\n                    self.active = True\n\n    def start_td(self, attrs):\n        self.indented = False\n        self.last_text = ''\n\n    def start_table(self, attrs):\n        pass\n\n    def end_table(self):\n        if self.header == self.last_letter:\n            self.active = False\n\n    def start_a(self, attrs):\n        self.nolink = False\n        self.link = {}\n        for attr in attrs:\n            self.link[attr[0]] = attr[1]\n        self.data = ''\n\n    def end_a(self):\n        text = self.data.replace('\\t', '').replace('\\n', ' ').replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')\n        self.link['text'] = text\n        # handle a tag without href attribute\n        try:\n            href = self.link['href']\n        except KeyError:\n            return\n        self.process_link()\n\n    def handle_data(self, data):\n        self.data += data\n\ndef main():\n    base = sys.argv[1]\n    fn = sys.argv[2]\n\n    parser = PyHTMLParser(formatter.NullFormatter(), base, fn, indent=0)\n    print '<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>'\n    print '<book title=\"PySide %s Documentation\" name=\"PySide\" version=\"%s\" link=\"index.html\">' % (sys.argv[3], sys.argv[3])\n    print '<chapters>'\n    parser.parse_file(fn)\n    print '</chapters>'\n\n    print '<functions>'\n\n    fn = 'genindex.html'\n    parser = PyIdxHTMLParser(formatter.NullFormatter(), base, fn, indent=1)\n    text = file(base + '/' + fn).read()\n    parser.feed(text)\n    parser.close()\n\n    print '</functions>'\n    print '</book>'\n\nmain()\n\n"
  },
  {
    "path": "doc/pyside.qdocconf.in",
    "content": "######################## compat.qdocconf\nalias.i                         = e\nalias.include                   = input\n\nmacro.0                         = \"\\\\\\\\0\"\nmacro.b                         = \"\\\\\\\\b\"\nmacro.n                         = \"\\\\\\\\n\"\nmacro.r                         = \"\\\\\\\\r\"\nmacro.i                         = \"\\\\o\"\nmacro.i11                       = \"\\\\o{1,1}\"\nmacro.i12                       = \"\\\\o{1,2}\"\nmacro.i13                       = \"\\\\o{1,3}\"\nmacro.i14                       = \"\\\\o{1,4}\"\nmacro.i15                       = \"\\\\o{1,5}\"\nmacro.i16                       = \"\\\\o{1,6}\"\nmacro.i17                       = \"\\\\o{1,7}\"\nmacro.i18                       = \"\\\\o{1,8}\"\nmacro.i19                       = \"\\\\o{1,9}\"\nmacro.i21                       = \"\\\\o{2,1}\"\nmacro.i31                       = \"\\\\o{3,1}\"\nmacro.i41                       = \"\\\\o{4,1}\"\nmacro.i51                       = \"\\\\o{5,1}\"\nmacro.i61                       = \"\\\\o{6,1}\"\nmacro.i71                       = \"\\\\o{7,1}\"\nmacro.i81                       = \"\\\\o{8,1}\"\nmacro.i91                       = \"\\\\o{9,1}\"\nmacro.img                       = \"\\\\image\"\nmacro.endquote                  = \"\\\\endquotation\"\nmacro.relatesto                 = \"\\\\relates\"\n\nspurious                        = \"Missing comma in .*\" \\\n                                  \"Missing pattern .*\"\n\n######################## macros.qdocconf\nmacro.aacute.HTML       = \"&aacute;\"\nmacro.Aring.HTML        = \"&Aring;\"\nmacro.aring.HTML        = \"&aring;\"\nmacro.Auml.HTML         = \"&Auml;\"\nmacro.author            = \"\\\\bold{Author:}\"\nmacro.br.HTML           = \"<br />\"\nmacro.BR.HTML           = \"<br />\"\nmacro.copyright.HTML    = \"&copy;\"\nmacro.eacute.HTML       = \"&eacute;\"\nmacro.gui               = \"\\\\bold\"\nmacro.hr.HTML           = \"<hr />\"\nmacro.iacute.HTML       = \"&iacute;\"\nmacro.key               = \"\\\\bold\"\nmacro.menu              = \"\\\\bold\"\nmacro.note              = \"\\\\bold{Note:}\"\nmacro.oslash.HTML       = \"&oslash;\"\nmacro.ouml.HTML         = \"&ouml;\"\nmacro.QA                = \"\\\\e{Qt Assistant}\"\nmacro.QD                = \"\\\\e{Qt Designer}\"\nmacro.QL                = \"\\\\e{Qt Linguist}\"\nmacro.QQV               = \"\\\\e{Qt QML Viewer}\"\nmacro.qmlbasictype      = \"\\\\e\"\nmacro.param             = \"\\\\e\"\nmacro.raisedaster.HTML  = \"<sup>*</sup>\"\nmacro.rarrow.HTML       = \"&rarr;\"\nmacro.reg.HTML          = \"<sup>&reg;</sup>\"\nmacro.return            = \"Returns\"\nmacro.starslash         = \"\\\\c{*/}\"\nmacro.begincomment      = \"\\\\c{/*}\"\nmacro.endcomment        = \"\\\\c{*/}\"\nmacro.uuml.HTML         = \"&uuml;\"\nmacro.mdash.HTML        = \"&mdash;\"\n\nmacro.beginfloatleft.HTML   = \"<div style=\\\"float: left; margin-right: 2em\\\">\"\nmacro.beginfloatright.HTML  = \"<div style=\\\"float: right; margin-left: 2em\\\">\"\nmacro.endfloat.HTML         = \"</div>\"\nmacro.clearfloat.HTML       = \"<br style=\\\"clear: both\\\" />\"\n\n######################## qt-cpp-ignore.qdocconf\nCpp.ignoretokens        = QAXFACTORY_EXPORT \\\n                          QDESIGNER_COMPONENTS_LIBRARY \\\n                          QDESIGNER_EXTENSION_LIBRARY \\\n                          QDESIGNER_SDK_LIBRARY \\\n                          QDESIGNER_SHARED_LIBRARY \\\n                          QDESIGNER_UILIB_LIBRARY \\\n                          QM_EXPORT_CANVAS \\\n                          QM_EXPORT_DNS \\\n                          QM_EXPORT_DOM \\\n                          QM_EXPORT_FTP \\\n                          QM_EXPORT_HTTP \\\n                          QM_EXPORT_ICONVIEW \\\n                          QM_EXPORT_NETWORK \\\n                          QM_EXPORT_OPENGL \\\n                          QM_EXPORT_OPENVG \\\n                          QM_EXPORT_SQL \\\n                          QM_EXPORT_TABLE \\\n                          QM_EXPORT_WORKSPACE \\\n                          QM_EXPORT_XML \\\n                          QT_ASCII_CAST_WARN \\\n                          QT_ASCII_CAST_WARN_CONSTRUCTOR \\\n                          QT_BEGIN_HEADER \\\n                          QT_DESIGNER_STATIC \\\n                          QT_END_HEADER \\\n                          QT_FASTCALL \\\n                          QT_WIDGET_PLUGIN_EXPORT \\\n                          Q_COMPAT_EXPORT \\\n                          Q_CORE_EXPORT \\\n                          Q_CORE_EXPORT_INLINE \\\n                          Q_EXPLICIT \\\n                          Q_EXPORT \\\n                          Q_EXPORT_CODECS_CN \\\n                          Q_EXPORT_CODECS_JP \\\n                          Q_EXPORT_CODECS_KR \\\n                          Q_EXPORT_PLUGIN \\\n                          Q_GFX_INLINE \\\n                          Q_AUTOTEST_EXPORT \\\n                          Q_GUI_EXPORT \\\n                          Q_GUI_EXPORT_INLINE \\\n                          Q_GUI_EXPORT_STYLE_CDE \\\n                          Q_GUI_EXPORT_STYLE_COMPACT \\\n                          Q_GUI_EXPORT_STYLE_MAC \\\n                          Q_GUI_EXPORT_STYLE_MOTIF \\\n                          Q_GUI_EXPORT_STYLE_MOTIFPLUS \\\n                          Q_GUI_EXPORT_STYLE_PLATINUM \\\n                          Q_GUI_EXPORT_STYLE_POCKETPC \\\n                          Q_GUI_EXPORT_STYLE_SGI \\\n                          Q_GUI_EXPORT_STYLE_WINDOWS \\\n                          Q_GUI_EXPORT_STYLE_WINDOWSXP \\\n                          QHELP_EXPORT \\\n                          Q_INLINE_TEMPLATE \\\n                          Q_INTERNAL_WIN_NO_THROW \\\n                          Q_NETWORK_EXPORT \\\n                          Q_OPENGL_EXPORT \\\n                          Q_OPENVG_EXPORT \\\n                          Q_OUTOFLINE_TEMPLATE \\\n                          Q_SQL_EXPORT \\\n                          Q_SVG_EXPORT \\\n                          Q_SCRIPT_EXPORT \\\n                          Q_SCRIPTTOOLS_EXPORT \\\n                          Q_TESTLIB_EXPORT \\\n                          Q_TYPENAME \\\n                          Q_XML_EXPORT \\\n                          Q_XMLSTREAM_EXPORT \\\n                          Q_XMLPATTERNS_EXPORT \\\n                          QDBUS_EXPORT \\\n                          QT_BEGIN_NAMESPACE \\\n                          QT_BEGIN_INCLUDE_NAMESPACE \\\n                          QT_END_NAMESPACE \\\n                          QT_END_INCLUDE_NAMESPACE \\\n                          PHONON_EXPORT \\\n                          Q_DECLARATIVE_EXPORT \\\n                          Q_GADGET \\\n                          QWEBKIT_EXPORT\nCpp.ignoredirectives    = Q_DECLARE_HANDLE \\\n                          Q_DECLARE_INTERFACE \\\n                          Q_DECLARE_METATYPE \\\n                          Q_DECLARE_OPERATORS_FOR_FLAGS \\\n                          Q_DECLARE_PRIVATE \\\n                          Q_DECLARE_PUBLIC \\\n                          Q_DECLARE_SHARED \\\n                          Q_DECLARE_TR_FUNCTIONS \\\n                          Q_DECLARE_TYPEINFO \\\n                          Q_DISABLE_COPY \\\n                          QT_FORWARD_DECLARE_CLASS \\\n                          Q_DUMMY_COMPARISON_OPERATOR \\\n                          Q_ENUMS \\\n                          Q_FLAGS \\\n                          Q_INTERFACES \\\n                          __attribute__ \\\n                          K_DECLARE_PRIVATE \\\n                          PHONON_OBJECT \\\n                          PHONON_HEIR \\\n                          Q_PRIVATE_PROPERTY \\\n                          Q_DECLARE_PRIVATE_D \\\n                          Q_CLASSINFO\n\n######################## qt-defines.qdocconf\ndefines                 = Q_QDOC \\\n                          QT_.*_SUPPORT \\\n                          QT_.*_LIB \\\n                          QT_COMPAT \\\n                          QT_KEYPAD_NAVIGATION \\\n                          QT3_SUPPORT \\\n                          Q_WS_.* \\\n                          Q_OS_.* \\\n                          Q_BYTE_ORDER \\\n                          QT_DEPRECATED \\\n                          Q_NO_USING_KEYWORD \\\n                          __cplusplus\n\nversionsym              = QT_VERSION_STR\n\ncodeindent              = 1\n\n######################## qt.qdocconf\n\nproject                 = Qt\nversionsym              =\nversion                 = @PYSIDE_QT_VERSION@\ndescription             = Qt Reference Documentation\nurl                     = http://www.pyside.org/docs/pyside-@PYSIDE_QT_VERSION@\n\nlanguage                = Cpp\n\nheaderdirs              = @QT_SRC_DIR@/src \\\n                          @QT_SRC_DIR@/extensions/activeqt \\\n                          @QT_SRC_DIR@/tools/assistant/lib \\\n                          @QT_SRC_DIR@/tools/assistant/compat/lib \\\n                          @QT_SRC_DIR@/tools/designer/src/uitools \\\n                          @QT_SRC_DIR@/tools/designer/src/lib/extension \\\n                          @QT_SRC_DIR@/tools/designer/src/lib/sdk \\\n                          @QT_SRC_DIR@/tools/designer/src/lib/uilib \\\n                          @QT_SRC_DIR@/tools/qtestlib/src \\\n                          @QT_SRC_DIR@/tools/qdbus/src \\\n                          @pyside_SOURCE_DIR@\nsourcedirs              = @QT_SRC_DIR@/src \\\n                          @QT_SRC_DIR@/doc/src \\\n                          @QT_SRC_DIR@/extensions/activeqt \\\n                          @QT_SRC_DIR@/tools/assistant/lib \\\n                          @QT_SRC_DIR@/tools/assistant/compat/lib \\\n                          @QT_SRC_DIR@/tools/designer/src/uitools \\\n                          @QT_SRC_DIR@/tools/designer/src/lib/extension \\\n                          @QT_SRC_DIR@/tools/designer/src/lib/sdk \\\n                          @QT_SRC_DIR@/tools/designer/src/lib/uilib \\\n                          @QT_SRC_DIR@/tools/qtestlib/src \\\n                          @QT_SRC_DIR@/tools/qdbus \\\n                          @pyside_SOURCE_DIR@\n\nexcludedirs             = @QT_SRC_DIR@/src/3rdparty/clucene \\\n                          @QT_SRC_DIR@/src/3rdparty/des \\\n                          @QT_SRC_DIR@/src/3rdparty/freetype \\\n                          @QT_SRC_DIR@/src/3rdparty/harfbuzz \\\n                          @QT_SRC_DIR@/src/3rdparty/kdebase \\\n                          @QT_SRC_DIR@/src/3rdparty/libjpeg \\\n                          @QT_SRC_DIR@/src/3rdparty/libmng \\\n                          @QT_SRC_DIR@/src/3rdparty/libpng \\\n                          @QT_SRC_DIR@/src/3rdparty/libtiff \\\n                          @QT_SRC_DIR@/src/3rdparty/md4 \\\n                          @QT_SRC_DIR@/src/3rdparty/md5 \\\n                          @QT_SRC_DIR@/src/3rdparty/patches \\\n                          @QT_SRC_DIR@/src/3rdparty/sha1 \\\n                          @QT_SRC_DIR@/src/3rdparty/sqlite \\\n                          @QT_SRC_DIR@/src/3rdparty/webkit/JavaScriptCore \\\n                          @QT_SRC_DIR@/src/3rdparty/webkit/WebCore \\\n                          @QT_SRC_DIR@/src/3rdparty/wintab \\\n                          @QT_SRC_DIR@/src/3rdparty/zlib \\\n                          @QT_SRC_DIR@/src/3rdparty/phonon/gstreamer \\\n                          @QT_SRC_DIR@/src/3rdparty/phonon/ds9 \\\n                          @QT_SRC_DIR@/src/3rdparty/phonon/qt7 \\\n                          @QT_SRC_DIR@/src/3rdparty/phonon/mmf \\\n                          @QT_SRC_DIR@/src/3rdparty/phonon/waveout \\\n                          @QT_SRC_DIR@/doc/src/snippets \\\n                          @QT_SRC_DIR@/doc/src/ja_JP \\\n                          @QT_SRC_DIR@/doc/src/zh_CN\n\nsources.fileextensions  = \"*.cpp *.qdoc *.mm\"\nexamples.fileextensions = \"*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp\"\nexamples.imageextensions = \"*.png\"\n\ntagfile                 = @QT_SRC_DIR@/doc/html/qt.tags\nbase                    = file:@QT_SRC_DIR@/doc/html\n\nHTML.generatemacrefs    = \"true\"\n\n######################## pyside.qdocconf\nquotinginformation      = true\nexampledirs             = @QT_SRC_DIR@/doc/src \\\n                          @QT_SRC_DIR@/examples \\\n                          @QT_SRC_DIR@/examples/tutorials \\\n                          @QT_SRC_DIR@ \\\n                          @QT_SRC_DIR@/qmake/examples \\\n                          @QT_SRC_DIR@/src/3rdparty/webkit/WebKit/qt/docs\n\nimagedirs               = @QT_SRC_DIR@/doc/src/images \\\n                          @QT_SRC_DIR@/examples \\\n                          @QT_SRC_DIR@/doc/src/declarative/pics \\\n                          @QT_SRC_DIR@/doc/src/template/image\n\noutputdir               = @DOC_DATA_DIR@\noutputformats           = WebXML\n\ngenerateindex           = false\nurl                     = .\n"
  },
  {
    "path": "doc/pysideapi2.rst",
    "content": "\n.. _pysideapi2:\n\nPySide API 2\n************\n\nSince the beginning one of the PySide goals was to be API compatible with PyQt4,\nbut with some (documented) exceptions. For example, PySide will not export to\nPython components marked as deprecated on C++ Qt. All the modifications follow\nthe `PSEP101 <http://www.pyside.org/docs/pseps/psep-0101.html>`_ as its guideline.\n\nThe release 4.7 of PyQt4 came with improvements on the pythonic front, being\nthe extinction of QString a good example. PySide followed this change, except in\none point: while PyQt4 has conserved the old behavior as optional, PySide\nbindings fully adopted the new API - completely removing QString. No turning\nback. Thus remember to update your source code to the new API, this will ensure\nyour code will run on both bindings.\n\n\n__hash__() function return value\n================================\n\nThe hash value returned for the classes :class:`PySide.QtCore.QDate`, :class:`PySide.QtCore.QDateTime`, :class:`PySide.QtCore.QTime`, :class:`PySide.QtCore.QUrl` will be\nbased on their string representations, thus objects with the same value will\nproduce the same hash.\n\n\nQString\n=======\n\nMethods that change QString arguments\n-------------------------------------\n\nMethods and functions that change the contents of a QString argument were\nmodified to receive an immutable Python unicode (or str) and return another\nPython unicode/str as the modified string.\n\nThe following methods had their return types modified this way:\n\n**Classes:** QAbstractSpinBox, QDateTimeEdit, QDoubleSpinBox, QSpinBox, QValidator\n\n- *fixup(string)*: string\n- *validate(string, int)*: [QValidator.State, string, int]\n\n\n**Classes:** QDoubleValidator, QIntValidator, QRegExpValidator\n\n- *validate(string, int)*: [QValidator.State, string, int]\n\n**Class:** QClipboard\n\n- *text(string, QClipboard.Mode mode=QClipboard.Clipboard)*: [string, string]\n\n\n**Class:** QFileDialog\n\nInstead of *getOpenFileNameAndFilter()*, *getOpenFileNamesAndFilter()* and *getSaveFileNameAndFilter()* like PyQt4 does,\nPySide has modified the original methods to return a tuple.\n\n- *getOpenFileName(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [string, filter]\n- *getOpenFileNames(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [list(string), filter]\n- *getSaveFileName(QWidget parent=None, str caption=None, str dir=None, str filter=None, QFileDialog.Options options=0)*: [string, filter]\n\n**Class:** QWebPage\n\n- *javaScriptPrompt(QWebFrame, string, string)*: [bool, string]\n\nOther QString related changes\n-----------------------------\n\n**Classes:** QFontMetrics and QFontMetricsF\n\nThey had two new methods added. Both take a string of one character and convert to a QChar (to call the C++ counterpart):\n\n- widthChar(string)\n- boundingRectChar(string)\n\n\nQTextStream\n===========\n\nInside this class some renames were applied to avoid clashes with native Python functions. They are: *bin_()*, *hex_()* and *oct_()*.\nThe only modification was the addition of '_' character.\n\n\nQVariant\n========\n\nAs QVariant was removed, any function expecting it can receive any Python object (None is an invalid QVariant). The same rule is valid when returning something: the returned QVariant will be converted to the its original Python object type.\n\nWhen a method expects a *QVariant::Type* the programmer can use a string (the type name) or the type itself.\n"
  },
  {
    "path": "doc/pysideinclude.py",
    "content": "#\n# This code is a modified version of the code found in sphinx distribution\n# the same license of sphinx distribution applies to this file as well.\n#\n\nimport os\nimport sys\nimport codecs\nfrom os import path\n\nfrom docutils import nodes\nfrom docutils.parsers.rst import Directive, directives\n\nfrom sphinx import addnodes\nfrom sphinx.util import parselinenos\n\nclass PySideInclude(Directive):\n    \"\"\"\n    Like ``.. include:: :literal:``, but only warns if the include file is\n    not found, and does not raise errors.  Also has several options for\n    selecting what to include.\n    \"\"\"\n\n    has_content = False\n    required_arguments = 1\n    optional_arguments = 0\n    final_argument_whitespace = False\n    option_spec = {\n        'linenos': directives.flag,\n        'tab-width': int,\n        'language': directives.unchanged_required,\n        'encoding': directives.encoding,\n        'pyobject': directives.unchanged_required,\n        'lines': directives.unchanged_required,\n        'start-after': directives.unchanged_required,\n        'end-before': directives.unchanged_required,\n        'prepend': directives.unchanged_required,\n        'append': directives.unchanged_required,\n        'snippet': directives.unchanged_required,\n    }\n\n    def run(self):\n        document = self.state.document\n        filename = self.arguments[0]\n        if not document.settings.file_insertion_enabled:\n            return [document.reporter.warning('File insertion disabled',\n                                              line=self.lineno)]\n        env = document.settings.env\n        if filename.startswith('/') or filename.startswith(os.sep):\n            rel_fn = filename[1:]\n        else:\n            docdir = path.dirname(env.doc2path(env.docname, base=None))\n            rel_fn = path.join(docdir, filename)\n        try:\n            fn = path.join(env.srcdir, rel_fn)\n        except UnicodeDecodeError:\n            # the source directory is a bytestring with non-ASCII characters;\n            # let's try to encode the rel_fn in the file system encoding\n            rel_fn = rel_fn.encode(sys.getfilesystemencoding())\n            fn = path.join(env.srcdir, rel_fn)\n\n        if 'pyobject' in self.options and 'lines' in self.options:\n            return [document.reporter.warning(\n                'Cannot use both \"pyobject\" and \"lines\" options',\n                line=self.lineno)]\n\n        encoding = self.options.get('encoding', env.config.source_encoding)\n        codec_info = codecs.lookup(encoding)\n        try:\n            f = codecs.StreamReaderWriter(open(fn, 'U'),\n                    codec_info[2], codec_info[3], 'strict')\n            lines = f.readlines()\n            f.close()\n        except (IOError, OSError):\n            return [document.reporter.warning(\n                'Include file %r not found or reading it failed' % filename,\n                line=self.lineno)]\n        except UnicodeError:\n            return [document.reporter.warning(\n                'Encoding %r used for reading included file %r seems to '\n                'be wrong, try giving an :encoding: option' %\n                (encoding, filename))]\n\n        objectname = self.options.get('pyobject')\n        if objectname is not None:\n            from sphinx.pycode import ModuleAnalyzer\n            analyzer = ModuleAnalyzer.for_file(fn, '')\n            tags = analyzer.find_tags()\n            if objectname not in tags:\n                return [document.reporter.warning(\n                    'Object named %r not found in include file %r' %\n                    (objectname, filename), line=self.lineno)]\n            else:\n                lines = lines[tags[objectname][1]-1 : tags[objectname][2]-1]\n\n        linespec = self.options.get('lines')\n        if linespec is not None:\n            try:\n                linelist = parselinenos(linespec, len(lines))\n            except ValueError, err:\n                return [document.reporter.warning(str(err), line=self.lineno)]\n            lines = [lines[i] for i in linelist]\n\n        startafter = self.options.get('start-after')\n        endbefore  = self.options.get('end-before')\n        prepend    = self.options.get('prepend')\n        append     = self.options.get('append')\n        snippet    = self.options.get('snippet')\n\n        if snippet:\n            startafter = \"//![%s]\" % snippet\n            endbefore = \"//![%s]\" % snippet\n\n        if startafter is not None or endbefore is not None:\n            use = not startafter\n            res = []\n            for line in lines:\n                if not use and startafter and startafter in line:\n                    use = True\n                elif use and endbefore and endbefore in line:\n                    use = False\n                    break\n                elif use:\n                    if not line.startswith(\"//!\"):\n                        res.append(line)\n            lines = res\n\n        if prepend:\n           lines.insert(0, prepend + '\\n')\n        if append:\n           lines.append(append + '\\n')\n\n        text = ''.join(lines)\n        if self.options.get('tab-width'):\n            text = text.expandtabs(self.options['tab-width'])\n        retnode = nodes.literal_block(text, text, source=fn)\n        retnode.line = 1\n        retnode.attributes['line_number'] = self.lineno\n        if self.options.get('language', ''):\n            retnode['language'] = self.options['language']\n        if 'linenos' in self.options:\n            retnode['linenos'] = True\n        document.settings.env.note_dependency(rel_fn)\n        return [retnode]\n\ndef setup(app):\n    app.add_directive('pysideinclude', PySideInclude)\n"
  },
  {
    "path": "doc/pysideversion.rst",
    "content": "Getting PySide and Qt version\n*****************************\n\nPySide exports their version numbers among the version of Qt used to compile PySide in a pythonnic way, you can check it using the variables:\n\n::\n\n    import PySide\n\n    # Prints PySide version\n    # e.g. 1.0.2\n    print PySide.__version__\n\n    # Gets a tuple with each version component\n    # e.g. (1, 0, 2, 'final', 1)\n    print PySide.__version_info__\n\n    # Prints the Qt version used to compile PySide\n    # e.g. \"4.7.2\"\n    print PySide.QtCore.__version__\n\n    # Gets a tuple with each version components of Qt used to compile PySide\n    # e.g. (4, 7, 2)\n    print PySide.QtCore.__version_info__\n\n\nNote that the Qt version used to compile PySide may differ from the version used to run PySide, to get the current running Qt version you can do:\n\n::\n\n    print PySide.QtCore.qVersion()\n"
  },
  {
    "path": "doc/tutorials/index.rst",
    "content": "PySide tutorials\n****************\n\nA 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.\n\n.. toctree::\n    :maxdepth: 2\n\n    qmltutorial/index.rst\n    qmladvancedtutorial/index.rst\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/index.rst",
    "content": ".. _qmladvancedtutorial:\n\nQML Advanced Tutorial\n*********************\n\nThis tutorial walks step-by-step through the creation of a full application using QML.\nIt assumes that you already know the basics of QML (for example, from reading the\n:ref:`qmltutorial`.\n\nIn this tutorial we write a game, *Same Game*, based on the Same Game application\nincluded in the declarative demos directory, which looks like this:\n\n.. figure:: declarative-samegame.png\n    :align: center\n\nWe will cover concepts for producing a fully functioning application, including\nJavaScript integration, using QML  States and Behaviors to\nmanage components and enhance your interface, and storing persistent application data.\n\nAn understanding of JavaScript is helpful to understand parts of this tutorial, but if you don't\nknow JavaScript you can still get a feel for how you can integrate backend logic to create and\ncontrol QML elements.\n\nTutorial chapters:\n\n.. toctree::\n    :maxdepth: 1\n\n    samegame1.rst\n    samegame2.rst\n    samegame3.rst\n    samegame4.rst\n\nAll the code in this tutorial can be found :download:`here <samegame.tar.bz2>`.\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame1/Block.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\n\nItem {\n    id: block\n\n    Image {\n        id: img\n        anchors.fill: parent\n        source: \"../shared/pics/redStone.png\"\n    }\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame1/Button.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\n\nRectangle {\n    id: container\n\n    property string text: \"Button\"\n\n    signal clicked\n\n    width: buttonLabel.width + 20; height: buttonLabel.height + 5\n    border { width: 1; color: Qt.darker(activePalette.button) }\n    smooth: true\n    radius: 8\n\n    // color the button with a gradient\n    gradient: Gradient {\n        GradientStop {\n            position: 0.0\n            color: {\n                if (mouseArea.pressed)\n                    return activePalette.dark\n                else\n                    return activePalette.light\n            }\n        }\n        GradientStop { position: 1.0; color: activePalette.button }\n    }\n\n    MouseArea {\n        id: mouseArea\n        anchors.fill: parent\n        onClicked: container.clicked();\n    }\n\n    Text {\n        id: buttonLabel\n        anchors.centerIn: container\n        color: activePalette.buttonText\n        text: container.text\n    }\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame1/samegame.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\n\nRectangle {\n    id: screen\n\n    width: 490; height: 720\n\n    SystemPalette { id: activePalette }\n\n    Item {\n        width: parent.width\n        anchors { top: parent.top; bottom: toolBar.top }\n\n        Image {\n            id: background\n            anchors.fill: parent\n            source: \"../shared/pics/background.jpg\"\n            fillMode: Image.PreserveAspectCrop\n        }\n    }\n\n    Rectangle {\n        id: toolBar\n        width: parent.width; height: 30\n        color: activePalette.window\n        anchors.bottom: screen.bottom\n\n        Button {\n            anchors { left: parent.left; verticalCenter: parent.verticalCenter }\n            text: \"New Game\" \n            onClicked: console.log(\"This doesn't do anything yet...\")\n        }\n\n        Text {\n            id: score\n            anchors { right: parent.right; verticalCenter: parent.verticalCenter }\n            text: \"Score: Who knows?\"\n        }\n    }\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame1/samegame1.qmlproject",
    "content": "import QmlProject 1.0\n\nProject {\n    /* Include .qml, .js, and image files from current directory and subdirectories */\n    QmlFiles {\n        directory: \".\"\n    }\n    JavaScriptFiles {\n        directory: \".\"\n    }\n    ImageFiles {\n        directory: \".\"\n    }\n    /* List of plugin directories passed to QML runtime */\n    // importPaths: [ \" ../exampleplugin \" ]\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame2/Block.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport QtQuick 1.0\n\nItem {\n    id: block\n\n    Image {\n        id: img\n        anchors.fill: parent\n        source: \"../shared/pics/redStone.png\"\n    }\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame2/Button.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport QtQuick 1.0\n\nRectangle {\n    id: container\n\n    property string text: \"Button\"\n\n    signal clicked\n\n    width: buttonLabel.width + 20; height: buttonLabel.height + 5\n    border { width: 1; color: Qt.darker(activePalette.button) }\n    smooth: true\n    radius: 8\n\n    // color the button with a gradient\n    gradient: Gradient {\n        GradientStop {\n            position: 0.0\n            color: {\n                if (mouseArea.pressed)\n                    return activePalette.dark\n                else\n                    return activePalette.light\n            }\n        }\n        GradientStop { position: 1.0; color: activePalette.button }\n    }\n\n    MouseArea {\n        id: mouseArea\n        anchors.fill: parent\n        onClicked: container.clicked();\n    }\n\n    Text {\n        id: buttonLabel\n        anchors.centerIn: container\n        color: activePalette.buttonText\n        text: container.text\n    }\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame2/samegame.js",
    "content": "//![0]\nvar blockSize = 40;\nvar maxColumn = 10;\nvar maxRow = 15;\nvar maxIndex = maxColumn * maxRow;\nvar board = new Array(maxIndex);\nvar component;\n\n//Index function used instead of a 2D array\nfunction index(column, row) {\n    return column + (row * maxColumn);\n}\n\nfunction startNewGame() {\n    //Delete blocks from previous game\n    for (var i = 0; i < maxIndex; i++) {\n        if (board[i] != null)\n            board[i].destroy();\n    }\n\n    //Calculate board size\n    maxColumn = Math.floor(background.width / blockSize);\n    maxRow = Math.floor(background.height / blockSize);\n    maxIndex = maxRow * maxColumn;\n\n    //Initialize Board\n    board = new Array(maxIndex);\n    for (var column = 0; column < maxColumn; column++) {\n        for (var row = 0; row < maxRow; row++) {\n            board[index(column, row)] = null;\n            createBlock(column, row);\n        }\n    }\n}\n\nfunction createBlock(column, row) {\n    if (component == null)\n        component = Qt.createComponent(\"Block.qml\");\n\n    // Note that if Block.qml was not a local file, component.status would be\n    // Loading and we should wait for the component's statusChanged() signal to\n    // know when the file is downloaded and ready before calling createObject().\n    if (component.status == Component.Ready) {\n        var dynamicObject = component.createObject(background);\n        if (dynamicObject == null) {\n            console.log(\"error creating block\");\n            console.log(component.errorString());\n            return false;\n        }\n        dynamicObject.x = column * blockSize;\n        dynamicObject.y = row * blockSize;\n        dynamicObject.width = blockSize;\n        dynamicObject.height = blockSize;\n        board[index(column, row)] = dynamicObject;\n    } else {\n        console.log(\"error loading block component\");\n        console.log(component.errorString());\n        return false;\n    }\n    return true;\n}\n//![0]\n\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame2/samegame.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport QtQuick 1.0\n//![2]\nimport \"samegame.js\" as SameGame\n//![2]\n\nRectangle {\n    id: screen\n\n    width: 490; height: 720\n\n    SystemPalette { id: activePalette }\n\n    Item {\n        width: parent.width\n        anchors { top: parent.top; bottom: toolBar.top }\n\n        Image {\n            id: background\n            anchors.fill: parent\n            source: \"../shared/pics/background.jpg\"\n            fillMode: Image.PreserveAspectCrop\n        }\n    }\n\n    Rectangle {\n        id: toolBar\n        width: parent.width; height: 32\n        color: activePalette.window\n        anchors.bottom: screen.bottom\n\n//![1]\n        Button {\n            anchors { left: parent.left; verticalCenter: parent.verticalCenter }\n            text: \"New Game\"\n            onClicked: SameGame.startNewGame()\n        }\n//![1]\n\n        Text {\n            id: score\n            anchors { right: parent.right; verticalCenter: parent.verticalCenter }\n            text: \"Score: Who knows?\"\n        }\n    }\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame2/samegame2.qmlproject",
    "content": "import QmlProject 1.0\n\nProject {\n    /* Include .qml, .js, and image files from current directory and subdirectories */\n    QmlFiles {\n        directory: \".\"\n    }\n    JavaScriptFiles {\n        directory: \".\"\n    }\n    ImageFiles {\n        directory: \".\"\n    }\n    /* List of plugin directories passed to QML runtime */\n    // importPaths: [ \" ../exampleplugin \" ]\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame3/Block.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\n\nItem {\n    id: block\n\n    property int type: 0\n\n    Image {\n        id: img\n\n        anchors.fill: parent\n        source: {\n            if (type == 0)\n                return \"../shared/pics/redStone.png\";\n            else if (type == 1) \n                return \"../shared/pics/blueStone.png\";\n            else\n                return \"../shared/pics/greenStone.png\";\n        }\n    }\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame3/Button.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport QtQuick 1.0\n\nRectangle {\n    id: container\n\n    property string text: \"Button\"\n\n    signal clicked\n\n    width: buttonLabel.width + 20; height: buttonLabel.height + 5\n    border { width: 1; color: Qt.darker(activePalette.button) }\n    smooth: true\n    radius: 8\n\n    // color the button with a gradient\n    gradient: Gradient {\n        GradientStop {\n            position: 0.0\n            color: {\n                if (mouseArea.pressed)\n                    return activePalette.dark\n                else\n                    return activePalette.light\n            }\n        }\n        GradientStop { position: 1.0; color: activePalette.button }\n    }\n\n    MouseArea {\n        id: mouseArea\n        anchors.fill: parent\n        onClicked: container.clicked();\n    }\n\n    Text {\n        id: buttonLabel\n        anchors.centerIn: container\n        color: activePalette.buttonText\n        text: container.text\n    }\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame3/Dialog.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\n\nRectangle {\n    id: container\n\n    function show(text) {\n        dialogText.text = text;\n        container.opacity = 1;\n    }\n\n    function hide() {\n        container.opacity = 0;\n    }\n\n    width: dialogText.width + 20\n    height: dialogText.height + 20\n    opacity: 0\n\n    Text {\n        id: dialogText\n        anchors.centerIn: parent\n        text: \"\"\n    }\n\n    MouseArea {\n        anchors.fill: parent\n        onClicked: hide();\n    }\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame3/samegame.js",
    "content": "/* This script file handles the game logic */\nvar maxColumn = 10;\nvar maxRow = 15;\nvar maxIndex = maxColumn * maxRow;\nvar board = new Array(maxIndex);\nvar component;\n\n//Index function used instead of a 2D array\nfunction index(column, row) {\n    return column + (row * maxColumn);\n}\n\nfunction startNewGame() {\n    //Calculate board size\n    maxColumn = Math.floor(gameCanvas.width / gameCanvas.blockSize);\n    maxRow = Math.floor(gameCanvas.height / gameCanvas.blockSize);\n    maxIndex = maxRow * maxColumn;\n\n    //Close dialogs\n    dialog.hide();\n\n    //Initialize Board\n    board = new Array(maxIndex);\n    gameCanvas.score = 0;\n    for (var column = 0; column < maxColumn; column++) {\n        for (var row = 0; row < maxRow; row++) {\n            board[index(column, row)] = null;\n            createBlock(column, row);\n        }\n    }\n}\n\nfunction createBlock(column, row) {\n    if (component == null)\n        component = Qt.createComponent(\"Block.qml\");\n\n    // Note that if Block.qml was not a local file, component.status would be\n    // Loading and we should wait for the component's statusChanged() signal to\n    // know when the file is downloaded and ready before calling createObject().\n    if (component.status == Component.Ready) {\n        var dynamicObject = component.createObject(gameCanvas);\n        if (dynamicObject == null) {\n            console.log(\"error creating block\");\n            console.log(component.errorString());\n            return false;\n        }\n        dynamicObject.type = Math.floor(Math.random() * 3);\n        dynamicObject.x = column * gameCanvas.blockSize;\n        dynamicObject.y = row * gameCanvas.blockSize;\n        dynamicObject.width = gameCanvas.blockSize;\n        dynamicObject.height = gameCanvas.blockSize;\n        board[index(column, row)] = dynamicObject;\n    } else {\n        console.log(\"error loading block component\");\n        console.log(component.errorString());\n        return false;\n    }\n    return true;\n}\n\nvar fillFound; //Set after a floodFill call to the number of blocks found\nvar floodBoard; //Set to 1 if the floodFill reaches off that node\n\n//![1]\nfunction handleClick(xPos, yPos) {\n    var column = Math.floor(xPos / gameCanvas.blockSize);\n    var row = Math.floor(yPos / gameCanvas.blockSize);\n    if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)\n        return;\n    if (board[index(column, row)] == null)\n        return;\n    //If it's a valid block, remove it and all connected (does nothing if it's not connected)\n    floodFill(column, row, -1);\n    if (fillFound <= 0)\n        return;\n    gameCanvas.score += (fillFound - 1) * (fillFound - 1);\n    shuffleDown();\n    victoryCheck();\n}\n//![1]\n\nfunction floodFill(column, row, type) {\n    if (board[index(column, row)] == null)\n        return;\n    var first = false;\n    if (type == -1) {\n        first = true;\n        type = board[index(column, row)].type;\n\n        //Flood fill initialization\n        fillFound = 0;\n        floodBoard = new Array(maxIndex);\n    }\n    if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)\n        return;\n    if (floodBoard[index(column, row)] == 1 || (!first && type != board[index(column, row)].type))\n        return;\n    floodBoard[index(column, row)] = 1;\n    floodFill(column + 1, row, type);\n    floodFill(column - 1, row, type);\n    floodFill(column, row + 1, type);\n    floodFill(column, row - 1, type);\n    if (first == true && fillFound == 0)\n        return;     //Can't remove single blocks\n    board[index(column, row)].opacity = 0;\n    board[index(column, row)] = null;\n    fillFound += 1;\n}\n\nfunction shuffleDown() {\n    //Fall down\n    for (var column = 0; column < maxColumn; column++) {\n        var fallDist = 0;\n        for (var row = maxRow - 1; row >= 0; row--) {\n            if (board[index(column, row)] == null) {\n                fallDist += 1;\n            } else {\n                if (fallDist > 0) {\n                    var obj = board[index(column, row)];\n                    obj.y += fallDist * gameCanvas.blockSize;\n                    board[index(column, row + fallDist)] = obj;\n                    board[index(column, row)] = null;\n                }\n            }\n        }\n    }\n    //Fall to the left\n    var fallDist = 0;\n    for (var column = 0; column < maxColumn; column++) {\n        if (board[index(column, maxRow - 1)] == null) {\n            fallDist += 1;\n        } else {\n            if (fallDist > 0) {\n                for (var row = 0; row < maxRow; row++) {\n                    var obj = board[index(column, row)];\n                    if (obj == null)\n                        continue;\n                    obj.x -= fallDist * gameCanvas.blockSize;\n                    board[index(column - fallDist, row)] = obj;\n                    board[index(column, row)] = null;\n                }\n            }\n        }\n    }\n}\n\n//![2]\nfunction victoryCheck() {\n    //Award bonus points if no blocks left\n    var deservesBonus = true;\n    for (var column = maxColumn - 1; column >= 0; column--)\n        if (board[index(column, maxRow - 1)] != null)\n        deservesBonus = false;\n    if (deservesBonus)\n        gameCanvas.score += 500;\n\n    //Check whether game has finished\n    if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1)))\n        dialog.show(\"Game Over. Your score is \" + gameCanvas.score);\n}\n//![2]\n\n//only floods up and right, to see if it can find adjacent same-typed blocks \nfunction floodMoveCheck(column, row, type) {\n    if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)\n        return false;\n    if (board[index(column, row)] == null)\n        return false;\n    var myType = board[index(column, row)].type;\n    if (type == myType)\n        return true;\n    return floodMoveCheck(column + 1, row, myType) || floodMoveCheck(column, row - 1, board[index(column, row)].type);\n}\n\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame3/samegame.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\nimport \"samegame.js\" as SameGame\n\nRectangle {\n    id: screen\n\n    width: 490; height: 720\n\n    SystemPalette { id: activePalette }\n\n    Item {\n        width: parent.width\n        anchors { top: parent.top; bottom: toolBar.top }\n\n        Image {\n            id: background\n            anchors.fill: parent\n            source: \"../shared/pics/background.jpg\"\n            fillMode: Image.PreserveAspectCrop\n        }\n\n//![1]\n        Item {\n            id: gameCanvas\n\n            property int score: 0\n            property int blockSize: 40\n\n            width: parent.width - (parent.width % blockSize)\n            height: parent.height - (parent.height % blockSize)\n            anchors.centerIn: parent\n\n            MouseArea {\n                anchors.fill: parent\n                onClicked: SameGame.handleClick(mouse.x, mouse.y)\n            }\n        }\n//![1]\n    }\n\n//![2]\n    Dialog {\n        id: dialog\n        anchors.centerIn: parent\n        z: 100\n    }\n//![2]\n\n    Rectangle {\n        id: toolBar\n        width: parent.width; height: 30\n        color: activePalette.window\n        anchors.bottom: screen.bottom\n\n        Button {\n            anchors { left: parent.left; verticalCenter: parent.verticalCenter }\n            text: \"New Game\"\n            onClicked: SameGame.startNewGame()\n        }\n\n        Text {\n            id: score\n            anchors { right: parent.right; verticalCenter: parent.verticalCenter }\n            text: \"Score: Who knows?\"\n        }\n    }\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame3/samegame3.qmlproject",
    "content": "import QmlProject 1.0\n\nProject {\n    /* Include .qml, .js, and image files from current directory and subdirectories */\n    QmlFiles {\n        directory: \".\"\n    }\n    JavaScriptFiles {\n        directory: \".\"\n    }\n    ImageFiles {\n        directory: \".\"\n    }\n    /* List of plugin directories passed to QML runtime */\n    // importPaths: [ \" ../exampleplugin \" ]\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/content/BoomBlock.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport QtQuick 1.0\nimport Qt.labs.particles 1.0\n\nItem {\n    id: block\n\n    property int type: 0\n    property bool dying: false\n\n    //![1]\n    property bool spawned: false\n\n    Behavior on x {\n        enabled: spawned;\n        SpringAnimation{ spring: 2; damping: 0.2 }\n    }\n    Behavior on y {\n        SpringAnimation{ spring: 2; damping: 0.2 }\n    }\n    //![1]\n\n    //![2]\n    Image {\n        id: img\n\n        anchors.fill: parent\n        source: {\n            if (type == 0)\n                return \"../../shared/pics/redStone.png\";\n            else if (type == 1)\n                return \"../../shared/pics/blueStone.png\";\n            else\n                return \"../../shared/pics/greenStone.png\";\n        }\n        opacity: 0\n\n        Behavior on opacity {\n            NumberAnimation { properties:\"opacity\"; duration: 200 }\n        }\n    }\n    //![2]\n\n    //![3]\n    Particles {\n        id: particles\n\n        width: 1; height: 1\n        anchors.centerIn: parent\n\n        emissionRate: 0\n        lifeSpan: 700; lifeSpanDeviation: 600\n        angle: 0; angleDeviation: 360;\n        velocity: 100; velocityDeviation: 30\n        source: {\n            if (type == 0)\n                return \"../../shared/pics/redStar.png\";\n            else if (type == 1) \n                return \"../../shared/pics/blueStar.png\";\n            else\n                return \"../../shared/pics/greenStar.png\";\n        }\n    }\n    //![3]\n\n    //![4]\n    states: [\n        State {\n            name: \"AliveState\"\n            when: spawned == true && dying == false\n            PropertyChanges { target: img; opacity: 1 }\n        },\n\n        State {\n            name: \"DeathState\"\n            when: dying == true\n            StateChangeScript { script: particles.burst(50); }\n            PropertyChanges { target: img; opacity: 0 }\n            StateChangeScript { script: block.destroy(1000); }\n        }\n    ]\n    //![4]\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/content/Button.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport QtQuick 1.0\n\nRectangle {\n    id: container\n\n    property string text: \"Button\"\n\n    signal clicked\n\n    width: buttonLabel.width + 20; height: buttonLabel.height + 5\n    border { width: 1; color: Qt.darker(activePalette.button) }\n    smooth: true\n    radius: 8\n\n    // color the button with a gradient\n    gradient: Gradient {\n        GradientStop {\n            position: 0.0\n            color: {\n                if (mouseArea.pressed)\n                    return activePalette.dark\n                else\n                    return activePalette.light\n            }\n        }\n        GradientStop { position: 1.0; color: activePalette.button }\n    }\n\n    MouseArea {\n        id: mouseArea\n        anchors.fill: parent\n        onClicked: container.clicked();\n    }\n\n    Text {\n        id: buttonLabel\n        anchors.centerIn: container\n        color: activePalette.buttonText\n        text: container.text\n    }\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/content/Dialog.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport QtQuick 1.0\n\n//![0]\nRectangle {\n    id: container\n//![0]\n\n//![1]\n    property string inputText: textInput.text\n    signal closed\n\n    function show(text) {\n        dialogText.text = text;\n        container.opacity = 1;\n        textInput.opacity = 0;\n    }\n\n    function showWithInput(text) {\n        show(text);\n        textInput.opacity = 1;\n        textInput.focus = true;\n        textInput.text = \"\"\n    }\n\n    function hide() {\n        textInput.focus = false;\n        container.opacity = 0;\n        container.closed();\n    }\n//![1]\n\n    width: dialogText.width + textInput.width + 20\n    height: dialogText.height + 20\n    opacity: 0\n    visible: opacity > 0\n\n    Text {\n        id: dialogText\n        anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: 10 }\n        text: \"\"\n    }\n\n//![2]\n    TextInput {\n        id: textInput\n        anchors { verticalCenter: parent.verticalCenter; left: dialogText.right }\n        width: 80\n        text: \"\"\n\n        onAccepted: container.hide()    // close dialog when Enter is pressed\n    }\n//![2]\n\n    MouseArea {\n        anchors.fill: parent\n\n        onClicked:  {\n            if (textInput.text == \"\" && textInput.opacity > 0)\n                textInput.openSoftwareInputPanel();\n            else\n                hide();\n        }\n    }\n\n//![3]\n}\n//![3]\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/content/samegame.js",
    "content": "/* This script file handles the game logic */\nvar maxColumn = 10;\nvar maxRow = 15;\nvar maxIndex = maxColumn * maxRow;\nvar board = new Array(maxIndex);\nvar component;\nvar scoresURL = \"\";\nvar gameDuration;\n\n//Index function used instead of a 2D array\nfunction index(column, row) {\n    return column + (row * maxColumn);\n}\n\nfunction startNewGame() {\n    //Delete blocks from previous game\n    for (var i = 0; i < maxIndex; i++) {\n        if (board[i] != null)\n            board[i].destroy();\n    }\n\n    //Calculate board size\n    maxColumn = Math.floor(gameCanvas.width / gameCanvas.blockSize);\n    maxRow = Math.floor(gameCanvas.height / gameCanvas.blockSize);\n    maxIndex = maxRow * maxColumn;\n\n    //Close dialogs\n    nameInputDialog.hide();\n    dialog.hide();\n\n    //Initialize Board\n    board = new Array(maxIndex);\n    gameCanvas.score = 0;\n    for (var column = 0; column < maxColumn; column++) {\n        for (var row = 0; row < maxRow; row++) {\n            board[index(column, row)] = null;\n            createBlock(column, row);\n        }\n    }\n\n    gameDuration = new Date();\n}\n\nfunction createBlock(column, row) {\n    if (component == null)\n        component = Qt.createComponent(\"content/BoomBlock.qml\");\n\n    // Note that if Block.qml was not a local file, component.status would be\n    // Loading and we should wait for the component's statusChanged() signal to\n    // know when the file is downloaded and ready before calling createObject().\n    if (component.status == Component.Ready) {\n        var dynamicObject = component.createObject(gameCanvas);\n        if (dynamicObject == null) {\n            console.log(\"error creating block\");\n            console.log(component.errorString());\n            return false;\n        }\n        dynamicObject.type = Math.floor(Math.random() * 3);\n        dynamicObject.x = column * gameCanvas.blockSize;\n        dynamicObject.y = row * gameCanvas.blockSize;\n        dynamicObject.width = gameCanvas.blockSize;\n        dynamicObject.height = gameCanvas.blockSize;\n        dynamicObject.spawned = true;\n        board[index(column, row)] = dynamicObject;\n    } else {\n        console.log(\"error loading block component\");\n        console.log(component.errorString());\n        return false;\n    }\n    return true;\n}\n\nvar fillFound; //Set after a floodFill call to the number of blocks found\nvar floodBoard; //Set to 1 if the floodFill reaches off that node\n\nfunction handleClick(xPos, yPos) {\n    var column = Math.floor(xPos / gameCanvas.blockSize);\n    var row = Math.floor(yPos / gameCanvas.blockSize);\n    if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)\n        return;\n    if (board[index(column, row)] == null)\n        return;\n    //If it's a valid block, remove it and all connected (does nothing if it's not connected)\n    floodFill(column, row, -1);\n    if (fillFound <= 0)\n        return;\n    gameCanvas.score += (fillFound - 1) * (fillFound - 1);\n    shuffleDown();\n    victoryCheck();\n}\n\nfunction floodFill(column, row, type) {\n    if (board[index(column, row)] == null)\n        return;\n    var first = false;\n    if (type == -1) {\n        first = true;\n        type = board[index(column, row)].type;\n\n        //Flood fill initialization\n        fillFound = 0;\n        floodBoard = new Array(maxIndex);\n    }\n    if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)\n        return;\n    if (floodBoard[index(column, row)] == 1 || (!first && type != board[index(column, row)].type))\n        return;\n    floodBoard[index(column, row)] = 1;\n    floodFill(column + 1, row, type);\n    floodFill(column - 1, row, type);\n    floodFill(column, row + 1, type);\n    floodFill(column, row - 1, type);\n    if (first == true && fillFound == 0)\n        return;     //Can't remove single blocks\n    board[index(column, row)].dying = true;\n    board[index(column, row)] = null;\n    fillFound += 1;\n}\n\nfunction shuffleDown() {\n    //Fall down\n    for (var column = 0; column < maxColumn; column++) {\n        var fallDist = 0;\n        for (var row = maxRow - 1; row >= 0; row--) {\n            if (board[index(column, row)] == null) {\n                fallDist += 1;\n            } else {\n                if (fallDist > 0) {\n                    var obj = board[index(column, row)];\n                    obj.y = (row + fallDist) * gameCanvas.blockSize;\n                    board[index(column, row + fallDist)] = obj;\n                    board[index(column, row)] = null;\n                }\n            }\n        }\n    }\n    //Fall to the left\n    fallDist = 0;\n    for (column = 0; column < maxColumn; column++) {\n        if (board[index(column, maxRow - 1)] == null) {\n            fallDist += 1;\n        } else {\n            if (fallDist > 0) {\n                for (row = 0; row < maxRow; row++) {\n                    obj = board[index(column, row)];\n                    if (obj == null)\n                        continue;\n                    obj.x = (fallDist - column) * gameCanvas.blockSize;\n                    board[index(column - fallDist, row)] = obj;\n                    board[index(column, row)] = null;\n                }\n            }\n        }\n    }\n}\n\n//![3]\nfunction victoryCheck() {\n//![3]\n    //Award bonus points if no blocks left\n    var deservesBonus = true;\n    for (var column = maxColumn - 1; column >= 0; column--)\n        if (board[index(column, maxRow - 1)] != null)\n        deservesBonus = false;\n    if (deservesBonus)\n        gameCanvas.score += 500;\n\n//![4]\n    //Check whether game has finished\n    if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) {\n        gameDuration = new Date() - gameDuration;\n        nameInputDialog.showWithInput(\"You won! Please enter your name: \");\n    }\n}\n//![4]\n\n//only floods up and right, to see if it can find adjacent same-typed blocks \nfunction floodMoveCheck(column, row, type) {\n    if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)\n        return false;\n    if (board[index(column, row)] == null)\n        return false;\n    var myType = board[index(column, row)].type;\n    if (type == myType)\n        return true;\n    return floodMoveCheck(column + 1, row, myType) || floodMoveCheck(column, row - 1, board[index(column, row)].type);\n}\n\n//![2]\nfunction saveHighScore(name) {\n    if (scoresURL != \"\")\n        sendHighScore(name);\n\n    var db = openDatabaseSync(\"SameGameScores\", \"1.0\", \"Local SameGame High Scores\", 100);\n    var dataStr = \"INSERT INTO Scores VALUES(?, ?, ?, ?)\";\n    var data = [name, gameCanvas.score, maxColumn + \"x\" + maxRow, Math.floor(gameDuration / 1000)];\n    db.transaction(function(tx) {\n        tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)');\n        tx.executeSql(dataStr, data);\n\n        var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = \"12x17\" ORDER BY score desc LIMIT 10');\n        var r = \"\\nHIGH SCORES for a standard sized grid\\n\\n\"\n        for (var i = 0; i < rs.rows.length; i++) {\n            r += (i + 1) + \". \" + rs.rows.item(i).name + ' got ' + rs.rows.item(i).score + ' points in ' + rs.rows.item(i).time + ' seconds.\\n';\n        }\n        dialog.show(r);\n    });\n}\n//![2]\n\n//![1]\nfunction sendHighScore(name) {\n    var postman = new XMLHttpRequest()\n        var postData = \"name=\" + name + \"&score=\" + gameCanvas.score + \"&gridSize=\" + maxColumn + \"x\" + maxRow + \"&time=\" + Math.floor(gameDuration / 1000);\n    postman.open(\"POST\", scoresURL, true);\n    postman.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n    postman.onreadystatechange = function() {\n        if (postman.readyState == postman.DONE) {\n            dialog.show(\"Your score has been uploaded.\");\n        }\n    }\n    postman.send(postData);\n}\n//![1]\n\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/highscores/README",
    "content": "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.\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/highscores/score_data.xml",
    "content": "<record><score>1000000</score><name>Alan the Tester</name><gridSize>0x0</gridSize><seconds>0</seconds></record>\n<record><score>6213</score><name>Alan</name><gridSize>12x17</gridSize><seconds>51</seconds></record>\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/highscores/score_style.xsl",
    "content": "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n<xsl:template match=\"/\">\n  <html>\n  <head><title>SameGame High Scores</title></head>\n  <body>\n  <h2>SameGame High Scores</h2>\n    <table border=\"1\">\n      <tr bgcolor=\"lightsteelblue\">\n        <th>Name</th>\n        <th>Score</th>\n        <th>Grid Size</th>\n        <th>Time, s</th>\n      </tr>\n      <xsl:for-each select=\"records/record\">\n      <xsl:sort select=\"score\" data-type=\"number\" order=\"descending\"/>\n      <tr>\n        <td><xsl:value-of select=\"name\"/></td>\n        <td><xsl:value-of select=\"score\"/></td>\n        <td><xsl:value-of select=\"gridSize\"/></td>\n        <td><xsl:value-of select=\"seconds\"/></td>\n      </tr>\n      </xsl:for-each>\n    </table>\n  </body>\n  </html>\n</xsl:template>\n</xsl:stylesheet>\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/highscores/scores.php",
    "content": "<?php\n    $score = $_POST[\"score\"];\n    echo \"<html>\";\n    echo \"<head><title>SameGame High Scores</title></head><body>\";\n    if($score > 0){#Sending in a new high score\n        $name = $_POST[\"name\"];\n        $grid = $_POST[\"gridSize\"];\n        $time = $_POST[\"time\"];\n        if($name == \"\")\n            $name = \"Anonymous\";\n\t$file = fopen(\"score_data.xml\", \"a\");\n        $ret = fwrite($file, \"<record><score>\". $score . \"</score><name>\" \n            . $name . \"</name><gridSize>\" . $grid . \"</gridSize><seconds>\"\n            . $time . \"</seconds></record>\\n\");\n        echo \"Your score has been recorded. Thanks for playing!\";\n        if($ret == False)\n            echo \"<br/> There was an error though, so don't expect to see that score again.\";\n    }else{#Read high score list\n        #Now uses XSLT to display. So just print the file. With XML cruft added.\n        #Note that firefox at least won't apply the XSLT on a php file. So redirecting\n\t$file = fopen(\"scores.xml\", \"w\");\n        $ret = fwrite($file, '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>' . \"\\n\"\n            . '<?xml-stylesheet type=\"text/xsl\" href=\"score_style.xsl\"?>' . \"\\n\"\n            . \"<records>\\n\" . file_get_contents(\"score_data.xml\") . \"</records>\\n\");\n        if($ret == False)\n            echo \"There was an internal error. Sorry.\";\n        else\n            echo '<script type=\"text/javascript\">window.location.replace(\"scores.xml\")</script>';\n    }\n    echo \"</body></html>\";\n?>\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/samegame.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport QtQuick 1.0\nimport \"content\"\nimport \"content/samegame.js\" as SameGame\n\nRectangle {\n    id: screen\n\n    width: 490; height: 720\n\n    SystemPalette { id: activePalette }\n\n    Item {\n        width: parent.width\n        anchors { top: parent.top; bottom: toolBar.top }\n\n        Image {\n            id: background\n            anchors.fill: parent\n            source: \"../shared/pics/background.jpg\"\n            fillMode: Image.PreserveAspectCrop\n        }\n\n        Item {\n            id: gameCanvas\n            property int score: 0\n            property int blockSize: 40\n\n            anchors.centerIn: parent\n            width: parent.width - (parent.width % blockSize);\n            height: parent.height - (parent.height % blockSize);\n\n            MouseArea {\n                anchors.fill: parent; onClicked: SameGame.handleClick(mouse.x,mouse.y);\n            }\n        }\n    }\n\n    Dialog {\n        id: dialog\n        anchors.centerIn: parent\n        z: 100\n    }\n\n    //![0]\n    Dialog {\n        id: nameInputDialog\n        anchors.centerIn: parent\n        z: 100\n\n        onClosed: {\n            if (nameInputDialog.inputText != \"\")\n                SameGame.saveHighScore(nameInputDialog.inputText);\n        }\n    }\n    //![0]\n\n    Rectangle {\n        id: toolBar\n        width: parent.width; height: 30\n        color: activePalette.window\n        anchors.bottom: screen.bottom\n\n        Button {\n            anchors { left: parent.left; verticalCenter: parent.verticalCenter }\n            text: \"New Game\"\n            onClicked: SameGame.startNewGame()\n        }\n\n        Text {\n            id: score\n            anchors { right: parent.right; verticalCenter: parent.verticalCenter }\n            text: \"Score: \" + gameCanvas.score\n        }\n    }\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame/samegame4/samegame4.qmlproject",
    "content": "import QmlProject 1.0\n\nProject {\n    /* Include .qml, .js, and image files from current directory and subdirectories */\n    QmlFiles {\n        directory: \".\"\n    }\n    JavaScriptFiles {\n        directory: \".\"\n    }\n    ImageFiles {\n        directory: \".\"\n    }\n    /* List of plugin directories passed to QML runtime */\n    // importPaths: [ \" ../exampleplugin \" ]\n}\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame1.rst",
    "content": ".. _samegame1:\n\nQML Advanced Tutorial 1 - Creating the Game Canvas and Blocks\n*************************************************************\n\nCreating the application screen\n===============================\n\nThe first step is to create the basic QML items in your application.\n\nTo begin with, we create our Same Game application with a main screen like this:\n\n.. figure:: declarative-adv-tutorial1.png\n    :align: center\n\nThis is defined by the main application file, ``samegame.qml``, which looks like this:\n\n.. pysideinclude:: samegame/samegame1/samegame.qml\n    :snippet: 0\n\nThis gives you a basic game window that includes the main canvas for the\nblocks, a \"New Game\" button and a score display.\n\nOne item you may not recognize here\nis the SystemPalette item. This provides access to the Qt system palette\nand is used to give the button a more native look-and-feel.\n\nNotice the anchors for the ``Item``, ``Button`` and ``Text`` elements are set using\ngroup notation for readability.\n\nAdding Button and Block components\n==================================\n\nThe ``Button`` item in the code above is defined in a separate component file named ``Button.qml``.\nTo create a functional button, we use the QML elements Text and MouseArea inside a Rectangle.\nHere is the ``Button.qml`` code:\n\n.. pysideinclude:: samegame/samegame1/Button.qml\n    :snippet: 0\n\nThis essentially defines a rectangle that contains text and can be clicked. The MouseArea\nhas an ``onClicked()`` handler that is implemented to emit the ``clicked()`` signal of the\n``container`` when the area is clicked.\n\nIn Same Game, the screen is filled with small blocks when the game begins.\nEach block is just an item that contains an image. The block\ncode is defined in a separate ``Block.qml`` file:\n\n.. pysideinclude:: samegame/samegame1/Block.qml\n    :snippet: 0\n\nAt the moment, the block doesn't do anything; it is just an image. As the\ntutorial progresses we will animate and give behaviors to the blocks.\nWe have not added any code yet to create the blocks; we will do this\nin the next chapter.\n\nWe have set the image to be the size of its parent Item using ``anchors.fill: parent``.\nThis means that when we dynamically create and resize the block items\nlater on in the tutorial, the image will be scaled automatically to the\ncorrect size.\n\nNotice the relative path for the Image element's ``source`` property.\nThis path is relative to the location of the file that contains the Image element.\nAlternatively, you could set the Image source to an absolute file path or a URL\nthat contains an image.\n\nYou should be familiar with the code so far. We have just created some basic\nelements to get started. Next, we will populate the game canvas with some blocks.\n\n[Previous :ref:`qmladvancedtutorial`] [Next :ref:`samegame2`]"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame2.rst",
    "content": ".. _samegame2:\n\nQML Advanced Tutorial 2 - Populating the Game Canvas\n****************************************************\n\nGenerating the blocks in JavaScript\n===================================\n\nNow that we've written some basic elements, let's start writing the game.\n\nThe first task is to generate the game blocks. Each time the New Game button\nis clicked, the game canvas is populated with a new, random set of\nblocks. Since we need to dynamically generate new blocks for each new game,\nwe cannot use Repeater to define the blocks. Instead, we will\ncreate the blocks in JavaScript.\n\nHere is the JavaScript code for generating the blocks, contained in a new\nfile, ``samegame.js``. The code is explained below.\n\n.. pysideinclude:: samegame/samegame2/samegame.js\n    :snippet: 0\n\nThe ``startNewGame()`` function deletes the blocks created in the previous game and\ncalculates the number of rows and columns of blocks required to fill the game window for the new game.\nThen, it creates an array to store all the game\nblocks, and calls ``createBlock()`` to create enough blocks to fill the game window.\n\nThe ``createBlock()`` function creates a block from the ``Block.qml`` file\nand moves the new block to its position on the game canvas. This involves several steps:\n\n*  ``Qt.createComponent()`` is called to\n   generate an element from ``Block.qml``.  If the component is ready,\n   we can call ``createObject()`` to create an instance of the ``Block``\n   item.\n\n*  If ``createObject()`` returned null (i.e. if there was an error\n   while loading the object), print the error information.\n\n*  Place the block in its position on the board and set its width and\n   height.  Also, store it in the blocks array for future reference.\n\n*  Finally, print error information to the console if the component\n   could not be loaded for some reason (for example, if the file is\n   missing).\n\nConnecting JavaScript components to QML\n=======================================\n\nNow we need to call the JavaScript code in ``samegame.js`` from our QML files.\nTo do this, we add this line to ``samegame.qml`` which imports\nthe JavaScript file as a module:\n\n.. pysideinclude:: samegame/samegame2/samegame.qml\n    :snippet: 2\n\nThis allows us to refer to any functions within ``samegame.js`` using \"SameGame\"\nas a prefix: for example, ``SameGame.startNewGame()`` or ``SameGame.createBlock()``.\nThis means we can now connect the New Game button's ``onClicked`` handler to the ``startNewGame()``\nfunction, like this:\n\n.. pysideinclude:: samegame/samegame2/samegame.qml\n    :snippet: 1\n\nSo, when you click the New Game button, ``startNewGame()`` is called and generates a field of blocks, like this:\n\n.. figure:: declarative-adv-tutorial2.png\n    :align: center\n\nNow, we have a screen of blocks, and we can begin to add the game mechanics.\n\n[Previous :ref:`samegame1`] [Next :ref:`samegame3`]"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame3.rst",
    "content": ".. _samegame3:\n\nQML Advanced Tutorial 3 - Implementing the Game Logic\n*****************************************************\n\nMaking a playable game\n======================\n\nNow that we have all the game components, we can add the game logic that\ndictates how a player interacts with the blocks and plays the game\nuntil it is won or lost.\n\nTo do this, we have added the following functions to ``samegame.js``:\n\n\n* ``handleClick(x,y)``\n* ``floodFill(xIdx,yIdx,type)``\n* ``shuffleDown()``\n* ``victoryCheck()``\n* ``floodMoveCheck(xIdx, yIdx, type)``\n\nAs this is a tutorial about QML, not game design, we will only discuss ``handleClick()`` and ``victoryCheck()`` below since they interface directly with the QML elements. Note that although the game logic here is written in JavaScript, it could have been written in Python and then exposed to QML.\n\nEnabling mouse click interaction\n================================\n\nTo make it easier for the JavaScript code to interface with the QML elements, we have added an Item called ``gameCanvas`` to ``samegame.qml``. It replaces the background as the item which contains the blocks. It also accepts mouse input from the user.  Here is the item code:\n\n.. pysideinclude:: samegame/samegame3/samegame.qml\n    :snippet: 1\n\nThe ``gameCanvas`` item is the exact size of the board, and has a ``score`` property and a MouseArea to handle mouse clicks.\nThe blocks are now created as its children, and its dimensions are used to determine the board size so that\nthe application scales to the available screen size.\nSince its size is bound to a multiple of ``blockSize``, ``blockSize`` was moved out of ``samegame.js`` and into ``samegame.qml`` as a QML property.\nNote that it can still be accessed from the script.\n\nWhen clicked, the MouseArea calls ``handleClick()`` in ``samegame.js``, which determines whether the player's click should cause any blocks to be removed, and updates ``gameCanvas.score`` with the current score if necessary. Here is the ``handleClick()`` function:\n\n.. pysideinclude:: samegame/samegame3/samegame.js\n    :snippet: 1\n\nNote that if ``score`` was a global variable in the ``samegame.js`` file you would not be able to bind to it. You can only bind to QML properties.\n\nUpdating the score\n==================\n\nWhen the player clicks a block and triggers \\c handleClick(), \\c handleClick() also calls \\c victoryCheck() to update the score and to check whether the player has completed the game. Here is the \\c victoryCheck() code:\n\n.. pysideinclude:: samegame/samegame3/samegame.js\n    :snippet: 2\n\nThis updates the ``gameCanvas.score`` value and displays a \"Game Over\" dialog if the game is finished.\n\nThe Game Over dialog is created using a ``Dialog`` element that is defined in ``Dialog.qml``. Here is the ``Dialog.qml`` code. Notice how it is designed to be usable imperatively from the script file, via the functions and signals:\n\n.. pysideinclude:: samegame/samegame3/Dialog.qml\n    :snippet: 0\n\nAnd this is how it is used in the main ``samegame.qml`` file:\n\n.. pysideinclude:: samegame/samegame3/samegame.qml\n    :snippet: 2\n\nWe give the dialog a ``z`` value of 100 to ensure it is displayed on top of our other components. The default ``z`` value for an item is 0.\n\n\nA dash of color\n---------------\n\nIt's not much fun to play Same Game if all the blocks are the same color, so we've modified the ``createBlock()`` function in ``samegame.js`` to randomly create a different type of block (for either red, green or blue) each time it is called. ``Block.qml`` has also changed so that each block contains a different image depending on its type:\n\n.. pysideinclude:: samegame/samegame3/Block.qml\n    :snippet: 0\n\n\nA working game\n==============\n\nNow we now have a working game! The blocks can be clicked, the player can score, and the game can end (and then you can start a new one).\nHere is a screenshot of what has been accomplished so far:\n\n.. figure:: declarative-adv-tutorial3.png\n    :align: center\n\nThis is what ``samegame.qml`` looks like now:\n\n.. pysideinclude:: samegame/samegame3/samegame.qml\n    :snippet: 0\n\nThe game works, but it's a little boring right now. Where are the smooth animated transitions? Where are the high scores?\nIf you were a QML expert you could have written these in the first iteration, but in this tutorial they've been saved\nuntil the next chapter - where your application becomes alive!\n\n[Previous :ref:`samegame2`] [Next :ref:`samegame4`]\n"
  },
  {
    "path": "doc/tutorials/qmladvancedtutorial/samegame4.rst",
    "content": ".. _samegame4:\n\nQML Advanced Tutorial 4 - Finishing Touches\n*******************************************\n\nAdding some flair\n=================\n\nNow we're going to do two things to liven up the game: animate the blocks and add a High Score system.\n\nWe've also cleaned up the directory structure for our application files. We now have a lot of files, so all the\nJavaScript and QML files outside of ``samegame.qml`` have been moved into a new sub-directory named \"content\".\n\nIn anticipation of the new block animations, ``Block.qml`` file is now renamed to ``BoomBlock.qml``.\n\nAnimating block movement\n------------------------\n\nFirst we will animate the blocks so that they move in a fluid manner. QML has a number of methods for adding fluid\nmovement, and in this case we're going to use the Behavior element to add a SpringAnimation.\nIn ``BoomBlock.qml``, we apply a SpringAnimation behavior to the ``x`` and ``y`` properties so that the\nblock will follow and animate its movement in a spring-like fashion towards the specified position (whose\nvalues will be set by ``samegame.js``).Here is the code added to ``BoomBlock.qml``:\n\n.. pysideinclude:: samegame/samegame4/content/BoomBlock.qml\n    :snippet: 1\n\nThe ``spring`` and ``damping`` values can be changed to modify the spring-like effect of the animation.\n\nThe ``enabled: spawned`` setting refers to the ``spawned`` value that is set from ``createBlock()`` in ``samegame.js``.\nThis ensures the SpringAnimation on the ``x`` is only enabled after ``createBlock()`` has set the block to\nthe correct position. Otherwise, the blocks will slide out of the corner (0,0) when a game begins, instead of falling\nfrom the top in rows. (Try commenting out ``enabled: spawned`` and see for yourself.)\n\nAnimating block opacity changes\n-------------------------------\n\nNext, we will add a smooth exit animation. For this, we'll use a Behavior element, which allows us to specify\na default animation when a property change occurs. In this case, when the ``opacity`` of a Block changes, we will\nanimate the opacity value so that it gradually fades in and out, instead of abruptly changing between fully\nvisible and invisible. To do this, we'll apply a Behavior on the ``opacity`` property of the ``Image``\nelement in ``BoomBlock.qml``:\n\n.. pysideinclude:: samegame/samegame4/content/BoomBlock.qml\n    :snippet: 2\n\nNote the ``opacity: 0`` which means the block is transparent when it is first created. We could set the opacity\nin ``samegame.js`` when we create and destroy the blocks,\nbut instead we'll use states, since this is useful for the next animation we're going to add.\nInitially, we add these States to the root element of ``BoomBlock.qml``:\n\n::\n\n    property bool dying: false\n    states: [\n        State{ name: \"AliveState\"; when: spawned == true && dying == false\n            PropertyChanges { target: img; opacity: 1 }\n        },\n        State{ name: \"DeathState\"; when: dying == true\n            PropertyChanges { target: img; opacity: 0 }\n        }\n    ]\n\nNow blocks will automatically fade in, as we already set ``spawned`` to true when we implemented the block animations.\nTo fade out, we set ``dying`` to true instead of setting opacity to 0 when a block is destroyed (in the ``floodFill()`` function).\n\nAdding particle effects\n-----------------------\n\nFinally, we'll add a cool-looking particle effect to the blocks when they are destroyed. To do this, we first add a Particles element in\n``BoomBlock.qml``, like so:\n\n.. pysideinclude:: samegame/samegame4/content/BoomBlock.qml\n    :snippet: 3\n\nTo fully understand this you should read the Particles documentation, but it's important to note that ``emissionRate`` is set\nto zero so that particles are not emitted normally.\nAlso, we extend the ``dying`` State, which creates a burst of particles by calling the ``burst()`` method on the particles element. The code for the states now look\nlike this:\n\n.. pysideinclude:: samegame/samegame4/content/BoomBlock.qml\n    :snippet: 4\n\nNow the game is beautifully animated, with subtle (or not-so-subtle) animations added for all of the\nplayer's actions. The end result is shown below, with a different set of images to demonstrate basic theming:\n\n.. figure:: declarative-adv-tutorial4.gif\n    :align: center\n\nThe theme change here is produced simply by replacing the block images. This can be done at runtime by changing the \\l Image \\c source property, so for a further challenge, you could add a button that toggles between themes with different images.\n\nKeeping a High Scores table\n===========================\n\nAnother feature we might want to add to the game is a method of storing and retrieving high scores.\n\nTo do this, we will show a dialog when the game is over to request the player's name and add it to a High Scores table.\nThis requires a few changes to ``Dialog.qml``. In addition to a ``Text`` element, it now has a\n``TextInput`` child item for receiving keyboard text input:\n\n.. pysideinclude:: samegame/samegame4/content/Dialog.qml\n    :snippet: 2\n    :prepend: Rectangle {\n              ...\n    :append: ...\n             }\n\n\nWe'll also add a ``showWithInput()`` function. The text input will only be visible if this function\nis called instead of ``show()``. When the dialog is closed, it emits a ``closed()`` signal, and\nother elements can retrieve the text entered by the user through an ``inputText`` property:\n\n.. pysideinclude:: samegame/samegame4/content/Dialog.qml\n    :snippet: 1\n    :prepend: Rectangle {\n              ...\n    :append: ...\n             }\n\nNow the dialog can be used in ``samegame.qml``:\n\n.. pysideinclude:: samegame/samegame4/samegame.qml\n    :snippet: 0\n\nWhen the dialog emits the ``closed`` signal, we call the new ``saveHighScore()`` function in ``samegame.js``, which stores the high score locally in an SQL database and also send the score to an online database if possible.\n\nThe ``nameInputDialog`` is activated in the ``victoryCheck()`` function in ``samegame.js``:\n\n.. pysideinclude:: samegame/samegame4/content/samegame.js\n    :snippet: 4\n    :prepend: function vitoryCheck() {\n              ...\n\nStoring high scores offline\n---------------------------\n\nNow we need to implement the functionality to actually save the High Scores table.\n\nHere is the ``saveHighScore()`` function in ``samegame.js``:\n\n.. pysideinclude:: samegame/samegame4/content/samegame.js\n    :snippet: 2\n\nFirst we call ``sendHighScore()`` (explained in the section below) if it is possible to send the high scores to an online database.\n\nThen, we use the Offline Storage API to maintain a persistant SQL database unique to this application. We create an offline storage database for the high scores using ``openDatabase()`` and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrival, and in the ``db.transaction()`` call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string.\n\nThis is one way of storing and displaying high scores locally, but certainly not the only way. A more complex alternative would be to create a high score dialog component, and pass it the results for processing and display (instead of reusing the ``Dialog``). This would allow a more themeable dialog that could beter present the high scores. If your QML is the UI for a Python application, you could also have passed the score to a Python function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database.\n\nStoring high scores online\n--------------------------\n\nYou've seen how you can store high scores locally, but it is also easy to integrate a web-enabled high score storage into your QML application. The implementation we've done here is very\nsimple: the high score data is posted to a php script running on a server somewhere, and that server then stores it and\ndisplays it to visitors. You could also request an XML or QML file from that same server, which contains and displays the scores,\nbut that's beyond the scope of this tutorial. The php script we use here is available in the ``examples`` directory.\n\nIf the player entered their name we can send the data to the web service us\n\nIf the player enters a name, we send the data to the service using this code in ``samegame.js``:\n\n.. pysideinclude:: samegame/samegame4/content/samegame.js\n    :snippet: 1\n\nThe XMLHttpRequest in this code is the same as the ``XMLHttpRequest()`` as you'll find in standard browser JavaScript, and can be used in the same way to dynamically get XML\nor QML from the web service to display the high scores. We don't worry about the response in this case - we just post the high\nscore data to the web server. If it had returned a QML file (or a URL to a QML file) you could instantiate it in much the same\nway as you did with the blocks.\n\nAn alternate way to access and submit web-based data would be to use QML elements designed for this purpose. XmlListModel\nmakes it very easy to fetch and display XML based data such as RSS in a QML application (see the Flickr demo for an example).\n\n\nThat's it!\n==========\n\nBy following this tutorial you've seen how you can write a fully functional application in QML:\n\n* Build your application with QML elements.\n* Add application logic with JavaScript code.\n* Add animations with Behaviors and states.\n* Store persistent application data using, for example, the Offline Storage API or XMLHttpRequest.\n\nThere is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the\ndemos and examples and the documentation to see all the things you can do with QML!\n\n[Previous :ref:`samegame3`]"
  },
  {
    "path": "doc/tutorials/qmltutorial/helloworld/Cell.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\n\n//![1]\nItem {\n    id: container\n//![4]\n    property alias cellColor: rectangle.color\n//![4]\n//![5]\n    signal clicked(color cellColor)\n//![5]\n\n    width: 40; height: 25\n//![1]\n\n//![2]\n    Rectangle {\n        id: rectangle\n        border.color: \"white\"\n        anchors.fill: parent\n    }\n//![2]\n\n//![3]\n    MouseArea {\n        anchors.fill: parent\n        onClicked: container.clicked(container.cellColor)\n    }\n//![3]\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmltutorial/helloworld/tutorial1.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\n//![3]\nimport QtQuick 1.0\n//![3]\n\n//![1]\nRectangle {\n    id: page\n    width: 500; height: 200\n    color: \"lightgray\"\n//![1]\n\n//![2]\n    Text {\n        id: helloText\n        text: \"Hello world!\"\n        y: 30\n        anchors.horizontalCenter: page.horizontalCenter\n        font.pointSize: 24; font.bold: true\n    }\n//![2]\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmltutorial/helloworld/tutorial2.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\n\nRectangle {\n    id: page\n    width: 500; height: 200\n    color: \"lightgray\"\n\n    Text {\n        id: helloText\n        text: \"Hello world!\"\n        y: 30\n        anchors.horizontalCenter: page.horizontalCenter\n        font.pointSize: 24; font.bold: true\n    }\n\n    Grid {\n        id: colorPicker\n        x: 4; anchors.bottom: page.bottom; anchors.bottomMargin: 4\n        rows: 2; columns: 3; spacing: 3\n\n//![1]\n        Cell { cellColor: \"red\"; onClicked: helloText.color = cellColor }\n//![1]\n        Cell { cellColor: \"green\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"blue\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"yellow\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"steelblue\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"black\"; onClicked: helloText.color = cellColor }\n    }\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmltutorial/helloworld/tutorial3.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the examples of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n//![0]\nimport QtQuick 1.0\n\nRectangle {\n    id: page\n    width: 500; height: 200\n    color: \"lightgray\"\n\n    Text {\n        id: helloText\n        text: \"Hello world!\"\n        y: 30\n        anchors.horizontalCenter: page.horizontalCenter\n        font.pointSize: 24; font.bold: true\n\n//![1]\n        MouseArea { id: mouseArea; anchors.fill: parent }\n//![1]\n\n//![2]\n        states: State {\n            name: \"down\"; when: mouseArea.pressed == true\n            PropertyChanges { target: helloText; y: 160; rotation: 180; color: \"red\" }\n        }\n//![2]\n\n//![3]\n        transitions: Transition {\n            from: \"\"; to: \"down\"; reversible: true\n            ParallelAnimation {\n                NumberAnimation { properties: \"y,rotation\"; duration: 500; easing.type: Easing.InOutQuad }\n                ColorAnimation { duration: 500 }\n            }\n        }\n//![3]\n    }\n\n    Grid {\n        id: colorPicker\n        x: 4; anchors.bottom: page.bottom; anchors.bottomMargin: 4\n        rows: 2; columns: 3; spacing: 3\n\n        Cell { cellColor: \"red\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"green\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"blue\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"yellow\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"steelblue\"; onClicked: helloText.color = cellColor }\n        Cell { cellColor: \"black\"; onClicked: helloText.color = cellColor }\n    }\n}\n//![0]\n"
  },
  {
    "path": "doc/tutorials/qmltutorial/index.rst",
    "content": "\n.. _qmltutorial:\n\nQML Tutorial\n************\n\nThis tutorial gives an introduction to QML, the mark up language for Qt Quick. It doesn't cover everything;\nthe emphasis is on teaching the key principles, and features are introduced as needed.\n\nThrough the different steps of this tutorial we will learn about QML basic types, we will create our own QML component\nwith properties and signals, and we will create a simple animation with the help of states and transitions.\n\nChapter one starts with a minimal \"Hello world\" program and the following chapters introduce new concepts.\n\nThe tutorial's source code can be downloaded :download:`here<helloworld.tar.bz2>`.\n\nTutorial chapters:\n\n.. toctree::\n    :maxdepth: 1\n\n    step1.rst\n    step2.rst\n    step3.rst\n\n"
  },
  {
    "path": "doc/tutorials/qmltutorial/step1.rst",
    "content": ".. _qmlbasictypes:\n\nQML Tutorial 1 - Basic Types\n****************************\n\nThis first program is a very simple \"Hello world\" example that introduces some basic QML concepts.\nThe picture below is a screenshot of this program.\n\n.. figure:: declarative-tutorial1.png\n    :align: center\n\nHere is the QML code for the application:\n\n.. pysideinclude:: helloworld/tutorial1.qml\n    :snippet: 0\n\nWalkthrough\n===========\n\nImport\n------\n\nFirst, we need to import the types that we need for this example. Most QML files will import the built-in QML\ntypes (like Rectangle, Image, ...) that come with Qt, using:\n\n.. pysideinclude:: helloworld/tutorial1.qml\n    :snippet: 3\n\nRectangle element\n-----------------\n\n.. pysideinclude:: helloworld/tutorial1.qml\n    :snippet: 1\n\nWe declare a root element of type Rectangle. It is one of the basic building blocks you can use to create an application in QML.\nWe give it an ``id`` to be able to refer to it later. In this case, we call it \"page\".\nWe also set the ``width``, ``height`` and ``color`` properties.\nThe Rectangle element contains many other properties (such as ``x`` and ``y``), but these are left at their default values.\n\nText element\n------------\n\n.. pysideinclude code/tutorial1.qml\n    :snippet: 2\n\nWe add a Text element as a child of the root Rectangle element that displays the text 'Hello world!'.\n\nThe ``y`` property is used to position the text vertically at 30 pixels from the top of its parent.\n\nThe ``anchors.horizontalCenter`` property refers to the horizontal center of an element.\nIn this case, we specify that our text element should be horizontally centered in the *page* element.\n\nThe ``font.pointSize`` and ``font.bold properties`` are related to fonts and use the dot notation.\n\n\nViewing the example\n-------------------\n\nTo view what you have created, run the QML Viewer tool (located in the ``bin directory`` of your Qt installation) with your filename as the first argument.\nFor example, to run the provided completed Tutorial 1 example from the install location, you would type:\n\n::\n\n    bin/qmlviewer tutorial1.qml\n\n[Previous :ref:`qmltutorial`][Next :ref:`qmlcomponents`]\n"
  },
  {
    "path": "doc/tutorials/qmltutorial/step2.rst",
    "content": ".. _qmlcomponents:\n\nQML Tutorial 2 - QML Components\n*******************************\n\nThis chapter adds a color picker to change the color of the text.\n\n.. figure:: declarative-tutorial2.png\n    :align: center\n\nOur color picker is made of six cells with different colors.\nTo avoid writing the same code multiple times for each cell, we create a new ``Cell`` component.\nA component provides a way of defining a new type that we can re-use in other QML files.\nA QML component is like a black-box and interacts with the outside world through properties, signals and functions and is generally\ndefined in its own QML file.\nThe component's filename must always start with a capital letter.\n\nHere is the QML code for ``Cell.qml``:\n\n.. pysideinclude:: helloworld/Cell.qml\n    :snippet: 0\n\nWalkthrough\n===========\n\nThe Cell Component\n------------------\n\n.. pysideinclude:: helloworld/Cell.qml\n    :snippet: 1\n\nThe root element of our component is an Item with the ``id`` *container*.\nAn Item is the most basic visual element in QML and is often used as a container for other elements.\n\n.. pysideinclude:: helloworld/Cell.qml\n    :snippet: 4\n\nWe declare a ``cellColor`` property. This property is accessible from  *outside* our component, this allows us\nto instantiate the cells with different colors.\nThis property is just an alias to an existing property - the color of the rectangle that compose the cell.\n\n.. pysideinclude:: helloworld/Cell.qml\n    :snippet: 5\n\nWe want our component to also have a signal that we call *clicked* with a *cellColor* parameter of type *color*.\nWe will use this signal to change the color of the text in the main QML file later.\n\n.. pysideinclude:: helloworld/Cell.qml\n    :snippet: 2\n\nOur cell component is basically a colored rectangle with the ``id`` *rectangle*.\n\nThe ``anchors.fill`` property is a convenient way to set the size of an element.\nIn this case the rectangle will have the same size as its parent.\n\n.. pysideinclude:: helloworld/Cell.qml\n    :snippet: 3\n\nIn order to change the color of the text when clicking on a cell, we create a MouseArea element with\nthe same size as its parent.\n\nA MouseArea defines a signal called *clicked*.\nWhen this signal is triggered we want to emit our own *clicked* signal with the color as parameter.\n\nThe main QML file\n-----------------\n\nIn our main QML file, we use our ``Cell`` component to create the color picker:\n\n.. pysideinclude:: helloworld/tutorial2.qml\n    :snippet: 0\n\nWe create the color picker by putting 6 cells with different colors in a grid.\n\n.. pysideinclude:: helloworld/tutorial2.qml\n    :snippet: 1\n\nWhen the *clicked* signal of our cell is triggered, we want to set the color of the text to the *cellColor* passed as a parameter.\nWe can react to any signal of our component through a property of the name *'onSignalName'*.\n\n[Previous :ref:`qmlbasictypes`][Next :ref:`qmlstatesandtransitions`]\n"
  },
  {
    "path": "doc/tutorials/qmltutorial/step3.rst",
    "content": ".. _qmlstatesandtransitions:\n\nQML Tutorial 3 - States and Transitions\n***************************************\n\nIn this chapter, we make this example a little bit more dynamic by introducing states and transitions.\n\nWe want our text to move to the bottom of the screen, rotate and become red when clicked.\n\n.. figure:: declarative-tutorial3_animation.gif\n    :align: center\n\nHere is the QML code:\n\n.. pysideinclude:: helloworld/tutorial3.qml\n    :snippet: 0\n\nWalkthrough\n===========\n\n.. pysideinclude:: helloworld/tutorial3.qml\n    :snippet: 2\n\nFirst, we create a new *down* state for our text element.\nThis state will be activated when the MouseArea is pressed, and deactivated when it is released.\n\nThe *down* state includes a set of property changes from our implicit *default state*\n(the items as they were initially defined in the QML).\nSpecifically, we set the ``y`` property of the text to ``160``, the rotation to ``180`` and the ``color`` to red.\n\n.. pysideinclude:: helloworld/tutorial3.qml\n    :snippet: 3\n\nBecause we don't want the text to appear at the bottom instantly but rather move smoothly,\nwe add a transition between our two states.\n\n``from`` and ``to`` define the states between which the transition will run.\nIn this case, we want a transition from the default state to our *down* state.\n\nBecause we want the same transition to be run in reverse when changing back from the *down* state to the default state,\nwe set ``reversible`` to ``true``.\nThis is equivalent to writing the two transitions separately.\n\nThe ParallelAnimation element makes sure that the two types of animations (number and color) start at the same time.\nWe could also run them one after the other by using SequentialAnimation instead.\n\n[Previous :ref:`qmlcomponents`]\n"
  },
  {
    "path": "doc/typesystem_doc.xml.in",
    "content": "<?xml version=\"1.0\" ?>\n<!--\n    This file is part of PySide project.\n    Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n    Contact: PySide team <contact@pyside.org>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n-->\n<typesystem package=\"PySide\">\n    <suppress-warning text=\"File containing conversion code for *\" />\n    <suppress-warning text=\"File for inject code not exist: *\" />\n\n    <load-typesystem name=\"typesystem_core.xml\" generate=\"yes\"/>\n\n    @if_QtNetwork@\n    <load-typesystem name=\"typesystem_network.xml\" generate=\"yes\" />\n    @end_QtNetwork@\n\n    @if_QtXml@\n    <load-typesystem name=\"typesystem_xml.xml\" generate=\"yes\" />\n    @end_QtXml@\n\n    @if_QtScript@\n    <load-typesystem name=\"typesystem_script.xml\" generate=\"yes\" />\n    @end_QtScript@\n\n    @if_QtGui@\n    <load-typesystem name=\"typesystem_gui.xml\" generate=\"yes\"/>\n    @end_QtGui@\n\n    @if_QtHelp@\n    <load-typesystem name=\"typesystem_help.xml\" generate=\"yes\" />\n    @end_QtHelp@\n\n    @if_Maemo5@\n    <load-typesystem name=\"typesystem_maemo5.xml\" generate=\"yes\" />\n    @end_Maemo5@\n\n    @if_QtMultimedia@\n    <load-typesystem name=\"typesystem_multimedia.xml\" generate=\"yes\" />\n    @end_QtMultimedia@\n\n    @if_QtDeclarative@\n    <load-typesystem name=\"typesystem_declarative.xml\" generate=\"yes\"/>\n    @end_QtDeclarative@\n\n    @if_QtOpenGL@\n    <load-typesystem name=\"typesystem_opengl.xml\" generate=\"yes\" />\n    @end_QtOpenGL@\n\n    @if_QtScriptTools@\n    <load-typesystem name=\"typesystem_scripttools.xml\" generate=\"yes\" />\n    @end_QtScriptTools@\n\n    @if_QtSql@\n    <load-typesystem name=\"typesystem_sql.xml\" generate=\"yes\" />\n    @end_QtSql@\n\n    @if_QtSvg@\n    <load-typesystem name=\"typesystem_svg.xml\" generate=\"yes\" />\n    @end_QtSvg@\n\n    @if_QtTest@\n    <load-typesystem name=\"typesystem_test.xml\" generate=\"yes\" />\n    @end_QtTest@\n\n    @if_QtUiTools@\n    <load-typesystem name=\"typesystem_uitools.xml\" generate=\"yes\" />\n    @end_QtUiTools@\n\n    @if_QtWebKit@\n    <load-typesystem name=\"typesystem_webkit.xml\" generate=\"yes\" />\n    @end_QtWebKit@\n\n\n    @if_QtXmlPatterns@\n    <load-typesystem name=\"typesystem_xmlpatterns.xml\" generate=\"yes\" />\n    @end_QtXmlPatterns@\n\n    @if_phonon@\n    <load-typesystem name=\"typesystem_phonon.xml\" generate=\"yes\" />\n    @end_phonon@\n\n    <suppress-warning text=\"Can't find qdoc3 file for class QMatrix4x3, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix4x3.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class QMatrix3x4, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix3x4.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class QMatrix2x3, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix2x3.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class QMatrix4x2, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix4x2.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class QMatrix3x3, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix3x3.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class QMatrix2x2, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix2x2.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class QMatrix3x2, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix3x2.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class QMatrix2x4, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/qmatrix2x4.xml\" />\n\n    <!-- These classes are documented in ObjectDescription<T> or other base template class -->\n    <suppress-warning text=\"Can't find qdoc3 file for class AudioCaptureDevice, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/phonon-audiocapturedevice.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class VideoCaptureDevice, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/phonon-videocapturedevice.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class AudioOutputDevice, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/phonon-audiooutputdevice.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class AudioChannelDescription, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/phonon-audiochanneldescription.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class EffectDescription, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/phonon-effectdescription.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class SubtitleDescription, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/phonon-subtitledescription.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class EffectDescriptionModel, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/phonon-effectdescriptionmodel.xml\" />\n    <suppress-warning text=\"Can't find qdoc3 file for class AudioOutputDeviceModel, tried: /home/hugo/src/pyside/build/doc/qdoc3-output/phonon-audiooutputdevicemodel.xml\" />\n</typesystem>\n"
  },
  {
    "path": "libpyside/CMakeLists.txt",
    "content": "project(libpyside)\n\n\nqt4_wrap_cpp(DESTROYLISTENER_MOC \"destroylistener.h\")\n\nset(libpyside_SRC\n    dynamicqmetaobject.cpp\n    destroylistener.cpp\n    signalmanager.cpp\n    globalreceiver.cpp\n    globalreceiverv2.cpp\n    pysideclassinfo.cpp\n    pysidemetafunction.cpp\n    pysidesignal.cpp\n    pysideslot.cpp\n    pysideproperty.cpp\n    pysideqflags.cpp\n    pysideweakref.cpp\n    pyside.cpp\n    ${DESTROYLISTENER_MOC}\n)\n\ninclude_directories(${CMAKE_CURRENT_SOURCE_DIR}\n                    ${SHIBOKEN_INCLUDE_DIR}\n                    ${SHIBOKEN_PYTHON_INCLUDE_DIR}\n                    ${QT_QTCORE_INCLUDE_DIR})\nadd_library(pyside SHARED ${libpyside_SRC})\ntarget_link_libraries(pyside\n                      ${SHIBOKEN_PYTHON_LIBRARIES}\n                      ${SHIBOKEN_LIBRARY}\n                      ${QT_QTCORE_LIBRARY})\n\nset_target_properties(pyside PROPERTIES\n                      VERSION ${BINDING_API_VERSION}\n                      SOVERSION \"${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}\"\n                      OUTPUT_NAME \"pyside${pyside_SUFFIX}${SHIBOKEN_PYTHON_SUFFIX}\"\n                      DEFINE_SYMBOL PYSIDE_EXPORTS)\n\n#\n# install stuff\n#\n\nset(libpyside_HEADERS\n    destroylistener.h\n    dynamicqmetaobject.h\n    globalreceiver.h\n    pysideclassinfo.h\n    pysideconversions.h\n    pysidemacros.h\n    signalmanager.h\n    pyside.h\n    pysidemetafunction.h\n    pysidesignal.h\n    pysideproperty.h\n    pysideqflags.h\n    pysideweakref.h\n)\n\nif (CMAKE_BUILD_TYPE STREQUAL \"Debug\")\n    set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_DEBUG_POSTFIX})\nelse()\n    set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_RELEASE_POSTFIX})\nendif()\n\n# create pkg-config file\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/pyside.pc.in\"\n               \"${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc\" @ONLY)\n# create cmake-config files\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/PySideConfig.cmake.in\" \"${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake\" @ONLY)\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/PySideConfig-spec.cmake.in\" \"${CMAKE_CURRENT_BINARY_DIR}/PySideConfig${SHIBOKEN_PYTHON_SUFFIX}.cmake\" @ONLY)\nconfigure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/PySideConfigVersion.cmake.in\" \"${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake\" @ONLY)\n\ninstall(FILES ${libpyside_HEADERS}\n        DESTINATION include/${BINDING_NAME}${pyside_SUFFIX})\ninstall(TARGETS pyside EXPORT pyside\n                       LIBRARY DESTINATION \"${LIB_INSTALL_DIR}\"\n                       ARCHIVE DESTINATION \"${LIB_INSTALL_DIR}\"\n                       RUNTIME DESTINATION bin)\ninstall(FILES \"${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc\" DESTINATION \"${LIB_INSTALL_DIR}/pkgconfig\")\ninstall(FILES \"${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake\"\n        DESTINATION \"${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}\")\ninstall(FILES \"${CMAKE_CURRENT_BINARY_DIR}/PySideConfig${SHIBOKEN_PYTHON_SUFFIX}.cmake\"\n        DESTINATION \"${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}\")\ninstall(FILES \"${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake\"\n        DESTINATION \"${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}\")\n"
  },
  {
    "path": "libpyside/PySideConfig-spec.cmake.in",
    "content": "#  PYSIDE_INCLUDE_DIR   - Directories to include to use PySide\n#  PYSIDE_LIBRARY       - Files to link against to use PySide\n#  PYSIDE_PYTHONPATH    - Path to where the PySide Python module files could be found\n#  PYSIDE_TYPESYSTEMS   - Type system files that should be used by other bindings extending PySide\n\nSET(PYSIDE_INCLUDE_DIR \"@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@\")\n# Platform specific library names\nif(MSVC)\n    SET(PYSIDE_LIBRARY \"@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@@SHIBOKEN_PYTHON_SUFFIX@.lib\")\nelseif(CYGWIN)\n    SET(PYSIDE_LIBRARY \"@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@@SHIBOKEN_PYTHON_SUFFIX@@CMAKE_IMPORT_LIBRARY_SUFFIX@\")\nelseif(WIN32)\n    SET(PYSIDE_LIBRARY \"@CMAKE_INSTALL_PREFIX@/bin/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@@SHIBOKEN_PYTHON_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@\")\nelse()\n    SET(PYSIDE_LIBRARY \"@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@@SHIBOKEN_PYTHON_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@\")\nendif()\nSET(PYSIDE_PYTHONPATH \"@SITE_PACKAGE@\")\nSET(PYSIDE_TYPESYSTEMS \"@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFIX@/typesystems\")\n"
  },
  {
    "path": "libpyside/PySideConfig.cmake.in",
    "content": "if (NOT PYTHON_BASENAME)\n    message(STATUS \"Using default python: @SHIBOKEN_PYTHON_SUFFIX@\")\n    SET(PYTHON_BASENAME @SHIBOKEN_PYTHON_SUFFIX@)\nendif()\ninclude(@LIB_INSTALL_DIR@/cmake/PySide-@BINDING_API_VERSION@/PySideConfig${PYTHON_BASENAME}.cmake)\n"
  },
  {
    "path": "libpyside/PySideConfigVersion.cmake.in",
    "content": "set(PACKAGE_VERSION @BINDING_API_VERSION@)\n\nif(\"${PACKAGE_VERSION}\" VERSION_LESS \"${PACKAGE_FIND_VERSION}\" )\n   set(PACKAGE_VERSION_COMPATIBLE FALSE)\nelse(\"${PACKAGE_VERSION}\" VERSION_LESS \"${PACKAGE_FIND_VERSION}\" )\n   set(PACKAGE_VERSION_COMPATIBLE TRUE)\n   if( \"${PACKAGE_FIND_VERSION}\" STREQUAL \"${PACKAGE_VERSION}\")\n      set(PACKAGE_VERSION_EXACT TRUE)\n   endif( \"${PACKAGE_FIND_VERSION}\" STREQUAL \"${PACKAGE_VERSION}\")\nendif(\"${PACKAGE_VERSION}\" VERSION_LESS \"${PACKAGE_FIND_VERSION}\" )\n"
  },
  {
    "path": "libpyside/destroylistener.cpp",
    "content": "#include <sbkpython.h>\n#include \"destroylistener.h\"\n\n#include <QObject>\n#include <shiboken.h>\n#include <QDebug>\n#include <QMutex>\n\nPySide::DestroyListener* PySide::DestroyListener::m_instance = 0;\n\nnamespace PySide\n{\n\nstruct DestroyListenerPrivate\n{\n    static bool m_destroyed;\n};\n\n\nDestroyListener* DestroyListener::instance()\n{\n    if (!m_instance)\n        m_instance = new DestroyListener(0);\n    return m_instance;\n}\n\nvoid DestroyListener::destroy()\n{\n    if (m_instance) {\n        m_instance->disconnect();\n        delete m_instance;\n        m_instance = 0;\n    }\n}\n\nvoid DestroyListener::listen(QObject *obj)\n{\n    SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(obj);\n    if (!wrapper) // avoid problem with multiple inheritance\n        return;\n\n    if (Py_IsInitialized() == 0)\n        onObjectDestroyed(obj);\n    else\n        QObject::connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(onObjectDestroyed(QObject*)), Qt::DirectConnection);\n}\n\nvoid DestroyListener::onObjectDestroyed(QObject* obj)\n{\n    SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(obj);\n    if (wrapper) //make sure the object exists before destroy\n        Shiboken::Object::destroy(wrapper, obj);\n}\n\nDestroyListener::DestroyListener(QObject *parent)\n    : QObject(parent)\n{\n    m_d = new DestroyListenerPrivate();\n}\n\nDestroyListener::~DestroyListener()\n{\n    delete m_d;\n}\n\n}//namespace\n\n"
  },
  {
    "path": "libpyside/destroylistener.h",
    "content": "#ifndef PYSIDE_DESTROY_LISTENER\n#define PYSIDE_DESTROY_LISTENER\n\n\n#include <QObject>\n#include \"pysidemacros.h\"\n\nnamespace PySide\n{\nclass DestroyListenerPrivate;\n/// \\deprecated This class is deprecated and isn't used by libpyside anymore.\nclass PYSIDE_API DestroyListener : public QObject\n{\n    Q_OBJECT\n    public:\n        PYSIDE_DEPRECATED(static DestroyListener* instance());\n        static void destroy();\n        void listen(QObject* obj);\n\n    public slots:\n        void onObjectDestroyed(QObject* obj);\n\n    private:\n        static DestroyListener* m_instance;\n        DestroyListenerPrivate* m_d;\n        DestroyListener(QObject *parent);\n        ~DestroyListener();\n};\n\n}//namespace\n\n#endif\n\n"
  },
  {
    "path": "libpyside/dynamicqmetaobject.cpp",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include \"dynamicqmetaobject.h\"\n#include \"dynamicqmetaobject_p.h\"\n#include \"pysidesignal.h\"\n#include \"pysidesignal_p.h\"\n#include \"pysideproperty.h\"\n#include \"pysideproperty_p.h\"\n#include \"pysideslot_p.h\"\n\n#include <QByteArray>\n#include <QString>\n#include <QStringList>\n#include <QList>\n#include <QLinkedList>\n#include <QObject>\n#include <cstring>\n#include <QDebug>\n#include <QMetaMethod>\n#include <shiboken.h>\n\n#define EMPTY_META_METHOD \"0()\"\n\nusing namespace PySide;\n\nenum PropertyFlags  {\n    Invalid = 0x00000000,\n    Readable = 0x00000001,\n    Writable = 0x00000002,\n    Resettable = 0x00000004,\n    EnumOrFlag = 0x00000008,\n    StdCppSet = 0x00000100,\n//     Override = 0x00000200,\n    Constant = 0x00000400,\n    Final = 0x00000800,\n    Designable = 0x00001000,\n    ResolveDesignable = 0x00002000,\n    Scriptable = 0x00004000,\n    ResolveScriptable = 0x00008000,\n    Stored = 0x00010000,\n    ResolveStored = 0x00020000,\n    Editable = 0x00040000,\n    ResolveEditable = 0x00080000,\n    User = 0x00100000,\n    ResolveUser = 0x00200000,\n    Notify = 0x00400000\n};\n\n// these values are from moc source code, generator.cpp:66\nenum MethodFlags {\n    AccessPrivate = 0x00,\n    AccessProtected = 0x01,\n    AccessPublic = 0x02,\n    MethodMethod = 0x00,\n    MethodSignal = 0x04,\n    MethodSlot = 0x08,\n    MethodConstructor = 0x0c,\n    MethodCompatibility = 0x10,\n    MethodCloned = 0x20,\n    MethodScriptable = 0x40\n};\n\nclass DynamicQMetaObject::DynamicQMetaObjectPrivate\n{\npublic:\n    QList<MethodData> m_methods;\n    QList<PropertyData> m_properties;\n\n    // methods added/remove not writed on metadata yet\n    int m_lastMethod;\n    int m_lastProperty;\n    int m_lastInfo;\n\n    QMap<QByteArray, QByteArray> m_info;\n    QByteArray m_className;\n    bool m_updated; // when the meta data is not update\n    bool m_invalid; // when the object need to be reconstructed\n    int m_methodOffset;\n    int m_propertyOffset;\n    int m_count;\n    int m_dataSize;\n    int m_stringDataSize;\n    int m_emptyMethod;\n    int m_nullIndex;\n\n    DynamicQMetaObjectPrivate()\n        : m_lastMethod(0), m_lastProperty(0), m_lastInfo(0),\n          m_updated(false), m_invalid(true), m_methodOffset(0), m_propertyOffset(0),\n          m_count(0), m_dataSize(0), m_stringDataSize(0), m_emptyMethod(-1), m_nullIndex(0) {}\n\n    int createMetaData(QMetaObject* metaObj, QLinkedList<QByteArray> &strings);\n    void updateMetaObject(QMetaObject* metaObj);\n    void writeMethodsData(const QList<MethodData>& methods, unsigned int** data, QLinkedList<QByteArray>& strings, int* prtIndex, int nullIndex, int flags);\n};\n\nstatic int registerString(const QByteArray& s, QLinkedList<QByteArray>& strings)\n{\n    int idx = 0;\n    QLinkedList<QByteArray>::const_iterator it = strings.begin();\n    QLinkedList<QByteArray>::const_iterator itEnd = strings.end();\n    while (it != itEnd) {\n        if (strcmp(*it, s) == 0)\n            return idx;\n        idx += it->size() + 1;\n        ++it;\n    }\n    strings.append(s);\n    return idx;\n}\n\nstatic int qvariant_nameToType(const char* name)\n{\n    if (!name)\n        return 0;\n\n    if (strcmp(name, \"QVariant\") == 0)\n        return 0xffffffff;\n    if (strcmp(name, \"QCString\") == 0)\n        return QMetaType::QByteArray;\n    if (strcmp(name, \"Q_LLONG\") == 0)\n        return QMetaType::LongLong;\n    if (strcmp(name, \"Q_ULLONG\") == 0)\n        return QMetaType::ULongLong;\n    if (strcmp(name, \"QIconSet\") == 0)\n        return QMetaType::QIcon;\n\n    uint tp = QMetaType::type(name);\n    return tp < QMetaType::User ? tp : 0;\n}\n\n/*\n  Returns true if the type is a QVariant types.\n*/\nstatic bool isVariantType(const char* type)\n{\n    return qvariant_nameToType(type) != 0;\n}\n\n/*!\n  Returns true if the type is qreal.\n*/\nstatic bool isQRealType(const char *type)\n{\n    return strcmp(type, \"qreal\") == 0;\n}\n\nuint PropertyData::flags() const\n{\n    const char* typeName = type().data();\n    uint flags = Invalid;\n    if (!isVariantType(typeName))\n         flags |= EnumOrFlag;\n    else if (!isQRealType(typeName))\n        flags |= qvariant_nameToType(typeName) << 24;\n\n    if (PySide::Property::isReadable(m_data))\n        flags |= Readable;\n\n    if (PySide::Property::isWritable(m_data))\n        flags |= Writable;\n\n    if (PySide::Property::hasReset(m_data))\n        flags |= Resettable;\n\n    if (PySide::Property::isDesignable(m_data))\n        flags |= Designable;\n    else\n        flags |= ResolveDesignable;\n\n    if (PySide::Property::isScriptable(m_data))\n        flags |= Scriptable;\n    else\n        flags |= ResolveScriptable;\n\n    if (PySide::Property::isStored(m_data))\n        flags |= Stored;\n    else\n        flags |= ResolveStored;\n\n    //EDITABLE\n    flags |= ResolveEditable;\n\n    if (PySide::Property::isUser(m_data))\n        flags |= User;\n    else\n        flags |= ResolveUser;\n\n    if (m_notifyId != -1)\n        flags |= Notify;\n\n    if (PySide::Property::isConstant(m_data))\n        flags |= Constant;\n\n    if (PySide::Property::isFinal(m_data))\n        flags |= Final;\n\n    return flags;\n}\n\n// const QByteArray with EMPTY_META_METHOD, used to save some memory\nconst QByteArray MethodData::m_emptySig(EMPTY_META_METHOD);\n\nMethodData::MethodData()\n    : m_signature(m_emptySig)\n{\n}\n\nMethodData::MethodData(QMetaMethod::MethodType mtype, const char* signature, const char* type)\n    : m_signature(signature), m_mtype(mtype)\n{\n    if (qstrcmp(type, \"void\"))\n        m_type = type;\n}\n\nvoid MethodData::clear()\n{\n    m_signature = m_emptySig;\n    m_type.clear();\n}\n\nbool MethodData::isValid() const\n{\n    return m_signature != m_emptySig;\n}\n\nQMetaMethod::MethodType MethodData::methodType() const\n{\n    return m_mtype;\n}\n\nPropertyData::PropertyData()\n    : m_notifyId(0), m_data(0)\n{\n}\n\nPropertyData::PropertyData(const char* name, int notifyId, PySideProperty* data)\n    : m_name(name), m_notifyId(notifyId), m_data(data)\n{\n}\n\nQByteArray PropertyData::type() const\n{\n    return QByteArray(PySide::Property::getTypeName(m_data));\n}\n\n\nbool PropertyData::isValid() const\n{\n    return !m_name.isEmpty();\n}\n\nint PropertyData::notifyId() const\n{\n    return m_notifyId;\n}\n\nbool PropertyData::operator==(const PropertyData& other) const\n{\n    return m_data == other.m_data;\n}\n\nbool PropertyData::operator==(const char* name) const\n{\n    return m_name == QString(name);\n}\n\n\nDynamicQMetaObject::DynamicQMetaObject(PyTypeObject* type, const QMetaObject* base)\n    : m_d(new DynamicQMetaObjectPrivate)\n{\n    d.superdata = base;\n    d.stringdata = NULL;\n    d.data = NULL;\n    d.extradata = NULL;\n\n    m_d->m_className = QByteArray(type->tp_name).split('.').last();\n    m_d->m_methodOffset = base->methodCount() - 1;\n    m_d->m_propertyOffset = base->propertyCount() - 1;\n    parsePythonType(type);\n}\n\nDynamicQMetaObject::DynamicQMetaObject(const char* className, const QMetaObject* metaObject)\n    : m_d(new DynamicQMetaObjectPrivate)\n{\n    d.superdata = metaObject;\n    d.stringdata = 0;\n    d.data = 0;\n    d.extradata = 0;\n    m_d->m_className = className;\n    m_d->m_methodOffset = metaObject->methodCount() - 1;\n    m_d->m_propertyOffset = metaObject->propertyCount() - 1;\n}\n\nDynamicQMetaObject::~DynamicQMetaObject()\n{\n    free(const_cast<char*>(d.stringdata));\n    free(const_cast<uint*>(d.data));\n    delete m_d;\n}\n\nint DynamicQMetaObject::addMethod(QMetaMethod::MethodType mtype, const char* signature, const char* type)\n{\n    int index = -1;\n    int counter = 0;\n\n    QList<MethodData>::iterator it = m_d->m_methods.begin();\n    for (; it != m_d->m_methods.end(); ++it) {\n        if ((it->signature() == signature) && (it->methodType() == mtype))\n            return m_d->m_methodOffset + counter;\n        else if (!it->isValid()) {\n            index = counter;\n            m_d->m_invalid = true; // need rewrite all methods again\n        }\n        counter++;\n    }\n\n    //has blank method\n    if (index != -1) {\n        m_d->m_methods[index] = MethodData(mtype, signature, type);\n        index++;\n    } else {\n        m_d->m_methods << MethodData(mtype, signature, type);\n        index = m_d->m_methods.size();\n    }\n\n    m_d->m_updated = false;\n    return m_d->m_methodOffset + index;\n}\n\nvoid DynamicQMetaObject::removeMethod(QMetaMethod::MethodType mtype, uint index)\n{\n    const char* methodSig = method(index).signature();\n    QList<MethodData>::iterator it = m_d->m_methods.begin();\n    for (; it != m_d->m_methods.end(); ++it) {\n        if ((it->signature() == methodSig) && (it->methodType() == mtype)){\n            it->clear();\n            m_d->m_invalid = true;\n            break;\n        }\n    }\n}\n\nint DynamicQMetaObject::addSignal(const char* signal, const char* type)\n{\n    return addMethod(QMetaMethod::Signal, signal, type);\n}\n\nint DynamicQMetaObject::addSlot(const char* slot, const char* type)\n{\n    return addMethod(QMetaMethod::Slot, slot, type);\n}\n\nvoid DynamicQMetaObject::removeSlot(uint index)\n{\n    removeMethod(QMetaMethod::Slot, index);\n}\n\nvoid DynamicQMetaObject::removeSignal(uint index)\n{\n    removeMethod(QMetaMethod::Signal, index);\n}\n\nint DynamicQMetaObject::addProperty(const char* propertyName, PyObject* data)\n{\n    int index = m_d->m_properties.indexOf(propertyName);\n    if (index != -1)\n        return m_d->m_propertyOffset + index;\n\n    // retrieve notifyId\n    int notifyId = -1;\n    PySideProperty* property = reinterpret_cast<PySideProperty*>(data);\n    if (property->d->notify) {\n        const char* signalNotify = PySide::Property::getNotifyName(property);\n        if (signalNotify) {\n            MethodData signalObject(QMetaMethod::Signal, signalNotify, \"\");\n            notifyId = m_d->m_methods.indexOf(signalObject);\n        }\n    }\n\n    //search for a empty space\n    PropertyData blank;\n    index = m_d->m_properties.indexOf(blank);\n    if (index != -1) {\n        m_d->m_properties[index] = PropertyData(propertyName, notifyId, property);\n        m_d->m_invalid = true;\n    } else {\n        m_d->m_properties << PropertyData(propertyName, notifyId, property);\n        index = m_d->m_properties.size();\n    }\n    m_d->m_updated = false;\n    return  m_d->m_propertyOffset + index;\n}\n\nvoid DynamicQMetaObject::addInfo(const char* key, const char* value)\n{\n    m_d->m_info[key] = value;\n}\n\nvoid DynamicQMetaObject::addInfo(QMap<QByteArray, QByteArray> info)\n{\n    QMap<QByteArray, QByteArray>::const_iterator i = info.constBegin();\n    while (i != info.constEnd()) {\n        m_d->m_info[i.key()] = i.value();\n        ++i;\n    }\n    m_d->m_updated = false;\n}\n\nconst QMetaObject* DynamicQMetaObject::update() const\n{\n    if (!m_d->m_updated || m_d->m_invalid) {\n        m_d->updateMetaObject(const_cast<DynamicQMetaObject*>(this));\n        m_d->m_updated = true;\n    }\n    return this;\n}\n\nvoid DynamicQMetaObject::DynamicQMetaObjectPrivate::writeMethodsData(const QList<MethodData>& methods,\n                                                                     unsigned int** data,\n                                                                     QLinkedList<QByteArray>& strings,\n                                                                     int* prtIndex,\n                                                                     int nullIndex,\n                                                                     int flags)\n{\n    int index = *prtIndex;\n    //skip to last registered method\n    QList<MethodData>::const_iterator it = methods.begin() + m_lastMethod;\n\n    if (m_emptyMethod == -1)\n        m_emptyMethod = registerString(EMPTY_META_METHOD, strings) + m_stringDataSize;\n\n    for (; it != methods.end(); ++it) {\n        if (it->signature() != EMPTY_META_METHOD)\n            (*data)[index++] = registerString(it->signature(), strings) + m_stringDataSize; // func name\n        else\n            (*data)[index++] = m_emptyMethod; // func name\n\n        (*data)[index++] = nullIndex; // arguments\n        (*data)[index++] = !it->type().isEmpty() ? registerString(it->type(), strings) : nullIndex; // normalized type\n        (*data)[index++] = nullIndex; // tags\n        (*data)[index++] = flags  |  (it->methodType() == QMetaMethod::Signal ? MethodSignal : MethodSlot);\n    }\n    *prtIndex = index;\n\n    //update last registered method\n    m_lastMethod = methods.size();\n}\n\nvoid DynamicQMetaObject::parsePythonType(PyTypeObject* type)\n{\n    PyObject* attrs = type->tp_dict;\n    PyObject* key = 0;\n    PyObject* value = 0;\n    Py_ssize_t pos = 0;\n\n    Shiboken::GilState gil;\n    typedef std::pair<const char*, PyObject*> PropPair;\n    QLinkedList<PropPair> properties;\n\n    Shiboken::AutoDecRef slotAttrName(Shiboken::String::fromCString(PYSIDE_SLOT_LIST_ATTR));\n\n    while (PyDict_Next(attrs, &pos, &key, &value)) {\n        if (Property::checkType(value)) {\n            // Leave the properties to be register after signals because they may depend on notify signals\n            int index = d.superdata->indexOfProperty(Shiboken::String::toCString(key));\n            if (index == -1)\n                properties << PropPair(Shiboken::String::toCString(key), value);\n        } else if (Signal::checkType(value)) { // Register signals\n            PySideSignal* data = reinterpret_cast<PySideSignal*>(value);\n            const char* signalName = Shiboken::String::toCString(key);\n            data->signalName = strdup(signalName);\n            QByteArray sig;\n            sig.reserve(128);\n            for (int i = 0; i < data->signaturesSize; ++i) {\n                sig = signalName;\n                sig += '(';\n                if (data->signatures[i])\n                    sig += data->signatures[i];\n                sig += ')';\n                if (d.superdata->indexOfSignal(sig) == -1)\n                    addSignal(sig);\n            }\n        } else if (PyFunction_Check(value)) { // Register slots\n            if (PyObject_HasAttr(value, slotAttrName)) {\n                PyObject* signatureList = PyObject_GetAttr(value, slotAttrName);\n                for(Py_ssize_t i = 0, i_max = PyList_Size(signatureList); i < i_max; ++i) {\n                    PyObject* signature = PyList_GET_ITEM(signatureList, i);\n                    QByteArray sig(Shiboken::String::toCString(signature));\n                    //slot the slot type and signature\n                    QList<QByteArray> slotInfo = sig.split(' ');\n                    int index = d.superdata->indexOfSlot(slotInfo[1]);\n                    if (index == -1)\n                        addSlot(slotInfo[1], slotInfo[0]);\n                }\n            }\n        }\n    }\n\n    // Register properties\n    foreach (PropPair propPair, properties)\n        addProperty(propPair.first, propPair.second);\n\n}\n\nint DynamicQMetaObject::DynamicQMetaObjectPrivate::createMetaData(QMetaObject* metaObj, QLinkedList<QByteArray> &strings)\n{\n    uint n_methods = m_methods.size();\n    uint n_properties = m_properties.size();\n    uint n_info = m_info.size();\n    int header[] = {3,                      // revision\n                    0,                      // class name index in m_metadata\n                    int(n_info), 0,         // classinfo and classinfo index\n                    int(n_methods), 0,      // method count and method list index\n                    int(n_properties), 0,   // prop count and prop indexes\n                    0, 0,                   // enum count and enum index\n                    0, 0,                   // constructors\n                    0};                     // flags\n\n    const int HEADER_LENGHT = sizeof(header)/sizeof(int);\n\n    m_dataSize = HEADER_LENGHT + n_methods*5 + n_properties*4 + n_info*2 + 1;\n    uint* data = reinterpret_cast<uint*>(realloc(const_cast<uint*>(metaObj->d.data), m_dataSize * sizeof(uint)));\n    Q_ASSERT(data);\n    std::memcpy(data, header, sizeof(header));\n\n    registerString(m_className, strings); // register class string\n    m_nullIndex = registerString(\"\", strings); // register a null string\n\n    metaObj->d.data = data;\n\n    return HEADER_LENGHT;\n}\n\n\nvoid DynamicQMetaObject::DynamicQMetaObjectPrivate::updateMetaObject(QMetaObject* metaObj)\n{\n    uint *data = const_cast<uint*>(metaObj->d.data);\n    int index = m_dataSize - 1; // remove the last 0\n    QLinkedList<QByteArray> strings;\n\n    if (!data || m_invalid) {\n        if (m_invalid) {\n            strings.clear();\n            m_dataSize = m_stringDataSize = 0;\n            m_lastMethod = m_lastInfo = m_lastProperty = 0;\n            m_invalid = false;\n        }\n\n        index = createMetaData(metaObj, strings);\n        data = const_cast<uint*>(metaObj->d.data);\n    } else {\n        int n_methods = m_methods.size() - m_lastMethod;\n        int n_info = m_info.size() - m_lastInfo;\n        uint n_properties = m_properties.size() - m_lastProperty;\n\n        int extraSize = n_methods*5 + n_properties*4 + n_info*2;\n        if (extraSize > 0) {\n            m_dataSize += extraSize;\n            //realloc data\n            data = reinterpret_cast<uint*>(realloc(const_cast<uint*>(metaObj->d.data), m_dataSize * sizeof(uint)));\n            Q_ASSERT(data);\n\n\n            data[2] = m_info.size(); //update info size\n            data[4] = m_methods.size(); //update number of methods\n            data[6] = m_properties.size(); // update property size\n            metaObj->d.data = data;\n        } else {\n            data = const_cast<uint*>(metaObj->d.data);\n        }\n    }\n\n    //write class info\n    if (m_info.size()) {\n        if (data[3] == 0)\n            data[3] = index;\n\n        QMap<QByteArray, QByteArray>::const_iterator i = m_info.constBegin() + m_lastInfo; //TODO: info is a hash this can fail\n        while (i != m_info.constEnd()) {\n            int valueIndex = registerString(i.value(), strings);\n            int keyIndex = registerString(i.key(), strings);\n            data[index++] = keyIndex + m_stringDataSize;\n            data[index++] = valueIndex + m_stringDataSize;\n            i++;\n        }\n\n        m_lastInfo = m_info.size();\n    }\n\n    //write properties\n    if (m_properties.size()) {\n        if (data[7] == 0)\n            data[7] = index;\n\n        QList<PropertyData>::const_iterator i = m_properties.constBegin() + m_lastProperty;\n        while(i != m_properties.constEnd()) {\n            if (i->isValid()) {\n                data[index++] = registerString(i->name(), strings) + m_stringDataSize; // name\n            } else\n                data[index++] = m_nullIndex;\n\n            data[index++] = (i->isValid() ? (registerString(i->type(), strings) + m_stringDataSize) :  m_nullIndex); // normalized type\n            data[index++] = i->flags();\n            i++;\n        }\n\n        //write properties notify\n        i = m_properties.constBegin() + m_lastProperty;\n        while(i != m_properties.constEnd()) {\n            data[index++] = i->notifyId() >= 0 ? i->notifyId() : 0; //signal notify index\n            i++;\n        }\n\n        m_lastProperty = m_properties.size();\n    }\n\n    //write signals/slots\n    if (m_methods.size()) {\n        if (data[5] == 0)\n            data[5] = index;\n\n        writeMethodsData(m_methods, &data, strings, &index, m_nullIndex, AccessPublic);\n    }\n\n    data[index++] = 0; // the end\n\n    // create the m_metadata string\n    QByteArray str;\n    QByteArray debugStr;\n    foreach(QByteArray field, strings) {\n\n        debugStr.append(field);\n        debugStr.append('|');\n\n        str.append(field);\n        str.append(char(0));\n    }\n\n    int newSize = (m_stringDataSize + str.count()) * sizeof(char);\n    char *stringdata = reinterpret_cast<char*>(realloc(const_cast<char*>(metaObj->d.stringdata), newSize));\n    Q_ASSERT(stringdata);\n\n    metaObj->d.stringdata = stringdata;\n\n    stringdata += m_stringDataSize; //shift to the end of old position\n    std::copy(str.begin(), str.end(), stringdata);\n\n    m_stringDataSize = newSize;\n    metaObj->d.data = data;\n}\n"
  },
  {
    "path": "libpyside/dynamicqmetaobject.h",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#ifndef DYNAMICQMETAOBJECT_H\n#define DYNAMICQMETAOBJECT_H\n\n#include \"pysidemacros.h\"\n#include <sbkpython.h>\n#include <QMetaObject>\n#include <QMetaMethod>\n\nnamespace PySide\n{\n\nclass DynamicQMetaObject : public QMetaObject\n{\npublic:\n    DynamicQMetaObject(const char* className, const QMetaObject* metaObject);\n    DynamicQMetaObject(PyTypeObject* type, const QMetaObject* metaobject);\n    ~DynamicQMetaObject();\n\n\n    int addMethod(QMetaMethod::MethodType mtype, const char* signature, const char* type);\n    void removeMethod(QMetaMethod::MethodType mtype, uint index);\n    int addSignal(const char* signal, const char* type = 0);\n    int addSlot(const char* slot, const char* type = 0);\n    int addProperty(const char* property, PyObject* data);\n    void addInfo(const char* key, const char* value);\n    void addInfo(QMap<QByteArray, QByteArray> info);\n\n    void removeSignal(uint idex);\n    void removeSlot(uint index);\n    void removeProperty(uint index);\n\n    const QMetaObject* update() const;\n\nprivate:\n    class DynamicQMetaObjectPrivate;\n    DynamicQMetaObjectPrivate* m_d;\n\n    void parsePythonType(PyTypeObject* type);\n};\n\n\n}\n#endif\n"
  },
  {
    "path": "libpyside/dynamicqmetaobject_p.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef DYNAMICMETAPROPERTY_P_H\n#define DYNAMICMETAPROPERTY_P_H\n\n#include <sbkpython.h>\n#include <QByteArray>\n#include <QMetaMethod>\n\n#define GLOBAL_RECEIVER_CLASS_NAME \"__GlobalReceiver__\"\n\nstruct PySideProperty;\nnamespace PySide\n{\n    class MethodData\n    {\n    public:\n        MethodData();\n        /**\n         * \\param signature method signature\n         * \\param type method return type\n         */\n        MethodData(QMetaMethod::MethodType mtype, const char* signature, const char* type = 0);\n        void clear();\n        bool isValid() const;\n        const QByteArray& signature() const { return m_signature; }\n        const QByteArray& type() const { return m_type; }\n        QMetaMethod::MethodType methodType() const;\n        bool operator==(const MethodData& other) const;\n\n    private:\n        QByteArray m_signature;\n        QByteArray m_type;\n        QMetaMethod::MethodType m_mtype;\n        static const QByteArray m_emptySig;\n    };\n\n    class PropertyData\n    {\n    public:\n        PropertyData();\n        PropertyData(const char* name, int notifyId=0, PySideProperty* data = 0);\n        const QByteArray& name() const { return m_name; }\n        QByteArray type() const;\n        uint flags() const;\n        bool isValid() const;\n        int notifyId() const;\n        bool operator==(const PropertyData& other) const;\n        bool operator==(const char* name) const;\n\n    private:\n        QByteArray m_name;\n        int m_notifyId;\n        PySideProperty* m_data;\n    };\n\ninline bool MethodData::operator==(const MethodData& other) const\n{\n    return m_mtype == other.methodType() && m_signature == other.signature();\n}\n\n}\n\n#endif\n"
  },
  {
    "path": "libpyside/globalreceiver.cpp",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include \"globalreceiver.h\"\n#include \"dynamicqmetaobject_p.h\"\n#include \"pysideweakref.h\"\n\n#include <QMetaMethod>\n#include <QDebug>\n#include <QEvent>\n#include <QLinkedList>\n#include <autodecref.h>\n#include <sbkconverter.h>\n#include <gilstate.h>\n\n#include \"typeresolver.h\"\n#include \"signalmanager.h\"\n\n#define RECEIVER_DESTROYED_SLOT_NAME \"__receiverDestroyed__(QObject*)\"\n\nnamespace PySide\n{\nclass DynamicSlotData\n{\n    public:\n        DynamicSlotData(int id, PyObject* callback, GlobalReceiver* parent);\n        void addRef(const QObject* o);\n        void decRef(const QObject* o);\n        void clear();\n        int hasRefTo(const QObject* o) const;\n        int refCount() const;\n        int id() const;\n        PyObject* call(PyObject* args);\n        ~DynamicSlotData();\n        static void onCallbackDestroyed(void* data);\n\n    private:\n        int m_id;\n        bool m_isMethod;\n        PyObject* m_callback;\n        PyObject* m_pythonSelf;\n        PyObject* m_pyClass;\n        PyObject* m_weakRef;\n        GlobalReceiver* m_parent;\n        QLinkedList<const QObject*> m_refs;\n};\n\n}\n\nusing namespace PySide;\n\nDynamicSlotData::DynamicSlotData(int id, PyObject* callback, GlobalReceiver* parent)\n    : m_id(id), m_pythonSelf(0), m_pyClass(0), m_weakRef(0), m_parent(parent)\n{\n    Shiboken::GilState gil;\n\n    m_isMethod = PyMethod_Check(callback);\n    if (m_isMethod) {\n        //Can not store calback pointe because this will be destroyed at the end of the scope\n        //To avoid increment intance reference keep the callback information\n        m_callback = PyMethod_GET_FUNCTION(callback);\n#ifdef IS_PY3K\n        m_pyClass = 0;\n#else\n        m_pyClass = PyMethod_GET_CLASS(callback);\n#endif\n\n        m_pythonSelf = PyMethod_GET_SELF(callback);\n\n        //monitor class from method lifetime\n        m_weakRef = WeakRef::create(m_pythonSelf, DynamicSlotData::onCallbackDestroyed, this);\n    } else {\n        m_callback = callback;\n        Py_INCREF(m_callback);\n    }\n}\n\nPyObject* DynamicSlotData::call(PyObject* args)\n{\n    PyObject* callback = m_callback;\n\n    //create a callback based on method data\n    Shiboken::GilState gil;\n    if (m_isMethod)\n#ifdef IS_PY3K\n        callback = PyMethod_New(callback, m_pythonSelf);\n#else\n        callback = PyMethod_New(callback, m_pythonSelf, m_pyClass);\n#endif\n\n    PyObject* result =  PyObject_CallObject(callback, args);\n\n    if (m_isMethod)\n        Py_DECREF(callback);\n\n    return result;\n}\n\nvoid DynamicSlotData::addRef(const QObject *o)\n{\n    m_refs.append(o);\n}\n\nvoid DynamicSlotData::decRef(const QObject *o)\n{\n    m_refs.removeOne(o);\n}\n\nint DynamicSlotData::refCount() const\n{\n    return m_refs.size();\n}\n\nint DynamicSlotData::id() const\n{\n    return m_id;\n}\n\nint DynamicSlotData::hasRefTo(const QObject *o) const\n{\n    return m_refs.count(o);\n}\n\nvoid DynamicSlotData::clear()\n{\n    Shiboken::GilState gil;\n    Py_XDECREF(m_weakRef);\n    m_weakRef = 0;\n    m_refs.clear();\n}\n\nDynamicSlotData::~DynamicSlotData()\n{\n    Shiboken::GilState gil;\n    clear();\n    if (!m_isMethod)\n       Py_DECREF(m_callback);\n}\n\nvoid DynamicSlotData::onCallbackDestroyed(void *data)\n{\n    Shiboken::GilState gil;\n    DynamicSlotData* self = reinterpret_cast<DynamicSlotData*>(data);\n\n    //Disconnect all sources\n    QMetaMethod m = self->m_parent->metaObject()->method(self->m_id);\n    QByteArray methodName = QByteArray::number(m.methodType()).append(m.signature());\n    QLinkedList<const QObject*> sources = self->m_refs;\n    foreach(const QObject* src, sources)\n        const_cast<QObject*>(src)->disconnect(self->m_parent, methodName);\n    self->m_weakRef = 0;\n}\n\nGlobalReceiver::GlobalReceiver()\n    : m_metaObject(GLOBAL_RECEIVER_CLASS_NAME, &QObject::staticMetaObject)\n{\n    //slot used to be notifyed of object destrouction\n    m_metaObject.addSlot(RECEIVER_DESTROYED_SLOT_NAME);\n    m_metaObject.update();\n    setObjectName(\"GLOBAL RECEIVER\");\n}\n\nGlobalReceiver::~GlobalReceiver()\n{\n    while(!m_slotReceivers.empty()) {\n        DynamicSlotData* data = m_slotReceivers.take(m_slotReceivers.begin().key());\n        data->clear();\n        delete data;\n    }\n}\n\nvoid GlobalReceiver::connectNotify(QObject* source, int slotId)\n{\n    if (m_slotReceivers.contains(slotId)) {\n        DynamicSlotData* data = m_slotReceivers[slotId];\n        if (!data->hasRefTo(source))\n            QObject::connect(source, SIGNAL(destroyed(QObject*)), this, \"1\" RECEIVER_DESTROYED_SLOT_NAME);\n        data->addRef(source);\n    }\n}\n\nvoid GlobalReceiver::disconnectNotify(QObject* source, int slotId)\n{\n   if (m_slotReceivers.contains(slotId)) {\n        DynamicSlotData *data = m_slotReceivers[slotId];\n        data->decRef(source);\n        if (data->refCount() == 0)\n            removeSlot(slotId);\n\n        if (!hasConnectionWith(source))\n            QObject::disconnect(source, SIGNAL(destroyed(QObject*)), this, \"1\" RECEIVER_DESTROYED_SLOT_NAME);\n    }\n}\n\nconst QMetaObject* GlobalReceiver::metaObject() const\n{\n    return m_metaObject.update();\n}\n\nint GlobalReceiver::addSlot(const char* slot, PyObject* callback)\n{\n    int slotId = m_metaObject.addSlot(slot);\n    if (!m_slotReceivers.contains(slotId))\n        m_slotReceivers[slotId] = new DynamicSlotData(slotId, callback, this);\n\n    bool isShortCircuit = true;\n    for (int i = 0; slot[i]; ++i) {\n        if (slot[i] == '(') {\n            isShortCircuit = false;\n            break;\n        }\n    }\n\n    if (isShortCircuit)\n        m_shortCircuitSlots << slotId;\n\n    Q_ASSERT(slotId >= QObject::staticMetaObject.methodCount());\n    return slotId;\n}\n\nvoid GlobalReceiver::removeSlot(int slotId)\n{\n    if (m_slotReceivers.contains(slotId)) {\n        delete m_slotReceivers.take(slotId);\n        m_metaObject.removeSlot(slotId);\n        m_shortCircuitSlots.remove(slotId);\n    }\n}\n\nbool GlobalReceiver::hasConnectionWith(const QObject *object)\n{\n    QHash<int, DynamicSlotData*>::iterator i = m_slotReceivers.begin();\n    while(i != m_slotReceivers.end()) {\n        if (i.value()->hasRefTo(object)) {\n            return true;\n        }\n        i++;\n    }\n    return false;\n}\n\nint GlobalReceiver::qt_metacall(QMetaObject::Call call, int id, void** args)\n{\n    Q_ASSERT(call == QMetaObject::InvokeMetaMethod);\n    Q_ASSERT(id >= QObject::staticMetaObject.methodCount());\n    QMetaMethod slot = metaObject()->method(id);\n    Q_ASSERT(slot.methodType() == QMetaMethod::Slot);\n\n    if (strcmp(slot.signature(), RECEIVER_DESTROYED_SLOT_NAME) == 0) {\n        QObject *arg = *(QObject**)args[1];\n\n        //avoid hash changes during the destruction\n        QHash<int, DynamicSlotData*> copy = m_slotReceivers;\n        QHash<int, DynamicSlotData*>::iterator i = copy.begin();\n        while(i != copy.end()) {\n            //Remove all refs\n            int refs = i.value()->hasRefTo(arg);\n            while(refs) {\n                disconnectNotify(arg, i.key());\n                refs--;\n            }\n            i++;\n        }\n        return -1;\n    }\n\n    DynamicSlotData* data = m_slotReceivers.value(id);\n    if (!data) {\n        qWarning() << \"Unknown global slot, id:\" << id;\n        return -1;\n    }\n\n    Shiboken::GilState gil;\n    PyObject* retval = 0;\n    if (m_shortCircuitSlots.contains(id)) {\n        retval = data->call(reinterpret_cast<PyObject*>(args[1]));\n    } else {\n        QList<QByteArray> paramTypes = slot.parameterTypes();\n        Shiboken::AutoDecRef preparedArgs(PyTuple_New(paramTypes.count()));\n        for (int i = 0, max = paramTypes.count(); i < max; ++i) {\n            const QByteArray& paramType = paramTypes[i];\n            Shiboken::Conversions::SpecificConverter converter(paramType.constData());\n            PyTuple_SET_ITEM(preparedArgs.object(), i, converter.toPython(args[i+1]));\n        }\n        retval = data->call(preparedArgs);\n    }\n\n    if (!retval)\n        PyErr_Print();\n    else\n        Py_DECREF(retval);\n\n    return -1;\n}\n"
  },
  {
    "path": "libpyside/globalreceiver.h",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#ifndef GLOBALRECEIVER_H\n#define GLOBALRECEIVER_H\n\n#include <sbkpython.h>\n#include <QObject>\n#include <QHash>\n#include <QSet>\n#include \"dynamicqmetaobject.h\"\n\nnamespace PySide\n{\n\nclass DynamicSlotData;\n\nclass GlobalReceiver : public QObject\n{\npublic:\n    GlobalReceiver();\n    ~GlobalReceiver();\n    int qt_metacall(QMetaObject::Call call, int id, void** args);\n    const QMetaObject* metaObject() const;\n    int addSlot(const char* slot, PyObject* callback);\n    void removeSlot(int slotId);\n    void connectNotify(QObject* sender, int slotId);\n    void disconnectNotify(QObject* sender, int slotId);\n    bool hasConnectionWith(const QObject* object);\n\nprotected:\n  using QObject::connectNotify;\n  using QObject::disconnectNotify;\n\nprivate:\n    DynamicQMetaObject m_metaObject;\n    QSet<int> m_shortCircuitSlots;\n    QHash<int, DynamicSlotData* > m_slotReceivers;\n};\n\n}\n\n#endif\n\n"
  },
  {
    "path": "libpyside/globalreceiverv2.cpp",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include \"globalreceiverv2.h\"\n#include \"dynamicqmetaobject_p.h\"\n#include \"pysideweakref.h\"\n\n#include <QMetaMethod>\n#include <QDebug>\n#include <QEvent>\n#include <QLinkedList>\n#include <autodecref.h>\n#include <gilstate.h>\n\n#include \"typeresolver.h\"\n#include \"signalmanager.h\"\n\n#define RECEIVER_DESTROYED_SLOT_NAME \"__receiverDestroyed__(QObject*)\"\n\nnamespace\n{\n    static int DESTROY_SIGNAL_ID = 0;\n    static int DESTROY_SLOT_ID = 0;\n}\n\nnamespace PySide\n{\nclass DynamicSlotDataV2\n{\n    public:\n        DynamicSlotDataV2(PyObject* callback, GlobalReceiverV2* parent);\n        ~DynamicSlotDataV2();\n\n        int addSlot(const char* signature);\n        int id(const char* signature) const;\n        PyObject* callback();\n        QByteArray hash() const;\n        void notify();\n\n        static void onCallbackDestroyed(void* data);\n        static QByteArray hash(PyObject *callback);\n\n\n    private:\n        bool m_isMethod;\n        PyObject* m_callback;\n        PyObject* m_pythonSelf;\n        PyObject* m_pyClass;\n        PyObject* m_weakRef;\n        QMap<QByteArray, int> m_signatures;\n        GlobalReceiverV2* m_parent;\n        QByteArray m_hash;\n};\n\n}\n\nusing namespace PySide;\n\nDynamicSlotDataV2::DynamicSlotDataV2(PyObject* callback, GlobalReceiverV2* parent)\n    : m_pythonSelf(0), m_pyClass(0), m_weakRef(0), m_parent(parent)\n{\n    Shiboken::GilState gil;\n\n    m_isMethod = PyMethod_Check(callback);\n    if (m_isMethod) {\n        //Can not store calback pointe because this will be destroyed at the end of the scope\n        //To avoid increment intance reference keep the callback information\n        m_callback = PyMethod_GET_FUNCTION(callback);\n#ifndef IS_PY3K\n        m_pyClass = PyMethod_GET_CLASS(callback);\n#endif\n        m_pythonSelf = PyMethod_GET_SELF(callback);\n\n        //monitor class from method lifetime\n        m_weakRef = WeakRef::create(m_pythonSelf, DynamicSlotDataV2::onCallbackDestroyed, this);\n\n        m_hash = QByteArray::number((qlonglong)PyObject_Hash(m_callback))\n                 + QByteArray::number((qlonglong)PyObject_Hash(m_pythonSelf));\n\n    } else {\n        m_callback = callback;\n        Py_INCREF(m_callback);\n\n        m_hash = QByteArray::number((qlonglong)PyObject_Hash(m_callback));\n    }\n}\n\nQByteArray DynamicSlotDataV2::hash() const\n{\n    return m_hash;\n}\n\nQByteArray DynamicSlotDataV2::hash(PyObject* callback)\n{\n    Shiboken::GilState gil;\n    if (PyMethod_Check(callback))\n        return  QByteArray::number((qlonglong)PyObject_Hash(PyMethod_GET_FUNCTION(callback)))\n              + QByteArray::number((qlonglong)PyObject_Hash(PyMethod_GET_SELF(callback)));\n    else\n        return QByteArray::number((qlonglong)PyObject_Hash(callback));\n}\n\nPyObject* DynamicSlotDataV2::callback()\n{\n    PyObject* callback = m_callback;\n\n    //create a callback based on method data\n    if (m_isMethod)\n#ifdef IS_PY3K\n        callback = PyMethod_New(m_callback, m_pythonSelf);\n#else\n        callback = PyMethod_New(m_callback, m_pythonSelf, m_pyClass);\n#endif\n    else\n        Py_INCREF(callback);\n\n    return callback;\n}\n\nint DynamicSlotDataV2::id(const char* signature) const\n{\n    if (m_signatures.contains(signature))\n        return m_signatures[signature];\n    return -1;\n}\n\nint DynamicSlotDataV2::addSlot(const char* signature)\n{\n    int index = id(signature);\n    if (index == -1) {\n        DynamicQMetaObject *dmo = const_cast<DynamicQMetaObject*>(reinterpret_cast<const DynamicQMetaObject*>(m_parent->metaObject()));\n        index = m_signatures[signature] = dmo->addSlot(signature);\n    }\n    return index;\n}\n\nvoid DynamicSlotDataV2::onCallbackDestroyed(void *data)\n{\n    DynamicSlotDataV2* self = reinterpret_cast<DynamicSlotDataV2*>(data);\n    self->m_weakRef = 0;\n    delete self->m_parent;\n}\n\nDynamicSlotDataV2::~DynamicSlotDataV2()\n{\n    Shiboken::GilState gil;\n\n    Py_XDECREF(m_weakRef);\n    m_weakRef = 0;\n\n    if (!m_isMethod)\n       Py_DECREF(m_callback);\n}\n\nGlobalReceiverV2::GlobalReceiverV2(PyObject *callback, SharedMap map)\n    : QObject(0), m_metaObject(GLOBAL_RECEIVER_CLASS_NAME, &QObject::staticMetaObject), m_sharedMap(map)\n{\n    m_data = new DynamicSlotDataV2(callback, this);\n    m_metaObject.addSlot(RECEIVER_DESTROYED_SLOT_NAME);\n    m_metaObject.update();\n    m_refs.append(NULL);\n\n\n    if (DESTROY_SIGNAL_ID == 0)\n        DESTROY_SIGNAL_ID = QObject::staticMetaObject.indexOfSignal(\"destroyed(QObject*)\");\n\n    if (DESTROY_SLOT_ID == 0)\n        DESTROY_SLOT_ID = m_metaObject.indexOfSlot(RECEIVER_DESTROYED_SLOT_NAME);\n\n\n}\n\nGlobalReceiverV2::~GlobalReceiverV2()\n{\n    m_refs.clear();\n    //Remove itself from map\n    m_sharedMap->remove(m_data->hash());\n    delete m_data;\n}\n\nint GlobalReceiverV2::addSlot(const char* signature)\n{\n    return m_data->addSlot(signature);\n}\n\nvoid GlobalReceiverV2::incRef(const QObject* link)\n{\n    if (link) {\n        if (!m_refs.contains(link)) {\n            if (QMetaObject::connect(link, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID))\n                m_refs.append(link);\n            else\n                Q_ASSERT(false);\n        } else {\n            m_refs.append(link);\n        }\n    } else {\n        m_refs.append(NULL);\n    }\n}\n\nvoid GlobalReceiverV2::decRef(const QObject* link)\n{\n    if (m_refs.size() <= 0)\n        return;\n\n\n    m_refs.removeOne(link);\n    if (link) {\n        if (!m_refs.contains(link)) {\n            bool result = QMetaObject::disconnect(link, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID);\n            Q_ASSERT(result);\n            if (!result)\n                return;\n        }\n    }\n\n    if (m_refs.size() == 0)\n        delete this;\n\n}\n\nint GlobalReceiverV2::refCount(const QObject* link) const\n{\n    if (link)\n        return m_refs.count(link);\n\n    return m_refs.size();\n}\n\nvoid GlobalReceiverV2::notify()\n{\n    QSet<const QObject*> objs = QSet<const QObject*>::fromList(m_refs);\n    foreach(const QObject* o, objs) {\n        QMetaObject::disconnect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID);\n        QMetaObject::connect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID);\n    }\n}\n\nQByteArray GlobalReceiverV2::hash() const\n{\n    return m_data->hash();\n}\n\nQByteArray GlobalReceiverV2::hash(PyObject* callback)\n{\n    return DynamicSlotDataV2::hash(callback);\n}\n\nconst QMetaObject* GlobalReceiverV2::metaObject() const\n{\n    return m_metaObject.update();\n}\n\nint GlobalReceiverV2::qt_metacall(QMetaObject::Call call, int id, void** args)\n{\n    Shiboken::GilState gil;\n    Q_ASSERT(call == QMetaObject::InvokeMetaMethod);\n    Q_ASSERT(id >= QObject::staticMetaObject.methodCount());\n\n    QMetaMethod slot = metaObject()->method(id);\n    Q_ASSERT(slot.methodType() == QMetaMethod::Slot);\n\n    if (id == DESTROY_SLOT_ID) {\n        if (m_refs.size() == 0)\n            return -1;\n        QObject *obj = *(QObject**)args[1];\n        incRef(); //keep the object live (safe ref)\n        m_refs.removeAll(obj); // remove all refs to this object\n        decRef(); //remove the safe ref\n    } else {\n        bool isShortCuit = (strstr(slot.signature(), \"(\") == 0);\n        Shiboken::AutoDecRef callback(m_data->callback());\n        SignalManager::callPythonMetaMethod(slot, args, callback, isShortCuit);\n    }\n\n    return -1;\n}\n"
  },
  {
    "path": "libpyside/globalreceiverv2.h",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#ifndef GLOBALRECEIVER_V2_H\n#define GLOBALRECEIVER_V2_H\n\n#include <sbkpython.h>\n#include <QObject>\n#include <QHash>\n#include <QSet>\n#include <QSharedPointer>\n#include <QLinkedList>\n#include <QByteArray>\n\n#include \"dynamicqmetaobject.h\"\n\nnamespace PySide\n{\n\nclass DynamicSlotDataV2;\nclass GlobalReceiverV2;\n\ntypedef QSharedPointer< QMap<QByteArray, GlobalReceiverV2*> >  SharedMap;\n\n/**\n * A class used to make the link between the C++ Signal/Slot and Python callback\n * This class is used internally by SignalManager\n **/\n\nclass GlobalReceiverV2 : public QObject\n{\npublic:\n    /**\n     * Create a GlobalReceiver object that will call 'callback' argumentent\n     *\n     * @param   callback    A Python callable object (can be a method or not)\n     * @param   ma          A SharedPointer used on Signal manager that contains all instaces of GlobalReceiver\n     **/\n    GlobalReceiverV2(PyObject *callback, SharedMap map);\n\n    /**\n     * Destructor\n     **/\n    ~GlobalReceiverV2();\n\n    /**\n     * Reimplemented function from QObject\n     **/\n    int qt_metacall(QMetaObject::Call call, int id, void** args);\n    const QMetaObject* metaObject() const;\n\n    /**\n     * Add a extra slot to this object\n     *\n     * @param   signature   The signature of the slot to be added\n     * @return  The index of this slot on metaobject\n     **/\n    int addSlot(const char* signature);\n\n    /**\n     * Notify to GlobalReceiver about when a new connection was made\n     **/\n    void notify();\n\n    /**\n     * Used to increment the reference of the GlobalReceiver object\n     *\n     * @param   link    This is a optional paramenter used to link the ref to some QObject life\n     **/\n    void incRef(const QObject* link = 0);\n\n    /**\n     * Used to decrement the reference of the GlobalReceiver object\n     *\n     * @param   link    This is a optional paramenter used to dismiss the link ref to some QObject\n     **/\n    void decRef(const QObject* link = 0);\n\n    /*\n     * Return the count of refs which the GlobalReceiver has\n     *\n     * @param   link    If any QObject was passed, the function return the number of references relative to this 'link' object\n     * @return  The number of references\n     **/\n    int refCount(const QObject* link) const;\n\n    /**\n     * Use to retrive the unique hash of this GlobalReceiver object\n     *\n     * @return  a string with a unique id based on GlobalReceiver contents\n     **/\n    QByteArray hash() const;\n\n    /**\n     * Use to retrive the unique hash of the PyObject based on GlobalReceiver rules\n     *\n     * @param   callback The Python callable object used to calculate the id\n     * @return  a string with a unique id based on GlobalReceiver contents\n     **/\n    static QByteArray hash(PyObject* callback);\n\nprivate:\n    DynamicQMetaObject m_metaObject;\n    DynamicSlotDataV2 *m_data;\n    QList<const QObject*> m_refs;\n    int m_ref;\n    SharedMap m_sharedMap;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "libpyside/pyside.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"pyside.h\"\n#include \"signalmanager.h\"\n#include \"pysideclassinfo_p.h\"\n#include \"pysideproperty_p.h\"\n#include \"pysideproperty.h\"\n#include \"pysidesignal.h\"\n#include \"pysidesignal_p.h\"\n#include \"pysideslot_p.h\"\n#include \"pysidemetafunction_p.h\"\n#include \"pysidemetafunction.h\"\n#include \"dynamicqmetaobject.h\"\n#include \"destroylistener.h\"\n\n#include <basewrapper.h>\n#include <conversions.h>\n#include <sbkconverter.h>\n#include <gilstate.h>\n#include <typeresolver.h>\n#include <bindingmanager.h>\n#include <algorithm>\n#include <cstring>\n#include <cctype>\n#include <QStack>\n#include <QCoreApplication>\n#include <QDebug>\n#include <QSharedPointer>\n\nstatic QStack<PySide::CleanupFunction> cleanupFunctionList;\nstatic void* qobjectNextAddr;\n\nnamespace PySide\n{\n\nvoid init(PyObject *module)\n{\n    qobjectNextAddr = 0;\n    ClassInfo::init(module);\n    Signal::init(module);\n    Slot::init(module);\n    Property::init(module);\n    MetaFunction::init(module);\n    // Init signal manager, so it will register some meta types used by QVariant.\n    SignalManager::instance();\n}\n\nbool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds, const char** blackList, unsigned int blackListSize)\n{\n\n    PyObject *key, *value;\n    Py_ssize_t pos = 0;\n\n    while (PyDict_Next(kwds, &pos, &key, &value)) {\n        if (!blackListSize || !std::binary_search(blackList, blackList + blackListSize, std::string(Shiboken::String::toCString(key)))) {\n            QByteArray propName(Shiboken::String::toCString(key));\n            if (metaObj->indexOfProperty(propName) != -1) {\n                propName[0] = std::toupper(propName[0]);\n                propName.prepend(\"set\");\n\n                Shiboken::AutoDecRef propSetter(PyObject_GetAttrString(qObj, propName.constData()));\n                if (!propSetter.isNull()) {\n                    Shiboken::AutoDecRef args(PyTuple_Pack(1, value));\n                    Shiboken::AutoDecRef retval(PyObject_CallObject(propSetter, args));\n                } else {\n                    PyObject* attr = PyObject_GenericGetAttr(qObj, key);\n                    if (PySide::Property::checkType(attr))\n                        PySide::Property::setValue(reinterpret_cast<PySideProperty*>(attr), qObj, value);\n                }\n            } else {\n                propName.append(\"()\");\n                if (metaObj->indexOfSignal(propName) != -1) {\n                    propName.prepend('2');\n                    PySide::Signal::connect(qObj, propName, value);\n                } else {\n                    PyErr_Format(PyExc_AttributeError, \"'%s' is not a Qt property or a signal\", propName.constData());\n                    return false;\n                };\n            }\n        }\n    }\n    return true;\n}\n\nvoid registerCleanupFunction(CleanupFunction func)\n{\n    cleanupFunctionList.push(func);\n}\n\nvoid runCleanupFunctions()\n{\n    //PySide::DestroyListener::instance()->destroy();\n    while (!cleanupFunctionList.isEmpty()) {\n        CleanupFunction f = cleanupFunctionList.pop();\n        f();\n    }\n    PySide::DestroyListener::destroy();\n}\n\nstatic void destructionVisitor(SbkObject* pyObj, void* data)\n{\n    void** realData = reinterpret_cast<void**>(data);\n    SbkObject* pyQApp = reinterpret_cast<SbkObject*>(realData[0]);\n    PyTypeObject* pyQObjectType = reinterpret_cast<PyTypeObject*>(realData[1]);\n\n    if (pyObj != pyQApp && PyObject_TypeCheck(pyObj, pyQObjectType)) {\n        if (Shiboken::Object::hasOwnership(pyObj) && Shiboken::Object::isValid(pyObj, false)) {\n            Shiboken::Object::setValidCpp(pyObj, false);\n\n            Py_BEGIN_ALLOW_THREADS\n            Shiboken::callCppDestructor<QObject>(Shiboken::Object::cppPointer(pyObj, pyQObjectType));\n            Py_END_ALLOW_THREADS\n        }\n    }\n\n};\n\nvoid destroyQCoreApplication()\n{\n    SignalManager::instance().clear();\n    QCoreApplication* app = QCoreApplication::instance();\n    if (!app)\n        return;\n\n    Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();\n    SbkObject* pyQApp = bm.retrieveWrapper(app);\n    PyTypeObject* pyQObjectType = Shiboken::Conversions::getPythonTypeObject(\"QObject*\");\n    assert(pyQObjectType);\n\n    void* data[2] = {pyQApp, pyQObjectType};\n    bm.visitAllPyObjects(&destructionVisitor, &data);\n\n    // in the end destroy app\n    // Allow threads because the destructor calls\n    // QThreadPool::globalInstance().waitForDone() which may deadlock on the GIL\n    // if there is a worker working with python objects.\n    Py_BEGIN_ALLOW_THREADS\n    delete app;\n    Py_END_ALLOW_THREADS\n}\n\nstruct TypeUserData {\n    TypeUserData(PyTypeObject* type, const QMetaObject* metaobject) : mo(type, metaobject) {}\n    DynamicQMetaObject mo;\n    std::size_t cppObjSize;\n};\n\nstd::size_t getSizeOfQObject(SbkObjectType* type)\n{\n    using namespace Shiboken::ObjectType;\n    TypeUserData* userData = reinterpret_cast<TypeUserData*>(getTypeUserData(reinterpret_cast<SbkObjectType*>(type)));\n    return userData->cppObjSize;\n}\n\nvoid initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base, const std::size_t& cppObjSize)\n{\n    //create DynamicMetaObject based on python type\n    TypeUserData* userData = new TypeUserData(reinterpret_cast<PyTypeObject*>(type), base);\n    userData->cppObjSize = cppObjSize;\n    userData->mo.update();\n    Shiboken::ObjectType::setTypeUserData(type, userData, Shiboken::callCppDestructor<TypeUserData>);\n\n    //initialize staticQMetaObject property\n    void* metaObjectPtr = &userData->mo;\n    static SbkConverter* converter = Shiboken::Conversions::getConverter(\"QMetaObject\");\n    if (!converter)\n        return;\n    Shiboken::AutoDecRef pyMetaObject(Shiboken::Conversions::pointerToPython(converter, metaObjectPtr));\n    PyObject_SetAttrString(reinterpret_cast<PyObject*>(type), \"staticMetaObject\", pyMetaObject);\n}\n\nvoid initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base)\n{\n    initDynamicMetaObject(type, base, 0);\n}\n\nvoid initQObjectSubType(SbkObjectType* type, PyObject* args, PyObject* kwds)\n{\n    PyTypeObject* qObjType = Shiboken::Conversions::getPythonTypeObject(\"QObject*\");\n    QByteArray className(Shiboken::String::toCString(PyTuple_GET_ITEM(args, 0)));\n\n    PyObject* bases = PyTuple_GET_ITEM(args, 1);\n    int numBases = PyTuple_GET_SIZE(bases);\n    QMetaObject* baseMo = 0;\n    SbkObjectType* qobjBase = 0;\n\n    for (int i = 0; i < numBases; ++i) {\n        PyTypeObject* base = reinterpret_cast<PyTypeObject*>(PyTuple_GET_ITEM(bases, i));\n        if (PyType_IsSubtype(base, qObjType)) {\n            baseMo = reinterpret_cast<QMetaObject*>(Shiboken::ObjectType::getTypeUserData(reinterpret_cast<SbkObjectType*>(base)));\n            qobjBase = reinterpret_cast<SbkObjectType*>(base);\n            reinterpret_cast<DynamicQMetaObject*>(baseMo)->update();\n            break;\n        }\n    }\n    if (!baseMo) {\n        qWarning(\"Sub class of QObject not inheriting QObject!? Crash will happen when using %s.\", className.constData());\n        return;\n    }\n\n    TypeUserData* userData = reinterpret_cast<TypeUserData*>(Shiboken::ObjectType::getTypeUserData(qobjBase));\n    initDynamicMetaObject(type, baseMo, userData->cppObjSize);\n}\n\nPyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* name)\n{\n    PyObject* attr = PyObject_GenericGetAttr(self, name);\n    if (!Shiboken::Object::isValid(reinterpret_cast<SbkObject*>(self), false))\n        return attr;\n\n    if (attr && Property::checkType(attr)) {\n        PyObject *value = Property::getValue(reinterpret_cast<PySideProperty*>(attr), self);\n        Py_DECREF(attr);\n        if (!value)\n            return 0;\n        Py_INCREF(value);\n        attr = value;\n    }\n\n    //mutate native signals to signal instance type\n    if (attr && PyObject_TypeCheck(attr, &PySideSignalType)) {\n        PyObject* signal = reinterpret_cast<PyObject*>(Signal::initialize(reinterpret_cast<PySideSignal*>(attr), name, self));\n        PyObject_SetAttr(self, name, reinterpret_cast<PyObject*>(signal));\n        return signal;\n    }\n\n    //search on metaobject (avoid internal attributes started with '__')\n    if (!attr) {\n        const char* cname = Shiboken::String::toCString(name);\n        uint cnameLen = qstrlen(cname);\n        if (std::strncmp(\"__\", cname, 2)) {\n            const QMetaObject* metaObject = cppSelf->metaObject();\n            //signal\n            QList<QMetaMethod> signalList;\n            for(int i=0, i_max = metaObject->methodCount(); i < i_max; i++) {\n                QMetaMethod method = metaObject->method(i);\n                const char* methSig = method.signature();\n                bool methMacth = !std::strncmp(cname, methSig, cnameLen) && methSig[cnameLen] == '(';\n                if (methMacth) {\n                    if (method.methodType() == QMetaMethod::Signal) {\n                        signalList.append(method);\n                    } else {\n                        PySideMetaFunction* func = MetaFunction::newObject(cppSelf, i);\n                        if (func) {\n                            PyObject_SetAttr(self, name, (PyObject*)func);\n                            return (PyObject*)func;\n                        }\n                    }\n                }\n            }\n            if (signalList.size() > 0) {\n                PyObject* pySignal = reinterpret_cast<PyObject*>(Signal::newObjectFromMethod(self, signalList));\n                PyObject_SetAttr(self, name, pySignal);\n                return pySignal;\n            }\n        }\n    }\n    return attr;\n}\n\nbool inherits(PyTypeObject* objType, const char* class_name)\n{\n    if (strcmp(objType->tp_name, class_name) == 0)\n        return true;\n\n    PyTypeObject* base = (objType)->tp_base;\n    if (base == 0)\n        return false;\n\n    return inherits(base, class_name);\n}\n\nvoid* nextQObjectMemoryAddr()\n{\n    return qobjectNextAddr;\n}\n\nvoid setNextQObjectMemoryAddr(void* addr)\n{\n    qobjectNextAddr = addr;\n}\n\n} // namespace PySide\n\n// A QSharedPointer is used with a deletion function to invalidate a pointer\n// when the property value is cleared.  This should be a QSharedPointer with\n// a void* pointer, but that isn't allowed\ntypedef char any_t;\nQ_DECLARE_METATYPE(QSharedPointer<any_t>);\n\nnamespace PySide\n{\n\nstatic void invalidatePtr(any_t* object)\n{\n    Shiboken::GilState state;\n\n    SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(object);\n    if (wrapper != NULL)\n        Shiboken::BindingManager::instance().releaseWrapper(wrapper);\n}\n\nstatic const char invalidatePropertyName[] = \"_PySideInvalidatePtr\";\n\nPyObject* getWrapperForQObject(QObject* cppSelf, SbkObjectType* sbk_type)\n{\n    PyObject* pyOut = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(cppSelf);\n    if (pyOut) {\n        Py_INCREF(pyOut);\n        return pyOut;\n    }\n\n    // Setting the property will trigger an QEvent notification, which may call into\n    // code that creates the wrapper so only set the property if it isn't already\n    // set and check if it's created after the set call\n    QVariant existing = cppSelf->property(invalidatePropertyName);\n    if (!existing.isValid()) {\n        QSharedPointer<any_t> shared_with_del((any_t*)cppSelf, invalidatePtr);\n        cppSelf->setProperty(invalidatePropertyName, QVariant::fromValue(shared_with_del));\n        pyOut = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(cppSelf);\n        if (pyOut) {\n            Py_INCREF(pyOut);\n            return pyOut;\n        }\n    }\n\n    const char* typeName = typeid(*cppSelf).name();\n    pyOut = Shiboken::Object::newObject(sbk_type, cppSelf, false, false, typeName);\n\n    return pyOut;\n}\n\n} //namespace PySide\n\n"
  },
  {
    "path": "libpyside/pyside.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_H\n#define PYSIDE_H\n\n#include <sbkpython.h>\n#include <pysidemacros.h>\n#include <QMetaType>\n#include <QHash>\n#include <QList>\n\nclass SbkObjectType;\n\nnamespace PySide\n{\n\nPYSIDE_API void init(PyObject *module);\n\n/**\n * Hash function used to enable hash on objects not supported on native Qt library which has toString function.\n */\ntemplate<class T>\ninline uint hash(const T& value)\n{\n    return qHash(value.toString());\n}\n\n/**\n * Fill QObject properties and do signal connections using the values found in \\p kwds dictonary.\n * \\param qObj PyObject fot the QObject.\n * \\param metaObj QMetaObject of \\p qObj.\n * \\param blackList keys to be ignored in kwds dictionary, this string list MUST be sorted.\n * \\param blackListSize numbe rof elements in blackList.\n * \\param kwds key->value dictonary.\n * \\return True if everything goes well, false with a Python error setted otherwise.\n */\nPYSIDE_API bool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds, const char** blackList, unsigned int blackListSize);\n\n/**\n*   If the type \\p T was registered on Qt meta type system with Q_DECLARE_METATYPE macro, this class will initialize\n*   the meta type.\n*\n*   Initialize a meta type means register it on Qt meta type system, Qt itself only do this on the first call of\n*   qMetaTypeId, and this is exactly what we do to init it. If we don't do that, calls to QMetaType::type(\"QMatrix2x2\")\n*   could return zero, causing QVariant to not recognize some C++ types, like QMatrix2x2.\n*/\ntemplate<typename T, bool OK = QMetaTypeId<T>::Defined >\nstruct initQtMetaType {\n    initQtMetaType()\n    {\n        qMetaTypeId<T>();\n    }\n};\n\n// Template specialization to do nothing when the type wasn't registered on Qt meta type system.\ntemplate<typename T>\nstruct initQtMetaType<T, false> {\n};\n\nPYSIDE_DEPRECATED(PYSIDE_API void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base));\nPYSIDE_API void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base, const std::size_t& cppObjSize);\nPYSIDE_API void initQObjectSubType(SbkObjectType* type, PyObject* args, PyObject* kwds);\n\n/// Return the size in bytes of a type that inherits QObject.\nPYSIDE_API std::size_t getSizeOfQObject(SbkObjectType* type);\n\ntypedef void (*CleanupFunction)(void);\n\n/**\n * Register a function to be called before python die\n */\nPYSIDE_API void registerCleanupFunction(CleanupFunction func);\nPYSIDE_API void runCleanupFunctions();\n\n/**\n * Destroy a QCoreApplication taking care of destroy all instances of QObject first.\n */\nPYSIDE_API void destroyQCoreApplication();\n\n/**\n * Check for properties and signals registered on MetaObject and return these\n * \\param cppSelf Is the QObject which contains the metaobject\n * \\param self Python object of cppSelf\n * \\param name Name of the argument which the function will try retrieve from MetaData\n * \\return The Python object which contains the Data obtained in metaObject or the Python attribute related with name\n */\nPYSIDE_API PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* name);\n\n/**\n * Check if self inherits from class_name\n * \\param self Python object\n * \\param class_name strict with the class name\n * \\return Returns true if self object inherits from class_name, otherwise returns false\n */\nPYSIDE_API bool inherits(PyTypeObject* self, const char* class_name);\n\nPYSIDE_API void* nextQObjectMemoryAddr();\nPYSIDE_API void setNextQObjectMemoryAddr(void* addr);\n\nPYSIDE_API PyObject* getWrapperForQObject(QObject* cppSelf, SbkObjectType* sbk_type);\n\n} //namespace PySide\n\n\n#endif // PYSIDE_H\n\n"
  },
  {
    "path": "libpyside/pyside.pc.in",
    "content": "prefix=@CMAKE_INSTALL_PREFIX@\nexec_prefix=@CMAKE_INSTALL_PREFIX@\nlibdir=@LIB_INSTALL_DIR@\nincludedir=@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@\ntypesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFIX@/typesystems\npythonpath=@SITE_PACKAGE@\n\nName: PySide@pyside_SUFFIX@\nDescription: Support library for Python bindings of Qt-based libraries.\nVersion: @BINDING_API_VERSION_FULL@\nLibs: -L${libdir} -lpyside@pyside_SUFFIX@@SHIBOKEN_PYTHON_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@\nCflags: -I${includedir}\nRequires: shiboken\n\n"
  },
  {
    "path": "libpyside/pysideclassinfo.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include <sbkpython.h>\n#include \"pysideclassinfo.h\"\n#include \"pysideclassinfo_p.h\"\n#include \"dynamicqmetaobject.h\"\n\n#include <shiboken.h>\n#include <QDebug>\n\n#define CLASSINFO_CLASS_NAME    \"ClassInfo\"\n\nextern \"C\"\n{\n\nstatic PyObject* classInfoTpNew(PyTypeObject* subtype, PyObject* args, PyObject* kwds);\nstatic int classInfoTpInit(PyObject*, PyObject*, PyObject*);\nstatic void classInfoFree(void*);\nstatic PyObject* classCall(PyObject*, PyObject*, PyObject*);\n\nPyTypeObject PySideClassInfoType = {\n    PyVarObject_HEAD_INIT(0, 0)\n    CLASSINFO_CLASS_NAME,      /*tp_name*/\n    sizeof(PySideClassInfo),   /*tp_basicsize*/\n    0,                         /*tp_itemsize*/\n    0,                         /*tp_dealloc*/\n    0,                         /*tp_print*/\n    0,                         /*tp_getattr*/\n    0,                         /*tp_setattr*/\n    0,                         /*tp_compare*/\n    0,                         /*tp_repr*/\n    0,                         /*tp_as_number*/\n    0,                         /*tp_as_sequence*/\n    0,                         /*tp_as_mapping*/\n    0,                         /*tp_hash */\n    classCall,                 /*tp_call*/\n    0,                         /*tp_str*/\n    0,                         /*tp_getattro*/\n    0,                         /*tp_setattro*/\n    0,                         /*tp_as_buffer*/\n    Py_TPFLAGS_DEFAULT,        /*tp_flags*/\n    0,                         /*tp_doc */\n    0,                         /*tp_traverse */\n    0,                         /*tp_clear */\n    0,                         /*tp_richcompare */\n    0,                         /*tp_weaklistoffset */\n    0,                         /*tp_iter */\n    0,                         /*tp_iternext */\n    0,                         /*tp_methods */\n    0,                         /*tp_members */\n    0,                         /*tp_getset */\n    0,                         /*tp_base */\n    0,                         /*tp_dict */\n    0,                         /*tp_descr_get */\n    0,                         /*tp_descr_set */\n    0,                         /*tp_dictoffset */\n    classInfoTpInit,           /*tp_init */\n    0,                         /*tp_alloc */\n    classInfoTpNew,            /*tp_new */\n    classInfoFree,             /*tp_free */\n    0,                         /*tp_is_gc */\n    0,                         /*tp_bases */\n    0,                         /*tp_mro */\n    0,                         /*tp_cache */\n    0,                         /*tp_subclasses */\n    0,                         /*tp_weaklist */\n    0,                         /*tp_del */\n};\n\nPyObject* classCall(PyObject* self, PyObject* args, PyObject* kw)\n{\n    PyObject* klass;\n    klass = PyTuple_GetItem(args, 0);\n\n    if (Shiboken::ObjectType::checkType(reinterpret_cast<PyTypeObject*>(klass))) {\n        PySide::DynamicQMetaObject* mo = reinterpret_cast<PySide::DynamicQMetaObject*>(Shiboken::ObjectType::getTypeUserData(reinterpret_cast<SbkObjectType*>(klass)));\n        if (mo)\n            mo->addInfo(PySide::ClassInfo::getMap(reinterpret_cast<PySideClassInfo*>(self)));\n    }\n\n    Py_INCREF(klass);\n    return klass;\n}\n\nstatic PyObject* classInfoTpNew(PyTypeObject* subtype, PyObject* args, PyObject* kwds)\n{\n    PySideClassInfo* me = reinterpret_cast<PySideClassInfo*>(subtype->tp_alloc(subtype, 0));\n    me->d = new PySideClassInfoPrivate;\n    return (PyObject*) me;\n}\n\nint classInfoTpInit(PyObject* self, PyObject* args, PyObject* kwds)\n{\n    PySideClassInfo* data = reinterpret_cast<PySideClassInfo*>(self);\n    PySideClassInfoPrivate* pData = data->d;\n\n    PyObject* key;\n    PyObject* value;\n    Py_ssize_t pos = 0;\n    while (PyDict_Next(kwds, &pos, &key, &value)) {\n        if (Shiboken::String::check(key) && Shiboken::String::check(value))\n            pData->m_data[Shiboken::String::toCString(key)] = Shiboken::String::toCString(value);\n    }\n\n    return PyErr_Occurred() ? -1 : 1;\n}\n\nvoid classInfoFree(void *self)\n{\n    PyObject* pySelf = reinterpret_cast<PyObject*>(self);\n    PySideClassInfo* data = reinterpret_cast<PySideClassInfo*>(self);\n\n    delete data->d;\n    pySelf->ob_type->tp_base->tp_free(self);\n}\n\n\n} // extern \"C\"\n\n\nnamespace PySide { namespace ClassInfo {\n\nvoid init(PyObject* module)\n{\n    if (PyType_Ready(&PySideClassInfoType) < 0)\n        return;\n\n    Py_INCREF(&PySideClassInfoType);\n    PyModule_AddObject(module, CLASSINFO_CLASS_NAME, ((PyObject*)&PySideClassInfoType));\n}\n\nbool checkType(PyObject* pyObj)\n{\n    if (pyObj)\n        return PyType_IsSubtype(pyObj->ob_type, &PySideClassInfoType);\n    return false;\n}\n\nQMap<QByteArray, QByteArray> getMap(PySideClassInfo* obj)\n{\n    return obj->d->m_data;\n}\n\n} //namespace Property\n} //namespace PySide\n"
  },
  {
    "path": "libpyside/pysideclassinfo.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_CLASSINFO_H\n#define PYSIDE_CLASSINFO_H\n\n#include <pysidemacros.h>\n#include <sbkpython.h>\n#include <QMap>\n#include <QByteArray>\n\nextern \"C\"\n{\n    extern PYSIDE_API PyTypeObject PySideClassInfoType;\n\n    struct PySideClassInfoPrivate;\n    struct PYSIDE_API PySideClassInfo\n    {\n        PyObject_HEAD\n        PySideClassInfoPrivate* d;\n    };\n};\n\nnamespace PySide { namespace ClassInfo {\n\nPYSIDE_API bool checkType(PyObject* pyObj);\nPYSIDE_API QMap<QByteArray, QByteArray> getMap(PySideClassInfo* obj);\n\n} //namespace ClassInfo\n} //namespace PySide\n\n#endif\n"
  },
  {
    "path": "libpyside/pysideclassinfo_p.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_CLASSINFO_P_H\n#define PYSIDE_CLASSINFO_P_H\n\n#include <sbkpython.h>\n#include <QMetaObject>\n#include \"pysideclassinfo.h\"\n\n#define __INFO_ATTR_NAME__      \"__classInfo__\"\n\nstruct PySideClassInfo;\n\nextern \"C\"\n{\n\nstruct PySideClassInfoPrivate {\n    QMap<QByteArray, QByteArray> m_data;\n};\n\n} // extern \"C\"\n\nnamespace PySide { namespace ClassInfo {\n\n/**\n * Init PySide QProperty support system\n */\nvoid init(PyObject* module);\n\n\n} // namespace ClassInfo\n} // namespace PySide\n\n#endif\n"
  },
  {
    "path": "libpyside/pysideconversions.h",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#ifndef PYSIDECONVERSIONS_H\n#define PYSIDECONVERSIONS_H\n\n#include <sbkpython.h>\n#include <QFlag>\n#include <conversions.h>\n#include <pysideqflags.h>\n\ntemplate <typename QtDict>\nstruct QtDictConverter\n{\n    static inline bool checkType(PyObject* pyObj)\n    {\n        return isConvertible(pyObj);\n    }\n\n    static inline bool isConvertible(PyObject* pyObj)\n    {\n        if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<QtDict>()))\n            return true;\n\n        if ((Shiboken::SbkType<QtDict>() && Shiboken::Object::checkType(pyObj)) || !PyDict_Check(pyObj))\n            return false;\n\n        PyObject* key;\n        PyObject* value;\n        Py_ssize_t pos = 0;\n\n        while (PyDict_Next(pyObj, &pos, &key, &value)) {\n            if (!Shiboken::Converter<typename QtDict::key_type>::isConvertible(key)\n                && !Shiboken::Converter<typename QtDict::mapped_type>::isConvertible(value)) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    static inline PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast<QtDict*>(cppObj)); }\n    static inline PyObject* toPython(const QtDict& cppobj)\n    {\n        PyObject* result = PyDict_New();\n        typename QtDict::const_iterator it = cppobj.begin();\n\n        for (; it != cppobj.end(); ++it) {\n            Shiboken::AutoDecRef keyObj(Shiboken::Converter<typename QtDict::key_type>::toPython(it.key()));\n            Shiboken::AutoDecRef valueObj(Shiboken::Converter<typename QtDict::mapped_type>::toPython(it.value()));\n            PyDict_SetItem(result, keyObj, valueObj);\n        }\n\n        return result;\n    }\n    static inline QtDict toCpp(PyObject* pyobj)\n    {\n        if (PyObject_TypeCheck(pyobj, Shiboken::SbkType<QtDict>()))\n            return *reinterpret_cast<QtDict*>(Shiboken::Object::cppPointer((SbkObject*)pyobj, Shiboken::SbkType<QtDict>()));\n\n        QtDict result;\n\n        PyObject* key;\n        PyObject* value;\n        Py_ssize_t pos = 0;\n\n        while (PyDict_Next(pyobj, &pos, &key, &value))\n            result[Shiboken::Converter<typename QtDict::key_type>::toCpp(key)] = Shiboken::Converter<typename QtDict::mapped_type>::toCpp(value);\n        return result;\n    }\n};\n\ntemplate <typename MultiMap>\nstruct QtMultiMapConverter\n{\n    static inline bool checkType(PyObject* pyObj)\n    {\n        return isConvertible(pyObj);\n    }\n\n    static inline bool isConvertible(PyObject* pyObj)\n    {\n        if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<MultiMap>()))\n            return true;\n\n        if ((Shiboken::SbkType<MultiMap>() && Shiboken::Object::checkType(pyObj)) || !PyDict_Check(pyObj))\n            return false;\n\n        PyObject* key;\n        PyObject* value;\n        Py_ssize_t pos = 0;\n\n        while (PyDict_Next(pyObj, &pos, &key, &value)) {\n            if (!Shiboken::Converter<typename MultiMap::key_type>::isConvertible(key)) {\n                if (PySequence_Check(value)) {\n                    for (int i = 0, max = PySequence_Length(value); i < max; ++i) {\n                        Shiboken::AutoDecRef item(PySequence_GetItem(value, i));\n                        if (!Shiboken::Converter<typename MultiMap::mapped_type>::isConvertible(value))\n                            return false;\n                    }\n                } else if (!Shiboken::Converter<typename MultiMap::mapped_type>::isConvertible(value)) {\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n\n    static inline PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast<MultiMap*>(cppObj)); }\n    static inline PyObject* toPython(const MultiMap& cppObj)\n    {\n        PyObject* result = PyDict_New();\n        typename MultiMap::const_iterator it = cppObj.begin();\n\n        for (; it != cppObj.end(); ++it) {\n            Shiboken::AutoDecRef key(Shiboken::Converter<typename MultiMap::key_type>::toPython(it.key()));\n            Shiboken::AutoDecRef value(Shiboken::Converter<typename MultiMap::mapped_type>::toPython(it.value()));\n\n            PyObject* values = PyDict_GetItem(result, key);\n            bool decRefValues = !values;\n            if (!values)\n                values = PyList_New(0);\n            PyList_Append(values, value);\n            PyDict_SetItem(result, key, values);\n            if (decRefValues) {\n                Py_DECREF(values);\n            }\n        }\n\n        return result;\n    }\n\n    static inline MultiMap toCpp(PyObject* pyObj)\n    {\n        if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<MultiMap>()))\n            return *reinterpret_cast<MultiMap*>(Shiboken::Object::cppPointer((SbkObject*)pyObj, Shiboken::SbkType<MultiMap>()));\n\n        MultiMap result;\n\n        PyObject* key;\n        PyObject* value;\n        Py_ssize_t pos = 0;\n\n        while (PyDict_Next(pyObj, &pos, &key, &value))\n            result[Shiboken::Converter<typename MultiMap::key_type>::toCpp(key)] = Shiboken::Converter<typename MultiMap::mapped_type>::toCpp(value);\n        return result;\n    }\n};\n\ntemplate <typename T>\nstruct QSequenceConverter\n{\n    static inline bool checkType(PyObject* pyObj)\n    {\n        return isConvertible(pyObj);\n    }\n\n    static inline bool isConvertible(PyObject* pyObj)\n    {\n        if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<T>()))\n            return true;\n        if ((Shiboken::SbkType<T>() && Shiboken::Object::checkType(pyObj)) || !PySequence_Check(pyObj))\n            return false;\n        for (int i = 0, max = PySequence_Length(pyObj); i < max; ++i) {\n            Shiboken::AutoDecRef item(PySequence_GetItem(pyObj, i));\n            if (!Shiboken::Converter<typename T::value_type>::isConvertible(item))\n                return false;\n        }\n        return true;\n    }\n    static inline PyObject* toPython(void* cppObj) { return toPython(*reinterpret_cast<T*>(cppObj)); }\n    static PyObject* toPython(const T& cppobj)\n    {\n        PyObject* result = PyList_New((int) cppobj.size());\n        typename T::const_iterator it = cppobj.begin();\n        for (int idx = 0; it != cppobj.end(); ++it, ++idx) {\n            typename T::value_type vh(*it);\n            PyList_SET_ITEM(result, idx, Shiboken::Converter<typename T::value_type>::toPython(vh));\n        }\n        return result;\n    }\n    static T toCpp(PyObject* pyobj)\n    {\n        if (PyObject_TypeCheck(pyobj, Shiboken::SbkType<T>()))\n            return *reinterpret_cast<T*>(Shiboken::Object::cppPointer((SbkObject*)pyobj, Shiboken::SbkType<T>()));\n\n        Shiboken::AutoDecRef fastSequence(PySequence_Fast(pyobj, \"Invalid sequence object\"));\n        T result;\n        for (int i = 0; i < PySequence_Size(pyobj); i++) {\n            PyObject* pyItem = PySequence_Fast_GET_ITEM(fastSequence.object(), i);\n            result << Shiboken::Converter<typename T::value_type>::toCpp(pyItem);\n        }\n        return result;\n    }\n};\n\n\ntemplate <typename T>\nstruct QFlagsConverter\n{\n    static inline bool checkType(PyObject* pyObj)\n    {\n        return PyObject_TypeCheck(pyObj, Shiboken::SbkType<T>());\n    }\n\n    static inline bool isConvertible(PyObject* pyObj)\n    {\n        return PyObject_TypeCheck(pyObj, Shiboken::SbkType<T>())\n               || PyObject_TypeCheck(pyObj, Shiboken::SbkType<typename T::enum_type>());\n    }\n\n    static inline PyObject* toPython(void* cppObj)\n    {\n        return toPython(*reinterpret_cast<T*>(cppObj));\n    }\n\n    static inline PyObject* toPython(const T& cppObj)\n    {\n        return reinterpret_cast<PyObject*>(PySide::QFlags::newObject(cppObj, Shiboken::SbkType<T>()));\n    }\n\n    static inline T toCpp(PyObject* pyObj)\n    {\n        long val = 0;\n        if (Shiboken::Enum::check(pyObj)) {\n            val = Shiboken::Enum::getValue(pyObj);\n        } else if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<T>())) {\n            val = PySide::QFlags::getValue(reinterpret_cast<PySideQFlagsObject*>(pyObj));\n        } else if (PyNumber_Check(pyObj)) {\n            Shiboken::AutoDecRef pyLong(PyNumber_Long(pyObj));\n            val = PyLong_AsLong(pyLong.object());\n        } else {\n            PyErr_BadArgument();\n        }\n        return T(QFlag(val));\n    }\n};\n\n#endif\n"
  },
  {
    "path": "libpyside/pysidemacros.h",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#ifndef PYSIDEMACROS_H\n#define PYSIDEMACROS_H\n\n#if defined _WIN32\n    #if PYSIDE_EXPORTS\n        #define PYSIDE_API __declspec(dllexport)\n    #else\n        #if defined __MINGW32__\n            #define PYSIDE_API\n        #else\n            #define PYSIDE_API __declspec(dllimport)\n        #endif\n    #endif\n    #define PYSIDE_DEPRECATED(func) __declspec(deprecated) func\n#else\n    #if __GNUC__ >= 4\n        #define PYSIDE_API __attribute__ ((visibility(\"default\")))\n        #define PYSIDE_DEPRECATED(func) func __attribute__ ((deprecated))\n    #else\n        #define PYSIDE_API\n        #define PYSIDE_DEPRECATED(func) func\n    #endif\n#endif\n\n#endif\n"
  },
  {
    "path": "libpyside/pysidemetafunction.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n#include <sbkpython.h>\n#include \"pysidemetafunction.h\"\n#include \"pysidemetafunction_p.h\"\n\n#include <shiboken.h>\n#include <QObject>\n#include <QMetaMethod>\n#include <QDebug>\n\nextern \"C\"\n{\n\nstruct PySideMetaFunctionPrivate\n{\n    QObject* qobject;\n    int methodIndex;\n};\n\n//methods\nstatic void         functionFree(void*);\nstatic PyObject*    functionCall(PyObject*, PyObject*, PyObject*);\n\nPyTypeObject PySideMetaFunctionType = {\n    PyVarObject_HEAD_INIT(0, 0)\n    /*tp_name*/             \"PySide.MetaFunction\",\n    /*tp_basicsize*/        sizeof(PySideMetaFunction),\n    /*tp_itemsize*/         0,\n    /*tp_dealloc*/          0,\n    /*tp_print*/            0,\n    /*tp_getattr*/          0,\n    /*tp_setattr*/          0,\n    /*tp_compare*/          0,\n    /*tp_repr*/             0,\n    /*tp_as_number*/        0,\n    /*tp_as_sequence*/      0,\n    /*tp_as_mapping*/       0,\n    /*tp_hash*/             0,\n    /*tp_call*/             functionCall,\n    /*tp_str*/              0,\n    /*tp_getattro*/         0,\n    /*tp_setattro*/         0,\n    /*tp_as_buffer*/        0,\n    /*tp_flags*/            Py_TPFLAGS_DEFAULT,\n    /*tp_doc*/              \"MetaFunction\",\n    /*tp_traverse*/         0,\n    /*tp_clear*/            0,\n    /*tp_richcompare*/      0,\n    /*tp_weaklistoffset*/   0,\n    /*tp_iter*/             0,\n    /*tp_iternext*/         0,\n    /*tp_methods*/          0,\n    /*tp_members*/          0,\n    /*tp_getset*/           0,\n    /*tp_base*/             0,\n    /*tp_dict*/             0,\n    /*tp_descr_get*/        0,\n    /*tp_descr_set*/        0,\n    /*tp_dictoffset*/       0,\n    /*tp_init*/             0,\n    /*tp_alloc*/            0,\n    /*tp_new*/              PyType_GenericNew,\n    /*tp_free*/             functionFree,\n    /*tp_is_gc*/            0,\n    /*tp_bases*/            0,\n    /*tp_mro*/              0,\n    /*tp_cache*/            0,\n    /*tp_subclasses*/       0,\n    /*tp_weaklist*/         0,\n    /*tp_del*/              0,\n};\n\nvoid functionFree(void *self)\n{\n    PySideMetaFunction* function = reinterpret_cast<PySideMetaFunction*>(self);\n    delete function->d;\n}\n\nPyObject* functionCall(PyObject* self, PyObject* args, PyObject* kw)\n{\n    PySideMetaFunction* function = reinterpret_cast<PySideMetaFunction*>(self);\n\n    PyObject* retVal;\n    if (!PySide::MetaFunction::call(function->d->qobject, function->d->methodIndex, args, &retVal))\n        return 0;\n    return retVal;\n}\n\n} // extern \"C\"\n\nnamespace PySide { namespace MetaFunction {\n\nvoid init(PyObject* module)\n{\n    if (PyType_Ready(&PySideMetaFunctionType) < 0)\n        return;\n\n    PyModule_AddObject(module, \"MetaFunction\", ((PyObject*)&PySideMetaFunctionType));\n}\n\nPySideMetaFunction* newObject(QObject* source, int methodIndex)\n{\n    if (methodIndex >= source->metaObject()->methodCount())\n        return 0;\n\n    QMetaMethod method = source->metaObject()->method(methodIndex);\n    if ((method.methodType() == QMetaMethod::Slot) ||\n        (method.methodType() == QMetaMethod::Method)) {\n        PySideMetaFunction* function = PyObject_New(PySideMetaFunction, &PySideMetaFunctionType);\n        function->d = new PySideMetaFunctionPrivate();\n        function->d->qobject = source;\n        function->d->methodIndex = methodIndex;\n        return function;\n    }\n    return 0;\n}\n\nbool call(QObject* self, int methodIndex, PyObject* args, PyObject** retVal)\n{\n\n    QMetaMethod method = self->metaObject()->method(methodIndex);\n    QList<QByteArray> argTypes = method.parameterTypes();\n\n    // args given plus return type\n    Shiboken::AutoDecRef sequence(PySequence_Fast(args, 0));\n    int numArgs = PySequence_Fast_GET_SIZE(sequence.object()) + 1;\n\n    if (numArgs - 1 != argTypes.count()) {\n        PyErr_Format(PyExc_TypeError, \"%s only accepts %d arguments, %d given!\", method.signature(), argTypes.count(), numArgs);\n        return false;\n    }\n\n    QVariant* methValues = new QVariant[numArgs];\n    void** methArgs = new void*[numArgs];\n\n    // Prepare room for return type\n    const char* returnType = method.typeName();\n    if (returnType)\n        argTypes.prepend(returnType);\n    else\n        argTypes.prepend(QByteArray());\n\n    int i;\n    for (i = 0; i < numArgs; ++i) {\n        const QByteArray& typeName = argTypes[i];\n        // This must happen only when the method hasn't return type.\n        if (typeName.isEmpty()) {\n            methArgs[i] = 0;\n            continue;\n        }\n\n        Shiboken::Conversions::SpecificConverter converter(typeName);\n        if (converter) {\n            int typeId = QMetaType::type(typeName);\n            if (!Shiboken::Conversions::pythonTypeIsObjectType(converter)) {\n                if (!typeId) {\n                    PyErr_Format(PyExc_TypeError, \"Value types used on meta functions (including signals) need to be \"\n                                                  \"registered on meta type: %s\", typeName.data());\n                    break;\n                }\n                methValues[i] = QVariant(typeId, (void*) 0);\n            }\n            methArgs[i] = methValues[i].data();\n            if (i == 0) // Don't do this for return type\n                continue;\n            if (typeId == QVariant::String) {\n                QString tmp;\n                converter.toCpp(PySequence_Fast_GET_ITEM(sequence.object(), i - 1), &tmp);\n                methValues[i] = tmp;\n            } else {\n                converter.toCpp(PySequence_Fast_GET_ITEM(sequence.object(), i - 1), methArgs[i]);\n            }\n        } else {\n            PyErr_Format(PyExc_TypeError, \"Unknown type used to call meta function (that may be a signal): %s\", argTypes[i].constData());\n            break;\n        }\n    }\n\n    bool ok = i == numArgs;\n    if (ok) {\n        Py_BEGIN_ALLOW_THREADS\n        QMetaObject::metacall(self, QMetaObject::InvokeMetaMethod, method.methodIndex(), methArgs);\n        Py_END_ALLOW_THREADS\n\n        if (retVal) {\n            if (methArgs[0]) {\n                static SbkConverter* qVariantTypeConverter = Shiboken::Conversions::getConverter(\"QVariant\");\n                Q_ASSERT(qVariantTypeConverter);\n                *retVal = Shiboken::Conversions::copyToPython(qVariantTypeConverter, &methValues[0]);\n                SbkDbg() << (*retVal);\n            } else {\n                *retVal = Py_None;\n                Py_INCREF(*retVal);\n            }\n        }\n    }\n\n    delete[] methArgs;\n    delete[] methValues;\n\n    return ok;\n}\n\n\n} //namespace MetaFunction\n} //namespace PySide\n\n"
  },
  {
    "path": "libpyside/pysidemetafunction.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_FUNCTION_H\n#define PYSIDE_METAFUNCTION_H\n\n#include <QObject>\n#include <QString>\n#include <QStringList>\n\n#include <pysidemacros.h>\n#include <sbkpython.h>\n\nextern \"C\"\n{\n    extern PYSIDE_API PyTypeObject PySideMetaFunctionType;\n\n    struct PySideMetaFunctionPrivate;\n    struct PYSIDE_API PySideMetaFunction\n    {\n        PyObject_HEAD\n        PySideMetaFunctionPrivate* d;\n    };\n}; //extern \"C\"\n\nnamespace PySide { namespace MetaFunction {\n\n/**\n * This function creates a MetaFunction object\n *\n * @param   obj the QObject witch this fuction is part of\n * @param   methodIndex The index of this function on MetaObject\n * @return  Return a new reference of PySideMetaFunction\n **/\nPYSIDE_API PySideMetaFunction*  newObject(QObject* obj, int methodIndex);\n\n} //namespace MetaFunction\n} //namespace PySide\n\n#endif\n"
  },
  {
    "path": "libpyside/pysidemetafunction_p.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_METAFUNCTION_P_H\n#define PYSIDE_METAFUNCTION_P_H\n\n#include <sbkpython.h>\n#include <QList>\n#include <QByteArray>\n\nclass QObject;\n\nnamespace PySide { namespace MetaFunction {\n\n    void init(PyObject* module);\n    /**\n     * Does a Qt metacall on a QObject\n     */\n    bool call(QObject* self, int methodIndex, PyObject* args, PyObject** retVal = 0);\n\n} //namespace MetaFunction\n} //namespace PySide\n\n#endif\n"
  },
  {
    "path": "libpyside/pysideproperty.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include <sbkpython.h>\n#include \"pysideproperty.h\"\n#include \"pysideproperty_p.h\"\n#include \"dynamicqmetaobject_p.h\"\n#include \"pysidesignal.h\"\n#include \"pysidesignal_p.h\"\n\n#include <shiboken.h>\n#include <QDebug>\n\n\n#define QPROPERTY_CLASS_NAME \"Property\"\n\nextern \"C\"\n{\n\nstatic PyObject* qpropertyTpNew(PyTypeObject* subtype, PyObject* args, PyObject* kwds);\nstatic int qpropertyTpInit(PyObject*, PyObject*, PyObject*);\nstatic void qpropertyDeAlloc(PyObject* self);\n\n//methods\nstatic PyObject* qPropertyCall(PyObject*, PyObject*, PyObject*);\nstatic PyObject* qPropertySetter(PyObject*, PyObject*);\nstatic PyObject* qPropertyGetter(PyObject*, PyObject*);\nstatic int qpropertyTraverse(PyObject* self, visitproc visit, void* arg);\nstatic int qpropertyClear(PyObject* self);\n\nstatic PyMethodDef PySidePropertyMethods[] = {\n    {\"setter\", (PyCFunction)qPropertySetter, METH_O},\n    {\"write\", (PyCFunction)qPropertySetter, METH_O},\n    {\"getter\", (PyCFunction)qPropertyGetter, METH_O},\n    {\"read\", (PyCFunction)qPropertyGetter, METH_O},\n    {0}\n};\n\nPyTypeObject PySidePropertyType = {\n    PyVarObject_HEAD_INIT(0, 0)\n    QPROPERTY_CLASS_NAME,      /*tp_name*/\n    sizeof(PySideProperty),   /*tp_basicsize*/\n    0,                         /*tp_itemsize*/\n    qpropertyDeAlloc,          /*tp_dealloc*/\n    0,                         /*tp_print*/\n    0,                         /*tp_getattr*/\n    0,                         /*tp_setattr*/\n    0,                         /*tp_compare*/\n    0,                         /*tp_repr*/\n    0,                         /*tp_as_number*/\n    0,                         /*tp_as_sequence*/\n    0,                         /*tp_as_mapping*/\n    0,                         /*tp_hash */\n    qPropertyCall,             /*tp_call*/\n    0,                         /*tp_str*/\n    0,                         /*tp_getattro*/\n    0,                         /*tp_setattro*/\n    0,                         /*tp_as_buffer*/\n    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,        /*tp_flags*/\n    0,                         /*tp_doc */\n    qpropertyTraverse,         /*tp_traverse */\n    qpropertyClear,            /*tp_clear */\n    0,                         /*tp_richcompare */\n    0,                         /*tp_weaklistoffset */\n    0,                         /*tp_iter */\n    0,                         /*tp_iternext */\n    PySidePropertyMethods,     /*tp_methods */\n    0,                         /*tp_members */\n    0,                         /*tp_getset */\n    0,                         /*tp_base */\n    0,                         /*tp_dict */\n    0,                         /*tp_descr_get */\n    0,                         /*tp_descr_set */\n    0,                         /*tp_dictoffset */\n    qpropertyTpInit,           /*tp_init */\n    0,                         /*tp_alloc */\n    qpropertyTpNew,            /*tp_new */\n    0,                         /*tp_free */\n    0,                         /*tp_is_gc */\n    0,                         /*tp_bases */\n    0,                         /*tp_mro */\n    0,                         /*tp_cache */\n    0,                         /*tp_subclasses */\n    0,                         /*tp_weaklist */\n    0,                         /*tp_del */\n};\n\nstatic void qpropertyMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Call call, void** args)\n{\n    Shiboken::Conversions::SpecificConverter converter(pp->d->typeName);\n    Q_ASSERT(converter);\n\n    QByteArray type(pp->d->typeName);\n\n    switch(call) {\n        case QMetaObject::ReadProperty:\n        {\n            Shiboken::GilState gil;\n            PyObject* value = PySide::Property::getValue(pp, self);\n            if (value) {\n                converter.toCpp(value, args[0]);\n                Py_DECREF(value);\n            } else if (PyErr_Occurred()) {\n                PyErr_Print(); // Clear any errors but print them to stderr\n            }\n            break;\n        }\n\n        case QMetaObject::WriteProperty:\n        {\n            Shiboken::GilState gil;\n            Shiboken::AutoDecRef value(converter.toPython(args[0]));\n            PySide::Property::setValue(pp, self, value);\n            break;\n        }\n\n        case QMetaObject::ResetProperty:\n        {\n            Shiboken::GilState gil;\n            PySide::Property::reset(pp, self);\n            break;\n        }\n\n        case QMetaObject::QueryPropertyDesignable:\n        case QMetaObject::QueryPropertyScriptable:\n        case QMetaObject::QueryPropertyStored:\n        case QMetaObject::QueryPropertyEditable:\n        case QMetaObject::QueryPropertyUser:\n        // just to avoid gcc warnings\n        case QMetaObject::InvokeMetaMethod:\n        case QMetaObject::CreateInstance:\n            break;\n    }\n}\n\n\nstatic PyObject* qpropertyTpNew(PyTypeObject* subtype, PyObject* args, PyObject* kwds)\n{\n    PySideProperty* me = reinterpret_cast<PySideProperty*>(subtype->tp_alloc(subtype, 0));\n    me->d = new PySidePropertyPrivate;\n    memset(me->d, 0, sizeof(PySidePropertyPrivate));\n    PySidePropertyPrivate* pData = me->d;\n    pData->designable = true;\n    pData->scriptable = true;\n    pData->stored = true;\n    return (PyObject*) me;\n}\n\nint qpropertyTpInit(PyObject* self, PyObject* args, PyObject* kwds)\n{\n    PyObject* type = 0;\n    PySideProperty* data = reinterpret_cast<PySideProperty*>(self);\n    PySidePropertyPrivate* pData = data->d;\n    pData->metaCallHandler = &qpropertyMetaCall;\n\n    static const char *kwlist[] = {\"type\", \"fget\", \"fset\", \"freset\", \"fdel\", \"doc\", \"notify\",\n                                   \"designable\", \"scriptable\", \"stored\", \"user\",\n                                   \"constant\", \"final\", 0};\n    if (!PyArg_ParseTupleAndKeywords(args, kwds,\n                                     \"O|OOOOsObbbbbb:QtCore.QProperty\", (char**) kwlist,\n                                     /*OO*/     &type, &(pData->fget),\n                                     /*OOO*/    &(pData->fset), &(pData->freset), &(pData->fdel),\n                                     /*s*/      &(pData->doc),\n                                     /*O*/      &(pData->notify),\n                                     /*bbbbbb*/ &(pData->designable), &(pData->scriptable), &(pData->stored), &(pData->user), &(pData->constant), &(pData->final))) {\n        return 0;\n    }\n\n\n    pData->typeName = PySide::Signal::getTypeName(type);\n\n    if (!pData->typeName)\n        PyErr_SetString(PyExc_TypeError, \"Invalid property type or type name.\");\n    else if (pData->constant && (pData->fset || pData->notify))\n        PyErr_SetString(PyExc_TypeError, \"A constant property cannot have a WRITE method or a NOTIFY signal.\");\n\n    if (!PyErr_Occurred()) {\n        Py_XINCREF(pData->fget);\n        Py_XINCREF(pData->fset);\n        Py_XINCREF(pData->freset);\n        Py_XINCREF(pData->fdel);\n        Py_XINCREF(pData->notify);\n        return 1;\n    } else {\n        pData->fget = 0;\n        pData->fset = 0;\n        pData->freset = 0;\n        pData->fdel = 0;\n        pData->notify = 0;\n        return -1;\n    }\n}\n\nvoid qpropertyDeAlloc(PyObject* self)\n{\n    qpropertyClear(self);\n    Py_TYPE(self)->tp_free(self);\n}\n\nPyObject* qPropertyCall(PyObject* self, PyObject* args, PyObject* kw)\n{\n    PyObject *callback = PyTuple_GetItem(args, 0);\n    if (PyFunction_Check(callback)) {\n        PySideProperty *prop = reinterpret_cast<PySideProperty*>(self);\n        PySidePropertyPrivate* pData = prop->d;\n\n        Py_INCREF(callback);\n        pData->fget = callback;\n\n        Py_INCREF(self);\n        return self;\n    } else {\n        PyErr_SetString(PyExc_TypeError, \"Invalid property usage.\");\n        return 0;\n    }\n}\n\nPyObject* qPropertySetter(PyObject* self, PyObject* callback)\n{\n    if (PyFunction_Check(callback)) {\n        PySideProperty *prop = reinterpret_cast<PySideProperty*>(self);\n        PySidePropertyPrivate* pData = prop->d;\n\n        Py_INCREF(callback);\n        pData->fset = callback;\n\n        Py_INCREF(callback);\n        return callback;\n    } else {\n        PyErr_SetString(PyExc_TypeError, \"Invalid property setter agument.\");\n        return 0;\n    }\n}\n\nPyObject* qPropertyGetter(PyObject* self, PyObject* callback)\n{\n    if (PyFunction_Check(callback)) {\n        PySideProperty *prop = reinterpret_cast<PySideProperty*>(self);\n        PySidePropertyPrivate* pData = prop->d;\n\n        Py_INCREF(callback);\n        pData->fget = callback;\n\n        Py_INCREF(callback);\n        return callback;\n    } else {\n        PyErr_SetString(PyExc_TypeError, \"Invalid property getter agument.\");\n        return 0;\n    }\n}\n\nstatic int qpropertyTraverse(PyObject* self, visitproc visit, void* arg)\n{\n    PySidePropertyPrivate* data = reinterpret_cast<PySideProperty*>(self)->d;\n    if (!data)\n        return 0;\n\n    Py_VISIT(data->fget);\n    Py_VISIT(data->fset);\n    Py_VISIT(data->freset);\n    Py_VISIT(data->fdel);\n    Py_VISIT(data->notify);\n    return 0;\n}\n\nstatic int qpropertyClear(PyObject* self)\n{\n    PySidePropertyPrivate* data = reinterpret_cast<PySideProperty*>(self)->d;\n    if (!data)\n        return 0;\n\n    Py_CLEAR(data->fget);\n    Py_CLEAR(data->fset);\n    Py_CLEAR(data->freset);\n    Py_CLEAR(data->fdel);\n    Py_CLEAR(data->notify);\n\n\n    free(data->typeName);\n    free(data->doc);\n    free(data->notifySignature);\n    delete data;\n    reinterpret_cast<PySideProperty*>(self)->d = 0;\n    return 0;\n}\n\n} // extern \"C\"\n\nnamespace {\n\nstatic PyObject* getFromType(PyTypeObject* type, PyObject* name)\n{\n    PyObject* attr = 0;\n    attr = PyDict_GetItem(type->tp_dict, name);\n    if (!attr) {\n        PyObject* bases = type->tp_bases;\n        int size = PyTuple_GET_SIZE(bases);\n        for(int i=0; i < size; i++) {\n            PyObject* base = PyTuple_GET_ITEM(bases, i);\n            attr = getFromType(reinterpret_cast<PyTypeObject*>(base), name);\n            if (attr)\n                return attr;\n        }\n    }\n    return attr;\n}\n\n} //namespace\n\n\nnamespace PySide { namespace Property {\n\nvoid init(PyObject* module)\n{\n    if (PyType_Ready(&PySidePropertyType) < 0)\n        return;\n\n    Py_INCREF(&PySidePropertyType);\n    PyModule_AddObject(module, QPROPERTY_CLASS_NAME, ((PyObject*)&PySidePropertyType));\n}\n\nbool checkType(PyObject* pyObj)\n{\n    if (pyObj) {\n        return PyType_IsSubtype(pyObj->ob_type, &PySidePropertyType);\n    }\n    return false;\n}\n\nbool isPropertyType(PyObject* pyObj)\n{\n    return checkType(pyObj);\n}\n\nint setValue(PySideProperty* self, PyObject* source, PyObject* value)\n{\n    PyObject* fset = self->d->fset;\n    if (fset) {\n        Shiboken::AutoDecRef args(PyTuple_New(2));\n        PyTuple_SET_ITEM(args, 0, source);\n        PyTuple_SET_ITEM(args, 1, value);\n        Py_INCREF(source);\n        Py_INCREF(value);\n        Shiboken::AutoDecRef result(PyObject_CallObject(fset, args));\n        return (result.isNull() ? -1 : 0);\n    } else {\n        PyErr_SetString(PyExc_AttributeError, \"Attibute read only\");\n    }\n    return -1;\n}\n\nPyObject* getValue(PySideProperty* self, PyObject* source)\n{\n    PyObject* fget = self->d->fget;\n    if (fget) {\n        Shiboken::AutoDecRef args(PyTuple_New(1));\n        Py_INCREF(source);\n        PyTuple_SET_ITEM(args, 0, source);\n        return  PyObject_CallObject(fget, args);\n    }\n    return 0;\n}\n\nint reset(PySideProperty* self, PyObject* source)\n{\n    PyObject* freset = self->d->freset;\n    if (freset) {\n        Shiboken::AutoDecRef args(PyTuple_New(1));\n        Py_INCREF(source);\n        PyTuple_SET_ITEM(args, 0, source);\n        Shiboken::AutoDecRef result(PyObject_CallObject(freset, args));\n        return (result.isNull() ? -1 : 0);\n    }\n    return -1;\n}\n\nconst char* getTypeName(const PySideProperty* self)\n{\n    return self->d->typeName;\n}\n\nPySideProperty* getObject(PyObject* source, PyObject* name)\n{\n    PyObject* attr = 0;\n\n    if (Shiboken::Object::isUserType(source)) {\n        PyObject* dict = reinterpret_cast<SbkObject*>(source)->ob_dict;\n        if (dict)\n            attr = PyDict_GetItem(dict, name);\n    }\n\n    attr = getFromType(source->ob_type, name);\n    if (attr && checkType(attr)) {\n        Py_INCREF(attr);\n        return reinterpret_cast<PySideProperty*>(attr);\n    }\n\n    if (!attr)\n        PyErr_Clear(); //Clear possible error caused by PyObject_GenericGetAttr\n\n    return 0;\n}\n\nbool isReadable(const PySideProperty* self)\n{\n    return true;\n}\n\nbool isWritable(const PySideProperty* self)\n{\n    return (self->d->fset != 0);\n}\n\nbool hasReset(const PySideProperty* self)\n{\n    return (self->d->freset != 0);\n}\n\nbool isDesignable(const PySideProperty* self)\n{\n    return self->d->designable;\n}\n\nbool isScriptable(const PySideProperty* self)\n{\n    return self->d->scriptable;\n}\n\nbool isStored(const PySideProperty* self)\n{\n    return self->d->stored;\n}\n\nbool isUser(const PySideProperty* self)\n{\n    return self->d->user;\n}\n\nbool isConstant(const PySideProperty* self)\n{\n    return self->d->constant;\n}\n\nbool isFinal(const PySideProperty* self)\n{\n    return self->d->final;\n}\n\nconst char* getNotifyName(PySideProperty* self)\n{\n    if (!self->d->notifySignature) {\n        PyObject* str = PyObject_Str(self->d->notify);\n        self->d->notifySignature = strdup(Shiboken::String::toCString(str));\n        Py_DECREF(str);\n    }\n\n    return self->d->notifySignature;\n}\n\nvoid setMetaCallHandler(PySideProperty* self, MetaCallHandler handler)\n{\n    self->d->metaCallHandler = handler;\n}\n\nvoid setTypeName(PySideProperty* self, const char* typeName)\n{\n    self->d->typeName = strdup(typeName);\n}\n\nvoid setUserData(PySideProperty* self, void* data)\n{\n    self->d->userData = data;\n}\n\nvoid* userData(PySideProperty* self)\n{\n    return self->d->userData;\n}\n\n} //namespace Property\n} //namespace PySide\n"
  },
  {
    "path": "libpyside/pysideproperty.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_PROPERTY_H\n#define PYSIDE_PROPERTY_H\n\n#include <pysidemacros.h>\n#include <sbkpython.h>\n#include <QObject>\n\nextern \"C\"\n{\n    extern PYSIDE_API PyTypeObject PySidePropertyType;\n\n    struct PySidePropertyPrivate;\n    struct PYSIDE_API PySideProperty\n    {\n        PyObject_HEAD\n        PySidePropertyPrivate* d;\n    };\n};\n\nnamespace PySide { namespace Property {\n\ntypedef void (*MetaCallHandler)(PySideProperty*,PyObject*,QMetaObject::Call, void**);\n\nPYSIDE_API bool checkType(PyObject* pyObj);\n\n/// @deprecated Use checkType\nPYSIDE_DEPRECATED(PYSIDE_API bool isPropertyType(PyObject* pyObj));\n\n/**\n * This function call set property function and pass value as arg\n * This function does not check the property object type\n *\n * @param   self The property object\n * @param   source The QObject witch has the property\n * @param   value The value to set in property\n * @return  Return 0 if ok or -1 if this function fail\n **/\nPYSIDE_API int setValue(PySideProperty* self, PyObject* source, PyObject* value);\n\n/**\n * This function call get property function\n * This function does not check the property object type\n *\n * @param   self The property object\n * @param   source The QObject witch has the property\n * @return  Return the result of property get function or 0 if this fail\n **/\nPYSIDE_API PyObject* getValue(PySideProperty* self, PyObject* source);\n\n/**\n * This function return the notify name used on this property\n *\n * @param   self The property object\n * @return  Return a const char with the notify name used\n **/\nPYSIDE_API const char* getNotifyName(PySideProperty* self);\n\n\n/**\n * This function search in the source object for desired property\n *\n * @param   source The QObject object\n * @param   name The property name\n * @return  Return a new reference to property object\n **/\nPYSIDE_API PySideProperty* getObject(PyObject* source, PyObject* name);\n\nPYSIDE_API void setMetaCallHandler(PySideProperty* self, MetaCallHandler handler);\n\nPYSIDE_API void setTypeName(PySideProperty* self, const char* typeName);\n\nPYSIDE_API void setUserData(PySideProperty* self, void* data);\nPYSIDE_API void* userData(PySideProperty* self);\n\n} //namespace Property\n} //namespace PySide\n\n#endif\n"
  },
  {
    "path": "libpyside/pysideproperty_p.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_QPROPERTY_P_H\n#define PYSIDE_QPROPERTY_P_H\n\n#include <sbkpython.h>\n#include <QMetaObject>\n#include \"pysideproperty.h\"\n\nstruct PySideProperty;\n\nextern \"C\"\n{\n\nstruct PySidePropertyPrivate {\n    char* typeName;\n    PySide::Property::MetaCallHandler metaCallHandler;\n    PyObject* fget;\n    PyObject* fset;\n    PyObject* freset;\n    PyObject* fdel;\n    PyObject* notify;\n    char* notifySignature;\n    char* doc;\n    bool designable;\n    bool scriptable;\n    bool stored;\n    bool user;\n    bool constant;\n    bool final;\n    void* userData;\n};\n\n} // extern \"C\"\n\nnamespace PySide { namespace Property {\n\n/**\n * Init PySide QProperty support system\n */\nvoid init(PyObject* module);\n\n/**\n * This function call reset property function\n * This function does not check the property object type\n *\n * @param   self The property object\n * @param   source The QObject witch has the property\n * @return  Return 0 if ok or -1 if this function fail\n **/\nint reset(PySideProperty* self, PyObject* source);\n\n\n/**\n * This function return the property type\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return the property type name\n **/\nconst char* getTypeName(const PySideProperty* self);\n\n/**\n * This function check if property has read function\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool isReadable(const PySideProperty* self);\n\n/**\n * This function check if property has write function\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool isWritable(const PySideProperty* self);\n\n/**\n * This function check if property has reset function\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool hasReset(const PySideProperty* self);\n\n/**\n * This function check if property has the flag DESIGNABLE setted\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool isDesignable(const PySideProperty* self);\n\n/**\n * This function check if property has the flag SCRIPTABLE setted\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool isScriptable(const PySideProperty* self);\n\n/**\n * This function check if property has the flag STORED setted\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool isStored(const PySideProperty* self);\n\n/**\n * This function check if property has the flag USER setted\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool isUser(const PySideProperty* self);\n\n/**\n * This function check if property has the flag CONSTANT setted\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool isConstant(const PySideProperty* self);\n\n/**\n * This function check if property has the flag FINAL setted\n * This function does not check the property object type\n *\n * @param   self The property object\n * @return  Return a boolean value\n **/\nbool isFinal(const PySideProperty* self);\n\n} // namespace Property\n} // namespace PySide\n\n#endif\n"
  },
  {
    "path": "libpyside/pysideqflags.cpp",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include \"pysideqflags.h\"\n#include <sbkenum.h>\n#include <autodecref.h>\n\nextern \"C\" {\n    struct SbkConverter;\n\n    /**\n     * Type of all QFlags\n     */\n    struct PySideQFlagsType\n    {\n        PyHeapTypeObject super;\n        SbkConverter** converterPtr;\n        SbkConverter* converter;\n    };\n\n    #define PYSIDE_QFLAGS(X) reinterpret_cast<PySideQFlagsObject*>(X)\n\n    PyObject* PySideQFlagsNew(PyTypeObject* type, PyObject* args, PyObject* kwds)\n    {\n        long val = 0;\n        if (PyTuple_GET_SIZE(args)) {\n            PyObject* arg = PyTuple_GET_ITEM(args, 0);\n            if (Shiboken::isShibokenEnum(arg)) {// faster call\n                val = Shiboken::Enum::getValue(arg);\n            } else if (PyNumber_Check(arg)) {\n                Shiboken::AutoDecRef number(PyNumber_Long(arg));\n                val = PyLong_AsLong(number);\n            } else {\n                PyErr_SetString(PyExc_TypeError,\"QFlags must be created using enums or numbers.\");\n                return 0;\n            }\n        }\n        PySideQFlagsObject* self = PyObject_New(PySideQFlagsObject, type);\n        self->ob_value = val;\n        return reinterpret_cast<PyObject*>(self);\n    }\n\n    static long getNumberValue(PyObject* v)\n    {\n        Shiboken::AutoDecRef number(PyNumber_Long(v));\n        return PyLong_AsLong(number);\n    }\n\n    PyObject* PySideQFlagsRichCompare(PyObject* self, PyObject* other, int op)\n    {\n        int result = 0;\n        if (!PyNumber_Check(other)) {\n            PyErr_BadArgument();\n            return NULL;\n        }\n\n        long valA = PYSIDE_QFLAGS(self)->ob_value;\n        long valB = getNumberValue(other);\n\n        if (self == other) {\n            result = 1;\n        } else  {\n            switch (op) {\n            case Py_EQ:\n                result = (valA == valB);\n                break;\n            case Py_NE:\n                result = (valA != valB);\n                break;\n            case Py_LE:\n                result = (valA <= valB);\n                break;\n            case Py_GE:\n                result = (valA >= valB);\n                break;\n            case Py_LT:\n                result = (valA < valB);\n                break;\n            case Py_GT:\n                result = (valA > valB);\n                break;\n            default:\n                PyErr_BadArgument();\n                return NULL;\n            }\n        }\n        if (result)\n            Py_RETURN_TRUE;\n        else\n            Py_RETURN_FALSE;\n    }\n}\n\nnamespace PySide\n{\nnamespace QFlags\n{\n    PyTypeObject* create(const char* name, PyNumberMethods* numberMethods)\n    {\n        PyTypeObject* type = reinterpret_cast<PyTypeObject*>(new PySideQFlagsType);\n        ::memset(type, 0, sizeof(PySideQFlagsType));\n        Py_TYPE(type) = &PyType_Type;\n        type->tp_basicsize = sizeof(PySideQFlagsObject);\n        type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES;\n        type->tp_name = name;\n        type->tp_new = &PySideQFlagsNew;\n        type->tp_as_number = numberMethods;\n        type->tp_richcompare = &PySideQFlagsRichCompare;\n\n        PySideQFlagsType* flagsType = reinterpret_cast<PySideQFlagsType*>(type);\n        flagsType->converterPtr = &flagsType->converter;\n\n        if (PyType_Ready(type) < 0)\n            return 0;\n\n        return type;\n    }\n\n    PySideQFlagsObject* newObject(long value, PyTypeObject* type)\n    {\n        PySideQFlagsObject* qflags = PyObject_New(PySideQFlagsObject, type);\n        qflags->ob_value = value;\n        return qflags;\n    }\n\n    long getValue(PySideQFlagsObject* self)\n    {\n        return self->ob_value;\n    }\n}\n}\n"
  },
  {
    "path": "libpyside/pysideqflags.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_QFLAGS_H\n#define PYSIDE_QFLAGS_H\n\n#include <sbkpython.h>\n#include \"pysidemacros.h\"\n\n\nextern \"C\"\n{\n    struct PYSIDE_API PySideQFlagsObject {\n        PyObject_HEAD\n        long ob_value;\n    };\n\n    PYSIDE_API PyObject* PySideQFlagsNew(PyTypeObject *type, PyObject *args, PyObject *kwds);\n    PYSIDE_API PyObject* PySideQFlagsRichCompare(PyObject *self, PyObject *other, int op);\n}\n\n\nnamespace PySide\n{\nnamespace QFlags\n{\n    /**\n     * Creates a new QFlags type.\n     */\n    PYSIDE_API PyTypeObject* create(const char* name, PyNumberMethods* numberMethods);\n    /**\n     * Creates a new QFlags instance of type \\p type and value \\p value.\n     */\n    PYSIDE_API PySideQFlagsObject* newObject(long value, PyTypeObject* type);\n    /**\n     * Returns the value held by a QFlag.\n     */\n    PYSIDE_API long getValue(PySideQFlagsObject* self);\n}\n}\n\n#endif\n\n"
  },
  {
    "path": "libpyside/pysidesignal.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include <sbkpython.h>\n#include \"pysidesignal.h\"\n#include \"pysidesignal_p.h\"\n#include \"signalmanager.h\"\n\n#include <shiboken.h>\n#include <QDebug>\n\n#define SIGNAL_CLASS_NAME \"Signal\"\n#define SIGNAL_INSTANCE_NAME \"SignalInstance\"\n#define QT_SIGNAL_SENTINEL '2'\n\nnamespace PySide {\nnamespace Signal {\n    //aux\n    static char*        buildSignature(const char*, const char*);\n    static void         appendSignature(PySideSignal*, char*);\n    static void         instanceInitialize(PySideSignalInstance*, PyObject*, PySideSignal*, PyObject*, int);\n    static char*        parseSignature(PyObject*);\n    static PyObject*    buildQtCompatible(const char*);\n}\n}\n\nextern \"C\"\n{\n\n// Signal methods\nstatic int signalTpInit(PyObject*, PyObject*, PyObject*);\nstatic void signalFree(void*);\nstatic void signalInstanceFree(void*);\nstatic PyObject* signalGetItem(PyObject* self, PyObject* key);\nstatic PyObject* signalToString(PyObject* self);\n\n// Signal Instance methods\nstatic PyObject* signalInstanceConnect(PyObject*, PyObject*, PyObject*);\nstatic PyObject* signalInstanceDisconnect(PyObject*, PyObject*);\nstatic PyObject* signalInstanceEmit(PyObject*, PyObject*);\nstatic PyObject* signalInstanceGetItem(PyObject*, PyObject*);\n\nstatic PyObject* signalInstanceCall(PyObject* self, PyObject* args, PyObject* kw);\nstatic PyObject* signalCall(PyObject*, PyObject*, PyObject*);\n\nstatic PyObject* metaSignalCheck(PyObject*, PyObject*);\n\nstatic PyMappingMethods Signal_as_mapping = {\n    0,\n    signalGetItem,\n    0\n};\n\nstatic PyMethodDef Signal_methods[] = {\n    {\"__instancecheck__\", (PyCFunction)metaSignalCheck, METH_O, NULL},\n    {0}\n};\n\nPyTypeObject PySideSignalMetaType = {\n    PyVarObject_HEAD_INIT(0, 0)\n    /*tp_name*/             \"PySide.QtCore.MetaSignal\",\n    /*tp_basicsize*/        sizeof(PyTypeObject),\n    /*tp_itemsize*/         0,\n    /*tp_dealloc*/          0,\n    /*tp_print*/            0,\n    /*tp_getattr*/          0,\n    /*tp_setattr*/          0,\n    /*tp_compare*/          0,\n    /*tp_repr*/             0,\n    /*tp_as_number*/        0,\n    /*tp_as_sequence*/      0,\n    /*tp_as_mapping*/       0,\n    /*tp_hash*/             0,\n    /*tp_call*/             0,\n    /*tp_str*/              0,\n    /*tp_getattro*/         0,\n    /*tp_setattro*/         0,\n    /*tp_as_buffer*/        0,\n    /*tp_flags*/            Py_TPFLAGS_DEFAULT,\n    /*tp_doc*/              0,\n    /*tp_traverse*/         0,\n    /*tp_clear*/            0,\n    /*tp_richcompare*/      0,\n    /*tp_weaklistoffset*/   0,\n    /*tp_iter*/             0,\n    /*tp_iternext*/         0,\n    /*tp_methods*/          Signal_methods,\n    /*tp_members*/          0,\n    /*tp_getset*/           0,\n    /*tp_base*/             &PyType_Type,\n};\n\nPyTypeObject PySideSignalType = {\n    PyVarObject_HEAD_INIT(&PySideSignalMetaType, 0)\n    /*tp_name*/             \"PySide.QtCore.\" SIGNAL_CLASS_NAME,\n    /*tp_basicsize*/        sizeof(PySideSignal),\n    /*tp_itemsize*/         0,\n    /*tp_dealloc*/          0,\n    /*tp_print*/            0,\n    /*tp_getattr*/          0,\n    /*tp_setattr*/          0,\n    /*tp_compare*/          0,\n    /*tp_repr*/             0,\n    /*tp_as_number*/        0,\n    /*tp_as_sequence*/      0,\n    /*tp_as_mapping*/       &Signal_as_mapping,\n    /*tp_hash*/             0,\n    /*tp_call*/             signalCall,\n    /*tp_str*/              signalToString,\n    /*tp_getattro*/         0,\n    /*tp_setattro*/         0,\n    /*tp_as_buffer*/        0,\n    /*tp_flags*/            Py_TPFLAGS_DEFAULT,\n    /*tp_doc*/              SIGNAL_CLASS_NAME,\n    /*tp_traverse*/         0,\n    /*tp_clear*/            0,\n    /*tp_richcompare*/      0,\n    /*tp_weaklistoffset*/   0,\n    /*tp_iter*/             0,\n    /*tp_iternext*/         0,\n    /*tp_methods*/          0,\n    /*tp_members*/          0,\n    /*tp_getset*/           0,\n    /*tp_base*/             0,\n    /*tp_dict*/             0,\n    /*tp_descr_get*/        0,\n    /*tp_descr_set*/        0,\n    /*tp_dictoffset*/       0,\n    /*tp_init*/             signalTpInit,\n    /*tp_alloc*/            0,\n    /*tp_new*/              PyType_GenericNew,\n    /*tp_free*/             signalFree,\n    /*tp_is_gc*/            0,\n    /*tp_bases*/            0,\n    /*tp_mro*/              0,\n    /*tp_cache*/            0,\n    /*tp_subclasses*/       0,\n    /*tp_weaklist*/         0,\n    /*tp_del*/              0,\n};\n\nstatic PyMethodDef SignalInstance_methods[] = {\n    {\"connect\", (PyCFunction)signalInstanceConnect, METH_VARARGS|METH_KEYWORDS, 0},\n    {\"disconnect\", signalInstanceDisconnect, METH_VARARGS, 0},\n    {\"emit\", signalInstanceEmit, METH_VARARGS, 0},\n    {0}  /* Sentinel */\n};\n\nstatic PyMappingMethods SignalInstance_as_mapping = {\n    0,\n    signalInstanceGetItem,\n    0\n};\n\nPyTypeObject PySideSignalInstanceType = {\n    PyVarObject_HEAD_INIT(0, 0)\n    /*tp_name*/             \"PySide.QtCore.\" SIGNAL_INSTANCE_NAME,\n    /*tp_basicsize*/        sizeof(PySideSignalInstance),\n    /*tp_itemsize*/         0,\n    /*tp_dealloc*/          0,\n    /*tp_print*/            0,\n    /*tp_getattr*/          0,\n    /*tp_setattr*/          0,\n    /*tp_compare*/          0,\n    /*tp_repr*/             0,\n    /*tp_as_number*/        0,\n    /*tp_as_sequence*/      0,\n    /*tp_as_mapping*/       &SignalInstance_as_mapping,\n    /*tp_hash*/             0,\n    /*tp_call*/             signalInstanceCall,\n    /*tp_str*/              0,\n    /*tp_getattro*/         0,\n    /*tp_setattro*/         0,\n    /*tp_as_buffer*/        0,\n    /*tp_flags*/            Py_TPFLAGS_DEFAULT,\n    /*tp_doc*/              SIGNAL_INSTANCE_NAME,\n    /*tp_traverse*/         0,\n    /*tp_clear*/            0,\n    /*tp_richcompare*/      0,\n    /*tp_weaklistoffset*/   0,\n    /*tp_iter*/             0,\n    /*tp_iternext*/         0,\n    /*tp_methods*/          SignalInstance_methods,\n    /*tp_members*/          0,\n    /*tp_getset*/           0,\n    /*tp_base*/             0,\n    /*tp_dict*/             0,\n    /*tp_descr_get*/        0,\n    /*tp_descr_set*/        0,\n    /*tp_dictoffset*/       0,\n    /*tp_init*/             0,\n    /*tp_alloc*/            0,\n    /*tp_new*/              PyType_GenericNew,\n    /*tp_free*/             signalInstanceFree,\n    /*tp_is_gc*/            0,\n    /*tp_bases*/            0,\n    /*tp_mro*/              0,\n    /*tp_cache*/            0,\n    /*tp_subclasses*/       0,\n    /*tp_weaklist*/         0,\n    /*tp_del*/              0,\n};\n\nint signalTpInit(PyObject* self, PyObject* args, PyObject* kwds)\n{\n    static PyObject* emptyTuple = 0;\n    static const char* kwlist[] = {\"name\", 0};\n    char* argName = 0;\n\n    if (emptyTuple == 0)\n        emptyTuple = PyTuple_New(0);\n\n    if (!PyArg_ParseTupleAndKeywords(emptyTuple, kwds,\n        \"|s:QtCore.\" SIGNAL_CLASS_NAME, const_cast<char**>(kwlist), &argName))\n        return 0;\n\n    bool tupledArgs = false;\n    PySideSignal* data = reinterpret_cast<PySideSignal*>(self);\n    if (argName) {\n        data->signalName = strdup(argName);\n    }\n\n    for (Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) {\n        PyObject* arg = PyTuple_GET_ITEM(args, i);\n        if (PySequence_Check(arg) && !Shiboken::String::check(arg)) {\n            tupledArgs = true;\n            PySide::Signal::appendSignature(data, PySide::Signal::parseSignature(arg));\n        }\n    }\n\n    if (!tupledArgs)\n        PySide::Signal::appendSignature(data, PySide::Signal::parseSignature(args));\n\n    return 1;\n}\n\nvoid signalFree(void* self)\n{\n    PyObject* pySelf = reinterpret_cast<PyObject*>(self);\n    PySideSignal* data = reinterpret_cast<PySideSignal*>(self);\n\n    for (int i = 0, i_max = data->signaturesSize; i < i_max; i++) {\n        if (data->signatures[i])\n            free(data->signatures[i]);\n    }\n\n    free(data->signatures);\n    free(data->signalName);\n    data->initialized = 0;\n    data->signaturesSize = 0;\n    Py_XDECREF(data->homonymousMethod);\n    data->homonymousMethod = 0;\n\n    pySelf->ob_type->tp_base->tp_free(self);\n}\n\nPyObject* signalGetItem(PyObject* self, PyObject* key)\n{\n    PySideSignal* data = reinterpret_cast<PySideSignal*>(self);\n    char* sigKey;\n    if (key) {\n        sigKey = PySide::Signal::parseSignature(key);\n    } else {\n        if (data->signatures[0])\n            sigKey = strdup(data->signatures[0]);\n        else\n            sigKey = strdup(\"void\");\n    }\n    char* sig = PySide::Signal::buildSignature(data->signalName, sigKey);\n    free(sigKey);\n    PyObject* pySignature = Shiboken::String::fromCString(sig);\n    free(sig);\n    return pySignature;\n}\n\n\nPyObject* signalToString(PyObject* self)\n{\n    return signalGetItem(self, 0);\n}\n\nvoid signalInstanceFree(void* self)\n{\n    PyObject* pySelf = reinterpret_cast<PyObject*>(self);\n    PySideSignalInstance* data = reinterpret_cast<PySideSignalInstance*>(self);\n\n    PySideSignalInstancePrivate* dataPvt = data->d;\n    free(dataPvt->signalName);\n    free(dataPvt->signature);\n\n    Py_XDECREF(dataPvt->homonymousMethod);\n\n    if (dataPvt->next) {\n        Py_DECREF(dataPvt->next);\n        dataPvt->next = 0;\n    }\n    delete dataPvt;\n    data->d = 0;\n    pySelf->ob_type->tp_base->tp_free(self);\n}\n\nPyObject* signalInstanceConnect(PyObject* self, PyObject* args, PyObject* kwds)\n{\n    PyObject* slot = 0;\n    PyObject* type = 0;\n    static const char* kwlist[] = {\"slot\", \"type\", 0};\n\n    if (!PyArg_ParseTupleAndKeywords(args, kwds,\n        \"O|O:\" SIGNAL_INSTANCE_NAME, const_cast<char**>(kwlist), &slot, &type))\n        return 0;\n\n    PySideSignalInstance* source = reinterpret_cast<PySideSignalInstance*>(self);\n    Shiboken::AutoDecRef pyArgs(PyList_New(0));\n\n    bool match = false;\n    if (slot->ob_type == &PySideSignalInstanceType) {\n        PySideSignalInstance* sourceWalk = source;\n        PySideSignalInstance* targetWalk;\n\n        //find best match\n        while (sourceWalk && !match) {\n            targetWalk = reinterpret_cast<PySideSignalInstance*>(slot);\n            while (targetWalk && !match) {\n                if (QMetaObject::checkConnectArgs(sourceWalk->d->signature, targetWalk->d->signature)) {\n                    PyList_Append(pyArgs, sourceWalk->d->source);\n                    Shiboken::AutoDecRef sourceSignature(PySide::Signal::buildQtCompatible(sourceWalk->d->signature));\n                    PyList_Append(pyArgs, sourceSignature);\n\n                    PyList_Append(pyArgs, targetWalk->d->source);\n                    Shiboken::AutoDecRef targetSignature(PySide::Signal::buildQtCompatible(targetWalk->d->signature));\n                    PyList_Append(pyArgs, targetSignature);\n\n                    match = true;\n                }\n                targetWalk = reinterpret_cast<PySideSignalInstance*>(targetWalk->d->next);\n            }\n            sourceWalk = reinterpret_cast<PySideSignalInstance*>(sourceWalk->d->next);\n        }\n    } else {\n        //try the first signature\n        PyList_Append(pyArgs, source->d->source);\n        Shiboken::AutoDecRef signature(PySide::Signal::buildQtCompatible(source->d->signature));\n        PyList_Append(pyArgs, signature);\n\n        PyList_Append(pyArgs, slot);\n        match = true;\n    }\n\n    if (type)\n        PyList_Append(pyArgs, type);\n\n    if (match) {\n        Shiboken::AutoDecRef tupleArgs(PyList_AsTuple(pyArgs));\n        Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(source->d->source, \"connect\"));\n        PyObject* result = PyObject_CallObject(pyMethod, tupleArgs);\n        if (result == Py_True)\n            return result;\n        else\n            Py_XDECREF(result);\n    }\n    if (!PyErr_Occurred())\n        PyErr_Format(PyExc_RuntimeError, \"Failed to connect signal %s.\", source->d->signature);\n    return 0;\n}\n\nPyObject* signalInstanceEmit(PyObject* self, PyObject* args)\n{\n    PySideSignalInstance* source = reinterpret_cast<PySideSignalInstance*>(self);\n\n    Shiboken::AutoDecRef pyArgs(PyList_New(0));\n    Shiboken::AutoDecRef sourceSignature(PySide::Signal::buildQtCompatible(source->d->signature));\n\n    PyList_Append(pyArgs, sourceSignature);\n    for (Py_ssize_t i = 0, max = PyTuple_Size(args); i < max; i++)\n        PyList_Append(pyArgs, PyTuple_GetItem(args, i));\n\n    Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(source->d->source, \"emit\"));\n\n    Shiboken::AutoDecRef tupleArgs(PyList_AsTuple(pyArgs));\n    return PyObject_CallObject(pyMethod, tupleArgs);\n}\n\nPyObject* signalInstanceGetItem(PyObject* self, PyObject* key)\n{\n    PySideSignalInstance* data = reinterpret_cast<PySideSignalInstance*>(self);\n    char* sigKey = PySide::Signal::parseSignature(key);\n    char* sig = PySide::Signal::buildSignature(data->d->signalName, sigKey);\n    free(sigKey);\n    const char* sigName = data->d->signalName;\n\n    while (data) {\n        if (strcmp(data->d->signature, sig) == 0) {\n            free(sig);\n            PyObject* result = reinterpret_cast<PyObject*>(data);\n            Py_INCREF(result);\n            return result;\n        }\n        data = reinterpret_cast<PySideSignalInstance*>(data->d->next);\n    }\n\n    PyErr_Format(PyExc_IndexError, \"Signature %s not found for signal: %s\", sig, sigName);\n    free(sig);\n    return 0;\n}\n\nPyObject* signalInstanceDisconnect(PyObject* self, PyObject* args)\n{\n    PySideSignalInstance* source = reinterpret_cast<PySideSignalInstance*>(self);\n    Shiboken::AutoDecRef pyArgs(PyList_New(0));\n\n    PyObject* slot;\n    if (PyTuple_Check(args) && PyTuple_GET_SIZE(args))\n        slot = PyTuple_GET_ITEM(args, 0);\n    else\n        slot = Py_None;\n\n    bool match = false;\n    if (slot->ob_type == &PySideSignalInstanceType) {\n        PySideSignalInstance* target = reinterpret_cast<PySideSignalInstance*>(slot);\n        if (QMetaObject::checkConnectArgs(source->d->signature, target->d->signature)) {\n            PyList_Append(pyArgs, source->d->source);\n            Shiboken::AutoDecRef source_signature(PySide::Signal::buildQtCompatible(source->d->signature));\n            PyList_Append(pyArgs, source_signature);\n\n            PyList_Append(pyArgs, target->d->source);\n            Shiboken::AutoDecRef target_signature(PySide::Signal::buildQtCompatible(target->d->signature));\n            PyList_Append(pyArgs, target_signature);\n            match = true;\n        }\n    } else {\n        //try the first signature\n        PyList_Append(pyArgs, source->d->source);\n        Shiboken::AutoDecRef signature(PySide::Signal::buildQtCompatible(source->d->signature));\n        PyList_Append(pyArgs, signature);\n\n        // disconnect all, so we need to use the c++ signature disconnect(qobj, signal, 0, 0)\n        if (slot == Py_None)\n            PyList_Append(pyArgs, slot);\n        PyList_Append(pyArgs, slot);\n        match = true;\n    }\n\n    if (match) {\n        Shiboken::AutoDecRef tupleArgs(PyList_AsTuple(pyArgs));\n        Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(source->d->source, \"disconnect\"));\n        PyObject* result = PyObject_CallObject(pyMethod, tupleArgs);\n        if (result == Py_True)\n            return result;\n        else\n            Py_DECREF(result);\n    }\n\n    PyErr_Format(PyExc_RuntimeError, \"Failed to disconnect signal %s.\", source->d->signature);\n    return 0;\n}\n\nPyObject* signalCall(PyObject* self, PyObject* args, PyObject* kw)\n{\n    PySideSignal* signal = reinterpret_cast<PySideSignal*>(self);\n\n    if (!signal->homonymousMethod) {\n        PyErr_SetString(PyExc_TypeError, \"native Qt signal is not callable\");\n        return 0;\n    }\n\n    descrgetfunc getDescriptor = signal->homonymousMethod->ob_type->tp_descr_get;\n    Shiboken::AutoDecRef homonymousMethod(getDescriptor(signal->homonymousMethod, 0, 0));\n\n    if (PyCFunction_GET_FLAGS(homonymousMethod.object()) & METH_STATIC)\n        return PyCFunction_Call(homonymousMethod, args, kw);\n\n    ternaryfunc callFunc = signal->homonymousMethod->ob_type->tp_call;\n    return callFunc(homonymousMethod, args, kw);\n}\n\nPyObject* signalInstanceCall(PyObject* self, PyObject* args, PyObject* kw)\n{\n    PySideSignalInstance* PySideSignal = reinterpret_cast<PySideSignalInstance*>(self);\n    if (!PySideSignal->d->homonymousMethod) {\n        PyErr_SetString(PyExc_TypeError, \"native Qt signal is not callable\");\n        return 0;\n    }\n\n    descrgetfunc getDescriptor = PySideSignal->d->homonymousMethod->ob_type->tp_descr_get;\n    Shiboken::AutoDecRef homonymousMethod(getDescriptor(PySideSignal->d->homonymousMethod, PySideSignal->d->source, 0));\n    return PyCFunction_Call(homonymousMethod, args, kw);\n}\n\nstatic PyObject* metaSignalCheck(PyObject* klass, PyObject* args)\n{\n    if (PyType_IsSubtype(args->ob_type, &PySideSignalInstanceType))\n        Py_RETURN_TRUE;\n    else\n        Py_RETURN_FALSE;\n}\n\n} // extern \"C\"\n\nnamespace PySide {\nnamespace Signal {\n\nvoid init(PyObject* module)\n{\n    if (PyType_Ready(&PySideSignalMetaType) < 0)\n        return;\n\n    if (PyType_Ready(&PySideSignalType) < 0)\n        return;\n\n    Py_INCREF(&PySideSignalType);\n    PyModule_AddObject(module, SIGNAL_CLASS_NAME, ((PyObject*)&PySideSignalType));\n\n    if (PyType_Ready(&PySideSignalInstanceType) < 0)\n        return;\n\n    Py_INCREF(&PySideSignalInstanceType);\n}\n\nbool checkType(PyObject* pyObj)\n{\n    if (pyObj)\n        return PyType_IsSubtype(pyObj->ob_type, &PySideSignalType);\n    return false;\n}\n\nvoid updateSourceObject(PyObject* source)\n{\n    PyTypeObject* objType = reinterpret_cast<PyTypeObject*>(PyObject_Type(source));\n\n    Py_ssize_t pos = 0;\n    PyObject* value;\n    PyObject* key;\n\n    while (PyDict_Next(objType->tp_dict, &pos, &key, &value)) {\n        if (PyObject_TypeCheck(value, &PySideSignalType)) {\n            Shiboken::AutoDecRef signalInstance((PyObject*)PyObject_New(PySideSignalInstance, &PySideSignalInstanceType));\n            instanceInitialize(signalInstance.cast<PySideSignalInstance*>(), key, reinterpret_cast<PySideSignal*>(value), source, 0);\n            PyObject_SetAttr(source, key, signalInstance);\n        }\n    }\n\n    Py_XDECREF(objType);\n}\n\nchar* getTypeName(PyObject* type)\n{\n    if (PyType_Check(type)) {\n        char* typeName = NULL;\n        if (PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(type), reinterpret_cast<PyTypeObject*>(&SbkObject_Type))) {\n            SbkObjectType* objType = reinterpret_cast<SbkObjectType*>(type);\n            typeName = strdup(Shiboken::ObjectType::getOriginalName(objType));\n        } else {\n            // Translate python types to Qt names\n            PyTypeObject* objType = reinterpret_cast<PyTypeObject*>(type);\n            if (Shiboken::String::checkType(objType))\n                typeName = strdup(\"QString\");\n            else if (objType == &PyInt_Type)\n                typeName = strdup(\"int\");\n            else if (objType == &PyLong_Type)\n                typeName = strdup(\"long\");\n            else if (objType == &PyFloat_Type)\n                typeName = strdup(\"double\");\n            else if (objType == &PyBool_Type)\n                typeName = strdup(\"bool\");\n            else if (Py_TYPE(objType) == &SbkEnumType_Type)\n                typeName = strdup(Shiboken::Enum::getCppName(objType));\n            else\n                typeName = strdup(\"PyObject\");\n        }\n        return typeName;\n    } else if (type == Py_None) { // Must be checked before as Shiboken::String::check accepts Py_None\n        return strdup(\"void\");\n    } else if (Shiboken::String::check(type)) {\n        return strdup(Shiboken::String::toCString(type));\n    }\n    return 0;\n}\n\nchar* buildSignature(const char* name, const char* signature)\n{\n    QByteArray signal(name);\n    signal += '(';\n    signal += signature;\n    signal += ')';\n    return strdup(QMetaObject::normalizedSignature(signal));\n}\n\nchar* parseSignature(PyObject* args)\n{\n    char* signature = 0;\n    if (args && (Shiboken::String::check(args) || !PySequence_Check(args)))\n        return getTypeName(args);\n\n    for (Py_ssize_t i = 0, i_max = PySequence_Size(args); i < i_max; i++) {\n        Shiboken::AutoDecRef arg(PySequence_ITEM(args, i));\n        char* typeName = getTypeName(arg);\n        if (typeName) {\n            if (signature) {\n                signature = reinterpret_cast<char*>(realloc(signature, (strlen(signature) + 1 + strlen(typeName)) * sizeof(char*)));\n                signature = strcat(signature, \",\");\n                signature = strcat(signature, typeName);\n                free(typeName);\n            } else {\n                signature = typeName;\n            }\n        }\n    }\n    return signature;\n}\n\nvoid appendSignature(PySideSignal* self, char* signature)\n{\n    self->signaturesSize++;\n\n    if (self->signaturesSize > 1) {\n        self->signatures = reinterpret_cast<char**>(realloc(self->signatures, sizeof(char**) * self->signaturesSize));\n    } else {\n        self->signatures = reinterpret_cast<char**>(malloc(sizeof(char**)));\n    }\n    self->signatures[self->signaturesSize - 1] = signature;\n}\n\nPySideSignalInstance* initialize(PySideSignal* self, PyObject* name, PyObject* object)\n{\n    PySideSignalInstance* instance = PyObject_New(PySideSignalInstance, &PySideSignalInstanceType);\n    instanceInitialize(instance, name, self, object, 0);\n    return instance;\n}\n\nvoid instanceInitialize(PySideSignalInstance* self, PyObject* name, PySideSignal* data, PyObject* source, int index)\n{\n    self->d = new PySideSignalInstancePrivate;\n    PySideSignalInstancePrivate* selfPvt = self->d;\n    selfPvt->next = 0;\n    if (data->signalName)\n        selfPvt->signalName = strdup(data->signalName);\n    else {\n        selfPvt->signalName = strdup(Shiboken::String::toCString(name));\n        data->signalName = strdup(selfPvt->signalName);\n    }\n\n    selfPvt->source = source;\n    selfPvt->signature = buildSignature(self->d->signalName, data->signatures[index]);\n    selfPvt->homonymousMethod = 0;\n    if (data->homonymousMethod) {\n        selfPvt->homonymousMethod = data->homonymousMethod;\n        Py_INCREF(selfPvt->homonymousMethod);\n    }\n    index++;\n\n    if (index < data->signaturesSize) {\n        selfPvt->next = PyObject_New(PySideSignalInstance, &PySideSignalInstanceType);\n        instanceInitialize(selfPvt->next, name, data, source, index);\n    }\n}\n\nbool connect(PyObject* source, const char* signal, PyObject* callback)\n{\n    Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(source, \"connect\"));\n    if (pyMethod.isNull())\n        return false;\n\n    Shiboken::AutoDecRef pySignature(Shiboken::String::fromCString(signal));\n    Shiboken::AutoDecRef pyArgs(PyTuple_Pack(3, source, pySignature.object(), callback));\n    PyObject* result =  PyObject_CallObject(pyMethod, pyArgs);\n    if (result == Py_False) {\n        PyErr_Format(PyExc_RuntimeError, \"Failed to connect signal %s, to python callable object.\", signal);\n        Py_DECREF(result);\n        result = 0;\n    }\n    return result;\n}\n\nPySideSignalInstance* newObjectFromMethod(PyObject* source, const QList<QMetaMethod>& methodList)\n{\n    PySideSignalInstance* root = 0;\n    PySideSignalInstance* previous = 0;\n    foreach(QMetaMethod m, methodList) {\n        PySideSignalInstance* item = PyObject_New(PySideSignalInstance, &PySideSignalInstanceType);\n        if (!root)\n            root = item;\n\n        if (previous)\n            previous->d->next = item;\n\n        item->d = new PySideSignalInstancePrivate;\n        PySideSignalInstancePrivate* selfPvt = item->d;\n        selfPvt->source = source;\n        QByteArray cppName(m.signature());\n        cppName = cppName.mid(0, cppName.indexOf('('));\n        // separe SignalName\n        selfPvt->signalName = strdup(cppName.data());\n        selfPvt->signature = strdup(m.signature());\n        selfPvt->homonymousMethod = 0;\n        selfPvt->next = 0;\n    }\n    return root;\n}\n\nPySideSignal* newObject(const char* name, ...)\n{\n    va_list listSignatures;\n    char* sig = 0;\n    PySideSignal* self = PyObject_New(PySideSignal, &PySideSignalType);\n    self->signalName = strdup(name);\n    self->signaturesSize = 0;\n    self->signatures = 0;\n    self->initialized = 0;\n    self->homonymousMethod = 0;\n\n    va_start(listSignatures, name);\n    sig = va_arg(listSignatures, char*);\n\n    while (sig != NULL) {\n        if (strcmp(sig, \"void\") == 0)\n            appendSignature(self, strdup(\"\"));\n        else\n            appendSignature(self, strdup(sig));\n\n        sig = va_arg(listSignatures, char*);\n    }\n\n    va_end(listSignatures);\n\n    return self;\n}\n\ntemplate<typename T>\nstatic typename T::value_type join(T t, const char* sep)\n{\n    typename T::value_type res;\n    if (!t.size())\n        return res;\n\n    typename T::const_iterator it = t.begin();\n    typename T::const_iterator end = t.end();\n    res += *it;\n    ++it;\n\n    while (it != end) {\n        res += sep;\n        res += *it;\n        ++it;\n    }\n    return res;\n}\n\nstatic void _addSignalToWrapper(SbkObjectType* wrapperType, const char* signalName, PySideSignal* signal)\n{\n    PyObject* typeDict = wrapperType->super.ht_type.tp_dict;\n    PyObject* homonymousMethod;\n    if ((homonymousMethod = PyDict_GetItemString(typeDict, signalName))) {\n        Py_INCREF(homonymousMethod);\n        signal->homonymousMethod = homonymousMethod;\n    }\n    PyDict_SetItemString(typeDict, signalName, reinterpret_cast<PyObject*>(signal));\n}\n\n// This function is used by qStableSort to promote empty signatures\nstatic bool compareSignals(const QByteArray& sig1, const QByteArray& sig2)\n{\n    return sig1.isEmpty();\n}\n\nvoid registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)\n{\n    typedef QHash<QByteArray, QList<QByteArray> > SignalSigMap;\n    SignalSigMap signalsFound;\n    for (int i = metaObject->methodOffset(), max = metaObject->methodCount(); i < max; ++i) {\n        QMetaMethod method = metaObject->method(i);\n\n        if (method.methodType() == QMetaMethod::Signal) {\n            QByteArray methodName(method.signature());\n            methodName.chop(methodName.size() - methodName.indexOf('('));\n            signalsFound[methodName] << join(method.parameterTypes(), \",\");\n        }\n    }\n\n    SignalSigMap::Iterator it = signalsFound.begin();\n    SignalSigMap::Iterator end = signalsFound.end();\n    for (; it != end; ++it) {\n        PySideSignal* self = PyObject_New(PySideSignal, &PySideSignalType);\n        self->signalName = strdup(it.key().constData());\n        self->signaturesSize = 0;\n        self->signatures = 0;\n        self->initialized = 0;\n        self->homonymousMethod = 0;\n\n        // Empty signatures comes first! So they will be the default signal signature\n        qStableSort(it.value().begin(), it.value().end(), &compareSignals);\n        SignalSigMap::mapped_type::const_iterator j = it.value().begin();\n        SignalSigMap::mapped_type::const_iterator endJ = it.value().end();\n        for (; j != endJ; ++j)\n            appendSignature(self, strdup(j->constData()));\n\n        _addSignalToWrapper(pyObj, it.key(), self);\n        Py_DECREF((PyObject*) self);\n    }\n}\n\nPyObject* buildQtCompatible(const char* signature)\n{\n    QByteArray ba;\n    ba.append(QT_SIGNAL_SENTINEL);\n    ba.append(signature);\n    return Shiboken::String::fromStringAndSize(ba, ba.size());\n}\n\nvoid addSignalToWrapper(SbkObjectType* wrapperType, const char* signalName, PySideSignal* signal)\n{\n    _addSignalToWrapper(wrapperType, signalName, signal);\n}\n\nPyObject* getObject(PySideSignalInstance* signal)\n{\n    return signal->d->source;\n}\n\nconst char* getSignature(PySideSignalInstance* signal)\n{\n    return signal->d->signature;\n}\n\nconst char** getSignatures(PyObject* signal, int* size)\n{\n    PySideSignal* self = reinterpret_cast<PySideSignal*>(signal);\n    *size = self->signaturesSize;\n    return const_cast<const char**>(self->signatures);\n}\n\nQStringList getArgsFromSignature(const char* signature, bool* isShortCircuit)\n{\n    QString qsignature(signature);\n    QStringList result;\n    QRegExp splitRegex(\"\\\\s*,\\\\s*\");\n\n    if (isShortCircuit)\n        *isShortCircuit = !qsignature.contains('(');\n    if (qsignature.contains(\"()\") || qsignature.contains(\"(void)\")) {\n        return result;\n    } else if (qsignature.contains('(')) {\n        static QRegExp regex(\".+\\\\((.*)\\\\)\");\n        //get args types\n        QString types = qsignature.replace(regex, \"\\\\1\");\n        result = types.split(splitRegex);\n    }\n    return result;\n}\n\nQString getCallbackSignature(const char* signal, QObject* receiver, PyObject* callback, bool encodeName)\n{\n    QByteArray functionName;\n    QByteArray signature;\n    QStringList args;\n    int numArgs = -1;\n    bool useSelf = false;\n    bool isMethod = PyMethod_Check(callback);\n    bool isFunction = PyFunction_Check(callback);\n\n    if (isMethod || isFunction) {\n        PyObject* function = isMethod ? PyMethod_GET_FUNCTION(callback) : callback;\n        PyCodeObject* objCode = reinterpret_cast<PyCodeObject*>(PyFunction_GET_CODE(function));\n        functionName = Shiboken::String::toCString(reinterpret_cast<PyFunctionObject*>(function)->func_name);\n        useSelf = isMethod;\n        numArgs = objCode->co_flags & CO_VARARGS ? -1 : objCode->co_argcount;\n    } else if (PyCFunction_Check(callback)) {\n        functionName = ((PyCFunctionObject*)callback)->m_ml->ml_name;\n        useSelf = ((PyCFunctionObject*)callback)->m_self;\n        int flags = ((PyCFunctionObject*)callback)->m_ml->ml_flags;\n\n        if (receiver) {\n            //Search for signature on metaobject\n            const QMetaObject* mo = receiver->metaObject();\n            QByteArray prefix(functionName);\n            prefix += '(';\n            for (int i = 0; i < mo->methodCount(); i++) {\n                QMetaMethod me = mo->method(i);\n                if ((strncmp(me.signature(), prefix, prefix.size()) == 0) &&\n                    QMetaObject::checkConnectArgs(signal, me.signature())) {\n                    numArgs = me.parameterTypes().size() + useSelf;\n                    break;\n                }\n           }\n        }\n\n        if (numArgs == -1) {\n            if (flags & METH_VARARGS)\n                numArgs = -1;\n            else if (flags & METH_NOARGS)\n                numArgs = 0;\n        }\n    } else if (PyCallable_Check(callback)) {\n        functionName = \"__callback\" + QByteArray::number((qlonglong)callback);\n    }\n\n    Q_ASSERT(!functionName.isEmpty());\n\n    bool isShortCircuit = false;\n\n    if (encodeName)\n        signature = qPrintable(codeCallbackName(callback, functionName));\n    else\n        signature = functionName;\n\n    args = getArgsFromSignature(signal, &isShortCircuit);\n\n    if (!isShortCircuit) {\n        signature.append('(');\n        if (numArgs == -1)\n            numArgs = std::numeric_limits<int>::max();\n        while (args.count() && (args.count() > (numArgs - useSelf))) {\n            args.removeLast();\n        }\n        signature.append(args.join(\",\"));\n        signature.append(')');\n    }\n    return signature;\n}\n\nbool isQtSignal(const char* signal)\n{\n    return (signal && signal[0] == QT_SIGNAL_SENTINEL);\n}\n\nbool checkQtSignal(const char* signal)\n{\n    if (!isQtSignal(signal)) {\n        PyErr_SetString(PyExc_TypeError, \"Use the function PySide.QtCore.SIGNAL on signals\");\n        return false;\n    }\n    return true;\n}\n\nQString codeCallbackName(PyObject* callback, const QString& funcName)\n{\n    if (PyMethod_Check(callback)) {\n        PyObject* self = PyMethod_GET_SELF(callback);\n        PyObject* func = PyMethod_GET_FUNCTION(callback);\n        return funcName + QString::number(quint64(self), 16) + QString::number(quint64(func), 16);\n    } else {\n        return funcName + QString::number(quint64(callback), 16);\n    }\n}\n\n} //namespace Signal\n} //namespace PySide\n\n"
  },
  {
    "path": "libpyside/pysidesignal.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_SIGNAL_H\n#define PYSIDE_SIGNAL_H\n\n#include <QObject>\n#include <QString>\n#include <QStringList>\n\n#include <pysidemacros.h>\n#include <sbkpython.h>\n#include <basewrapper.h>\n\nextern \"C\"\n{\n    extern PYSIDE_API PyTypeObject PySideSignalType;\n    extern PYSIDE_API PyTypeObject PySideSignalInstanceType;\n\n    // Internal object\n    struct PYSIDE_API PySideSignal;\n\n    struct PySideSignalInstancePrivate;\n    struct PYSIDE_API PySideSignalInstance\n    {\n        PyObject_HEAD\n        PySideSignalInstancePrivate* d;\n    };\n}; // extern \"C\"\n\nnamespace PySide {\nnamespace Signal {\n\nPYSIDE_API bool checkType(PyObject* type);\n\n/**\n * This function creates a Signal object which stays attached to QObject class\n *\n * @param   name of the Signal to be registered on meta object\n * @param   signatures a list of signatures supported by this signal, ended with a NULL pointer\n * @return  Return a new reference to PyObject* of type  PySideSignal\n * @deprecated Use registerSignals\n **/\nPYSIDE_DEPRECATED(PYSIDE_API PySideSignal* newObject(const char* name, ...));\n\n/**\n * Register all C++ signals of a QObject on Python type.\n */\nPYSIDE_API void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject);\n\n/**\n * This function creates a Signal object which stays attached to QObject class based on a list of QMetaMethods\n *\n * @param   source of the Signal to be registered on meta object\n * @param   methods a list of QMetaMethod wich contains the supported signature\n * @return  Return a new reference to PyObject* of type  PySideSignal\n **/\nPYSIDE_API PySideSignalInstance* newObjectFromMethod(PyObject* source, const QList<QMetaMethod>& methods);\n\n/**\n * This function initializes the Signal object by creating a PySideSignalInstance\n *\n * @param   self a Signal object used as base to PySideSignalInstance\n * @param   name the name to be used on PySideSignalInstance\n * @param   object the PyObject where the signal will be attached\n * @return  Return a new reference to PySideSignalInstance\n **/\nPYSIDE_API PySideSignalInstance* initialize(PySideSignal* signal, PyObject* name, PyObject* object);\n\n/**\n * This function is used to retrieve the object in which the signal is attached\n *\n * @param   self The Signal object\n * @return  Return the internal reference to the parent object of the signal\n **/\nPYSIDE_API PyObject* getObject(PySideSignalInstance* signal);\n\n/**\n * This function is used to retrieve the signal signature\n *\n * @param   self The Signal object\n * @return  Return the signal signature\n **/\nPYSIDE_API const char* getSignature(PySideSignalInstance* signal);\n\n/**\n * This function is used to retrieve the signal signature\n *\n * @param   self The Signal object\n * @return  Return the signal signature\n **/\nPYSIDE_API void updateSourceObject(PyObject* source);\n\n/**\n * @deprecated Use registerSignals\n **/\nPYSIDE_DEPRECATED(PYSIDE_API void addSignalToWrapper(SbkObjectType* wrapperType, const char* signalName, PySideSignal* signal));\n\n/**\n * This function verifies if the signature is a QtSignal base on SIGNAL flag\n * @param   signature   The signal signature\n * @return  Return true if this is a Qt Signal, otherwise return false\n **/\nPYSIDE_API bool isQtSignal(const char* signature);\n\n/**\n * This function is similar to isQtSignal, however if it fails, it'll raise a Python error instead.\n *\n * @param   signature   The signal signature\n * @return  Return true if this is a Qt Signal, otherwise return false\n **/\nPYSIDE_API bool checkQtSignal(const char* signature);\n\n/**\n * This function is used to retrieve the signature base on Signal and receiver callback\n * @param   signature   The signal signature\n * @param   receiver    The QObject which will receive the signal\n * @param   callback    Callback function which will connect to the signal\n * @param   encodeName  Used to specify if the returned signature will be encoded with Qt signal/slot style\n * @return  Return the callback signature\n **/\nPYSIDE_API QString getCallbackSignature(const char* signal, QObject* receiver, PyObject* callback, bool encodeName);\n\n/**\n * This function parses the signature and then returns a list of argument types.\n *\n * @param   signature       The signal signature\n * @param   isShortCircuit  If this is a shortCircuit(python<->python) signal\n * @return  Return true if this is a Qt Signal, otherwise return false\n * @todo    replace return type by QList<QByteArray>\n **/\nQStringList getArgsFromSignature(const char* signature, bool* isShortCircuit = 0);\n\n} // namespace Signal\n} // namespace PySide\n\n#endif\n"
  },
  {
    "path": "libpyside/pysidesignal_p.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef PYSIDE_QSIGNAL_P_H\n#define PYSIDE_QSIGNAL_P_H\n\n#include <sbkpython.h>\n\nextern \"C\"\n{\n    extern PyTypeObject PySideSignalType;\n\n    struct PySideSignal {\n        PyObject_HEAD\n        bool initialized;\n        char* signalName;\n        char** signatures;\n        int signaturesSize;\n        PyObject* homonymousMethod;\n    };\n\n    struct PySideSignalInstance;\n    struct PySideSignalInstancePrivate {\n        char* signalName;\n        char* signature;\n        PyObject* source;\n        PyObject* homonymousMethod;\n        PySideSignalInstance* next;\n    };\n\n\n}; //extern \"C\"\n\nnamespace PySide { namespace Signal {\n\n    void            init(PyObject* module);\n    bool            connect(PyObject* source, const char* signal, PyObject* callback);\n    char*           getTypeName(PyObject*);\n    const char**    getSignatures(PyObject* self, int *size);\n    QString         codeCallbackName(PyObject* callback, const QString& funcName);\n\n}} //namespace PySide\n\n#endif\n"
  },
  {
    "path": "libpyside/pysideslot.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"dynamicqmetaobject_p.h\"\n#include \"pysidesignal_p.h\"\n#include \"pysideslot_p.h\"\n\n#include <shiboken.h>\n#include <QString>\n#include <QMetaObject>\n\n#define SLOT_DEC_NAME \"Slot\"\n\ntypedef struct\n{\n    PyObject_HEAD\n    char* slotName;\n    char* args;\n    char* resultType;\n} PySideSlot;\n\nextern \"C\"\n{\n\nstatic int slotTpInit(PyObject*, PyObject*, PyObject*);\nstatic PyObject* slotCall(PyObject*, PyObject*, PyObject*);\n\n// Class Definition -----------------------------------------------\nstatic PyTypeObject PySideSlotType = {\n    PyVarObject_HEAD_INIT(0, 0)\n    \"PySide.QtCore.\" SLOT_DEC_NAME, /*tp_name*/\n    sizeof(PySideSlot),        /*tp_basicsize*/\n    0,                         /*tp_itemsize*/\n    0,                         /*tp_dealloc*/\n    0,                         /*tp_print*/\n    0,                         /*tp_getattr*/\n    0,                         /*tp_setattr*/\n    0,                         /*tp_compare*/\n    0,                         /*tp_repr*/\n    0,                         /*tp_as_number*/\n    0,                         /*tp_as_sequence*/\n    0,                         /*tp_as_mapping*/\n    0,                         /*tp_hash */\n    slotCall,                  /*tp_call*/\n    0,                         /*tp_str*/\n    0,                         /*tp_getattro*/\n    0,                         /*tp_setattro*/\n    0,                         /*tp_as_buffer*/\n    Py_TPFLAGS_DEFAULT,        /*tp_flags*/\n    SLOT_DEC_NAME,             /*tp_doc */\n    0,                         /*tp_traverse */\n    0,                         /*tp_clear */\n    0,                         /*tp_richcompare */\n    0,                         /*tp_weaklistoffset */\n    0,                         /*tp_iter */\n    0,                         /*tp_iternext */\n    0,                         /*tp_methods */\n    0,                         /*tp_members */\n    0,                         /*tp_getset */\n    0,                         /*tp_base */\n    0,                         /*tp_dict */\n    0,                         /*tp_descr_get */\n    0,                         /*tp_descr_set */\n    0,                         /*tp_dictoffset */\n    slotTpInit,                /*tp_init */\n    0,                         /*tp_alloc */\n    PyType_GenericNew,         /*tp_new */\n    0,                         /*tp_free */\n    0,                         /*tp_is_gc */\n    0,                         /*tp_bases */\n    0,                         /*tp_mro */\n    0,                         /*tp_cache */\n    0,                         /*tp_subclasses */\n    0,                         /*tp_weaklist */\n    0,                         /*tp_del */\n};\n\nint slotTpInit(PyObject *self, PyObject *args, PyObject *kw)\n{\n    static PyObject *emptyTuple = 0;\n    static const char *kwlist[] = {\"name\", \"result\", 0};\n    char* argName = 0;\n    PyObject* argResult = 0;\n\n    if (emptyTuple == 0)\n        emptyTuple = PyTuple_New(0);\n\n    if (!PyArg_ParseTupleAndKeywords(emptyTuple, kw, \"|sO:QtCore.\" SLOT_DEC_NAME, (char**) kwlist, &argName, &argResult))\n        return 0;\n\n    PySideSlot *data = reinterpret_cast<PySideSlot*>(self);\n    for(Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) {\n        PyObject *argType = PyTuple_GET_ITEM(args, i);\n        char *typeName = PySide::Signal::getTypeName(argType);\n        if (typeName) {\n            if (data->args) {\n                data->args = reinterpret_cast<char*>(realloc(data->args, (strlen(data->args) + 1 + strlen(typeName)) * sizeof(char*)));\n                data->args = strcat(data->args, \",\");\n                data->args = strcat(data->args, typeName);\n                free(typeName);\n            } else {\n                data->args = typeName;\n            }\n        } else {\n            PyErr_Format(PyExc_TypeError, \"Unknown signal argument type: %s\", argType->ob_type->tp_name);\n            return -1;\n        }\n    }\n\n    if (argName)\n        data->slotName = strdup(argName);\n\n    if (argResult)\n        data->resultType = PySide::Signal::getTypeName(argResult);\n    else\n        data->resultType = strdup(\"void\");\n\n    return 1;\n}\n\nPyObject* slotCall(PyObject* self, PyObject* args, PyObject* kw)\n{\n    static PyObject* pySlotName = 0;\n    PyObject* callback;\n    callback = PyTuple_GetItem(args, 0);\n    Py_INCREF(callback);\n\n    if (PyFunction_Check(callback)) {\n        PySideSlot *data = reinterpret_cast<PySideSlot*>(self);\n\n        if (!data->slotName) {\n            PyObject *funcName = reinterpret_cast<PyFunctionObject*>(callback)->func_name;\n            data->slotName = strdup(Shiboken::String::toCString(funcName));\n        }\n\n\n        QByteArray returnType = QMetaObject::normalizedType(data->resultType);\n        QByteArray signature = QString().sprintf(\"%s(%s)\", data->slotName, data->args).toAscii();\n        signature = returnType + \" \" + signature;\n\n        if (!pySlotName)\n            pySlotName = Shiboken::String::fromCString(PYSIDE_SLOT_LIST_ATTR);\n\n        PyObject *pySignature = Shiboken::String::fromCString(signature);\n        PyObject *signatureList = 0;\n        if (PyObject_HasAttr(callback, pySlotName)) {\n            signatureList = PyObject_GetAttr(callback, pySlotName);\n        } else {\n            signatureList = PyList_New(0);\n            PyObject_SetAttr(callback, pySlotName, signatureList);\n            Py_DECREF(signatureList);\n        }\n\n        PyList_Append(signatureList, pySignature);\n        Py_DECREF(pySignature);\n\n        //clear data\n        free(data->slotName);\n        data->slotName = 0;\n        free(data->resultType);\n        data->resultType = 0;\n        free(data->args);\n        data->args = 0;\n        return callback;\n    }\n    return callback;\n}\n\n} // extern \"C\"\n\nnamespace PySide { namespace Slot {\n\nvoid init(PyObject* module)\n{\n    if (PyType_Ready(&PySideSlotType) < 0)\n        return;\n\n    Py_INCREF(&PySideSlotType);\n    PyModule_AddObject(module, SLOT_DEC_NAME, ((PyObject*)&PySideSlotType));\n}\n\n} // namespace Slot\n} // namespace PySide\n"
  },
  {
    "path": "libpyside/pysideslot_p.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n#ifndef PYSIDE_SLOT_P_H\n#define PYSIDE_SLOT_P_H\n\n#include <sbkpython.h>\n#define PYSIDE_SLOT_LIST_ATTR \"_slots\"\n\nnamespace PySide { namespace Slot {\n    void init(PyObject* module);\n}}\n\n#endif\n"
  },
  {
    "path": "libpyside/pysideweakref.cpp",
    "content": "#include \"pysideweakref.h\"\n\n#include <sbkpython.h>\n\ntypedef struct {\n    PyObject_HEAD\n    /* Type-specific fields go here. */\n    PySideWeakRefFunction weakref_func;\n    void*  user_data;\n} PySideCallableObject;\n\nstatic PyObject* CallableObject_call(PyObject* callable_object, PyObject* args, PyObject* kw);\n\nstatic PyTypeObject PySideCallableObjectType = {\n    PyVarObject_HEAD_INIT(0, 0)\n    const_cast<char*>(\"PySide.Callable\"),\n    sizeof(PySideCallableObject),    /*tp_basicsize*/\n    0,                         /*tp_itemsize*/\n    0,                         /*tp_dealloc*/\n    0,                         /*tp_print*/\n    0,                         /*tp_getattr*/\n    0,                         /*tp_setattr*/\n    0,                         /*tp_compare*/\n    0,                         /*tp_repr*/\n    0,                         /*tp_as_number*/\n    0,                         /*tp_as_sequence*/\n    0,                         /*tp_as_mapping*/\n    0,                         /*tp_hash */\n    CallableObject_call,       /*tp_call*/\n    0,                         /*tp_str*/\n    0,                         /*tp_getattro*/\n    0,                         /*tp_setattro*/\n    0,                         /*tp_as_buffer*/\n    Py_TPFLAGS_DEFAULT,        /*tp_flags*/\n    0,                         /* tp_doc */\n};\n\nstatic PyObject* CallableObject_call(PyObject* callable_object, PyObject* args, PyObject* kw)\n{\n    PySideCallableObject* obj = (PySideCallableObject*)(callable_object);\n    obj->weakref_func(obj->user_data);\n\n    Py_XDECREF(PyTuple_GET_ITEM(args, 0)); //kill weak ref object\n    Py_RETURN_NONE;\n}\n\nnamespace PySide { namespace WeakRef {\n\nPyObject* create(PyObject* obj, PySideWeakRefFunction func, void* userData)\n{\n    if (obj == Py_None)\n        return 0;\n\n    if (Py_TYPE(&PySideCallableObjectType) == 0)\n    {\n        Py_TYPE(&PySideCallableObjectType) = &PyType_Type;\n        PyType_Ready(&PySideCallableObjectType);\n    }\n\n    PySideCallableObject* callable = PyObject_New(PySideCallableObject, &PySideCallableObjectType);\n    if (!callable || PyErr_Occurred())\n        return 0;\n\n    PyObject* weak = PyWeakref_NewRef(obj, (PyObject*)callable);\n    if (!weak || PyErr_Occurred())\n        return 0;\n\n    Py_DECREF(callable);\n\n    callable->weakref_func = func;\n    callable->user_data = userData;\n    return (PyObject*)weak;\n}\n\n} }  //namespace\n\n"
  },
  {
    "path": "libpyside/pysideweakref.h",
    "content": "#ifndef __PYSIDEWEAKREF__\n#define __PYSIDEWEAKREF__\n\n#include <pysidemacros.h>\n#include <sbkpython.h>\n\ntypedef void (*PySideWeakRefFunction)(void* userData);\n\nnamespace PySide { namespace WeakRef {\n\nPYSIDE_API PyObject* create(PyObject* ob, PySideWeakRefFunction func, void* userData);\n\n} //PySide\n} //WeakRef\n\n\n#endif\n"
  },
  {
    "path": "libpyside/signalmanager.cpp",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include \"signalmanager.h\"\n#include \"pysidesignal.h\"\n#include \"pysideproperty.h\"\n#include \"pysideproperty_p.h\"\n#include \"pyside.h\"\n#include \"dynamicqmetaobject.h\"\n#include \"pysidemetafunction_p.h\"\n\n#include <QHash>\n#include <QStringList>\n#include <QMetaMethod>\n#include <autodecref.h>\n#include <gilstate.h>\n#include <QDebug>\n#include <limits>\n#include <algorithm>\n#include <typeresolver.h>\n#include <basewrapper.h>\n#include <sbkconverter.h>\n#include <conversions.h>\n\n#if QSLOT_CODE != 1 || QSIGNAL_CODE != 2\n#error QSLOT_CODE and/or QSIGNAL_CODE changed! change the hardcoded stuff to the correct value!\n#endif\n#define PYSIDE_SLOT '1'\n#define PYSIDE_SIGNAL '2'\n#include \"globalreceiverv2.h\"\n#include \"globalreceiver.h\"\n\n#define PYTHON_TYPE \"PyObject\"\n\nnamespace {\n    static PyObject *metaObjectAttr = 0;\n\n    static int callMethod(QObject* object, int id, void** args);\n    static PyObject* parseArguments(const QList< QByteArray >& paramTypes, void** args);\n    static bool emitShortCircuitSignal(QObject* source, int signalIndex, PyObject* args);\n\n#ifdef IS_PY3K\n    static void destroyMetaObject(PyObject* obj)\n    {\n        void* ptr = PyCapsule_GetPointer(obj, 0);\n        PySide::DynamicQMetaObject* meta = reinterpret_cast<PySide::DynamicQMetaObject*>(ptr);\n        SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(meta);\n        if (wrapper)\n            Shiboken::BindingManager::instance().releaseWrapper(wrapper);\n        delete meta;\n    }\n\n#else\n    static void destroyMetaObject(void* obj)\n    {\n        PySide::DynamicQMetaObject* meta = reinterpret_cast<PySide::DynamicQMetaObject*>(obj);\n        SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(meta);\n        if (wrapper)\n            Shiboken::BindingManager::instance().releaseWrapper(wrapper);\n        delete meta;\n    }\n#endif\n}\n\nnamespace PySide {\n\n\nPyObjectWrapper::PyObjectWrapper()\n    :m_me(Py_None)\n{\n    Py_INCREF(m_me);\n}\n\nPyObjectWrapper::PyObjectWrapper(PyObject* me)\n    : m_me(me)\n{\n    Py_INCREF(m_me);\n}\n\nPyObjectWrapper::PyObjectWrapper(const PyObjectWrapper &other)\n    : m_me(other.m_me)\n{\n    Py_INCREF(m_me);\n}\n\nPyObjectWrapper::~PyObjectWrapper()\n{\n    // Check that Python is still initialized as sometimes this is called by a static destructor\n    // after Python interpeter is shutdown.\n    if (!Py_IsInitialized())\n        return;\n\n    Shiboken::GilState gil;\n    Py_DECREF(m_me);\n}\n\nPyObjectWrapper& PyObjectWrapper::operator=(const PySide::PyObjectWrapper& other)\n{\n    Py_INCREF(other.m_me);\n    Py_DECREF(m_me);\n    m_me = other.m_me;\n    return *this;\n}\n\nPyObjectWrapper::operator PyObject*() const\n{\n    return m_me;\n}\n\nQDataStream &operator<<(QDataStream& out, const PyObjectWrapper& myObj)\n{\n    if (Py_IsInitialized() == 0) {\n        qWarning() << \"Stream operator for PyObject called without python interpreter.\";\n        return out;\n    }\n\n    static PyObject *reduce_func  = 0;\n\n    Shiboken::GilState gil;\n    if (!reduce_func) {\n        Shiboken::AutoDecRef pickleModule(PyImport_ImportModule(\"pickle\"));\n        reduce_func = PyObject_GetAttrString(pickleModule, \"dumps\");\n    }\n    Shiboken::AutoDecRef repr(PyObject_CallFunctionObjArgs(reduce_func, (PyObject*)myObj, NULL));\n    if (repr.object()) {\n        const char* buff = 0;\n        Py_ssize_t size  = 0;\n        if (PyBytes_Check(repr.object())) {\n            buff = PyBytes_AS_STRING(repr.object());\n            size = PyBytes_GET_SIZE(repr.object());\n        } else if (Shiboken::String::check(repr.object())) {\n            buff = Shiboken::String::toCString(repr.object());\n            size = Shiboken::String::len(repr.object());\n        }\n        QByteArray data(buff, size);\n        out << data;\n    }\n    return out;\n}\n\nQDataStream &operator>>(QDataStream& in, PyObjectWrapper& myObj)\n{\n    if (Py_IsInitialized() == 0) {\n        qWarning() << \"Stream operator for PyObject called without python interpreter.\";\n        return in;\n    }\n\n    static PyObject *eval_func  = 0;\n\n    Shiboken::GilState gil;\n    if (!eval_func) {\n        Shiboken::AutoDecRef pickleModule(PyImport_ImportModule(\"pickle\"));\n        eval_func = PyObject_GetAttrString(pickleModule, \"loads\");\n    }\n\n    QByteArray repr;\n    in >> repr;\n    Shiboken::AutoDecRef pyCode(PyBytes_FromStringAndSize(repr.data(), repr.size()));\n    Shiboken::AutoDecRef value(PyObject_CallFunctionObjArgs(eval_func, pyCode.object(), 0));\n    if (!value.object()) {\n        value = Py_None;\n    }\n    myObj = PyObjectWrapper(value);\n    return in;\n}\n\n};\n\nnamespace Shiboken {\n\ntemplate<>\nstruct Converter<PySide::PyObjectWrapper>\n{\n    static PySide::PyObjectWrapper toCpp(PyObject* obj)\n    {\n        return PySide::PyObjectWrapper(obj);\n    }\n\n    static PyObject* toPython(void* obj)\n    {\n        return toPython(*reinterpret_cast<PySide::PyObjectWrapper*>(obj));\n    }\n\n    static PyObject* toPython(const PySide::PyObjectWrapper& obj)\n    {\n        Py_INCREF((PyObject*)obj);\n        return obj;\n    }\n};\n\n};\n\nusing namespace PySide;\n\nstruct SignalManager::SignalManagerPrivate\n{\n    SharedMap m_globalReceivers;\n\n    //Deprecated\n    GlobalReceiver m_globalReceiver;\n\n    SignalManagerPrivate()\n    {\n        m_globalReceivers = SharedMap( new QMap<QByteArray, GlobalReceiverV2*>() );\n    }\n\n    ~SignalManagerPrivate()\n    {\n        if (!m_globalReceivers.isNull()) {\n            QList<GlobalReceiverV2*> values = m_globalReceivers->values();\n            m_globalReceivers->clear();\n            if (values.size()) {\n                qDeleteAll(values);\n            }\n        }\n    }\n};\n\nstatic void clearSignalManager()\n{\n    PySide::SignalManager::instance().clear();\n}\n\nstatic void PyObject_PythonToCpp_PyObject_PTR(PyObject* pyIn, void* cppOut)\n{\n    *((PyObject**)cppOut) = pyIn;\n}\nstatic PythonToCppFunc is_PyObject_PythonToCpp_PyObject_PTR_Convertible(PyObject* pyIn)\n{\n    return PyObject_PythonToCpp_PyObject_PTR;\n}\nstatic PyObject* PyObject_PTR_CppToPython_PyObject(const void* cppIn)\n{\n    PyObject* pyOut = (PyObject*)cppIn;\n    if (pyOut)\n        Py_INCREF(pyOut);\n    return pyOut;\n}\n\nSignalManager::SignalManager() : m_d(new SignalManagerPrivate)\n{\n    // Register Qt primitive typedefs used on signals.\n    using namespace Shiboken;\n\n    // Register PyObject type to use in queued signal and slot connections\n    qRegisterMetaType<PyObjectWrapper>(PYTHON_TYPE);\n    qRegisterMetaTypeStreamOperators<PyObjectWrapper>(PYTHON_TYPE);\n    qRegisterMetaTypeStreamOperators<PyObjectWrapper>(\"PyObjectWrapper\");\n    qRegisterMetaTypeStreamOperators<PyObjectWrapper>(\"PySide::PyObjectWrapper\");\n\n    SbkConverter* converter = Shiboken::Conversions::createConverter(&PyBaseObject_Type, 0);\n    Shiboken::Conversions::setCppPointerToPythonFunction(converter, PyObject_PTR_CppToPython_PyObject);\n    Shiboken::Conversions::setPythonToCppPointerFunctions(converter, PyObject_PythonToCpp_PyObject_PTR, is_PyObject_PythonToCpp_PyObject_PTR_Convertible);\n    Shiboken::Conversions::registerConverterName(converter, PYTHON_TYPE);\n    Shiboken::Conversions::registerConverterName(converter, \"object\");\n    Shiboken::Conversions::registerConverterName(converter, \"PyObjectWrapper\");\n    Shiboken::Conversions::registerConverterName(converter, \"PySide::PyObjectWrapper\");\n\n    PySide::registerCleanupFunction(clearSignalManager);\n\n    if (!metaObjectAttr)\n        metaObjectAttr = Shiboken::String::fromCString(\"__METAOBJECT__\");\n}\n\nvoid SignalManager::clear()\n{\n    delete m_d;\n    m_d = new SignalManagerPrivate();\n}\n\nSignalManager::~SignalManager()\n{\n    delete m_d;\n}\n\nSignalManager& SignalManager::instance()\n{\n    static SignalManager me;\n    return me;\n}\n\nQObject* SignalManager::globalReceiver()\n{\n    return &m_d->m_globalReceiver;\n}\n\nvoid SignalManager::globalReceiverConnectNotify(QObject* source, int slotIndex)\n{\n    m_d->m_globalReceiver.connectNotify(source, slotIndex);\n}\n\nvoid SignalManager::globalReceiverDisconnectNotify(QObject* source, int slotIndex)\n{\n    m_d->m_globalReceiver.disconnectNotify(source, slotIndex);\n}\n\nvoid SignalManager::addGlobalSlot(const char* slot, PyObject* callback)\n{\n    addGlobalSlotGetIndex(slot, callback);\n}\n\nint SignalManager::addGlobalSlotGetIndex(const char* slot, PyObject* callback)\n{\n    return m_d->m_globalReceiver.addSlot(slot, callback);\n}\n\nQObject* SignalManager::globalReceiver(QObject *sender, PyObject *callback)\n{\n    SharedMap globalReceivers = m_d->m_globalReceivers;\n    QByteArray hash = GlobalReceiverV2::hash(callback);\n    GlobalReceiverV2* gr = 0;\n    if (!globalReceivers->contains(hash)) {\n        gr = (*globalReceivers)[hash] = new GlobalReceiverV2(callback, globalReceivers);\n        if (sender) {\n            gr->incRef(sender); // create a link reference\n            gr->decRef(); // remove extra reference\n        }\n    } else {\n        gr = (*globalReceivers)[hash];\n        if (sender)\n            gr->incRef(sender);\n    }\n\n    return reinterpret_cast<QObject*>(gr);\n}\n\nint SignalManager::countConnectionsWith(const QObject *object)\n{\n    int count = 0;\n    foreach(GlobalReceiverV2* g, m_d->m_globalReceivers->values()) {\n        if (g->refCount(object))\n            count++;\n    }\n    return count;\n}\n\nvoid SignalManager::notifyGlobalReceiver(QObject* receiver)\n{\n    reinterpret_cast<GlobalReceiverV2*>(receiver)->notify();\n}\n\nvoid SignalManager::releaseGlobalReceiver(const QObject* source, QObject* receiver)\n{\n    GlobalReceiverV2* gr = reinterpret_cast<GlobalReceiverV2*>(receiver);\n    gr->decRef(source);\n}\n\nint SignalManager::globalReceiverSlotIndex(QObject* receiver, const char* signature) const\n{\n    return reinterpret_cast<GlobalReceiverV2*>(receiver)->addSlot(signature);\n}\n\nbool SignalManager::emitSignal(QObject* source, const char* signal, PyObject* args)\n{\n    if (!Signal::checkQtSignal(signal))\n        return false;\n    signal++;\n\n    int signalIndex = source->metaObject()->indexOfSignal(signal);\n    if (signalIndex != -1) {\n        // cryptic but works!\n        // if the signature doesn't have a '(' it's a shor circuited signal, i.e. std::find\n        // returned the string null terminator.\n        bool isShortCircuit = !*std::find(signal, signal + std::strlen(signal), '(');\n        if (isShortCircuit)\n            return emitShortCircuitSignal(source, signalIndex, args);\n        else\n            return MetaFunction::call(source, signalIndex, args);\n    }\n    return false;\n}\n\nint SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id, void** args)\n{\n    const QMetaObject* metaObject = object->metaObject();\n    PySideProperty* pp = 0;\n    PyObject* pp_name = 0;\n    QMetaProperty mp;\n    PyObject* pySelf = 0;\n    int methodCount = metaObject->methodCount();\n    int propertyCount = metaObject->propertyCount();\n\n    if (call != QMetaObject::InvokeMetaMethod) {\n        mp = metaObject->property(id);\n        if (!mp.isValid())\n            return id - methodCount;\n\n        Shiboken::GilState gil;\n        pySelf = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(object);\n        Q_ASSERT(pySelf);\n        pp_name = Shiboken::String::fromCString(mp.name());\n        pp = Property::getObject(pySelf, pp_name);\n        if (!pp) {\n            qWarning(\"Invalid property: %s.\", mp.name());\n            Py_XDECREF(pp_name);\n            return id - methodCount;\n        }\n    }\n\n    switch(call) {\n#ifndef QT_NO_PROPERTIES\n        case QMetaObject::ReadProperty:\n        case QMetaObject::WriteProperty:\n        case QMetaObject::ResetProperty:\n        case QMetaObject::QueryPropertyDesignable:\n        case QMetaObject::QueryPropertyScriptable:\n        case QMetaObject::QueryPropertyStored:\n        case QMetaObject::QueryPropertyEditable:\n        case QMetaObject::QueryPropertyUser:\n            pp->d->metaCallHandler(pp, pySelf, call, args);\n            break;\n#endif\n        case QMetaObject::InvokeMetaMethod:\n            id = callMethod(object, id, args);\n            break;\n\n        default:\n            qWarning(\"Unsupported meta invocation type.\");\n    }\n\n    // WARNING Isn't safe to call any metaObject and/or object methods beyond this point\n    //         because the object can be deleted inside the called slot.\n\n    if (call == QMetaObject::InvokeMetaMethod)\n        id = id - methodCount;\n    else\n        id = id - propertyCount;\n\n    if (pp || pp_name) {\n        Shiboken::GilState gil;\n        Py_XDECREF(pp);\n        Py_XDECREF(pp_name);\n    }\n    return id;\n}\n\nint SignalManager::callPythonMetaMethod(const QMetaMethod& method, void** args, PyObject* pyMethod, bool isShortCuit)\n{\n    Q_ASSERT(pyMethod);\n\n    Shiboken::GilState gil;\n    PyObject* pyArguments = 0;\n\n    if (isShortCuit)\n        pyArguments = reinterpret_cast<PyObject*>(args[1]);\n    else\n        pyArguments = parseArguments(method.parameterTypes(), args);\n\n    if (pyArguments) {\n        Shiboken::Conversions::SpecificConverter* retConverter = NULL;\n        const char* returnType = method.typeName();\n        if (returnType && std::strcmp(\"\", returnType)) {\n            retConverter = new Shiboken::Conversions::SpecificConverter(returnType);\n            if (!retConverter || !*retConverter) {\n                PyErr_Format(PyExc_RuntimeError, \"Can't find converter for '%s' to call Python meta method.\", returnType);\n                PyErr_Print();\n                return -1;\n            }\n        }\n\n        Shiboken::AutoDecRef retval(PyObject_CallObject(pyMethod, pyArguments));\n\n        if (!isShortCuit && pyArguments)\n            Py_DECREF(pyArguments);\n\n        if (!retval.isNull() && retval != Py_None && !PyErr_Occurred() && retConverter)\n            retConverter->toCpp(retval, args[0]);\n        delete retConverter;\n    }\n\n    if (PyErr_Occurred())\n        PyErr_Print();\n\n    return -1;\n}\n\nbool SignalManager::registerMetaMethod(QObject* source, const char* signature, QMetaMethod::MethodType type)\n{\n    int ret = registerMetaMethodGetIndex(source, signature, type);\n    return (ret != -1);\n}\n\nint SignalManager::registerMetaMethodGetIndex(QObject* source, const char* signature, QMetaMethod::MethodType type)\n{\n    Q_ASSERT(source);\n    const QMetaObject* metaObject = source->metaObject();\n    int methodIndex = metaObject->indexOfMethod(signature);\n    // Create the dynamic signal is needed\n    if (methodIndex == -1) {\n        SbkObject* self = Shiboken::BindingManager::instance().retrieveWrapper(source);\n        if (!Shiboken::Object::hasCppWrapper(self)) {\n            qWarning() << \"Invalid Signal signature:\" << signature;\n            return -1;\n        } else {\n            DynamicQMetaObject *dmo = 0;\n            PyObject *pySelf = reinterpret_cast<PyObject*>(self);\n            PyObject* dict = self->ob_dict;\n\n            // Create a instance meta object\n            if (!dict || !PyDict_Contains(dict, metaObjectAttr)) {\n                dmo = new DynamicQMetaObject(pySelf->ob_type, metaObject);\n#ifdef IS_PY3K\n                PyObject* pyDmo = PyCapsule_New(dmo, 0, destroyMetaObject);\n#else\n                PyObject* pyDmo = PyCObject_FromVoidPtr(dmo, destroyMetaObject);\n#endif\n\n                PyObject_SetAttr(pySelf, metaObjectAttr, pyDmo);\n                Py_DECREF(pyDmo);\n            } else {\n                dmo = reinterpret_cast<DynamicQMetaObject*>(const_cast<QMetaObject*>(metaObject));\n            }\n\n            if (type == QMetaMethod::Signal)\n                return dmo->addSignal(signature);\n            else\n                return dmo->addSlot(signature);\n        }\n    }\n    return methodIndex;\n}\n\nbool SignalManager::hasConnectionWith(const QObject *object)\n{\n    return m_d->m_globalReceiver.hasConnectionWith(object);\n}\n\nconst QMetaObject* SignalManager::retriveMetaObject(PyObject *self)\n{\n    Shiboken::GilState gil;\n    DynamicQMetaObject *mo = 0;\n    Q_ASSERT(self);\n\n    PyObject* dict = reinterpret_cast<SbkObject*>(self)->ob_dict;\n    if (dict && PyDict_Contains(dict, metaObjectAttr)) {\n        PyObject *pyMo = PyDict_GetItem(dict, metaObjectAttr);\n\n#ifdef IS_PY3K\n        mo = reinterpret_cast<DynamicQMetaObject*>(PyCapsule_GetPointer(pyMo, 0));\n#else\n        mo = reinterpret_cast<DynamicQMetaObject*>(PyCObject_AsVoidPtr(pyMo));\n#endif\n    } else {\n        mo = reinterpret_cast<DynamicQMetaObject*>(Shiboken::Object::getTypeUserData(reinterpret_cast<SbkObject*>(self)));\n    }\n\n    mo->update();\n    return mo;\n}\n\nnamespace {\n\nstatic int callMethod(QObject* object, int id, void** args)\n{\n    const QMetaObject* metaObject = object->metaObject();\n    QMetaMethod method = metaObject->method(id);\n\n    if (method.methodType() == QMetaMethod::Signal) {\n        // emit python signal\n        QMetaObject::activate(object, id, args);\n    } else {\n        Shiboken::GilState gil;\n        PyObject* self = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(object);\n        QByteArray methodName = method.signature();\n        methodName = methodName.left(methodName.indexOf('('));\n        Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(self, methodName));\n        SignalManager::callPythonMetaMethod(method, args, pyMethod, false);\n    }\n    return -1;\n}\n\n\nstatic PyObject* parseArguments(const QList<QByteArray>& paramTypes, void** args)\n{\n    int argsSize = paramTypes.count();\n    PyObject* preparedArgs = PyTuple_New(argsSize);\n\n    for (int i = 0, max = argsSize; i < max; ++i) {\n        void* data = args[i+1];\n        const char* dataType = paramTypes[i].constData();\n        Shiboken::Conversions::SpecificConverter converter(dataType);\n        if (converter) {\n            PyTuple_SET_ITEM(preparedArgs, i, converter.toPython(data));\n        } else {\n            PyErr_Format(PyExc_TypeError, \"Can't call meta function because I have no idea how to handle %s\", dataType);\n            Py_DECREF(preparedArgs);\n            return 0;\n        }\n    }\n    return preparedArgs;\n}\n\nstatic bool emitShortCircuitSignal(QObject* source, int signalIndex, PyObject* args)\n{\n    void* signalArgs[2] = {0, args};\n    source->qt_metacall(QMetaObject::InvokeMetaMethod, signalIndex, signalArgs);\n    return true;\n}\n\n} //namespace\n"
  },
  {
    "path": "libpyside/signalmanager.h",
    "content": "/*\n* This file is part of the PySide project.\n*\n* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n*\n* Contact: PySide team <contact@pyside.org>\n*\n* This library is free software; you can redistribute it and/or\n* modify it under the terms of the GNU Lesser General Public\n* License as published by the Free Software Foundation; either\n* version 2.1 of the License, or (at your option) any later version.\n*\n* This library is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n* Lesser General Public License for more details.\n*\n* You should have received a copy of the GNU Lesser General Public\n* License along with this library; if not, write to the Free Software\n* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#ifndef SIGNALMANAGER_H\n#define SIGNALMANAGER_H\n\n#include \"pysidemacros.h\"\n#include <sbkpython.h>\n#include <Qt>\n#include <QStringList>\n#include <QMetaMethod>\n#include <QMetaType>\n\nclass QObject;\n\nnamespace PySide\n{\n\n/// Thin wrapper for PyObject which increases the reference count at the constructor but *NOT* at destructor.\nclass PYSIDE_API PyObjectWrapper\n{\npublic:\n    PyObjectWrapper();\n    PyObjectWrapper(PyObject* me);\n    PyObjectWrapper(const PyObjectWrapper &other);\n    ~PyObjectWrapper();\n    operator PyObject*() const;\n    PyObjectWrapper& operator=(const PyObjectWrapper &other);\nprivate:\n    PyObject* m_me;\n    void*     m_data; //future\n};\n\nPYSIDE_API QDataStream &operator<<(QDataStream& out, const PyObjectWrapper& myObj);\nPYSIDE_API QDataStream &operator>>(QDataStream& in, PyObjectWrapper& myObj);\n\nclass PYSIDE_API SignalManager\n{\npublic:\n    static SignalManager& instance();\n\n    QObject* globalReceiver(QObject* sender, PyObject* callback);\n    void releaseGlobalReceiver(const QObject* sender, QObject* receiver);\n    int globalReceiverSlotIndex(QObject* sender, const char* slotSignature) const;\n    void notifyGlobalReceiver(QObject* receiver);\n\n    bool emitSignal(QObject* source, const char* signal, PyObject* args);\n    static int qt_metacall(QObject* object, QMetaObject::Call call, int id, void** args);\n\n    // Used to register a new signal/slot on QMetaobject of source.\n    static bool registerMetaMethod(QObject* source, const char* signature, QMetaMethod::MethodType type);\n    static int registerMetaMethodGetIndex(QObject* source, const char* signature, QMetaMethod::MethodType type);\n\n    // used to discovery metaobject\n    static const QMetaObject* retriveMetaObject(PyObject* self);\n\n    // Used to discovery if SignalManager was connected with object \"destroyed()\" signal.\n    int countConnectionsWith(const QObject *object);\n\n    // Disconnect all signals managed by Globalreceiver\n    void clear();\n\n    // Utility function to call a python method usign args received in qt_metacall\n    static int callPythonMetaMethod(const QMetaMethod& method, void** args, PyObject* obj, bool isShortCuit);\n\n    PYSIDE_DEPRECATED(QObject* globalReceiver());\n    PYSIDE_DEPRECATED(void addGlobalSlot(const char* slot, PyObject* callback));\n    PYSIDE_DEPRECATED(int addGlobalSlotGetIndex(const char* slot, PyObject* callback));\n\n    PYSIDE_DEPRECATED(void globalReceiverConnectNotify(QObject *sender, int slotIndex));\n    PYSIDE_DEPRECATED(void globalReceiverDisconnectNotify(QObject *sender, int slotIndex));\n    PYSIDE_DEPRECATED(bool hasConnectionWith(const QObject *object));\n\nprivate:\n    struct SignalManagerPrivate;\n    SignalManagerPrivate* m_d;\n\n    SignalManager();\n    ~SignalManager();\n\n    // disable copy\n    SignalManager(const SignalManager&);\n    SignalManager operator=(const SignalManager&);\n};\n\n}\n\nQ_DECLARE_METATYPE(PySide::PyObjectWrapper)\n\n#endif\n"
  },
  {
    "path": "plugins/CMakeLists.txt",
    "content": "project(plugins)\n\nset(ui_plugin_src\n    customwidgets.cpp\n    customwidget.cpp\n)\n\nset(ui_plugin_moc\n    customwidget.h\n    customwidgets.h\n)\n\ninclude_directories(${QT_QTDESIGNER_INCLUDE_DIR}\n                    ${SHIBOKEN_INCLUDE_DIR}\n                    ${SHIBOKEN_PYTHON_INCLUDE_DIR})\n\nQT4_WRAP_CPP(MOC_FILES ${ui_plugin_moc})\nadd_library(uiplugin STATIC ${ui_plugin_src} ${MOC_FILES})\nadd_definitions(-fPIC)\nadd_definitions(-DQT_STATICPLUGIN)\ntarget_link_libraries(uiplugin\n                      ${QT_QTUITOOLS_LIBRARY}\n                      ${SHIBOKEN_LIBRARY}\n                      ${SHIBOKEN_PYTHON_LIBRARY})\nif (CMAKE_BUILD_TYPE STREQUAL \"Debug\")\n    set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_DEBUG_POSTFIX})\nelse()\n    set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_RELEASE_POSTFIX})\nendif()\n"
  },
  {
    "path": "plugins/customwidget.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n\n#include \"customwidget.h\"\n\n#include <shiboken.h>\n\nstruct PyCustomWidgetPrivate\n{\n    PyObject* pyObject;\n    bool initialized;\n};\n\nPyCustomWidget::PyCustomWidget(PyObject* objectType)\n    : m_data(new PyCustomWidgetPrivate())\n{\n    m_data->pyObject = objectType;\n    m_name = QString(reinterpret_cast<PyTypeObject*>(objectType)->tp_name);\n}\n\nPyCustomWidget::~PyCustomWidget()\n{\n    delete m_data;\n}\n\nbool PyCustomWidget::isContainer() const\n{\n    return false;\n}\n\nbool PyCustomWidget::isInitialized() const\n{\n    return m_data->initialized;\n}\n\nQIcon PyCustomWidget::icon() const\n{\n    return QIcon();\n}\n\nQString PyCustomWidget::domXml() const\n{\n    return QString();\n}\n\nQString PyCustomWidget::group() const\n{\n    return QString();\n}\n\nQString PyCustomWidget::includeFile() const\n{\n    return QString();\n}\n\nQString PyCustomWidget::name() const\n{\n    return m_name;\n}\n\nQString PyCustomWidget::toolTip() const\n{\n    return QString();\n}\n\nQString PyCustomWidget::whatsThis() const\n{\n    return QString();\n}\n\nQWidget* PyCustomWidget::createWidget(QWidget* parent)\n{\n    //Create a python instance and return cpp object\n    PyObject* pyParent;\n    bool unkowParent = false;\n    if (parent) {\n        pyParent = reinterpret_cast<PyObject*>(Shiboken::BindingManager::instance().retrieveWrapper(parent));\n        if (pyParent) {\n            Py_INCREF(pyParent);\n        } else {\n            static Shiboken::Conversions::SpecificConverter converter(\"QWidget*\");\n            pyParent = converter.toPython(&parent);\n            unkowParent = true;\n        }\n    } else {\n        Py_INCREF(Py_None);\n        pyParent = Py_None;\n    }\n\n    Shiboken::AutoDecRef pyArgs(PyTuple_New(1));\n    PyTuple_SET_ITEM(pyArgs, 0, pyParent); //tuple will keep pyParent reference\n\n    //Call python constructor\n    SbkObject* result = reinterpret_cast<SbkObject*>(PyObject_CallObject(m_data->pyObject, pyArgs));\n\n    QWidget* widget = 0;\n    if (result) {\n        if (unkowParent) //if parent does not exists in python, transfer the ownership to cpp\n            Shiboken::Object::releaseOwnership(result);\n        else\n            Shiboken::Object::setParent(pyParent, reinterpret_cast<PyObject*>(result));\n\n        widget = reinterpret_cast<QWidget*>(Shiboken::Object::cppPointer(result, Py_TYPE(result)));\n    }\n\n    return widget;\n}\n\nvoid PyCustomWidget::initialize(QDesignerFormEditorInterface* core)\n{\n    m_data->initialized = true;\n}\n"
  },
  {
    "path": "plugins/customwidget.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef _PY_CUSTOM_WIDGET_H_\n#define _PY_CUSTOM_WIDGET_H_\n\n#include <shiboken.h>\n#include <QtDesigner/QtDesigner>\n#include <QDesignerCustomWidgetInterface>\n\nstruct PyCustomWidgetPrivate;\n\nclass PyCustomWidget: public QObject, public QDesignerCustomWidgetInterface\n{\n     Q_OBJECT\n     Q_INTERFACES(QDesignerCustomWidgetInterface)\n\npublic:\n    PyCustomWidget(PyObject* objectType);\n    ~PyCustomWidget();\n\n    bool isContainer() const;\n    bool isInitialized() const;\n    QIcon icon() const;\n    QString domXml() const;\n    QString group() const;\n    QString includeFile() const;\n    QString name() const;\n    QString toolTip() const;\n    QString whatsThis() const;\n    QWidget *createWidget(QWidget *parent);\n    void initialize(QDesignerFormEditorInterface *core);\n\nprivate:\n    PyCustomWidgetPrivate* m_data;\n    QString m_name;\n};\n\n#endif\n"
  },
  {
    "path": "plugins/customwidgets.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"customwidget.h\"\n#include \"customwidgets.h\"\n\n#include <shiboken.h>\n\nstruct PyCustomWidgetPrivate\n{\n    PyObject* pyObject;\n    bool initialized;\n};\n\nstruct PyCustomWidgetsPrivate\n{\n    QList<QDesignerCustomWidgetInterface*> widgets;\n    ~PyCustomWidgetsPrivate();\n};\n\n\nPyCustomWidgetsPrivate::~PyCustomWidgetsPrivate()\n{\n    foreach(QDesignerCustomWidgetInterface* iface, widgets)\n        delete iface;\n    widgets.clear();\n}\n\nPyCustomWidgets::PyCustomWidgets(QObject *parent)\n    : QObject(parent), m_data(new PyCustomWidgetsPrivate)\n{\n}\n\nPyCustomWidgets::~PyCustomWidgets()\n{\n    delete m_data;\n}\n\nvoid PyCustomWidgets::registerWidgetType(PyObject* widget)\n{\n    m_data->widgets.append(new PyCustomWidget(widget));\n}\n\nQList<QDesignerCustomWidgetInterface*> PyCustomWidgets::customWidgets() const\n{\n    return m_data->widgets;\n}\n\nQ_EXPORT_STATIC_PLUGIN2(uiplugin, PyCustomWidgets)\n"
  },
  {
    "path": "plugins/customwidgets.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef _PY_CUSTOM_WIDGETS_H_\n#define _PY_CUSTOM_WIDGETS_H_\n\n#include <shiboken.h>\n#include <customwidget.h>\n\n#include <QtDesigner/QtDesigner>\n#include <QtPlugin>\n#include <QDesignerCustomWidgetInterface>\n\nstruct PyCustomWidgetsPrivate;\n\nclass PyCustomWidgets: public QObject, public QDesignerCustomWidgetCollectionInterface\n{\n    Q_OBJECT\n    Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)\n\npublic:\n    PyCustomWidgets(QObject *parent = 0);\n    ~PyCustomWidgets();\n    virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const;\n    void registerWidgetType(PyObject* widget);\n\nprivate:\n    PyCustomWidgetsPrivate* m_data;\n};\n\n#endif\n"
  },
  {
    "path": "tests/CMakeLists.txt",
    "content": "if(CMAKE_VERSION VERSION_LESS 2.8)\n    message(\"CMake version greater than 2.8 necessary to run tests\")\nelse()\n    if(NOT CTEST_TESTING_TIMEOUT)\n        set(CTEST_TESTING_TIMEOUT 60)\n    endif()\n\n   if(WIN32)\n        set(TEST_PYTHONPATH     \"${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util;${pysidetest_BINARY_DIR};$ENV{PYTHONPATH}\")\n        set(TEST_LIBRARY_PATH   \"${libpyside_BINARY_DIR};${pysidetest_BINARY_DIR};${SHIBOKEN_INCLUDE_DIR}/../../bin;$ENV{PATH}\")\n        set(LIBRARY_PATH_VAR    \"PATH\")\n        string(REPLACE \"\\\\\" \"/\" TEST_PYTHONPATH \"${TEST_PYTHONPATH}\")\n        string(REPLACE \"\\\\\" \"/\" TEST_LIBRARY_PATH \"${TEST_LIBRARY_PATH}\")\n\n        string(REPLACE \";\" \"\\\\;\" TEST_PYTHONPATH \"${TEST_PYTHONPATH}\")\n        string(REPLACE \";\" \"\\\\;\" TEST_LIBRARY_PATH \"${TEST_LIBRARY_PATH}\")\n    else()\n        set(TEST_PYTHONPATH     \"${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util:${pysidetest_BINARY_DIR}:$ENV{PYTHONPATH}\")\n        set(TEST_LIBRARY_PATH   \"${libpyside_BINARY_DIR}:${pysidetest_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}\")\n        set(LIBRARY_PATH_VAR    \"LD_LIBRARY_PATH\")\n    endif()\n\n\n    macro(TEST_QT_MODULE var name)\n      if(NOT DISABLE_${name} AND ${var})\n          add_subdirectory(${name})\n      endif()\n    endmacro()\n\n    macro(PYSIDE_TEST)\n        string(REGEX MATCH \"/([^/]+)//?([^/]+)\\\\.py\" foo \"${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}\" )\n        set(TEST_NAME \"${CMAKE_MATCH_1}_${CMAKE_MATCH_2}\")\n        if (${ARGC} EQUAL 1)\n            set(EXPECT_TO_FAIL 0)\n        elseif(${ARGC} EQUAL 2)\n            set(EXPECT_TO_FAIL ${ARGV1})\n        else()\n            message(WARNING \"Invalid call of macro PYSIDE_TEST\")\n        endif()\n        set(TEST_CMD ${XVFB_EXEC} ${SHIBOKEN_PYTHON_INTERPRETER} \"${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}\")\n        add_test(${TEST_NAME} ${TEST_CMD})\n        set_tests_properties(${TEST_NAME} PROPERTIES\n                             TIMEOUT ${CTEST_TESTING_TIMEOUT}\n                             WILL_FAIL ${EXPECT_TO_FAIL}\n                             ENVIRONMENT \"PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH}\")\n    endmacro()\n\n    # Try to find QtMultimedia\n    # TODO: Remove this hack when cmake support QtMultimedia module\n    if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)\n        find_path(QT_QTMULTIMEDIA_INCLUDE_DIR QtMultimedia\n                PATHS ${QT_HEADERS_DIR}/QtMultimedia\n                    ${QT_LIBRARY_DIR}/QtMultimedia.framework/Headers\n                NO_DEFAULT_PATH)\n        find_library(QT_QTMULTIMEDIA_LIBRARY QtMultimedia PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)\n        if (QT_QTMULTIMEDIA_INCLUDE_DIR AND QT_QTMULTIMEDIA_LIBRARY)\n            set(QT_QTMULTIMEDIA_FOUND ON)\n        endif()\n    endif ()\n\n    add_subdirectory(pysidetest)\n    add_subdirectory(signals)\n    TEST_QT_MODULE(QT_QTCORE_FOUND QtCore)\n    TEST_QT_MODULE(QT_QTGUI_FOUND QtGui)\n    TEST_QT_MODULE(QT_QTNETWORK_FOUND QtNetwork)\n    TEST_QT_MODULE(QT_QTWEBKIT_FOUND QtWebKit)\n    TEST_QT_MODULE(QT_QTSVG_FOUND QtSvg)\n    TEST_QT_MODULE(QT_QTXML_FOUND QtXml)\n    TEST_QT_MODULE(QT_QTTEST_FOUND QtTest)\n    TEST_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)\n    TEST_QT_MODULE(QT_QTSQL_FOUND QtSql)\n    TEST_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)\n    TEST_QT_MODULE(QT_QTHELP_FOUND QtHelp)\n    TEST_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)\n    TEST_QT_MODULE(QT_QTMAEMO5_FOUND QtMaemo5)\n    TEST_QT_MODULE(QT_QTSCRIPT_FOUND QtScript)\n    TEST_QT_MODULE(QT_QTSCRIPTTOOLS_FOUND QtScriptTools)\n    TEST_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia)\n    TEST_QT_MODULE(QT_PHONON_FOUND phonon)\n    TEST_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)\n\n    #platform specific\n    if (ENABLE_MAC)\n        add_subdirectory(mac)\n    endif ()\nendif()\n"
  },
  {
    "path": "tests/QtCore/CMakeLists.txt",
    "content": "PYSIDE_TEST(bug_278_test.py)\nPYSIDE_TEST(bug_332.py)\nPYSIDE_TEST(bug_408.py)\nPYSIDE_TEST(bug_428.py)\nPYSIDE_TEST(bug_462.py)\nPYSIDE_TEST(bug_505.py)\nPYSIDE_TEST(bug_515.py)\nPYSIDE_TEST(bug_606.py)\nPYSIDE_TEST(bug_656.py)\nPYSIDE_TEST(bug_686.py)\nPYSIDE_TEST(bug_699.py)\nPYSIDE_TEST(bug_706.py)\nPYSIDE_TEST(bug_723.py)\nPYSIDE_TEST(bug_724.py)\nPYSIDE_TEST(bug_820.py)\nPYSIDE_TEST(bug_826.py)\nPYSIDE_TEST(bug_829.py)\nPYSIDE_TEST(bug_835.py)\nPYSIDE_TEST(bug_920.py)\nPYSIDE_TEST(bug_927.py)\nPYSIDE_TEST(bug_931.py)\nPYSIDE_TEST(bug_938.py)\nPYSIDE_TEST(bug_953.py)\nPYSIDE_TEST(bug_987.py)\nPYSIDE_TEST(bug_994.py)\nPYSIDE_TEST(bug_1019.py)\nPYSIDE_TEST(bug_1031.py)\nPYSIDE_TEST(bug_1063.py)\nPYSIDE_TEST(bug_1069.py)\nPYSIDE_TEST(bug_PYSIDE-42.py)\nPYSIDE_TEST(bug_PYSIDE-164.py)\nPYSIDE_TEST(blocking_signals_test.py)\nPYSIDE_TEST(classinfo_test.py)\nPYSIDE_TEST(child_event_test.py)\nPYSIDE_TEST(deepcopy_test.py)\nPYSIDE_TEST(deletelater_test.py)\nPYSIDE_TEST(destroysignal_test.py)\nPYSIDE_TEST(duck_punching_test.py)\nPYSIDE_TEST(hash_test.py)\nPYSIDE_TEST(inherits_test.py)\nPYSIDE_TEST(max_signals.py)\nPYSIDE_TEST(missing_symbols_test.py)\nPYSIDE_TEST(mockclass_test.py)\nPYSIDE_TEST(python_conversion.py)\nPYSIDE_TEST(qabs_test.py)\nPYSIDE_TEST(qabstractfileengine_test.py)\nPYSIDE_TEST(qabstractitemmodel_test.py)\nPYSIDE_TEST(qabstracttransition_test.py)\nPYSIDE_TEST(qanimationgroup_test.py)\nPYSIDE_TEST(qbitarray_test.py)\nPYSIDE_TEST(qbytearray_buffer_protocol_test.py)\nPYSIDE_TEST(qbytearray_concatenation_operator_test.py)\nPYSIDE_TEST(qbytearray_operator_iadd_test.py)\nPYSIDE_TEST(qbytearray_operator_test.py)\nPYSIDE_TEST(qbytearray_test.py)\nPYSIDE_TEST(qcoreapplication_instance_test.py)\nPYSIDE_TEST(qdatastream_test.py)\nPYSIDE_TEST(qdatetime_test.py)\nPYSIDE_TEST(qdate_test.py)\nPYSIDE_TEST(qeasingcurve_test.py)\nPYSIDE_TEST(qenum_test.py)\nPYSIDE_TEST(qevent_test.py)\nPYSIDE_TEST(qfileinfo_test.py)\nPYSIDE_TEST(qfile_test.py)\nPYSIDE_TEST(qflags_test.py)\nPYSIDE_TEST(qinstallmsghandler_test.py)\nPYSIDE_TEST(qlinef_test.py)\nPYSIDE_TEST(qlocale_test.py)\nPYSIDE_TEST(qmetaobject_test.py)\nPYSIDE_TEST(qmodelindex_internalpointer_test.py)\nPYSIDE_TEST(qobject_children_segfault_test.py)\nPYSIDE_TEST(qobject_connect_notify_test.py)\nPYSIDE_TEST(qobject_destructor.py)\nPYSIDE_TEST(qobject_event_filter_test.py)\nPYSIDE_TEST(qobject_inherits_test.py)\nPYSIDE_TEST(qobject_objectproperty_test.py)\nPYSIDE_TEST(qobject_parent_test.py)\nPYSIDE_TEST(qobject_property_test.py)\nPYSIDE_TEST(qobject_protected_methods_test.py)\nPYSIDE_TEST(qobject_test.py)\nPYSIDE_TEST(qobject_timer_event_test.py)\nPYSIDE_TEST(qobject_tr_as_instance_test.py)\nPYSIDE_TEST(qpoint_test.py)\nPYSIDE_TEST(qprocess_test.py)\nPYSIDE_TEST(qproperty_decorator.py)\nPYSIDE_TEST(qrect_test.py)\nPYSIDE_TEST(qregexp_test.py)\nPYSIDE_TEST(qresource_test.py)\nPYSIDE_TEST(qsize_test.py)\nPYSIDE_TEST(qslot_object_test.py)\nPYSIDE_TEST(qsrand_test.py)\nPYSIDE_TEST(qstatemachine_test.py)\nPYSIDE_TEST(qstate_test.py)\nPYSIDE_TEST(qstring_test.py)\nPYSIDE_TEST(qsysinfo_test.py)\nPYSIDE_TEST(qtext_codec_test.py)\nPYSIDE_TEST(qtextstream_test.py)\nPYSIDE_TEST(qthread_prod_cons_test.py)\nPYSIDE_TEST(qthread_signal_test.py)\nPYSIDE_TEST(qthread_test.py)\nPYSIDE_TEST(qtimer_singleshot_test.py)\nPYSIDE_TEST(qtimer_timeout_test.py)\nPYSIDE_TEST(qtnamespace_test.py)\nPYSIDE_TEST(qurl_test.py)\nPYSIDE_TEST(repr_test.py)\nPYSIDE_TEST(setprop_on_ctor_test.py)\nPYSIDE_TEST(staticMetaObject_test.py)\nPYSIDE_TEST(static_method_test.py)\nPYSIDE_TEST(static_protected_methods_test.py)\nPYSIDE_TEST(thread_signals_test.py)\nPYSIDE_TEST(tr_noop_test.py)\nPYSIDE_TEST(translation_test.py)\nPYSIDE_TEST(unaryoperator_test.py)\nPYSIDE_TEST(unicode_test.py)\nPYSIDE_TEST(versioninfo_test.py)\n\nif(X11)\n    PYSIDE_TEST(qhandle_test.py)\nendif()\n"
  },
  {
    "path": "tests/QtCore/blocking_signals_test.py",
    "content": "\n''' Test case for QObject.signalsBlocked() and blockSignal()'''\n\nimport unittest\nimport os\nfrom tempfile import mkstemp\n\nfrom PySide.QtCore import QObject, SIGNAL, QFile\n\nclass TestSignalsBlockedBasic(unittest.TestCase):\n    '''Basic test case for signalsBlocked'''\n\n    def testBasic(self):\n        '''QObject.signalsBlocked() and blockSignals()\n        The signals aren't blocked by default.\n        blockSignals returns the previous value'''\n        obj = QObject()\n        self.assert_(not obj.signalsBlocked())\n        self.assert_(not obj.blockSignals(True))\n        self.assert_(obj.signalsBlocked())\n        self.assert_(obj.blockSignals(False))\n\nclass TestSignalsBlocked(unittest.TestCase):\n    '''Test case to check if the signals are really blocked'''\n\n    def setUp(self):\n        #Set up the basic resources needed\n        self.obj = QObject()\n        self.args = tuple()\n        self.called = False\n\n    def tearDown(self):\n        #Delete used resources\n        del self.obj\n        del self.args\n\n    def callback(self, *args):\n        #Default callback\n        if  args == self.args:\n            self.called = True\n        else:\n            raise TypeError(\"Invalid arguments\")\n\n    def testShortCircuitSignals(self):\n        #Blocking of Python short-circuit signals\n        QObject.connect(self.obj, SIGNAL('mysignal'), self.callback)\n\n        self.obj.emit(SIGNAL('mysignal'))\n        self.assert_(self.called)\n\n        self.called = False\n        self.obj.blockSignals(True)\n        self.obj.emit(SIGNAL('mysignal'))\n        self.assert_(not self.called)\n\n    def testPythonSignals(self):\n        #Blocking of Python typed signals\n        QObject.connect(self.obj, SIGNAL('mysignal(int,int)'), self.callback)\n        self.args = (1, 3)\n\n        self.obj.emit(SIGNAL('mysignal(int,int)'), *self.args)\n        self.assert_(self.called)\n\n        self.called = False\n        self.obj.blockSignals(True)\n        self.obj.emit(SIGNAL('mysignal(int,int)'), *self.args)\n        self.assert_(not self.called)\n\nclass TestQFileSignalBlocking(unittest.TestCase):\n    '''Test case for blocking the signal QIODevice.aboutToClose()'''\n\n    def setUp(self):\n        #Set up the needed resources - A temp file and a QFile\n        self.called = False\n        handle, self.filename = mkstemp()\n        os.close(handle)\n\n        self.qfile = QFile(self.filename)\n\n    def tearDown(self):\n        #Release acquired resources\n        os.remove(self.filename)\n        del self.qfile\n\n    def callback(self):\n        #Default callback\n        self.called = True\n\n    def testAboutToCloseBlocking(self):\n        #QIODevice.aboutToClose() blocking\n\n        QObject.connect(self.qfile, SIGNAL('aboutToClose()'), self.callback)\n\n        self.assert_(self.qfile.open(QFile.ReadOnly))\n        self.qfile.close()\n        self.assert_(self.called)\n\n        self.called = False\n        self.qfile.blockSignals(True)\n\n        self.assert_(self.qfile.open(QFile.ReadOnly))\n        self.qfile.close()\n        self.assert_(not self.called)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_1019.py",
    "content": "import unittest\nfrom PySide.QtCore import *\n\nclass MyTimer (QTimer):\n    def __init__(self):\n        QTimer.__init__(self)\n        self.startCalled = False\n\n    @Slot()\n    def slotUsedToIncreaseMethodOffset(self):\n        pass\n\nclass MyTimer2 (MyTimer):\n\n    @Slot()\n    def slotUsedToIncreaseMethodOffset2(self):\n        pass\n\n    def start(self):\n        self.startCalled = True\n        QCoreApplication.instance().quit()\n\nclass TestBug1019 (unittest.TestCase):\n    def testIt(self):\n        app = QCoreApplication([])\n        t = MyTimer2()\n        QTimer.singleShot(0, t.start)\n        app.exec_()\n        self.assertTrue(t.startCalled)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_1031.py",
    "content": "from PySide.QtCore import QStateMachine, QState\n\nmach = QStateMachine()\nstate = QState(mach)\nprint(state.machine())\n"
  },
  {
    "path": "tests/QtCore/bug_1063.py",
    "content": "''' unit test for BUG #1063 '''\n\nimport unittest\nimport tempfile\nfrom PySide import QtCore\nimport os\nimport py3kcompat as py3k\n\nclass QTextStreamTestCase(unittest.TestCase):\n    def setUp(self):\n        self.temp_file = tempfile.NamedTemporaryFile(delete=False)\n        self.temp_file.close()\n        self.f = QtCore.QFile(self.temp_file.name)\n        self.f.open(QtCore.QIODevice.WriteOnly)\n        self.strings = (py3k.unicode_('foo'), py3k.unicode_('bar'))\n        self.stream = QtCore.QTextStream(self.f)\n\n    def testIt(self):\n        for s in self.strings:\n            self.stream << s\n\n        self.f.close()\n\n        # make sure we didn't get an empty file\n        self.assertNotEqual(QtCore.QFile(self.temp_file.name).size(), 0)\n\n        os.unlink(self.temp_file.name)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_1069.py",
    "content": "''' unit test for BUG #1069 '''\n\nfrom PySide import QtCore\nimport unittest\n\nclass QDataStreamOpOverloadTestCase(unittest.TestCase):\n    def setUp(self):\n        self.ba = QtCore.QByteArray()\n        self.stream = QtCore.QDataStream(self.ba, QtCore.QIODevice.WriteOnly)\n\n    def testIt(self):\n        self.stream << \"hello\"\n        ok = False\n        for c in self.ba:\n            if c != b'\\x00':\n                ok = True\n                break\n\n        self.assertEqual(ok, True)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_278_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\n\nfrom PySide import QtCore\n\ndef setValue(o):\n    values = ['Name']\n    o.setProperty('test1', values)\n\nclass QQtVersionTest(unittest.TestCase):\n    '''Tests for QVariant conversion of QStringList'''\n\n    def testGet(self):\n        o = QtCore.QObject()\n        setValue(o)\n        self.assertEqual(o.property('test1'), ['Name'])\n\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n\n"
  },
  {
    "path": "tests/QtCore/bug_332.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom PySide import QtCore\n\nclass Lock(QtCore.QMutex):\n    def tryLock(self,timeoutt=10):\n        return QtCore.QMutex.tryLock(self,timeoutt)\n\nclass TestBug(unittest.TestCase):\n\n    def testCase(self):\n        l = Lock()\n        l.tryLock() # this cause a assertion\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_408.py",
    "content": "import unittest\n\nfrom PySide.QtCore import *\n\nclass MyDevice(QIODevice):\n    def __init__(self, txt):\n        QIODevice.__init__(self)\n        self.txt = txt\n        self.ptr = 0\n\n    def readData(self, size):\n        size = min(len(self.txt) - self.ptr, size)\n        retval = self.txt[self.ptr:size]\n        self.ptr += size\n        return retval\n\nclass QIODeviceTest(unittest.TestCase):\n\n    def testIt(self):\n        device = MyDevice(\"hello world\\nhello again\")\n        device.open(QIODevice.ReadOnly)\n\n        s = QTextStream(device)\n        self.assertEqual(s.readLine(), \"hello world\")\n        self.assertEqual(s.readLine(), \"hello again\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_428.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QObject\n\nclass MyBaseObject(QObject):\n    def __init__(self, number):\n        self.myMember = 'myMember' + number\n        QObject.__init__(self)\n\nclass QObjectConstructorTest(unittest.TestCase):\n    def testBug(self):\n        for i in range(10):\n            number = str(i)\n            obj = MyBaseObject(number)\n            self.assertEqual(obj.myMember, 'myMember' + number)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_462.py",
    "content": "import unittest\nimport sys\n\nfrom PySide.QtCore import QObject, QCoreApplication, QEvent, QThread\n\nclass MyEvent(QEvent):\n    def __init__(self,i):\n        print(\"TYPE:\", type(QEvent.User))\n        super(MyEvent,self).__init__(QEvent.Type(QEvent.User + 100 ))\n        self.i = i\n\nclass MyThread (QThread):\n    def __init__(self,owner):\n        super(MyThread,self).__init__()\n        self.owner=owner;\n\n    def run(self):\n        for i in range(3):\n            e=MyEvent(i);\n            QCoreApplication.postEvent(self.owner,e)\n\nclass MyBaseObject(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n        self.events = []\n        self.t = MyThread(self)\n        self.t.start()\n\n    def customEvent(self, event):\n        self.events.append(event)\n        if len(self.events) == 3:\n            self.t.wait()\n            self.app.quit()\n\n\nclass CheckForEventsTypes(unittest.TestCase):\n    def testTypes(self):\n        o = MyBaseObject()\n        o.app = QCoreApplication(sys.argv)\n        o.app.exec_()\n        for e in o.events:\n            self.assertTrue(isinstance(e, MyEvent))\n        o.app = None\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_505.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QObject\n\nclass MyBaseObject(QObject):\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n        self.setObjectName(\"PySide\")\n\n    def __del__(self):\n        if self.objectName() != \"PySide\":\n            raise NameError('Fail')\n\nclass CheckForEventsTypes(unittest.TestCase):\n    def testDelObject(self):\n        p = MyBaseObject()\n        o = MyBaseObject(p)\n        del o\n        del p\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_515.py",
    "content": "\"\"\" Unittest for bug #515 \"\"\"\n\"\"\" http://bugs.openbossa.org/show_bug.cgi?id=515 \"\"\"\n\nfrom PySide import QtCore\n\ncallCleanup = False\ndef _cleanup():\n    global callCleanup\n    callCleanup = True\n\ndef _checkCleanup():\n    global callCleanup\n    assert(callCleanup)\n\napp = QtCore.QCoreApplication([])\nQtCore.qAddPostRoutine(_cleanup)\nQtCore.qAddPostRoutine(_checkCleanup)\ndel app\n"
  },
  {
    "path": "tests/QtCore/bug_606.py",
    "content": "import unittest\n\nimport PySide\nfrom PySide.QtCore import QPoint, QPointF\nfrom PySide.QtCore import QLine, QLineF\nfrom PySide.QtCore import QSize, QSizeF\n\nclass testCases(unittest.TestCase):\n    def testQPointToTuple(self):\n        p = QPoint(1, 2)\n        self.assertEqual((1, 2), p.toTuple())\n\n    def testQPointFToTuple(self):\n        p = QPointF(1, 2)\n        self.assertEqual((1, 2), p.toTuple())\n\n    def testQLineToTuple(self):\n        l = QLine(1, 2, 3, 4)\n        self.assertEqual((1, 2, 3, 4), l.toTuple())\n\n    def testQLineFToTuple(self):\n        l = QLineF(1, 2, 3, 4)\n        self.assertEqual((1, 2, 3, 4), l.toTuple())\n\n    def testQSizeToTuple(self):\n        s = QSize(1, 2)\n        self.assertEqual((1, 2), s.toTuple())\n\n    def testQSizeFToTuple(self):\n        s = QSizeF(1, 2)\n        self.assertEqual((1, 2), s.toTuple())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_656.py",
    "content": "from PySide.QtCore import *\n\nclass CoreApp(QCoreApplication):\n    def __init__(self,*args):\n        super(CoreApp,self).__init__(*args)\n        # It shouldn't crash after the __init__ call\n\nimport sys\napp = CoreApp(sys.argv)\n"
  },
  {
    "path": "tests/QtCore/bug_686.py",
    "content": "from __future__ import with_statement\n\nimport unittest\nfrom PySide.QtCore import *\n\nclass MyWriteThread(QThread):\n    def __init__(self, lock):\n        QThread.__init__(self)\n        self.lock = lock\n        self.started = False\n        self.canQuit = False\n\n    def run(self):\n        self.started = True\n        while not self.lock.tryLockForWrite():\n            pass\n        self.canQuit = True\n\nclass MyReadThread(QThread):\n    def __init__(self, lock):\n        QThread.__init__(self)\n        self.lock = lock\n        self.started = False\n        self.canQuit = False\n\n    def run(self):\n        self.started = True\n        while not self.lock.tryLockForRead():\n            pass\n        self.canQuit = True\n\nclass MyMutexedThread(QThread):\n    def __init__(self, mutex):\n        QThread.__init__(self)\n        self.mutex = mutex\n        self.started = False\n        self.canQuit = False\n\n    def run(self):\n        self.started = True\n        while not self.mutex.tryLock():\n            pass\n        self.canQuit = True\n\nclass TestQMutex (unittest.TestCase):\n\n    def testReadLocker(self):\n        lock = QReadWriteLock()\n        thread = MyWriteThread(lock)\n\n        with QReadLocker(lock):\n            thread.start()\n            while not thread.started:\n                pass\n            self.assertFalse(thread.canQuit)\n\n        thread.wait()\n        self.assertTrue(thread.canQuit)\n\n    def testWriteLocker(self):\n        lock = QReadWriteLock()\n        thread = MyReadThread(lock)\n\n        with QWriteLocker(lock):\n            thread.start()\n            while not thread.started:\n                pass\n            self.assertFalse(thread.canQuit)\n\n        thread.wait()\n        self.assertTrue(thread.canQuit)\n\n    def testMutexLocker(self):\n        mutex = QMutex()\n        thread = MyMutexedThread(mutex)\n\n        with QMutexLocker(mutex):\n            thread.start()\n            while not thread.started:\n                pass\n            self.assertFalse(thread.canQuit)\n\n        thread.wait()\n        self.assertTrue(thread.canQuit)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_699.py",
    "content": "import unittest\nfrom PySide.QtCore import *\n\nclass TestBug699 (unittest.TestCase):\n\n    def defClass(self):\n        class Foo (QObject):\n            def foo(self):\n                pass\n\n            prop = Property(foo, foo)\n\n    def testIt(self):\n        self.assertRaises(TypeError, self.defClass)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_706.py",
    "content": "import unittest\n\nfrom PySide.QtCore import *\n\nclass MyModel (QAbstractListModel):\n    def rowCount(self, parent = None):\n        return 3\n\nclass TestBug706(unittest.TestCase):\n\n    def mySlot(self, idx, start, end):\n        self.start = start\n        self.end = end\n\n    def testIt(self):\n        self.start = None\n        self.end = None\n\n        app = QCoreApplication([])\n        model = MyModel()\n        model.columnsAboutToBeInserted.connect(self.mySlot)\n        model.columnsAboutToBeInserted.emit(QModelIndex(), 0, 1)\n        self.assertEqual(self.start, 0)\n        self.assertEqual(self.end, 1)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_723.py",
    "content": "import unittest\nfrom PySide.QtCore import *\n\nclass MyFileEngine (QAbstractFileEngine):\n\n    def __init__(self):\n        QAbstractFileEngine.__init__(self)\n        self.contents = \"Foo \\0bar for the win!\"\n        self.pos = 0\n\n    def open(self, mode):\n        return True\n\n    def read(self, maxlen):\n        print(\"Reading... to return \", self.contents[self.pos:maxlen])\n\n        if self.pos > len(self.contents):\n            return -1\n\n        res = self.contents[self.pos:maxlen]\n        self.pos += len(res)\n        return res\n\n    def readLine(self, maxlen):\n        return self.contents[self.pos:maxlen]\n\nclass MyFileEngineHandler (QAbstractFileEngineHandler):\n\n    def create(self, fileName):\n        if fileName.startswith(\"foo:/\"):\n            return MyFileEngine()\n        return None\n\n\nclass TestBug723 (unittest.TestCase):\n\n    def testIt(self):\n        fh = MyFileEngineHandler()\n\n        f = QFile(\"foo:/bar\")\n\n        print(type(QFile.ReadOnly))\n        v = (QFile.ReadOnly | QFile.Text)\n        print(type(v))\n\n        \"\"\"\n        assert(f.open(QFile.ReadOnly | QFile.Text))\n        contents = f.readAll()\n        self.assertEqual(contents, \"Foo \\0bar for the win!\")\n        f.close()\n        \"\"\"\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_724.py",
    "content": "from PySide.QtCore import QAbstractFileEngine, QIODevice, QFile\nimport unittest\nimport tempfile\nimport os\nimport py3kcompat as py3k\n\nclass TestBug724 (unittest.TestCase):\n\n    def testIt(self):\n        # creates a temporary file\n        handle, self.filename = tempfile.mkstemp()\n        os.write(handle, py3k.b('a'))\n        os.close(handle)\n\n        engine = QAbstractFileEngine.create(self.filename)\n        engine.open(QIODevice.ReadOnly)\n        memory = engine.map(0, 1, QFile.NoOptions)\n        self.assertEqual(len(memory), 1)\n        self.assertEqual(memory[0], py3k.b('a'))\n        engine.unmap(memory)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_820.py",
    "content": "import functools\nimport unittest\n\nfrom PySide.QtCore import QObject, Slot, Signal, SIGNAL\n\ndef log_exception():\n    def log_exception_decorator(func):\n        @functools.wraps(func)\n        def wrapper(*args, **kwds):\n            try:\n                return func(*args, **kwds)\n            except Exception:\n                raise\n\n        return wrapper\n\n    return log_exception_decorator\n\n\ndef log_exception2():\n    def log_exception_decorator(func):\n        def wrapper(*args, **kwds):\n            try:\n                return func(*args, **kwds)\n            except Exception:\n                raise\n\n        return wrapper\n\n    return log_exception_decorator\n\nclass MyObject(QObject):\n\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n        self._mySlotcalled = False\n        self._mySlot2called = False\n\n    @Slot()\n    @log_exception()\n    def mySlot(self):\n        self._mySlotcalled = True\n\n    @Slot(name=\"mySlot2\")\n    @log_exception2()\n    def mySlot2(self):\n        self._mySlot2called = True\n\n    def poke(self):\n        self.events.emit()\n\n    events = Signal()\n\n\nclass SlotWithDecoratorTest(unittest.TestCase):\n    def testSlots(self):\n        o = MyObject()\n        self.assert_(o.metaObject().indexOfSlot(\"mySlot()\") > 0)\n        self.assert_(o.metaObject().indexOfSlot(\"mySlot2()\") > 0)\n\n        o.events.connect(o.mySlot)\n        o.events.connect(o.mySlot2)\n        o.poke()\n        self.assertTrue(o._mySlotcalled)\n        self.assertTrue(o._mySlot2called)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/bug_826.py",
    "content": "from PySide.QtCore import QEvent, Qt\nimport PySide\n\nimport unittest\n\nTEST_EVENT_TYPE = QEvent.Type(QEvent.registerEventType())\n\nclass TestEvent(QEvent):\n    TestEventType = QEvent.Type(QEvent.registerEventType())\n\n    def __init__(self, rand=0):\n        super(TestEvent, self).__init__(TestEvent.TestEventType)\n        self._rand = rand\n\n    def getRand(self):\n        return self._rand\n\n\nclass TestEnums(unittest.TestCase):\n    def testUserTypesValues(self):\n        self.assert_(QEvent.User <= int(TestEvent.TestEventType) <= QEvent.MaxUser)\n        self.assert_(QEvent.User <= int(TEST_EVENT_TYPE) <= QEvent.MaxUser)\n\n    def testUserTypesRepr(self):\n        self.assertEqual(eval(repr(TestEvent.TestEventType)), TestEvent.TestEventType)\n        self.assertEqual(eval(repr(TEST_EVENT_TYPE)), TEST_EVENT_TYPE)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_829.py",
    "content": "# Test case for PySide bug 829\n# Thomas Perl <thp.io/about>; 2011-04-16\n\nimport unittest\nfrom PySide.QtCore import QSettings\nimport tempfile\n\nclass QVariantConversions(unittest.TestCase):\n    def testDictionary(self):\n        confFile = tempfile.NamedTemporaryFile(delete=False)\n        s = QSettings(confFile.name, QSettings.IniFormat)\n        # Save value\n        s.setValue('x', {1: 'a'})\n        s.sync()\n        del s\n\n        # Restore value\n        s = QSettings(confFile.name, QSettings.IniFormat)\n        self.assertEqual(s.value('x'), {1: 'a'})\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_835.py",
    "content": "from PySide.QtCore import *\n\nimport unittest\n\nget_counter = 0\nset_counter = 0\n\nclass Descriptor(object):\n    def __get__(self, obj, owner):\n        global get_counter\n\n        if not obj:\n            return self\n\n        get_counter += 1\n        return obj.var\n\n    def __set__(self, obj, value):\n        global set_counter\n\n        set_counter += 1\n        obj.var = value\n\nclass FooBar(QObject):\n    test = Descriptor()\n    var = 0\n\nclass SetAndGetTestCases(unittest.TestCase):\n    def setUp(self):\n        global get_counter\n        global set_counter\n\n        get_counter = 0\n        set_counter = 0\n\n    def testSetMethod(self):\n        global get_counter\n        global set_counter\n\n        f = FooBar()\n\n        f.test = 1\n        self.assertEqual(get_counter, 0)\n        self.assertEqual(set_counter, 1)\n\n        get_counter = 0\n        set_counter = 0\n\n    def testGetMethod(self):\n        global get_counter\n        global set_counter\n\n        f = FooBar()\n        f.test = 1\n        set_counter = 0\n\n        ret = f.test\n        self.assertEqual(get_counter, 1)\n        self.assertEqual(set_counter, 0)\n\n        get_counter = 0\n        set_counter = 0\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_920.py",
    "content": "#!/usr/bin/env python\n\nimport sys\nimport unittest\nimport PySide.QtCore as QtCore\n\nclass Signaller(QtCore.QObject):\n    s1 = QtCore.Signal()\n    s2 = QtCore.Signal()\n\nclass TestBug920(unittest.TestCase):\n\n    def testIt(self):\n        s = Signaller()\n        s.s1.connect(self.onSignal)\n        s.s2.connect(self.onSignal)\n        self.assertTrue(s.s1.disconnect(self.onSignal))\n        self.assertTrue(s.s2.disconnect(self.onSignal))\n\n    def onSignal(self):\n        pass\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_927.py",
    "content": "import time\nimport unittest\n\nfrom PySide.QtCore import QTime, QRunnable, QThreadPool\n\nclass Task(QRunnable):\n   def run(self):\n       t = QTime()\n       t.start()\n       time.sleep(2) # Sleep 2 seconds\n\n\nclass QThreadPoolTest(unittest.TestCase):\n    '''This used to cause a segfault due the ownership control on globalInstance function '''\n    def testSlowJobs(self):\n       for i in range(3):\n           task = Task()\n           QThreadPool.globalInstance().start(task)\n           time.sleep(1) # Sleep 1 second\n\n       QThreadPool.globalInstance().waitForDone()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_931.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QObject, Signal\no = QObject()\nclass MyObject(QObject):\n    s = Signal(int)\n\nclass CheckSignalType(unittest.TestCase):\n    def testSignal(self):\n        self.assertTrue(isinstance(QObject.destroyed, Signal))\n        self.assertEqual(type(QObject.destroyed), Signal)\n\n        self.assertEqual(type(o.destroyed).__name__, \"SignalInstance\")\n        self.assertNotEqual(type(o.destroyed), Signal)\n\n        self.assertTrue(isinstance(o.destroyed, Signal))\n        self.assertTrue(isinstance(MyObject.s, Signal))\n        self.assertFalse(isinstance(int, Signal))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_938.py",
    "content": "import unittest\nfrom PySide.QtCore import *\n\nclass TestBug938 (unittest.TestCase):\n\n    def testIt(self):\n        b = QBuffer()\n        b.open(QBuffer.WriteOnly)\n        b.write(\"\\x0023\\x005\")\n        b.close()\n        self.assertEqual(b.buffer().size(), 5)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_953.py",
    "content": "from PySide.QtCore import *\n\nclass Dispatcher(QObject):\n    _me = None\n\n    def __init__(self):\n        super(Dispatcher, self).__init__()\n        self._me = self\n        QTimer.singleShot(0, self._finish)\n\n    def _finish(self):\n        del self._me # It can't crash here!\n        QTimer.singleShot(10, QCoreApplication.instance().quit)\n\nif __name__ == '__main__':\n    app = QCoreApplication([])\n    Dispatcher()\n    app.exec_()\n"
  },
  {
    "path": "tests/QtCore/bug_987.py",
    "content": "from PySide.QtCore import QObject\n\nimport unittest\n\n\nclass TestBug987(unittest.TestCase):\n    def callback(self):\n        pass\n\n    def testInvalidDisconnection(self):\n        o = QObject()\n        self.assertRaises(RuntimeError, o.destroyed.disconnect, self.callback)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_994.py",
    "content": "import unittest\nimport py3kcompat as py3k\nfrom PySide.QtCore import QIODevice, QTextStream\n\n\nclass MyIODevice (QIODevice):\n    def readData(self, amount):\n        return py3k.b(\"\\0a\" * int(amount/2))\n\n    def readLineData(self, maxSize):\n        return py3k.b(\"\\0b\" * 4)\n\n    def atEnd(self):\n        return False\n\nclass TestBug944 (unittest.TestCase):\n\n    def testIt(self):\n        device = MyIODevice()\n        device.open(QIODevice.ReadOnly)\n        s = QTextStream(device)\n        self.assertEqual(s.read(4), \"\\0a\\0a\")\n        self.assertEqual(device.readLine(), \"\\0b\\0b\\0b\\0b\")\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_PYSIDE-164.py",
    "content": "from PySide.QtCore import QCoreApplication, QEventLoop, QObject, Qt, QThread, QTimer, SIGNAL\nimport unittest\n\n\nclass Emitter(QThread):\n    def __init__(self):\n        QThread.__init__(self)\n\n    def run(self):\n        print \"Before emit.\"\n        self.emit(SIGNAL(\"signal(int)\"), 0)\n        print \"After emit.\"\n\nclass Receiver(QObject):\n    def __init__(self, eventloop):\n        QObject.__init__(self)\n        self.eventloop = eventloop\n\n    def receive(self, number):\n        print \"Received number: %d\" % number\n        self.eventloop.exit(0)\n\n\nclass TestBugPYSIDE164(unittest.TestCase):\n\n    def testBlockingSignal(self):\n        app = QCoreApplication.instance() or QCoreApplication([])\n        eventloop = QEventLoop()\n        emitter = Emitter()\n        receiver = Receiver(eventloop)\n        emitter.connect(emitter, SIGNAL(\"signal(int)\"),\n                        receiver.receive, Qt.BlockingQueuedConnection)\n        emitter.start()\n        retval = eventloop.exec_()\n        emitter.wait()\n        self.assertEqual(retval, 0)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/bug_PYSIDE-42.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\nimport unittest\n\nclass TestBugPYSIDE42 (unittest.TestCase):\n\n    def testIt(self):\n        obj1 = QFile()\n        obj2 = QObject()\n        hash1 = hash(obj1)\n        hash2 = hash(obj2)\n\n        self.assertNotEqual(hash1, hash2)\n        self.assertEqual(hash1, hash(obj1))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/child_event_test.py",
    "content": "#!/usr/bin/python\n'''Test case for QObject.childEvent and QTimer.childEvent overloading'''\n\nimport unittest\nfrom time import sleep\nfrom PySide.QtCore import QObject, QTimer, QCoreApplication\n\nfrom helper import UsesQCoreApplication\n\nclass ExtQObject(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n        self.child_event_received = False\n\n    def childEvent(self, event):\n        QObject.childEvent(self, event)\n        self.child_event_received = True\n\nclass ExtQTimer(QTimer):\n    def __init__(self):\n        QTimer.__init__(self)\n        self.child_event_received = False\n\n    def childEvent(self, event):\n        QTimer.childEvent(self, event)\n        self.child_event_received = True\n\n\nclass TestChildEvent(UsesQCoreApplication):\n    '''Test case for QObject::childEvent and QTimer::childEvent'''\n\n    def setUp(self):\n        UsesQCoreApplication.setUp(self)\n\n    def tearDown(self):\n        UsesQCoreApplication.tearDown(self)\n\n    def testQObject(self):\n        parent = ExtQObject()\n        child = QObject()\n        child.setParent(parent)\n        self.assertTrue(parent.child_event_received)\n\n    def testQTimer(self):\n        parent = ExtQTimer()\n        child = QObject()\n        child.setParent(parent)\n        self.assert_(parent.child_event_received)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/classinfo_test.py",
    "content": "import unittest\nimport sys\nfrom PySide.QtCore import QObject, ClassInfo\n\n@ClassInfo(author='pyside',url='http://www.pyside.org')\nclass MyObject(QObject):\n    pass\n\nclass TestClassInfo(unittest.TestCase):\n    def testMetaData(self):\n        o = MyObject()\n        mo = o.metaObject()\n        self.assertEqual(mo.classInfoCount(), 2)\n\n        ci = mo.classInfo(0) #author\n        self.assertEqual(ci.name(), 'author')\n        self.assertEqual(ci.value(), 'pyside')\n\n        ci = mo.classInfo(1) #url\n        self.assertEqual(ci.name(), 'url')\n        self.assertEqual(ci.value(), 'http://www.pyside.org')\n\nif __name__ == '__main__':\n    if sys.version_info[0] < 2:\n        sys.exit(0)\n    elif (sys.version_info[0] == 2) and (sys.version_info[1] <= 5):\n        sys.exit(0)\n    else:\n        unittest.main()\n"
  },
  {
    "path": "tests/QtCore/deepcopy_test.py",
    "content": "\nimport unittest\nfrom copy import deepcopy\n\nfrom PySide.QtCore import QByteArray, QDate, QDateTime, QTime, QLine, QLineF\nfrom PySide.QtCore import Qt, QSize, QSizeF, QRect, QRectF, QDir, QPoint, QPointF\nfrom PySide.QtCore import QUuid\n\nclass DeepCopyHelper:\n    def testCopy(self):\n        copy = deepcopy([self.original])[0]\n        self.assert_(copy is not self.original)\n        self.assertEqual(copy, self.original)\n\nclass QByteArrayDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QByteArray('the quick brown fox jumps over the lazy dog')\n\n\nclass QDateDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QDate(2010, 11, 22)\n\n\nclass QTimeDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QTime(11, 37, 55, 692)\n\n\nclass QDateTimeDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QDateTime(2010, 5, 18, 10, 24, 45, 223, Qt.LocalTime)\n\n\nclass QSizeDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QSize(42, 190)\n\n\nclass QSizeFDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QSizeF(42.7, 190.2)\n\n\nclass QRectDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QRect(100, 200, 300, 400)\n\n\nclass QRectFDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QRectF(100.33, 200.254, 300.321, 400.123)\n\nclass QLineDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QLine(1, 2, 3, 4)\n\nclass QLineFDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QLineF(1.1, 2.2, 3.3, 4.4)\n\nclass QPointDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QPoint(1, 2)\n\nclass QPointFDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QPointF(1.1, 2.2)\n\nclass QDirDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QDir(\"./\")\n\nclass QUuiCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QUuid(\"67C8770B-44F1-410A-AB9A-F9B5446F13EE\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/deletelater_test.py",
    "content": "#!/usr/bin/python\n\n'''Test cases for QTimer.singleShot'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, QTimer, QCoreApplication, SIGNAL\nfrom helper import UsesQCoreApplication\n\nclass TestDeleteLater(UsesQCoreApplication):\n    '''Test case for function DeleteLater'''\n\n    def testCase(self):\n        o = QObject()\n        o.deleteLater()\n        del o\n        QTimer.singleShot(100, self.app.quit)\n        self.app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/destroysignal_test.py",
    "content": "from PySide.QtCore import QTimer, QObject\nimport sys\nimport unittest\n\nclass TestDestroySignal(unittest.TestCase):\n    def onObjectDestroyed(self, timer):\n        self.assert_(isinstance(timer, QObject))\n        self._destroyed = True\n\n    def testSignal(self):\n        self._destroyed = False\n        t = QTimer()\n        t.destroyed[QObject].connect(self.onObjectDestroyed)\n        del t\n        self.assert_(self._destroyed)\n\n    def testWithParent(self):\n        self._destroyed = False\n        p = QTimer()\n        t = QTimer(p)\n        t.destroyed[QObject].connect(self.onObjectDestroyed)\n        del p\n        self.assert_(self._destroyed)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/duck_punching_test.py",
    "content": "#!/usr/bin/python\n\n'''Test case for duck punching new implementations of C++ virtual methods into object instances.'''\n\nimport unittest\nimport types\nimport sys\nfrom PySide.QtCore import QObject\nfrom helper import UsesQCoreApplication\n\ndef MethodType(func, instance, instanceType):\n    if sys.version_info[0] == 3:\n        return types.MethodType(func, instance)\n    else:\n        return types.MethodType(func, instance, instanceType)\n\nclass Duck(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n    def childEvent(self, event):\n        QObject.childEvent(self, event)\n\nclass TestDuckPunchingOnQObjectInstance(UsesQCoreApplication):\n    '''Test case for duck punching new implementations of C++ virtual methods into object instances.'''\n\n    def setUp(self):\n        #Acquire resources\n        self.duck_childEvent_called = False\n        UsesQCoreApplication.setUp(self)\n\n    def tearDown(self):\n        #Release resources\n        del self.duck_childEvent_called\n        UsesQCoreApplication.tearDown(self)\n\n\n    def testChildEventMonkeyPatch(self):\n        #Test if the new childEvent injected on QObject instance is called from C++\n        parent = QObject()\n        def childEvent(obj, event):\n            self.duck_childEvent_called = True\n        parent.childEvent = MethodType(childEvent, parent, QObject)\n        child = QObject()\n        child.setParent(parent)\n        self.assert_(self.duck_childEvent_called)\n        # This is done to decrease the refcount of the vm object\n        # allowing the object wrapper to be deleted before the\n        # BindingManager. This is useful when compiling Shiboken\n        # for debug, since the BindingManager destructor has an\n        # assert that checks if the wrapper mapper is empty.\n        parent.childEvent = None\n\n    def testChildEventMonkeyPatchWithInheritance(self):\n        #Test if the new childEvent injected on a QObject's extension class instance is called from C++\n        parent = Duck()\n        def childEvent(obj, event):\n            QObject.childEvent(obj, event)\n            self.duck_childEvent_called = True\n        child = QObject()\n        child.setParent(parent)\n        parent.childEvent = MethodType(childEvent, parent, QObject)\n        child = QObject()\n        child.setParent(parent)\n        self.assert_(self.duck_childEvent_called)\n        # This is done to decrease the refcount of the vm object\n        # allowing the object wrapper to be deleted before the\n        # BindingManager. This is useful when compiling Shiboken\n        # for debug, since the BindingManager destructor has an\n        # assert that checks if the wrapper mapper is empty.\n        parent.childEvent = None\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/hash_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtCore import QDate, QDateTime, QTime, QUrl\nfrom PySide.QtCore import QLine, QPoint, QRect, QSize\n\nclass HashTest(unittest.TestCase):\n    def testInsert(self):\n        myHash = {}\n        qdate = QDate.currentDate()\n        qdatetime = QDateTime.currentDateTime()\n        qtime = QTime.currentTime()\n        qurl = QUrl(\"http://www.pyside.org\")\n        qpoint = QPoint(12, 42)\n\n        myHash[qdate] = \"QDate\"\n        myHash[qdatetime] = \"QDateTime\"\n        myHash[qtime] = \"QTime\"\n        myHash[qurl] = \"QUrl\"\n        myHash[qpoint] = \"QPoint\"\n\n        self.assertEqual(myHash[qdate], \"QDate\")\n        self.assertEqual(myHash[qdatetime], \"QDateTime\")\n        self.assertEqual(myHash[qtime], \"QTime\")\n        self.assertEqual(myHash[qurl], \"QUrl\")\n        self.assertEqual(myHash[qpoint], \"QPoint\")\n\n    def testQPointHash(self):\n        p1 = QPoint(12, 34)\n        p2 = QPoint(12, 34)\n        self.assertFalse(p1 is p2)\n        self.assertEqual(p1, p2)\n        self.assertEqual(hash(p1), hash(p2))\n\n    def testQSizeHash(self):\n        s1 = QSize(12, 34)\n        s2 = QSize(12, 34)\n        self.assertFalse(s1 is s2)\n        self.assertEqual(s1, s2)\n        self.assertEqual(hash(s1), hash(s2))\n\n    def testQRectHash(self):\n        r1 = QRect(12, 34, 56, 78)\n        r2 = QRect(12, 34, 56, 78)\n        self.assertFalse(r1 is r2)\n        self.assertEqual(r1, r2)\n        self.assertEqual(hash(r1), hash(r2))\n\n    def testQLineHash(self):\n        l1 = QLine(12, 34, 56, 78)\n        l2 = QLine(12, 34, 56, 78)\n        self.assertFalse(l1 is l2)\n        self.assertEqual(l1, l2)\n        self.assertEqual(hash(l1), hash(l2))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/inherits_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QObject\n\nclass MyObject(QObject):\n    pass\n\nclass MainTest(unittest.TestCase):\n    def testInherits(self):\n        o = MyObject()\n        mo = o.metaObject()\n        self.assertEqual(mo.className(), 'MyObject')\n        self.assertTrue(o.inherits('MyObject'))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/max_signals.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QObject, SIGNAL\n\nclass MyObject(QObject):\n    pass\n\n\nclass TestSignalLimitless(unittest.TestCase):\n    SIGNAL_MAX = 100\n    def test100DynamicSignals(self):\n\n        self.count = 0\n        def onSignal():\n            self.count += 1\n\n        #create 100 dynamic signals\n        o = MyObject()\n        for i in range(self.SIGNAL_MAX):\n            o.connect(SIGNAL('sig%d()'%i), onSignal)\n\n        #chek if the signals are valid\n        m = o.metaObject()\n        for i in range(self.SIGNAL_MAX):\n            self.assert_(m.indexOfSignal('sig%d()'%i) > 0)\n\n        #emit all 100 signals\n        for i in range(self.SIGNAL_MAX):\n            o.emit(SIGNAL('sig%d()'%i))\n\n        self.assertEqual(self.count, self.SIGNAL_MAX)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/missing_symbols_test.py",
    "content": "\n'''(Very) Simple test case for missing names from QtCore'''\n\nimport unittest\nfrom PySide import QtCore\n\nclass MissingClasses(unittest.TestCase):\n\n    def testQSettings(self): # Bug 232\n        getattr(QtCore, 'QSettings')\n\n    def testQtTrNoop(self): # Bug 220\n        getattr(QtCore, 'QT_TR_NOOP')\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/mockclass_test.py",
    "content": "# Test case for PySide bug 634\n# http://bugs.pyside.org/show_bug.cgi?id=634\n# Marcus Lindblom <macke@yar.nu>; 2011-02-16\n\nimport unittest\nfrom PySide.QtCore import QCoreApplication\n\nclass Mock(object):\n    def __init__(self):\n        self.called = False\n        self.return_value = None\n\n    def __call__(self, *args, **kwargs):\n        self.called = True\n        return self.return_value\n\n\nclass MockClassTest(unittest.TestCase):\n    def testMockQCoreApplication(self):\n        mock = Mock()\n        setattr(QCoreApplication, 'instance', mock)\n        QCoreApplication.instance()\n        self.assert_(mock.called)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/python_conversion.py",
    "content": "#!/usr/bin/python\n'''Test cases for QLineF'''\n\nimport unittest\nimport datetime\n\nfrom PySide.QtCore import QTime, QDateTime, QDate\n\nclass TestDateTimeConversions (unittest.TestCase):\n    def testQDate(self):\n        date = datetime.date(2010, 4, 23)\n        other = QDate(date)\n        self.assertEqual(date.year, other.year())\n        self.assertEqual(date.month, other.month())\n        self.assertEqual(date.day, other.day())\n\n        self.assertEqual(date, other.toPython())\n\n    def testQTime(self):\n        time = datetime.time(11, 14, 0, 1000)\n        other = QTime(time)\n        self.assertEqual(time.hour, other.hour())\n        self.assertEqual(time.minute, other.minute())\n        self.assertEqual(time.second, other.second())\n        self.assertEqual(time.microsecond/1000, other.msec())\n\n        self.assertEqual(time, other.toPython())\n\n    def testQDateTime(self):\n        dateTime = datetime.datetime(2010, 4, 23, 11, 14, 0, 1000)\n        other = QDateTime(dateTime)\n\n        otherDate = other.date()\n        self.assertEqual(dateTime.year, otherDate.year())\n        self.assertEqual(dateTime.month, otherDate.month())\n        self.assertEqual(dateTime.day, otherDate.day())\n\n        otherTime = other.time()\n        self.assertEqual(dateTime.hour, otherTime.hour())\n        self.assertEqual(dateTime.minute, otherTime.minute())\n        self.assertEqual(dateTime.second, otherTime.second())\n        self.assertEqual(dateTime.microsecond/1000, otherTime.msec())\n\n        self.assertEqual(dateTime, other.toPython())\n\n    def testQDateTime6arg(self):\n        dateTime = datetime.datetime(2010, 4, 23, 11, 14, 7)\n        other = QDateTime(dateTime)\n\n        otherDate = other.date()\n        self.assertEqual(dateTime.year, otherDate.year())\n        self.assertEqual(dateTime.month, otherDate.month())\n        self.assertEqual(dateTime.day, otherDate.day())\n\n        otherTime = other.time()\n        self.assertEqual(dateTime.hour, otherTime.hour())\n        self.assertEqual(dateTime.minute, otherTime.minute())\n        self.assertEqual(dateTime.second, otherTime.second())\n        self.assertEqual(dateTime.microsecond/1000, otherTime.msec())\n\n        self.assertEqual(dateTime, other.toPython())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qabs_test.py",
    "content": "\nimport unittest\n\nfrom PySide import QtCore\n\n\nclass QAbsTest(unittest.TestCase):\n    '''Tests for QtCore.qAbs'''\n\n    def testBasic(self):\n        def check(x):\n            self.assertEqual(QtCore.qAbs(x), abs(x))\n\n        check(0)\n        check(-10)\n        check(10)\n        check(10.5)\n        check(-10.5)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qabstractfileengine_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport os\nfrom PySide.QtCore import QAbstractFileEngineIterator, QAbstractFileEngine, QAbstractFileEngineHandler, QDir\n\n\nclass TestFSIterator(QAbstractFileEngineIterator):\n    def __init__(self, parent, filters, filterNames):\n        QAbstractFileEngineIterator.__init__(self, filters, filterNames)\n        self.index = -1\n        self._list = ['.', '..']\n        if parent == '/bup':\n            self._list += ['A', 'B', 'C']\n\n    def next(self):\n        self.index += 1\n        return self.currentFileName()\n\n    def hasNext(self):\n        return (self.index + 1) < len(self._list)\n\n    def currentFileName(self):\n        if self.index < len(self._list):\n            return self._list[self.index]\n        return None\n\n\nclass TestFS(QAbstractFileEngine):\n    def __init__(self, path):\n        QAbstractFileEngine.__init__(self)\n        self.path = path\n\n    def beginEntryList(self, filters, filterNames):\n        return TestFSIterator(self.path, filters, filterNames)\n\n    def fileFlags(self, _ = QAbstractFileEngine.FileInfoAll):\n        return QAbstractFileEngine.ExistsFlag\\\n               |QAbstractFileEngine.ReadOwnerPerm\\\n               |QAbstractFileEngine.ReadUserPerm\\\n               |QAbstractFileEngine.ReadGroupPerm\\\n               |QAbstractFileEngine.ReadOtherPerm\\\n               |QAbstractFileEngine.DirectoryType\n\n    def fileName(self, path=QAbstractFileEngine.DefaultName):\n        if path == QAbstractFileEngine.DefaultName:\n            return self.path\n        return os.path.basename(self.path)\n\n    def setFileName(self, path):\n        self.path = path\n\nclass TestFSHandler(QAbstractFileEngineHandler):\n    def __init__(self):\n        QAbstractFileEngineHandler.__init__(self)\n\n    def create(self, path):\n        if path.startswith('/bup'):\n            return TestFS(path)\n        return None\n\nclass QAbstractFileEngineTest(unittest.TestCase):\n\n    def testBeginEntryList(self):\n        obj = TestFSHandler()\n        qdir = QDir('/bup')\n        for n1, n2 in zip(qdir.entryList(), ['.', '..', 'A', 'B', 'C']):\n            self.assertEqual(n1, n2)\n        self.assertEqual(len(qdir.entryList()), 5)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qabstractitemmodel_test.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide.QtCore import *\n\nclass MyModel (QAbstractListModel):\n    pass\n\nclass Foo:\n    pass\n\nclass TestQModelIndexInternalPointer(unittest.TestCase):\n\n    def testInternalPointer(self):\n        m = MyModel()\n        foo = Foo()\n        idx = m.createIndex(0,0, foo)\n\n    def testPassQPersistentModelIndexAsQModelIndex(self):\n        # Related to bug #716\n        m = MyModel()\n        idx = QPersistentModelIndex()\n        m.span(idx)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qabstracttransition_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom sys import getrefcount\nfrom PySide.QtCore import *\n\ndef addStates(transition):\n    sx = QState()\n    sy = QState()\n    transition.setTargetStates([sx, sy])\n\ndef addAnimation(transition):\n    animation = QParallelAnimationGroup()\n    transition.addAnimation(animation)\n\nclass QAbstractTransitionTest(unittest.TestCase):\n\n    def testBasic(self):\n        app = QCoreApplication([])\n\n        o = QObject()\n        o.setProperty(\"text\", \"INdT\")\n\n        machine = QStateMachine()\n        s1 = QState()\n        s1.assignProperty(o, \"text\", \"Rocks\")\n\n        s2 = QFinalState()\n        t = s1.addTransition(o, SIGNAL(\"change()\"), s2)\n\n        self.assertEqual(t.targetStates(), [s2])\n\n        addStates(t)\n        self.assertEqual(len(t.targetStates()), 2)\n\n        animation = QParallelAnimationGroup()\n        t.addAnimation(animation)\n\n        self.assertEqual(t.animations(), [animation])\n\n        addAnimation(t)\n        self.assertEqual(t.animations()[0].parent(), None)\n\n        machine.addState(s1)\n        machine.addState(s2)\n        machine.setInitialState(s1)\n        machine.start()\n\n        QTimer.singleShot(100, app.quit)\n        app.exec_()\n\n    def testRefCountOfTargetState(self):\n        transition = QEventTransition()\n        state1 = QState()\n        refcount1 = getrefcount(state1)\n\n        transition.setTargetState(state1)\n\n        self.assertEqual(transition.targetState(), state1)\n        self.assertEqual(getrefcount(transition.targetState()), refcount1 + 1)\n\n        state2 = QState()\n        refcount2 = getrefcount(state2)\n\n        transition.setTargetState(state2)\n\n        self.assertEqual(transition.targetState(), state2)\n        self.assertEqual(getrefcount(transition.targetState()), refcount2 + 1)\n        self.assertEqual(getrefcount(state1), refcount1)\n\n        del transition\n\n        self.assertEqual(getrefcount(state2), refcount2)\n\n    def testRefCountOfTargetStates(self):\n        transition = QEventTransition()\n        state1 = QState()\n        state2 = QState()\n        states = [state1, state2]\n        refcount1 = getrefcount(state1)\n        refcount2 = getrefcount(state2)\n\n        transition.setTargetStates(states)\n\n        self.assertEqual(transition.targetStates(), states)\n        self.assertEqual(transition.targetState(), state1)\n        self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1)\n        self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1)\n\n        del states\n        del transition\n\n        self.assertEqual(getrefcount(state1), refcount1 - 1)\n        self.assertEqual(getrefcount(state2), refcount2 - 1)\n\n    def testRefCountOfTargetStatesAfterSingleTargetState(self):\n        transition = QEventTransition()\n        state0 = QState()\n        refcount0 = getrefcount(state0)\n\n        transition.setTargetState(state0)\n\n        self.assertEqual(transition.targetState(), state0)\n        self.assertEqual(getrefcount(transition.targetState()), refcount0 + 1)\n\n        state1 = QState()\n        state2 = QState()\n        states = [state1, state2]\n        refcount1 = getrefcount(state1)\n        refcount2 = getrefcount(state2)\n\n        transition.setTargetStates(states)\n\n        self.assertEqual(getrefcount(state0), refcount0)\n        self.assertEqual(transition.targetStates(), states)\n        self.assertEqual(transition.targetState(), state1)\n        self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1)\n        self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1)\n\n        del states\n        del transition\n\n        self.assertEqual(getrefcount(state1), refcount1 - 1)\n        self.assertEqual(getrefcount(state2), refcount2 - 1)\n\n    def testRefCountOfTargetStatesBeforeSingleTargetState(self):\n        transition = QEventTransition()\n        state1 = QState()\n        state2 = QState()\n        states = [state1, state2]\n        refcount1 = getrefcount(state1)\n        refcount2 = getrefcount(state2)\n\n        transition.setTargetStates(states)\n\n        self.assertEqual(transition.targetStates(), states)\n        self.assertEqual(transition.targetState(), state1)\n        self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1)\n        self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1)\n\n        state3 = QState()\n        refcount3 = getrefcount(state3)\n\n        transition.setTargetState(state3)\n\n        self.assertEqual(transition.targetState(), state3)\n        self.assertEqual(getrefcount(transition.targetState()), refcount3 + 1)\n\n        del states\n\n        self.assertEqual(getrefcount(state1), refcount1 - 1)\n        self.assertEqual(getrefcount(state2), refcount2 - 1)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qanimationgroup_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtCore import *\n\nclass QAnimationGroupTest(unittest.TestCase):\n\n    def testBasic(self):\n        app = QCoreApplication([])\n\n        panim = QParallelAnimationGroup()\n        sanim = QSequentialAnimationGroup()\n        panim.addAnimation(sanim)\n\n        self.assertEqual(sanim.parent(), panim)\n\n        panim.clear()\n\n        self.assertRaises(RuntimeError, lambda :sanim.parent())\n\n        QTimer.singleShot(100, app.quit)\n        app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qbitarray_test.py",
    "content": "#!/usr/bin/python\n'''Tests if QBitArray class is iterable and also '~' (__invert__) and bitwise operators'''\n\nimport unittest\n\nfrom PySide.QtCore import QBitArray\n\ndef bool_list_from_qbitarray(qbitarray):\n    '''This function is used instead of a list comprehension because\n       the QBitArray is being tested also to check if it is providing\n       the iterable protocol.\n    '''\n    qbitarray_values = []\n    for i in range(qbitarray.size()):\n        qbitarray_values.append(qbitarray.at(i))\n    return qbitarray_values\n\nclass QBitArrayIsIterableTest(unittest.TestCase):\n    '''Tests if QBitArray class is iterable and also '~' (__invert__) and bitwise operators'''\n\n    def setUp(self):\n        #Acquire resources\n        self.qbitarray = QBitArray(3)\n        self.qbitarray_values = [True, False, False]\n        # WARNING: do not pythonify the following loop\n        for i in range(len(self.qbitarray_values)):\n            self.qbitarray.setBit(i, self.qbitarray_values[i])\n\n        self.inverted_qbitarray_values = [not bit for bit in self.qbitarray_values]\n\n        self.other_qbitarray = QBitArray(3)\n        self.other_qbitarray_values = [True, True, False]\n        # WARNING: do not pythonify the following loop\n        for i in range(len(self.other_qbitarray_values)):\n            self.other_qbitarray.setBit(i, self.other_qbitarray_values[i])\n\n    def tearDown(self):\n        #Release resources\n        del self.qbitarray\n        del self.other_qbitarray\n        del self.qbitarray_values\n        del self.other_qbitarray_values\n        del self.inverted_qbitarray_values\n\n    def testQBitArrayIsIterable(self):\n        #Tests if QBitArray class is iterable\n        qbitarray_is_iterable = True\n        try:\n            bitarray = [bit for bit in self.qbitarray]\n        except:\n            qbitarray_is_iterable = False\n        self.assertTrue(qbitarray_is_iterable)\n\n    def testQBitArrayInvertOperator(self):\n        #Tests QBitArray '~' (__invert__) operator\n        inverted_qbitarray = ~self.qbitarray\n        # WARNING: do not pythonify the following loop, the\n        # iterability of QBitArray class is tested in another place\n        inverted_qbitarray_values = bool_list_from_qbitarray(inverted_qbitarray)\n        self.assertEqual(self.inverted_qbitarray_values, inverted_qbitarray_values)\n\n    def testQBitArrayOrBitwiseOperator(self):\n        #Tests QBitArray '|' (or) operator\n        has_or_bitwise_operator = True\n        ored_qbitarray, ored_bool_list = None, None\n        try:\n            ored_qbitarray = self.qbitarray | self.other_qbitarray\n            ored_bool_list = [b1 | b2 for b1, b2 in zip(self.qbitarray_values, self.other_qbitarray_values)]\n        except:\n            has_or_bitwise_operator = False\n        self.assertTrue(has_or_bitwise_operator)\n        self.assertEqual(bool_list_from_qbitarray(ored_qbitarray), ored_bool_list)\n\n    def testQBitArrayAndBitwiseOperator(self):\n        #Tests QBitArray '&' (and) operator\n        has_and_bitwise_operator = True\n        anded_qbitarray, anded_bool_list = None, None\n        try:\n            anded_qbitarray = self.qbitarray | self.other_qbitarray\n            anded_bool_list = [b1 | b2 for b1, b2 in zip(self.qbitarray_values, self.other_qbitarray_values)]\n        except:\n            has_and_bitwise_operator = False\n        self.assertTrue(has_and_bitwise_operator)\n        self.assertEqual(bool_list_from_qbitarray(anded_qbitarray), anded_bool_list)\n\n    def testQBitArrayXorBitwiseOperator(self):\n        #Tests QBitArray '^' (xor) operator\n        has_xor_bitwise_operator = True\n        xored_qbitarray, xored_bool_list = None, None\n        try:\n            xored_qbitarray = self.qbitarray | self.other_qbitarray\n            xored_bool_list = [b1 | b2 for b1, b2 in zip(self.qbitarray_values, self.other_qbitarray_values)]\n        except:\n            has_xor_bitwise_operator = False\n        self.assertTrue(has_xor_bitwise_operator)\n        self.assertEqual(bool_list_from_qbitarray(xored_qbitarray), xored_bool_list)\n\n\nclass QBitArrayGetItemTest(unittest.TestCase):\n    '''Test case for []/__getitem__ operator'''\n\n    def create_bitarray(self, values):\n        '''helper function to create a bit array'''\n        obj = QBitArray(len(values))\n        for i, value in enumerate(values):\n            obj.setBit(i, value)\n        return obj\n\n    def testSequenceProtocol(self):\n        '''QBitArray sequence protocol'''\n        data = [True, False, True]\n        obj = self.create_bitarray(data)\n        for reference, value in zip(data, obj):\n            self.assertEqual(reference, value)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qbytearray_buffer_protocol_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Tests QByteArray implementation of Python buffer protocol'''\n\nimport unittest\nimport py3kcompat as py3k\n\nfrom os.path import isdir\nfrom PySide.QtCore import QByteArray\n\n\nclass QByteArrayBufferProtocolTest(unittest.TestCase):\n    '''Tests QByteArray implementation of Python buffer protocol'''\n\n    def testQByteArrayBufferProtocol(self):\n        if py3k.IS_PY3K:\n            return\n        #Tests QByteArray implementation of Python buffer protocol using the os.path.isdir\n        #function which an unicode object or other object implementing the Python buffer protocol\n        isdir(QByteArray('/tmp'))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qbytearray_concatenation_operator_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Test cases for QByteArray concatenation with '+' operator'''\n\nimport unittest\n\nfrom PySide.QtCore import QByteArray\n\nclass QByteArrayConcatenationOperatorTest(unittest.TestCase):\n    '''Test cases for QByteArray concatenation with '+' operator'''\n\n    def testConcatQByteArrayAndPythonString(self):\n        #Test concatenation of a QByteArray with a Python string, in this order\n        qba = QByteArray('foo')\n        result = qba + '\\x00bar'\n        self.assertEqual(type(result), QByteArray)\n        self.assertEqual(result, 'foo\\x00bar')\n\n    def testConcatPythonStringAndQByteArray(self):\n        #Test concatenation of a Python string with a QByteArray, in this order\n        concat_python_string_add_qbytearray_worked = True\n        qba = QByteArray('foo')\n        result = 'bar\\x00' + qba\n        self.assertEqual(type(result), QByteArray)\n        self.assertEqual(result, 'bar\\x00foo')\n\n    # NOTICE: Does not makes sense concat a unicode string with a QByteArray, because the\n    # user does not know nothing about the internal representation of the unicode string.\n    #def testConcatPythonUnicodeAndQByteArray(self):\n        ##Test concatenation of a Python unicode object with a QByteArray, in this order\n        #concat_python_unicode_add_qbytearray_worked = True\n        #qba = QByteArray('foo')\n        #result = None\n        #try:\n            #result = u'ümlaut' + qba\n        #except:\n            #concat_python_unicode_add_qbytearray_worked = False\n        #self.assertTrue(concat_python_unicode_add_qbytearray_worked)\n        #self.assertEqual(result.__class__.__name__, 'unicode')\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qbytearray_operator_iadd_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QByteArray\nfrom helper.docmodifier import DocModifier\n\nclass BaseQByteArrayOperatorIAdd(object):\n    '''Base class for QByteArray += operator tests.\n\n    Implementing classes should inherit from unittest.TestCase and implement\n    setUp, setting self.obj and self.orig_obj to the target QByteArray and original\n    one, respectively'''\n\n    __metaclass__ = DocModifier\n\n    def testSingleString(self):\n        '''QByteArray += string of size 1'''\n        s = '0'\n        self.obj += s\n        self.assertEqual(self.obj, self.orig_obj + s)\n        self.assertEqual(self.obj.size(), self.orig_obj.size() + len(s))\n\n    def testString(self):\n        '''QByteArray += string of size > 1'''\n        s = 'dummy'\n        self.obj += s\n        self.assertEqual(self.obj, self.orig_obj + s)\n        self.assertEqual(self.obj.size(), self.orig_obj.size() + len(s))\n\n    def testQByteArray(self):\n        '''QByteArray += QByteArray'''\n        s = QByteArray('array')\n        self.obj += s\n        self.assertEqual(self.obj, self.orig_obj + s)\n\n    def testChar(self):\n        '''QByteArray += char (number < 256)'''\n        s = ord('a')\n        self.obj += s\n        self.assertEqual(self.obj, self.orig_obj + s)\n        self.assertEqual(self.obj.size(), self.orig_obj.size() + 1)\n\nclass NullQByteArrayOperatorIAdd(unittest.TestCase, BaseQByteArrayOperatorIAdd):\n    '''Test case for operator QByteArray += on null QByteArrays'''\n\n    doc_prefix = 'Null object'\n    doc_filter = lambda x: x.startswith('test')\n\n    def setUp(self):\n        self.obj = QByteArray()\n        self.orig_obj = QByteArray()\n\n\nclass ValidQByteArrayOperatorIAdd(unittest.TestCase, BaseQByteArrayOperatorIAdd):\n    '''Test case for operator QByteArray += on valid QByteArrays'''\n\n    doc_prefix = 'Valid object'\n    doc_filter = lambda x: x.startswith('test')\n\n    def setUp(self):\n        self.obj = QByteArray('some byte array')\n        self.orig_obj = QByteArray('some byte array')\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qbytearray_operator_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Test cases for QByteArray operators'''\n\nimport unittest\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import QByteArray\n\nclass QByteArrayOperatorEqual(unittest.TestCase):\n    '''TestCase for operator QByteArray == QByteArray'''\n\n    def testDefault(self):\n        #QByteArray() == QByteArray()\n        obj1 = QByteArray()\n        obj2 = QByteArray()\n        self.assertEqual(obj1, obj2)\n\n    def testSimple(self):\n        #QByteArray(some_string) == QByteArray(some_string)\n        string = 'egg snakes'\n        self.assertEqual(QByteArray(string), QByteArray(string))\n\n    def testPyString(self):\n        #QByteArray(string) == string\n        string = 'my test string'\n        self.assertEqual(QByteArray(string), string)\n\n    def testQString(self):\n        #QByteArray(string) == string\n        string = 'another test string'\n        self.assertEqual(QByteArray(string), string)\n\nclass QByteArrayOperatorAt(unittest.TestCase):\n    '''TestCase for operator QByteArray[]'''\n\n    def testInRange(self):\n        #QByteArray[x] where x is a valid index\n        string = 'abcdefgh'\n        obj = QByteArray(string)\n\n        for i in range(len(string)):\n            self.assertEqual(obj[i], py3k.b(string[i]))\n\n    def testInRangeReverse(self):\n        #QByteArray[x] where x is a valid index (reverse order)\n        string = 'abcdefgh'\n        obj = QByteArray(string)\n\n        for i in range(len(string)-1, 0, -1):\n            self.assertEqual(obj[i], py3k.b(string[i]))\n\n\n    def testOutOfRange(self):\n        #QByteArray[x] where x is out of index\n        string = '1234567'\n        obj = QByteArray(string)\n        self.assertRaises(IndexError, lambda :obj[len(string)])\n\n    def testNullStrings(self):\n        ba = QByteArray('\\x00')\n        self.assertEqual(ba.at(0), '\\x00')\n        self.assertEqual(ba[0], py3k.b('\\x00'))\n\nclass QByteArrayOperatorLen(unittest.TestCase):\n    '''Test case for __len__ operator of QByteArray'''\n\n    def testBasic(self):\n        '''QByteArray __len__'''\n        self.assertEqual(len(QByteArray()), 0)\n        self.assertEqual(len(QByteArray('')), 0)\n        self.assertEqual(len(QByteArray(' ')), 1)\n        self.assertEqual(len(QByteArray('yabadaba')), 8)\n\n\nclass QByteArrayOperatorStr(unittest.TestCase):\n    '''Test case for __str__ operator of QByteArray'''\n\n    def testBasic(self):\n        '''QByteArray __str__'''\n        self.assertEqual(QByteArray().__str__(), '')\n        self.assertEqual(QByteArray('').__str__(), '')\n        self.assertEqual(QByteArray('aaa').__str__(), 'aaa')\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qbytearray_test.py",
    "content": "#!/usr/bin/python\n'''Unit tests for QByteArray'''\n\nimport unittest\nimport ctypes\nimport pickle\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import QByteArray, QSettings, QObject\n\nclass QByteArrayTestToNumber(unittest.TestCase):\n    def testToNumberInt(self):\n        obj = QByteArray('37')\n        self.assertEqual((37, True), obj.toInt())\n\n    def testToNumberUShort(self):\n        obj = QByteArray('37')\n        self.assertEqual((37, True), obj.toUShort())\n\n    def testToNumberFloat(self):\n        obj = QByteArray('37.109')\n        self.assertEqual((ctypes.c_float(37.109).value, True),\n                         obj.toFloat())\n\n    def testToNumberDouble(self):\n        obj = QByteArray('37.109')\n        self.assertEqual((ctypes.c_double(37.109).value, True),\n                         obj.toDouble())\n\n    def testSetNum(self):\n        b = QByteArray()\n        b.setNum(py3k.long(-124124))\n        self.assertEqual(b, \"-124124\")\n        b = QByteArray()\n        b.setNum(-124124)\n        self.assertEqual(b, \"-124124\")\n        b = QByteArray()\n        b.setNum(-0.5)\n        self.assertEqual(b, \"-0.5\")\n\n    def testAppend(self):\n        b = QByteArray()\n        b.append(\"A\")\n        self.assertEqual(b.size(), 1)\n        b.append(\"AB\")\n        self.assertEqual(b.size(), 3)\n\n\nclass QByteArraySplit(unittest.TestCase):\n    '''Test case for QByteArray.split'''\n\n    def testPathSeparator(self):\n        #QByteArray.split('/')\n        obj = QByteArray(unittest.__file__)\n        self.assertEqual(obj.split('/'), unittest.__file__.split('/'))\n\nclass QByteArrayData(unittest.TestCase):\n\n    '''Test case for QByteArray.data'''\n\n    def testData(self):\n        url = QByteArray(\"http://web.openbossa.org/\")\n        self.assertEqual(url.data(), py3k.b(\"http://web.openbossa.org/\"))\n\n    def testDataWithZeros(self):\n        s1 = \"123\\000321\"\n        ba = QByteArray(s1)\n        s2 = ba.data()\n        self.assertEqual(py3k.b(s1), s2)\n        self.assertEqual(s1, ba)\n\nclass QByteArrayOperatorAtSetter(unittest.TestCase):\n    '''Test case for operator QByteArray[] - __setitem__'''\n\n    def testSetterString(self):\n        '''QByteArray[x] = pythonstring'''\n        obj = QByteArray('123456')\n        obj[1] = '0'\n        self.assertEqual(obj, QByteArray('103456'))\n\n    def testSetterStringLarge(self):\n        '''QByteArray[x] = pythonstring (larget than 1 char)'''\n        obj = QByteArray('123456')\n        obj[3] = 'abba'\n        self.assertEqual(obj, QByteArray('123abba56'))\n\n    def testSetterQByteArray(self):\n        '''QByteArray[x] = qbytearray'''\n        obj = QByteArray('123456')\n        obj[3] = QByteArray('array')\n        self.assertEqual(obj, QByteArray('123array56'))\n\n\nclass QByteArrayOperatorAtSetterNegativeIndex(unittest.TestCase):\n    '''Test case for QByteArray[] - __setitem__ - for negative index'''\n\n    def testSetterNegativeIndex(self):\n        '''QByteArray[x] = string - negative index'''\n        obj = QByteArray('123456')\n        obj[-3] = 'array'\n        self.assertEqual(obj, QByteArray('123array56'))\n\n\nclass QByteArrayOperatorAtSetterLargeIndex(unittest.TestCase):\n    '''Test case for QByteArray[] - __setitem__ - for 'overflown' index'''\n\n    def testSetterLargeIndexEmpty(self):\n        '''QByteArray[x] = somestring - Overflow index on empty string'''\n        # should pad with spaces if the index is larger\n        obj = QByteArray('')\n        obj[2] = 'a'\n        self.assertEqual(obj, QByteArray('  a'))\n\n    def testSetterLargeIndexNormal(self):\n        '''QByteArray[x] = somestring - Overflow index on normal string'''\n        # should pad with spaces if the index is larger\n        obj = QByteArray('mystring')\n        obj[10] = 'normal'\n        self.assertEqual(obj, QByteArray('mystring  normal'))\n\nclass QByteArrayOnQVariant(unittest.TestCase):\n    def testQByteArrayOnQVariant(self):\n        a = QSettings().value(\"some_prop\", QByteArray())\n        self.assertEqual(type(a), QByteArray)\n\nclass TestBug666(unittest.TestCase):\n    '''QByteArray does not support slices'''\n    def testIt(self):\n        if not py3k.IS_PY3K:\n            ba = QByteArray('1234567890')\n            self.assertEqual(ba[2:4], '34')\n            self.assertEqual(ba[:4], '1234')\n            self.assertEqual(ba[4:], '567890')\n            self.assertEqual(len(ba[4:1]), 0)\n\nclass QByteArrayBug514(unittest.TestCase):\n    def testIt(self):\n        data = py3k.b(\"foobar\")\n        a = QByteArray.fromRawData(data)\n        self.assertEqual(type(a), QByteArray)\n        self.assertEqual(a.data(), data)\n\nclass TestPickler(unittest.TestCase):\n    def testIt(self):\n        ba = QByteArray(\"321\\x00123\")\n        output = pickle.dumps(str(ba))\n        ba2 = pickle.loads(output)\n        self.assertEqual(ba, ba2)\n\nclass QByteArrayBug720(unittest.TestCase):\n    def testIt(self):\n        ba = QByteArray(b\"32\\\"1\\x00123\")\n        self.assertEqual(str(ba), \"32\\\"1\\x00123\")\n        self.assertEqual(repr(ba), \"PySide.QtCore.QByteArray('32\\\"1\\x00123')\")\n\nclass QByteArrayImplicitConvert(unittest.TestCase):\n    def testString(self):\n        # No implicit conversions from QByteArray to python string\n        ba = QByteArray(\"object name\")\n        obj = QObject()\n        self.assertRaises(TypeError, obj.setObjectName, ba)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qcoreapplication_instance_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Test cases for QCoreApplication.instance static method'''\n\nimport unittest\n\nfrom PySide.QtCore import QCoreApplication\n\nclass QCoreApplicationInstanceTest(unittest.TestCase):\n    '''Test cases for QCoreApplication.instance static method'''\n\n    def testQCoreApplicationInstance(self):\n        #Tests QCoreApplication.instance()\n        self.assertEqual(QCoreApplication.instance(), None)\n        app = QCoreApplication([])\n        self.assertEqual(QCoreApplication.instance(), app)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qdatastream_test.py",
    "content": "#!/usr/bin/python\n'''Unit tests for QDataStream'''\n\nimport unittest\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import QBitArray, QByteArray, QIODevice, QDataStream, QDate, QTime, QDateTime\n\ndef create_bitarray(string):\n    array = QBitArray(len(string))\n    for i, char in enumerate(string):\n        array.setBit(i, char != '0')\n    return array\n\nclass QDataStreamWrite(unittest.TestCase):\n    '''Test case for QDatastream write* functions'''\n\n    def setUp(self):\n        self.ba = QByteArray()\n        self.read = QDataStream(self.ba, QIODevice.ReadOnly)\n        self.write = QDataStream(self.ba, QIODevice.WriteOnly)\n\n    def testWriteUInt8(self):\n        '''QDataStream.writeUInt8 (accepting str of size 1)'''\n        x = 0xFF\n        self.write.writeUInt8(x)\n        y = self.read.readUInt8()\n        self.assertEqual(x, y)\n\n        self.assertRaises(TypeError, self.write.writeUInt8, 'aaaaa')\n\n    def testWriteInt8(self):\n        '''QDataStream.writeInt8 (accepting str of size 1)'''\n        x = 65\n        self.write.writeInt8(chr(x))\n        y = self.read.readInt8()\n        self.assertEqual(x, y)\n\n        self.assertRaises(TypeError, self.write.writeInt8, 'aaaaa')\n\n    def testWriteUInt8Int(self):\n        '''QDataStream.writeUInt8 (accepting integer)'''\n        x = 0xFF\n        self.write.writeUInt8(x)\n        y = self.read.readUInt8()\n        self.assertEqual(x, y)\n\n    def testWriteInt8Int(self):\n        '''QDataStream.writeInt8 (accepting integer)'''\n        x = 65\n        self.write.writeInt8(x)\n        y = self.read.readInt8()\n        self.assertEqual(x, y)\n\n    def testWriteUInt16(self):\n        '''QDataStream.writeUInt16'''\n        x = 0x4423\n        self.write.writeUInt16(x)\n        y = int(self.read.readUInt16())\n        self.assertEqual(x, y)\n\n    def testWriteUInt32(self):\n        '''QDataStream.writeUInt32'''\n        x = 0xdeadbeef\n        self.write.writeUInt32(x)\n        y = int(self.read.readUInt32())\n        self.assertEqual(x, y)\n\nclass QDataStreamShift(unittest.TestCase):\n    '''Test case for << and >> operators'''\n\n    def setUp(self):\n        self.ba = QByteArray()\n        self.stream = QDataStream(self.ba, QIODevice.WriteOnly)\n        self.read_stream = QDataStream(self.ba, QIODevice.ReadOnly)\n\n    def testQCharValid(self):\n        '''QDataStream <<>> QChar - valid'''\n        self.stream.writeQChar(42)\n\n        res = self.read_stream.readQChar()\n        self.assertEqual(res, py3k.unichr(42))\n\n    def testQCharNull(self):\n        '''QDataStream <<>> QChar - null'''\n        self.stream.writeQChar(None)\n\n        res = self.read_stream.readQChar()\n        self.assertEqual(res, py3k.unicode_('\\x00'))\n\n    def testQByteArrayValid(self):\n        '''QDataStream <<>> QByteArray - valid'''\n        self.stream << QByteArray(\"hello\")\n\n        res = QByteArray()\n\n        self.read_stream >> res\n        self.assertEqual(res, QByteArray(\"hello\"))\n\n    def testQByteArrayEmpty(self):\n        '''QDataStream <<>> QByteArray - empty'''\n        self.stream << QByteArray(\"\")\n\n        res = QByteArray()\n\n        self.read_stream >> res\n        self.assertEqual(res, QByteArray(\"\"))\n        self.assertTrue(res.isEmpty())\n        self.assertFalse(res.isNull())\n\n    def testQByteArrayNull(self):\n        '''QDataStream <<>> QByteArray - null'''\n        self.stream << QByteArray()\n\n        res = QByteArray()\n\n        self.read_stream >> res\n        self.assertEqual(res, QByteArray())\n        self.assertTrue(res.isEmpty())\n        self.assertTrue(res.isNull())\n\n    def testQStringValid(self):\n        '''QDataStream <<>> QString - valid'''\n        self.stream.writeQString('Ka-boom')\n\n        res = self.read_stream.readQString()\n        self.assertEqual(res, py3k.unicode_('Ka-boom'))\n\n    def testQStringEmpty(self):\n        '''QDataStream <<>> QString - empty'''\n        self.stream.writeQString('')\n\n        res = self.read_stream.readQString()\n        self.assertEqual(res, py3k.unicode_(''))\n\n    def testQStringNull(self):\n        '''QDataStream <<>> QString - null'''\n        self.stream.writeQString(None)\n\n        res = self.read_stream.readQString()\n        self.assertEqual(res, py3k.unicode_(''))\n\n    def testQBitArrayNull(self):\n        '''QDataStream <<>> QBitArray - null'''\n        self.stream << QBitArray()\n\n        res = QBitArray()\n\n        self.read_stream >> res\n        self.assertEqual(res, QBitArray())\n\n    def testQBitArrayValid(self):\n        '''QDataStream <<>> QBitArray - valid'''\n        self.stream << create_bitarray('01010101')\n\n        res = QBitArray()\n\n        self.read_stream >> res\n        self.assertEqual(res, create_bitarray('01010101'))\n\n    def testQDateNull(self):\n        '''QDataStream <<>> QDate - null'''\n        self.stream << QDate()\n\n        res = QDate()\n\n        self.read_stream >> res\n        self.assertEqual(res, QDate())\n        self.assertFalse(res.isValid())\n        self.assertTrue(res.isNull())\n\n    def testQDateValid(self):\n        '''QDataStream <<>> QDate - valid'''\n        self.stream << QDate(2012, 12, 21)\n\n        res = QDate()\n\n        self.read_stream >> res\n        self.assertEqual(res, QDate(2012, 12, 21))\n        self.assertTrue(res.isValid())\n        self.assertFalse(res.isNull())\n\n\n    def testQTimeNull(self):\n        '''QDataStream <<>> QTime - null'''\n        self.stream << QTime()\n\n        res = QTime()\n\n        self.read_stream >> res\n        self.assertEqual(res, QTime())\n        self.assertFalse(res.isValid())\n        self.assertTrue(res.isNull())\n\n    def testQTimeValid(self):\n        '''QDataStream <<>> QTime - valid'''\n        self.stream << QTime(12, 12, 21)\n\n        res = QTime()\n\n        self.read_stream >> res\n        self.assertEqual(res, QTime(12, 12, 21))\n        self.assertTrue(res.isValid())\n        self.assertFalse(res.isNull())\n\n    def testQDateTimeNull(self):\n        '''QDataStream <<>> QDateTime - null'''\n\n        self.stream << QDateTime()\n\n        res = QDateTime()\n\n        self.read_stream >> res\n        self.assertEqual(res, QDateTime())\n        self.assertFalse(res.isValid())\n        self.assertTrue(res.isNull())\n\n    def testQDateTimeValid(self):\n        '''QDataStream <<>> QDateTime - valid'''\n        time = QTime(23, 23, 23)\n        date = QDate(2009, 1, 1)\n\n        self.stream << QDateTime(date, time)\n\n        res = QDateTime()\n\n        self.read_stream >> res\n        self.assertEqual(res, QDateTime(date, time))\n        self.assertTrue(res.isValid())\n        self.assertFalse(res.isNull())\n\n\nclass QDataStreamShiftBitArray(unittest.TestCase):\n\n    def _check_bitarray(self, data_set):\n        '''Check the >> operator for the given data set'''\n\n        for data, expectedStatus, expectedString in data_set:\n            stream = QDataStream(data, QIODevice.ReadOnly)\n            string = QBitArray()\n            stream >> string\n\n            self.assertEqual(stream.status(), expectedStatus)\n            self.assertEqual(string.size(), expectedString.size())\n            self.assertEqual(string, expectedString)\n\n    def testOk(self):\n        '''QDataStream with valid QBitArray'''\n        data = []\n\n        data.append((QByteArray('\\x00\\x00\\x00\\x00'), QDataStream.Ok,\n                     QBitArray()))\n        data.append((QByteArray('\\x00\\x00\\x00\\x01\\x00'), QDataStream.Ok,\n                     create_bitarray('0')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x01\\x01'), QDataStream.Ok,\n                     create_bitarray('1')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x02\\x03'), QDataStream.Ok,\n                     create_bitarray('11')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x03\\x07'), QDataStream.Ok,\n                     create_bitarray('111')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x04\\x0f'), QDataStream.Ok,\n                     create_bitarray('1111')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x05\\x1f'), QDataStream.Ok,\n                     create_bitarray('11111')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x06\\x3f'), QDataStream.Ok,\n                     create_bitarray('111111')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x07\\x7f'), QDataStream.Ok,\n                     create_bitarray('1111111')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x07\\x7e'), QDataStream.Ok,\n                     create_bitarray('0111111')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x07\\x00'), QDataStream.Ok,\n                     create_bitarray('0000000')))\n        data.append((QByteArray('\\x00\\x00\\x00\\x07\\x39'), QDataStream.Ok,\n                     create_bitarray('1001110')))\n\n        self._check_bitarray(data)\n\n    def testPastEnd(self):\n        '''QDataStream >> QBitArray reading past the end of the data'''\n        data = []\n\n        data.append((QByteArray(), QDataStream.ReadPastEnd,\n                     QBitArray()))\n        data.append((QByteArray('\\x00'), QDataStream.ReadPastEnd,\n                     QBitArray()))\n        data.append((QByteArray('\\x00\\x00'), QDataStream.ReadPastEnd,\n                     QBitArray()))\n        data.append((QByteArray('\\x00\\x00\\x00'), QDataStream.ReadPastEnd,\n                     QBitArray()))\n        data.append((QByteArray('\\x00\\x00\\x00\\x01'), QDataStream.ReadPastEnd,\n                     QBitArray()))\n        data.append((QByteArray('\\x00\\x00\\x00\\x02'), QDataStream.ReadPastEnd,\n                     QBitArray()))\n        data.append((QByteArray('\\x00\\x00\\x00\\x03'), QDataStream.ReadPastEnd,\n                     QBitArray()))\n        data.append((QByteArray('\\x00\\x00\\x00\\x04'), QDataStream.ReadPastEnd,\n                     QBitArray()))\n\n        self._check_bitarray(data)\n\n    def testCorruptData(self):\n        '''QDataStream reading corrupt data'''\n        data = []\n\n        data.append((QByteArray('\\x00\\x00\\x00\\x01\\x02'),\n                     QDataStream.ReadCorruptData,\n                     QBitArray()))\n\n        self._check_bitarray(data)\n\nclass QDataStreamRawData(unittest.TestCase):\n    def testRawData(self):\n        data = QDataStream()\n        self.assertEqual(data.readRawData(4), None)\n\n        ba = QByteArray()\n        data = QDataStream(ba, QIODevice.WriteOnly)\n        data.writeRawData('AB\\x00C')\n        self.assertEqual(ba.data(), py3k.b('AB\\x00C'))\n\n        data = QDataStream(ba)\n        self.assertEqual(data.readRawData(4), py3k.b('AB\\x00C'))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qdate_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QDate'''\n\nimport unittest\n\nfrom PySide.QtCore import *\n\nclass TestQDate (unittest.TestCase):\n    def testGetDate(self):\n        date = QDate(2009, 22, 9)\n        tuple_ = date.getDate()\n        self.assertEquals(tuple, tuple_.__class__)\n        (y, m, d) = tuple_\n        self.assertEqual(date.year(), y)\n        self.assertEqual(date.month(), m)\n        self.assertEqual(date.day(), d)\n\n    def testGetWeekNumber(self):\n        date = QDate(2000, 1, 1)\n        tuple_ = date.weekNumber()\n        self.assertEquals(tuple, tuple_.__class__)\n        (week, yearNumber) = tuple_\n        self.assertEqual(week, 52)\n        self.assertEqual(yearNumber, 1999)\n\n    def testBooleanCast(self):\n        today = QDate.currentDate()\n        self.assertTrue(today)\n        nodate = QDate()\n        self.assertFalse(nodate)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qdatetime_test.py",
    "content": "import unittest\nimport datetime\n\nfrom PySide.QtCore import QDateTime, QDate, QTime\n\nclass TestQDate (unittest.TestCase):\n    def testDateConversion(self):\n        dateTime = QDateTime(QDate(2011, 5, 17), QTime(11, 1, 14, 15))\n        dateTimePy = QDateTime(datetime.date(2011, 5, 17), datetime.time(11, 1, 14, 15000))\n        self.assertEqual(dateTime, dateTimePy)\n\n    def testDateTimeConversion(self):\n        dateTime = QDateTime(QDate(2011, 5, 17), QTime(11, 1, 14, 15))\n        dateTimePy = QDateTime(datetime.datetime(2011, 5, 17, 11, 1, 14, 15000))\n        self.assertEqual(dateTime, dateTimePy)\n\n    def testDateTimeNow(self):\n        py = datetime.datetime.now()\n        qt = QDateTime(py)\n        self.assertEqual(qt, py)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qeasingcurve_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QEasingCurve\n\ndef myFunction(progress):\n    if progress == 1.0:\n        return 100.0\n    else:\n        return -100.0\n\nclass TestQEasingCurve(unittest.TestCase):\n    def testCustomType(self):\n        ec = QEasingCurve()\n        ec.setCustomType(myFunction)\n        self.assertEqual(ec.valueForProgress(1.0), 100.0)\n        self.assertEqual(ec.valueForProgress(0.5), -100.0)\n\n    def testObjectCleanup(self):\n        for i in range(100):\n            ec = QEasingCurve()\n            ec.setCustomType(myFunction)\n            self.assertEqual(ec.valueForProgress(1.0), 100.0)\n            self.assertEqual(ec.valueForProgress(0.5), -100.0)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qenum_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QEnum and QFlags'''\n\nimport unittest\n\nfrom PySide.QtCore import *\n\nclass TestEnum(unittest.TestCase):\n\n    def testToInt(self):\n        self.assertEqual(QIODevice.NotOpen, 0)\n        self.assertEqual(QIODevice.ReadOnly, 1)\n        self.assertEqual(QIODevice.WriteOnly, 2)\n        self.assertEqual(QIODevice.ReadWrite, 1 | 2)\n        self.assertEqual(QIODevice.Append, 4)\n        self.assertEqual(QIODevice.Truncate, 8)\n        self.assertEqual(QIODevice.Text, 16)\n        self.assertEqual(QIODevice.Unbuffered, 32)\n\n    def testToIntInFunction(self):\n        self.assertEqual(str(int(QIODevice.WriteOnly)), \"2\")\n\nclass TestQFlags(unittest.TestCase):\n    def testToItn(self):\n        om = QIODevice.NotOpen\n\n        self.assertEqual(om, QIODevice.NotOpen)\n        self.assertTrue(om == 0)\n\n        self.assertTrue(om != QIODevice.ReadOnly)\n        self.assertTrue(om != 1)\n\n    def testToIntInFunction(self):\n        om = QIODevice.WriteOnly\n        self.assertEqual(int(om), 2)\n\n    def testNonExtensibleEnums(self):\n        try:\n            om = QIODevice.OpenMode(QIODevice.WriteOnly)\n            self.assertFail()\n        except:\n            pass\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qevent_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QtCore.QEvent'''\n\nimport unittest\n\nfrom PySide.QtCore import QEvent\n\nclass QEventTypeFlag(unittest.TestCase):\n    '''Test case for usage of QEvent.Type flags'''\n\n    def testFlagAccess(self):\n        #QEvent.Type flags usage\n\n        event = QEvent(QEvent.Timer)\n        self.assertEqual(event.type(), QEvent.Timer)\n\n        event = QEvent(QEvent.Close)\n        self.assertEqual(event.type(), QEvent.Close)\n\n        event = QEvent(QEvent.IconTextChange)\n        self.assertEqual(event.type(), QEvent.IconTextChange)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qfile_test.py",
    "content": "\nimport unittest\n\nimport os\nimport tempfile\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import QFile, QIODevice\n\nclass GetCharTest(unittest.TestCase):\n    '''Test case for QIODevice.getChar in QFile'''\n\n    def setUp(self):\n        '''Acquire resources'''\n        handle, self.filename = tempfile.mkstemp()\n        os.write(handle, py3k.b('a'))\n        os.close(handle)\n\n    def tearDown(self):\n        '''release resources'''\n        os.remove(self.filename)\n\n    def testBasic(self):\n        '''QFile.getChar'''\n        obj = QFile(self.filename)\n        obj.open(QIODevice.ReadOnly)\n        self.assertEqual(obj.getChar(), (True, 'a'))\n        self.assertFalse(obj.getChar()[0])\n        obj.close()\n\n    def testBug721(self):\n        obj = QFile(self.filename)\n        obj.open(QIODevice.ReadOnly)\n        memory = obj.map(0, 1)\n        self.assertEqual(len(memory), 1)\n        self.assertEqual(memory[0], py3k.b('a'))\n        obj.unmap(memory)\n        # now memory points to wild bytes... :-)\n        # uncommenting this must cause a segfault.\n        # self.assertEqual(memory[0], 'a')\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qfileinfo_test.py",
    "content": "\nimport unittest\n\nimport os\nimport tempfile\n\nfrom PySide.QtCore import QFile, QFileInfo\n\nclass QFileConstructor(unittest.TestCase):\n    '''QFileInfo constructor with qfile'''\n\n    def testBasic(self):\n        '''QFileInfo(QFile)'''\n        obj = QFileInfo(QFile())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qflags_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QFlags'''\n\nimport unittest\nfrom PySide.QtCore import Qt, QTemporaryFile, QFile, QIODevice, QObject\n\nclass QFlagTest(unittest.TestCase):\n    '''Test case for usage of flags'''\n\n    def testCallFunction(self):\n        f = QTemporaryFile()\n        self.assertTrue(f.open())\n        fileName = f.fileName()\n        f.close()\n\n        f = QFile(fileName)\n        self.assertEqual(f.open(QIODevice.Truncate | QIODevice.Text | QIODevice.ReadWrite), True)\n        om = f.openMode()\n        self.assertEqual(om & QIODevice.Truncate, QIODevice.Truncate)\n        self.assertEqual(om & QIODevice.Text, QIODevice.Text)\n        self.assertEqual(om & QIODevice.ReadWrite, QIODevice.ReadWrite)\n        self.assertTrue(om == QIODevice.Truncate | QIODevice.Text | QIODevice.ReadWrite)\n        f.close()\n\n\nclass QFlagOperatorTest(unittest.TestCase):\n    '''Test case for operators in QFlags'''\n\n    def testInvert(self):\n        '''QFlags ~ (invert) operator'''\n        self.assertEqual(type(~QIODevice.ReadOnly), QIODevice.OpenMode)\n\n    def testOr(self):\n        '''QFlags | (or) operator'''\n        self.assertEqual(type(QIODevice.ReadOnly | QIODevice.WriteOnly), QIODevice.OpenMode)\n\n    def testAnd(self):\n        '''QFlags & (and) operator'''\n        self.assertEqual(type(QIODevice.ReadOnly & QIODevice.WriteOnly), QIODevice.OpenMode)\n\n    def testIOr(self):\n        '''QFlags |= (ior) operator'''\n        flag = Qt.WindowFlags()\n        self.assertTrue(Qt.Widget == 0)\n        self.assertFalse(flag & Qt.Widget)\n        result = flag & Qt.Widget\n        self.assertTrue(result == 0)\n        flag |= Qt.WindowMinimizeButtonHint\n        self.assertTrue(flag & Qt.WindowMinimizeButtonHint)\n\n    def testInvertOr(self):\n        '''QFlags ~ (invert) operator over the result of an | (or) operator'''\n        self.assertEqual(type(~(Qt.ItemIsSelectable | Qt.ItemIsEditable)), Qt.ItemFlags)\n\n    def testEqual(self):\n        '''QFlags == operator'''\n        flags = Qt.Window\n        flags |= Qt.WindowMinimizeButtonHint\n        flag_type = (flags & Qt.WindowType_Mask)\n        self.assertEqual(flag_type, Qt.Window)\n\n        self.assertEqual(Qt.KeyboardModifiers(Qt.ControlModifier), Qt.ControlModifier)\n\n    def testOperatorBetweenFlags(self):\n        '''QFlags & QFlags'''\n        flags = Qt.NoItemFlags | Qt.ItemIsUserCheckable\n        newflags = Qt.NoItemFlags | Qt.ItemIsUserCheckable\n        self.assertTrue(flags & newflags)\n\n    def testOperatorDifferentOrder(self):\n        '''Different ordering of arguments'''\n        flags = Qt.NoItemFlags | Qt.ItemIsUserCheckable\n        self.assertEqual(flags | Qt.ItemIsEnabled, Qt.ItemIsEnabled | flags)\n\nclass QFlagsOnQVariant(unittest.TestCase):\n    def testQFlagsOnQVariant(self):\n        o = QObject()\n        o.setProperty(\"foo\", QIODevice.ReadOnly | QIODevice.WriteOnly)\n        self.assertEqual(type(o.property(\"foo\")), QIODevice.OpenMode)\n\nclass QFlagsWrongType(unittest.TestCase):\n    def testWrongType(self):\n        '''Wrong type passed to QFlags binary operators'''\n\n        self.assertRaises(TypeError, Qt.NoItemFlags | '43')\n        self.assertRaises(TypeError, Qt.NoItemFlags & '43')\n        self.assertRaises(TypeError, 'jabba' & Qt.NoItemFlags)\n        self.assertRaises(TypeError, 'hut' & Qt.NoItemFlags)\n        self.assertRaises(TypeError, Qt.NoItemFlags & QObject())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qhandle_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QEnum and QFlags'''\n\nimport unittest\n\nfrom PySide.QtCore import QThread, Qt\n\nclass TestHANDLE(unittest.TestCase):\n    def testIntConversion(self):\n        i = 0\n        h = QThread.currentThreadId()\n        i = 0 + int(h)\n        self.assertEqual(i, int(h))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qinstallmsghandler_test.py",
    "content": "\n'''Test cases for qInstallMsgHandler'''\n\nimport unittest\nimport sys\n\nfrom PySide.QtCore import *\n\nparam = []\n\ndef handler(msgt, msg):\n    global param\n    param = [msgt, msg.strip()]\n\ndef handleruseless(msgt, msg):\n    pass\n\nclass QInstallMsgHandlerTest(unittest.TestCase):\n\n    def tearDown(self):\n        # Ensure that next test will have a clear environment\n        qInstallMsgHandler(None)\n\n    def testNone(self):\n        ret = qInstallMsgHandler(None)\n        self.assertEqual(ret, None)\n\n    def testRet(self):\n        ret = qInstallMsgHandler(None)\n        self.assertEqual(ret, None)\n        refcount = sys.getrefcount(handleruseless)\n        retNone = qInstallMsgHandler(handleruseless)\n        self.assertEqual(sys.getrefcount(handleruseless), refcount + 1)\n        rethandler = qInstallMsgHandler(None)\n        self.assertEqual(rethandler, handleruseless)\n        del rethandler\n        self.assertEqual(sys.getrefcount(handleruseless), refcount)\n\n    def testHandler(self):\n        rethandler = qInstallMsgHandler(handler)\n        qDebug(\"Test Debug\")\n        self.assertEqual(param[0], QtDebugMsg)\n        self.assertEqual(param[1], \"Test Debug\")\n        qWarning(\"Test Warning\")\n        self.assertEqual(param[0], QtWarningMsg)\n        self.assertEqual(param[1], \"Test Warning\")\n        qCritical(\"Test Critical\")\n        self.assertEqual(param[0], QtCriticalMsg)\n        self.assertEqual(param[1], \"Test Critical\")\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qlinef_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QLineF'''\n\nimport unittest\nimport os\n\nfrom PySide.QtCore import *\n\nclass TestQLineF (unittest.TestCase):\n    def testIntersect(self):\n        l1 = QLineF(0, 0, 1, 0)\n        l2 = QLineF(1, -1, 1, 1)\n        tuple_ = l1.intersect(l2)\n        self.assertEquals(tuple, tuple_.__class__)\n        (value, p) = tuple_\n        self.assertEquals(QLineF.BoundedIntersection, value)\n        self.assertEqual(QPointF(1, 0), p)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qlocale_test.py",
    "content": "#!/usr/bin/python\n'''Unit tests for QLocale'''\n\nimport unittest\nimport ctypes\nimport sys\n\nfrom PySide.QtCore import QLocale\n\nclass QLocaleTestToNumber(unittest.TestCase):\n    def testToNumberInt(self):\n        obj = QLocale(QLocale.C)\n        self.assertEqual((37, True), obj.toInt('37'))\n\n    def testToNumberFloat(self):\n        obj = QLocale(QLocale.C)\n        self.assertEqual((ctypes.c_float(37.109).value, True),\n                         obj.toFloat('37.109'))\n\n    def testToNumberDouble(self):\n        obj = QLocale(QLocale.C)\n        self.assertEqual((ctypes.c_double(37.109).value, True),\n                         obj.toDouble('37.109'))\n\n    def testToNumberShort(self):\n        obj = QLocale(QLocale.C)\n        self.assertEqual((ctypes.c_short(37).value, True),\n                         obj.toShort('37'))\n\n    def testToNumberULongLong(self):\n        obj = QLocale(QLocale.C)\n        self.assertEqual((ctypes.c_ulonglong(37).value, True),\n                         obj.toULongLong('37'))\n\n    def testToNumberULongLongNegative(self):\n        obj = QLocale(QLocale.C)\n        self.assert_(not obj.toULongLong('-37')[1])\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qmetaobject_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Tests for static methos conflicts with class methods'''\n\nimport unittest\n\nfrom PySide.QtCore import *\n\nclass Foo(QFile):\n  pass\n\nclass DynObject(QObject):\n    def slot(self):\n        pass\n\nclass qmetaobject_test(unittest.TestCase):\n    \"\"\"\n    def test_QMetaObject(self):\n        qobj = QObject()\n        qobj_metaobj = qobj.metaObject()\n        self.assertEqual(qobj_metaobj.className(), \"QObject\")\n\n        obj = QFile()\n        m = obj.metaObject()\n        self.assertEqual(m.className(), \"QFile\")\n        self.assertNotEqual(m.methodCount(), qobj_metaobj.methodCount())\n\n        obj = Foo()\n        m = obj.metaObject()\n        self.assertEqual(m.className(), \"Foo\")\n        f = QFile()\n        fm = f.metaObject()\n        self.assertEqual(m.methodCount(), fm.methodCount())\n    \"\"\"        \n\n    def test_DynamicSlotSignal(self):\n        o = DynObject()\n        o2 = QObject()\n\n        o.connect(o2, SIGNAL(\"bars()\"), o.slot)\n        self.assertTrue(o2.metaObject().indexOfMethod(\"bars()\") > -1)\n        #self.assertTrue(o.metaObject().indexOfMethod(\"bar()\") == -1)\n        #self.assertTrue(o.metaObject().indexOfMethod(\"slot()\") > -1)\n\n        #slot_index = o.metaObject().indexOfMethod(\"slot()\")\n\n        #o.connect(o, SIGNAL(\"foo()\"), o2, SIGNAL(\"bar()\"))\n        #signal_index = o.metaObject().indexOfMethod(\"foo()\");\n\n        #self.assert_(slot_index != signal_index)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qmodelindex_internalpointer_test.py",
    "content": "# -*- coding: utf-8 -*-\n\n''' Test case for QAbstractListModel.createIndex and QModelIndex.internalPointer'''\n\nimport sys\nimport unittest\nfrom PySide.QtCore import *\n\nclass MyModel (QAbstractListModel):\n    pass\n\nclass TestQModelIndexInternalPointer(unittest.TestCase):\n    ''' Test case for QAbstractListModel.createIndex and QModelIndex.internalPointer'''\n\n    def setUp(self):\n        #Acquire resources\n        self.model = MyModel()\n\n    def tearDown(self):\n        #Release resources\n        del self.model\n\n    def testInternalPointer(self):\n        #Test QAbstractListModel.createIndex and\n        #QModelIndex.internalPointer with regular\n        #Python objects\n        idx = self.model.createIndex(0, 0, \"Hello\")\n        self.assertEqual(\"Hello\", idx.internalPointer())\n        a = [1, 2, 3]\n        idx = self.model.createIndex(0, 0, a)\n        self.assertEqual(a, idx.internalPointer())\n\n    def testReferenceCounting(self):\n        #Test reference counting when retrieving data with\n        #QModelIndex.internalPointer\n        a = [1, 2, 3]\n        a_refcnt = sys.getrefcount(a)\n        idx = self.model.createIndex(0, 0, a)\n        ptr = idx.internalPointer()\n        self.assertEqual(sys.getrefcount(a), a_refcnt + 1)\n\n    def testIndexForDefaultDataArg(self):\n        #Test QAbstractListModel.createIndex with a default\n        #value for data argument\n        idx = self.model.createIndex(0, 0)\n        self.assertEqual(None, idx.internalPointer())\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qobject_children_segfault_test.py",
    "content": "\n'''Test cases for parent-child relationship'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, QCoreApplication\n\nclass ChildrenCoreApplication(unittest.TestCase):\n    '''Test case for calling QObject.children after creating a QCoreApp'''\n\n    def testQCoreAppChildren(self):\n        #QObject.children() after creating a QCoreApplication\n        # Minimal test:\n        # 1- Create QCoreApp\n        # 2- Create parent and childrens\n        # 3- While keeping the children alive, call parent.children()\n        # 4- Delete parent\n        app = QCoreApplication([])\n        parent = QObject()\n        children = [QObject(parent) for x in range(25)]\n        # Uncomment the lines below to make the test pass\n        # del children\n        # del child2\n        del parent # XXX Segfaults here\n        self.assert_(True)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_connect_notify_test.py",
    "content": "# -*- coding: utf-8 -*-\n\n''' Test case for QObject::connectNotify()'''\n\nimport unittest\nfrom PySide.QtCore import *\nfrom helper import UsesQCoreApplication\n\ndef cute_slot():\n    pass\n\nclass Obj(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n        self.con_notified = False\n        self.dis_notified = False\n        self.signal = \"\"\n\n    def connectNotify(self, signal):\n        self.con_notified = True\n        self.signal = signal\n\n    def disconnectNotify(self, signal):\n        self.dis_notified = True\n\n    def reset(self):\n        self.con_notified = False\n        self.dis_notified = False\n\nclass TestQObjectConnectNotify(UsesQCoreApplication):\n    '''Test case for QObject::connectNotify'''\n    def setUp(self):\n        UsesQCoreApplication.setUp(self)\n        self.called = False             \n\n    def tearDown(self):\n        UsesQCoreApplication.tearDown(self)\n\n    def testBasic(self):\n        sender = Obj()\n        receiver = QObject()\n        sender.connect(SIGNAL(\"destroyed()\"), receiver, SLOT(\"deleteLater()\"))\n        self.assert_(sender.con_notified)\n        self.assertEqual(sender.signal, SIGNAL(\"destroyed()\"))\n        sender.disconnect(SIGNAL(\"destroyed()\"), receiver, SLOT(\"deleteLater()\"))\n        self.assert_(sender.dis_notified)\n\n    def testPySignal(self):\n        sender = Obj()\n        receiver = QObject()\n        sender.connect(SIGNAL(\"foo()\"), receiver, SLOT(\"deleteLater()\"))\n        self.assert_(sender.con_notified)\n        sender.disconnect(SIGNAL(\"foo()\"), receiver, SLOT(\"deleteLater()\"))\n        self.assert_(sender.dis_notified)\n\n    def testPySlots(self):\n        sender = Obj()\n        receiver = QObject()\n        sender.connect(SIGNAL(\"destroyed()\"), cute_slot)\n        self.assert_(sender.con_notified)\n        sender.disconnect(SIGNAL(\"destroyed()\"), cute_slot)\n        self.assert_(sender.dis_notified)\n\n    def testpyAll(self):\n        sender = Obj()\n        receiver = QObject()\n        sender.connect(SIGNAL(\"foo()\"), cute_slot)\n        self.assert_(sender.con_notified)\n        sender.disconnect(SIGNAL(\"foo()\"), cute_slot)\n        self.assert_(sender.dis_notified)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_destructor.py",
    "content": "import sys\nimport unittest\nfrom PySide import QtCore\n\nclass MyObject(QtCore.QObject):\n    def __init__(self, other=None):\n        QtCore.QObject.__init__(self, None)\n        self._o = other\n\nclass TestDestructor(unittest.TestCase):\n    def testReference(self):\n        o = QtCore.QObject()\n        m = MyObject(o)\n        self.assertEqual(sys.getrefcount(o), 3)\n        del m\n        self.assertEqual(sys.getrefcount(o), 2)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_event_filter_test.py",
    "content": "\n'''Test cases for QObject.eventFilter'''\n\nimport unittest\nimport weakref\nimport sys\n\nfrom PySide.QtCore import QObject, QTimerEvent\n\nfrom helper import UsesQCoreApplication\n\nclass FilterObject(QObject):\n    '''Filter object for the basic test'''\n    def __init__(self, obj=None, event_type=None, *args):\n        #Creates a new filter object\n        QObject.__init__(self, *args)\n        self.obj = obj\n        self.event_type = event_type\n        self.events_handled = 0\n        self.events_bypassed = 0\n\n    def setTargetObject(self, obj):\n        #Sets the object that will be filtered\n        self.obj = obj\n\n    def eventFilter(self, obj, event):\n        '''Just checks if is the correct object and event type\n        incrementing counter until reaching the limit. After that it\n        stops filtering the events for the object.'''\n        if (self.obj == obj):\n            if isinstance(event, self.event_type) and self.events_handled < 5:\n                self.events_handled += 1\n                return True\n            else:\n                self.events_bypassed += 1\n                return False\n        else:\n            return QObject.eventFilter(self, obj, event)\n\nclass FilteredObject(QObject):\n    '''Class that will be filtered. Quits the app after 5 timer events'''\n    def __init__(self, app, *args):\n        QObject.__init__(self, *args)\n        self.app = app\n        self.times_called = 0\n\n    def timerEvent(self, evt):\n        #Overriden method\n        self.times_called += 1\n\n        if self.times_called == 5:\n            self.app.quit()\n\nclass TestQObjectEventFilterPython(UsesQCoreApplication):\n    '''QObject.eventFilter - Reimplemented in python\n    Filters 5 TimerEvents and then bypasses the other events to the\n    timerEvent method. After 5 runs, the timerEvent method will ask\n    the core application to exit'''\n    def setUp(self):\n        #Acquire resources\n        UsesQCoreApplication.setUp(self)\n        self.obj_filter = FilterObject(event_type=QTimerEvent)\n    def tearDown(self):\n        #Release resources\n        del self.obj_filter\n        UsesQCoreApplication.tearDown(self)\n\n    def testEventFilter(self):\n        #QObject.eventFilter reimplemented in python\n        filtered = FilteredObject(self.app)\n        filtered.installEventFilter(self.obj_filter)\n        self.obj_filter.setTargetObject(filtered)\n\n        filtered.startTimer(0)\n\n        self.app.exec_()\n\n        self.assertEqual(filtered.times_called, 5)\n        self.assertEqual(self.obj_filter.events_handled, 5)\n\n    def testInstallEventFilterRefCountAfterDelete(self):\n        '''Bug 910 - installEventFilter() increments reference count on target object\n        http://bugs.pyside.org/show_bug.cgi?id=910'''\n        obj = QObject()\n        filt = QObject()\n\n        self.assertEqual(sys.getrefcount(obj), 2)\n        self.assertEqual(sys.getrefcount(filt), 2)\n        obj.installEventFilter(filt)\n        self.assertEqual(sys.getrefcount(obj), 2)\n        self.assertEqual(sys.getrefcount(filt), 2)\n\n        wref = weakref.ref(obj)\n        del obj\n        self.assertEqual(wref(), None)\n\n    def testInstallEventFilterRefCountAfterRemove(self):\n        # Bug 910\n        obj = QObject()\n        filt = QObject()\n\n        self.assertEqual(sys.getrefcount(obj), 2)\n        self.assertEqual(sys.getrefcount(filt), 2)\n        obj.installEventFilter(filt)\n        self.assertEqual(sys.getrefcount(obj), 2)\n        self.assertEqual(sys.getrefcount(filt), 2)\n        obj.removeEventFilter(filt)\n        self.assertEqual(sys.getrefcount(obj), 2)\n        self.assertEqual(sys.getrefcount(filt), 2)\n\n        wref = weakref.ref(obj)\n        del obj\n        self.assertEqual(wref(), None)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_inherits_test.py",
    "content": "'''Test cases for QObject methods'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject\n\nclass InheritsCase(unittest.TestCase):\n    '''Test case for QObject.inherits'''\n\n    def testCppInheritance(self):\n        #QObject.inherits() for c++ classes\n        #An class inherits itself\n        self.assert_(QObject().inherits('QObject'))\n\n    def testPythonInheritance(self):\n        #QObject.inherits() for python classes\n\n        class Dummy(QObject):\n            #Dummy class\n            pass\n\n        self.assert_(Dummy().inherits('QObject'))\n        self.assert_(Dummy().inherits('Dummy'))\n        self.assert_(not Dummy().inherits('FooBar'))\n\n    def testPythonMultiInheritance(self):\n        #QObject.inherits() for multiple inheritance\n        # QObject.inherits(classname) should fail if classname isn't a\n        # QObject subclass\n\n        class Parent(object):\n            #Dummy parent\n            pass\n        class Dummy(QObject, Parent):\n            #Dummy class\n            pass\n\n        self.assert_(Dummy().inherits('QObject'))\n        self.assert_(not Dummy().inherits('Parent'))\n\n    def testSetAttributeBeforeCallingInitOnQObjectDerived(self):\n        '''Test for bug #428.'''\n        class DerivedObject(QObject):\n            def __init__(self):\n                self.member = 'member'\n                QObject.__init__(self)\n        obj0 = DerivedObject()\n        # The second instantiation of DerivedObject will generate an exception\n        # that will not come to surface immediately.\n        obj1 = DerivedObject()\n        # The mere calling of the object method causes\n        # the exception to \"reach the surface\".\n        obj1.objectName()\n\n    def testMultipleInheritance(self):\n        def declareClass():\n            class Foo(object, QObject):\n                pass\n\n        self.assertRaises(TypeError, declareClass)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_objectproperty_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Test case for the bug #378\nhttp://bugs.openbossa.org/show_bug.cgi?id=378\n'''\n\nimport unittest\nfrom PySide.QtCore import QObject\n\nclass ExtQObject(QObject):\n    def __init__(self):\n        # \"foobar\" will become a object attribute that will not be\n        # listed on the among the type attributes. Thus for bug\n        # condition be correctly triggered the \"foobar\" attribute\n        # must not previously exist in the parent class.\n        self.foobar = None\n        # The parent __init__ method must be called after the\n        # definition of \"self.foobar\".\n        QObject.__init__(self)\n\nclass TestBug378(unittest.TestCase):\n    '''Test case for the bug #378'''\n\n    def testBug378(self):\n        obj = ExtQObject()\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qobject_parent_test.py",
    "content": "\n'''Test cases for parent-child relationship'''\n\nimport unittest\nfrom sys import getrefcount\n\nfrom PySide.QtCore import *\n\nclass ParentRefCountCase(unittest.TestCase):\n    '''Test case for the refcount changes of setParent'''\n\n    def setUp(self):\n        #Acquire resources\n        self.parent = QObject()\n        self.child = QObject()\n\n    def tearDown(self):\n        #Release resources\n        del self.child\n        del self.parent\n\n    def testSetParent(self):\n        #QObject.setParent() refcount changes\n        self.assertEqual(getrefcount(self.child), 2)\n        self.child.setParent(self.parent)\n        self.assertEqual(getrefcount(self.child), 3)\n\n    def testSetParentTwice(self):\n        self.assertEqual(getrefcount(self.child), 2)\n        self.child.setParent(self.parent)\n        self.assertEqual(getrefcount(self.child), 3)\n        self.child.setParent(self.parent)\n        self.assertEqual(getrefcount(self.child), 3)\n\n    def testConstructor(self):\n        #QObject(QObject) refcount changes\n        child = QObject(self.parent)\n        self.assertEqual(getrefcount(child), 3)\n\nclass ParentCase(unittest.TestCase):\n    '''Small collection of tests related to parent-child relationship'''\n\n    def testSetParent(self):\n        #QObject.setParent()\n        parent = QObject()\n        child = QObject()\n        child.setParent(parent)\n\n        self.assertEqual(parent, child.parent())\n\n    def testParentConstructor(self):\n        #QObject(parent)\n        parent = QObject()\n        child = QObject(parent)\n\n        self.assertEqual(parent, child.parent())\n\n        orig_repr = repr(child)\n        del child\n        self.assertEqual(orig_repr, repr(parent.children()[0]))\n\n    def testChildren(self):\n        #QObject.children()\n        parent = QObject()\n        children = [QObject(parent) for x in range(25)]\n\n        self.assertEqual(parent.children(), children)\n\n    def testFindChild(self):\n        #QObject.findChild() with all QObject\n        parent = QObject()\n        name = 'object%d'\n        children = [QObject(parent) for i in range(20)]\n\n        for i, child in enumerate(children):\n            child.setObjectName(name % i)\n\n        for i, child in enumerate(children):\n            self.assertEqual(child, parent.findChild(QObject, name % i))\n\n    def testFindChildWithoutName(self):\n        parent = QObject()\n        name = 'object%d'\n        children = [QObject(parent) for i in range(20)]\n\n        for i, child in enumerate(children):\n            child.setObjectName(name % i)\n\n        child = parent.findChild(QObject)\n        self.assertTrue(isinstance(child, QObject))\n\n    def testFindChildren(self):\n        #QObject.findChildren() with all QObject\n        parent = QObject()\n        target_name = 'foo'\n        children = [QTimer(parent) for i in range(20)]\n        children.extend([QObject(parent) for i in range(20)])\n\n        for i, child in enumerate(children):\n            if i % 5 == 0:\n                child.setObjectName(target_name)\n            else:\n                child.setObjectName(str(i))\n\n        # Emulates findChildren with the intended outcome\n        target_children = [x for x in children if x.objectName() == target_name]\n        test_children = parent.findChildren(QObject, target_name)\n        self.assertEqual(target_children, test_children)\n\n        # test findChildren default value\n        res = parent.findChildren(QTimer)\n        self.assertEqual(len(res), 20)\n\n        # test findChildre with a regex\n        res = parent.findChildren(QObject, QRegExp(\"^fo+\"))\n        self.assertEqual(res, test_children)\n\n\n    def testParentEquality(self):\n        #QObject.parent() == parent\n        parent = QObject()\n        child = QObject(parent)\n        self.assertEqual(parent, child.parent())\n\n\nclass TestParentOwnership(unittest.TestCase):\n    '''Test case for Parent/Child object ownership'''\n\n    def testParentDestructor(self):\n        parent = QObject()\n        self.assertEqual(getrefcount(parent), 2)\n\n        child = QObject(parent)\n        self.assertEqual(getrefcount(child), 3)\n        self.assertEqual(getrefcount(parent), 2)\n\n        del parent\n        self.assertEqual(getrefcount(child), 2)\n\n        # this will fail because parent deleted child cpp object\n        self.assertRaises(RuntimeError, lambda :child.objectName())\n\n    # test parent with multiples children\n    def testMultipleChildren(self):\n        o = QObject()\n        self.assertEqual(getrefcount(o), 2)\n\n        c = QObject(o)\n        self.assertEqual(getrefcount(c), 3)\n        self.assertEqual(getrefcount(o), 2)\n\n        c2 = QObject(o)\n        self.assertEqual(getrefcount(o), 2)\n        self.assertEqual(getrefcount(c), 3)\n        self.assertEqual(getrefcount(c2), 3)\n\n        del o\n        self.assertEqual(getrefcount(c), 2)\n        self.assertEqual(getrefcount(c2), 2)\n\n        # this will fail because parent deleted child cpp object\n        self.assertRaises(RuntimeError, lambda :c.objectName())\n        self.assertRaises(RuntimeError, lambda :c2.objectName())\n\n    # test recursive parent\n    def testRecursiveParent(self):\n        o = QObject()\n        self.assertEqual(getrefcount(o), 2)\n\n        c = QObject(o)\n        self.assertEqual(getrefcount(c), 3)\n        self.assertEqual(getrefcount(o), 2)\n\n        c2 = QObject(c)\n        self.assertEqual(getrefcount(o), 2)\n        self.assertEqual(getrefcount(c), 3)\n        self.assertEqual(getrefcount(c2), 3)\n\n        del o\n        self.assertEqual(getrefcount(c), 2)\n        self.assertEqual(getrefcount(c2), 2)\n\n        # this will fail because parent deleted child cpp object\n        self.assertRaises(RuntimeError, lambda :c.objectName())\n        self.assertRaises(RuntimeError, lambda :c2.objectName())\n\n    # test parent transfer\n    def testParentTransfer(self):\n        o = QObject()\n        self.assertEqual(getrefcount(o), 2)\n\n        c = QObject()\n        self.assertEqual(getrefcount(c), 2)\n\n        c.setParent(o)\n        self.assertEqual(getrefcount(c), 3)\n\n        c.setParent(None)\n        self.assertEqual(getrefcount(c), 2)\n\n        del c\n        del o\n\n\nclass ExtQObject(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n\nclass ReparentingTest(unittest.TestCase):\n    '''Test cases for reparenting'''\n\n    def testParentedQObjectIdentity(self):\n        object_list = []\n        parent = QObject()\n        for i in range(3):\n            obj = QObject()\n            object_list.append(obj)\n            obj.setParent(parent)\n        for child in parent.children():\n            self.assertTrue(child in object_list)\n\n    def testParentedExtQObjectType(self):\n        object_list = []\n        parent = QObject()\n        for i in range(3):\n            obj = ExtQObject()\n            object_list.append(obj)\n            obj.setParent(parent)\n        for orig, child in zip(object_list, parent.children()):\n            self.assertEqual(type(orig), type(child))\n\n    def testReparentedQObjectIdentity(self):\n        object_list = []\n        old_parent = QObject()\n        new_parent = QObject()\n        for i in range(3):\n            obj = QObject()\n            object_list.append(obj)\n            obj.setParent(old_parent)\n        for obj in object_list:\n            obj.setParent(new_parent)\n        for child in new_parent.children():\n            self.assertTrue(child in object_list)\n\n    def testReparentedExtQObjectType(self):\n        object_list = []\n        old_parent = QObject()\n        new_parent = QObject()\n        for i in range(3):\n            obj = ExtQObject()\n            object_list.append(obj)\n            obj.setParent(old_parent)\n        for obj in object_list:\n            obj.setParent(new_parent)\n        for orig, child in zip(object_list, new_parent.children()):\n            self.assertEqual(type(orig), type(child))\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_property_test.py",
    "content": "\n'''Test cases for QObject property and setProperty'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, Property, Signal\n\nclass MyObjectWithNotifyProperty(QObject):\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n        self.p = 0\n\n    def readP(self):\n        return self.p\n\n    def writeP(self, v):\n        self.p = v\n        self.notifyP.emit()\n\n    notifyP = Signal()\n    myProperty = Property(int, readP, fset=writeP, notify=notifyP)\n\nclass PropertyWithNotify(unittest.TestCase):\n    def called(self):\n        self.called_ = True\n\n    def testNotify(self):\n        self.called_ = False\n        obj = MyObjectWithNotifyProperty()\n        obj.notifyP.connect(self.called)\n        obj.myProperty = 10\n        self.assert_(self.called_)\n\n    def testHasProperty(self):\n        o = MyObjectWithNotifyProperty()\n        o.setProperty(\"myProperty\", 10)\n        self.assertEqual(o.myProperty, 10)\n        self.assertEqual(o.property(\"myProperty\"), 10)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_protected_methods_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QObject protected methods'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, QThread, SIGNAL\n\nclass Dummy(QObject):\n    '''Dummy class'''\n    pass\n\nclass QObjectReceivers(unittest.TestCase):\n    '''Test case for QObject.receivers()'''\n\n    def cb(self, *args):\n        #Dummy callback\n        pass\n\n    def testQObjectReceiversExtern(self):\n        #QObject.receivers() - Protected method external access\n\n        obj = Dummy()\n        self.assertEqual(obj.receivers(SIGNAL(\"destroyed()\")), 0)\n\n        QObject.connect(obj, SIGNAL(\"destroyed()\"), self.cb)\n        self.assertEqual(obj.receivers(SIGNAL(\"destroyed()\")), 1)\n\n    def testQThreadReceiversExtern(self):\n        #QThread.receivers() - Inherited protected method\n\n        obj = QThread()\n        self.assertEqual(obj.receivers(SIGNAL('destroyed()')), 0)\n        QObject.connect(obj, SIGNAL(\"destroyed()\"), self.cb)\n        self.assertEqual(obj.receivers(SIGNAL(\"destroyed()\")), 1)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Test cases for QObject methods'''\n\nimport unittest\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import QObject\n\nclass ObjectNameCase(unittest.TestCase):\n    '''Tests related to QObject object name'''\n\n    def testSimple(self):\n        #QObject.objectName(string)\n        name = 'object1'\n        obj = QObject()\n        obj.setObjectName(name)\n\n        self.assertEqual(name, obj.objectName())\n\n    def testEmpty(self):\n        #QObject.objectName('')\n        name = ''\n        obj = QObject()\n        obj.setObjectName(name)\n\n        self.assertEqual(name, obj.objectName())\n\n    def testDefault(self):\n        #QObject.objectName() default\n        obj = QObject()\n        self.assertEqual('', obj.objectName())\n\n    def testUnicode(self):\n        name = py3k.unicode_('não')\n        #FIXME Strange error on upstream when using equal(name, obj)\n        obj = QObject()\n        obj.setObjectName(name)\n        self.assertEqual(obj.objectName(), name)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_timer_event_test.py",
    "content": "#!/usr/bin/python\n'''Test case for QObject.timerEvent overloading'''\n\nimport unittest\nfrom time import sleep\nfrom PySide.QtCore import QObject, QCoreApplication\n\nfrom helper import UsesQCoreApplication\n\nclass Dummy(QObject):\n\n    def __init__(self, app):\n        super(Dummy, self).__init__()\n        self.times_called = 0\n        self.app = app\n\n    def timerEvent(self, event):\n        QObject.timerEvent(self, event)\n        event.accept()\n        self.times_called += 1\n\n        if self.times_called == 5:\n            self.app.exit(0)\n\nclass QObjectTimerEvent(UsesQCoreApplication):\n\n    def setUp(self):\n        #Acquire resources\n        super(QObjectTimerEvent, self).setUp()\n\n    def tearDown(self):\n        #Release resources\n        super(QObjectTimerEvent, self).tearDown()\n\n    def testTimerEvent(self):\n        #QObject.timerEvent overloading\n        obj = Dummy(self.app)\n        timer_id = obj.startTimer(200)\n        self.app.exec_()\n        obj.killTimer(timer_id)\n        self.assertEqual(obj.times_called, 5)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qobject_tr_as_instance_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n'''Unit tests for QObject's tr and trUtf8 static methods.'''\n\nimport os\nimport unittest\nfrom PySide.QtCore import QObject\n\n#from helper import UsesQCoreApplication\n\nclass QObjectTrTest(unittest.TestCase):\n    '''Test case to check if QObject tr and trUtf8 static methods could be treated as instance methods.'''\n\n    def setUp(self):\n        self.obj = QObject()\n\n    def tearDown(self):\n        del self.obj\n\n    def testTrCommonCase(self):\n        #Test common case for QObject.tr\n        invar1 = 'test1'\n        outvar1 = self.obj.tr(invar1)\n        invar2 = 'test2'\n        outvar2 = self.obj.tr(invar2, 'test comment')\n        self.assertEqual((invar1, invar2), (outvar1, outvar2))\n\n    def testTrAsInstanceMethod(self):\n        #Test QObject.tr as instance\n        invar1 = 'test1'\n        outvar1 = QObject.tr(self.obj, invar1)\n        invar2 = 'test2'\n        outvar2 = QObject.tr(self.obj, invar2, 'test comment')\n        self.assertEqual((invar1, invar2), (outvar1, outvar2))\n\n    def testTrUtf8CommonCase(self):\n        #Test common case for QObject.trUtf8\n        invar1 = 'test1'\n        outvar1 = self.obj.trUtf8(invar1)\n        invar2 = 'test2'\n        outvar2 = self.obj.trUtf8(invar2, 'test comment')\n        self.assertEqual((invar1, invar2), (outvar1, outvar2))\n\n    def testTrUtf8AsInstanceMethod(self):\n        #Test QObject.trUtf8 as instance\n        invar1 = 'test1'\n        outvar1 = QObject.trUtf8(self.obj, invar1)\n        invar2 = 'test2'\n        outvar2 = QObject.trUtf8(self.obj, invar2, 'test comment')\n        self.assertEqual((invar1, invar2), (outvar1, outvar2))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qpoint_test.py",
    "content": "\n'''Test cases for QPoint and QPointF'''\n\nimport unittest\n\nfrom PySide.QtCore import QPoint, QPointF\n\n\nclass QPointTest(unittest.TestCase):\n\n    def testQPointCtor(self):\n        point = QPoint(QPoint(10,20))\n\nclass QPointFTest(unittest.TestCase):\n\n    def testQPointFCtor(self):\n        pointf = QPointF(QPoint(10,20))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qprocess_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QProcess'''\n\nimport unittest\nimport os\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import *\n\nclass TestQProcess (unittest.TestCase):\n    def testStartDetached(self):\n        value, pid = QProcess.startDetached(\"dir\", [], os.getcwd())\n        self.assertTrue(isinstance(value, bool))\n        self.assertTrue(isinstance(pid, py3k.long))\n\n    def testPid(self):\n        p = QProcess()\n        p.start(\"dir\")\n        p.waitForStarted()\n        pid = p.pid()\n        # We can't test the pid method result because it returns 0 when the\n        # process isn't running\n        if p.state() == QProcess.Running:\n            self.assertNotEqual(pid, 0)\n        else:\n            print(\"PROCESS ALREADY DEAD :-/\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qproperty_decorator.py",
    "content": "import weakref\nimport unittest\n\nfrom PySide.QtCore import QObject, Property\n\nclass MyObject(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n        self._value = None\n\n    @Property(int)\n    def value(self):\n        return self._value\n\n    @value.setter\n    def valueSet(self, value):\n        self._value = value\n\n\nclass PropertyTest(unittest.TestCase):\n    def destroyCB(self, obj):\n        self._obDestroyed = True\n\n    def testDecorator(self):\n        self._obDestroyed = False\n        o = MyObject()\n        weak = weakref.ref(o, self.destroyCB)\n        o.value = 10\n        self.assertEqual(o._value, 10)\n        self.assertEqual(o.value, 10)\n        del o\n        self.assertTrue(self._obDestroyed)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qrect_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QRect'''\n\nimport unittest\n\nfrom PySide.QtCore import QPoint, QRect, QRectF\n\nclass RectConstructor(unittest.TestCase):\n\n    def testDefault(self):\n        #QRect()\n        obj = QRect()\n\n        self.assert_(obj.isNull())\n\n    def testConstructorQPoint(self):\n        topLeft = QPoint(3, 0)\n        bottomRight = QPoint(0, 3)\n\n        rect1 = QRect(topLeft, bottomRight)\n        rect2 = QRect(topLeft, bottomRight)\n\n        self.assertEqual(rect1, rect2)\n\nclass RectOperator(unittest.TestCase):\n    '''Test case for QRect operators'''\n\n    def testEqual(self):\n        '''QRect == QRect\n        Note: operator == must be working as it's the main check\n        for correctness'''\n        rect1 = QRect()\n        rect2 = QRect()\n        self.assertEqual(rect1, rect2)\n\n        rect1 = QRect(0, 4, 100, 300)\n        rect2 = QRect(0, 4, 100, 300)\n        self.assertEqual(rect1, rect2)\n\n    def testNullRectIntersection(self):\n        #QRect & QRect for null rects\n        rect1 = QRect()\n        rect2 = QRect()\n        rect3 = rect1 & rect2\n        self.assertEqual(rect3, rect1)\n        self.assertEqual(rect3, rect2)\n\n    def testNoIntersect(self):\n        '''QRect & QRect for non-intersecting QRects\n        Non-intersecting QRects return a 'null' QRect for operator &'''\n        rect1 = QRect(10, 10, 5, 5)\n        rect2 = QRect(20, 20, 5, 5)\n        rect3 = rect1 & rect2\n        self.assertEqual(rect3, QRect())\n\n    def testIntersectPartial(self):\n        #QRect & QRect for partial intersections\n        rect1 = QRect(10, 10, 10, 10)\n        rect2 = QRect(15, 15, 10, 10)\n        rect3 = rect1 & rect2\n        self.assertEqual(rect3, QRect(15, 15, 5, 5))\n\n    def testIntersetEnclosed(self):\n        #QRect & QRect for a qrect inside another\n        rect1 = QRect(10, 10, 20, 20)\n        rect2 = QRect(15, 15, 5, 5)\n        rect3 = rect1 & rect2\n        self.assertEqual(rect3, rect2)\n\n    def testNullRectIntersectBounding(self):\n        #QRect | QRect for null rects\n        rect1 = QRect()\n        rect2 = QRect()\n        rect3 = rect1 & rect2\n        self.assertEqual(rect3, rect1)\n        self.assertEqual(rect3, rect2)\n\n    def testNoIntersectBounding(self):\n        '''QRect | QRect for non-intersecting QRects\n        Non-intersecting QRects return a greater QRect for operator |'''\n        rect1 = QRect(10, 10, 5, 5)\n        rect2 = QRect(20, 20, 5, 5)\n        rect3 = rect1 | rect2\n        self.assertEqual(rect3, QRect(10, 10, 15, 15))\n\n    def testBoundingPartialIntersection(self):\n        #QRect | QRect for partial intersections\n        rect1 = QRect(10, 10, 10, 10)\n        rect2 = QRect(15, 15, 10, 10)\n        rect3 = rect1 | rect2\n        self.assertEqual(rect3, QRect(10, 10, 15, 15))\n\n    def testBoundingEnclosed(self):\n        #QRect | QRect for a qrect inside another\n        rect1 = QRect(10, 10, 20, 20)\n        rect2 = QRect(15, 15, 5, 5)\n        rect3 = rect1 | rect2\n        self.assertEqual(rect3, rect1)\n\n    def testGetCoordsAndRect(self):\n        rect1 = QRect(1, 2, 3, 4)\n        self.assertEqual(rect1.getRect(), (1, 2, 3, 4))\n        self.assertEqual(rect1.getCoords(), (1, 2, 3, 5))\n\n        rect1 = QRectF(1, 2, 3, 4)\n        self.assertEqual(rect1.getRect(), (1, 2, 3, 4))\n        self.assertEqual(rect1.getCoords(), (1, 2, 4, 6))\n\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qregexp_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom PySide.QtCore import QRegExp\n\nclass QRegExpTest(unittest.TestCase):\n\n    def testReplace1(self):\n        re = QRegExp('a[mn]')\n        string = re.replace('Banana', 'ox')\n        self.assertEqual(string, 'Boxoxa')\n\n    def testReplace2(self):\n        re = QRegExp('<i>([^<]*)</i>')\n        string = re.replace('A <i>bon mot</i>.', '\\\\emph{\\\\1}')\n        self.assertEqual(string, 'A \\\\emph{bon mot}.')\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qresource_test.py",
    "content": "# -*- coding: utf-8 -*-\n\n'''Test cases for QResource usage'''\n\nimport unittest\nfrom helper import adjust_filename\nfrom PySide.QtCore import QFile, QIODevice\nimport resources_mc\n\nclass ResourcesUsage(unittest.TestCase):\n    '''Test case for resources usage'''\n\n    def testPhrase(self):\n        #Test loading of quote.txt resource\n        f = open(adjust_filename('quoteEnUS.txt', __file__), \"r\")\n        orig = f.read()\n        f.close()\n\n        f = QFile(':/quote.txt')\n        f.open(QIODevice.ReadOnly) #|QIODevice.Text)\n        print(\"Error:\", f.errorString())\n        copy = f.readAll()\n        f.close()\n        self.assertEqual(orig, copy)\n\n    def testImage(self):\n        #Test loading of sample.png resource\n        f = open(adjust_filename('sample.png', __file__), \"rb\")\n        orig = f.read()\n        f.close()\n\n        f = QFile(':/sample.png')\n        f.open(QIODevice.ReadOnly)\n        copy = f.readAll()\n        f.close()\n        self.assertEqual(len(orig), len(copy))\n        self.assertEqual(orig, copy)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qsize_test.py",
    "content": "#!/usr/bin/python\n'''Unit tests for QSize'''\n\nimport unittest\n\nfrom PySide.QtCore import QSize\n\nclass QSizeOperator(unittest.TestCase):\n    def testOperatorMultiply(self):\n        #QSize operator * float\n        # bug 131\n        a = QSize(1, 1)\n        x = a * 3.4\n        self.assertEqual(QSize(3, 3), x)\n\n    def testOperatorRevertedMultiply(self):\n        #QSize operator * float, reverted\n        # bug 132\n        a = QSize(1, 1)\n        x = 3.4 * a\n        self.assertEqual(QSize(3, 3), x)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qslot_object_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide import QtCore\n\nglobal qApp\n\nclass objTest(QtCore.QObject):\n\n    def __init__(self, parent=None):\n        QtCore.QObject.__init__(self, parent)\n\n        self.ok = False\n\n    def slot(self):\n        global qApp\n \n        self.ok = True\n        qApp.quit()\n\n\n\nclass slotTest(unittest.TestCase):\n    def quit_app(self):\n        global qApp\n       \n        qApp.quit() \n\n    def testBasic(self):\n        global qApp\n        timer = QtCore.QTimer()\n        timer.setInterval(100)\n\n        my_obj = objTest()\n        my_slot = QtCore.SLOT(\"slot()\")\n        QtCore.QObject.connect(timer, QtCore.SIGNAL(\"timeout()\"), my_obj, my_slot)\n        timer.start(100)\n\n        QtCore.QTimer.singleShot(1000, self.quit_app)\n        qApp.exec_()\n\n        self.assert_(my_obj.ok)   \n\n\nif __name__ == '__main__':\n    global qApp\n    qApp = QtCore.QCoreApplication([])\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qsrand_test.py",
    "content": "import gc\nimport unittest\n\nfrom PySide.QtCore import qsrand\n\nclass OverflowExceptionCollect(unittest.TestCase):\n    '''Test case for OverflowError exception during garbage collection. See bug #147'''\n\n    def testOverflow(self):\n        # NOTE: PyQt4 raises TypeError, but boost.python raises OverflowError\n        self.assertRaises(OverflowError, qsrand, 42415335332353253)\n        # should not abort if bug #147 is fixed\n        gc.collect()\n\nif __name__ == '__main__':\n        unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qstate_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtCore import *\n\n\nclass QStateTest(unittest.TestCase):\n    def testBasic(self):\n        app = QCoreApplication([])\n\n        o = QObject()\n        o.setProperty(\"text\", \"INdT\")\n\n        machine = QStateMachine()\n        s1 = QState()\n        s1.assignProperty(o, \"text\", \"Rocks\");\n\n        s2 = QFinalState()\n        t = s1.addTransition(o, SIGNAL(\"change()\"), s2);\n        self.assert_(isinstance(t, QSignalTransition))\n\n        machine.addState(s1)\n        machine.addState(s2)\n        machine.setInitialState(s1)\n        machine.start()\n\n        o.emit(SIGNAL(\"change()\"))\n\n        QTimer.singleShot(100, app.quit)\n        app.exec_()\n\n        txt = o.property(\"text\")\n        self.assert_(txt, \"Rocks\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qstatemachine_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtCore import QObject, QState, QFinalState, SIGNAL\nfrom PySide.QtCore import QTimer, QStateMachine\nfrom PySide.QtCore import QParallelAnimationGroup\n\nfrom helper import UsesQCoreApplication\n\n\nclass StateMachineTest(unittest.TestCase):\n    '''Check presence of State Machine classes'''\n\n    def testBasic(self):\n        '''State machine classes'''\n        import PySide.QtCore\n        PySide.QtCore.QSignalTransition\n        PySide.QtCore.QPropertyAnimation\n\n\n\nclass QStateMachineTest(UsesQCoreApplication):\n\n    def cb(self, *args):\n        self.assertEqual(self.machine.defaultAnimations(), [self.anim])\n\n    def testBasic(self):\n        self.machine = QStateMachine()\n        s1 = QState()\n        s2 = QState()\n        s3 = QFinalState()\n\n        QObject.connect(self.machine, SIGNAL(\"started()\"), self.cb)\n\n        self.anim = QParallelAnimationGroup()\n\n        self.machine.addState(s1)\n        self.machine.addState(s2)\n        self.machine.addState(s3)\n        self.machine.setInitialState(s1)\n        self.machine.addDefaultAnimation(self.anim)\n        self.machine.start()\n\n        QTimer.singleShot(100, self.app.quit)\n        self.app.exec_()\n\n\nclass QSetConverterTest(UsesQCoreApplication):\n    '''Test converter of QSet toPython using QStateAnimation.configuration'''\n\n    def testBasic(self):\n        '''QStateMachine.configuration converting QSet to python set'''\n        machine = QStateMachine()\n        s1 = QState()\n        machine.addState(s1)\n        machine.setInitialState(s1)\n        machine.start()\n\n        QTimer.singleShot(100, self.app.quit)\n        self.app.exec_()\n\n        configuration = machine.configuration()\n\n        self.assert_(isinstance(configuration, set))\n        self.assert_(s1 in configuration)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qstring_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Test cases for QString'''\n\nimport unittest\nimport py3kcompat as py3k\nfrom PySide.QtCore import QObject\n\nclass QStringConstructor(unittest.TestCase):\n    '''Test case for QString constructors'''\n\n    def testQStringDefault(self):\n        obj = QObject()\n        obj.setObjectName('foo')\n        self.assertEqual(obj.objectName(), py3k.unicode_('foo'))\n        obj.setObjectName(py3k.unicode_('áâãà'))\n        self.assertEqual(obj.objectName(), py3k.unicode_('áâãà'))\n        obj.setObjectName(None)\n        self.assertEqual(obj.objectName(), py3k.unicode_(''))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qsysinfo_test.py",
    "content": "import unittest\nfrom PySide.QtCore import QSysInfo\n\nclass TestQSysInfo(unittest.TestCase):\n    def testEnumEndian(self):\n        self.assertEqual(QSysInfo.BigEndian, 0)\n        self.assertEqual(QSysInfo.LittleEndian, 1)\n        self.assert_(QSysInfo.ByteOrder > -1)\n\n    def testEnumSizes(self):\n        self.assert_(QSysInfo.WordSize > 0)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qtext_codec_test.py",
    "content": "import gc\nimport unittest\n\nfrom PySide.QtCore import QTextCodec\n\nclass TestCodecGetters(unittest.TestCase):\n\n    def testCodecsNames(self):\n        for codec_name in QTextCodec.availableCodecs():\n            codec = QTextCodec.codecForName(codec_name)\n            self.assert_(type(codec), QTextCodec)\n\n    def testCodecsMibs(self):\n        for codec_num in QTextCodec.availableMibs():\n            codec = QTextCodec.codecForMib(codec_num)\n            self.assert_(type(codec), QTextCodec)\n\n\nif __name__ == '__main__':\n        unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qtextstream_test.py",
    "content": "\n'''Unit tests for QTextStream'''\n\nimport unittest\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import QByteArray, QTextStream, QIODevice, QTextCodec, QFile\n\nclass QTextStreamShiftTest(unittest.TestCase):\n\n    def setUp(self):\n        self.ba = QByteArray()\n        self.read = QTextStream(self.ba, QIODevice.ReadOnly)\n        self.write = QTextStream(self.ba, QIODevice.WriteOnly)\n\n    def testNumber(self):\n        '''QTextStream << number'''\n\n        self.write << '4'\n        self.write.flush()\n        res = self.read.readLine()\n        self.assertTrue(isinstance(res, py3k.unicode))\n        self.assertEqual(res, '4')\n\nclass QTextStreamGetSet(unittest.TestCase):\n\n    def setUp(self):\n        self.obj = QTextStream()\n\n\n    def testCodec(self):\n        '''QTextStream set/get Codec'''\n\n        codec = QTextCodec.codecForName('ISO8859-1')\n        self.obj.setCodec(codec)\n        self.assertEqual(codec, self.obj.codec())\n\n    def testDevice(self):\n        '''QTextStream get/set Device'''\n        device = QFile()\n        self.obj.setDevice(device)\n        self.assertEqual(device, self.obj.device())\n        self.obj.setDevice(None)\n        self.assertEqual(None, self.obj.device())\n\nclass QTextStreamInitialization(unittest.TestCase):\n\n    def testConstruction(self):\n        '''QTextStream construction'''\n        obj = QTextStream()\n\n        self.assertEqual(obj.codec(), QTextCodec.codecForLocale())\n        self.assertEqual(obj.device(), None)\n        self.assertEqual(obj.string(), None)\n\n        self.assertTrue(obj.atEnd())\n        self.assertEqual(obj.readAll(), '')\n\nclass QTextStreamReadLinesFromDevice(unittest.TestCase):\n\n    def _check_data(self, data_set):\n\n        for data, lines in data_set:\n            stream = QTextStream(data)\n\n            res = []\n            while not stream.atEnd():\n                res.append(stream.readLine())\n\n            self.assertEqual(res, lines)\n\n    def testLatin1(self):\n        '''QTextStream readLine for simple Latin1 strings'''\n\n        data = []\n\n        data.append((QByteArray(), []))\n        data.append((QByteArray('\\n'), ['']))\n        data.append((QByteArray('\\r\\n'), ['']))\n        data.append((QByteArray('ole'), ['ole']))\n        data.append((QByteArray('ole\\n'), ['ole']))\n        data.append((QByteArray('ole\\r\\n'), ['ole']))\n        data.append((QByteArray('ole\\r\\ndole\\r\\ndoffen'), ['ole', 'dole', 'doffen']))\n\n        self._check_data(data)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qthread_prod_cons_test.py",
    "content": "#!/usr/bin/python\n'''Producer-Consumer test/example with QThread'''\n\nimport unittest\nfrom random import random\nimport logging\n\nlogging.basicConfig(level=logging.WARNING)\n\nfrom PySide.QtCore import QThread, QCoreApplication, QObject, SIGNAL\n\nclass Bucket(QObject):\n    '''Dummy class to hold the produced values'''\n    def __init__(self, max_size=10, *args):\n        #Constructor which receives the max number of produced items\n        super(Bucket, self).__init__(*args)\n        self.data = []\n        self.max_size = 10\n\n    def pop(self):\n        #Retrieves an item\n        return self.data.pop(0)\n\n    def push(self, data):\n        #Pushes an item\n        self.data.append(data)\n\nclass Producer(QThread):\n    '''Producer thread'''\n\n    def __init__(self, bucket, *args):\n        #Constructor. Receives the bucket\n        super(Producer, self).__init__(*args)\n        self.runs = 0\n        self.bucket = bucket\n        self.production_list = []\n\n    def run(self):\n        #Produces at most bucket.max_size items\n        while self.runs < self.bucket.max_size:\n            value = int(random()*10) % 10\n            self.bucket.push(value)\n            self.production_list.append(value)\n            logging.debug('PRODUCER - pushed %d' % value)\n            self.runs += 1\n            self.msleep(5)\n\n\n\nclass Consumer(QThread):\n    '''Consumer thread'''\n    def __init__(self, bucket, *args):\n        #Constructor. Receives the bucket\n        super(Consumer, self).__init__(*args)\n        self.runs = 0\n        self.bucket = bucket\n        self.consumption_list = []\n\n    def run(self):\n        #Consumes at most bucket.max_size items\n        while self.runs < self.bucket.max_size:\n            try:\n                value = self.bucket.pop()\n                self.consumption_list.append(value)\n                logging.debug('CONSUMER - got %d' % value)\n                self.runs += 1\n            except IndexError:\n                logging.debug('CONSUMER - empty bucket')\n            self.msleep(5)\n\nclass ProducerConsumer(unittest.TestCase):\n    '''Basic test case for producer-consumer QThread'''\n\n    def setUp(self):\n        #Create fixtures\n        self.app = QCoreApplication([])\n\n    def tearDown(self):\n        #Destroy fixtures\n        del self.app\n\n    def finishCb(self):\n        #Quits the application\n        self.app.exit(0)\n\n    def testProdCon(self):\n        #QThread producer-consumer example\n        bucket = Bucket()\n        prod = Producer(bucket)\n        cons = Consumer(bucket)\n\n        prod.start()\n        cons.start()\n\n        QObject.connect(prod, SIGNAL('finished()'), self.finishCb)\n        QObject.connect(cons, SIGNAL('finished()'), self.finishCb)\n\n        self.app.exec_()\n\n        prod.wait()\n        cons.wait()\n\n        self.assertEqual(prod.production_list, cons.consumption_list)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qthread_signal_test.py",
    "content": "\n'''Test cases for connecting signals between threads'''\n\nimport unittest\n\nfrom PySide.QtCore import QThread, QObject, SIGNAL, QCoreApplication\n\nthread_run = False\n\nclass Source(QObject):\n    def __init__(self, *args):\n        QObject.__init__(self, *args)\n\n    def emit_sig(self):\n        self.emit(SIGNAL('source()'))\n\nclass Target(QObject):\n    def __init__(self, *args):\n        QObject.__init__(self, *args)\n        self.called = False\n\n    def myslot(self):\n        self.called = True\n\nclass ThreadJustConnects(QThread):\n    def __init__(self, source, *args):\n        QThread.__init__(self, *args)\n        self.source = source\n        self.target = Target()\n\n    def run(self):\n        global thread_run\n        thread_run = True\n        QObject.connect(self.source, SIGNAL('source()'), self.target.myslot)\n\n        while not self.target.called:\n            pass\n\n\n\nclass BasicConnection(unittest.TestCase):\n\n    def testEmitOutsideThread(self):\n        global thread_run\n\n        app = QCoreApplication([])\n        source = Source()\n        thread = ThreadJustConnects(source)\n\n        QObject.connect(thread, SIGNAL('finished()'), lambda: app.exit(0))\n        thread.start()\n\n        while not thread_run:\n            pass\n\n        source.emit_sig()\n\n        app.exec_()\n        thread.wait()\n\n        self.assert_(thread.target.called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qthread_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QThread'''\n\nimport unittest\nfrom PySide.QtCore import QThread, QCoreApplication, QObject, SIGNAL, QMutex, QTimer\nfrom PySide.QtCore import QEventLoop\n\nfrom helper import UsesQCoreApplication\n\nmutex = QMutex()\n\nclass Dummy(QThread):\n    '''Dummy thread'''\n    def __init__(self, *args):\n        super(Dummy, self).__init__(*args)\n        self.called = False\n\n    def run(self):\n        #Start-quit sequence\n        self.qobj = QObject()\n        mutex.lock()\n        self.called = True\n        mutex.unlock()\n\nclass QThreadSimpleCase(UsesQCoreApplication):\n\n    def setUp(self):\n        UsesQCoreApplication.setUp(self)\n        self.called = False\n\n    def tearDown(self):\n        UsesQCoreApplication.tearDown(self)\n\n    def testThread(self):\n        #Basic QThread test\n        obj = Dummy()\n        obj.start()\n        obj.wait()\n\n        self.assert_(obj.called)\n\n    def cb(self, *args):\n        self.called = True\n        #self.exit_app_cb()\n\n    def abort_application(self):\n        self._thread.terminate()\n        self.app.quit()\n\n    def testSignalFinished(self):\n        #QThread.finished() (signal)\n        obj = Dummy()\n        QObject.connect(obj, SIGNAL('finished()'), self.cb)\n        mutex.lock()\n        obj.start()\n        mutex.unlock()\n\n        self._thread = obj\n        QTimer.singleShot(1000, self.abort_application)\n        self.app.exec_()\n\n        self.assert_(self.called)\n\n    def testSignalStarted(self):\n        #QThread.started() (signal)\n        obj = Dummy()\n        QObject.connect(obj, SIGNAL('started()'), self.cb)\n        obj.start()\n\n        self._thread = obj\n        QTimer.singleShot(1000, self.abort_application)\n        self.app.exec_()\n\n        self.assertEqual(obj.qobj.thread(), obj) # test QObject.thread() method\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/qtimer_singleshot_test.py",
    "content": "#!/usr/bin/python\n\n'''Test cases for QTimer.singleShot'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, QTimer, QCoreApplication, Signal\nfrom helper import UsesQCoreApplication\n\nclass WatchDog(QObject):\n    '''Exits the QCoreApplication main loop after sometime.'''\n\n    def __init__(self, watched):\n        QObject.__init__(self)\n        self.times_called = 0\n        self.watched = watched\n\n    def timerEvent(self, evt):\n        self.times_called += 1\n        if self.times_called == 20:\n            self.watched.exit_app_cb()\n\nclass TestSingleShot(UsesQCoreApplication):\n    '''Test case for QTimer.singleShot'''\n\n    def setUp(self):\n        #Acquire resources\n        UsesQCoreApplication.setUp(self)\n        self.watchdog = WatchDog(self)\n        self.called = False\n\n    def tearDown(self):\n        #Release resources\n        del self.watchdog\n        del self.called\n        UsesQCoreApplication.tearDown(self)\n\n    def callback(self):\n        self.called = True\n        self.app.quit()\n\n    def testSingleShot(self):\n        QTimer.singleShot(100, self.callback)\n        self.app.exec_()\n        self.assert_(self.called)\n\nclass SigEmitter(QObject):\n\n    sig1 = Signal()\n\n\nclass TestSingleShotSignal(UsesQCoreApplication):\n    '''Test case for QTimer.singleShot connecting to signals'''\n\n    def setUp(self):\n        UsesQCoreApplication.setUp(self)\n        self.watchdog = WatchDog(self)\n        self.called = False\n\n    def tearDown(self):\n        del self.watchdog\n        del self.called\n        UsesQCoreApplication.tearDown(self)\n\n    def callback(self):\n        self.called = True\n        self.app.quit()\n\n    def testSingleShotSignal(self):\n        emitter = SigEmitter()\n        emitter.sig1.connect(self.callback)\n        QTimer.singleShot(100, emitter.sig1)\n        self.app.exec_()\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qtimer_timeout_test.py",
    "content": "\n'''Test case for timeout() signals from QTimer object.'''\n\nimport unittest\nimport os\nimport sys\nfrom tempfile import mkstemp\nfrom PySide.QtCore import QObject, QTimer, SIGNAL\nfrom helper import UsesQCoreApplication\n\nclass WatchDog(QObject):\n    '''Exits the QCoreApplication main loop after sometime.'''\n\n    def __init__(self, watched):\n        QObject.__init__(self)\n        self.times_called = 0\n        self.watched = watched\n\n    def timerEvent(self, evt):\n        self.times_called += 1\n        if self.times_called == 20:\n            self.watched.exit_app_cb()\n\n\nclass TestTimeoutSignal(UsesQCoreApplication):\n    '''Test case to check if the signals are really being caught'''\n\n    def setUp(self):\n        #Acquire resources\n        UsesQCoreApplication.setUp(self)\n        self.watchdog = WatchDog(self)\n        self.timer = QTimer()\n        self.called = False\n\n    def tearDown(self):\n        #Release resources\n        del self.watchdog\n        del self.timer\n        del self.called\n        UsesQCoreApplication.tearDown(self)\n\n    def callback(self, *args):\n        #Default callback\n        self.called = True\n\n    def testTimeoutSignal(self):\n        #Test the QTimer timeout() signal\n        refCount = sys.getrefcount(self.timer)\n        QObject.connect(self.timer, SIGNAL('timeout()'), self.callback)\n        self.timer.start(4)\n        self.watchdog.startTimer(10)\n\n        self.app.exec_()\n\n        self.assert_(self.called)\n        self.assertEqual(sys.getrefcount(self.timer), refCount)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/qtnamespace_test.py",
    "content": "#!/usr/bin/python\n'''Test suite for QtCore.Qt namespace'''\n\nimport unittest\n\nfrom PySide.QtCore import Qt\n\nclass QtNamespace(unittest.TestCase):\n    '''Test case for accessing attributes from Qt namespace'''\n\n    def testBasic(self):\n        #Access to Qt namespace\n        getattr(Qt, 'Horizontal')\n        getattr(Qt, 'WindowMaximizeButtonHint')\n        self.assert_(True)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/quoteEnUS.txt",
    "content": "Fine! Dishonor! Dishonor on you, dishonor on ya cow!\n"
  },
  {
    "path": "tests/QtCore/qurl_test.py",
    "content": "#!/usr/bin/python\n'''Test suite for QtCore.QUrl'''\n\nimport unittest\n\nfrom PySide.QtCore import QUrl\n\nclass QUrlBasicConstructor(unittest.TestCase):\n    '''Tests the basic constructors'''\n\n    def testBasic(self):\n        #Default constructor for QUrl\n        url = QUrl()\n        self.assertEqual(url.toString(), \"\")\n\n    def testSetAttributes(self):\n        #Construct QUrl by set* methods\n        url = QUrl()\n\n        url.setScheme('ftp')\n        self.assertEqual(url.toString(), 'ftp:')\n\n        url.setHost('www.google.com')\n        self.assertEqual(url.toString(), 'ftp://www.google.com')\n\n        url.setPort(8080)\n        self.assertEqual(url.toString(), 'ftp://www.google.com:8080')\n\n        url.setPath('mail/view')\n        self.assertEqual(url.toString(),\n                        'ftp://www.google.com:8080/mail/view')\n\n        url.setUserName('john')\n        self.assertEqual(url.toString(),\n                        'ftp://john@www.google.com:8080/mail/view')\n\n        url.setPassword('abc123')\n        self.assertEqual(url.toString(),\n                        'ftp://john:abc123@www.google.com:8080/mail/view')\n\nclass QueryItemsTest(unittest.TestCase):\n    '''Test query item management'''\n\n    def testQueryItems(self):\n        #QUrl.queryItems\n        url = QUrl('http://www.google.com/search?q=python&hl=en')\n        valid_data = [(('q'), ('python')), (('hl'), ('en'))]\n\n        self.assertEqual(sorted(url.queryItems()), sorted(valid_data))\n\n    def testEncodedQueryItems(self):\n        #QUrl.encodedQueryItems\n        url = QUrl('http://www.google.com/search?q=python&hl=en')\n        valid_data = [(('q'), ('python')), (('hl'), ('en'))]\n\n        self.assertEqual(sorted(url.encodedQueryItems()), sorted(valid_data))\n\n    def testSetQueryItems(self):\n        #QUrl.setQueryItems\n        urla = QUrl('http://www.google.com/search?q=python&hl=en')\n        urlb = QUrl('http://www.google.com/search')\n\n        urlb.setQueryItems(urla.queryItems())\n\n        self.assertEqual(urla, urlb)\n\n    def testAddQueryItem(self):\n        #QUrl.addQueryItem\n        url = QUrl()\n        valid_data = [('hl', 'en'), ('user', 'konqui')]\n\n        url.addQueryItem(*valid_data[0])\n        self.assertEqual(url.queryItems()[0], valid_data[0])\n\n        url.addQueryItem(*valid_data[1])\n        self.assertEqual(sorted(url.queryItems()), sorted(valid_data))\n\n    def testAllEncodedQueryItemsValues(self):\n        #QUrl.allEncodedQueryItemValues\n        url = QUrl()\n        key = 'key'\n        valid_data = ['data', 'valid', 'test']\n\n        for i, data in enumerate(valid_data):\n            url.addQueryItem(key, data)\n            self.assertEqual(url.allEncodedQueryItemValues(key),\n                             list(valid_data[:i+1]))\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/repr_test.py",
    "content": "import PySide\nimport unittest\n\nfrom PySide.QtCore import QByteArray, QDate, QDateTime, QTime, QLine, QLineF\nfrom PySide.QtCore import Qt, QSize, QSizeF, QRect, QRectF, QPoint, QPointF\nfrom PySide.QtCore import QUuid\n\nclass ReprCopyHelper:\n    def testCopy(self):\n        copy = eval(self.original.__repr__())\n        self.assert_(copy is not self.original)\n        self.assertEqual(copy, self.original)\n\nclass QByteArrayReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QByteArray('the quick brown fox jumps over the lazy dog')\n\n\nclass QDateReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QDate(2010, 11, 22)\n\n\nclass QTimeReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QTime(11, 37, 55, 692)\n\n\nclass QDateTimeReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QDateTime(2010, 5, 18, 10, 24, 45, 223, Qt.LocalTime)\n\n\nclass QSizeReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QSize(42, 190)\n\n\nclass QSizeFReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QSizeF(42.7, 190.2)\n\nclass QRectReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QRect(100, 200, 300, 400)\n\nclass QRectFReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QRectF(100.33, 200.254, 300.321, 400.123)\n\nclass QLineReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QLine(1, 2, 3, 4)\n\nclass QLineFReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QLineF(1.1, 2.2, 3.3, 4.4)\n\nclass QPointReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QPoint(1, 2)\n\nclass QPointFReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QPointF(1.1, 2.2)\n\nclass QUuiCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QUuid(\"67C8770B-44F1-410A-AB9A-F9B5446F13EE\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/resources.qrc",
    "content": "<RCC>\n    <qresource prefix=\"/\">\n        <file alias=\"quote.txt\">quoteEnUS.txt</file>\n        <file alias=\"sample.png\">sample.png</file>\n    </qresource>\n</RCC>\n\n"
  },
  {
    "path": "tests/QtCore/resources_mc.py",
    "content": "# -*- coding: utf-8 -*-\n\n# Resource object code\n#\n# Created: Thu Feb 3 16:09:36 2011\n#      by: The Resource Compiler for PySide (Qt v4.6.3)\n#\n# WARNING! All changes made in this file will be lost!\n\nfrom PySide import QtCore\n\nqt_resource_data = b\"\"\"\\\n\\x00\\x00\\x00\\x35\\\n\\x46\\\n\\x69\\x6e\\x65\\x21\\x20\\x44\\x69\\x73\\x68\\x6f\\x6e\\x6f\\x72\\x21\\x20\\x44\\\n\\x69\\x73\\x68\\x6f\\x6e\\x6f\\x72\\x20\\x6f\\x6e\\x20\\x79\\x6f\\x75\\x2c\\x20\\\n\\x64\\x69\\x73\\x68\\x6f\\x6e\\x6f\\x72\\x20\\x6f\\x6e\\x20\\x79\\x61\\x20\\x63\\\n\\x6f\\x77\\x21\\x0a\\\n\\x00\\x00\\xda\\x88\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\xb1\\x00\\x00\\x00\\xd2\\x08\\x06\\x00\\x00\\x00\\x05\\x49\\x21\\x31\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\xa7\\x93\\x00\\\n\\x00\\x00\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0b\\x13\\x00\\x00\\x0b\\x13\\x01\\\n\\x00\\x9a\\x9c\\x18\\x00\\x00\\x00\\x07\\x74\\x49\\x4d\\x45\\x07\\xda\\x03\\x0a\\\n\\x0c\\x02\\x2e\\xb0\\x96\\x99\\x74\\x00\\x00\\x00\\x19\\x74\\x45\\x58\\x74\\x43\\\n\\x6f\\x6d\\x6d\\x65\\x6e\\x74\\x00\\x43\\x72\\x65\\x61\\x74\\x65\\x64\\x20\\x77\\\n\\x69\\x74\\x68\\x20\\x47\\x49\\x4d\\x50\\x57\\x81\\x0e\\x17\\x00\\x00\\x20\\x00\\\n\\x49\\x44\\x41\\x54\\x78\\xda\\x94\\xbd\\xd9\\xaf\\x24\\xd9\\x7a\\xdd\\xf7\\x8b\\\n\\x21\\x33\\x77\\x44\\xe4\\x9c\\xa7\\xaa\\xcf\\xa9\\xb1\\xab\\x87\\x6b\\xf2\\x92\\\n\\xd4\\x15\\x49\\x0b\\x84\\x64\\xd9\\x22\\x64\\x3f\\xd8\\x30\\x0c\\xd8\\x8f\\x34\\\n\\xfc\\x68\\x43\\x7f\\x8b\\xfe\\x04\\x02\\x06\\xfc\\x64\\xbf\\xd1\\x06\\x04\\x13\\\n\\x7a\\x30\\x65\\x59\\x04\\x4d\\x03\\xa4\\x48\\xba\\x29\\xf9\\x72\\xb8\\xdd\\x5d\\\n\\x55\\x5d\\xc3\\x39\\x75\\xea\\x9c\\x9c\\x23\\xf6\\xce\\xcc\\x18\\xfc\\xb0\\x87\\\n\\x88\\xc8\\xcc\\x6a\\xd9\\xd9\\x68\\x44\\xce\\x79\\x2a\\x73\\xc5\\x8a\\xb5\\xd7\\\n\\xb7\\xbe\\x2f\\xbc\\xdf\\xff\\x17\\xbf\\x57\\x09\\x00\\x15\\x82\\xc8\\x29\\x89\\\n\\xb0\\x97\\x24\\xaa\\x90\\x52\\x51\\x12\\x91\\x44\\x95\\xb9\\x37\\x42\\x56\\x1e\\\n\\x91\\x97\\x91\\x4a\\xcf\\x3d\\x27\\x8a\\x04\\x12\\x1a\\xaf\\xd6\\xcf\\x45\\x54\\\n\\xa0\\x3c\\x7e\\xfc\\x22\\xeb\\xe7\\x9b\\xeb\\xfa\\xbd\\xea\\xdb\\x08\\x01\\x4a\\\n\\x01\\x11\\x42\\x54\\x28\\xe5\\xe9\\x2d\\x20\\xc0\\xdd\\x6e\\x5e\\xdc\\x7d\\x4a\\\n\\x02\\x7d\\x2a\\xd1\\x73\\x8f\\x79\\x6a\\x07\\xa2\\xa0\\x22\\xd6\\xd7\\x81\\x24\\\n\\xdb\\xe3\\x8d\\x87\\xad\\xf7\\xc8\\xe3\\x12\\x80\\x30\\xf3\\xc9\\xe3\\x92\\x30\\\n\\xf3\\x09\\x63\\x81\\x22\\x43\\x10\\x03\\x99\\x79\\x66\\x6c\\xfe\\xce\\x12\\x94\\\n\\x5f\\xbf\\xc1\\xd1\\xed\\x38\\x28\\xf4\\xfb\\x85\\x11\\x79\\x2e\\xf1\\x37\\x7d\\\n\\xb6\\xb1\\xe4\\x61\\x76\\xe0\\xf6\\xe5\\x82\\xc3\\x04\\x46\\xe3\\x01\\x00\\x7d\\\n\\x42\\xb6\\xe4\\x4c\\xbd\\x31\\xd5\\x70\\xc3\\xc6\\xef\\x33\\x28\\xb7\\x78\\xeb\\\n\\x01\\xeb\\x47\\x01\\x09\\x3d\\x52\\x76\\x24\\xe8\\x7f\\x57\\x90\\x29\\x3a\\x71\\\n\\x0f\\x45\\xfd\\x7d\\x77\\x85\\x60\\xaf\\xd4\\xc9\\x37\\x2e\\x44\\x81\\x52\\x01\\\n\\x82\\x0a\\x85\\x87\\xcc\\x04\\xdf\\x7e\\xbc\\x67\\x1c\\x06\\xfa\\xfb\\x99\\x54\\\n\\xcc\\x98\\x50\\x72\\x4f\\x12\\x27\\x88\\x69\\x42\\x99\\x15\\x27\\xef\\xe3\\xc7\\\n\\x41\\xeb\\xfe\\xbd\\x52\\xc8\\x4c\\x00\\x50\\x72\\x8f\\xcf\\x8c\\x49\\x2c\\x29\\\n\\x45\\x84\\x1f\\x07\\x54\\x9d\\x11\\xde\\x61\\xa5\\x1f\\xcf\\x0a\\x56\\x73\\xb8\\\n\\x5b\\xbc\\xa4\\x5a\\xae\\x4f\\xde\\xdb\\x1b\\x0f\\x19\\x52\\xf1\\xd9\\xe3\\x11\\\n\\x4c\\x1f\\x52\\x75\\x46\\x27\\xcf\\x79\\xf4\\xe8\\x6b\\x42\\xfd\\x63\\x07\\x20\\\n\\x72\\x50\\x01\\xb0\\xa7\\x2b\\xba\\xec\\x91\\xec\\xa5\\x06\\x88\\xaf\\x0e\\x48\\\n\\x72\\x03\\x18\\x0d\\xea\\x14\\x8f\\x3d\\x12\\x64\\xc4\\x1e\\x40\\xda\\xfb\\x61\\\n\\x8f\\x44\\x00\\x25\\x5e\\x8d\\x4f\\xc0\\x47\\x52\\x12\\x31\\x2c\\x3d\\xd6\\x7e\\\n\\xe5\\x6e\\x83\\x47\\x15\\x65\\x78\\xd2\\xc3\\x8f\\xa0\\x94\\xfa\\x47\\x90\\x91\\\n\\xa4\\xb4\\x3b\\x8a\\x52\\x06\\xd2\\x12\\x94\\x05\\xa9\\xbe\\x47\\x99\\x5d\\x47\\\n\\x35\\x76\\x16\\x0b\\x68\\x0d\\xe4\\x08\\xa5\\x4a\\x03\\x66\\xe8\\x09\\xfd\\xfc\\\n\\xca\\x00\\xaf\\x12\\x3d\\xfa\\xf3\\x0d\\x69\\xdc\\xa5\\xf2\\xf5\\xeb\\x06\\xa5\\\n\\xc7\\xc6\\xaf\\x18\\x64\\x3e\\x79\\x2c\\xd0\\x1f\\x1a\\x93\\xc7\\x10\\x02\\x82\\\n\\xb8\\x01\\xe4\\x06\\x58\\x9b\\x00\\x06\\x8a\\x2a\\x26\\x40\\x11\\x67\\x92\\x2c\\\n\\x8e\\xc8\\x8a\\x80\\xa2\\x27\\x98\\x50\\xd6\\xc0\\xce\\x24\\x19\\x53\\x1e\\xbe\\\n\\x80\\x2d\\x39\\x7d\\x42\\xd4\\x7c\\x05\\xd3\\x11\\x7d\\x42\\xf6\\xd5\\x16\\x56\\\n\\x1e\\x83\\xd1\\x96\\xd5\\x6a\\x44\\x39\\xd8\\x32\\xe2\\x82\\x42\\x1c\\x10\\xf8\\\n\\xa0\\x34\\x80\\x01\\x14\\x1e\\x5d\\x21\\xda\\x80\\xa5\\xa2\\x14\\x91\\x03\\x73\\\n\\x57\\x08\\x94\\x52\\xee\\x7e\\x94\\xe2\\x2f\\x6e\\x7e\\xce\\x24\\xeb\\xc3\\x64\\\n\\x48\\x31\\x9a\\x10\\x2c\\x16\\x94\\x13\\x0d\\xc2\\xae\\xf8\\x34\\xfd\\x34\\x01\\\n\\x5c\\x55\\x63\\xba\\x62\\x09\\x68\\x20\\xfb\\xcc\\xea\\xbf\\xc9\\x3e\\x7f\\x59\\\n\\x12\\x24\\xf5\\x0e\\xc0\\xbc\\x60\\xbb\\x08\\x48\\x3c\\x48\\xab\\x09\\x89\\xb7\\\n\\x00\\x20\\x8d\\xbb\\x24\\xcb\\x35\\x98\\x1d\\x1a\\xc0\\x3b\\xac\\x5a\\x40\\xf6\\\n\\x0e\\x2b\\x92\\x7e\\x07\\xfd\\x8d\\x0b\\xf3\\x87\\x88\\x02\\x44\\x41\\xa6\\xe6\\\n\\x35\\x9b\\x01\\x4a\\xe4\\x1a\\xe8\\xe6\\xf6\\x1e\\xc9\\x1e\\x49\\xd7\\x80\\xa7\\\n\\x4b\\x64\\x71\\x85\\xdf\\x40\\xed\\xbe\\x71\\xbd\\x06\\x2c\\x6c\\xfd\\xcc\\xec\\\n\\xa9\\x91\\x7b\\xcc\\x93\\xb1\\x7e\\x8e\\xf4\\xf0\\x0d\\xeb\\x5b\\x30\\xa7\\xd2\\\n\\x03\\xa9\\xdc\\xbb\\xc9\\x06\\x5f\\xcb\\x16\\x9b\\xd7\\xcf\\x50\\xca\\xd3\\x47\\\n\\x81\\x06\\xb8\\x85\\xa8\\xe8\\x89\\x88\\x9d\\x92\\x20\\x0a\\xc7\\xc0\\x9e\\xda\\\n\\xe9\\x2f\\x30\\x38\\xb8\\x77\\xdb\\xf8\\x15\\xd1\\x11\\xb3\\xb7\\x18\\x3a\\x53\\\n\\xa7\\x00\\xb6\\xc0\\xed\\x09\\xb7\\x0d\\x76\\x35\\x80\\x5b\\xaf\\xcf\\x25\\x59\\\n\\x11\\x10\\xb3\\x26\\x9c\\x68\\x60\\x66\\x0c\\x99\\x7a\\x63\\xba\\x5e\\x9f\\x7c\\\n\\x9a\\x68\\x20\\x37\\x2e\\x87\\x95\\xa7\\x9f\\x1f\\xea\\xf7\\x4a\\xf0\\x89\\x18\\\n\\x20\\x44\\x41\\x11\\x0b\\x3a\\x71\\xef\\x04\\xc0\\x80\\x06\\xea\\x19\\x66\\xb6\\\n\\xc0\\x96\\x99\\xe0\\xe3\\xdb\\x1c\\x80\\x65\\x5e\\x10\\xac\\x34\\x90\\x3e\\x96\\\n\\x17\\x44\\xb1\\x3a\\x01\\xeb\\xa7\\x2e\\x41\\xb2\\xd1\\xdf\\x7e\\x56\\xff\\x0d\\\n\\xf6\\xf5\\x00\\x45\\x3a\\x20\\x48\\x36\\x54\\x9d\\x11\\x65\\x56\\x50\\xa4\\x83\\\n\\xd6\\xe3\\x16\\xc0\\xcb\\xaa\\x20\\xc9\\xf6\\xa4\\x71\\xb7\\xf5\\xfe\\x16\\xc0\\\n\\x96\\xc9\\x01\\xd2\\xed\\x01\\x3f\\x57\\x92\\x03\\x19\\x76\\xbb\\xc9\\x4b\\x64\\\n\\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\\xb0\\xac\\x0a\\xc6\\x5e\\xe0\\xe4\\x5d\\x4b\\x5e\\x18\\\n\\xf0\\x1e\\xcb\\x0a\\x1f\\x40\\xe5\\xe6\\x07\\x31\\xdb\\x6a\\xb5\\x43\\x76\\x6f\\\n\\xc9\\x52\\xc3\\x6b\\xf7\\x1e\\x07\\xb1\\xa9\\x59\\x57\\xe4\\x0e\\xa0\\xea\\x88\\\n\\x71\\xbb\\x47\\xaa\\xf8\\xdf\\x75\\xb1\\x80\\x6c\\x5e\\xb7\\x4c\\xec\\x47\\x15\\\n\\xa5\\x92\\x24\\x51\\x85\\x2f\\x22\\xf7\\xce\\xb5\\x3e\\xaf\\xb9\\x58\\xfe\\x88\\\n\\x0e\\x3f\\xa7\\x97\\x05\\xe0\\x91\\x51\\x88\\x94\\x8d\\x5f\\x69\\x20\\x43\\x83\\\n\\x7d\\x63\\xc2\\x4c\\x19\\x29\\x11\\x1b\\x19\\x12\\xb6\\x98\\x16\\xa0\\xd3\\x9b\\\n\\x12\\xec\\x94\\xbb\\xff\\x18\\xa8\\x00\\x59\\x1c\\x31\\xec\\x75\\xb5\\x84\\x88\\\n\\x43\\x26\\x71\\x5b\\x72\\x0c\\x09\\xf0\\x1f\\x7b\\x84\\x61\\x84\\xff\\xd8\\x63\\\n\\x1d\\x7b\\x24\\x71\\xc2\\xe8\\xf1\\x23\\xd4\\x24\\xc1\\x9f\\x14\\x74\\x27\\x43\\\n\\xb6\\x03\\x9f\\x69\\xd8\\x37\\x47\\x80\\x94\\xd5\\xfa\\xee\\x93\\x8c\\xdb\\xbc\\\n\\x58\\x76\\xb6\\x5b\\x61\\x8e\\xbc\\x16\\x58\\xe1\\xaa\\x82\\xcf\\x87\\x4c\\xb2\\\n\\xbe\\x03\\x70\\x1b\\x24\\xe9\\x89\\x0e\\x3e\\x77\\xf1\\xbc\\x25\\x9d\\xde\\x65\\\n\\x8b\\x89\\x9b\\x92\\xc6\\x32\\xb5\\x05\\x61\\x91\\x1a\\xed\\x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00\\x7f\\x4c\\x07\\x37\\x3f\\xa7\\xaa\\xc6\\x1c\\x76\\x37\\x6e\\x51\\xd7\\\n\\x94\\x16\\xcd\\x1d\\xcc\\x02\\xd0\\x82\\x7a\\xbb\\xa8\\xc1\\x0b\\xb4\\x98\\xd8\\\n\\xf3\\xe6\\x84\\x65\\x9f\\xd2\\x5f\\xb4\\x64\\x84\\xdd\\x01\\x52\\x7f\\x8f\\x2f\\\n\\x3e\\xd6\\xd4\\xac\\x1e\\xac\\x48\\x6f\\xbb\\x04\\xc9\\x15\\x22\\x79\\xcd\\x32\\\n\\x1e\\x9f\\xa7\\x4f\\x51\\x20\\x54\\x48\\x97\\x48\\x83\\x56\\x74\\xcc\\xa2\\x50\\\n\\x33\\xb1\\x05\\xaf\\x3a\\xf3\\xd2\\x54\\x1e\\x39\\x15\\x91\\xa8\\xb7\\x52\\xd5\\\n\\xb7\\x81\\x2d\\x9a\\x85\\x25\\x90\\x44\\x42\\xbb\\x22\\x44\\x2d\\x80\\x47\\x44\\\n\\x48\\x64\\x43\\x54\\x44\\x48\\x51\\x19\\x38\\x37\\x80\\x2c\\xaa\\xda\\xc5\\x30\\\n\\x00\\x2e\\x44\\xda\\x62\\xe2\\x41\\xe9\\xe1\\xa9\\x82\\x98\\x2e\\x91\\xa8\\x18\\\n\\x94\\x9e\\x63\\xe1\\x4e\\x4f\\xd0\\x69\\x68\\x5d\\x0b\\x5a\\xa7\\x7f\\xab\\x98\\\n\\x49\\xec\\x33\\xa1\\x64\\x81\\xef\\xd8\\x36\\x0c\\x23\\xfc\\x49\\xa1\\xc1\\x48\\\n\\x8f\\x84\\x1e\\x13\\x31\\xd2\\x32\\x40\\x44\\x74\\x85\\xa0\\x2b\\x84\\x5e\\xfd\\\n\\xf7\\x8b\\x5a\\x0a\\x64\\x6b\\xf6\\x4a\\xb1\\x5a\\xdf\\xb1\\x79\\xa7\\x98\\xe7\\\n\\x5b\\xfa\\x1b\\xf3\\x99\\xf3\\xa5\\x01\\x98\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\\x60\\x51\\x51\\x6d\\x47\\x90\\xad\\x5b\\x1e\\\n\\x33\\x80\\x3f\\xf6\\x49\\xb7\\x07\\x2d\\x00\\xfd\\x20\\x01\\x34\\x80\\xed\\xed\\\n\\xc4\\x93\\x66\\xd5\\x18\\x91\\xab\\x39\\x21\\x7d\\x54\\x83\\x6d\\xad\\x96\\x3d\\\n\\x5e\\xc8\\x95\\x44\\x54\\x51\\x46\\xe9\\x2c\\xb3\\x18\\x90\\x1a\\xd4\\xb2\\x21\\\n\\x1f\\xa4\\xd2\\xaf\\x8d\\xaa\\x1f\\x2d\\x7f\\x58\\xa0\\xa6\\x46\\x9c\\xe8\\x42\\\n\\xcb\\xe9\\x6b\\x9a\\xf7\\x09\\x7c\\x14\\x25\\x8a\\x58\\xb3\\x8e\\x28\\x50\\xca\\\n\\xa3\\x27\\x22\\x3c\\x91\\x39\\x00\\x6b\\x9f\\xb8\\xf6\\x85\\x43\\x2a\\x2d\\x13\\\n\\xa2\\x10\\xaf\\x6a\\xc8\\x2c\\x55\\x32\\x13\\xa1\\x96\\xc7\\xc1\\x9a\\x84\\x29\\\n\\x25\\x05\\x1f\\x45\\x48\\xe2\\x57\\x06\\x80\\x09\\x92\\x0d\\x01\\x7b\\x20\\xd1\\\n\\x2c\\x87\\x70\\xee\\x81\\x64\\x43\\xc4\\x00\\x89\\x07\\x2c\\x49\\x08\\x80\\x35\\\n\\xc4\\x43\\x0d\\xe4\\xf9\\x2d\\xa8\\x00\\x21\\x02\\x4a\\x0a\\xe8\\xaf\\x09\\x54\\\n\\x97\\x94\\x1d\\x42\\xf8\\x04\\xaa\\x83\\xa2\\xa6\\xb0\\xd1\\xf0\\x82\\x0e\\x15\\\n\\x05\\x70\\xc8\\x76\\x04\\x40\\x11\\x17\\x28\\x95\\x50\\x88\\x0d\\x81\\xea\\x18\\\n\\x1d\\xdf\\x39\\xfb\\xfd\\x5a\\x20\\xdb\\x62\\x47\\x31\\x9a\\xc0\\xbd\\x66\\xc4\\\n\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\\x25\\xb0\\xb1\\x4b\\x57\\x53\\x45\\xcb\\x59\\xd8\\x4a\\x20\\\n\\xf7\\x28\\x42\\x02\\x14\\x59\\x67\\xc8\\xe0\\x70\\x57\\xaf\\x17\\x94\\x22\\x25\\\n\\x04\\x42\\xc8\\x52\\x56\\x6b\\x49\\x18\\x2a\\x12\\xa5\\xdf\\xc7\\xee\\x44\\xed\\\n\\x23\\x70\\x0a\\x24\\x0e\\x88\\x6b\\x34\\xb9\\x0c\\xb3\\x80\\x22\\xfe\\x34\\x70\\\n\\x8f\\xdd\\x82\\x26\\x98\\x3f\\xf3\\x2b\\x82\\x30\\x60\\x39\\x48\\x58\\xbe\\x4b\\\n\\x11\\xd3\\x25\\x0c\\xe0\\xf1\\x6f\\xfe\\x1a\\xf3\\xfb\\x35\\xb3\\xd5\\x82\\xbb\\\n\\xc5\\x92\\x8b\\xc9\\x98\\xce\\x62\\xcd\\xdd\\x72\\xc1\\x9b\\x77\\x05\\x30\\xe1\\\n\\xf5\\xea\\x7b\\xaa\\x65\\xc8\\x7e\\xf4\\x80\\x8b\\xf1\\x98\\x8b\\xc9\\xf8\\x93\\\n\\x8b\\xb9\\x26\\x08\\x83\\x64\\xc3\\x67\\x7e\\x85\\xe4\\x82\\x03\\xcb\\x9a\\x89\\\n\\x8d\\xa3\\x58\\x56\\x5b\\xaa\\xf1\\x8c\\x73\\xb5\\x96\\xc3\\xee\\x86\\x34\\x4b\\\n\\x35\\x13\\x77\\x89\\xd8\\xab\\xba\\x4a\\x67\\x81\\xbc\\x57\\xfb\\x96\\xce\\x75\\\n\\xa5\\xca\\xc6\\xe1\\x3f\\x91\\xf2\\x44\\xf3\\x5a\\x3f\\x57\\xeb\\x62\\x08\\xa4\\\n\\x47\\x69\\xc0\\xad\\x88\\xe8\\xe2\\x81\\x94\\x4e\\x3e\\xf8\\x8d\\x85\\x9c\\x2b\\\n\\x63\\x9b\\xeb\\xbe\\xb9\\x1e\\x9d\\x61\\x5b\\x0b\\xee\\xa8\\xe1\\x4e\\xb4\\xca\\\n\\xd1\\xca\\xab\\x8b\\x1c\\xf8\\xba\\xb8\\x41\\xa6\\xe5\\x84\\xa8\\x1c\\x1b\\x6b\\\n\\x49\\x11\\xb9\\xd2\\x76\\x10\\x17\\x44\\xbd\\x09\\x4a\\x95\\x08\\xa1\\x8f\\x4c\\\n\\x01\\x11\\xc5\\xbb\\x94\\x70\\xbc\\x45\\x70\\xe1\\x0e\\xf7\\x6c\\xd7\\xa4\\xe6\\\n\\xcb\\xd7\\x40\\xcb\\x0d\\xa0\\xd1\\xc0\\xcc\\x72\\x88\\x43\\x03\\x52\\x48\\xb3\\\n\\x14\\x3f\\xde\\x91\\x66\\xf5\\xe2\\x47\\xdb\\x70\\xfa\\x79\\xc4\\x21\\xa1\\x71\\\n\\x32\\x52\\xeb\\x6f\\x1a\\x47\\xc3\\x02\\xda\\x28\\x65\\xc0\\xee\\x20\\x3d\\x86\\\n\\x04\\xac\\x29\\x28\\xe2\\xc2\\x01\\xbc\\x59\\x8e\\xfe\\x14\\x13\\x0b\\x2a\\xc7\\\n\\xc4\\x51\\xac\\x28\\x4a\\xcd\\xc6\\x77\\xcb\\x05\\x17\\xff\\x46\\x4b\\x8a\\x7e\\\n\\xfa\\x9a\\x89\\x0f\\xc5\\x63\\xc1\\x40\\x1b\\x7b\\xfc\\xf2\\xaf\\x3e\\x44\\x66\\\n\\xcf\\xf8\\x50\\xea\\xef\\x77\\xb6\\x78\\x00\\x63\\xf8\\x7c\\x32\\x74\\x00\\x1e\\\n\\x4d\\x6b\\xdd\\x1a\\x24\\x1b\\x07\\xda\\xa6\\x1c\\xd0\\xd2\\x62\\xce\\x61\\xb5\\\n\\xd4\\x0c\\xbc\\x5a\\x90\\x45\\x09\\xfd\\xf5\\x18\\x46\\x39\\xb3\\xaa\\xa0\\xda\\\n\\x54\\xe4\\xfe\\x96\\x90\\x87\\xad\\x85\\x9d\\x98\\x42\\xa7\\x77\\x59\\x57\\xec\\\n\\xba\\xa2\\x7b\\x22\\x0d\\x9c\\xe6\\x6d\\xdc\\xa7\\xce\\xf9\\xc0\\x0d\\x10\\x36\\\n\\x75\\x70\\x20\\x3d\\x57\\xc0\\xd8\\x9b\\x6d\\xb7\\xc1\\xba\\xcd\\xd7\\x36\\xfd\\\n\\x5f\\xd9\\xb8\\x1e\\xb5\\x96\\x6b\\x5a\\x4a\\x70\\x24\\x33\\xb0\\x15\\x2a\\x03\\\n\\xdc\\xf6\\x4e\\x57\\x39\\x37\\xc5\\x82\\xba\\x09\\xe0\\x8a\\x18\\xd1\\x5c\\xd1\\\n\\x2b\\xc5\\x26\\x0b\\x90\\xbb\\x05\\x42\\xf8\\xba\\x54\\xdd\\x94\\x4a\\xeb\\x7a\\\n\\xa5\\x9f\\x66\\x4b\\x94\\x52\\xa8\\xf9\\x1e\\xb9\\x5b\\x40\\x96\\xb3\\xf5\\x52\\\n\\x16\\x59\\xa9\\xc1\\x9b\\x99\\x05\\x8a\\xb9\\xbe\\x96\\x5b\\x88\\x43\\xfd\\xb8\\\n\\x2d\\xa1\\x14\\x0d\\xbf\\x35\\xab\\x17\\x34\\xe5\\xa2\\xed\\xc3\\xae\\xe5\\xf6\\\n\\x47\\x59\\xd5\\x32\\x71\\x90\\x05\\x67\\x01\\x5c\\x88\\xc3\\x89\\x2b\\x61\\x4b\\\n\\xce\\xda\\xae\\xab\\xe8\\x0a\\xc1\\x6c\\x02\\x83\\x99\\x96\\x03\\x87\\xd5\\x92\\\n\\x57\\xdf\\xff\\xc0\\xab\\x05\\x6c\\x19\\x93\\xb2\\x73\\xef\\xbb\\xe9\\xe8\\xef\\\n\\x2c\\x58\\x2d\\x90\\xaf\\x5e\\xeb\\x1d\\x72\\x90\\x70\\x31\\x19\\x73\\x98\\x8c\\\n\\x98\\x4c\\xd3\\x56\\x15\\xaf\\xcc\\x0a\\x67\\xa7\\x59\\x67\\x22\\x48\\x36\\x94\\\n\\x4b\\xfd\\x5d\\xac\\xaa\\x0a\\x56\\x21\\xfe\\x48\\x2f\\x6c\\xcb\\xa1\\x26\\x86\\\n\\x85\\xaf\\x8f\\x86\\x61\\xd9\\x3f\\xa9\\xd4\\x55\\x9d\\xd1\\x91\\x26\\x6e\\x94\\\n\\x84\\x9b\\x8b\\xb4\\x63\\x1f\\x57\\x57\\xe2\\x74\\x2e\\x42\\x49\\x45\\x27\\xaa\\\n\\x38\\x48\\x75\\xe4\\x4a\\x68\\xf6\\xb5\\x4c\\x5b\\x36\\xae\\xfb\\x4d\\x1b\\xad\\\n\\x11\\x2c\\x6a\\x32\\x30\\x47\\xc0\\x75\\x60\\x3d\\x62\\xe2\\xda\\x56\\x13\\x44\\\n\\x48\\x04\\xc2\\x1d\\x25\\xd4\\xa7\\x02\\x47\\x8e\\xa9\\x33\\x97\\x9b\\x50\\x4a\\\n\\x22\\x44\\x44\\x98\\xf9\\x60\\x16\\x76\\x9b\\x2c\\x00\\x16\\xa4\\x72\\x07\\xd9\\\n\\x54\\x33\\xe6\\x7c\\xc5\\xbb\\x65\\xc9\\x44\\x7e\\x64\\xdb\\xbf\\x22\\x3e\\x54\\\n\\x06\\x88\\x3b\\xf0\\x04\\x78\\x8a\\x78\\xe5\\x43\\x08\\x6b\\x4f\\xd5\\xb9\\x09\\\n\\x2f\\x63\\x58\\x09\\x5d\\xd5\\xcb\\x72\\x5b\\x5f\\xd2\\x36\\x5c\\xaf\\xcb\\xda\\\n\\x53\\x0c\\xa3\\x3e\\x6b\\xb9\\x65\\x68\\xf3\\x06\\x93\\x7b\\x67\\x51\\x85\\x59\\\n\\xc4\\x30\\xee\\xff\\x7f\\xab\\x98\\x19\\x26\\x4e\\x8e\\xc4\\xc7\\x39\\x79\\x61\\\n\\xf3\\x0c\\x7a\\xc1\\xa7\\xaf\\x0f\\x0e\\x92\\xd0\\x17\\x7c\\x18\\x4d\\x18\\xfe\\\n\\x6c\\xc2\\x37\\x7f\\xfe\\x0d\\x37\\x7f\\xfb\\x1d\\x00\\x3f\\x7d\\xa8\\xa9\\xf5\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x6c\\xca\\xca\\x2d\\xb8\\\n\\x2a\\x79\\x26\\xf0\\x13\\x9d\\x08\\x0a\\x0d\\x7c\\x88\\x84\\xae\\xcd\\x09\\x17\\\n\\x00\\xca\\xe8\\xb5\\x0a\\x1d\\x75\\x97\\x47\\xbf\\x2b\\xd8\\xfa\\x29\\x42\\x44\\\n\\x48\\xe5\\x11\\xc5\\x25\\x52\\x49\\xa2\\xb8\\x22\\x37\\x07\\x68\\x9d\\x68\\xcb\\\n\\x34\\x58\\xe3\\x92\\xdc\\xb2\\xbc\\xf9\\xe1\\x85\\xcd\\x15\\xdb\\xc3\\x9f\\xbd\\\n\\xae\\x7c\\x17\\xa0\\x1f\\xe4\\xa9\\x76\\x25\\x4c\\xaa\\x6d\\x51\\xc5\\x2c\\x4c\\\n\\x95\\x70\\x2d\\x33\\x26\\x71\\xdf\\x69\\xe0\\x45\\x56\\x32\\xc8\\x53\\x07\\xe4\\\n\\x32\\x5e\\x39\\x3d\\xec\\x67\\x23\\xd2\\x78\\x75\\xe4\\x1e\\xef\\xdc\\xfd\\xfe\\\n\\x61\\x79\\x96\\x89\\xf7\\x4a\\x91\\xb2\\x43\\x66\\x23\\xee\\xb3\\x05\\x33\\x26\\\n\\xdc\\xb3\\x70\\x5d\\x1c\\x92\\x99\\x0b\\xef\\x90\\x65\\xb5\\xf7\\x9d\\xd5\\x8c\\\n\\x5f\\x4b\\x17\\xa3\\xf7\\x17\\xef\\xc8\\x33\\x9f\\x65\\x3e\\x24\\xdc\\xdc\\xd2\\\n\\x9f\\x0c\\xf9\\xfa\\x71\\x8f\\xa6\\xc1\\x7b\\x5c\\xaa\\x76\\x60\\x36\\x05\\xca\\\n\\x55\\x55\\x31\\xf0\\xa0\\x42\\x67\\xd9\\xb7\\x51\\x46\\xbc\\x3e\\xc0\\xf8\\x54\\\n\\x46\\x1c\\x83\\x3a\\x3c\\xab\\x21\\x8d\\x0c\\x38\\x66\\x65\\x5d\\xc8\\x88\\x8c\\\n\\xcb\\x60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\\xc5\\x73\\\n\\xfc\\xf9\\x1b\\x0e\\xde\\x63\\x3a\\x8f\\x22\\x5d\\x5e\\x27\\x71\\x0b\\xbc\\x63\\\n\\x40\\xf7\\x27\\x17\\x8e\\x81\\x87\\x5e\\xc9\\xba\\xf2\\x09\\xe3\\x88\\x78\\x9d\\\n\\xe2\\x0d\\xe6\\x28\\x9e\\x20\\x3e\\x91\\x61\\x66\\xed\\x69\\x39\\x21\\x22\\xa1\\\n\\xcb\\xc1\\x06\\xcc\\xbe\\xd4\\xdb\\xbd\\xd4\\x8f\\xf9\\x52\\xb6\\xec\\xb2\\xc0\\\n\\x64\\x1e\\x8a\\x06\\xe0\\xad\\xee\\xf5\\x91\\x94\\x0a\\xfc\\x48\\xcb\\x05\\xd1\\\n\\x14\\x00\\x86\\x69\\x2d\\x18\\x71\\xcd\\xa6\\xfa\\x59\\x41\\xea\\xb3\\xf6\\x2b\\\n\\x92\\x48\\xd6\\xcc\\xac\\xe6\\x48\\xd0\\x1a\\xdb\\xd7\\x00\\x06\\xd8\\x26\\x3a\\\n\\xb5\\x5c\\x50\\x12\\xa4\\x7d\\xca\\x6a\\xeb\\x52\\x6e\\x51\\x23\\xbd\\xa6\\x0c\\\n\\x9b\\xf6\\x88\\xd9\\x71\\x5e\\x4e\\xd8\\x7e\\xba\\xfe\\xa1\\x64\\x4b\\x0d\\x60\\\n\\xbd\\x2d\\x88\\x44\\x85\\x52\\x92\\x64\\x69\\xbe\\xfc\\x81\\x87\\x17\\x0c\\x1a\\\n\\x7d\\x76\\x70\\xd8\\x29\\x02\\x51\\x82\\x52\\x28\\x15\\x23\\x0c\\x58\\x01\\xa6\\\n\\x99\\x47\\x16\\x57\\x4e\\xd3\\x17\\x76\\xe1\\xd7\\x70\\x60\\x02\\x2f\\x63\\x6d\\\n\\x16\\x76\\x64\\xb9\\x03\\x35\\xa2\\x24\\x3f\\x48\\xc2\\x34\\x69\\x34\\x9a\\xe4\\\n\\x8e\\x71\\xf5\\xdf\\xbf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x47\\x32\\xf1\\x9d\\x94\\x38\\x06\\xb2\\x00\\x28\\x27\\xae\\\n\\x80\\xd2\\x64\\x65\\x9d\\x9d\\x30\\x01\\x74\\xeb\\x36\\x78\\xb2\\xb6\\xc6\\x02\\\n\\x63\\x7d\\x15\\x06\\xb8\\x2e\\xd0\\xde\\xd0\\xb9\\x42\\x2a\\x23\\x87\\xf2\\x96\\\n\\x13\\xa1\\x6d\\x9a\\x43\\xa3\\xb1\\x32\\x22\\xee\\xf4\\x28\\xc5\\x54\\x5b\\x27\\\n\\x22\\x32\\x5b\\x3d\\xeb\\xa2\\xea\\xc7\\x44\\x91\\xa0\\x30\\xba\\x56\\xb7\\x31\\\n\\x45\\x6e\\xdb\\xea\\xa8\\x33\\x00\\x96\\xe6\\xf0\\x2c\\xa5\\x32\\x76\\x4c\\x64\\\n\\x42\\xef\\x25\\x42\\x54\\x2e\\x3b\\x21\\x1a\\x8b\\xba\\x73\\x00\\xf6\\xc8\\xd8\\\n\\xf8\\x15\\xc9\\xa1\\x3c\\xe9\\x70\\x96\\xd6\\x6b\\x1e\\xd7\\x11\\xff\\xad\\x9f\\\n\\x36\\x58\\x22\\x43\\x08\\xdb\\xb2\\x94\\x35\\x58\\x58\\x7f\\x6a\\x12\\x1c\\x60\\\n\\xe0\\xb1\\xc6\\xd3\\x95\\x3f\\x20\\xce\\xbc\\xba\\x64\\xed\\xa4\\x9d\\x62\\x10\\\n\\x17\\x14\\x55\\xec\\x00\\x9d\\x15\\x01\\x59\\xc7\\xd3\\xc9\\xba\\x24\\xd5\\x76\\\n\\x5c\\xec\\xd7\\x00\\x8e\\xdb\\xeb\\xf2\\x66\\x79\\x24\\x0c\\x23\\x92\\x38\\x61\\\n\\x32\\x9d\\xd5\\x8c\\x3f\\xe8\\xf0\\xf4\\xf1\\x15\\xc3\\xc9\\x98\\x07\\x5f\\x7e\\\n\\xc1\\x83\\xc7\\x3d\\x18\\xfb\\x74\\x27\\x43\\xc6\\x13\\x03\\x5e\\x03\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ef\\xa6\\xc4\\xdf\\x7e\\xa0\\xb8\\xff\\x86\\xe2\\xfb\\xb9\\x66\\\n\\x57\\x13\\xc2\\x71\\xdb\\x26\\xdb\\x36\\xfe\\xdf\\x6f\\x6f\\xf5\\x76\\xb1\\x86\\\n\\x65\\x49\\x55\\xae\\x38\\xac\\x6a\\x0f\\xbc\\x13\\xf7\\xdc\\xc8\\x80\\xe9\\x17\\\n\\x9f\\xb3\\xaa\\x2a\\x3e\\x2e\\xee\\xe9\\x4e\\x86\\x94\\x62\\xd6\\xc8\\x9b\\x27\\\n\\xf8\\xe8\\x80\\x7d\\xdd\\x28\\x7a\\xe1\\xd8\\x37\\x59\\x04\\x2d\\x36\\x06\\xc8\\\n\\xfd\\xad\\x2b\\xa4\\x9c\\x6b\\x52\\x0d\\xab\\x28\\x03\\xe9\\xd5\\xe1\\x19\\x03\\\n\\x13\\x81\\x70\\x5e\\x71\\x2d\\x13\\xbc\\x56\\x74\\xb2\\x95\\x87\\x20\\x42\\x52\\\n\\xb5\\x53\\x6a\\x22\\xd7\\x93\\x85\\x9a\\xa5\\xe4\\x46\\x93\\xe7\\x71\\xb9\\xd8\\\n\\x39\\xbe\\x4a\\x9d\\x3c\\x2e\\xed\\x82\\xcd\\xde\\x67\\x26\\x02\\x49\\xa0\\x5f\\\n\\x64\\x7a\\x87\\x20\\xd2\\xbe\\xb0\\x69\\x41\\xe2\\x4c\\x97\\x73\\x93\\x85\\x2d\\\n\\x2b\\x4b\\xe5\\xe1\\x99\\xd8\\xa9\\x05\\xad\\x95\\x15\\x76\\xf2\\x8f\\x03\\xb0\\\n\\x59\\xcc\\xe9\\x49\\x40\\xa5\\xb3\\xd8\\x94\\x52\\x08\\x3b\\x94\\x44\\x98\\x8a\\\n\\x5c\\x4f\\x03\\x39\\x30\\x56\\x5c\\xd1\\xf0\\x92\\x6d\\x89\\x7a\\x58\\xe9\\x06\\\n\\xad\\x45\\x55\\x7b\\xc8\\x71\\x50\\xe0\\x6f\\xfa\\xc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\\x62\\xa7\\xe5\\x06\\xa6\\x75\\x48\\x49\\\n\\x2d\\x27\\xea\\x92\\x70\\x44\\x61\\xb5\\x70\\x43\\x5b\\xda\\x38\\xa6\\x38\\x93\\\n\\x03\\xf6\\x91\\x26\\xc0\\xb1\\xa9\\xa1\\x6a\\x16\\x91\\xcd\\x7e\\x0c\\x3b\\x8c\\\n\\x30\\x6a\\x15\\x94\\xdb\\xcd\\x49\\x91\\x59\\xb0\\x49\\x03\\xee\\x08\\xd9\\xaa\\\n\\xf4\\xcd\\x92\\x82\\xc2\\xf6\\xcb\\xd9\\xd6\\xfc\\xc6\\xce\\x55\\x11\\x23\\x0c\\\n\\xd0\\x76\\xc6\\xd7\\x3d\\x76\\x29\\x3c\\x91\\xa1\\x96\\x7b\\x2a\\xd1\\x6b\\x31\\\n\\xf1\\xd6\\x46\\x34\\xe3\\xa3\\x24\\x55\\x30\\xe0\\xb0\\xd9\\x20\\x06\\x89\\x03\\\n\\xb6\\xb2\\xfa\\x18\\x9c\\x57\\x8c\\x5b\\xe4\\x95\\x2d\\x06\\x0e\\x3c\\x3d\\x39\\\n\\x28\\x35\\x16\\x5d\\x62\\x99\\xdc\\x56\\xf6\\x8c\\x55\\xb7\\x46\\xdb\\x6c\\x04\\\n\\x85\\x8b\\x74\\x5a\\x56\\x76\\x51\\xcd\\x66\\xb0\\xde\\xb2\\x31\\x90\\xc4\\x39\\\n\\x12\\x1d\\x74\\x0f\\xc2\\x80\\x57\\x1f\\xfe\\x8a\\x7e\\x57\\x10\\xee\\x04\\x79\\\n\\x76\\xad\\xa5\\x6f\\x3e\\xe4\\x62\\x78\\xed\\x7a\\xeb\\xc2\\x18\\xe6\\x8b\\x88\\\n\\x3c\\x96\\x84\\x59\\x44\\x1e\\x0b\\x53\\xc8\\x91\\x0d\\xfa\\x92\\x6c\\x7a\\x13\\\n\\xf2\\x9d\\x74\\x05\\x9d\\x61\\x35\\x61\\x34\\x9a\\xea\\x46\\xd9\\x09\\xbc\\x01\\\n\\x62\\xd6\\x08\\x1e\\xb4\\xfe\\xed\\xad\\x30\\x90\\x92\\x2c\\xf3\\x82\\xa9\\x17\\\n\\xba\\x8e\\x98\\x4e\\xf0\\x19\\xe9\\xa4\\x40\\x72\\x4f\\xd4\\x82\\xb0\\x0d\\x18\\\n\\x0d\\x1b\\x8b\\xbc\\xc4\\x44\\x31\\xed\\x62\\xce\\xe8\\x5d\\xd5\\xe8\\x81\\xb3\\\n\\xb2\\xa0\\x38\\xb3\\x60\\xb2\\x61\\x20\\xa1\\x6c\\x0f\\x5e\\x0d\\x3e\\x69\\x3d\\\n\\x61\\x36\\x8d\\xc7\\x3e\\x7d\\xb1\\x15\\x38\\xcb\\xa6\\x16\\xe6\\x91\\x6d\\xbb\\\n\\x6f\\x48\\x15\\x07\\x6f\\xc3\\xca\\x49\\x54\\x71\\x48\\x03\\x48\\x24\\xa8\\xa8\\\n\\x9e\\x94\\x69\\x62\\x97\\x98\\xc5\\x9b\\x05\\x74\\xaf\\x31\\xc9\\xd2\\x02\\xd8\\\n\\xca\\x09\\x31\\xee\\x1a\\x56\\x8e\\x1c\\x13\\x27\\x87\\x92\\x66\\x48\\x2c\\x63\\\n\\x4f\\x6c\\xf4\\x71\\xb0\\xd1\\x51\\xcd\\x30\\x36\\xa0\\xb3\\x9f\\xd3\\x00\\xad\\\n\\x6a\\xe6\\x2b\\x44\\xc9\\x61\\x37\\x77\\xce\\xc5\\x61\\x37\\x87\\xa8\\x24\\x69\\\n\\xac\\x13\\x6a\\x56\\xcf\\x48\\xbd\\x92\\x40\\xfa\\xf8\\xa2\\x44\\x1c\\x22\\x07\\\n\\xe0\\xb5\\xa7\\x75\\xf6\\x49\\xca\\xed\\xf8\\x90\\x4c\\x08\\xdc\\xb3\\xb9\\x87\\\n\\x8b\\xe1\\x9e\\x71\\x3c\\x26\\xcf\\x14\\x0b\\x25\\x19\\x18\\xef\\xfa\\x62\\xb8\\\n\\x67\\xdc\\xbb\\xa2\\x8c\\x57\\xae\\x6b\\x63\\x70\\x90\\x04\\x19\\x74\\x26\\x3d\\\n\\x14\\xa6\\x0b\\x64\\x3a\\xf9\\xd1\\xdf\\xd0\\xc6\\x2f\\x2b\\xff\\xd2\\x84\\x82\\\n\\x16\\x74\\xbd\\x91\\x2b\\xbf\\x5b\\x09\\xe1\\xb6\\x26\\x60\\x34\\x0e\\x77\\xbc\\\n\\x5d\\x94\\x8e\\x8d\\xfd\\xc9\\x82\\x74\\x31\\x21\\x99\\xcc\\x18\\x2c\\xbe\\x85\\\n\\xe1\\x57\\xba\\x3d\\x69\\x7b\\xa1\\x19\\xdc\\x3a\\x1c\\x59\\xe2\\x2c\\xb6\\xd0\\\n\\xfa\\xbe\\x55\\x54\\x51\\xca\\xb8\\x66\\xd7\\x48\\xb4\\x17\\x69\\xcd\\x85\\x9f\\\n\\x54\\xf8\\x4d\\xf7\\x41\\x6d\\x80\\x01\\xd2\\xa6\\x39\\xc0\\xb0\\xf0\\xce\\x59\\\n\\x74\\x41\\x43\\x38\\x14\\x48\\x02\\x3b\\x53\\xc2\\x14\\x43\\xb6\\x41\\xe6\\xc8\\\n\\xd7\\x8d\\x89\\x35\\xc5\\x01\\x54\\x04\\xaa\\xd6\\xc3\\x56\\x7f\\x46\\xa6\\xca\\\n\\xe7\\xba\\x76\\x45\\xd5\\x72\\x20\\x9a\\x96\\x9a\\x65\\xdf\\xe3\\xaa\\x9d\\x6d\\\n\\x16\\xf5\\x44\\x81\\x5a\\xee\\x9d\\x2e\\xb2\\x4c\\x7c\\x2a\\x26\\x72\\x0a\\x21\\\n\\x08\\x94\\xc2\\x0b\\x29\\xf9\\xbd\\x95\\x00\\x00\\x20\\x00\\x49\\x44\\x41\\x54\\\n\\x06\\x6c\\xf7\\x77\\x24\\x45\\x8f\\xce\\x80\\x46\\x67\\x89\\x72\\xec\\xac\\x7d\\\n\\xe4\\x7a\\xf8\\xa0\\x10\\x82\\xd4\\xcb\\x48\\x2a\\xed\\x4c\\xf8\\x55\\xc6\\x6e\\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3\\\n\\xed\\x1c\\xdf\\x4c\\x90\\xdf\\x99\\xf3\\x8e\\x1e\\x33\\x71\\xcb\\xff\\x8d\\xf7\\\n\\x66\\xf4\\x95\\x70\\xe5\\x66\\xcb\\xca\\x12\\x49\\x59\\x64\\xac\\x6f\\xe1\\x71\\\n\\x18\\xf2\\xd6\\x68\\xd7\\x6a\\xd6\\x67\\x7e\\x3f\\x67\\xea\\x4d\\x99\\xdf\\xcf\\\n\\x39\\x78\\x53\\x3a\\x68\\x20\\xdf\\x04\\xfd\\x13\\x90\\x59\\x0d\\xfd\\x88\\xf7\\\n\\x0e\\xcc\\xb3\\x79\\x97\\xf7\\x53\\xc9\\xe5\\x68\\xcb\\x4d\\xd0\\x77\\xb7\\x67\\\n\\x68\\xb0\\x5e\\xca\\x8f\\xdc\\x4f\\xfb\\x06\\xf0\\x30\\x6b\\xec\\x0c\\xcd\\xf7\\\n\\x3d\\x27\\x45\\xac\\xa4\\x78\\x68\\x54\\xe2\\x7b\\x15\\xf2\\x2b\\x71\\xce\\x78\\\n\\x3c\\xd5\\xa3\\x18\\x7a\\x42\\xcf\\x76\\x43\\xb9\\x59\\x16\\xf1\\xa1\\x22\\x18\\\n\\x95\\x78\\x69\\x52\\x4b\\x06\\x03\\xe6\\x7e\\x95\\xd4\\x21\\xa2\\x58\\xe7\\x62\\\n\\xc8\\x20\\xcf\\xb7\\x4c\\xb3\\xbe\\xcb\\x2b\\xbb\\x35\\x85\\x3f\\x72\\x92\\x42\\\n\\x19\\x3d\\x6c\\x2d\\x36\\x45\\xd2\\x38\\x93\\x93\\x61\\x62\\x03\\xde\\x0f\\xcb\\\n\\xb7\\x5c\\x8d\\x9f\\xf0\\x76\\xf7\\x84\\x17\\xf1\\xfc\\x14\\xc0\\x26\\x47\\xe1\\\n\\x02\\x41\\x91\\xd0\\x91\\xca\\xed\\x51\\x91\\xa3\\xa5\\x1f\\x0d\\xe0\\xa4\\x39\\\n\\x31\\xe3\\xb1\\x47\\xdb\\x5c\\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\\x64\\x61\\x97\\xe1\\x63\\x43\\x61\\\n\\xa2\\xf2\\x84\\x2e\\xa3\\xad\\xa3\\x07\\xc5\\x4e\\xbd\\x71\\x63\\xee\\xd8\\x19\\\n\\x37\\xd8\\x56\\x73\\x94\\xe8\\xf0\\x9c\\xcd\\x17\\x4c\\x73\\x9f\\x86\\xe3\\xc8\\\n\\xa6\\x47\\x6a\\xa7\\x44\\x04\\x58\\xb6\\x22\\xd9\\x89\\xce\\xd1\\x36\\xc3\\x56\\\n\\x9d\\x81\\xb7\\x42\\xf3\\x92\\x28\\xee\\x5a\\xc3\\x59\\x26\\x8e\\x0b\\xae\\xd9\\\n\\xac\\x64\\xe3\\x88\\x40\\xe8\\x89\\xb5\\x50\\xc1\\x2f\\xf8\\x61\\xdf\\x0a\\x71\\\n\\xfd\\x1c\\x4d\\x53\\x29\\x5d\\x1b\\x34\\x14\\x52\\x22\\xe2\\x02\\xf5\\x36\\x8b\\\n\\xc9\\x8f\\x38\\x12\\xba\\xe2\\x18\\x4b\\x2c\\x65\\xac\\x32\\x18\\x73\\x10\\x25\\\n\\xac\\x74\\xf1\\x66\\xca\\x63\\xbf\\x38\\x6a\\x58\\xf4\\xcb\\xd5\\x04\\xe1\\x3c\\\n\\x26\\xae\\x06\\x63\\x15\\x23\\x97\\xcf\\x3d\\x29\\xc8\\xcf\\x7f\\xae\\x7f\\xe3\\\n\\x7a\\xa5\\x30\\xb0\\x3e\\x24\\x13\\x2b\\x17\\x5c\\x95\\xde\\x1b\\x9d\\x31\\x79\\\n\\xf3\\xeb\\xd4\\x59\\xe6\\xbb\\x5b\\x31\\x7b\\xfb\\xe1\\x1c\\xbd\\x05\\xc0\\xc3\\\n\\x43\\xc2\\x7e\\x24\\x33\\x5f\\x3c\\xec\\x62\\xb4\\x7a\\xc4\\xa3\\x88\\xdf\\xfa\\\n\\xee\\x5b\\xb4\\xde\\x7a\\xc4\\x0f\\x5c\\x49\\x78\\xf9\\xc5\\x4f\\x30\\xfe\\xcc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\x34\\x17\\x02\\x95\\x49\\x2a\\x7e\\x57\\x45\\x73\\x19\\xd9\\x03\\x6c\\xad\\x2e\\\n\\xdb\\xc8\\xfe\\xd4\\xa3\\x11\\x4c\\xc1\\x15\\xef\\xcd\\xd8\\x50\\x69\\xf4\\xd2\\\n\\x42\\x6f\\xe2\\xd0\\xd0\\x62\\x1a\\x41\\xce\\xb8\\xd5\\xc1\\x01\\xe2\\x61\\xb1\\\n\\x88\\xb1\\xdb\\x90\\x0c\\xc5\\x88\\x94\\x06\\x62\\x0f\\x75\\x56\\x19\\x44\\x2b\\\n\\x33\\x71\\x89\\x87\\xdb\\x1c\\xc9\\xe0\\x19\\xb6\\xea\\x4f\\x16\\x4e\\x15\\x90\\\n\\xc4\\x84\\x8b\\x2a\\x36\\xc5\\xcf\\xe5\\x3e\\x66\\x67\\x2c\\xf4\\x13\\xb6\\x51\\\n\\x87\\xa8\\xb0\\xb2\\xc2\\x91\\x6b\\x99\\x9a\\xb2\\x13\\x25\\x96\\x38\\x96\\x54\\\n\\xdc\\x05\\xb9\\x64\\x45\\x83\\xe1\\x14\\xd4\\x5b\\x58\\x48\\x2f\\x4b\\x41\\x50\\\n\\x58\\x60\\xd4\\x07\\xe1\\xd6\\x1c\\x14\\xf8\\x8f\\x09\\xe4\\x5f\\xcf\\x6a\\x73\\\n\\x30\\xe3\\x7b\\xfc\\x32\\x93\\x4b\\x3f\\x4c\\x9c\\x5c\\x17\\x2e\\x99\\xf2\\xac\\\n\\xb7\\x3e\\x54\\x0b\\x21\\x56\\x25\\x08\\x58\\x64\\x12\\x72\\x96\\x8b\\x77\\xf1\\\n\\x83\\x37\\xee\\xf1\\xdd\\x3f\\xf8\\x4d\\x6e\\x9f\\x7c\\x5b\\x34\\x1e\\x2c\\xf0\\\n\\x83\\x26\\xbb\\x19\\xa2\\x81\\xc1\\x9a\\x0c\\x60\\xd5\\x5a\\x92\\xfa\\x86\\x95\\\n\\xd4\\x07\\xe5\\x60\\x4e\\x69\\x76\\x14\\x42\\xb2\\x13\\x71\\x90\\xee\\x90\\x1f\\\n\\xa9\\xb4\\x07\\x21\\xf9\\x82\\x73\\x11\\xef\\x16\\x59\\xb9\\x7c\\x9c\\x2f\\x08\\\n\\x6c\\x7c\\x3c\\x10\\x54\\x5c\\x2f\\xab\\x00\\x9f\\x5c\\xfc\\xfc\\x32\\x63\\x97\\\n\\xd4\\x5b\\xb5\\xfb\\x57\\xd2\\x6b\\x65\\x26\\xb6\\xdb\\x1a\\x93\\xbd\\x01\\x4a\\\n\\xda\\x03\\x2f\\xa7\\xdf\\xef\\xd3\\xef\\xf7\\x19\\x8c\\x12\\x06\\xbb\\xd0\\xef\\\n\\xf7\\x89\\x0f\\x7c\\x74\\xdd\\x22\\x48\\x35\\xfc\\x69\\x44\\x7c\\x10\\x33\\xc8\\\n\\x53\\xf0\\x72\\xc6\\xa9\\x41\\xa3\\x27\\xb2\\xa9\\x53\\x5b\\xa4\\x11\\x4c\\x69\\\n\\x69\\x0e\\xe3\\xbc\\x43\\x43\\xe9\\xe3\\x17\\x06\\xe4\\xee\\xb5\\x26\\x9d\\x96\\\n\\x86\\xa2\\xb6\\xc8\\x2a\\x30\\xc2\\x53\\x1d\\x49\\xb5\\x59\\x76\\x34\\x97\\x89\\\n\\xa9\\x24\\x8c\\x92\\x2b\\x2e\\x31\\xb1\\xea\\xfb\\x92\\x67\\xae\\xca\\x3c\\xc7\\\n\\x7e\\x8c\\x9a\\x5a\\xb9\\xd8\\x5e\\x64\\x99\\x72\\xa6\\x4e\\xeb\\x47\\xf8\\xd3\\\n\\x33\\x88\\x74\\x31\\xed\\x61\\x76\\x65\\xb6\\x8d\\x11\\x03\\x95\\x71\\xe1\\x0a\\\n\\xa4\\x95\\xc7\\x50\\x91\\x4a\\xb7\\x92\\x27\\x76\\xe6\\x66\\xd4\\xc2\\xf9\\x76\\\n\\x74\\xa1\\x66\\x4b\\x09\\xb1\\x22\\xf1\\xb5\\xee\\xc1\\x16\\xf6\\xce\\x0f\\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0\\x44\\x75\\x46\\x32\\x90\\xc7\\x84\\xb8\\\n\\x95\\x2c\\xd1\\xa0\\x46\\x8f\\x94\\x2e\\x33\\x2d\\x71\\x95\\x1b\\x06\\x0b\\x56\\\n\\x80\\xbb\\x22\\x6b\\x5f\\xbf\\x76\\x8b\\x2b\\x37\\xaf\\x73\\xe9\\xc6\\x66\\x31\\\n\\xc2\\x50\\x38\\x3e\\x15\\xff\\x4b\\xbd\\x48\\x4c\\x5d\\x20\\x9d\\xb6\\xd0\\x6a\\\n\\x43\\x3a\\x99\\x22\\x18\\x08\\x33\\x93\\xc5\\x5b\\x75\\x25\\x18\\x64\\xf4\\x51\\\n\\x51\\xa2\\x09\\x4e\\xcd\\x94\\x01\\x0c\\xa0\\x7a\\x0e\\x74\\x52\\x19\\xc0\\x79\\\n\\x63\\x8c\\x37\\x76\\xc4\\xe3\\xc0\\x41\\xd7\\x2d\\x22\\x1a\\xa8\\x81\\x29\\x33\\\n\\xf1\\x8d\\x4b\\x06\\x03\\x6f\\x1d\\x06\\xfb\\xd8\\x6d\\xad\\xc0\\xc7\\xf3\\x58\\\n\\x58\\x14\\x85\\xce\\xdc\\xf0\\xa9\\xdc\\x63\\x27\\xc5\\xec\\x16\\x28\\xa1\\x82\\\n\\x6a\\x26\\xb3\\x82\\xc8\\x32\\x71\\xc2\\x48\\x76\\xe4\\xe2\\x0a\\x56\\xd6\\x42\\\n\\x05\\x5f\\x0d\\xb0\\xac\\xfc\\x82\\x2d\\xab\\x66\\x9a\\xa4\\x51\\x24\\x8f\\x16\\\n\\x33\\x75\\x5c\\x5a\\xd1\\x50\\x94\\x41\\x1d\\x86\\x0a\\x76\\x9a\\x0b\\x89\\x26\\\n\\x26\\x53\\x7d\\x99\\xe5\\x16\\x7c\\xe1\\x3a\\x6c\\x7d\\xe3\\x26\\xbf\\xf5\\x78\\\n\\x99\\x17\\x6f\\xbd\\xc6\\x8f\\x7e\\xe1\\x5f\\xb1\\x79\\x6b\\x1d\\x3b\\x2a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xc0\\x02\\x1f\\x8b\\xfb\\xfd\\x6c\\x40\\xc7\\x69\\x8b\\x23\\\n\\x6d\\x09\\x21\\x24\\x04\\xa9\\x24\\x8c\\xae\\x1a\\xf1\\xe9\\x85\\x15\\x8c\\xb5\\\n\\x16\\x76\\xbb\\xcb\\x83\\xc7\\x31\\x2b\\x16\\x1c\\x76\\x72\\x1a\\xcb\\x97\\x49\\\n\\xcd\\xab\\x74\\xac\\x19\\x3c\\x88\\x27\\x3d\\xb4\\xca\\xb8\\xbe\\x36\\x11\\xc2\\\n\\x1a\\x0d\\x5b\\x14\\xee\\x93\\xf3\\xdb\\xa9\\x32\\xce\\x39\\x6c\\x8b\\x91\\xa6\\\n\\x89\\x38\\x09\\x95\\x68\\x02\\x8d\\x99\\x78\\x9e\\x54\\x58\\x5d\\xe1\\xd6\\x18\\\n\\x91\\x92\\xbb\\x0a\\xc5\\x8c\\xa9\\xcc\\xce\\x42\\xe0\\x3e\\x9f\\x89\\xcb\\xcc\\\n\\x5b\\xf2\\xc5\\x2d\\xb6\\x67\\xed\\xe5\\x00\\x1a\\xc5\\x74\\x88\\x9c\\x12\\x29\\\n\\x8a\\x3c\\xdd\\x2a\\x27\\x94\\xad\\x52\\xe7\\x10\\xce\\x63\\xe4\\x48\\xd0\\x68\\\n\\x46\\x45\\x7d\\xe6\\x44\\x96\\x5c\\x18\\x63\\xa7\\x19\\x9e\\xa3\\x14\\x7b\\x3f\\\n\\x66\\x25\\x93\\x53\\x1d\\x5f\\x2a\\xe6\\xed\\xca\\xad\\x19\\x56\\x14\\x51\\x6e\\\n\\x75\\x88\\xc2\\x10\\x2b\\x35\\x45\\x00\\x17\\x2e\\x3b\\x4d\\x25\\x23\\x34\\x73\\\n\\xea\\x96\\xc5\\xb3\\x5a\\xc4\\xfd\\xad\\x9f\\x27\\xdf\\x3c\\xe6\\x27\\xba\\x75\\\n\\x0c\\xb3\\x0f\\x74\\xa4\\x5b\\x50\\xd5\\x2e\\x36\\x2c\\x32\\x31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\\x48\\x21\\xdb\\xce\\x8a\\x1f\\x40\\xa4\\xe3\\xfa\\x79\\xe1\\x9f\\\n\\x36\\x7f\\x4b\\x09\\x65\\x03\\x40\\x2b\\x98\\x85\\x12\\x0a\\xd8\\x46\\x5d\\xfa\\\n\\x53\\xa4\\x17\\xa4\\x9a\\x4f\\x30\\x9e\\xaa\\x70\\xb4\\xae\\x9f\\xa3\\xf8\\x39\\\n\\x56\\x6a\\x12\\x6a\\x11\\x4a\\x49\\xbb\\x35\\x0d\\x68\\x1a\\x58\\xa9\\xc9\\xc4\\\n\\x0f\\x09\\xb1\\xb9\\x7a\\x45\\xe7\\x85\\xee\\x9f\\x8a\\x4b\\xb0\\xb2\\x36\\xe7\\\n\\x16\\x54\\xde\\x0f\\x2b\\x98\\x37\\x4b\\xc7\\x60\\x89\\x25\\x07\\x96\\x69\\xd2\\\n\\x31\\x4d\\x30\\x3b\\x73\\x3c\\x38\\x96\\x39\\xa3\\x11\\x73\\xf1\\x77\\xbb\\xae\\\n\\x8d\\x6a\\x07\\x9c\\x45\\x19\\xbd\\xdb\\x03\\x76\\x46\\xce\\x05\\x2a\\x6b\\xe0\\\n\\x88\\xa2\\xcd\\xf3\\x4d\\x3c\\xe3\\x59\\xba\\xed\\x0e\\x69\\x7b\\x83\\xde\\x00\\\n\\x86\\x83\\x21\\x77\\xdf\\x7a\\xc8\\xab\\x6f\\x3d\\xe2\\xf5\\x87\\x87\\xf4\\x06\\\n\\x02\\x1e\\xc8\\x2c\\xab\\xcc\\x02\\x35\\x4e\\x22\\xe2\\x24\\x2a\\xf8\\x6d\\x13\\\n\\x37\\x8f\\x64\\x70\\x27\\xf6\\x44\\x64\\x60\\x35\\xc7\\x75\\x2c\\xc6\\x4c\\xf1\\\n\\xfc\\x90\\x56\\xe0\\x56\\x58\\x8a\\x59\\x00\\x7f\\x7a\\xa1\\xcd\\xf2\\x52\\x01\\\n\\xcf\\xcc\\xab\\x92\\x27\\xde\\xbc\\xa6\\x61\\x6e\\x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xc9\\x95\\xe3\\\n\\x98\\x38\\x3c\\xe0\\xee\\x23\\x9d\\x31\\xe0\\x72\\x28\\xcd\\xfc\\x44\\x37\\x6d\\\n\\x02\\xa3\\x7c\\x0e\\x46\\x9c\\xc7\\xbf\\x29\\x2d\\x06\\x4a\\x4e\\x3b\\x9f\\xbf\\\n\\x8c\\xf6\\xd2\\xd9\\xeb\\x55\\x48\\x12\\x27\\x11\\x5d\\x8d\\x82\\xf9\\x88\\x49\\\n\\x1a\\x62\\x9a\\xf2\\x78\\x64\\xb0\\x10\\x3c\\x46\\xc7\\xa4\\x7e\\xda\\x84\\x65\\\n\\x18\\x1f\\xa7\\x34\\x96\\x35\\x29\\xd4\\x87\\x7b\\xfc\\xd1\\xde\\x19\\xfe\\xd7\\\n\\xfe\\x98\\x6b\\x4f\\xdf\\xc2\\x5d\\x54\\xa1\\x09\\x8d\\x51\\x07\\x5c\\x05\\x45\\\n\\x73\\xc9\\x53\\x4f\\x64\\xe7\\x36\\xa2\\x08\\x5b\\xcb\\x59\\x0b\\x14\\x46\\x45\\\n\\x07\\xae\\xcc\\xd0\\x07\\x76\\x8d\\x86\\x16\\xe3\\x8f\\x1d\\xdc\\x4c\\xa1\\xd5\\\n\\x76\\x19\\xa6\\x3e\\x8a\\xa6\\x30\\x0e\\x23\\x16\\xac\\xc7\\x64\\xdd\\x0d\\xa0\\\n\\xf7\\xa1\\x38\\xb8\\xda\\xae\\x2e\\xa7\\x3e\\xf4\\xa0\\x27\\x31\\xf1\\x74\\xe3\\\n\\x59\\x59\\xd8\\x55\\x6f\\x0e\\x3b\\xc0\\x75\\x92\\x24\\x44\\xd1\\x5b\\x24\\xc9\\\n\\x2c\\xa0\\x3d\\xd5\\x99\\x37\\x4f\\x31\\x81\\xa4\\xd8\\xf3\\xac\\xdb\\x89\\x64\\\n\\x14\\x88\\xc2\\x79\\x5f\\x89\\x73\\x78\\x19\\x20\\x33\\x67\\xff\\x94\\x7e\\x14\\\n\\x51\\x37\\x33\\xea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\\x0a\\x0e\\x2e\\x69\\x60\\x11\\xdb\\x01\\\n\\x35\\xb3\\x26\\x0b\\xd2\\x5e\\x69\\x09\\x30\\x84\\x86\\x65\\x62\\x4e\\x8b\\xeb\\\n\\xa4\\x9a\\x42\\xa4\\xc9\\x29\\x0e\\x80\\x78\\x1c\\xa2\\x07\\x11\\x8d\\xc5\\x18\\\n\\xa8\\x31\\xa2\\x4b\\x93\\x1e\\x8a\\xe6\\x62\\x07\\x82\\x6e\\x0b\\x52\\xe4\\x5e\\\n\\xbb\\x32\\x0b\\xe3\\xd6\\x04\\xbb\\x30\\xec\\x33\\x5c\\xd0\\x61\\x4f\\x04\\x6d\\\n\\x99\\x89\\x6b\\x8f\\x4f\\x99\\x5e\\x5a\\x64\\xd8\\xaa\\xcb\\x4c\\x0c\\x42\\x04\\\n\\xe4\\x5d\\x18\\x58\\x05\\x3d\\x2e\\x38\\x62\\x2a\\x05\\x9d\\x4b\\xe1\\xda\\x13\\\n\\x2a\\xd2\\x97\\xb8\\xea\\x00\\x64\\x86\\x11\\x69\\x31\\xce\\x54\\xce\\xdc\\x95\\\n\\xa3\\x97\\xd5\\xcc\\x6b\\x5e\\x10\\xd2\\x17\\x99\\xbb\\x42\\xbd\\x95\\x59\\x58\\\n\\x2c\\x83\\x34\\x2f\\x64\\xe2\\x49\\x98\\xd1\\xa1\\xc5\\x59\\x32\\xa0\\x71\\x78\\\n\\x51\\xee\\x57\\x7a\\x50\\x7c\\xec\\xc5\\x7b\\xb3\\xe6\\xc6\\xf2\\x3e\\xba\\xfa\\\n\\x1c\\x64\\x70\\xf5\\x0a\\xe8\\xfb\\xc7\\xec\\x2c\\x42\\x27\\x6b\\x62\\x60\\x13\\\n\\x11\\x11\\x45\\x30\\x3a\\x13\\xfb\\x9a\\xcb\\xc2\\x62\\xb9\\x0d\\xc7\\x03\\x53\\\n\\x8e\\xfe\\xe0\\x85\\xf4\\xdc\\x70\\x2e\\xa8\\x03\\xee\\x32\\x5c\\x09\\x79\\xf6\\\n\\xbe\\xc1\\x6e\\xbe\\x8b\\xb8\\x0e\\xec\\x72\\xa4\\x39\\x28\\x99\\x37\\x33\\x27\\\n\\x18\\x29\\x33\\xff\\x5b\\x99\\x41\\x2d\\x7a\\x4e\\xa9\\x81\\x1d\\x81\\x27\\x5a\\\n\\xc9\\xbd\\x61\\x48\\x8f\\x10\\xd5\\x0d\\x39\\x1d\\x35\\x51\\xdd\\x10\\xbc\\x7e\\\n\\x91\\xa9\\xfb\\x32\\x53\\x0b\\xa8\\xd1\\xa7\\x97\\xcd\\x8a\\xbe\\xe3\\x81\\x08\\\n\\xd4\\x4c\\x69\\x16\\xe3\\xff\\x5a\\x45\\x38\\xdf\\xa1\\xdb\\x8a\\xd8\\x39\\x08\\\n\\xf9\\xf3\\xbf\\xf9\\x36\\x3f\\x6a\\x5e\\xe5\\xfa\\x3f\\x5a\\x27\\x39\\x55\\x21\\\n\\x4c\\x50\\xcc\\x84\\x1a\\x35\\x99\\x60\\xb2\\x50\\x41\\x35\\x2d\\xb2\\x28\\xa4\\\n\\x99\\x29\\xa4\\xc0\\x59\\x18\\xd0\\xb0\\x4c\\xb4\\xb3\\x29\\x69\\x23\\x23\\xee\\\n\\x87\\x0c\\x06\\x43\\x74\\xdb\\x22\\x09\\x42\\x74\\x3b\\x11\\x41\\xab\\x19\\x40\\\n\\x4f\\x76\\xf8\\x02\\x3b\\xc7\\xf6\\xa6\\x42\\x5e\\x6f\\xe7\\xd8\\x81\\x22\\x8a\\\n\\x3f\\xb7\\x2e\\xf6\\xdc\\xad\\x2b\\x0c\\x4e\\x12\\x5a\\x67\\x09\\x3b\\xa7\\x1e\\\n\\x87\\x8b\\xae\\xcc\\xc4\\xab\\x97\\x16\\x39\\x9c\\x66\\x7c\\x62\\x28\\x32\\x71\\\n\\xd9\\xae\\xee\\x67\\x1a\\x64\\x33\\x83\\x96\\x8e\\x9a\\x8a\\x41\\x51\\xbd\\x17\\\n\\x93\\x48\\x6d\\xc4\\x19\\x16\\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xd0\\x1a\\x7b\\x8a\\x09\\\n\\x0a\\xb8\\x8e\\x46\\x5c\\x06\\xa4\\x53\\x99\\x84\\x2e\\x9d\\x84\\x0e\\x42\\xee\\\n\\xbe\\xf2\\x75\\x5e\\xfc\\xe4\\x2f\\xf2\\xec\\xb3\\x26\\x7b\\x87\\x42\\x28\\x5f\\\n\\x62\\x5d\\x5f\\x1d\\x93\\x9b\\xf6\\x1c\\xb4\\xd3\\x81\\xba\\x69\\x15\\xd0\\xc3\\\n\\x42\\x07\\x14\\x26\\xb4\\x25\\xdd\\x53\\xa3\\xd3\\xe9\\x08\\x3e\\xd9\\x9b\\xca\\\n\\x00\\x1e\\xa1\\x08\\x28\\x61\\xe7\\x42\\xce\\x99\\x4e\\x44\\x16\\x4e\\x27\\x82\\\n\\xb9\\xb0\\x61\\x95\\x7a\\x11\\x55\\xf3\\x98\\x18\\xa0\\xf6\\xf8\\x14\\xda\\x5d\\\n\\x69\\xb2\\xdd\\x51\\x53\\x19\\xc8\\xe5\\xfd\\xea\\x94\\x88\\xf6\\x5f\\xfc\\xf4\\\n\\x8f\\xfc\\x4a\\x42\\x88\\x81\\x4d\\x42\\x48\\x42\\x08\\xf1\\x04\\x8b\\x05\\x01\\\n\\x29\\x8c\\x0c\\x35\\xd0\\x89\\xe3\\x3e\\x06\\x36\\xaa\\x91\\xe1\\x27\\x09\\xd3\\\n\\x24\\xa1\\x96\\x24\\x78\\x7a\\x4c\\x8e\\x41\\x14\\x25\\x4c\\xf4\\x98\\x29\\x31\\\n\\x71\\x94\\x00\\x06\\x89\\xfc\\x35\\x21\\x4b\\x14\\xb2\\x44\\x41\\xb1\\x72\\x32\\\n\\x0c\\xe2\\xe4\\x4d\\x3e\\xd8\\xff\\x36\\x0b\\xcd\\x65\\x74\\xe3\\x92\\x1c\\x63\\\n\\xb2\\x30\\x88\\x8d\\x9c\\x3a\\x53\\xb4\\x54\\xc1\\xa6\\x46\\x6a\\x66\\x4c\\x26\\\n\\x3e\\x63\\xe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x8b\\x52\\x99\\x86\\x27\\xa0\\x83\\xf4\\x10\\x2e\\x9c\\\n\\xe0\\x05\\xb6\\xed\\xc8\\x21\\xd0\\x4c\\x69\\xa2\\xe6\\x23\\x7a\\x03\\x71\\xe2\\\n\\xa8\\xf9\\x88\\x38\\x11\\x3f\\xb3\\x2a\\xcb\\x1c\\x33\\x65\\xcc\\x14\\x35\\x1f\\\n\\x49\\x51\\x7e\\xf5\\xb9\\x6a\\x20\\x1b\\xad\\xde\\x9c\\x1b\\xfd\\x9f\\xbf\\xfb\\\n\\x36\\xbf\\xf3\\x17\\xc7\\x4c\\xb3\\x45\\xda\\xed\\x36\\x0d\\x2d\\x46\\x89\\x26\\\n\\xe4\\x66\\x9d\\x1c\\x1b\\x3b\\x5b\\xc4\\x57\\xc7\\x28\\x9a\\x2b\\x8f\\x23\\x14\\\n\\x52\\xb7\\x41\\x93\\x99\\xfa\\x6d\\x54\\x42\\xc5\\x73\\xc3\\xa7\\x33\\x9e\\x6e\\\n\\x3a\\xd7\\xfc\\x28\\x1b\\x22\\x81\\x7d\\x8e\\xe2\\x5b\\x9c\\xb1\\x1d\\x57\\xa6\\\n\\x16\\x87\\xd3\\x4c\\x52\\x6d\\x25\\x3b\\x51\\x16\\x86\\x25\\x4b\\x51\\x1e\\xc7\\\n\\xea\\x14\\xd5\\x9f\\xfb\\x25\\x74\\x12\\x7c\\x72\\x33\\x27\\xd4\\x45\\x00\\xf8\\\n\\x51\\x48\\x82\\x2f\\x46\\x7e\\x0a\\x86\\x22\\x0e\\x15\\x6a\\x85\\x68\\xc7\\x8f\\\n\\x42\\x92\\xa2\\xfb\\x53\\x32\\x1c\\x51\\x18\\x11\\x59\\xa6\\x38\\x16\\x18\\xcb\\\n\\x04\\x22\\x33\\x11\\x8f\\xf5\\x37\\x61\\xbf\\x25\\xb3\\x71\\x9c\\x6c\\x31\\xee\\\n\\x4f\\xe4\\x40\\x7d\\x52\\x14\\x7d\\x7e\\xb9\\xfe\\xd4\\x6e\\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\x2d\\xb3\\x77\\x39\\x64\\x12\\x87\\x63\\xa9\\xac\\xb8\\xba\\xa6\\x72\\\n\\x77\\x6f\\x5e\\xe7\\xfb\\x68\\xf4\\x06\\xcf\\x76\\x5e\\x16\\xd6\\x53\\x51\\x9f\\\n\\xbd\\x9d\\x87\\x90\\xbd\\x26\\xa7\\x94\\xf3\\x3b\\x5d\\x1a\\xc6\\x5d\\x36\\xb4\\\n\\x44\\x2e\\x89\\x29\\x27\\x4a\\x26\\xd6\\x75\\xae\\x5e\\xb9\\xc7\\x5b\\xb7\\x67\\\n\\xc1\\x39\\x68\\xdd\\xa7\\x3d\\x84\\x6c\\x6f\\x83\\x61\\x7e\\x1b\\x10\\x94\\xcd\\\n\\x0f\\x76\\x0e\\x41\\x05\\xbd\\xf5\\x65\\x76\\xef\\x1f\\xb2\\xbd\\xd3\\x67\\xff\\\n\\xec\\x84\\x7c\\xe1\\x29\\xda\\x4b\\x00\\x77\\x39\\x3d\\x7c\\x9d\\xdf\\x7f\\xd3\\\n\\xc2\\x5e\\xf9\\x1e\\x4f\\xdb\\x2f\\xf0\\x78\\x61\\x97\\x6b\\xba\\xcd\\x23\\x66\\\n\\x3a\\x8d\\x95\\xd4\\x47\\x51\\x73\\xfa\\x4d\\x85\\x58\\xd1\\x31\\xbc\\x84\\xc4\\\n\\x9e\\x0f\\xe0\\x32\\x68\\xcf\\x07\\x75\\xf9\\x7c\\x62\\x87\\x44\\xc9\\x18\\x33\\\n\\x98\\x15\\x4f\\xcd\\xc4\\x67\\x54\\x70\\xa2\\x0d\\xc7\\x60\\x98\\x8d\\xe8\\xaa\\\n\\x39\\xbd\\x6c\\x44\\xcb\\x69\\x42\\x2e\\xd8\\x8f\\xc4\\x1e\\xd1\\x75\\x72\\xc9\\\n\\x86\\x94\\x9f\\xab\\x63\\x49\\xec\\xad\\x2e\\xae\\x42\\x51\\x10\\xf6\\x06\\x70\\\n\\xb3\\x6b\\xb1\\x79\\x75\\x83\\x9b\\x57\\x63\\x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n\\x4d\\x27\\x98\\x0b\\x40\\x3d\\xb0\\x04\\xfe\\xd5\\x1b\\x02\\x3a\\x34\\x55\\x49\\\n\\x15\\x57\\x03\\xb7\\x84\\x16\\xd5\\xcc\\xdc\\x74\\x82\\xb9\\x93\\x22\\x76\\x05\\\n\\x06\\xa7\\x08\\xe8\\xaa\\x3f\\x45\\xa9\\x3f\\x7e\\xe6\\xc5\\x5b\\xdc\\xbc\\x1a\\\n\\xb3\\x62\\x5e\\x43\\xff\\x84\\x06\\xfd\\x6c\\x2e\\x70\\x27\\xce\\x81\\xc8\\xc2\\\n\\x8b\\x6b\\x73\\xd9\\xb8\\x7a\\xbf\\xbe\\x08\\x9c\\x8a\\xcf\\xbd\\xba\\xb8\\x21\\\n\\x02\\xdd\\x87\\xe1\\x60\\x93\\xd5\\xf6\\x36\\x67\\x1c\\x63\\x27\\xcb\\x88\\x66\\\n\\x6f\\x5d\\x62\\xe3\\xb2\\xd0\\x2b\\x1f\\x57\\x03\\xb9\\x0c\\xe6\\x91\\x12\\x31\\\n\\xd8\\x3d\\x45\\x1f\\x7c\\x4f\\x06\\xee\\xf8\\xd4\\x13\\x8b\\xd4\\x03\\x91\\x89\\\n\\xcb\\xb6\\xb3\\xaf\\x6f\\x80\\x2e\\x54\\x71\\x12\\x13\\x17\\x8c\\x87\\xa0\\x7f\\\n\\x8b\\x46\\x46\\x99\\x61\\xc1\\xc4\\x4a\\x26\\xb2\\x63\\x27\\x05\\x4b\\xca\\x19\\\n\\x06\\x36\\x53\\x4d\\xe0\\xe5\\xc4\\xcb\\x31\\xf5\\x08\\x88\\xf0\\x12\\x13\\x53\\\n\\x17\\x27\\x42\\x4c\\x80\\x11\\xb9\\xc4\\xa6\\xf7\\xa1\\x01\\x6d\\x58\\x82\\x2e\\\n\\xbf\\xbc\\xf9\\x32\\xde\\xe4\\x16\\x27\\x85\\xe3\\x69\\x47\\x7d\\x30\\x37\\x2a\\\n\\xf9\\x4c\\x57\\x61\\xe7\\xdd\\x1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\\x02\\xe8\\x82\\x79\\xa7\\x80\\xb5\\x3c\\x4f\\xb1\\xb0\\xa7\\x97\\x36\\\n\\x69\\x33\\xed\\x66\\x82\\x1d\\xad\\x08\\x78\\x5d\\x19\\x78\\x0f\\x9a\\x86\\x7a\\\n\\x7e\\xf3\\xea\\x2e\\x23\\xff\\x28\\xae\\xd1\\xbb\\x10\\x45\\xa9\\xd5\\x08\\xfc\\\n\\x1d\\x35\\x81\\xc8\\xa8\\x1a\\x58\\x83\\x3c\\xa6\\xb5\\x42\\xcd\\x14\\xe3\\x02\\\n\\xfa\\x40\\xeb\\x03\\x78\\x56\\xdd\\xa6\\x61\\x46\\x84\\xf5\\x06\\xf7\\x1f\\x5c\\\n\\x11\\xad\\xff\\x0d\\xb8\\x03\\xd9\\xd8\\x47\\x4c\\xa6\\x4c\\x69\\x59\\x48\\x89\\\n\\xd2\\xaa\\xf0\\x8a\\x48\\xe9\\x50\\xa9\\x83\\x71\\x75\\xc8\\x20\\xfe\\xe2\\xa5\\\n\\xec\\x63\\x06\\xd8\\x58\\x83\\xbc\\xea\\xb3\\x56\\x37\\xab\\x74\\x2a\\x11\\x46\\\n\\xd0\\x9f\\x31\\xca\\x54\\x40\\x03\\x21\\x23\\x0a\\x83\\x52\\x02\\xdc\\xa5\\x30\\\n\\x87\\x6b\\x8e\\xe7\\x02\\x58\\x0f\\x8c\\xb4\\x8a\\x1e\\xd6\\x60\\x42\\xb5\\x3c\\\n\\x6d\\xac\\x22\\x73\\x29\\x9a\\x35\\xd1\\x31\\xbe\\xbc\\x61\\xb0\\x5c\\x10\\x12\\\n\\x02\\xa0\\xb2\\xb0\\x4a\\xeb\\xea\\x94\\xca\\xc2\\x2a\\x10\\x70\\xe1\\x65\\x58\\\n\\x9a\\xc3\\xca\\x12\\xd0\\x27\\x17\\x87\\xca\\x2b\\xd5\\xf1\\xde\\xa4\\xb5\\x9d\\\n\\xe3\\x07\\x2f\\xa1\\xf0\\x37\\xff\\x46\\x9c\\x45\\x18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\xf1\\xfb\\xdc\\x7a\\xe5\\x8b\\x82\\\n\\x59\\x35\\x00\\xcb\\x04\\x99\\xce\\x9c\\x03\\x40\\xcf\\x10\\xd1\\x2f\\xad\\x54\\\n\\x48\\x2f\\xef\\x71\\x9d\\x89\\xf0\\x05\\xb7\\xfa\\xb4\\x3a\\x72\\x86\\xb0\\xad\\\n\\x52\\x2e\\xf5\\x84\\x9c\\x74\\xee\\x43\\x2b\\x34\\xd4\\xf3\\xf2\\xbb\\xc8\\xfd\\\n\\xf5\\x72\\x7e\\x3d\\xc2\\x17\\x50\\x53\\x00\\xce\\xd0\\xa5\\x99\\x81\\x17\\xee\\\n\\xdc\\xe1\\xf6\\x9d\\x8d\\xb9\\x00\\x06\\x88\\xb2\\x67\\x73\\x25\\x84\\x88\\xbe\\\n\\x8a\\x34\\xc1\\x9d\\xa3\\x0b\\x26\\xdc\\x22\\xcb\\x01\\xce\\x69\\xc4\\xd3\\xc3\\\n\\x55\\xde\\x7b\\x27\\xe0\\xd1\\xdb\\xae\\x62\\x5f\\x09\\xda\\x16\\x02\\xc0\\xb2\\\n\\x52\\x5a\\xaf\\x98\\x96\\xe3\\x80\\xf7\\xfb\\xcf\\x44\\xbb\\xaf\\xea\\x5d\\x7e\\\n\\xe3\\x38\\xe2\\x7f\\xff\\xef\\xfe\\x4b\\xce\\xfe\\xf4\\x37\\x09\\xcd\\x76\\x0c\\\n\\x44\\x83\\xff\\xf4\\xef\\x7f\\x9e\\xca\\xfa\\x16\\x93\\xf3\\x47\\xb4\\xda\\x06\\\n\\x6f\\x7e\\xfb\\x77\\x79\\xfb\\xe1\\x1f\\x51\\x2b\\x89\\xf3\\x70\\x15\\x64\\x54\\\n\\x3a\\xa6\\x32\\xde\\x46\\x56\\x3c\\xa6\\x41\\xef\\x00\\x15\\x5f\\x55\\x75\\x5c\\\n\\xf5\\xa7\\x19\\x72\\x55\\x22\\xd1\\x01\\x48\\x02\\x4b\\x67\\x61\\x19\\xa1\\x93\\\n\\xcf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\\x9b\\x43\\xc5\\xc2\\x21\\xa2\\xd3\\xbb\\x04\\xa8\\xdb\\xda\\xe6\\x20\\x9a\\\n\\x10\\x85\\x3b\\xd4\\xba\\x23\\xba\\xb5\\x7c\\x82\\x81\\xba\\xb5\\xbc\\x7a\\x5e\\\n\\xf7\\x27\\xde\\x28\\x2d\\x51\\x7e\\x39\\xc3\\xad\\xad\\x57\\xf0\\x82\\x20\\x61\\\n\\x60\\x89\\xcc\\xb5\\x38\\x49\\x29\\xe8\\xab\\xdc\\x5f\\xf9\\x58\\x82\\x52\\x37\\\n\\xd8\\x66\\x18\\x3a\\x7e\\x6c\\x0d\\x6c\\x8c\\xa0\\x9f\\xe8\\xe2\\x23\\x75\\xae\\\n\\xac\\xbc\\xd0\\x17\\x81\\xde\\xea\\x35\\x43\\x97\\x5a\\x46\\x00\\xf8\\xfe\\x03\\\n\\x53\\x05\\x75\\x94\\xad\\xd1\\x64\\x46\\x13\\x57\\xba\\xb7\\x66\\xdc\\x6a\\x67\\\n\\xfd\\x01\\x6e\\x6b\\x9b\\xf7\\xde\\x09\\x78\\xe3\\xdb\\xef\\xf1\\x64\\x6f\\xa8\\\n\\x64\\x41\\xb7\\xd8\\x57\\x8c\\x1a\\x99\\x15\\xb2\\xce\\x58\\xe9\\x5a\\x09\\x38\\\n\\xc9\\xbc\\xb2\\x62\\x5b\\xea\\x5c\\xf9\\xbc\\xde\\xff\\x58\\xb2\\xb0\\x5e\\x4d\\\n\\xa2\\x7f\\x9e\\x32\\x10\\xa3\\xa7\\x64\\xaa\\x1d\\xbe\\x75\\x60\\xf1\\xc1\\xef\\\n\\x3c\\xc5\\x74\\x46\\xc2\\xc8\\xd3\\xb4\\x71\\x76\\xf9\\x01\\x97\\x3d\\xb1\\xe8\\\n\\x5e\\xff\\xf6\\x37\\x94\\x61\\x97\\x0e\\x7c\\xac\\x95\\x0d\\xdc\\xb3\\x80\\xa8\\\n\\xd2\\xc4\\x08\\x5a\\xd0\\x8d\\x65\\x5e\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d\\x02\\\n\\x7e\\x71\\xa4\\x5e\\x4b\\xba\\xec\\xaa\\x6c\\x36\\x57\\xe9\\x5e\\xb5\\x79\\x6b\\\n\\xcf\\x65\\xec\\xff\\x99\\xd2\\xc6\\x77\\x63\\x6d\\x3c\\x39\\x7f\\x84\\x6b\\xad\\\n\\x27\\x5b\\x2a\\xd8\\x70\\x9a\\xba\\xc8\\x1b\\xb9\\x45\\x4a\\x2b\\x19\\x8c\\x7e\\\n\\x8b\\x28\\xd3\\x24\\xac\\x76\\x84\\x9b\\x2d\\x66\\xe2\\xd2\\x60\\x3c\\xf5\\x13\\\n\\x7b\\x51\\x2d\\xa1\\x71\\x8b\\x25\\x91\\x18\\x5f\\xb1\\x4c\\xdc\\xc8\\x06\\xca\\\n\\x98\\x99\\x92\\xea\\x02\\x34\\xf5\\xaf\\x65\\x12\\x39\\x16\\xc5\\x12\\x4a\\x3e\\\n\\xb4\\x27\\x36\\x95\\xfc\\x0a\\xdd\\x77\\x07\\x22\\x86\\xee\\xef\\x30\\x29\\x1c\\\n\\x29\\x57\\x4e\\x8b\\x80\\xa6\\x39\\xe4\\xd4\\x83\\x0f\\xdc\\x36\\x67\\xbd\\x2c\\\n\\x67\\x3d\\xf1\\xe5\\xa2\\x70\\x87\\xb3\\x5e\\x56\\x0c\\xe3\\xcb\\xdc\\x4a\\xb0\\\n\\x70\\xb7\\x96\\xe7\\x46\\xc1\\x27\\xe4\\x7e\\xc2\\x11\\x0e\\x28\\xe3\\xef\\xd0\\\n\\x35\\x58\\xad\\x6f\\x24\\x7c\\xc0\\xf3\\xd8\\x75\\x5e\\x70\\xc2\\x08\\xfa\\x09\\\n\\xc3\\xad\\xea\\x3b\\x8a\\x59\\x7b\\x56\\x99\\x52\\x39\\xab\\xc0\\xac\\x03\\x35\\\n\\xad\\x87\\x75\\x2f\\x87\\xee\\xda\\xab\\x65\\x6a\\x34\\x6b\\x36\\x6b\\x65\\x43\\\n\\xb9\\xd2\\xce\\x87\\xe7\\x09\\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\\x79\\x5c\\x12\\x55\\xdf\\x73\\x8e\\xb1\\x7e\\x7f\\\n\\x99\\x48\\x91\\x46\\x22\\x76\\x10\\xf4\\xe7\\xba\\xe9\\xd2\\xcf\\xa5\\xcf\\xab\\\n\\xee\\x92\\x6b\\x75\\x3d\\xa2\\xec\\x19\\x79\\x56\\x70\\x49\\x85\\xb2\\xad\\x64\\\n\\xb9\\x52\\x89\\x1c\\x01\\x35\\xd1\\xe2\\xd5\\xbd\\x60\\xa3\\x34\\xdf\\xe5\\x57\\\n\\x2a\\x67\\xb1\\xee\\x7f\\xfe\\x93\\xf8\\x97\\x15\\xac\\xcf\\xf7\\x45\\xf4\\x0d\\\n\\x78\\xf5\\xee\\x90\\xc3\\xe0\\x2e\\x0b\\x77\\x7c\\x02\\x1f\\x16\\xec\\x0d\\x5a\\\n\\xec\\xc7\\xa0\\xfe\\x50\\x31\\xf6\\xfa\\xba\\xa8\\xe6\\x30\\x56\\xb2\\xe2\\x4b\\\n\\x04\\x0f\\x55\\x56\\x5a\\x3d\\x32\\xe8\\xc4\\x91\\x26\\x79\\x49\\x13\\xee\\x9e\\\n\\xf9\\x2e\\xae\\xb4\\x3e\\x53\\x46\\x9a\\xef\\x42\\x0f\\x7c\\xdc\\x84\\x11\\x37\\\n\\x57\\x0f\\xc7\\xd2\\x41\\xee\\x3b\\xec\\xb9\\x09\\xa3\\x45\\x07\\xb2\\x6e\\xd0\\\n\\x28\\x3d\\x88\\xa9\\x5c\\x4d\\xcd\\xfa\\x40\\x15\\x82\\x16\\x57\\x93\\x25\\x56\\\n\\x8f\\xfd\\x67\\x14\\xce\\x9b\\x74\\x3b\\x5d\\xdc\\x98\\x09\\x75\\xf6\\x95\\x2c\\\n\\xaf\\xff\\x16\\x7d\\xe1\\xd6\\x23\\x43\\xc8\\x8c\\x6a\\xc4\\xf6\\x55\\x87\\xee\\\n\\xaf\\x7f\\x9d\\x47\\xef\\xdc\\xa0\\xfc\\xca\\x21\\x0b\\x5d\\xd1\\x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\\x25\\x4f\\x60\\x2f\\x19\\\n\\xd8\\x90\\xec\\x5b\\x69\\x64\\x67\\x2e\\xb9\\x72\\xff\\x74\\x35\\x87\\x9c\\x66\\\n\\x34\\x5c\\x6e\\x51\\x19\\xde\\xa0\\x5f\\x38\\x56\\x35\\x7d\\x22\\x78\\x33\\x99\\\n\\x3d\\x61\\xd7\\xe4\\x6c\\xe8\\x41\\x81\\x04\\xd8\\x52\\xa9\\xa1\\xba\\x57\\x26\\\n\\xed\\x39\\x98\\xe7\\xf9\\x98\\x97\\x0b\\x3d\\xcf\\x38\\xd5\\x17\\xb8\\xf4\\x5f\\\n\\x17\\x72\\x6b\\x33\\x57\\x8d\\x79\\x0c\\x9b\\x96\\x14\\xcf\\x33\\xee\\xae\\x5b\\\n\\x78\\xfa\\x77\\xd7\\x93\\xe4\\xeb\\x55\\xa0\\x9c\\x85\\x4e\\xc8\\xce\\xf6\\x19\\\n\\xfc\\x28\\x84\\x3d\\xb0\\xcc\\x88\\xe5\\xf6\\xd4\\xc5\\x9b\\x2d\\x7c\\x1c\\xfc\\\n\\xa3\\x69\\x92\\x7c\\xec\\x21\\x79\\xb2\\x3f\\x41\\x14\\x8f\\x57\\xa8\\x1a\\x2e\\\n\\x66\\xad\\xa1\\x65\\xb1\\xd9\\x0d\\x3c\\xc6\\x84\\x83\\x21\\xa5\\x62\\x14\\x33\\\n\\x71\\x14\\x3f\\x17\\x0a\\x30\\x7b\\x6d\\x4a\\xc5\\x06\\x78\\x6d\\x3c\\x1b\\xc2\\\n\\xc8\\xa6\\xa4\\x71\\xb0\\x8d\\x87\\x3b\\x30\\xa0\\x88\\x02\\xbd\\x40\\xf3\\x90\\\n\\xb6\\x9d\\x61\\xed\\x66\\x85\\xd5\\xfa\\x97\\xe1\\x8b\\x7d\\x9a\\x93\\x2f\\xd1\\\n\\x0f\\xce\\xc0\\x8e\\x2d\\xea\\xa1\\x41\\x35\\x9f\\x63\\x62\\x98\\x6c\\xae\\x7e\\\n\\x19\\x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a0\\x8c\\x41\\xe6\\x61\\x12\\x46\\x36\\x0c\\x86\\x94\\x8a\\x0d\\\n\\xdc\\x81\\xec\\x86\\x28\\xb6\\x42\\x82\\x88\\xd7\\x4a\\x5e\\x1b\\x77\\x20\\x58\\\n\\x19\\x40\\x2e\\x10\\x77\\x50\\xc4\\x2c\\x9a\\x84\\x83\\x90\\x6c\\xd1\\x66\\x3c\\\n\\x20\\x66\\xf9\\x82\\x08\\x67\\x07\\x11\\x54\\x6c\\xcc\\x81\\x18\\x76\\x03\\x65\\\n\\x6c\\xcf\\x8d\\x47\\x90\\x4d\\x6f\\xfb\\x95\\x09\\x81\\x66\\xad\\xeb\\xae\\x23\\\n\\xe9\\xd9\\x98\\x77\\xc2\\x66\\x0c\\xbf\\x38\\x72\\xd4\\xac\\xd9\\x0c\\x97\\x5b\\\n\\xb4\\x4e\\x81\\xd3\\xe9\\xd8\\x58\\x59\\xf9\\xa0\\x97\\xb9\\x8b\\xf1\\x60\\x36\\\n\\xa8\\xd6\\xae\\x3c\\xb7\\x4e\\xf0\\x3a\\x69\\x90\\x0e\\x76\\xcc\\x2b\\xa3\\x9a\\\n\\xc7\\xa6\\x32\\xd7\\xa1\\xea\\x3b\\x60\\x25\\x93\\x73\\x9e\\xc7\\xb8\\xd7\\x45\\\n\\xe6\\xa4\\x67\\xc2\\xae\\x64\\x66\\xa4\\x83\\x64\\xdf\\x8f\\x5a\\x44\\xd7\\xdd\\\n\\xf4\\x48\\x68\\x42\\x1b\\xc7\\x00\\x6f\\x75\\xb3\\x6c\\x1f\\xef\\xb2\\x79\\x79\\\n\\x9f\\x71\\xe3\\x52\\xb5\\x42\\x00\\xa8\\x2f\\xbe\\x42\\xc9\\x3f\\xc2\\x25\\x1e\\\n\\x96\\x33\\xc8\\x89\\xb9\\x1e\\xbb\\x01\\xd9\\xd6\\x9b\\xec\\xda\\xa2\\x11\\xe1\\\n\\x51\\x3c\\x13\\xda\\x35\\xc7\\x98\\x25\\xc3\\xc3\\xb3\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6\\x85\\\n\\x3c\\x12\\x26\\x39\\xa2\\xa6\\x54\\xf2\\x10\\x73\\x1f\\x96\\xa4\\x8b\\x89\\xa1\\\n\\x4d\\x99\\x6c\\x5c\\x4a\\x10\\x80\\xb9\\x51\\xc8\\x7d\\xd5\\x54\\xc9\\x2d\\xec\\\n\\x86\\x66\\x56\\x34\\xff\\xae\\xf5\\x50\\x19\\x08\\x4d\\x4c\\x8d\\x05\\x33\\xdc\\\n\\x21\\x73\\x1f\\x89\\x74\\xcc\\xe8\\x74\\x88\\x45\\x72\\x89\\x13\\x7f\\x52\\xf7\\\n\\x27\\x5e\\xb9\\x40\\xaf\\xd8\\x97\\x13\\x2a\\x58\\x0f\\x81\\x51\\x35\\xd0\\xd2\\\n\\xc2\\xac\\xad\\x0f\\x19\\x7e\\xba\\x0b\\x20\\x74\\x6d\\x2c\\xe1\\x88\\x68\\xdd\\\n\\xa1\\x88\\x11\\xdd\\x7a\\xa2\\x38\\x92\\xc0\\x4b\\x60\\xb6\\xe7\\x89\\xdc\\xb1\\\n\\x11\\xfa\\xea\\x08\\xde\\x9c\\xf0\\x90\\xc1\\x67\\xca\\xf1\\x35\\x05\\x2e\\x78\\\n\\xd4\\x4e\\xa7\\xc7\\x8f\\xc9\\x44\\xe3\\xeb\\x88\\xf9\\x78\\xd2\\x8d\\x29\\x3a\\\n\\xc7\\x75\\x30\\xf9\\x81\\xe9\\xf5\\x02\\x15\\x82\\xd0\\x86\\x9f\\xdb\\x22\\x7b\\\n\\x4d\\x05\\x3d\\x81\\x76\\x3d\\x5d\\xec\\x35\\x5b\\xa1\\xe7\\x04\\x50\\x5e\\x38\\\n\\x1b\\xf4\\x3b\\x52\\xab\\xd7\\xb9\\xdb\\x17\\x9d\\x7d\\xd2\\x7c\\x86\\xc5\\xdd\\\n\\x9d\\xd0\\xc4\\x70\\x2f\\x77\\x43\\xd5\\x8b\\x97\\x08\\x58\\xda\\x42\\x55\\xbe\\\n\\x44\\x52\\xc5\\x20\\x8d\\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\\x95\\xb3\\xca\\xde\\x26\\xa3\\xd4\\xc4\\\n\\xcc\\x54\\x9d\\x41\\xc0\\xa5\\x3b\\xc4\\x02\\x75\\x24\\x6e\\x01\\x26\\x2f\\xb2\\\n\\x50\\x44\\xed\\x74\\xee\\x35\\x1e\\xcc\\xa0\\x48\\x9e\\x49\\x37\\xab\\x44\\x43\\\n\\x4c\\xdc\\x71\\x7b\\xe8\\xb9\\x01\\xbe\\x7f\\xf9\\xc3\\xee\\x77\\x01\\xf8\\x9c\\\n\\x0d\\x02\\x4d\\x92\\x54\\xcc\\x09\\x21\\x36\\x0e\\xee\\x3f\\x42\\xf7\\xec\\x44\\\n\\x74\\x01\\x02\\x00\\xa7\\xc9\\x36\\xb4\\x6d\\x27\\xc0\\x13\\xab\\x40\\xb9\\xcd\\\n\\x30\\xec\\xd4\\x01\\x06\\x02\\x35\\x67\\x47\\x4a\\xc6\\xf1\\x31\\x17\\x60\\xa7\\\n\\x6d\\x49\\x82\\x70\\x29\\x62\\x02\\xb0\\xca\\xbc\\x6d\\xbe\\xe9\\x55\\xba\\xc1\\\n\\xdb\\xd5\\x35\\xd2\\xab\\x97\\xc2\\x33\\xc1\\xbd\\x02\\x34\\x89\\x48\\xa6\\xd1\\\n\\x06\\xd4\\xe1\\x2e\\x47\\x42\\x57\\xe7\\xd6\\x6a\\x54\\x4e\\x37\\x12\\x38\\x3d\\\n\\xc7\\xc1\\x76\\x3a\\x43\\xff\\x6c\\x64\\xd4\\xcf\\x1c\\x58\\xbc\\xf7\\x9b\\x8e\\\n\\x41\\x75\\xfe\\xed\\x36\\xcd\\xae\\x6e\\xdf\\x16\\x1c\\x31\\x7d\\x2e\\x67\\xe2\\\n\\xe5\\x76\\x0b\\xdb\\xaf\\xa4\\x47\\x8a\\xd6\\x95\\xb9\\xa5\\xf5\\x13\\x93\\x57\\\n\\xc3\\xc4\\xba\\x26\\xf0\\xaa\\x9d\\xe3\\x37\\x93\\xb5\\x08\\xce\\x90\\xb7\\xe1\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\x34\\x8e\\xa5\\xe4\\xf5\\xd8\\x1d\\xd4\\x53\\x8f\\x00\\xc4\\x8b\\\n\\x7a\\x02\\x52\\xbc\\x00\\xb2\\xd1\\x9d\\x28\\xf8\\xcc\\x46\\x77\\x08\\xfb\\x11\\\n\\x82\\xfb\\x8f\\x50\\x7a\\x17\\xb8\\xd7\\xe9\\x22\\x0f\\xa2\\xba\\x17\\xdb\\xb7\\\n\\xdf\\xd4\\xd2\\xc4\\xbd\\xc4\\xa6\\x77\\x85\\x78\\x01\\xc0\\x3d\\x81\\x13\\xcf\\\n\\xf0\\x70\\x74\\x8e\\xd2\\xbb\\x80\\x87\\x53\\x78\\x16\\x50\\x34\\x8c\\x8c\\x41\\\n\\x85\\xff\\x07\\x5b\\x53\\xe4\\xea\\xf5\\xd8\\xe3\\x94\\x00\\x00\\x00\\x00\\x49\\\n\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\"\"\"\n\nqt_resource_name = b\"\"\"\\\n\\x00\\x09\\\n\\x06\\xa8\\xaa\\x74\\\n\\x00\\x71\\\n\\x00\\x75\\x00\\x6f\\x00\\x74\\x00\\x65\\x00\\x2e\\x00\\x74\\x00\\x78\\x00\\x74\\\n\\x00\\x0a\\\n\\x07\\x2b\\x67\\xc7\\\n\\x00\\x73\\\n\\x00\\x61\\x00\\x6d\\x00\\x70\\x00\\x6c\\x00\\x65\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\"\"\"\n\nqt_resource_struct = b\"\"\"\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\\n\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\\n\\x00\\x00\\x00\\x18\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x39\\\n\"\"\"\n\ndef qInitResources():\n    QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)\n\ndef qCleanupResources():\n    QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)\n\nqInitResources()\n"
  },
  {
    "path": "tests/QtCore/setprop_on_ctor_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtCore import *\n\n\nclass SetPropOnCtorTest(unittest.TestCase):\n    def testIt(self):\n        obj = QEventTransition(targetStates = [QState()])\n        self.assertEqual(len(obj.targetStates()), 1);\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/staticMetaObject_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QObject, Slot, QMetaObject\n\nclass MyObject(QObject):\n    @Slot(int, str)\n    def slot1(self, a, b):\n        pass\n\nclass testAttribute(unittest.TestCase):\n    def testBug896(self):\n        mo = MyObject.staticMetaObject\n        self.assertTrue(isinstance(mo, QMetaObject))\n        self.assertEqual(mo.className(), 'MyObject')\n        self.assertTrue(mo.indexOfSlot('slot1(int,QString)') > -1)\n\n    def testDuplicateSlot(self):\n        mo = MyObject.staticMetaObject\n        self.assertEqual(mo.indexOfSignal('destroyed(void)'), -1)\n        self.assertTrue(mo.indexOfSignal('destroyed()') > -1)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/static_method_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for overloads involving static and non-static versions of a method.'''\n\nimport os\nimport unittest\n\nfrom PySide.QtCore import QFile\n\nclass StaticNonStaticMethodsTest(unittest.TestCase):\n    '''Test cases for overloads involving static and non-static versions of a method.'''\n\n    def setUp(self):\n        filename = 'somefile%d.txt' % os.getpid()\n        self.existing_filename = os.path.join(os.path.curdir, filename)\n        self.delete_file = False\n        if not os.path.exists(self.existing_filename):\n            f = open(self.existing_filename, 'w')\n            for line in range(10):\n                f.write('sbrubbles\\n')\n            f.close()\n            self.delete_file = True\n\n        self.non_existing_filename = os.path.join(os.path.curdir, 'inexistingfile.txt')\n        i = 0\n        while os.path.exists(self.non_existing_filename):\n            i += 1\n            filename = 'inexistingfile-%d.txt' % i\n            self.non_existing_filename = os.path.join(os.path.curdir, filename)\n\n    def tearDown(self):\n        if self.delete_file:\n            os.remove(self.existing_filename)\n\n    def testCallingStaticMethodWithClass(self):\n        '''Call static method using class.'''\n        self.assert_(QFile.exists(self.existing_filename))\n        self.assertFalse(QFile.exists(self.non_existing_filename))\n\n    def testCallingStaticMethodWithInstance(self):\n        '''Call static method using instance of class.'''\n        f = QFile(self.non_existing_filename)\n        self.assert_(f.exists(self.existing_filename))\n        self.assertFalse(f.exists(self.non_existing_filename))\n\n    def testCallingInstanceMethod(self):\n        '''Call instance method.'''\n        f1 = QFile(self.non_existing_filename)\n        self.assertFalse(f1.exists())\n        f2 = QFile(self.existing_filename)\n        self.assert_(f2.exists())\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/static_protected_methods_test.py",
    "content": "#!/usr/bin/python\n'''Unit tests for static protected methods'''\n\nimport unittest, time\n\nfrom PySide.QtCore import QThread\n\nclass Test (QThread):\n    def run(self):\n        start = time.time()\n        self.sleep(1)\n        self.time_elapsed = time.time() - start\n\nclass QStaticProtectedCall(unittest.TestCase):\n    '''Test case for static protected method call'''\n\n    def setUp(self):\n        pass\n\n    def tearDown(self):\n        pass\n\n    def testPathSeparator(self):\n        thread = Test()\n        thread.start()\n        thread.wait()\n        self.assertTrue(thread.time_elapsed <= 1.1) # tolarance of 100ms\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/thread_signals_test.py",
    "content": "\n''' Test case for QObject.signalsBlocked() and blockSignal()'''\n\nimport unittest\nimport os\nfrom tempfile import mkstemp\n\nfrom PySide.QtCore import QObject, SIGNAL, QFile, QThread, QTimer, Qt\nfrom helper import UsesQCoreApplication\n\nclass MyThread(QThread):\n\n    def run(self):\n        self.emit(SIGNAL(\"test(const QString&)\"), \"INdT - PySide\");\n\nclass TestThreadSignal(UsesQCoreApplication):\n\n    __called__ = True\n    def _callback(self, msg):\n        self.assertEqual(msg, \"INdT - PySide\")\n        self.__called__ = True\n        self.app.quit()\n\n    def testThread(self):\n        t = MyThread()\n        QObject.connect(t, SIGNAL(\"test(const QString&)\"), self._callback);\n        t.start()\n\n        self.app.exec_()\n        t.wait()\n        self.assert_(self.__called__);\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtCore/tr_noop_test.py",
    "content": "import unittest\n\nimport sys\nfrom PySide.QtCore import QT_TR_NOOP, QT_TR_NOOP_UTF8\nfrom PySide.QtCore import QT_TRANSLATE_NOOP, QT_TRANSLATE_NOOP3, QT_TRANSLATE_NOOP_UTF8\n\nclass QtTrNoopTest(unittest.TestCase):\n\n    def setUp(self):\n        self.txt = 'Cthulhu fhtag!'\n\n    def tearDown(self):\n        del self.txt\n\n    def testQtTrNoop(self):\n        refcnt = sys.getrefcount(self.txt)\n        result = QT_TR_NOOP(self.txt)\n        self.assertEqual(result, self.txt)\n        self.assertEqual(sys.getrefcount(result), refcnt + 1)\n\n    def testQtTrNoopUtf8(self):\n        refcnt = sys.getrefcount(self.txt)\n        result = QT_TR_NOOP_UTF8(self.txt)\n        self.assertEqual(result, self.txt)\n        self.assertEqual(sys.getrefcount(result), refcnt + 1)\n\n    def testQtTranslateNoop(self):\n        refcnt = sys.getrefcount(self.txt)\n        result = QT_TRANSLATE_NOOP(None, self.txt)\n        self.assertEqual(result, self.txt)\n        self.assertEqual(sys.getrefcount(result), refcnt + 1)\n\n    def testQtTranslateNoopUtf8(self):\n        refcnt = sys.getrefcount(self.txt)\n        result = QT_TRANSLATE_NOOP_UTF8(self.txt)\n        self.assertEqual(result, self.txt)\n        self.assertEqual(sys.getrefcount(result), refcnt + 1)\n\n    def testQtTranslateNoop3(self):\n        refcnt = sys.getrefcount(self.txt)\n        result = QT_TRANSLATE_NOOP3(None, self.txt, None)\n        self.assertEqual(result, self.txt)\n        self.assertEqual(sys.getrefcount(result), refcnt + 1)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/translation_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n'''Unit tests to test QTranslator and translation in general.'''\n\nimport os\nimport unittest\nimport py3kcompat as py3k\nfrom PySide.QtCore import QObject, QTranslator, QCoreApplication\n\nfrom helper import UsesQCoreApplication\n\nclass TranslationTest(UsesQCoreApplication):\n    '''Test case for Qt translation facilities.'''\n\n    def setUp(self):\n        super(TranslationTest, self).setUp()\n        self.trdir = os.path.join(os.path.dirname(__file__), 'translations')\n\n    def testLatin(self):\n        #Set string value to Latin\n        translator = QTranslator()\n        translator.load(os.path.join(self.trdir, 'trans_latin.qm'))\n        self.app.installTranslator(translator)\n\n        obj = QObject()\n        obj.setObjectName(obj.tr('Hello World!'))\n        self.assertEqual(obj.objectName(), py3k.unicode_('Orbis, te saluto!'))\n\n    def testRussian(self):\n        #Set string value to Russian\n        translator = QTranslator()\n        translator.load(os.path.join(self.trdir, 'trans_russian.qm'))\n        self.app.installTranslator(translator)\n\n        obj = QObject()\n        obj.setObjectName(obj.tr('Hello World!'))\n        self.assertEqual(obj.objectName(), py3k.unicode_('привет мир!'))\n\n    def testUtf8(self):\n        translator = QTranslator()\n        translator.load(os.path.join(self.trdir, 'trans_russian.qm'))\n        self.app.installTranslator(translator)\n\n        obj = QObject()\n        obj.setObjectName(obj.trUtf8('Hello World!'))\n        self.assertEqual(obj.objectName(), py3k.unicode_('привет мир!'))\n\n    def testTranslateWithNoneDisambiguation(self):\n        value = 'String here'\n        obj = QCoreApplication.translate('context', value, None, QCoreApplication.UnicodeUTF8)\n        self.assertTrue(isinstance(obj, py3k.unicode))\n        self.assertEqual(obj, value)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/translations/trans_latin.ts",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS><TS version=\"1.1\" language=\"lt\">\n<defaultcodec></defaultcodec>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Hello World!</source>\n        <translation>Orbis, te saluto!</translation>\n    </message>\n</context>\n</TS>\n"
  },
  {
    "path": "tests/QtCore/translations/trans_russian.ts",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS><TS version=\"1.1\" language=\"ru\">\n<defaultcodec></defaultcodec>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Hello World!</source>\n        <translation>привет мир!</translation>\n    </message>\n</context>\n</TS>\n"
  },
  {
    "path": "tests/QtCore/unaryoperator_test.py",
    "content": "#!/usr/bin/python\n'''Tests the presence of unary operator __neg__ on the QPoint class'''\n\nimport unittest\n\nfrom PySide.QtCore import QPoint\n\nclass NegUnaryOperatorTest(unittest.TestCase):\n    '''Tests the presence of unary operator __neg__ on the QPoint class'''\n\n    def setUp(self):\n        #Acquire resources\n        self.x, self.y = 10, 20\n        self.neg_x, self.neg_y = -self.x, -self.y\n        self.qpoint = QPoint(self.x, self.y)\n\n    def tearDown(self):\n        #Release resources\n        del self.qpoint\n        del self.x\n        del self.y\n        del self.neg_x\n        del self.neg_y\n\n    def testNegUnaryOperator(self):\n        #Test __neg__ unary operator on QPoint class\n        __neg__method_exists = True\n        try:\n            neg_qpoint = -self.qpoint\n        except:\n            __neg__method_exists = False\n\n        self.assertTrue(__neg__method_exists)\n        self.assertEqual(self.qpoint, -neg_qpoint)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/unicode_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n'''Unit tests for QString conversion to/from Python Unicode'''\n\nimport unittest\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import QObject\n\nclass UnicodeConversion(unittest.TestCase):\n    '''Test case for QString to/from Python Unicode conversion'''\n\n    def setUp(self):\n        pass\n\n    def tearDown(self):\n        pass\n\n    def testSetRegularStringRetrieveUnicode(self):\n        #Set regular Python string retrieve unicode\n        obj = QObject()\n        obj.setObjectName('test')\n        self.assertEqual(obj.objectName(), py3k.unicode_('test'))\n\n    def testSetUnicodeRetrieveUnicode(self):\n        #Set Python unicode string and retrieve unicode\n        obj = QObject()\n        obj.setObjectName(py3k.unicode_('ümlaut'))\n        self.assertEqual(obj.objectName(), py3k.unicode_('ümlaut'))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtCore/versioninfo_test.py",
    "content": "import unittest\nimport PySide\n\nclass TestVersionInfo(unittest.TestCase):\n    def testIt(self):\n\n        v = PySide.__version_info__\n        self.assertEqual(type(v), tuple)\n        self.assertEqual(len(v), 5)\n        self.assertEqual(type(v[0]), int)\n        self.assertEqual(type(v[1]), int)\n        self.assertEqual(type(v[2]), int)\n        self.assertEqual(type(v[3]), str)\n        self.assertEqual(type(v[4]), int)\n\n        self.assertEqual(type(PySide.__version__), str)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/CMakeLists.txt",
    "content": "PYSIDE_TEST(bug_451.py)\nPYSIDE_TEST(bug_456.py)\nPYSIDE_TEST(bug_557.py)\nPYSIDE_TEST(bug_726.py)\nPYSIDE_TEST(bug_814.py)\nPYSIDE_TEST(bug_825.py)\nPYSIDE_TEST(bug_847.py)\nPYSIDE_TEST(bug_915.py)\nPYSIDE_TEST(bug_926.py)\nPYSIDE_TEST(bug_951.py)\nPYSIDE_TEST(bug_995.py)\nPYSIDE_TEST(bug_997.py)\nPYSIDE_TEST(bug_1029.py)\nPYSIDE_TEST(qdeclarativenetwork_test.py)\nPYSIDE_TEST(qdeclarativeview_test.py)\nPYSIDE_TEST(connect_python_qml.py)\nPYSIDE_TEST(registertype.py)\n"
  },
  {
    "path": "tests/QtDeclarative/bug_1029.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtDeclarative import *\n\nimport sys\nimport gc\n\ndef register_qml_types():\n    class TestClass(QDeclarativeItem):\n        def __init__(self, parent = None):\n            QDeclarativeItem.__init__(self, parent)\n\n    qmlRegisterType(TestClass, \"UserTypes\", 1, 0, \"TestClass\")\n\ndef main():\n    app = QApplication([])\n\n    # reg qml types here\n    register_qml_types()\n\n    # force gc to run\n    gc.collect()\n\n    view = QDeclarativeView()\n    url = QUrl(__file__.replace(\".py\", \".qml\"))\n    view.setSource(url)\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "tests/QtDeclarative/bug_1029.qml",
    "content": "import QtQuick 1.0\nimport UserTypes 1.0\n\nRectangle\n{\n    width: 200\n    height: 200\n\n    color: \"#ff0000\"\n\n    TestClass\n    {\n\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/bug_451.py",
    "content": "''' Test bug 451: http://bugs.openbossa.org/show_bug.cgi?id=451'''\n\nfrom PySide import QtCore, QtGui, QtDeclarative\nfrom helper import adjust_filename\nimport sys\nimport unittest\n\nclass PythonObject(QtCore.QObject):\n    def __init__(self):\n        QtCore.QObject.__init__(self, None)\n        self._called = \"\"\n        self._arg1 = None\n        self._arg2 = None\n\n    def setCalled(self, v):\n        self._called = v\n\n    def setArg1(self, v):\n        self._arg1 = v\n\n    def setArg2(self, v):\n        self._arg2 = v\n\n    def getCalled(self):\n        return self._called\n\n    def getArg1(self):\n        return self._arg1\n\n    def getArg2(self):\n        return self._arg2\n\n    called = QtCore.Property(str, getCalled, setCalled)\n    arg1 = QtCore.Property(int, getArg1, setArg1)\n    arg2 = QtCore.Property('QVariant', getArg2, setArg2)\n\nclass TestBug(unittest.TestCase):\n    def testQMLFunctionCall(self):\n        app = QtGui.QApplication(sys.argv)\n        view = QtDeclarative.QDeclarativeView()\n\n        obj = PythonObject()\n        context = view.rootContext()\n        context.setContextProperty(\"python\", obj)\n        view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_451.qml', __file__)))\n        root = view.rootObject()\n        root.simpleFunction()\n        self.assertEqual(obj.called, \"simpleFunction\")\n\n        root.oneArgFunction(42)\n        self.assertEqual(obj.called, \"oneArgFunction\")\n        self.assertEqual(obj.arg1, 42)\n\n        root.twoArgFunction(10, app)\n        self.assertEqual(obj.called, \"twoArgFunction\")\n        self.assertEqual(obj.arg1, 10)\n        self.assertEqual(obj.arg2, app)\n\n        rvalue = root.returnFunction()\n        self.assertEqual(obj.called, \"returnFunction\")\n        self.assertEqual(rvalue, 42)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/bug_451.qml",
    "content": "import Qt 4.7\n\nRectangle {\n    id: page\n\n    function simpleFunction() {\n        python.called = \"simpleFunction\"\n    }\n\n    function oneArgFunction(x) {\n        python.called = \"oneArgFunction\"\n        python.arg1 = x\n    }\n\n    function twoArgFunction(x, y) {\n        python.called = \"twoArgFunction\"\n        python.arg1 = x\n        python.arg2 = y\n    }\n\n    function returnFunction() {\n        python.called = \"returnFunction\"\n        return 42\n    }\n\n}\n"
  },
  {
    "path": "tests/QtDeclarative/bug_456.py",
    "content": "from PySide import QtCore, QtGui, QtDeclarative\nfrom helper import adjust_filename, TimedQApplication\nimport unittest\n\nclass RotateValue(QtCore.QObject):\n    def __init__(self):\n        super(RotateValue,self).__init__()\n\n    @QtCore.Slot(result=int)\n    def val(self):\n        return 100\n\n    def setRotation(self, v):\n        self._rotation = v\n\n    def getRotation(self):\n        return self._rotation\n\n    rotation = QtCore.Property(int, getRotation, setRotation)\n\nclass TestConnectionWithInvalidSignature(TimedQApplication):\n\n    def testSlotRetur(self):\n        view = QtDeclarative.QDeclarativeView()\n        rotatevalue = RotateValue()\n\n        timer = QtCore.QTimer()\n        timer.start(2000)\n\n        context = view.rootContext()\n        context.setContextProperty(\"rotatevalue\", rotatevalue)\n        view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_456.qml', __file__)))\n        root = view.rootObject()\n        button = root.findChild(QtCore.QObject, \"buttonMouseArea\")\n        view.show()\n        button.entered.emit()\n        self.assertEqual(rotatevalue.rotation, 100)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/bug_456.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: PySide Team (pyside@openbossa.org)\n**\n** This file is part of the examples of PySide: Python for Qt.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport Qt 4.7\n\nRectangle {\n    id: page\n\n    width: 500; height: 200\n    color: \"lightgray\"\n\n    Rectangle {\n        id: button\n        width: 150; height: 40\n        color: \"darkgray\"\n        anchors.horizontalCenter: page.horizontalCenter\n        y: 120\n        MouseArea {\n            id: buttonMouseArea\n            objectName: \"buttonMouseArea\"\n            anchors.fill: parent\n            onEntered: {\n                    rotatevalue.rotation = rotatevalue.val()\n            }\n        }\n        Text {\n            id: buttonText\n                text: \"Press me!\"\n            anchors.horizontalCenter: button.horizontalCenter\n            anchors.verticalCenter: button.verticalCenter\n            font.pointSize: 16;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/bug_557.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtDeclarative import *\n\nimport sys\n\napp = QApplication(sys.argv)\n\nengine = QDeclarativeEngine()\ncomponent = QDeclarativeComponent(engine)\n\n# This should segfault if the QDeclarativeComponent has not QDeclarativeEngine\ncomponent.loadUrl(QUrl.fromLocalFile('foo.qml'))\n\n"
  },
  {
    "path": "tests/QtDeclarative/bug_726.py",
    "content": "from PySide import QtCore, QtGui, QtDeclarative\nfrom helper import adjust_filename, TimedQApplication\nimport unittest\n\nclass ProxyObject(QtCore.QObject):\n    def __init__(self):\n        super(ProxyObject,self).__init__()\n        self._o = None\n        self._receivedName = \"\"\n\n    @QtCore.Slot(result='QObject*')\n    def getObject(self):\n        if self._o:\n            return self._o\n\n        self._o = QtCore.QObject()\n        self._o.setObjectName(\"PySideObject\")\n        return self._o\n\n    @QtCore.Slot(str)\n    def receivedObject(self, name):\n        self._receivedName = name\n \n\nclass TestConnectionWithInvalidSignature(TimedQApplication):\n\n    def testSlotRetur(self):\n        view = QtDeclarative.QDeclarativeView()\n        proxy = ProxyObject()\n\n        context = view.rootContext()\n        context.setContextProperty(\"proxy\", proxy)\n        view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_726.qml', __file__)))\n        root = view.rootObject()\n        button = root.findChild(QtCore.QObject, \"buttonMouseArea\")\n        view.show()\n        button.entered.emit()\n        self.assertEqual(proxy._receivedName, \"PySideObject\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/bug_726.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: PySide Team (pyside@openbossa.org)\n**\n** This file is part of the examples of PySide: Python for Qt.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport Qt 4.7\n\nRectangle {\n    id: page\n\n    width: 500; height: 200\n    color: \"lightgray\"\n\n    Rectangle {\n        id: button\n        width: 150; height: 40\n        color: \"darkgray\"\n        anchors.horizontalCenter: page.horizontalCenter\n        y: 120\n        MouseArea {\n            id: buttonMouseArea\n            objectName: \"buttonMouseArea\"\n            anchors.fill: parent\n            onEntered: {\n                    proxy.receivedObject(proxy.getObject().objectName)\n            }\n        }\n        Text {\n            id: buttonText\n                text: \"Press me!\"\n            anchors.horizontalCenter: button.horizontalCenter\n            anchors.verticalCenter: button.verticalCenter\n            font.pointSize: 16;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/bug_814.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# Test case for PySide bug 814\n# http://bugs.pyside.org/show_bug.cgi?id=814\n# 2011-04-08 Thomas Perl <m@thp.io>\n# Released under the same terms as PySide itself\n\nfrom PySide.QtCore import QUrl, QAbstractListModel, QModelIndex\nfrom PySide.QtDeclarative import QDeclarativeView\n\nfrom helper import adjust_filename, TimedQApplication\nimport unittest\n\nclass ListModel(QAbstractListModel):\n    def __init__(self):\n        QAbstractListModel.__init__(self)\n        self.setRoleNames({0: 'pysideModelData'})\n\n    def rowCount(self, parent=QModelIndex()):\n        return 3\n\n    def data(self, index, role):\n        if index.isValid() and role == 0:\n            return 'blubb'\n        return None\n\nclass TestBug814(TimedQApplication):\n    def testAbstractItemModelTransferToQML(self):\n        view = QDeclarativeView()\n        view.setSource(QUrl.fromLocalFile(adjust_filename('bug_814.qml', __file__)))\n        root = view.rootObject()\n        model = ListModel()\n        root.setProperty('model', model)\n        view.show()\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtDeclarative/bug_814.qml",
    "content": "\nimport Qt 4.7\n\nListView {\n    width: 300; height: 300\n    delegate: Text { text: pysideModelData }\n    model: 3\n}\n\n"
  },
  {
    "path": "tests/QtDeclarative/bug_825.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtDeclarative import *\n\nfrom helper import adjust_filename\nimport unittest\n\npaintCalled = False\n\nclass MetaA(type):\n    pass\n\nclass A(object):\n    __metaclass__ = MetaA\n\nMetaB = type(QDeclarativeItem)\nB = QDeclarativeItem\n\nclass MetaC(MetaA, MetaB):\n    pass\n\nclass C(A, B):\n    __metaclass__ = MetaC\n\nclass Bug825 (C):\n\n    def __init__(self, parent = None):\n        QDeclarativeItem.__init__(self, parent)\n        # need to disable this flag to draw inside a QDeclarativeItem\n        self.setFlag(QGraphicsItem.ItemHasNoContents, False)\n\n    def paint(self, painter, options, widget):\n        global paintCalled\n        pen = QPen(Qt.black, 2)\n        painter.setPen(pen);\n        painter.drawPie(self.boundingRect(), 0, 128);\n        paintCalled = True\n\nclass TestBug825 (unittest.TestCase):\n    def testIt(self):\n        global paintCalled\n        app = QApplication([])\n        qmlRegisterType(Bug825, 'bugs', 1, 0, 'Bug825')\n        self.assertRaises(TypeError, qmlRegisterType, A, 'bugs', 1, 0, 'A')\n\n        view = QDeclarativeView()\n        view.setSource(QUrl.fromLocalFile(adjust_filename('bug_825.qml', __file__)))\n        view.show()\n        QTimer.singleShot(250, view.close)\n        app.exec_()\n        self.assertTrue(paintCalled)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/bug_825.qml",
    "content": "import Qt 4.7\nimport bugs 1.0\n\nItem {\n    width: 300; height: 200\n\n    Bug825 {\n\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/bug_847.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# Testcase for PySide bug 847\n# Released under the same terms as PySide itself\n# 2011-05-04 Thomas Perl <m@thp.io>\n\nimport unittest\n\nfrom PySide.QtCore import Slot, Signal, QUrl\nfrom PySide.QtDeclarative import QDeclarativeView\n\nfrom helper import adjust_filename, UsesQApplication\n\nclass View(QDeclarativeView):\n    def __init__(self):\n        QDeclarativeView.__init__(self)\n        self.setSource(QUrl.fromLocalFile(adjust_filename('bug_847.qml', __file__)))\n        self.rootObject().setProperty('pythonObject', self)\n\n    @Slot(int, int)\n    def blubb(self, x, y):\n        self.called.emit(x, y)\n\n    called = Signal(int, int)\n\n\nclass TestQML(UsesQApplication):\n    def done(self, x, y):\n        self._sucess = True\n        self.app.quit()\n\n    def testPythonSlot(self):\n        self._sucess = False\n        view = View()\n        view.called.connect(self.done)\n        view.show()\n        self.app.exec_()\n        self.assertTrue(self._sucess)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtDeclarative/bug_847.qml",
    "content": "\nimport Qt 4.7\n\nRectangle {\n    width: 500\n    height: 500\n    color: 'red'\n\n    property variant pythonObject: undefined\n\n    Text {\n        anchors.centerIn: parent\n        text: 'click me'\n        color: 'white'\n    }\n\n    Timer {\n        interval: 100; running: true;\n        onTriggered: {\n            if (pythonObject != undefined) {\n                pythonObject.blubb(42, 84)\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "tests/QtDeclarative/bug_915.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\nimport unittest\n\nfrom PySide.QtDeclarative import QDeclarativeView, QDeclarativeItem\nfrom helper import TimedQApplication\n\nclass TestBug915(TimedQApplication):\n    def testReturnPolicy(self):\n        view = QDeclarativeView()\n\n        item1 = QDeclarativeItem()\n        item1.setObjectName(\"Item1\")\n        view.scene().addItem(item1)\n        self.assertEqual(item1.objectName(), \"Item1\") # check if the item still valid\n\n        item2 = QDeclarativeItem()\n        item2.setObjectName(\"Item2\")\n        item1.scene().addItem(item2)\n        item1 = None\n        self.assertEqual(item2.objectName(), \"Item2\") # check if the item still valid\n\n        view = None\n\nif __name__ == '__main__':\n    unittest.main()\n\n\n"
  },
  {
    "path": "tests/QtDeclarative/bug_926.py",
    "content": "import sys\nimport unittest\nfrom helper import adjust_filename\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtDeclarative import *\n\nclass MyClass (QObject):\n\n    def __init__(self):\n        super(MyClass,self).__init__()\n        self.__url = QUrl()\n\n    def getUrl(self):\n        return self.__url\n\n    def setUrl(self,value):\n        newUrl = QUrl(value)\n        if (newUrl != self.__url):\n            self.__url = newUrl\n            self.urlChanged.emit()\n\n    urlChanged = Signal()\n    urla = Property(QUrl, getUrl, setUrl, notify = urlChanged)\n\nclass TestBug926 (unittest.TestCase):\n    def testIt(self):\n        app = QApplication([])\n        qmlRegisterType(MyClass,'Example',1,0,'MyClass')\n        view = QDeclarativeView()\n        view.setSource(QUrl.fromLocalFile(adjust_filename('bug_926.qml', __file__)))\n        self.assertEqual(len(view.errors()), 0)\n        view.show()\n        QTimer.singleShot(0, app.quit)\n        app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/bug_926.qml",
    "content": "import Qt 4.7\nimport Example 1.0\n\nRectangle {\n    width: 100\n    height: 62\n\n    MyClass {\n        id: myClass\n        urla: \"http://www.pyside.org\"\n    }\n\n    Text {\n        id: name\n        text: myClass.urla\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/bug_951.py",
    "content": "from PySide.QtDeclarative import QDeclarativeItem, qmlRegisterType, QDeclarativeView\r\nfrom PySide.QtCore import QUrl\r\n\r\nfrom helper import adjust_filename, TimedQApplication\r\nimport unittest\r\n\r\nclass MyItem(QDeclarativeItem):\r\n    COMPONENT_COMPLETE_CALLED = False\r\n    def __init__(self,parent=None):\r\n        super(MyItem, self).__init__(parent)\r\n        self.setObjectName(\"myitem\")\r\n\r\n    def componentComplete(self):\r\n        MyItem.COMPONENT_COMPLETE_CALLED = True\r\n        super(MyItem, self).componentComplete()\r\n\r\nclass TestRegisterQMLType(TimedQApplication):\r\n    def setup(self):\r\n        TimedQApplication.setup(self, 100 * 3) # 3s\r\n\r\n    def testSignalEmission(self):\r\n        qmlRegisterType(MyItem, \"my.item\", 1, 0, \"MyItem\")\r\n\r\n        view = QDeclarativeView()\r\n        view.setSource(QUrl.fromLocalFile(adjust_filename('bug_951.qml', __file__)))\r\n\r\n        self.app.exec_()\r\n        self.assertTrue(MyItem.COMPONENT_COMPLETE_CALLED)\r\n\r\nif __name__ == '__main__':\r\n    unittest.main()\r\n"
  },
  {
    "path": "tests/QtDeclarative/bug_951.qml",
    "content": "import Qt 4.7\r\nimport my.item 1.0\r\nRectangle{\r\n    width:10\r\n    height:10\r\n    MyItem{ }\r\n}\r\n"
  },
  {
    "path": "tests/QtDeclarative/bug_995.py",
    "content": "from PySide.QtGui import *\nfrom PySide.QtDeclarative import *\nfrom helper import adjust_filename, UsesQApplication\n\napp = QApplication([])\nview = QDeclarativeView(adjust_filename('bug_995.qml', __file__))\nview.show()\nview.resize(200, 200)\nitem = view.itemAt(100, 100)\n\n# it CAN NOT crash here\nprint(item)\n\n"
  },
  {
    "path": "tests/QtDeclarative/bug_995.qml",
    "content": "import Qt 4.7\n\nRectangle {\n    width: 100\n    height: 100\n    color: \"red\"\n\n    Text {\n        text: \"Hello World\"\n        anchors.centerIn: parent\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/bug_997.py",
    "content": "from PySide import QtCore, QtDeclarative\n\nimport unittest\nfrom helper import adjust_filename, UsesQApplication\n\n\nclass TestBug(UsesQApplication):\n    def testQMLFunctionCall(self):\n        ownerData = QtDeclarative.QDeclarativePropertyMap()\n        ownerData.insert('name', 'John Smith')\n        ownerData.insert('phone', '555-5555')\n        ownerData.insert('newValue', '')\n\n        view = QtDeclarative.QDeclarativeView()\n        ctxt = view.rootContext()\n        ctxt.setContextProperty('owner', ownerData)\n        view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_997.qml', __file__)))\n        view.show()\n        QtCore.QTimer.singleShot(1000, self.app.quit)\n        self.app.exec_()\n        self.assertEqual(ownerData.value('newName'), ownerData.value('name'))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/bug_997.qml",
    "content": "import Qt 4.7\n\nText {\n    text: owner.name + \" \" + owner.phone \n    Component.onCompleted: { owner.newName = owner.name }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/connect_python_qml.py",
    "content": "'''Test case for bug #442'''\n\nfrom PySide import QtCore, QtGui, QtDeclarative\nfrom helper import adjust_filename, TimedQApplication\nimport unittest\n\nclass TestConnectionWithInvalidSignature(TimedQApplication):\n    def onButtonClicked(self):\n        self.buttonClicked = True\n        self.app.quit()\n\n    def onButtonFailClicked(self):\n        pass\n\n    def testFailConnection(self):\n        self.buttonClicked = False\n        self.buttonFailClicked = False\n        view = QtDeclarative.QDeclarativeView()\n        view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('connect_python_qml.qml', __file__)))\n        root = view.rootObject()\n        button = root.findChild(QtCore.QObject, \"buttonMouseArea\")\n        self.assertRaises(TypeError, QtCore.QObject.connect, [button,QtCore.SIGNAL('entered()'), self.onButtonFailClicked])\n        button.entered.connect(self.onButtonClicked)\n        button.entered.emit()\n        view.show()\n        self.app.exec_()\n        self.assert_(self.buttonClicked)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/connect_python_qml.qml",
    "content": "import Qt 4.7\n\nRectangle {\n    id: page\n    width: 500; height: 200\n    color: \"lightgray\"\n\n    Rectangle {\n        id: button\n        width: 150; height: 40\n        color: \"darkgray\"\n        anchors.horizontalCenter: page.horizontalCenter\n        y: 150\n        MouseArea {\n            id: buttonMouseArea\n            objectName: \"buttonMouseArea\"\n            anchors.fill: parent\n        }\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/hw.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the QtDeclarative module of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport Qt 4.7\n\nRectangle {\n     id: page\n     width: 500; height: 200\n     color: \"lightgray\"\n\n     Text {\n         id: helloText\n         text: \"Hello world!\"\n         y: 30\n         anchors.horizontalCenter: page.horizontalCenter\n         font.pointSize: 24; font.bold: true\n     }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/qdeclarativenetwork_test.py",
    "content": "'''Test cases for QDeclarativeNetwork'''\n\nimport unittest\n\nfrom PySide.QtCore import QUrl\nfrom PySide.QtDeclarative import QDeclarativeView, QDeclarativeNetworkAccessManagerFactory\nfrom PySide.QtNetwork import QNetworkAccessManager\n\nfrom helper import adjust_filename, TimedQApplication\n\nclass TestQDeclarativeNetworkFactory(TimedQApplication):\n\n    def setUp(self):\n        TimedQApplication.setUp(self, timeout=1000)\n\n    def testQDeclarativeNetworkFactory(self):\n        view = QDeclarativeView()\n\n        url = QUrl.fromLocalFile(adjust_filename('hw.qml', __file__))\n\n        view.setSource(url)\n        view.show()\n\n        self.assertEqual(view.status(), QDeclarativeView.Ready)\n\n        self.app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/qdeclarativeview_test.py",
    "content": "'''Test cases for QDeclarativeView'''\n\nimport unittest\n\nfrom PySide.QtCore import QUrl, QObject, Property, Slot\nfrom PySide.QtDeclarative import QDeclarativeView\n\nfrom helper import adjust_filename, TimedQApplication\n\nclass MyObject(QObject):\n    def __init__(self, text, parent=None):\n        QObject.__init__(self, parent)\n        self._text = text\n\n    def getText(self):\n        return self._text\n\n\n    @Slot(str)\n    def qmlText(self, text):\n        self._qmlText = text\n\n    title = Property(str, getText)\n\n\nclass TestQDeclarativeView(TimedQApplication):\n\n    def testQDeclarativeViewList(self):\n        view = QDeclarativeView()\n\n        dataList = [\"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\"]\n\n        ctxt = view.rootContext()\n        ctxt.setContextProperty(\"myModel\", dataList)\n\n        url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))\n        view.setSource(url)\n        view.show()\n\n        self.assertEqual(view.status(), QDeclarativeView.Ready)\n\n\n    def testModelExport(self):\n        view = QDeclarativeView()\n        dataList = [MyObject(\"Item 1\"), MyObject(\"Item 2\"), MyObject(\"Item 3\"), MyObject(\"Item 4\")]\n\n        ctxt = view.rootContext()\n        ctxt.setContextProperty(\"myModel\", dataList)\n\n        url = QUrl.fromLocalFile(adjust_filename('viewmodel.qml', __file__))\n        view.setSource(url)\n        view.show()\n\n        self.assertEqual(view.status(), QDeclarativeView.Ready)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/registertype.py",
    "content": "\nimport sys\nimport unittest\nimport helper\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtDeclarative import *\n\nclass PieSlice (QDeclarativeItem):\n\n    def __init__(self, parent = None):\n        QDeclarativeItem.__init__(self, parent)\n        # need to disable this flag to draw inside a QDeclarativeItem\n        self.setFlag(QGraphicsItem.ItemHasNoContents, False)\n        self._color = QColor()\n        self._fromAngle = 0\n        self._angleSpan = 0\n\n    def getColor(self):\n        return self._color\n\n    def setColor(self, value):\n        self._color = value\n\n    def getFromAngle(self):\n        return self._angle\n\n    def setFromAngle(self, value):\n        self._fromAngle = value\n\n    def getAngleSpan(self):\n        return self._angleSpan\n\n    def setAngleSpan(self, value):\n        self._angleSpan = value\n\n    color = Property(QColor, getColor, setColor)\n    fromAngle = Property(int, getFromAngle, setFromAngle)\n    angleSpan = Property(int, getAngleSpan, setAngleSpan)\n\n    def paint(self, painter, options, widget):\n        global paintCalled\n        pen = QPen(self._color, 2)\n        painter.setPen(pen);\n        painter.setRenderHints(QPainter.Antialiasing, True);\n        painter.drawPie(self.boundingRect(), self._fromAngle * 16, self._angleSpan * 16);\n        paintCalled = True\n\nclass PieChart (QDeclarativeItem):\n\n    def __init__(self, parent = None):\n        QDeclarativeItem.__init__(self, parent)\n        self._name = ''\n        self._slices = []\n\n    def getName(self):\n        return self._name\n\n    def setName(self, value):\n        self._name = value\n\n    name = Property(str, getName, setName)\n\n    def appendSlice(self, _slice):\n        global appendCalled\n        _slice.setParentItem(self)\n        self._slices.append(_slice)\n        appendCalled = True\n\n    slices = ListProperty(PieSlice, append=appendSlice)\n\nappendCalled = False\npaintCalled = False\n\nclass TestQmlSupport(unittest.TestCase):\n\n    def testIt(self):\n        app = QApplication([])\n\n        qmlRegisterType(PieChart, 'Charts', 1, 0, 'PieChart');\n        qmlRegisterType(PieSlice, \"Charts\", 1, 0, \"PieSlice\");\n\n        view = QDeclarativeView()\n        view.setSource(QUrl.fromLocalFile(helper.adjust_filename('registertype.qml', __file__)))\n        view.show()\n        QTimer.singleShot(250, view.close)\n        app.exec_()\n        self.assertTrue(appendCalled)\n        self.assertTrue(paintCalled)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtDeclarative/registertype.qml",
    "content": "import Qt 4.7\nimport Charts 1.0\n\nItem {\n    width: 300; height: 200\n\n    PieChart {\n        anchors.centerIn: parent\n        width: 100; height: 100\n\n        slices: [\n            PieSlice {\n                anchors.fill: parent\n                color: \"red\"\n                fromAngle: 0; angleSpan: 110\n            },\n            PieSlice {\n                anchors.fill: parent\n                color: \"black\"\n                fromAngle: 110; angleSpan: 50\n            },\n            PieSlice {\n                anchors.fill: parent\n                color: \"blue\"\n                fromAngle: 160; angleSpan: 100\n            }\n        ]\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/view.qml",
    "content": "/****************************************************************************\n**\n** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n** Contact: http://www.qt-project.org/legal\n**\n** This file is part of the QtDeclarative module of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:BSD$\n** You may use this file under the terms of the BSD license as follows:\n**\n** \"Redistribution and use in source and binary forms, with or without\n** modification, are permitted provided that the following conditions are\n** met:\n**   * Redistributions of source code must retain the above copyright\n**     notice, this list of conditions and the following disclaimer.\n**   * Redistributions in binary form must reproduce the above copyright\n**     notice, this list of conditions and the following disclaimer in\n**     the documentation and/or other materials provided with the\n**     distribution.\n**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names\n**     of its contributors may be used to endorse or promote products derived\n**     from this software without specific prior written permission.\n**\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n** \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\"\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\nimport Qt 4.7\n\nListView {\n    width: 100\n    height: 100\n    anchors.fill: parent\n    model: myModel\n    delegate: Component {\n        Rectangle {\n            height: 25\n            width: 100\n            Text { text: modelData }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/QtDeclarative/viewmodel.qml",
    "content": "import Qt 4.7\n\nListView {\n    width: 100; height: 100\n    anchors.fill: parent\n\n    model: myModel\n    delegate: Rectangle {\n        height: 25\n        width: 100\n        Text { text: title }\n    }\n}\n\n"
  },
  {
    "path": "tests/QtGui/CMakeLists.txt",
    "content": "#Keep this in alphabetical sort\n\nPYSIDE_TEST(action_clear.py)\nPYSIDE_TEST(api2_test.py)\nPYSIDE_TEST(add_action_test.py)\nPYSIDE_TEST(bug_172.py)\nPYSIDE_TEST(bug_243.py)\nPYSIDE_TEST(bug_300_test.py)\nPYSIDE_TEST(bug_307.py)\nPYSIDE_TEST(bug_324.py)\nPYSIDE_TEST(bug_338.py)\nPYSIDE_TEST(bug_363.py)\nPYSIDE_TEST(bug_367.py)\nPYSIDE_TEST(bug_389.py)\nPYSIDE_TEST(bug_400.py)\nPYSIDE_TEST(bug_416.py)\nPYSIDE_TEST(bug_429.py)\nPYSIDE_TEST(bug_430.py)\nPYSIDE_TEST(bug_433.py)\nPYSIDE_TEST(bug_467.py)\nPYSIDE_TEST(bug_480.py)\nPYSIDE_TEST(bug_493.py)\nPYSIDE_TEST(bug_500.py)\nPYSIDE_TEST(bug_512.py)\nPYSIDE_TEST(bug_525.py)\nPYSIDE_TEST(bug_546.py)\nPYSIDE_TEST(bug_547.py)\nPYSIDE_TEST(bug_549.py)\nPYSIDE_TEST(bug_569.py)\nPYSIDE_TEST(bug_575.py)\nPYSIDE_TEST(bug_576.py)\nPYSIDE_TEST(bug_585.py)\nPYSIDE_TEST(bug_589.py)\nPYSIDE_TEST(bug_606.py)\nPYSIDE_TEST(bug_617.py)\nPYSIDE_TEST(bug_635.py)\nPYSIDE_TEST(bug_640.py)\nPYSIDE_TEST(bug_652.py)\nPYSIDE_TEST(bug_653.py)\nPYSIDE_TEST(bug_660.py)\nPYSIDE_TEST(bug_662.py)\nPYSIDE_TEST(bug_667.py)\nPYSIDE_TEST(bug_668.py)\nPYSIDE_TEST(bug_674.py)\nPYSIDE_TEST(bug_675.py)\nPYSIDE_TEST(bug_688.py)\nPYSIDE_TEST(bug_696.py)\nPYSIDE_TEST(bug_693.py)\nPYSIDE_TEST(bug_714.py)\nPYSIDE_TEST(bug_716.py)\nPYSIDE_TEST(bug_722.py)\nPYSIDE_TEST(bug_728.py)\nPYSIDE_TEST(bug_736.py)\nPYSIDE_TEST(bug_740.py)\nPYSIDE_TEST(bug_743.py)\nPYSIDE_TEST(bug_750.py)\nPYSIDE_TEST(bug_778.py)\nPYSIDE_TEST(bug_785.py)\nPYSIDE_TEST(bug_793.py)\nPYSIDE_TEST(bug_811.py)\nPYSIDE_TEST(bug_834.py)\nPYSIDE_TEST(bug_836.py)\nPYSIDE_TEST(bug_844.py)\nPYSIDE_TEST(bug_854.py)\nPYSIDE_TEST(bug_860.py)\nPYSIDE_TEST(bug_862.py)\nPYSIDE_TEST(bug_871.py)\nPYSIDE_TEST(bug_879.py)\nPYSIDE_TEST(bug_882.py)\nPYSIDE_TEST(bug_919.py)\nPYSIDE_TEST(bug_921.py)\nPYSIDE_TEST(bug_941.py)\nPYSIDE_TEST(bug_964.py)\nPYSIDE_TEST(bug_967.py)\nPYSIDE_TEST(bug_972.py)\nPYSIDE_TEST(bug_979.py)\nPYSIDE_TEST(bug_988.py)\nPYSIDE_TEST(bug_991.py)\nPYSIDE_TEST(bug_998.py)\nPYSIDE_TEST(bug_1002.py)\nPYSIDE_TEST(bug_1006.py)\nPYSIDE_TEST(bug_1048.py)\nPYSIDE_TEST(bug_1077.py)\nPYSIDE_TEST(bug_PYSIDE-41.py)\nPYSIDE_TEST(customproxywidget_test.py)\nPYSIDE_TEST(deepcopy_test.py)\nPYSIDE_TEST(event_filter_test.py)\nPYSIDE_TEST(float_to_int_implicit_conversion_test.py)\nPYSIDE_TEST(grandparent_method_test.py)\nPYSIDE_TEST(hashabletype_test.py)\nPYSIDE_TEST(keep_reference_test.py)\nPYSIDE_TEST(missing_symbols_test.py)\nPYSIDE_TEST(paint_event_test.py)\nPYSIDE_TEST(parent_method_test.py)\nPYSIDE_TEST(pyside_reload_test.py)\nPYSIDE_TEST(python_properties_test.py)\nPYSIDE_TEST(qabstracttextdocumentlayout_test.py)\nPYSIDE_TEST(qapplication_exit_segfault_test.py)\nPYSIDE_TEST(qapplication_singleton_test.py)\nPYSIDE_TEST(qapp_test.py)\nPYSIDE_TEST(qbrush_test.py)\nPYSIDE_TEST(qcolor_test.py)\nPYSIDE_TEST(qcolor_reduce_test.py)\nPYSIDE_TEST(qcursor_test.py)\nPYSIDE_TEST(qaction_test.py)\nPYSIDE_TEST(qdatastream_gui_operators_test.py)\nPYSIDE_TEST(qdynamic_signal.py)\nPYSIDE_TEST(qfontdialog_test.py)\nPYSIDE_TEST(qfontmetrics_test.py)\nPYSIDE_TEST(qformlayout_test.py)\nPYSIDE_TEST(qgraphicsitem_isblocked_test.py)\nPYSIDE_TEST(qgraphicsitem_test.py)\nPYSIDE_TEST(qgraphicsproxywidget_test.py)\nPYSIDE_TEST(qgraphicsscene_test.py)\nPYSIDE_TEST(qicon_test.py)\nPYSIDE_TEST(qimage_test.py)\nPYSIDE_TEST(qinputcontext_test.py)\nPYSIDE_TEST(qinputdialog_get_test.py)\nPYSIDE_TEST(qitemselection_test.py)\nPYSIDE_TEST(qlayout_ref_test.py)\nPYSIDE_TEST(qlayout_test.py)\nPYSIDE_TEST(qlcdnumber_test.py)\nPYSIDE_TEST(qlistwidget_test.py)\nPYSIDE_TEST(qlistwidgetitem_test.py)\nPYSIDE_TEST(qmainwindow_test.py)\nPYSIDE_TEST(qmatrix_test.py)\nPYSIDE_TEST(qmenuadd_test.py)\nPYSIDE_TEST(qmenu_test.py)\nPYSIDE_TEST(qobject_mi_test.py)\nPYSIDE_TEST(qpainter_test.py)\nPYSIDE_TEST(qpen_test.py)\nPYSIDE_TEST(qpicture_test.py)\nPYSIDE_TEST(qpixmap_test.py)\nPYSIDE_TEST(qpixmap_constructor.py)\nPYSIDE_TEST(qpixmapcache_test.py)\nPYSIDE_TEST(qpolygonf_test.py)\nPYSIDE_TEST(qpushbutton_test.py)\nPYSIDE_TEST(qkeysequence_test.py)\nPYSIDE_TEST(qradialgradient_test.py)\nPYSIDE_TEST(qregion_test.py)\nPYSIDE_TEST(qshortcut_test.py)\nPYSIDE_TEST(qsplitter_test.py)\nPYSIDE_TEST(qstandarditemmodel_test.py)\nPYSIDE_TEST(qstring_qkeysequence_test.py)\nPYSIDE_TEST(qstyle_test.py)\nPYSIDE_TEST(qtableview_test.py)\nPYSIDE_TEST(qtabwidget_test.py)\nPYSIDE_TEST(qtextdocument_undoredo_test.py)\nPYSIDE_TEST(qtextedit_test.py)\nPYSIDE_TEST(qtextedit_signal_test.py)\nPYSIDE_TEST(qtextline_test.py)\nPYSIDE_TEST(qtoolbar_test.py)\nPYSIDE_TEST(qtoolbox_test.py)\nPYSIDE_TEST(qtransform_test.py)\nPYSIDE_TEST(qvariant_test.py)\nPYSIDE_TEST(qvalidator_test.py)\nPYSIDE_TEST(qwidget_setlayout_test.py)\nPYSIDE_TEST(qwidget_test.py)\nPYSIDE_TEST(reference_count_test.py)\nPYSIDE_TEST(repr_test.py)\nPYSIDE_TEST(returnquadruplesofnumbers_test.py)\nPYSIDE_TEST(standardpixmap_test.py)\nPYSIDE_TEST(timed_app_test.py)\nPYSIDE_TEST(virtual_protected_inheritance_test.py)\nPYSIDE_TEST(virtual_pure_override_test.py)\nPYSIDE_TEST(wrong_return_test.py)\n\nif (${QTVERSION} VERSION_GREATER 4.6.9)\n    PYSIDE_TEST(bug_1091.py)\nendif()\n\nif(Q_WS_X11)\n    PYSIDE_TEST(x11_symbols_test.py)\nendif()\n"
  },
  {
    "path": "tests/QtGui/action_clear.py",
    "content": "from PySide.QtGui import QMenu, QWidget, QMenuBar, QToolBar\nimport weakref\n\nimport unittest\nfrom helper import UsesQApplication\n\n\nclass TestQActionLifeCycle(UsesQApplication):\n    def actionDestroyed(self, act):\n        self._actionDestroyed = True\n\n    def testMenu(self):\n        self._actionDestroyed = False\n        w = QWidget()\n        menu = QMenu(w)\n        act = menu.addAction(\"MENU\")\n        _ref = weakref.ref(act, self.actionDestroyed)\n        act = None\n        self.assertFalse(self._actionDestroyed)\n        menu.clear()\n        self.assertTrue(self._actionDestroyed)\n\n    def testMenuBar(self):\n        self._actionDestroyed = False\n        w = QWidget()\n        menuBar = QMenuBar(w)\n        act = menuBar.addAction(\"MENU\")\n        _ref = weakref.ref(act, self.actionDestroyed)\n        act = None\n        self.assertFalse(self._actionDestroyed)\n        menuBar.clear()\n        self.assertTrue(self._actionDestroyed)\n\n    def testToolBar(self):\n        self._actionDestroyed = False\n        w = QWidget()\n        toolBar = QToolBar(w)\n        act = toolBar.addAction(\"MENU\")\n        _ref = weakref.ref(act, self.actionDestroyed)\n        act = None\n        self.assertFalse(self._actionDestroyed)\n        toolBar.clear()\n        self.assertTrue(self._actionDestroyed)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/add_action_test.py",
    "content": "\n'''Tests for QMenuBar.addAction(identifier, callback) calls'''\n\nimport unittest\n\nfrom PySide.QtCore import SLOT\nfrom PySide.QtGui import QMenuBar, QAction, QPushButton\n\nfrom helper import UsesQApplication\n\n\nclass AddActionTest(UsesQApplication):\n    '''QMenuBar addAction'''\n\n    def tearDown(self):\n        try:\n            del self.called\n        except AttributeError:\n            pass\n        super(AddActionTest, self).tearDown()\n\n    def _callback(self):\n        self.called = True\n\n    def testBasic(self):\n        '''QMenuBar.addAction(id, callback)'''\n        menubar = QMenuBar()\n        action = menubar.addAction(\"Accounts\", self._callback)\n        action.activate(QAction.Trigger)\n        self.assert_(self.called)\n\n    def testWithCppSlot(self):\n        '''QMenuBar.addAction(id, object, slot)'''\n        menubar = QMenuBar()\n        widget = QPushButton()\n        widget.setCheckable(True)\n        widget.setChecked(False)\n        action = menubar.addAction(\"Accounts\", widget, SLOT(\"toggle()\"))\n        action.activate(QAction.Trigger)\n        self.assert_(widget.isChecked())\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/api2_test.py",
    "content": "﻿'''Test cases for PySide API2 support'''\n\n\nimport unittest\nimport sys\n\nfrom PySide.QtGui import QWidget, QIntValidator, QSpinBox, QValidator, QApplication\n\nfrom helper import UsesQApplication\n\nclass WidgetValidatorQInt(QWidget, QIntValidator):\n    def __init__(self, parent=None):\n        QWidget.__init__(self, parent)\n        QIntValidator.__init__(self, parent)\n\nclass WidgetValidatorQSpinBox(QSpinBox):\n    def __init__(self, parent=None):\n        QSpinBox.__init__(self, parent)\n\n    def fixup(self, text):\n        print(\"It was called!\")\n\nclass DoubleQObjectInheritanceTest(UsesQApplication):\n\n    def testDouble(self):\n        '''Double inheritance from QObject classes'''\n\n        obj = WidgetValidatorQInt()\n\n        #QIntValidator methods\n        state, string, number = obj.validate('Test', 0)\n        self.assertEqual(state, QValidator.Invalid)\n        state, string, number = obj.validate('33', 0)\n        self.assertEqual(state, QValidator.Acceptable)\n\n    def testQSpinBox(self):\n        obj = WidgetValidatorQSpinBox()\n\n        obj.setRange(1, 10)\n        obj.setValue(0)\n        self.assertEqual(obj.value(), 1)\n\nclass QClipboardTest(UsesQApplication):\n\n    def testQClipboard(self):\n        #skip this test on MacOS because the clipboard is not available during the ssh session\n        #this cause problems in the buildbot\n        if sys.platform == 'darwin':\n            return\n        clip = QApplication.clipboard()\n        clip.setText(\"Testing this thing!\")\n\n        text, subtype = clip.text(\"\")\n        self.assertEqual(subtype, \"plain\")\n        self.assertEqual(text, \"Testing this thing!\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_1002.py",
    "content": "import unittest\nimport sys\nfrom PySide.QtGui import QWidget, QPushButton\n\nfrom helper import UsesQApplication\n\nclass TestBug1002 (UsesQApplication):\n    def testReturnWindow(self):\n        widget = QWidget()\n        button = QPushButton(widget)\n        self.assertEqual(sys.getrefcount(widget), 2)\n        window = button.window()\n        self.assertEqual(sys.getrefcount(widget), 3)\n        self.assertEqual(sys.getrefcount(window), 3)\n\n        del widget\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_1006.py",
    "content": "import unittest\nimport weakref\nimport sys\n\nfrom PySide.QtCore import Qt\nfrom PySide.QtGui import QDialog, QLabel, QGridLayout, QHBoxLayout, QWidget\n\nfrom helper import TimedQApplication\n\nclass LabelWindow(QDialog):\n    def __init__(self, parent):\n        super(LabelWindow, self).__init__(parent)\n\n        self.test_layout = QGridLayout()\n        label = QLabel(\"Label\")\n        self.test_layout.addWidget(label, 0, 0)\n        self.setLayout(self.test_layout)\n        self._destroyCalled = False\n\n\n    def replace(self, unit):\n        old_item = self.test_layout.itemAtPosition(0, 0)\n        old_label = old_item.widget()\n        ref = weakref.ref(old_item, self._destroyed)\n\n        self.test_layout.removeWidget(old_label)\n        unit.assertRaises(RuntimeError, old_item.widget)\n        del old_item\n\n        label = QLabel(\"Label New\")\n        old_label.deleteLater()\n        label.setAlignment(Qt.AlignCenter)\n        self.test_layout.addWidget(label, 0, 0)\n\n    def _destroyed(self, obj):\n        self._destroyCalled = True\n\nclass TestBug1006 (TimedQApplication):\n\n    def testLayoutItemLifeTime(self):\n        window = LabelWindow(None)\n        window.replace(self)\n        self.assertTrue(window._destroyCalled)\n        self.app.exec_()\n\n    def testParentLayout(self):\n        def createLayout():\n            label = QLabel()\n            layout = QHBoxLayout()\n            layout.addWidget(label)\n\n            widget = QWidget()\n            widget.setLayout(layout)\n            return (layout, widget)\n        (layout, widget) = createLayout()\n        item = layout.itemAt(0)\n        self.assertTrue(isinstance(item.widget(), QWidget))\n\n    def testRemoveOrphanWidget(self):\n        widget = QLabel()\n        layout = QHBoxLayout()\n        layout.addWidget(widget)\n        self.assertEqual(sys.getrefcount(widget), 3)\n\n        layout.removeWidget(widget)\n        widget.setObjectName(\"MyWidget\")\n        self.assertEqual(sys.getrefcount(widget), 2)\n\n    def testRemoveChildWidget(self):\n        parent = QLabel()\n        widget = QLabel(parent)\n        self.assertEqual(sys.getrefcount(widget), 3)\n\n        layout = QHBoxLayout()\n        layout.addWidget(widget)\n        self.assertEqual(sys.getrefcount(widget), 3)\n\n        layout.removeWidget(widget)\n        widget.setObjectName(\"MyWidget\")\n        self.assertEqual(sys.getrefcount(widget), 3)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_1048.py",
    "content": "from PySide import QtGui\n\na = QtGui.QApplication([])\n\nw = QtGui.QWidget()\nl = QtGui.QGridLayout(w)\n\nl.itemAtPosition(0, 0)\n"
  },
  {
    "path": "tests/QtGui/bug_1077.py",
    "content": "''' unit test for BUG #1077 '''\n\nfrom PySide import QtCore, QtGui\nimport time\n\nclass Highlighter(QtGui.QSyntaxHighlighter):\n    def __init__(self, parent, mode):\n        QtGui.QSyntaxHighlighter.__init__(self, parent)\n        self.tstamp = time.time()\n\nif __name__ == \"__main__\":\n    app = QtGui.QApplication([])\n    python = QtGui.QTextEdit()\n    python.setWindowTitle(\"python\")\n    hl = Highlighter(python.document(), \"python\")\n    python.show()\n    text = hl.document()\n"
  },
  {
    "path": "tests/QtGui/bug_1091.py",
    "content": "''' unit test for BUG #1091 '''\n\nimport unittest\nfrom PySide import QtGui\n\nclass QPainterTestCase(unittest.TestCase):\n    def testIt(self):\n        self.assertTrue(\"PixmapFragment\" in dir(QtGui.QPainter))\n        self.assertTrue(\"drawPixmapFragments\" in dir(QtGui.QPainter))\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_172.py",
    "content": "from PySide.QtGui import *\n\nif __name__ == '__main__':\n    app = QApplication([])\n\n    wdg = QWidget()\n\n    hbox = QHBoxLayout()\n\n    vbox = QVBoxLayout()\n    vbox.addLayout(hbox)\n\n    wdg.setLayout(vbox)\n"
  },
  {
    "path": "tests/QtGui/bug_243.py",
    "content": "\n''' Test bug 243: http://bugs.openbossa.org/show_bug.cgi?id=243'''\n\nimport unittest\nimport sys\n\nfrom PySide.QtGui import QApplication, QMainWindow, QLayout\n\nclass QAppPresence(unittest.TestCase):\n\n    def testBug(self):\n        app = QApplication(sys.argv)\n        window = QMainWindow()\n        l = window.layout()\n        self.assert_(isinstance(l, QLayout))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_300_test.py",
    "content": "from PySide.QtGui import QStringListModel\nfrom PySide.QtCore import QModelIndex\nimport unittest\n\nclass TestQAbstractItemModelSignals(unittest.TestCase):\n    def sigCallback(self, index, r, c):\n        self._called = True\n\n    def testSignals(self):\n        self._called = False\n        m = QStringListModel()\n        m.rowsAboutToBeInserted[QModelIndex,int,int].connect(self.sigCallback)\n        m.insertRows(0, 3)\n        self.assert_(self._called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_307.py",
    "content": "\nimport unittest\nimport colorsys\n\nfrom PySide.QtCore import SIGNAL\nfrom PySide.QtGui import QPushButton, QApplication\n\n\nclass Test (QApplication) :\n    def __init__(self, argv) :\n        super(Test, self).__init__(argv)\n        self._called = False\n        \n    def called(self):\n        self._called = True        \n\n\nclass QApplicationSignalsTest(unittest.TestCase):\n    def testQuit(self):\n        app = Test([])\n        button = QPushButton(\"BUTTON\")\n        app.connect(button, SIGNAL(\"clicked()\"), app.called)\n        button.click()\n        self.assert_(app._called)\n        \nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_324.py",
    "content": "''' Test bug 324: http://bugs.openbossa.org/show_bug.cgi?id=324'''\n\nimport unittest\nimport sys\nimport signal\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass QBug( QObject ):\n    def __init__(self, parent = None):\n        QObject.__init__(self, parent)\n\n    def check(self):\n        self.done.emit(\"abc\")\n\n    done = Signal(str)\n\nclass Bug324(unittest.TestCase):\n\n    def on_done(self, val):\n        self.value = val\n\n    def testBug(self):\n        app = QApplication([])\n        bug = QBug()\n        self.value = ''\n        bug.done.connect(self.on_done)\n        bug.check()\n        self.assertEqual(self.value, 'abc')\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_338.py",
    "content": "''' Test bug 338: http://bugs.openbossa.org/show_bug.cgi?id=338'''\n\nimport sys\nimport unittest\nfrom PySide import QtCore,QtGui\n\nclass DiagramItem(QtGui.QGraphicsPolygonItem):\n    def __init__(self, parent=None, scene=None):\n        super(DiagramItem, self).__init__(parent, scene)\n\n    def itemChange(self, change, value):\n        return value\n\n\nclass BugTest(unittest.TestCase):\n    def test(self):\n        app = QtGui.QApplication(sys.argv)\n        scene = QtGui.QGraphicsScene()\n        item = DiagramItem()\n        item2 = DiagramItem()\n        #this cause segfault \n        scene.addItem(item)\n        scene.addItem(item2)\n  \n"
  },
  {
    "path": "tests/QtGui/bug_363.py",
    "content": "''' Test bug 363: http://bugs.openbossa.org/show_bug.cgi?id=363'''\n\nimport sys\nimport unittest\nfrom helper import UsesQApplication\nfrom PySide import QtCore,QtGui\n\n# Check for desktop object lifetime\nclass BugTest(UsesQApplication):\n    def mySlot(self):\n        pass\n\n    # test if it is possible to connect with a desktop object after storing that on an auxiliar variable\n    def testCase1(self):\n        desktop = QtGui.QApplication.desktop()\n        desktop.resized[int].connect(self.mySlot)\n        self.assert_(True)\n\n    # test if it is possible to connect with a desktop object without storing that on an auxiliar variable\n    def testCase2(self):\n        QtGui.QApplication.desktop().resized[int].connect(self.mySlot)\n        self.assert_(True)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_367.py",
    "content": "''' Test bug 367: http://bugs.openbossa.org/show_bug.cgi?id=367'''\n\nimport sys\nimport unittest\nfrom helper import UsesQApplication\nfrom PySide import QtCore,QtGui\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        model = QtGui.QStandardItemModel()\n        parentItem = model.invisibleRootItem()\n        for i in range(10):\n            item = QtGui.QStandardItem()\n            rcount =  sys.getrefcount(item)\n            parentItem.appendRow(item)\n            self.assertEqual(rcount+1, sys.getrefcount(item))\n            parentItem = item\n\n        self.assert_(True)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_389.py",
    "content": "''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389'''\n\nimport sys\nimport unittest\nfrom helper import UsesQApplication\nfrom PySide import QtCore,QtGui\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        s = QtGui.QWidget().style()\n        i = s.standardIcon(QtGui.QStyle.SP_TitleBarMinButton)\n        self.assertEqual(type(i), QtGui.QIcon)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_400.py",
    "content": "''' Test bug 400: http://bugs.openbossa.org/show_bug.cgi?id=400'''\n\nimport unittest\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QTreeWidgetItemIterator, QTreeWidgetItem, QTreeWidget\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        treeWidget = QTreeWidget()\n        treeWidget.setColumnCount(1)\n        items = []\n        for i in range(10):\n            items.append(QTreeWidgetItem(None, [\"item: %i\" % i]))\n\n        treeWidget.insertTopLevelItems(0, items);\n        _iter = QTreeWidgetItemIterator(treeWidget)\n        index = 0\n        while(_iter.value()):\n            item = _iter.value()\n            self.assert_(item is items[index])\n            index += 1\n            _iter += 1\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_416.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom helper import TimedQApplication\nfrom PySide.QtCore import QSignalTransition, QState, Qt, QStateMachine\nfrom PySide.QtGui import QCheckBox\n\nclass CheckedTransition(QSignalTransition):\n    def __init__(self, check):\n        QSignalTransition.__init__(self, check.stateChanged[int])\n        self.eventTested = False\n\n    def eventTest(self, event):\n        self.eventTested = True\n        if not QSignalTransition.eventTest(self, event):\n            return False\n        return event.arguments()[0] == Qt.Checked\n\nclass TestBug(TimedQApplication):\n    def testCase(self):\n        check = QCheckBox()\n        check.setTristate(True)\n\n        s1 = QState()\n        s2 = QState()\n\n        t1 = CheckedTransition(check)\n        t1.setTargetState(s2)\n        s1.addTransition(t1)\n\n        machine = QStateMachine()\n        machine.addState(s1)\n        machine.addState(s2)\n        machine.setInitialState(s1)\n        machine.start()\n\n        check.stateChanged[int].emit(1)\n        check.show()\n        self.app.exec_()\n        self.assert_(t1.eventTested)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_429.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\nimport sys\n\napp = QApplication(sys.argv)\nscene = QGraphicsScene()\nlabel = QLabel(\"hello world\")\nlabel.show()\nQTimer.singleShot(0, label.close)\nexit(app.exec_())\n"
  },
  {
    "path": "tests/QtGui/bug_430.py",
    "content": "import sys\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass ListModel(QAbstractListModel):\n    def rowCount(self, parent = QModelIndex()):\n        return 0\n\napp = QApplication([])\nmodel = ListModel()\nv = QListView()\nv.setModel(model)\nQTimer.singleShot(0, v.close)\napp.exec_()\n"
  },
  {
    "path": "tests/QtGui/bug_433.py",
    "content": "from PySide import QtCore, QtGui\nimport sys\n\nclass Test(QtGui.QGraphicsView):\n    def __init__(self, parent=None):\n        super(Test, self).__init__(parent)\n        self.s = QtGui.QGraphicsScene()\n        self.setScene(self.s)\n\na = QtGui.QApplication(sys.argv)\nt = Test()\nt.show()\nQtCore.QTimer.singleShot(0, t.close)\nsys.exit(a.exec_())\n"
  },
  {
    "path": "tests/QtGui/bug_467.py",
    "content": "''' Test bug 367: http://bugs.openbossa.org/show_bug.cgi?id=467'''\n\nimport unittest\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QMainWindow, QApplication\n\nclass MyWidget(QMainWindow):\n    def __init__(self, parent = None):\n        QMainWindow.__init__(self, parent)\n\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        w = MyWidget()\n        widgets = QApplication.allWidgets()\n        self.assert_(w in widgets)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_480.py",
    "content": "import unittest\n\nfrom PySide import QtGui\n\nclass BuggyWidget(QtGui.QWidget):\n    def setup(self):\n        self.verticalLayout = QtGui.QVBoxLayout(self)\n        self.gridLayout = QtGui.QGridLayout()\n        self.lbl = QtGui.QLabel(self)\n        self.gridLayout.addWidget(self.lbl, 0, 1, 1, 1)\n\n        # this cause a segfault during the ownership transfer\n        self.verticalLayout.addLayout(self.gridLayout)\n\nclass LayoutTransferOwnerShip(unittest.TestCase):\n    def testBug(self):\n        app = QtGui.QApplication([])\n        w = BuggyWidget()\n        w.setup()\n        w.show()\n        self.assert_(True)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_493.py",
    "content": "from PySide.QtCore import Qt, QEvent\nfrom PySide.QtGui import QApplication, QKeyEvent, QKeySequence\nimport unittest\n\n\nclass TestBug569(unittest.TestCase):\n\n    def testIt(self):\n        # We need a qapp otherwise Qt will crash when trying to detect the\n        # current platform\n        app = QApplication([])\n        ev1 = QKeyEvent(QEvent.KeyRelease, Qt.Key_Delete, Qt.NoModifier)\n        ev2 = QKeyEvent(QEvent.KeyRelease, Qt.Key_Copy, Qt.NoModifier)\n        ks = QKeySequence.Delete\n\n        self.assertEqual(ev1, ks)\n        self.assertEqual(ks, ev1)\n        self.assertNotEqual(ev2, ks)\n        self.assertNotEqual(ks, ev2)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_500.py",
    "content": "#!/usr/bin/python\n\nimport unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom helper import UsesQApplication\n\nclass NeverDiesTest(UsesQApplication):\n\n    def testIt(self):\n        QPrintDialog()\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_512.py",
    "content": "''' Test bug 512: http://bugs.openbossa.org/show_bug.cgi?id=512'''\n\nimport unittest\nfrom helper import UsesQApplication\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        w = QWidget(None)\n        lbl = QLabel(\"Hello\", w);\n        g = QGridLayout()\n        g.addWidget(lbl, 0, 0)\n        w.setLayout(g)\n        w.show()\n\n        t = g.getItemPosition(0)\n        self.assertEqual(type(t), tuple)\n        self.assertEqual(t, (0,0,1,1))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_525.py",
    "content": "import unittest\nfrom PySide.QtGui import QApplication\nfrom PySide.QtGui import QMenu\n\nclass M2(QMenu):\n    def __init__(self,parent=None):\n        super(M2,self).__init__(parent)\n        self.setTitle(self.tr(\"M2\"))\n\nclass TestMenuDerivedClass(unittest.TestCase):\n    def aboutToShowHandler(self):\n        pass\n\n    def testConnectSignal(self):\n        app = QApplication([])\n        m2 = M2()\n        # Test if the aboutToShow signal was translated to correct type\n        m2.aboutToShow.connect(self.aboutToShowHandler)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_546.py",
    "content": "import unittest\nfrom PySide.QtGui import *\n\nclass TestBug546(unittest.TestCase):\n\n    \"\"\"Test to check a crash at exit\"\"\"\n    def testIt(self):\n        app = QApplication([])\n        textEdit = QPlainTextEdit()\n        completer = QCompleter((\"foo\", \"bar\"), textEdit)\n        completer.setWidget(textEdit)\n\nif __name__=='__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_547.py",
    "content": "\"\"\" Unittest for bug #547 \"\"\"\n\"\"\" http://bugs.openbossa.org/show_bug.cgi?id=547 \"\"\"\n\nfrom PySide import QtGui\nimport sys\nimport unittest\n\nclass MyMainWindow(unittest.TestCase):\n    app = QtGui.QApplication(sys.argv)\n    def testCase1(self):\n        self._tree = QtGui.QTreeWidget()\n        self._tree.setColumnCount(2)\n        self._i1 = None\n        self._i11 = None\n\n        self._updateTree()\n        self.assertEqual(sys.getrefcount(self._i1), 3)\n        self.assertEqual(sys.getrefcount(self._i11), 3)\n\n        self._i11.parent().setExpanded(True)\n        self._i11.setExpanded(True)\n\n        self._updateTree()\n        self.assertEqual(sys.getrefcount(self._i1), 3)\n        self.assertEqual(sys.getrefcount(self._i11), 3)\n\n    def testCase2(self):\n        self._tree = QtGui.QTreeWidget()\n        self._tree.setColumnCount(2)\n        self._i1 = None\n        self._i11 = None\n\n        self._updateTree()\n        self.assertEqual(sys.getrefcount(self._i1), 3)\n        self.assertEqual(sys.getrefcount(self._i11), 3)\n\n        self._i11.parent().setExpanded(True)\n        self._i11.setExpanded(True)\n\n        self.assertEqual(sys.getrefcount(self._i1), 3)\n        self.assertEqual(sys.getrefcount(self._i11), 3)\n\n    def _updateTree(self):\n        self._tree.clear()\n        if self._i1 and self._i11:\n            self.assertEqual(sys.getrefcount(self._i1), 2)\n            self.assertEqual(sys.getrefcount(self._i11), 2)\n\n        self._i1 = QtGui.QTreeWidgetItem(self._tree, ['1', ])\n        self.assertEqual(sys.getrefcount(self._i1), 3)\n        self._i11 = QtGui.QTreeWidgetItem(self._i1, ['11', ])\n        self.assertEqual(sys.getrefcount(self._i11), 3)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_549.py",
    "content": "import unittest\n\nfrom PySide.QtGui import *\n\nclass TestBug549(unittest.TestCase):\n    def testBug(self):\n        app = QApplication([])\n        w = QGraphicsWidget()\n        w.setContentsMargins(1, 2, 3, 4)\n        self.assertEquals(w.getContentsMargins(), (1, 2, 3, 4))\n        w.setWindowFrameMargins(5, 6, 7, 8)\n        self.assertEquals(w.getWindowFrameMargins(), (5, 6, 7, 8))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_569.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\nimport unittest\n\n\nclass TestBug569(unittest.TestCase):\n\n    def testIt(self):\n        types = (QTableWidgetItem, QListWidgetItem, QTreeWidgetItem)\n        for t in types:\n            a = t()\n            a.__lt__ = lambda other : True\n            b = t()\n            b.__lt__ = lambda other : False\n            self.assertTrue(a < b)\n            self.assertFalse(b < a)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_575.py",
    "content": "\"\"\" Unittest for bug #575 \"\"\"\n\"\"\" http://bugs.openbossa.org/show_bug.cgi?id=575 \"\"\"\n\nfrom PySide.QtGui import QApplication, QPlainTextEdit, QTextEdit\nimport sys\nimport unittest\n\nclass Bug575(unittest.TestCase):\n    def testPropertyValues(self):\n        app = QApplication(sys.argv)\n        textEdit = QPlainTextEdit()\n        textEdit.insertPlainText(\"PySide INdT\")\n        selection = QTextEdit.ExtraSelection()\n        selection.cursor = textEdit.textCursor()\n        selection.cursor.setPosition(2)\n        self.assertEqual(selection.cursor.position(), 2)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_576.py",
    "content": "\"\"\" Unittest for bug #576 \"\"\"\n\"\"\" http://bugs.openbossa.org/show_bug.cgi?id=576 \"\"\"\n\nfrom PySide import QtGui, QtCore\nimport sys\nimport unittest\n\nclass Bug576(unittest.TestCase):\n    def onButtonDestroyed(self, button):\n        self._destroyed = True\n        self.assert_(isinstance(button, QtGui.QPushButton))\n\n    def testWidgetParent(self):\n        self._destroyed = False\n        app = QtGui.QApplication(sys.argv)\n        w = QtGui.QWidget()\n\n        b = QtGui.QPushButton(\"test\")\n        b.destroyed[QtCore.QObject].connect(self.onButtonDestroyed)\n        self.assertEqual(sys.getrefcount(b), 2)\n        b.setParent(w)\n        self.assertEqual(sys.getrefcount(b), 3)\n        b.parent()\n        self.assertEqual(sys.getrefcount(b), 3)\n        b.setParent(None)\n        self.assertEqual(sys.getrefcount(b), 2)\n        del b\n        self.assert_(self._destroyed)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_585.py",
    "content": "'''Test bug 585: http://bugs.openbossa.org/show_bug.cgi?id=585'''\n\nfrom PySide import QtCore ,QtGui\nimport sys\nimport unittest\n\n\nclass Bug585(unittest.TestCase):\n    def testCase(self):\n        app = QtGui.QApplication([])\n        self._tree = QtGui.QTreeWidget()\n        self._tree.setColumnCount(2)\n        i1 = QtGui.QTreeWidgetItem(self._tree, ['1', ])\n        i2 = QtGui.QTreeWidgetItem(self._tree, ['2', ])\n        refCount = sys.getrefcount(i1)\n\n        # this function return None\n        # because the topLevelItem does not has a parent item\n        # but still have a TreeWidget as a parent\n        self._tree.topLevelItem(0).parent()\n\n        self.assertEqual(refCount, sys.getrefcount(i1))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_589.py",
    "content": "# trimmed down diagramscene.py to demonstrate crash in sizeHint()\n\nimport sys\nfrom PySide import QtCore, QtGui\nimport unittest\n\nclass CustomWidget(QtGui.QGraphicsProxyWidget):\n   def itemChange(self, eventType, value):\n      QtGui.QGraphicsProxyWidget.itemChange(self, eventType, value)\n\nclass Bug589(unittest.TestCase):\n   def testCase(self):\n      widget = QtGui.QGraphicsProxyWidget()\n      custom = CustomWidget()\n      custom.setParentItem(widget)\n\nif __name__ == \"__main__\":\n   app = QtGui.QApplication(sys.argv)\n   unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_606.py",
    "content": "import unittest\n\nimport PySide\nfrom PySide.QtGui import QVector2D, QVector3D, QVector4D\nfrom PySide.QtGui import QColor\n\nclass testCases(unittest.TestCase):\n    def testQVector2DToTuple(self):\n        vec = QVector2D(1, 2)\n        self.assertEqual((1, 2), vec.toTuple())\n\n    def testQVector3DToTuple(self):\n        vec = QVector3D(1, 2, 3)\n        self.assertEqual((1, 2, 3), vec.toTuple())\n\n    def testQVector4DToTuple(self):\n        vec = QVector4D(1, 2, 3, 4)\n        self.assertEqual((1, 2, 3, 4), vec.toTuple())\n\n    def testQColorToTuple(self):\n        c = QColor(0, 0, 255)\n        c.setRgb(1, 2, 3)\n        self.assertEqual((1, 2, 3, 255), c.toTuple())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_617.py",
    "content": "from PySide.QtCore import QEvent\nfrom PySide.QtGui import QColor\nimport unittest\n\nclass MyEvent(QEvent):\n    def __init__(self):\n        QEvent.__init__(self, QEvent.Type(999))\n\n\nclass Bug617(unittest.TestCase):\n    def testRepr(self):\n        c = QColor.fromRgb(1, 2, 3, 4)\n        s = c.spec()\n        self.assertEqual(repr(s), repr(QColor.Rgb))\n\n    def testOutOfBounds(self):\n        e = MyEvent()\n        self.assertEqual(repr(e.type()), 'PySide.QtCore.QEvent.Type(999)')\n\nif __name__ == \"__main__\":\n   unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_632.py",
    "content": "import sys\nfrom PySide.QtGui import QLineEdit, QApplication\nimport unittest\n\n\nclass Bug589(unittest.TestCase):\n    def testWrongSignature(self):\n        text = QLineEdit(\"PySide bug 632\")\n        a = b = c = d = 0\n        self.assertRaises(TypeError, text.getTextMargins, (a, b, c, d))\n\n    def testTupleReturn(self):\n        text = QLineEdit(\"PySide bug 632\")\n        text.setTextMargins(10, 20, 30, 40)\n        (a, b, c, d) = text.getTextMargins()\n        self.assert_((a, b, c, d), (10, 20, 30, 40))\n\nif __name__ == \"__main__\":\n   app = QApplication(sys.argv)\n   unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_635.py",
    "content": "''' Test bug 635: http://bugs.openbossa.org/show_bug.cgi?id=635'''\n\nimport unittest\nfrom PySide.QtGui import QApplication, QToolBar, QIcon\nimport sys\n\nclass testQToolBar(unittest.TestCase):\n    def callback(self):\n        self._called = True\n\n    def testAddAction(self):\n        bar = QToolBar()\n        self._called = False\n        a = bar.addAction(\"act1\", self.callback)\n        a.trigger()\n        self.assert_(self._called)\n\n    def testAddActionWithIcon(self):\n        bar = QToolBar()\n        self._called = False\n        icon = QIcon()\n        a = bar.addAction(icon, \"act1\", self.callback)\n        a.trigger()\n        self.assert_(self._called)\n\nif __name__ == '__main__':\n    app = QApplication(sys.argv)\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_640.py",
    "content": "import sys\nfrom PySide.QtGui import *\nimport unittest\n\nclass Bug640(unittest.TestCase):\n    def testIt(self):\n        option = QStyleOptionGraphicsItem()\n        a = option.state # crash!?\n\nif __name__ == \"__main__\":\n   unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_652.py",
    "content": "import unittest\nfrom PySide.QtGui import *\n\nclass MyData(QTextBlockUserData):\n    def __init__(self, data):\n        QTextBlockUserData.__init__(self)\n        self.data = data\n\n    def getMyNiceData(self):\n        return self.data\n\nclass TestBug652(unittest.TestCase):\n    \"\"\"Segfault when using QTextBlock::setUserData due to missing ownership transfer\"\"\"\n    def testIt(self):\n        td = QTextDocument()\n        tc = QTextCursor(td)\n        tc.insertText(\"Hello world\")\n        heyHo = \"hey ho!\"\n        tc.block().setUserData(MyData(heyHo))\n        self.assertEqual(type(tc.block().userData()), MyData)\n        self.assertEqual(tc.block().userData().getMyNiceData(), heyHo)\n\n        del tc\n        tc = QTextCursor(td)\n        blk = tc.block()\n        self.assertEqual(type(blk.userData()), MyData)\n        self.assertEqual(blk.userData().getMyNiceData(), heyHo)\n\nif __name__ == \"__main__\":\n    unittest.main()"
  },
  {
    "path": "tests/QtGui/bug_653.py",
    "content": "import unittest\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass TestBug653(unittest.TestCase):\n    \"\"\"Crash after calling QWizardPage.wizard()\"\"\"\n    def testIt(self):\n        app = QApplication([])\n\n        wizard = QWizard()\n        page = QWizardPage()\n        wizard.addPage(page)\n        page.wizard() # crash here if the bug still exists due to a circular dependency\n        wizard.show()\n\nif __name__ == \"__main__\":\n    unittest.main()"
  },
  {
    "path": "tests/QtGui/bug_660.py",
    "content": "import unittest\nimport py3kcompat as py3k\nfrom PySide.QtGui import QStandardItemModel, QStandardItem\n\nclass MyItemModel(QStandardItemModel):\n    def __init__(self,parent=None):\n        super(MyItemModel,self).__init__(parent)\n        self.appendRow([QStandardItem('Item 1'),])\n\n    def mimeTypes(self):\n        mtypes = super(MyItemModel,self).mimeTypes()\n        mtypes.append(py3k.unicode_('application/my-form'))\n        return mtypes\n\n    def mimeData(self,indexes):\n        self.__mimedata = super(MyItemModel,self).mimeData(indexes)\n        self.__mimedata.setData(py3k.unicode_('application/my-form'), 'hi')\n        return self.__mimedata\n\nclass TestBug660(unittest.TestCase):\n    '''QMimeData type deleted prematurely when overriding mime-type in QStandardItemModel drag and drop'''\n    def testIt(self):\n        model = MyItemModel()\n        model.mimeData([model.index(0, 0)]) # if it doesn't raise an exception it's all right!\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_662.py",
    "content": "''' Test bug 662: http://bugs.openbossa.org/show_bug.cgi?id=662'''\n\nimport unittest\nfrom PySide.QtGui import QTextEdit, QApplication, QTextCharFormat\nimport sys\n\nclass testQTextBlock(unittest.TestCase):\n    def tesIterator(self):\n        edit = QTextEdit()\n        cursor = edit.textCursor()\n        fmt = QTextCharFormat()\n        frags = []\n        for i in range(10):\n            fmt.setFontPointSize(i+10)\n            frags.append(\"block%d\"%i)\n            cursor.insertText(frags[i], fmt)\n\n        doc = edit.document()\n        block = doc.begin()\n\n        index = 0\n        for i in block:\n            self.assertEqual(i.fragment().text(), frags[index])\n            index += 1\n\nif __name__ == '__main__':\n    app = QApplication(sys.argv)\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_667.py",
    "content": "from   PySide.QtCore import *\nfrom   PySide.QtGui  import *\n\nclass Ball(QGraphicsEllipseItem):\n    def __init__(self, d, parent=None):\n        super(Ball, self).__init__(0, 0, d, d, parent)\n        self.vel = QPointF(0,0)   #commenting this out prevents the crash\n\nclass Foo(QGraphicsView):\n    def __init__(self):\n        super(Foo, self).__init__(None)\n        self.scene = QGraphicsScene(self.rect())\n        self.setScene(self.scene)\n        self.scene.addItem(Ball(10))\n\n\nif __name__ == \"__main__\":\n    import sys\n    app = QApplication(sys.argv)\n    w = Foo()\n    w.show()\n    w.raise_()\n    QTimer.singleShot(0, w.close)\n    sys.exit(app.exec_())\n"
  },
  {
    "path": "tests/QtGui/bug_668.py",
    "content": "# coding: utf-8\nfrom PySide.QtCore import *\nfrom PySide.QtGui  import *\n\nimport sys\n\nclass A(QMainWindow):\n    def __init__(self, parent=None):\n        super(A, self).__init__(parent)\n        a = QFileSystemModel(self)\n        a.setRootPath(QDir.homePath())\n\n        v = QTreeView(self)\n        v.setModel(a)\n        self.setCentralWidget(v)\n\napp = QApplication([])\nm = A()\nm.show()\nQTimer.singleShot(0, m.close)\napp.exec_()\n"
  },
  {
    "path": "tests/QtGui/bug_674.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\nimport unittest\nimport sys\n\nclass TestBug679(unittest.TestCase):\n    '''QGraphicsScene::clear() is missing'''\n    def testIt(self):\n        app = QApplication([])\n\n        scene = QGraphicsScene()\n        hello = scene.addText(\"Hello\")\n        scene.addText(\"World\")\n\n        self.assertEqual(sys.getrefcount(hello), 3)\n        scene.clear()\n        self.assertEqual(sys.getrefcount(hello), 2)\n        self.assertEqual(len(scene.items()), 0)\n        self.assertRaises(RuntimeError, hello.isVisible) # the C++ object was deleted\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_675.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\n\napp = QApplication([])\n\nscene = QGraphicsScene()\n\n# don't segfault due to lack of keepReferenceCall\ntextEdit = scene.addWidget(QTextEdit())\n\nlayout = QGraphicsLinearLayout()\nlayout.addItem(textEdit)\n\nview = QGraphicsView(scene)\nview.show()\n"
  },
  {
    "path": "tests/QtGui/bug_688.py",
    "content": "''' Test bug 688: http://bugs.openbossa.org/show_bug.cgi?id=688'''\n\nimport unittest\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QTextFrame, QTextEdit, QTextCursor, QTextCharFormat, QFont, QTextFrameFormat\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        editor = QTextEdit()\n        cursor = QTextCursor(editor.textCursor())\n        cursor.movePosition(QTextCursor.Start)\n   \n        mainFrame = cursor.currentFrame()\n        \n        plainCharFormat = QTextCharFormat()\n        boldCharFormat = QTextCharFormat()\n        boldCharFormat.setFontWeight(QFont.Bold);\n        cursor.insertText(\"\"\"\n                          Text documents are represented by the \n                          QTextDocument class, rather than by QString objects. \n                          Each QTextDocument object contains information about \n                          the document's internal representation, its structure, \n                          and keeps track of modifications to provide undo/redo \n                          facilities. This approach allows features such as the \n                          layout management to be delegated to specialized \n                          classes, but also provides a focus for the framework.\"\"\",\n                          plainCharFormat)\n\n        frameFormat = QTextFrameFormat()\n        frameFormat.setMargin(32)\n        frameFormat.setPadding(8)\n        frameFormat.setBorder(4)\n        cursor.insertFrame(frameFormat)\n\n        cursor.insertText(\"\"\"\n                          Documents are either converted from external sources \n                          or created from scratch using Qt. The creation process \n                          can done by an editor widget, such as QTextEdit, or by \n                          explicit calls to the Scribe API.\"\"\",\n                          boldCharFormat)\n\n        cursor = mainFrame.lastCursorPosition()\n        cursor.insertText(\"\"\"\n                          There are two complementary ways to visualize the \n                          contents of a document: as a linear buffer that is \n                          used by editors to modify the contents, and as an \n                          object hierarchy containing structural information \n                          that is useful to layout engines. In the hierarchical \n                          model, the objects generally correspond to visual \n                          elements such as frames, tables, and lists. At a lower \n                          level, these elements describe properties such as the \n                          style of text used and its alignment. The linear \n                          representation of the document is used for editing and \n                          manipulation of the document's contents.\"\"\",\n                          plainCharFormat)\n\n        \n        frame = cursor.currentFrame()\n\n        items = []\n\n        #test iterator\n        for i in frame:\n            items.append(i)\n\n        #test __iadd__\n        b = frame.begin()\n        i = 0\n        while not b.atEnd():\n            self.assertEqual(b, items[i])\n            self.assert_(b.parentFrame(), items[i].parentFrame())\n            b.__iadd__(1)\n            i += 1\n\n        #test __isub__\n        b = frame.end()\n        i = 0\n        while i > 0:\n            self.assertEqual(b, items[i])\n            self.assert_(b.parentFrame(), items[i].parentFrame())\n            b.__isub__(1)\n            i -= 1\n\n        \n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_693.py",
    "content": "\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nimport unittest\n\nclass MyModel (QAbstractListModel):\n\n    stupidLine = QLine(0, 0, 10, 10)\n\n    def rowCount(self, parent):\n        return 1\n\n    def data(self, index, role):\n        return self.stupidLine\n\nclass TestBug693(unittest.TestCase):\n    def testIt(self):\n        app = QApplication([])\n        model = MyModel()\n        view = QListView()\n        view.setModel(model)\n        view.show()\n\n        # This must NOT throw the exception:\n        # RuntimeError: Internal C++ object (PySide.QtCore.QLine) already deleted.\n        MyModel.stupidLine.isNull()\n\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_696.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# This file is part of the Shiboken Python Bindings Generator project.\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n#\n# Contact: PySide team <contact@pyside.org>\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public License\n# version 2.1 as published by the Free Software Foundation. Please\n# review the following information to ensure the GNU Lesser General\n# Public License version 2.1 requirements will be met:\n# http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n# #\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n\nimport sys\nimport unittest\n\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QMainWindow, QMenu, QApplication\n\nclass MainWindow(QMainWindow):\n    def __init__(self, *args):\n        self._menu = QMenu(self.dontexist) # attribute called with invalid C++ object\n\nclass MainWindow2(QMainWindow):\n    def __init__(self):\n        self.show()\n\nclass Bug696(UsesQApplication):\n    def testContructorInitialization(self):\n        self.assertRaises(AttributeError, MainWindow)\n\n    def testContructorInitializationAndCPPFunction(self):\n        self.assertRaises(RuntimeError, MainWindow2)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_711.py",
    "content": "import unittest\nfrom PySide.QtGui import QToolBar, QApplication, QAction, QToolButton\n\nclass TestLabelPixmap(unittest.TestCase):\n    def testReference(self):\n        toolbar = QToolBar()\n\n        for i in xrange(20):\n            toolbar.addAction(QAction(\"Action %d\" % i, None))\n\n        buttons = toolbar.findChildren(QToolButton, \"\")\n        toolbar.clear()\n\n        for b in buttons:\n            self.assertRaises(RuntimeError, b.objectName)\n\nif __name__ == '__main__':\n    app = QApplication([])\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_714.py",
    "content": "import unittest\nimport sys\nfrom PySide.QtGui import QLabel, QApplication, QPixmap\n\nclass TestLabelPixmap(unittest.TestCase):\n    def testReference(self):\n        l = QLabel()\n        p = QPixmap()\n        l.setPixmap(p) # doesn't increment pixmap ref because this makes a copy\n        self.assertEqual(sys.getrefcount(p), 2)\n\n        p = l.pixmap() # this increment the reference because this is an internal pointer\n        self.assertEqual(sys.getrefcount(p), 3)\n\n        p2 = l.pixmap()\n        self.assertEqual(p, p2)\n\nif __name__ == '__main__':\n    app = QApplication([])\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_716.py",
    "content": "from PySide.QtCore import Qt, QPersistentModelIndex\nfrom PySide.QtGui import QStringListModel\n\nif __name__ == '__main__':\n    stringListModel = QStringListModel(['one', 'two'])\n    idx = stringListModel.index(1, 0)\n    persistentModelIndex = QPersistentModelIndex(idx)\n    stringListModel.data(persistentModelIndex, Qt.DisplayRole)\n\n"
  },
  {
    "path": "tests/QtGui/bug_722.py",
    "content": "import unittest\n\nfrom helper import UsesQApplication\n\nfrom PySide.QtGui import QDoubleSpinBox, QGraphicsBlurEffect\n\nclass TestSignalConnection(UsesQApplication):\n    def testFloatSignal(self):\n        foo1 = QDoubleSpinBox()\n        foo2 = QDoubleSpinBox()\n        foo1.valueChanged[float].connect(foo2.setValue)\n        foo2.valueChanged[float].connect(foo1.setValue)\n        foo1.setValue(0.42)\n        self.assertEqual(foo1.value(), foo2.value())\n\n    def testQRealSignal(self):\n        foo1 = QDoubleSpinBox()\n        effect = QGraphicsBlurEffect()\n        effect.blurRadiusChanged['qreal'].connect(foo1.setValue) # check if qreal is a valid type\n        effect.setBlurRadius(0.42)\n        self.assertAlmostEqual(foo1.value(), effect.blurRadius())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_728.py",
    "content": "from PySide.QtGui import *\nfrom PySide.QtCore import *\n\napp = QApplication([])\nQTimer.singleShot(200, app.quit)\n\n# This test for a dead lock in QFileDialog.getOpenFileNames, the test fail with a timeout if the dead lock exists.\nQFileDialog.getOpenFileNames(None, \"caption\", QDir.homePath(), None, \"\", QFileDialog.DontUseNativeDialog)\n"
  },
  {
    "path": "tests/QtGui/bug_736.py",
    "content": "import unittest\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass TestBug736 (unittest.TestCase):\n\n    def testIt(self):\n        app = QApplication([])\n        slider = QSlider(Qt.Horizontal)\n        slider2 = QSlider(Qt.Horizontal)\n\n        slider2.setMaximum(10)\n        slider.valueChanged[int].connect(slider2.setMaximum)\n        slider.valueChanged[int].emit(100)\n        self.assertEqual(slider2.maximum(), 100)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_740.py",
    "content": "import unittest\nimport py3kcompat as py3k\nfrom helper import UsesQApplication\nfrom PySide.QtCore import QSize\nfrom PySide.QtGui import QBitmap, QImage\n\nclass TestQBitmap(UsesQApplication):\n    def testFromDataMethod(self):\n        dataBits = py3k.b('\\x38\\x28\\x38\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\x10\\xfe\\xfe\\x7c\\x7c\\x38\\x38\\x10\\x10')\n        bim = QBitmap.fromData(QSize(8, 48), dataBits, QImage.Format_Mono) # missing function\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_743.py",
    "content": "import unittest\n\nfrom PySide.QtGui import QMatrix4x4\n\nclass TestQMatrix(unittest.TestCase):\n    def testOperator(self):\n        m = QMatrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)\n        v = 1\n        for x in range(4):\n            for y in range(4):\n                self.assertEqual(m[x,y], v)\n                v += 1\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_750.py",
    "content": "import unittest\n\nfrom helper import UsesQApplication\n\nfrom PySide.QtCore import QTimer\nfrom PySide.QtGui import QPainter, QFont, QFontInfo, QWidget, qApp\n\nclass MyWidget(QWidget):\n    def paintEvent(self, e):\n        p = QPainter(self)\n        self._info = p.fontInfo()\n        self._app.quit()\n\n\nclass TestQPainter(UsesQApplication):\n    def testFontInfo(self):\n        w = MyWidget()\n        w._app = self.app\n        w._info = None\n        QTimer.singleShot(300, w.show)\n        self.app.exec_()\n        self.assert_(w._info)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_778.py",
    "content": "import unittest\n\nfrom helper import UsesQApplication\n\nfrom PySide.QtGui import QTreeWidget, QTreeWidgetItem, QTreeWidgetItemIterator\n\nclass QTreeWidgetItemIteratorTest(UsesQApplication):\n    def testWidgetIterator(self):\n        treeWidget = QTreeWidget()\n        treeWidget.setColumnCount(1)\n        items = []\n        for i in range(10):\n            items.append(QTreeWidgetItem(None, ['item: %d' % i]))\n        treeWidget.insertTopLevelItems(0, items)\n\n        index = 0\n        for it in QTreeWidgetItemIterator(treeWidget):\n            self.assertEqual(it.value().text(0), 'item: %d' % index)\n            index += 1\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_785.py",
    "content": "import sys\r\n\r\nimport unittest\r\nfrom PySide.QtGui import QApplication, QStandardItemModel, QStandardItem, QItemSelection\r\n\r\nclass Bug324(unittest.TestCase):\r\n    def testOperators(self):\r\n        model = QStandardItemModel()\r\n        for i in range(100):\r\n            model.appendRow(QStandardItem(\"Item: %d\"%i))\r\n\r\n        first = model.index(0, 0)\r\n        second = model.index(10, 0)\r\n        third = model.index(20, 0)\r\n        fourth = model.index(30, 0)\r\n\r\n        sel = QItemSelection(first, second)\r\n        sel2 = QItemSelection()\r\n        sel2.select(third, fourth)\r\n\r\n        sel3 = sel + sel2 #check operator +\r\n        self.assertEqual(len(sel3), 2)\r\n        sel4 = sel\r\n        sel4 += sel2 #check operator +=\r\n        self.assertEqual(len(sel4), 2)\r\n        self.assertEqual(sel4, sel3)\r\n\r\nif __name__ == \"__main__\":\r\n    unittest.main()\r\n"
  },
  {
    "path": "tests/QtGui/bug_793.py",
    "content": "import unittest\nimport sys\nfrom PySide.QtCore import QTimer\nfrom PySide.QtGui import QWidget, QApplication\n\nclass TestW1(QWidget):\n    def __init__(self, parent = None):\n        super(TestW1, self).__init__(parent)\n        TestW2(parent, self)\n\nclass TestW2(QWidget):\n    def __init__(self, ancestor, parent = None):\n        super(TestW2, self).__init__(parent)\n        self.ancestor_ref = ancestor\n\nclass Test(QWidget):\n    def __init__(self):\n        super(Test, self).__init__()\n        TestW1(self)\n\nclass TestQApplicationDestrcutor(unittest.TestCase):\n    def testDestructor(self):\n        w = Test()\n        w.show()\n        QTimer.singleShot(0, w.close)\n\nif __name__ == '__main__':\n    app = QApplication(sys.argv)\n    unittest.main()\n    sys.exit(app.exec_())\n"
  },
  {
    "path": "tests/QtGui/bug_811.py",
    "content": "import unittest\nimport sys\nimport weakref\n\nfrom helper import UsesQApplication\n\nfrom PySide.QtGui import QTextBlockUserData, QTextEdit, QTextCursor\n\nclass TestUserData(QTextBlockUserData):\n    def __init__(self, data):\n        super(TestUserData, self).__init__()\n        self.data = data\n\nclass TestUserDataRefCount(UsesQApplication):\n    def testRefcount(self):\n        textedit = QTextEdit()\n        textedit.setReadOnly(True)\n        doc = textedit.document()\n        cursor = QTextCursor(doc)\n        cursor.insertText(\"PySide Rocks\")\n        ud = TestUserData({\"Life\": 42})\n        self.assertEqual(sys.getrefcount(ud), 2)\n        cursor.block().setUserData(ud)\n        self.assertEqual(sys.getrefcount(ud), 3)\n        ud2 = cursor.block().userData()\n        self.assertEqual(sys.getrefcount(ud), 4)\n        self.udata = weakref.ref(ud, None)\n        del ud, ud2\n        self.assertEqual(sys.getrefcount(self.udata()), 2)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_834.py",
    "content": "from PySide import QtCore, QtGui\n\nclass Window(QtGui.QMainWindow):\n    def childEvent(self, event):\n        super(Window, self).childEvent(event)\n\napp = QtGui.QApplication([])\nwindow = Window()\n\ndock1 = QtGui.QDockWidget()\ndock2 = QtGui.QDockWidget()\nwindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dock1)\nwindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dock2)\nwindow.tabifyDockWidget(dock1, dock2)\n\nwindow.show()\nQtCore.QTimer.singleShot(0, window.close)\napp.exec_()\n"
  },
  {
    "path": "tests/QtGui/bug_836.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass Mixin1(object):\n    pass\n\nclass Mixin2(object):\n    pass\n\nclass Mixin3(object):\n    pass\n\nclass MainWindow(Mixin1, Mixin2, Mixin3, QFrame):\n    def __init__(self):\n        super(MainWindow, self).__init__()\n\ndef main():\n    app = QApplication([])\n    # if it doesn't crash it should pass\n    w = MainWindow()\n    w.show()\n    QTimer.singleShot(0, w.close)\n    app.exec_()\n\nif __name__ == \"__main__\":\n    main()\n\n\n"
  },
  {
    "path": "tests/QtGui/bug_844.py",
    "content": "from PySide.QtGui import *\nfrom PySide.QtCore import *\n\nclass QtKeyPressListener(QObject):\n    def __init__(self, obj):\n        QObject.__init__(self)\n        obj.installEventFilter(self)\n\n    def eventFilter(self, obj, event):\n        # This used to crash here due to a misbehaviour of type discovery!\n        return QObject.eventFilter(self, obj, event)\n\napp = QApplication([])\nkey_listener = QtKeyPressListener(app)\nw = QLabel('Hello')\nw.show()\nQTimer.singleShot(0, w.close)\napp.exec_()\n"
  },
  {
    "path": "tests/QtGui/bug_854.py",
    "content": "from PySide.QtGui import QTableView, QVBoxLayout, QApplication\nfrom PySide.QtCore import QAbstractItemModel\n\nfrom helper import UsesQApplication\nimport unittest\n\n\nclass VirtualList(QAbstractItemModel):\n    def __getitem__(self, index):\n        self._getItemCalled = True\n        pass\n\n    def rowCount(self, parent):\n        return 5000\n\n    def columnCount(self, parent):\n        return 3\n\n    def index(self, row, column, parent):\n        return self.createIndex(row, column)\n\n    def parent(self, index):\n         return QModelIndex()\n\n    def data(self, index, role):\n        return \"(%i, %i)\" % (index.row(), index.column())\n\n\nclass TestQAbstractItemModel(UsesQApplication):\n    def testSetModel(self):\n        model = VirtualList()\n        model._getItemCalled = False\n        table = QTableView()\n        table.setModel(model)\n        table.show()\n        self.assertFalse(model._getItemCalled)\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_860.py",
    "content": "\nimport sys\nimport unittest\n\nfrom PySide.QtCore import QSignalMapper\nfrom PySide.QtGui import QCheckBox\n\nfrom helper import UsesQApplication\n\nclass MultipleSlotTest(UsesQApplication):\n    def cb_changed(self, i):\n        self._changed = True\n\n    def cb_changedVoid(self):\n        self._changed = True\n\n    def testSignalMapper(self):\n        checkboxMapper = QSignalMapper()\n        box = QCheckBox('check me')\n        box.stateChanged.connect(checkboxMapper.map)\n\n        checkboxMapper.setMapping(box, box.text())\n        checkboxMapper.mapped[str].connect(self.cb_changed)\n        self._changed = False\n        box.setChecked(True)\n        self.assert_(self._changed)\n\n    def testSimpleSignal(self):\n        box = QCheckBox('check me')\n        box.stateChanged[int].connect(self.cb_changedVoid)\n        self._changed = False\n        box.setChecked(True)\n        self.assert_(self._changed)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_862.py",
    "content": "\nfrom PySide.QtCore import QObject\nfrom PySide.QtGui import *\nimport PySide.QtCore\nimport unittest\n\nclass MyQObject(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n\nclass MyQWidget(QWidget):\n    def __init__(self):\n        QWidget.__init__(self)\n\nclass MyQGraphicsObject(QGraphicsObject):\n    def __init__(self):\n        QGraphicsObject.__init__(self)\n\nclass MyQGraphicsItem(QGraphicsItem):\n    def __init__(self):\n        QGraphicsItem.__init__(self)\n\nclass TestRepr (unittest.TestCase):\n\n    def testIt(self):\n\n        app = QApplication([])\n\n        self.assertEqual(\"<__main__.MyQObject object at \", repr(MyQObject())[:30])\n        self.assertEqual(\"<__main__.MyQWidget object at \", repr(MyQWidget())[:30])\n        self.assertEqual(\"<__main__.MyQGraphicsObject(this = 0x\", repr(MyQGraphicsObject())[:37])\n        self.assertEqual(\"<__main__.MyQGraphicsItem(this = 0x\", repr(MyQGraphicsItem())[:35])\n\n        self.assertEqual(\"<PySide.QtCore.QObject object at \", repr(QObject())[:33])\n        self.assertEqual(\"<PySide.QtCore.QObject object at \", repr(PySide.QtCore.QObject())[:33])\n        self.assertEqual(\"<PySide.QtGui.QWidget object at \", repr(QWidget())[:32])\n        self.assertEqual(\"<PySide.QtGui.QGraphicsWidget(this = 0x\", repr(QGraphicsWidget())[:39])\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_871.py",
    "content": "import unittest\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QLineEdit, QValidator, QIntValidator\n\n'''Bug #871 - http://bugs.pyside.org/show_bug.cgi?id=871'''\n\n\nclass BlankIntValidator(QIntValidator):\n    def validate(self,input,pos):\n        if input == '':\n            return QValidator.Acceptable, input, pos\n        else:\n            return QIntValidator.validate(self,input,pos)\n\n\nclass Bug871Test(UsesQApplication):\n    def testWithoutValidator(self):\n        edit = QLineEdit()\n        self.assertEqual(edit.text(), '')\n        edit.insert('1')\n        self.assertEqual(edit.text(), '1')\n        edit.insert('a')\n        self.assertEqual(edit.text(), '1a')\n        edit.insert('2')\n        self.assertEqual(edit.text(), '1a2')\n\n    def testWithIntValidator(self):\n        edit = QLineEdit()\n        edit.setValidator(BlankIntValidator(edit))\n        self.assertEqual(edit.text(), '')\n        edit.insert('1')\n        self.assertEqual(edit.text(), '1')\n        edit.insert('a')\n        self.assertEqual(edit.text(), '1')\n        edit.insert('2')\n        self.assertEqual(edit.text(), '12')\n\n\nif __name__ == \"__main__\":\n   unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/bug_879.py",
    "content": "import unittest\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass MySpinBox(QSpinBox):\n\n    def validate(self,text,pos):\n        return QSpinBox.validate(self,text,pos)\n\nclass TestBug879 (unittest.TestCase):\n\n    def testIt(self):\n        app = QApplication([])\n        self.box = MySpinBox()\n        self.box.show()\n\n        QTimer.singleShot(0, self.sendKbdEvent)\n        QTimer.singleShot(100, app.quit)\n        app.exec_()\n\n        self.assertEqual(self.box.text(), '0')\n\n    def sendKbdEvent(self):\n        ev = QKeyEvent(QEvent.KeyPress, Qt.Key_A, Qt.NoModifier, 'a')\n        QCoreApplication.sendEvent(self.box, ev)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_882.py",
    "content": "from PySide.QtGui import *\nfrom PySide.QtCore import *\nimport os\n\nif \"DISPLAY\" in os.environ:\n    del os.environ[\"DISPLAY\"]\n\napp = QApplication([], False)\nQTimer.singleShot(0, app.quit)\napp.exec_()\n\n\n\n"
  },
  {
    "path": "tests/QtGui/bug_919.py",
    "content": "import unittest\n\nfrom helper import TimedQApplication\nfrom PySide.QtGui import QPainter, QPushButton, QStyleOptionButton, QApplication, QStyle\n\nclass MyWidget(QPushButton):\n    def __init__(self, parent = None):\n        QPushButton.__init__(self, parent)\n        self._painted = False\n\n    def paintEvent(self, e):\n        p = QPainter(self)\n        style = QApplication.style()\n        option = QStyleOptionButton()\n        style.drawControl(QStyle.CE_PushButton, option, p)\n        self._painted = True\n\n\nclass TestBug919(TimedQApplication):\n    def testFontInfo(self):\n        w = MyWidget()\n        w.show()\n        self.app.exec_()\n        self.assert_(w._painted)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_921.py",
    "content": "#!/usr/bin/env python\n\nimport unittest\n\nimport PySide.QtCore as QtCore\nimport PySide.QtGui as QtGui\n\nfrom helper import TimedQApplication\n\nclass Signaller(QtCore.QObject):\n    s1 = QtCore.Signal()\n    s2 = QtCore.Signal()\n    s3 = QtCore.Signal()\n\nclass Window(object):\n\n    def __init__(self, s):\n        self._window = QtGui.QMainWindow()\n        self._window.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)\n        self._window.setWindowTitle(\"Demo!\")\n\n        self._s = s\n        self._s.s1.connect(self._on_signal)\n        self._s.s2.connect(self._on_signal)\n\n    def show(self):\n        self._window.show()\n\n    def _on_signal(self):\n        self._window.setWindowTitle(\"Signaled!\")\n\nclass TestTimedApp(TimedQApplication):\n    def testSignals(self):\n        s = Signaller()\n        w = Window(s)\n        w.show()\n\n        def midleFunction():\n            def internalFunction():\n                pass\n            s.s3.connect(internalFunction)\n\n        midleFunction()\n        self.app.exec_()\n        del w\n\n        s.s1.emit()\n        s.s2.emit()\n        s.s3.emit()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_941.py",
    "content": "import unittest\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\ndef foo(a, b):\n    pass\n\nclass TestBug941 (unittest.TestCase):\n\n    def testIt(self):\n        app = QApplication([])\n        view = QHeaderView(Qt.Horizontal)\n        self.assertTrue(view.sortIndicatorChanged.connect(foo))\n        view.sortIndicatorChanged.emit(0, Qt.Vertical) # this can't raise an exception!\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_964.py",
    "content": "import unittest\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass TestBug964 (unittest.TestCase):\n\n    def testIt(self):\n        app = QApplication([])\n        model = QStringListModel([\"1\", \"2\"])\n        view = QListView()\n        view.setModel(model)\n        view.setCurrentIndex(model.index(0,0))\n        newCursor = view.moveCursor(QAbstractItemView.MoveDown, Qt.NoModifier)\n        self.assertEqual(newCursor.row(), 1)\n        self.assertEqual(newCursor.column(), 0)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_967.py",
    "content": "import unittest\nfrom PySide.QtGui import *\n\nclass TestBug967 (unittest.TestCase):\n\n    def callback(self, arg):\n        self.arg = arg\n\n    def testIt(self):\n        self.arg = None\n        app = QApplication([])\n        obj = QComboBox()\n        obj.currentIndexChanged.connect(self.callback)\n        obj.currentIndexChanged.emit(5)\n        self.assertEqual(self.arg, 5)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_972.py",
    "content": "import unittest\nfrom PySide.QtCore import QSizeF\nfrom PySide.QtGui import QGraphicsProxyWidget, QSizePolicy, QPushButton, QGraphicsScene, QGraphicsView\n\nfrom helper import TimedQApplication\n\ndef createItem(minimum, preferred, maximum, name):\n    w = QGraphicsProxyWidget()\n\n    w.setWidget(QPushButton(name))\n    w.setMinimumSize(minimum)\n    w.setPreferredSize(preferred)\n    w.setMaximumSize(maximum)\n    w.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)\n\n    return w\n\nclass TestBug972 (TimedQApplication):\n\n    # Test if the function QGraphicsProxyWidget.setWidget have the correct behavior\n    def testIt(self):\n        scene = QGraphicsScene()\n\n        minSize = QSizeF(30, 100)\n        prefSize = QSizeF(210, 100)\n        maxSize = QSizeF(300, 100)\n\n        a = createItem(minSize, prefSize, maxSize, \"A\")\n        b = createItem(minSize, prefSize, maxSize, \"B\")\n        c = createItem(minSize, prefSize, maxSize, \"C\")\n        d = createItem(minSize, prefSize, maxSize, \"D\")\n\n        view = QGraphicsView(scene)\n        view.show()\n        self.app.exec_()\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_979.py",
    "content": "from PySide.QtGui import QDialog\nfrom import_test import PysideImportTest2\n\nclass PysideImportTest1(QDialog, PysideImportTest2):\n       pass\n\nif __name__ == '__main__':\n    quit()\n\n"
  },
  {
    "path": "tests/QtGui/bug_988.py",
    "content": "import unittest\nfrom PySide.QtGui import *\n\nclass TestBug988 (unittest.TestCase):\n\n    def callback(self, arg):\n        self.arg = arg\n\n    def testIt(self):\n        self.arg = None\n        app = QApplication([])\n        obj = QTabWidget()\n        obj.currentChanged.connect(self.callback)\n        obj.currentChanged.emit(5)\n        self.assertEqual(self.arg, 5)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_991.py",
    "content": "import unittest\nfrom PySide.QtCore import QObject\nfrom PySide.QtGui import QPen, QBrush\n\nclass TestBug991 (unittest.TestCase):\n    def testReprFunction(self):\n        reprPen = repr(QPen())\n        self.assertTrue(reprPen.startswith(\"<PySide.QtGui.QPen\"))\n        reprBrush = repr(QBrush())\n        self.assertTrue(reprBrush.startswith(\"<PySide.QtGui.QBrush\"))\n        reprObject = repr(QObject())\n        self.assertTrue(reprObject.startswith(\"<PySide.QtCore.QObject\"))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_998.py",
    "content": "import unittest\nfrom PySide.QtGui import QApplication\n\nclass TestBug998 (unittest.TestCase):\n    def testNoFocusWindow(self):\n        widget = QApplication.focusWidget()\n        self.assertTrue(widget == None)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/bug_PYSIDE-41.py",
    "content": "# TODO:\n# move this to QtCore -- QStringListModel is part of QtGui and there is no\n# simple model class appropriate for this test in QtCore.\n\nimport unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\n\nclass TestBugPYSIDE41(unittest.TestCase):\n\n    def testIt(self):\n\n        # list of single-character strings\n        strings = list('abcdefghijklmnopqrstuvwxyz')\n\n        model = QStringListModel(strings)\n\n        # Test hashing of both QModelIndex and QPersistentModelIndex\n        indexFunctions = []\n        indexFunctions.append(model.index)\n        indexFunctions.append(lambda i: QPersistentModelIndex(model.index(i)))\n\n        for indexFunction in indexFunctions:\n\n            # If two objects compare equal, their hashes MUST also be equal. (The\n            # reverse is not a requirement.)\n            for i, _ in enumerate(strings):\n                index1 = indexFunction(i)\n                index2 = indexFunction(i)\n                self.assertEqual(index1, index2)\n                self.assertEqual(hash(index1), hash(index2))\n\n            # Adding the full set of indexes to itself is a no-op.\n            allIndexes1 = set(indexFunction(i) for i, _ in enumerate(strings))\n            allIndexes2 = set(indexFunction(i) for i, _ in enumerate(strings))\n            allIndexesCombined = allIndexes1 & allIndexes2\n            self.assertEqual(allIndexes1, allIndexesCombined)\n            self.assertEqual(allIndexes2, allIndexesCombined)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/customproxywidget_test.py",
    "content": "import unittest\n\nfrom helper import UsesQApplication\nfrom PySide.QtCore import Qt, QTimer\nfrom PySide.QtGui import QLabel, QPainter\nfrom PySide.QtGui import QGraphicsScene, QGraphicsView, QGraphicsItem, QGraphicsProxyWidget\n\nclass CustomProxy(QGraphicsProxyWidget):\n    def __init__(self, parent=None, wFlags=0):\n        QGraphicsProxyWidget.__init__(self, parent, wFlags)\n\nclass CustomProxyWidgetTest(UsesQApplication):\n    def testCustomProxyWidget(self):\n        scene = QGraphicsScene()\n\n        proxy = CustomProxy(None, Qt.Window)\n        widget = QLabel('Widget')\n        proxy.setWidget(widget)\n        proxy.setCacheMode(QGraphicsItem.DeviceCoordinateCache)\n        scene.addItem(proxy)\n        scene.setSceneRect(scene.itemsBoundingRect())\n\n        view = QGraphicsView(scene)\n        view.setRenderHints(QPainter.Antialiasing|QPainter.SmoothPixmapTransform)\n        view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)\n        view.show()\n\n        timer = QTimer.singleShot(100, self.app.quit)\n        self.app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/deepcopy_test.py",
    "content": "\nimport unittest\nfrom copy import deepcopy\n\nfrom PySide.QtCore import QPoint\nfrom PySide.QtGui import QMatrix\nfrom PySide.QtGui import QMatrix2x2, QMatrix2x3, QMatrix2x4\nfrom PySide.QtGui import QMatrix3x2, QMatrix3x3, QMatrix3x4\nfrom PySide.QtGui import QMatrix4x2, QMatrix4x3, QMatrix4x4\nfrom PySide.QtGui import QVector2D, QVector3D, QVector4D\nfrom PySide.QtGui import QColor, QTransform, QKeySequence, QQuaternion\nfrom PySide.QtGui import QPolygon\n\nclass DeepCopyHelper:\n    def testCopy(self):\n        copy = deepcopy([self.original])[0]\n        self.assert_(copy is not self.original)\n        self.assertEqual(copy, self.original)\n\nclass DeepCopyColorHelperF:\n    def testCopy(self):\n        copy = deepcopy([self.original])[0]\n        self.assert_(copy is not self.original)\n        self.assertEqual(copy.spec(), self.original.spec())\n        # impossible to compare float point\n        # self.assertEqual(copy, self.original)\n\n\nclass QColorDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QColor(\"red\")\n\nclass QColorRGBDeepCopy(DeepCopyColorHelperF, unittest.TestCase):\n    def setUp(self):\n        self.original = QColor.fromRgbF(0.2, 0.3, 0.4, 0.5)\n\nclass QColorHSLDeepCopy(DeepCopyColorHelperF, unittest.TestCase):\n    def setUp(self):\n        self.original = QColor.fromHslF(0.2, 0.3, 0.4, 0.5)\n\nclass QColorHSVDeepCopy(DeepCopyColorHelperF, unittest.TestCase):\n    def setUp(self):\n        self.original = QColor.fromHsvF(0.2, 0.3, 0.4, 0.5)\n\nclass QColorCMYKDeepCopy(DeepCopyColorHelperF, unittest.TestCase):\n    def setUp(self):\n        self.original = QColor.fromCmykF(0.2, 0.3, 0.4, 0.5, 0.6)\n\nclass QTransformDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8)\n\nclass QKeySequenceDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QKeySequence(\"Ctrl+P\")\n\nclass QQuaternionDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QQuaternion(1, 2, 3, 4)\n\nclass QVector2DDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QVector2D(1, 2)\n\nclass QVector3DDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QVector3D(1, 2, 3)\n\nclass QVector4DDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QVector4D(1, 2, 3, 4)\n\nclass QPolygonDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QPolygon([QPoint(1, 2), QPoint(3, 4), QPoint(5, 6)])\n\nclass QMatrixDeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix(1, 2, 3, 4, 5, 6)\n\n\n# Avoid these tests until get gcc fixed\n# Related bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247\n\"\"\"\nclass QMatrix2x2DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix2x2([1, 2, 3, 4])\n\nclass QMatrix2x3DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix2x3([1, 2, 3, 4, 5, 6])\n\nclass QMatrix2x4DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix2x4([1, 2, 3, 4, 5, 6, 7, 8])\n\nclass QMatrix3x2DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix3x2([1, 2, 3, 4, 5, 6])\n\nclass QMatrix3x3DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix3x3([1, 2, 3, 4, 5, 6, 7, 8, 9])\n\nclass QMatrix3x4DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix3x4([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])\n\nclass QMatrix4x2DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix4x2([1, 2, 3, 4, 5, 6, 7, 8])\n\nclass QMatrix4x3DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix4x3([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])\n\nclass QMatrix4x4DeepCopy(DeepCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix4x4([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])\n\"\"\"\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/event_filter_test.py",
    "content": "import unittest\nimport sys\n\nfrom helper import UsesQApplication\nfrom PySide.QtCore import QObject, QEvent\nfrom PySide.QtGui import QWidget\n\nclass MyFilter(QObject):\n  def eventFilter(self, obj, event):\n    if event.type() == QEvent.KeyPress:\n      pass\n    return QObject.eventFilter(self, obj, event)\n\n\nclass EventFilter(UsesQApplication):\n    def testRefCount(self):\n        o = QObject()\n        filt = MyFilter()\n        o.installEventFilter(filt)\n        self.assertEqual(sys.getrefcount(o), 2)\n\n        o.installEventFilter(filt)\n        self.assertEqual(sys.getrefcount(o), 2)\n\n        o.removeEventFilter(filt)\n        self.assertEqual(sys.getrefcount(o), 2)\n\n    def testObjectDestructorOrder(self):\n        w = QWidget()\n        filt = MyFilter()\n        filt.app = self.app\n        w.installEventFilter(filt)\n        w.show()\n        w.close()\n        w = None\n        self.assert_(True)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/float_to_int_implicit_conversion_test.py",
    "content": "\n'''Test cases for QImage'''\n\nimport unittest\n\nfrom PySide.QtGui import QImage, qRgb\n\nfrom helper import UsesQApplication\n\nclass SetPixelFloat(UsesQApplication):\n    '''Test case for calling setPixel with float as argument'''\n\n    def setUp(self):\n        #Acquire resources\n        super(SetPixelFloat, self).setUp()\n        self.color = qRgb(255, 0, 0)\n        self.image = QImage(200, 200, QImage.Format_RGB32)\n\n    def tearDown(self):\n        #Release resources\n        del self.color\n        del self.image\n        super(SetPixelFloat, self).tearDown()\n\n    def testFloat(self):\n        #QImage.setPixel(float, float, color) - Implicit conversion\n        self.image.setPixel(3.14, 4.2, self.color)\n        self.assertEqual(self.image.pixel(3.14, 4.2), self.color)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/grandparent_method_test.py",
    "content": "\n'''Tests for calling methods further than the direct parent'''\n\nimport unittest\n\nfrom PySide.QtGui import QPushButton, QWidget\n\nfrom helper import UsesQApplication\n\nclass Dummy(QPushButton):\n\n    def show(self):\n        QWidget.show(self)\n        self.called = True\n\nclass GrandParentMethod(UsesQApplication):\n    def testMethod(self):\n        obj = Dummy()\n        obj.show()\n        self.assert_(obj.called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/hashabletype_test.py",
    "content": "'''Test cases for __hash__'''\n\nimport unittest\n\nfrom PySide.QtGui import QTreeWidgetItem\nfrom helper import UsesQApplication\n\nclass HashableTest(UsesQApplication):\n\n    def testQTreeWidgetItemHash(self):\n        h = {}\n        obj = QTreeWidgetItem()\n        h[obj] = 2\n        self.assert_(h.get(obj), 2)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/import_test.py",
    "content": "class PysideImportTest2(object):\n    pass\n"
  },
  {
    "path": "tests/QtGui/keep_reference_test.py",
    "content": "#!/usr/bin/env python\n\nimport unittest\n\nfrom sys import getrefcount\nfrom helper import UsesQApplication\nfrom PySide.QtCore import *\nfrom PySide.QtGui import QTableView\n\nclass TestModel(QAbstractTableModel):\n    def __init__(self, parent=None):\n        QAbstractTableModel.__init__(self, parent)\n    def rowCount(self, parent):\n        return 0\n    def columnCount(self, parent):\n        return 0\n    def data(self, index, role):\n        return None\n\nclass KeepReferenceTest(UsesQApplication):\n\n    def testModelWithoutParent(self):\n        view = QTableView()\n        model = TestModel()\n        view.setModel(model)\n        samemodel = view.model()\n        self.assertEqual(model, samemodel)\n\n    def testModelWithParent(self):\n        view = QTableView()\n        model = TestModel(None)\n        view.setModel(model)\n        samemodel = view.model()\n        self.assertEqual(model, samemodel)\n\n    def testReferenceCounting(self):\n        '''Tests reference count of model object referred by view objects.'''\n        model1 = TestModel()\n        refcount1 = getrefcount(model1)\n        view1 = QTableView()\n        view1.setModel(model1)\n        self.assertEqual(getrefcount(view1.model()), refcount1 + 1)\n\n        view2 = QTableView()\n        view2.setModel(model1)\n        self.assertEqual(getrefcount(view2.model()), refcount1 + 2)\n\n        model2 = TestModel()\n        view2.setModel(model2)\n        self.assertEqual(getrefcount(view1.model()), refcount1 + 1)\n\n    def testReferenceCountingWhenDeletingReferrer(self):\n        '''Tests reference count of model object referred by deceased view object.'''\n        model = TestModel()\n        refcount1 = getrefcount(model)\n        view = QTableView()\n        view.setModel(model)\n        self.assertEqual(getrefcount(view.model()), refcount1 + 1)\n\n        del view\n        self.assertEqual(getrefcount(model), refcount1)\n\n    def testReferreedObjectSurvivalAfterContextEnd(self):\n        '''Model object assigned to a view object must survive after getting out of context.'''\n        def createModelAndSetToView(view):\n            model = TestModel()\n            model.setObjectName('created model')\n            view.setModel(model)\n        view = QTableView()\n        createModelAndSetToView(view)\n        model = view.model()\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/missing_symbols_test.py",
    "content": "\n'''(Very) Simple test case for missing names from QtGui'''\n\nimport unittest\nfrom PySide import QtGui\n\nclass MissingClasses(unittest.TestCase):\n    def testQDrag(self): # Bug 222\n        getattr(QtGui, 'QDrag')\n\n    def testQDropEvent(self): # Bug 255\n        getattr(QtGui, 'QDropEvent')\n\nclass MissingMembers(unittest.TestCase):\n\n    def testQFontMetricsSize(self): # Bug 223\n        QtGui.QFontMetrics.size\n\n    def testQLayoutSetSpacing(self): # Bug 231\n        QtGui.QLayout.setSpacing\n\n    def testQImageLoad(self): # Bug 257\n        QtGui.QImage.load\n\n    def testQStandardItemModelinsertRow(self): # Bug 227\n        QtGui.QStandardItemModel.insertRow\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/paint_event_test.py",
    "content": "\n'''Test paint event override in python'''\n\nimport unittest\n\nfrom PySide.QtCore import QTimerEvent\nfrom PySide.QtGui import QApplication, QWidget\n\nfrom helper import UsesQApplication\n\nclass MyWidget(QWidget):\n    '''Sample widget'''\n\n    def __init__(self, app=None):\n        #Creates a new widget\n        if app is None:\n            app = QApplication([])\n\n        super(MyWidget, self).__init__()\n        self.app = app\n        self.runs = 0\n        self.max_runs = 5\n        self.paint_event_called = False\n\n    def timerEvent(self, event):\n        #Timer event method\n        self.runs += 1\n\n        if self.runs == self.max_runs:\n            self.app.quit()\n\n        if not isinstance(event, QTimerEvent):\n            raise TypeError('Invalid event type. Must be QTimerEvent')\n\n    def paintEvent(self, event):\n        #Empty paint event method\n        # XXX: should be using super here, but somehow PyQt4\n        # complains about paintEvent not present in super\n        QWidget.paintEvent(self, event)\n        self.paint_event_called = True\n\n\nclass PaintEventOverride(UsesQApplication):\n    '''Test case for overriding QWidget.paintEvent'''\n\n    qapplication = True\n\n    def setUp(self):\n        #Acquire resources\n        super(PaintEventOverride, self).setUp()\n        self.widget = MyWidget(self.app)\n\n    def tearDown(self):\n        #Release resources\n        del self.widget\n        super(PaintEventOverride, self).tearDown()\n\n    def testPaintEvent(self):\n        #Test QWidget.paintEvent override\n        timer_id = self.widget.startTimer(100)\n        self.widget.show()\n        self.app.exec_()\n\n        self.widget.killTimer(timer_id)\n\n        self.assert_(self.widget.paint_event_called)\n        self.assertEqual(self.widget.runs, 5)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/parent_method_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import QObject, QTimer, QThread\nfrom PySide.QtGui import *\n\nclass Foo(QTableView):\n    def __init__(self, parent=None):\n        QTableView.__init__(self, parent)\n\nfrom helper import UsesQApplication\n\nclass TestParentType(UsesQApplication):\n\n    def testParentType(self):\n        # Test the problem with calling QObject.parent from a QWidget\n        # when the parent is a python class derived from a QWidget-derived\n        # class. The method was returning the last C++ class in the hierarchy\n        parent = Foo()\n        w2 = QWidget(parent)\n        self.assert_(isinstance(w2.parentWidget(), Foo))\n        self.assert_(isinstance(w2.parent(), Foo))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/pyside_reload_test.py",
    "content": "import os\nimport sys\nimport shutil\nimport unittest\nimport py3kcompat as py3k\n\norig_path = os.path.join(os.path.dirname(__file__))\nworkdir = os.getcwd()\nsrc = os.path.join(orig_path, 'test_module_template.py')\ndst = os.path.join(workdir, 'test_module.py')\nshutil.copyfile(src, dst)\nsys.path.append(workdir)\n\ndef reload_module(moduleName):\n    if py3k.IS_PY3K:\n        import imp\n        imp.reload(moduleName)\n    else:\n        reload(moduleName)\n\ndef increment_module_value():\n    modfile = open(dst, 'a')\n    modfile.write('Sentinel.value += 1' + os.linesep)\n    modfile.flush()\n    modfile.close()\n    if not sys.dont_write_bytecode:\n        if py3k.IS_PY3K:\n            import imp\n            cacheFile = imp.cache_from_source(dst)\n        else:\n            cacheFile = dst + 'c'\n        os.remove(cacheFile)\n\nclass TestModuleReloading(unittest.TestCase):\n\n    def testModuleReloading(self):\n        '''Test module reloading with on-the-fly modifications.'''\n\n        import test_module\n        self.assertEqual(test_module.Sentinel.value, 10)\n\n        increment_module_value()\n        reload_module(sys.modules['test_module'])\n        self.assertEqual(test_module.Sentinel.value, 11)\n\n        reload_module(sys.modules['test_module'])\n        self.assertEqual(test_module.Sentinel.value, 11)\n\n        increment_module_value()\n        reload_module(sys.modules['test_module'])\n        self.assertEqual(test_module.Sentinel.value, 12)\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n\n"
  },
  {
    "path": "tests/QtGui/python_properties_test.py",
    "content": "import unittest\nfrom PySide import QtGui, QtCore\n\nclass Properties(unittest.TestCase):\n\n    def testStaticProperty(self):\n        self.assertEqual(QtGui.QGraphicsItem.UserType, 65536)\n\n    def testInstanceProperty(self):\n        p = QtGui.QStyleOptionViewItemV3()\n        self.assert_(isinstance(p.locale, QtCore.QLocale))\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qabstracttextdocumentlayout_test.py",
    "content": "import unittest\nimport py3kcompat as py3k\n\nfrom PySide.QtCore import QSizeF, QTimer\nfrom PySide.QtGui import QTextFormat, QTextCharFormat, QTextEdit, QPyTextObject\nfrom helper import UsesQApplication\n\nclass Foo(QPyTextObject):\n    called = False\n\n    def intrinsicSize(self, doc, posInDocument, format):\n        Foo.called = True\n        return QSizeF(10, 10)\n\n    def drawObject(self, painter, rect, doc, posInDocument, format):\n        pass\n\nclass QAbstractTextDocumentLayoutTest(UsesQApplication):\n\n    objectType = QTextFormat.UserObject + 1\n\n    def foo(self):\n        fmt = QTextCharFormat()\n        fmt.setObjectType(QAbstractTextDocumentLayoutTest.objectType)\n\n        cursor = self.textEdit.textCursor()\n        cursor.insertText(py3k.unichr(0xfffc), fmt)\n        self.textEdit.setTextCursor(cursor)\n        self.textEdit.close()\n\n    def testIt(self):\n\n        self.textEdit = QTextEdit()\n        self.textEdit.show()\n\n        interface = Foo()\n        self.textEdit.document().documentLayout().registerHandler(QAbstractTextDocumentLayoutTest.objectType, interface)\n\n        QTimer.singleShot(0, self.foo)\n        self.app.exec_()\n\n        self.assertTrue(Foo.called)\n\nif __name__ == \"__main__\":\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qaction_test.py",
    "content": "import unittest\n\nfrom PySide.QtGui import QAction, QWidget\nfrom helper import UsesQApplication\n\nclass QPainterDrawText(UsesQApplication):\n\n    def _cb(self):\n        self._called = True\n\n    def testSignal(self):\n        o = QWidget()\n        act = QAction(o)\n        self._called = False\n        act.triggered.connect(self._cb)\n        act.trigger()\n        self.assert_(self._called)\n\n    def testNewCtor(self):\n        o = QWidget()\n        self._called = False\n        myAction = QAction(\"&Quit\", o, triggered=self._cb)\n        myAction.trigger()\n        self.assert_(self._called)\n\n\nclass SetShortcutTest(UsesQApplication):\n\n    def testSetShortcut(self):\n        # Somehow an exception was leaking from the constructor\n        # and appearing in setShortcut.\n        o = QWidget()\n        action = QAction('aaaa', o)\n        shortcut = 'Ctrl+N'\n        action.setShortcut(shortcut)\n        s2 = action.shortcut()\n        self.assertEqual(s2, shortcut)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qapp_test.py",
    "content": "\n''' Test the presence of qApp Macro'''\n\nimport unittest\n\nfrom PySide.QtGui import *\n\nclass QAppPresence(unittest.TestCase):\n\n    def testQApp(self):\n        #QtGui.qApp variable is instance of QApplication\n        self.assert_(isinstance(qApp, QApplication))\n\ndef main():\n    app = QApplication([])\n    unittest.main()\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "tests/QtGui/qapplication_exit_segfault_test.py",
    "content": "\nimport unittest\nimport sys\n\nfrom PySide.QtGui import QApplication, QPushButton, QWidget, QSpinBox\n\nclass QApplicationDelete(unittest.TestCase):\n    '''Test for segfault when deleting a QApplication before a QWidget'''\n\n    def testQPushButton(self):\n        #QApplication deleted before QPushButton\n        a = QApplication([])\n        b = QPushButton('aaaa')\n        del a\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qapplication_singleton_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtGui import QApplication\n\nclass TestSingleton(unittest.TestCase):\n    def testBasic(self):\n        a = QApplication([])\n        self.assertRaises(RuntimeError, QApplication, [])\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qbrush_test.py",
    "content": "\n'''Test cases for QBrush'''\n\nimport unittest\n\nfrom PySide.QtCore import Qt\nfrom PySide.QtGui import QApplication, QColor, QBrush\n\nfrom helper import UsesQApplication\n\nclass Constructor(UsesQApplication):\n    '''Test case for constructor of QBrush'''\n\n    def testQColor(self):\n        #QBrush(QColor) constructor\n        color = QColor('black')\n        obj = QBrush(color)\n        self.assertEqual(obj.color(), color)\n\n        obj = QBrush(Qt.blue)\n        self.assertEqual(obj.color(), Qt.blue)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qcolor_reduce_test.py",
    "content": "import unittest\nimport pickle\nfrom PySide.QtGui import QColor\n\nclass TestQColor (unittest.TestCase):\n    def reduceColor(self, c):\n        p = pickle.dumps(c)\n        c2 = pickle.loads(p)\n        self.assertEqual(c.spec(), c2.spec())\n        self.assertEqual(c, c2)\n\n    def testReduceEmpty(self):\n        self.reduceColor(QColor())\n\n    def testReduceString(self):\n        self.reduceColor(QColor('gray'))\n\n    def testReduceRGB(self):\n        self.reduceColor(QColor.fromRgbF(0.1, 0.2, 0.3, 0.4))\n\n    def testReduceCMYK(self):\n        self.reduceColor(QColor.fromCmykF(0.1, 0.2, 0.3, 0.4, 0.5))\n\n    def testReduceHsl(self):\n        self.reduceColor(QColor.fromHslF(0.1, 0.2, 0.3, 0.4))\n\n    def testReduceHsv(self):\n        self.reduceColor(QColor.fromHsvF(0.1, 0.2, 0.3, 0.4))\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qcolor_test.py",
    "content": "\nimport unittest\nimport colorsys\nimport PySide\n\nfrom PySide.QtCore import Qt\nfrom PySide.QtGui import QColor\n\n\nclass QColorGetTest(unittest.TestCase):\n\n    def setUp(self):\n        self.color = QColor(20, 40, 60, 80)\n\n    def testGetRgb(self):\n        self.assertEqual(self.color.getRgb(), (20, 40, 60, 80))\n\n    def testGetHslF(self):\n        hls = colorsys.rgb_to_hls(20.0/255, 40.0/255, 60.0/255)\n        hsla = hls[0], hls[2], hls[1], self.color.alphaF()\n        for x, y in zip(self.color.getHslF(), hsla): # Due to rounding problems\n            self.assert_(x - y < 1/100000.0)\n\n    def testGetHsv(self):\n        hsv = colorsys.rgb_to_hsv(20.0/255, 40.0/255, 60.0/255)\n        hsva = int(hsv[0]*360.0), int(hsv[1]*255), int(hsv[2]*256), self.color.alpha()\n        self.assertEqual(self.color.getHsv(), hsva)\n\n    def testGetCmyk(self): # not supported by colorsys\n        self.assertEqual(self.color.getCmyk(), (170, 85, 0, 195, 80))\n\n    def testGetCmykF(self): # not supported by colorsys\n        for x, y in zip(self.color.getCmykF(), (170/255.0, 85/255.0, 0, 195/255.0, 80/255.0)):\n            self.assert_(x - y < 1/10000.0)\n\n\nclass QColorQRgbConstructor(unittest.TestCase):\n    '''QColor(QRgb) constructor'''\n    # Affected by bug #170 - QColor(QVariant) coming before QColor(uint)\n    # in overload sorting\n\n    def testBasic(self):\n        '''QColor(QRgb)'''\n        color = QColor(255, 0, 0)\n        #QRgb format #AARRGGBB\n        rgb = 0x00FF0000\n        self.assertEqual(QColor(rgb), color)\n\n\nclass QColorEqualGlobalColor(unittest.TestCase):\n\n    def testEqualGlobalColor(self):\n        '''QColor == Qt::GlobalColor'''\n        self.assertEqual(QColor(255, 0, 0), Qt.red)\n\n\nclass QColorCopy(unittest.TestCase):\n\n    def testDeepCopy(self):\n        '''QColor deepcopy'''\n\n        from copy import deepcopy\n\n        original = QColor(0, 0, 255)\n        copy = deepcopy([original])[0]\n\n        self.assert_(original is not copy)\n        self.assertEqual(original, copy)\n        del original\n        self.assertEqual(copy, QColor(0, 0, 255))\n\n    def testEmptyCopy(self):\n        from copy import deepcopy\n\n        original = QColor()\n        copy = deepcopy([original])[0]\n        self.assert_(original is not copy)\n        self.assertEqual(original, copy)\n        del original\n        self.assertEqual(copy, QColor())\n\n\nclass QColorRepr(unittest.TestCase):\n    def testReprFunction(self):\n        c = QColor(100, 120, 200)\n        c2 = eval(c.__repr__())\n        self.assertEqual(c, c2)\n\n    def testStrFunction(self):\n        c = QColor('red')\n        c2 = eval(c.__str__())\n        self.assertEqual(c, c2)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qcursor_test.py",
    "content": "'''Test for Bug 630 - Fails to resolve overload for QCursor(QBitmap, QBitmap, int, int)\nhttp://bugs.openbossa.org/show_bug.cgi?id=630\n'''\n\nimport unittest\nfrom PySide.QtGui import QBitmap, QCursor, QPixmap\nfrom helper import UsesQApplication\n\nclass TestQCursor(UsesQApplication):\n    def testQCursorConstructor(self):\n        bmp = QBitmap(16, 16)\n        cursor = QCursor(bmp, bmp, 16, 16)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qdatastream_gui_operators_test.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport unittest\nimport sys\n\nfrom PySide.QtCore import QDataStream, QByteArray, QIODevice, Qt\nfrom PySide.QtGui import QPixmap, QColor\n\nfrom helper import UsesQApplication\n\nclass QPixmapQDatastream(UsesQApplication):\n    '''QDataStream <<>> QPixmap'''\n\n    def setUp(self):\n        super(QPixmapQDatastream, self).setUp()\n        self.source_pixmap = QPixmap(100, 100)\n        self.source_pixmap.fill(Qt.red)\n        self.output_pixmap = QPixmap()\n        self.buffer = QByteArray()\n        self.read_stream = QDataStream(self.buffer, QIODevice.ReadOnly)\n        self.write_stream = QDataStream(self.buffer, QIODevice.WriteOnly)\n\n    def testStream(self):\n        self.write_stream << self.source_pixmap\n\n        self.read_stream >> self.output_pixmap\n\n        image = self.output_pixmap.toImage()\n        pixel = image.pixel(10,10)\n        self.assertEqual(pixel, QColor(Qt.red).rgba())\n        self.assertEqual(self.source_pixmap.toImage(), self.output_pixmap.toImage())\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qdynamic_signal.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import QObject\nfrom PySide.QtGui import QInputDialog\n\nfrom helper import UsesQApplication\n\nclass DynamicSignalTest(UsesQApplication):\n\n    def cb(self, obj):\n        self._called = True\n\n    def testQDialog(self):\n        dlg = QInputDialog()\n        dlg.setInputMode(QInputDialog.TextInput)\n        lst = dlg.children()\n        self.assert_(len(lst))\n        obj = lst[0]\n        self._called = False\n        obj.destroyed[QObject].connect(self.cb)\n        obj = None\n        del dlg\n        self.assert_(self._called)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qfontdialog_test.py",
    "content": "import unittest\nimport sys\n\nfrom PySide import QtGui\nfrom PySide import QtCore\n\nfrom helper import TimedQApplication\n\nclass TestFontDialog(TimedQApplication):\n\n    def testGetFont(self):\n        QtGui.QFontDialog.getFont()\n\n    def testGetFontQDialog(self):\n        QtGui.QFontDialog.getFont(QtGui.QFont(\"FreeSans\",10))\n    \n    def testGetFontQDialogQString(self):\n        QtGui.QFontDialog.getFont(QtGui.QFont(\"FreeSans\",10), None, \"Select font\")\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qfontmetrics_test.py",
    "content": "\n'''Tests for inject codes and modifications on QFontMetrics\n   and QFontMetricsF'''\n\nimport unittest\nfrom PySide.QtGui import QFont, QFontMetrics, QFontMetricsF\nfrom PySide.QtCore import QRect, QRectF, Qt, QSize, QSizeF\nfrom helper import UsesQApplication\n\n\nclass QFontMetricsTest(UsesQApplication):\n    '''Base class for QFontMetrics tests'''\n\n    def setUp(self):\n        super(QFontMetricsTest, self).setUp()\n        self.font = QFont()\n        self.metrics = QFontMetrics(self.font)\n\n    def tearDown(self):\n        del self.metrics\n        del self.font\n        super(QFontMetricsTest, self).tearDown()\n\n\nclass BoundingRectTest(QFontMetricsTest):\n    '''Tests for QFontMetrics.boundingRect inject code'''\n\n    def testIntDefault(self):\n        '''QFontMetrics.boundingRect(int, int, int, int, ...) - default args'''\n        rect = self.metrics.boundingRect(0, 0, 0, 0,\n                                         Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT')\n        self.assertTrue(isinstance(rect, QRect))\n\n    def testIntWithArg(self):\n        '''QFontMetrics.boundingRect(int, int, int, int, ...) - single arg'''\n        rect = self.metrics.boundingRect(0, 0, 0, 0,\n                                         Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 2)\n        self.assertTrue(isinstance(rect, QRect))\n\n    def testIntWithFull(self):\n        '''QFontMetrics.boundingRect(int, int, int, int, ...) - all argss'''\n        rect = self.metrics.boundingRect(0, 0, 0, 0,\n                                         Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 20, [1, 2, 3, 4, 5])\n        self.assertTrue(isinstance(rect, QRect))\n\n    def testIntTypeError(self):\n        '''QFontMetrics.boundingRect(int, int, int, int, ...) - type error'''\n        self.assertRaises(TypeError, self.metrics.boundingRect, 0, 0, 0, 0,\n                                         Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 20, ['aaaa', 'ase'])\n\n    def testQRectDefault(self):\n        '''QFontMetrics.boundingRect(QRect, ...) - default args'''\n        arg = QRect(0, 0, 100, 200)\n        rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT')\n        self.assertTrue(isinstance(rect, QRect))\n\n    def testQRectWithArg(self):\n        '''QFontMetrics.boundingRect(QRect, ...) - only tabstops'''\n        arg = QRect(0, 0, 100, 200)\n        rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 2)\n        self.assertTrue(isinstance(rect, QRect))\n\n    def testQRectWithFull(self):\n        '''QFontMetrics.boundingRect(QRect, ...) - all arguments'''\n        arg = QRect(0, 0, 100, 200)\n        rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 20,\n                                         [1, 2, 3, 4, 5])\n        self.assertTrue(isinstance(rect, QRect))\n\n    def testQRectTypeError(self):\n        '''QFontMetrics.boundingRect(QRect, ...) - type error'''\n        arg = QRect(0, 0, 100, 200)\n        self.assertRaises(TypeError, self.metrics.boundingRect, arg,\n                                         Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 20, ['aaaa', 'ase'])\n\n\nclass SizeTest(QFontMetricsTest):\n    '''Tests for QFontMetrics.size inject code'''\n\n    def testDefault(self):\n        '''QFontMetrics.size - default arguments'''\n        size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine,\n                                 'PySide by INdT')\n        self.assertTrue(isinstance(size, QSize))\n\n    def testWithTabStops(self):\n        '''QFontMetrics.size - only tabstops'''\n        size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine,\n                                 'PySide by INdT', 2)\n        self.assertTrue(isinstance(size, QSize))\n\n    def testFull(self):\n        '''QFontMetrics.size - all arguments'''\n        size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine,\n                                 'PySide by INdT', 2, [1, 2, 3, 4])\n        self.assertTrue(isinstance(size, QSize))\n\n    def testTypeError(self):\n        '''QFontMetrics.size - type error'''\n        self.assertRaises(TypeError, self.metrics.size,\n                                         Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 20, ['aaaa', 'ase'])\n\n\nclass QFontMetricsFTest(UsesQApplication):\n    '''Base class for QFontMetrics tests'''\n\n    def setUp(self):\n        super(QFontMetricsFTest, self).setUp()\n        self.font = QFont()\n        self.metrics = QFontMetricsF(self.font)\n\n    def tearDown(self):\n        del self.metrics\n        del self.font\n        super(QFontMetricsFTest, self).tearDown()\n\n\nclass FBoundingRectTest(QFontMetricsFTest):\n    '''Tests for QFontMetricsF.boundingRect inject code'''\n\n    def testQRectDefault(self):\n        '''QFontMetricsF.boundingRect(QRectF, ...) - default args'''\n        arg = QRectF(0, 0, 100, 200)\n        rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT')\n        self.assertTrue(isinstance(rect, QRectF))\n\n    def testQRectWithArg(self):\n        '''QFontMetricsF.boundingRect(QRectF, ...) - only tabstops'''\n        arg = QRectF(0, 0, 100, 200)\n        rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 2)\n        self.assertTrue(isinstance(rect, QRectF))\n\n    def testQRectWithFull(self):\n        '''QFontMetricsF.boundingRect(QRectF, ...) - all arguments'''\n        arg = QRectF(0, 0, 100, 200)\n        rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 20,\n                                         [1, 2, 3, 4, 5])\n        self.assertTrue(isinstance(rect, QRectF))\n\n    def testQRectTypeError(self):\n        '''QFontMetricsF.boundingRect(QRectF, ...) - type error'''\n        arg = QRectF(0, 0, 100, 200)\n        self.assertRaises(TypeError, self.metrics.boundingRect, arg,\n                                         Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 20, ['aaaa', 'ase'])\n\n\nclass FSizeTest(QFontMetricsFTest):\n    '''Tests for QFontMetricsF.size inject code'''\n\n    def testDefault(self):\n        '''QFontMetricsF.size - default arguments'''\n        size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine,\n                                 'PySide by INdT')\n        self.assertTrue(isinstance(size, QSizeF))\n\n    def testWithTabStops(self):\n        '''QFontMetricsF.size - only tabstops'''\n        size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine,\n                                 'PySide by INdT', 2)\n        self.assertTrue(isinstance(size, QSizeF))\n\n    def testFull(self):\n        '''QFontMetricsF.size - all arguments'''\n        size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine,\n                                 'PySide by INdT', 2, [1, 2, 3, 4])\n        self.assertTrue(isinstance(size, QSizeF))\n\n    def testTypeError(self):\n        '''QFontMetricsF.size - type error'''\n        self.assertRaises(TypeError, self.metrics.size,\n                                         Qt.TextExpandTabs | Qt.AlignLeft,\n                                         'PySide by INdT', 20, ['aaaa', 'ase'])\n\n\nclass QCharTest(QFontMetricsFTest):\n\n    def testBoundingRect(self):\n        retCh = self.metrics.boundingRectChar('a')\n        self.assertEqual(type(retCh), QRectF)\n\n    def testWith(self):\n        retCh = self.metrics.widthChar('a')\n        self.assertTrue(retCh > 0)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qformlayout_test.py",
    "content": "import unittest\nfrom PySide.QtGui import QFormLayout, QWidget\n\nfrom helper import UsesQApplication\n\nclass QFormLayoutTest(UsesQApplication):\n\n    def testGetItemPosition(self):\n        formlayout = QFormLayout()\n        row, role = formlayout.getItemPosition(0)\n        self.assert_(isinstance(row, int))\n        self.assert_(isinstance(role, QFormLayout.ItemRole))\n        self.assertEqual(row, -1)\n\n        widget = QWidget()\n        formlayout.addRow(widget)\n        row, role = formlayout.getItemPosition(0)\n        self.assert_(isinstance(row, int))\n        self.assert_(isinstance(role, QFormLayout.ItemRole))\n        self.assertEqual(row, 0)\n        self.assertEqual(role, QFormLayout.SpanningRole)\n\n    def testGetWidgetPosition(self):\n        formlayout = QFormLayout()\n        widget = QWidget()\n        row, role = formlayout.getWidgetPosition(widget)\n        self.assert_(isinstance(row, int))\n        self.assert_(isinstance(role, QFormLayout.ItemRole))\n        self.assertEqual(row, -1)\n\n        formlayout.addRow(widget)\n        row, role = formlayout.getWidgetPosition(widget)\n        self.assert_(isinstance(row, int))\n        self.assert_(isinstance(role, QFormLayout.ItemRole))\n        self.assertEqual(row, 0)\n        self.assertEqual(role, QFormLayout.SpanningRole)\n\n    def testGetLayoutPosition(self):\n        formlayout = QFormLayout()\n        layout = QFormLayout()\n        row, role = formlayout.getLayoutPosition(layout)\n        self.assert_(isinstance(row, int))\n        self.assert_(isinstance(role, QFormLayout.ItemRole))\n        self.assertEqual(row, -1)\n\n        formlayout.addRow(layout)\n        row, role = formlayout.getLayoutPosition(layout)\n        self.assert_(isinstance(row, int))\n        self.assert_(isinstance(role, QFormLayout.ItemRole))\n        self.assertEqual(row, 0)\n        self.assertEqual(role, QFormLayout.SpanningRole)\n\n\nif __name__ == \"__main__\":\n   unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qgraphicsitem_isblocked_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\n\nfrom PySide import QtCore\nfrom PySide import QtGui\nfrom helper import UsesQApplication\n\nclass Item(QtGui.QGraphicsItem):\n    \n    def __init__(self):\n        QtGui.QGraphicsItem.__init__(self)\n\n    def boundingRect(self):\n        return QtCore.QRectF(0, 0, 100, 100)\n    \n    def paint(self, painter, option, widget):\n        painter.setBrush(QtGui.QColor(255, 255, 255))\n        painter.drawRect(0, 0, 100, 100)\n\n\nclass QGraphicsViewIsBlockedTest(UsesQApplication):\n\n    def testIsBlockedByModalPanel(self):\n        (first, second) = Item().isBlockedByModalPanel()\n        self.assertFalse(first)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qgraphicsitem_test.py",
    "content": "\n''' Test cases related to QGraphicsItem and subclasses'''\n\nimport unittest\n\nfrom PySide.QtGui import QGraphicsScene, QPolygonF, QColor, QBrush\n\nfrom helper import UsesQApplication\n\nclass QColorOnSetBrush(UsesQApplication):\n    '''Test case for passing a QColor directly to setBrush'''\n\n    def setUp(self):\n        #Acquire resources\n        super(QColorOnSetBrush, self).setUp()\n\n        self.scene = QGraphicsScene()\n        poly = QPolygonF()\n        self.item = self.scene.addPolygon(poly)\n        self.color = QColor('black')\n\n    def tearDown(self):\n        #Release resources\n        del self.color\n        del self.item\n        del self.scene\n        super(QColorOnSetBrush, self).tearDown()\n\n    def testQColor(self):\n        #QGraphicsAbstractShapeItem.setBrush(QColor)\n        self.item.setBrush(self.color)\n        self.assertEqual(QBrush(self.color), self.item.brush())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qgraphicsproxywidget_test.py",
    "content": "import unittest\n\nfrom helper import UsesQApplication\nfrom PySide.QtCore import Qt, QTimer\nfrom PySide.QtGui import QLabel, QPainter\nfrom PySide.QtGui import QGraphicsScene, QGraphicsView, QGraphicsItem, QGraphicsProxyWidget\n\nclass QGraphicsProxyWidgetTest(UsesQApplication):\n    def testQGraphicsProxyWidget(self):\n        scene = QGraphicsScene()\n\n        proxy = QGraphicsProxyWidget(None, Qt.Window)\n        widget = QLabel('Widget')\n        proxy.setWidget(widget)\n        proxy.setCacheMode(QGraphicsItem.DeviceCoordinateCache)\n        scene.addItem(proxy)\n        scene.setSceneRect(scene.itemsBoundingRect())\n\n        view = QGraphicsView(scene)\n        view.setRenderHints(QPainter.Antialiasing|QPainter.SmoothPixmapTransform)\n        view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)\n        view.show()\n\n        timer = QTimer.singleShot(100, self.app.quit)\n        self.app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qgraphicsscene_test.py",
    "content": "\n'''Basic test cases for QGraphicsScene'''\n\nimport unittest\nimport gc\n\nfrom PySide.QtCore import QPointF\nfrom PySide.QtGui import QApplication, QPushButton, QPolygonF, QPixmap\nfrom PySide.QtGui import QGraphicsScene, QPainterPath\nfrom PySide.QtGui import QGraphicsEllipseItem, QGraphicsLineItem\nfrom PySide.QtGui import QGraphicsPathItem, QGraphicsPixmapItem\nfrom PySide.QtGui import QGraphicsPolygonItem, QGraphicsRectItem\nfrom PySide.QtGui import QGraphicsSimpleTextItem, QGraphicsTextItem\nfrom PySide.QtGui import QGraphicsProxyWidget\n\nfrom helper import UsesQApplication\n\nclass Constructor(unittest.TestCase):\n    '''QGraphicsScene constructor'''\n\n    def testConstructor(self):\n        #QGraphicsScene constructor\n        obj = QGraphicsScene()\n        self.assertTrue(isinstance(obj, QGraphicsScene))\n\n\nclass ConstructorWithRect(unittest.TestCase):\n    '''QGraphicsScene qrect constructor and related sizes'''\n\n    def setUp(self):\n        #Acquire resources\n        # PyQt4 doesn't accept a QRect as argument to constructor\n        self.scene = QGraphicsScene(0, 200, 150, 175)\n\n    def tearDown(self):\n        #Release resources\n        del self.scene\n\n    def testHeight(self):\n        #QGraphicsScene.height()\n        self.assertEqual(self.scene.height(), 175)\n\n    def testWidth(self):\n        #QGraphicsScene.width()\n        self.assertEqual(self.scene.width(), 150)\n\n\nclass AddItem(UsesQApplication):\n    '''Tests for QGraphicsScene.add*'''\n\n    qapplication = True\n\n    def setUp(self):\n        #Acquire resources\n        super(AddItem, self).setUp()\n        self.scene = QGraphicsScene()\n        # While the scene does not inherits from QWidget, requires\n        # an application to make the internals work.\n\n    def tearDown(self):\n        #Release resources\n        del self.scene\n        super(AddItem, self).tearDown()\n\n    def testEllipse(self):\n        #QGraphicsScene.addEllipse\n        item = self.scene.addEllipse(100, 100, 100, 100)\n        self.assertTrue(isinstance(item, QGraphicsEllipseItem))\n\n    def testLine(self):\n        #QGraphicsScene.addLine\n        item = self.scene.addLine(100, 100, 200, 200)\n        self.assertTrue(isinstance(item, QGraphicsLineItem))\n\n    def testPath(self):\n        #QGraphicsScene.addPath\n        item = self.scene.addPath(QPainterPath())\n        self.assertTrue(isinstance(item, QGraphicsPathItem))\n\n    def testPixmap(self):\n        #QGraphicsScene.addPixmap\n        item = self.scene.addPixmap(QPixmap())\n        self.assertTrue(isinstance(item, QGraphicsPixmapItem))\n\n    def testPolygon(self):\n        #QGraphicsScene.addPolygon\n        points = [QPointF(0, 0), QPointF(100, 100), QPointF(0, 100)]\n        item = self.scene.addPolygon(QPolygonF(points))\n        self.assertTrue(isinstance(item, QGraphicsPolygonItem))\n\n    def testRect(self):\n        #QGraphicsScene.addRect\n        item = self.scene.addRect(100, 100, 100, 100)\n        self.assertTrue(isinstance(item, QGraphicsRectItem))\n\n    def testSimpleText(self):\n        #QGraphicsScene.addSimpleText\n        item = self.scene.addSimpleText('Monty Python 42')\n        self.assertTrue(isinstance(item, QGraphicsSimpleTextItem))\n\n    def testText(self):\n        #QGraphicsScene.addText\n        item = self.scene.addText('Monty Python 42')\n        self.assertTrue(isinstance(item, QGraphicsTextItem))\n\n    def testWidget(self):\n        #QGraphicsScene.addWidget\n        # XXX: printing some X11 error when using under PyQt4\n        item = self.scene.addWidget(QPushButton())\n        self.assertTrue(isinstance(item, QGraphicsProxyWidget))\n\n\nclass ItemRetrieve(UsesQApplication):\n    '''Tests for QGraphicsScene item retrieval methods'''\n\n    qapplication = True\n\n    def setUp(self):\n        #Acquire resources\n        super(ItemRetrieve, self).setUp()\n        self.scene = QGraphicsScene()\n\n        self.topleft = QGraphicsRectItem(0, 0, 100, 100)\n        self.topright = QGraphicsRectItem(100, 0, 100, 100)\n        self.bottomleft = QGraphicsRectItem(0, 100, 100, 100)\n        self.bottomright = QGraphicsRectItem(100, 100, 100, 100)\n\n        self.items = [self.topleft, self.topright, self.bottomleft,\n                        self.bottomright]\n\n        for item in self.items:\n            self.scene.addItem(item)\n\n    def tearDown(self):\n        #Release resources\n        del self.scene\n        super(ItemRetrieve, self).tearDown()\n\n    def testItems(self):\n        #QGraphicsScene.items()\n        items = self.scene.items()\n        for i in items:\n            self.assertTrue(i in self.items)\n\n    def testItemAt(self):\n        #QGraphicsScene.itemAt()\n        self.assertEqual(self.scene.itemAt(50, 50), self.topleft)\n        self.assertEqual(self.scene.itemAt(150, 50), self.topright)\n        self.assertEqual(self.scene.itemAt(50, 150), self.bottomleft)\n        self.assertEqual(self.scene.itemAt(150, 150), self.bottomright)\n\nclass TestGraphicsGroup(UsesQApplication):\n    def testIt(self):\n        scene = QGraphicsScene()\n        i1 = QGraphicsRectItem()\n        scene.addItem(i1)\n        i2 = QGraphicsRectItem(i1)\n        i3 = QGraphicsRectItem()\n        i4 = QGraphicsRectItem()\n        group = scene.createItemGroup((i2, i3, i4))\n        scene.removeItem(i1)\n        del i1 # this shouldn't delete i2\n        self.assertEqual(i2.scene(), scene)\n        scene.destroyItemGroup(group)\n        self.assertRaises(RuntimeError, group.type)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qicon_test.py",
    "content": "\nimport unittest\n\nfrom helper import TimedQApplication\nfrom PySide.QtGui import QIcon\n\n\nclass QIconCtorWithNoneTest(TimedQApplication):\n    '''Test made by seblin, see Bug #944: http://bugs.pyside.org/show_bug.cgi?id=944'''\n\n    def testQIconCtorWithNone(self):\n        icon = QIcon(None)\n        pixmap = icon.pixmap(48, 48)\n        self.app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qimage_test.py",
    "content": "\n'''Test cases for QImage'''\n\nimport unittest\nimport py3kcompat as py3k\nfrom PySide.QtGui import *\nfrom helper import UsesQApplication, adjust_filename\n\nxpm = [\n    \"27 22 206 2\",\n    \"   c None\",\n    \".  c #FEFEFE\",\n    \"+  c #FFFFFF\",\n    \"@  c #F9F9F9\",\n    \"#  c #ECECEC\",\n    \"$  c #D5D5D5\",\n    \"%  c #A0A0A0\",\n    \"&  c #767676\",\n    \"*  c #525252\",\n    \"=  c #484848\",\n    \"-  c #4E4E4E\",\n    \";  c #555555\",\n    \">  c #545454\",\n    \",  c #5A5A5A\",\n    \"'  c #4B4B4B\",\n    \")  c #4A4A4A\",\n    \"!  c #4F4F4F\",\n    \"~  c #585858\",\n    \"{  c #515151\",\n    \"]  c #4C4C4C\",\n    \"^  c #B1B1B1\",\n    \"/  c #FCFCFC\",\n    \"(  c #FDFDFD\",\n    \"_  c #C1C1C1\",\n    \":  c #848484\",\n    \"<  c #616161\",\n    \"[  c #5E5E5E\",\n    \"}  c #CECECE\",\n    \"|  c #E2E2E2\",\n    \"1  c #E4E4E4\",\n    \"2  c #DFDFDF\",\n    \"3  c #D2D2D2\",\n    \"4  c #D8D8D8\",\n    \"5  c #D4D4D4\",\n    \"6  c #E6E6E6\",\n    \"7  c #F1F1F1\",\n    \"8  c #838383\",\n    \"9  c #8E8E8E\",\n    \"0  c #8F8F8F\",\n    \"a  c #CBCBCB\",\n    \"b  c #CCCCCC\",\n    \"c  c #E9E9E9\",\n    \"d  c #F2F2F2\",\n    \"e  c #EDEDED\",\n    \"f  c #B5B5B5\",\n    \"g  c #A6A6A6\",\n    \"h  c #ABABAB\",\n    \"i  c #BBBBBB\",\n    \"j  c #B0B0B0\",\n    \"k  c #EAEAEA\",\n    \"l  c #6C6C6C\",\n    \"m  c #BCBCBC\",\n    \"n  c #F5F5F5\",\n    \"o  c #FAFAFA\",\n    \"p  c #B6B6B6\",\n    \"q  c #F3F3F3\",\n    \"r  c #CFCFCF\",\n    \"s  c #FBFBFB\",\n    \"t  c #CDCDCD\",\n    \"u  c #DDDDDD\",\n    \"v  c #999999\",\n    \"w  c #F0F0F0\",\n    \"x  c #2B2B2B\",\n    \"y  c #C3C3C3\",\n    \"z  c #A4A4A4\",\n    \"A  c #D7D7D7\",\n    \"B  c #E7E7E7\",\n    \"C  c #6E6E6E\",\n    \"D  c #9D9D9D\",\n    \"E  c #BABABA\",\n    \"F  c #AEAEAE\",\n    \"G  c #898989\",\n    \"H  c #646464\",\n    \"I  c #BDBDBD\",\n    \"J  c #CACACA\",\n    \"K  c #2A2A2A\",\n    \"L  c #212121\",\n    \"M  c #B7B7B7\",\n    \"N  c #F4F4F4\",\n    \"O  c #737373\",\n    \"P  c #828282\",\n    \"Q  c #4D4D4D\",\n    \"R  c #000000\",\n    \"S  c #151515\",\n    \"T  c #B2B2B2\",\n    \"U  c #D6D6D6\",\n    \"V  c #D3D3D3\",\n    \"W  c #2F2F2F\",\n    \"X  c #636363\",\n    \"Y  c #A1A1A1\",\n    \"Z  c #BFBFBF\",\n    \"`  c #E0E0E0\",\n    \" . c #6A6A6A\",\n    \".. c #050505\",\n    \"+. c #A3A3A3\",\n    \"@. c #202020\",\n    \"#. c #5F5F5F\",\n    \"$. c #B9B9B9\",\n    \"%. c #C7C7C7\",\n    \"&. c #D0D0D0\",\n    \"*. c #3E3E3E\",\n    \"=. c #666666\",\n    \"-. c #DBDBDB\",\n    \";. c #424242\",\n    \">. c #C2C2C2\",\n    \",. c #1A1A1A\",\n    \"'. c #2C2C2C\",\n    \"). c #F6F6F6\",\n    \"!. c #AAAAAA\",\n    \"~. c #DCDCDC\",\n    \"{. c #2D2D2D\",\n    \"]. c #2E2E2E\",\n    \"^. c #A7A7A7\",\n    \"/. c #656565\",\n    \"(. c #333333\",\n    \"_. c #464646\",\n    \":. c #C4C4C4\",\n    \"<. c #B8B8B8\",\n    \"[. c #292929\",\n    \"}. c #979797\",\n    \"|. c #EFEFEF\",\n    \"1. c #909090\",\n    \"2. c #8A8A8A\",\n    \"3. c #575757\",\n    \"4. c #676767\",\n    \"5. c #C5C5C5\",\n    \"6. c #7A7A7A\",\n    \"7. c #797979\",\n    \"8. c #989898\",\n    \"9. c #EEEEEE\",\n    \"0. c #707070\",\n    \"a. c #C8C8C8\",\n    \"b. c #111111\",\n    \"c. c #AFAFAF\",\n    \"d. c #474747\",\n    \"e. c #565656\",\n    \"f. c #E3E3E3\",\n    \"g. c #494949\",\n    \"h. c #5B5B5B\",\n    \"i. c #222222\",\n    \"j. c #353535\",\n    \"k. c #D9D9D9\",\n    \"l. c #0A0A0A\",\n    \"m. c #858585\",\n    \"n. c #E5E5E5\",\n    \"o. c #0E0E0E\",\n    \"p. c #9A9A9A\",\n    \"q. c #6F6F6F\",\n    \"r. c #868686\",\n    \"s. c #060606\",\n    \"t. c #1E1E1E\",\n    \"u. c #E8E8E8\",\n    \"v. c #A5A5A5\",\n    \"w. c #0D0D0D\",\n    \"x. c #030303\",\n    \"y. c #272727\",\n    \"z. c #131313\",\n    \"A. c #1F1F1F\",\n    \"B. c #757575\",\n    \"C. c #F7F7F7\",\n    \"D. c #414141\",\n    \"E. c #080808\",\n    \"F. c #6B6B6B\",\n    \"G. c #313131\",\n    \"H. c #C0C0C0\",\n    \"I. c #C9C9C9\",\n    \"J. c #0B0B0B\",\n    \"K. c #232323\",\n    \"L. c #434343\",\n    \"M. c #3D3D3D\",\n    \"N. c #282828\",\n    \"O. c #7C7C7C\",\n    \"P. c #252525\",\n    \"Q. c #3A3A3A\",\n    \"R. c #F8F8F8\",\n    \"S. c #1B1B1B\",\n    \"T. c #949494\",\n    \"U. c #3B3B3B\",\n    \"V. c #242424\",\n    \"W. c #383838\",\n    \"X. c #6D6D6D\",\n    \"Y. c #818181\",\n    \"Z. c #939393\",\n    \"`. c #9E9E9E\",\n    \" + c #929292\",\n    \".+ c #7D7D7D\",\n    \"++ c #ADADAD\",\n    \"@+ c #DADADA\",\n    \"#+ c #919191\",\n    \"$+ c #E1E1E1\",\n    \"%+ c #BEBEBE\",\n    \"&+ c #ACACAC\",\n    \"*+ c #9C9C9C\",\n    \"=+ c #B3B3B3\",\n    \"-+ c #808080\",\n    \";+ c #A8A8A8\",\n    \">+ c #393939\",\n    \",+ c #747474\",\n    \"'+ c #7F7F7F\",\n    \")+ c #D1D1D1\",\n    \"!+ c #606060\",\n    \"~+ c #5C5C5C\",\n    \"{+ c #686868\",\n    \"]+ c #7E7E7E\",\n    \"^+ c #787878\",\n    \"/+ c #595959\",\n    \". . . + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / . . + + \",\n    \". ( + _ : < [ & } | 1 2 $ 3 4 5 3 6 7 + + 8 9 + . + . \",\n    \". + 0 9 a ( 3 a b c d e c f g h i g j $ k + l m + . + \",\n    \"+ 2 8 n o p | ( q r s . # t + + + u ^ v e w + x + + + \",\n    \"+ y z . @ A k B 7 n + ( s | p 8 C D 2 E 4 + + F G + . \",\n    \"# H I $ J G K L - M N . 2 O P Q R R S T U s s V W j + \",\n    \"X Y Z @ o ` _ g  ...+.( 4 @.#.m G $.%.7 &.X *.=.-.;.&.\",\n    \"Q >.C ,.'.} e + ).!.k + . + + . ~.{.> ].x f 7 ^./.k (.\",\n    \"_.:.4 @ <.[.}.|.1.2.+ + + >.} 4 B + ( @ _ 3.4.5.6.r 7.\",\n    \"3.8.9.~ 0.+ a.Q b.+ + c.d.#.=.$ |.b #.e.z ^ ; ^. .f.g.\",\n    \"-.h.+ i.S M + # p j.% n 9.5.k.H l.m.V ^.n.o.M + M p.q.\",\n    \"7 r.N s.1.R t.<.|.| u.v.~ w.x.E + s y.z.A.B.C.+ 5 D.q \",\n    \").p.2 E.0.9 F.%.O {._ @.+ + i { [ i.G.H.P I.+ s q.} + \",\n    \").p.6 J.R b.K.L.M.A.! b.g.K [.R M k + N.I + + >.O.+ . \",\n    \").8.9.N.P...R R R R E.t.W n.+ Q.R.6 @.| + . + S.+ + . \",\n    \"n }.w T.U.B.<.i.@ Y + + U.+ c u V.= B B 7 u.W.c + . + \",\n    \"N T.# + }.X.Y.,.8.F.8 Z.[.`. +.+}.4 ++@+O.< ~.+ ( . + \",\n    \"d #+1 + _ ~.u.$+b $.y @+| $+%+I.&+k.h W +.9.+ ( . + . \",\n    \"w 0 |.*+. >.<.=+++++p a.p -+;+5.k.>+,+@ + . . + . + + \",\n    \"q '+9.R.^ I.t b %.I.)+4 $+n.I.,+ .|.+ . . . + . + + + \",\n    \". p !+( + + + + + + E 0. .-+8.f.+ + . . + + . + + + + \",\n    \". ( A ~+{+]+^+l > /+D f.c q . + . . + + . + + + + + + \"\n]\n\nclass QImageTest(UsesQApplication):\n    '''Test case for calling setPixel with float as argument'''\n\n    def testQImageStringBuffer(self):\n        '''Test if the QImage signatures receiving string buffers exist.'''\n        img0 = QImage(adjust_filename('sample.png', __file__))\n\n        # btw let's test the bits() method\n        img1 = QImage(img0.bits(), img0.width(), img0.height(), img0.format())\n        self.assertEqual(img0, img1)\n        img2 = QImage(img0.bits(), img0.width(), img0.height(), img0.bytesPerLine(), img0.format())\n        self.assertEqual(img0, img2)\n\n        ## test scanLine method\n        data1 = img0.scanLine(0)\n        data2 = img1.scanLine(0)\n        self.assertEqual(data1, data2)\n\n        # PySide python 3.x does not support slice yet\n        if not py3k.IS_PY3K:\n            buff = py3k.buffer(img0.bits()[:img0.bytesPerLine()])\n            self.assertEqual(data1, buff)\n            self.assertEqual(data2, buff)\n\n    def testEmptyBuffer(self):\n        img = QImage(py3k.buffer(''), 100, 100, QImage.Format_ARGB32)\n\n    def testEmptyStringAsBuffer(self):\n        img = QImage(py3k.b(''), 100, 100, QImage.Format_ARGB32)\n\n    def testXpmConstructor(self):\n        label = QLabel()\n        img = QImage(xpm)\n        self.assertFalse(img.isNull())\n        self.assertEqual(img.width(), 27)\n        self.assertEqual(img.height(), 22)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qinputcontext_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import Qt\nfrom PySide.QtGui import QPushButton\nfrom helper import UsesQApplication\n\nclass QInputContextTest(UsesQApplication):\n\n    def testSetFocusWidget(self):\n        widget = QPushButton()\n        widget.show()\n\n        context = self.app.inputContext()\n        self.assertEqual(context.focusWidget(), None)\n\n        if not widget.testAttribute(Qt.WA_InputMethodEnabled):\n            widget.setAttribute(Qt.WA_InputMethodEnabled)\n\n        context.setFocusWidget(widget)\n        self.assertEqual(context.focusWidget(), widget)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qinputdialog_get_test.py",
    "content": "import unittest\n\nfrom PySide import QtCore, QtGui\nfrom helper import UsesQApplication, TimedQApplication\n\nclass TestInputDialog(TimedQApplication):\n\n    def testGetDouble(self):\n        self.assertEquals(QtGui.QInputDialog.getDouble(None, \"title\", \"label\"), (0.0, False))\n\n    def testGetInt(self):\n        self.assertEquals(QtGui.QInputDialog.getInt(None, \"title\", \"label\"), (0, False))\n\n    def testGetInteger(self):\n        self.assertEquals(QtGui.QInputDialog.getInteger(None, \"title\", \"label\"), (0, False))\n\n    def testGetItem(self):\n        (item, bool) = QtGui.QInputDialog.getItem(None, \"title\", \"label\", [\"1\", \"2\", \"3\"])\n        self.assertEquals(str(item), \"1\")\n\n    def testGetText(self):\n        (text, bool) = QtGui.QInputDialog.getText(None, \"title\", \"label\")\n        self.assertEquals(str(text),\"\")\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qitemselection_test.py",
    "content": "import unittest\n\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QItemSelection, QStandardItemModel\n\nclass QItemSelectionTest(UsesQApplication):\n    def testLen(self):\n        model = QStandardItemModel(2, 2)\n        model.insertRow(0)\n        model.insertRow(1)\n        model.insertColumn(0)\n        model.insertColumn(1)\n        selection = QItemSelection(model.index(0,0), model.index(1,1))\n        self.assertEqual(len(selection), 1)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qkeysequence_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import Qt\nfrom PySide.QtGui import QKeySequence\n\nfrom helper import UsesQApplication\n\nclass QKeySequenceTest(UsesQApplication):\n\n    def testGetItemOperator(self):\n        # bug #774\n        ks = QKeySequence(Qt.SHIFT, Qt.CTRL, Qt.Key_P, Qt.Key_R)\n        self.assertEqual(ks[0], Qt.SHIFT)\n        self.assertEqual(ks[1], Qt.CTRL)\n        self.assertEqual(ks[2], Qt.Key_P)\n        self.assertEqual(ks[3], Qt.Key_R)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qlayout_ref_test.py",
    "content": "\n'''Test cases for QLayout handling of child widgets references'''\n\nimport unittest\nfrom sys import getrefcount\n\nfrom PySide.QtGui import QHBoxLayout, QVBoxLayout, QGridLayout, QWidget\nfrom PySide.QtGui import QStackedLayout, QFormLayout\nfrom PySide.QtGui import QApplication, QPushButton, QLabel\n\nfrom helper import UsesQApplication\n\nclass SaveReference(UsesQApplication):\n    '''Test case to check if QLayout-derived classes increment the refcount\n    of widgets passed to addWidget()'''\n\n    # Adding here as nose can't see the qapplication attrib we inherit\n    qapplication = True\n\n    def setUp(self):\n        #Acquire resources\n        super(SaveReference, self).setUp()\n        self.widget1 = QPushButton('click me')\n        self.widget2 = QLabel('aaa')\n\n    def tearDown(self):\n        #Release resources\n        del self.widget2\n        del self.widget1\n        super(SaveReference, self).tearDown()\n\n    def checkLayoutReference(self, layout):\n        #Checks the reference cound handling of layout.addWidget\n        self.assertEqual(getrefcount(self.widget1), 2)\n        layout.addWidget(self.widget1)\n        self.assertEqual(getrefcount(self.widget1), 3)\n\n        self.assertEqual(getrefcount(self.widget2), 2)\n        layout.addWidget(self.widget2)\n        self.assertEqual(getrefcount(self.widget2), 3)\n\n        # Check if doesn't mess around with previous widget refcount\n        self.assertEqual(getrefcount(self.widget1), 3)\n\n    def testMoveLayout(self):\n        l = QHBoxLayout()\n        self.assertEqual(getrefcount(self.widget1), 2)\n        l.addWidget(self.widget1)\n        self.assertEqual(getrefcount(self.widget1), 3)\n\n        w = QWidget()\n        w.setLayout(l)\n        self.assertEqual(getrefcount(self.widget1), 3)\n\n\n    def testHBoxReference(self):\n        #QHBoxLayout.addWidget reference count\n        w = QWidget()\n        self.checkLayoutReference(QHBoxLayout(w))\n\n    def testVBoxReference(self):\n        #QVBoxLayout.addWidget reference count\n        w = QWidget()\n        self.checkLayoutReference(QVBoxLayout(w))\n\n    def testGridReference(self):\n        #QGridLayout.addWidget reference count\n        w = QWidget()\n        self.checkLayoutReference(QGridLayout(w))\n\n    def testFormReference(self):\n        #QFormLayout.addWidget reference count\n        w = QWidget()\n        self.checkLayoutReference(QFormLayout(w))\n\n    def testStackedReference(self):\n        #QStackedLayout.addWidget reference count\n        w = QWidget()\n        self.checkLayoutReference(QStackedLayout(w))\n\nclass MultipleAdd(UsesQApplication):\n    '''Test case to check if refcount is incremented only once when multiple\n    calls to addWidget are made with the same widget'''\n\n    qapplication = True\n\n    def setUp(self):\n        #Acquire resources\n        super(MultipleAdd, self).setUp()\n        self.widget = QPushButton('click me')\n        self.win = QWidget()\n        self.layout = QHBoxLayout(self.win)\n\n    def tearDown(self):\n        #Release resources\n        del self.widget\n        del self.layout\n        del self.win\n        super(MultipleAdd, self).tearDown()\n\n    def testRefCount(self):\n        #Multiple QLayout.addWidget calls on the same widget\n        self.assertEqual(getrefcount(self.widget), 2)\n        self.layout.addWidget(self.widget)\n        self.assertEqual(getrefcount(self.widget), 3)\n        self.layout.addWidget(self.widget)\n        self.assertEqual(getrefcount(self.widget), 3)\n        self.layout.addWidget(self.widget)\n        self.assertEqual(getrefcount(self.widget), 3)\n\nclass InternalAdd(UsesQApplication):\n    def testInternalRef(self):\n        mw = QWidget()\n        w = QWidget()\n        ow = QWidget()\n\n        topLayout = QGridLayout()\n\n        # unique reference\n        self.assertEqual(getrefcount(w), 2)\n        self.assertEqual(getrefcount(ow), 2)\n\n        topLayout.addWidget(w, 0, 0)\n        topLayout.addWidget(ow, 1, 0)\n\n        # layout keep the referemce\n        self.assertEqual(getrefcount(w), 3)\n        self.assertEqual(getrefcount(ow), 3)\n\n        mainLayout = QGridLayout()\n\n        mainLayout.addLayout(topLayout, 1, 0, 1, 4)\n\n        # the same reference\n        self.assertEqual(getrefcount(w), 3)\n        self.assertEqual(getrefcount(ow), 3)\n\n        mw.setLayout(mainLayout)\n\n        # now trasfer the ownership to mw\n        self.assertEqual(getrefcount(w), 3)\n        self.assertEqual(getrefcount(ow), 3)\n\n        del mw\n\n        # remove the ref and invalidate the widget\n        self.assertEqual(getrefcount(w), 2)\n        self.assertEqual(getrefcount(ow), 2)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qlayout_test.py",
    "content": "import unittest\nimport sys\n\nfrom helper import UsesQApplication\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass MyLayout(QLayout):\n    def __init__(self, parent=None):\n        QLayout.__init__(self, parent)\n        self._list = []\n\n    def addItem(self, item):\n        self.add(item)\n\n    def addWidget(self, widget):\n        self.add(QWidgetItem(widget))\n\n    def itemAt(self, index):\n        if index < len(self._list):\n            return self._list[index]\n\n        return None\n\n    def count(self):\n        return len(self._list)\n\n    def add(self, item):\n        self._list.append(item)\n\nclass MissingItemAtLayout(QLayout):\n    def __init__(self, parent=None):\n        QLayout.__init__(self, parent)\n        self._list = []\n\n    def addItem(self, item):\n        self.add(item)\n\n    def addWidget(self, widget):\n        self.add(QWidgetItem(widget))\n\n    def count(self):\n        return len(self._list)\n\n    def add(self, item):\n        self._list.append(item)\n\n#Test if a layout implemented in python, the QWidget.setLayout works\n#fine because this implement som layout functions used in glue code of\n#QWidget, then in c++ when call a virtual function this need call the QLayout\n#function implemented in python\n\nclass QLayoutTest(UsesQApplication):\n    def testOwnershipTransfer(self):\n        b = QPushButton(\"teste\")\n        l = MyLayout()\n\n        l.addWidget(b)\n\n        self.assertEqual(sys.getrefcount(b), 2)\n\n        w = QWidget()\n\n        #transfer ref\n        w.setLayout(l)\n\n        self.assertEqual(sys.getrefcount(b), 3)\n\n\n    def testReferenceTransfer(self):\n        b = QPushButton(\"teste\")\n        l = QHBoxLayout()\n\n        # keep ref\n        l.addWidget(b)\n        self.assertEqual(sys.getrefcount(b), 3)\n\n        w = QWidget()\n\n        # transfer ref\n        w.setLayout(l)\n\n        self.assertEqual(sys.getrefcount(b), 3)\n\n        # release ref\n        del w\n\n        self.assertEqual(sys.getrefcount(b), 2)\n\n    def testMissingFunctions(self):\n        w = QWidget()\n        b = QPushButton(\"test\")\n        l = MissingItemAtLayout()\n\n        l.addWidget(b)\n\n        self.assertRaises(RuntimeError, w.setLayout, l)\n\n    def testQFormLayout(self):\n        w = QWidget()\n        formLayout = QFormLayout()\n        spacer = QSpacerItem(100, 30)\n        formLayout.setItem(0, QFormLayout.SpanningRole, spacer)\n        w.setLayout(formLayout)\n        w.show()\n        QTimer.singleShot(10, w.close)\n        self.app.exec_()\n        del w\n        self.assertRaises(RuntimeError, spacer.isEmpty)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qlcdnumber_test.py",
    "content": "import unittest\n\nfrom PySide.QtGui import QApplication, QLCDNumber\n\nclass QLCDNumberOverflow(unittest.TestCase):\n    '''Test case for unhandled overflow on QLCDNumber() numDigits argument (see bug #215).'''\n\n    def setUp(self):\n        self.app = QApplication([])\n\n    def testnumDigitsOverflow(self):\n        # NOTE: PyQt4 raises TypeError, but boost.python raises OverflowError\n        self.assertRaises(OverflowError, QLCDNumber, 840835495615213080)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qlistwidget_test.py",
    "content": "\nimport unittest\n\nimport sys\nfrom PySide import QtGui, QtCore\nfrom helper import UsesQApplication\n\nclass QListWidgetTest(UsesQApplication):\n\n    def populateList(self, lst):\n        o = QtCore.QObject()\n        o.setObjectName(\"obj\")\n\n        item = QtGui.QListWidgetItem(\"item0\")\n        item.setData(QtCore.Qt.UserRole, o)\n        #item._data = o\n        self.assert_(sys.getrefcount(o), 3)\n        self.assert_(sys.getrefcount(item), 2)\n        lst.addItem(item)\n        self.assert_(sys.getrefcount(item), 3)\n\n    def checkCurrentItem(self, lst):\n        item = lst.currentItem()\n        self.assert_(sys.getrefcount(item), 3)\n\n    def checkItemData(self, lst):\n        item = lst.currentItem()\n        o = item.data(QtCore.Qt.UserRole)\n        self.assert_(sys.getrefcount(o), 4)\n        self.assertEqual(o, item._data)\n        self.assert_(sys.getrefcount(o), 2)\n\n    def testConstructorWithParent(self):\n        lst = QtGui.QListWidget()\n        self.populateList(lst)\n        self.checkCurrentItem(lst)\n        i = lst.item(0)\n        self.assert_(sys.getrefcount(i), 3)\n\n        del lst\n        self.assert_(sys.getrefcount(i), 2)\n        del i\n\n    def testIt(self):\n        lst = QtGui.QListWidget()\n        lst.show()\n        slot = lambda : lst.removeItemWidget(lst.currentItem())\n        lst.addItem(QtGui.QListWidgetItem(\"foo\"))\n        QtCore.QTimer.singleShot(0, slot)\n        QtCore.QTimer.singleShot(0, lst.close)\n        self.app.exec_()\n        self.assertEqual(lst.count(), 1)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qlistwidgetitem_test.py",
    "content": "\nimport unittest\n\nfrom PySide import QtGui\n\nfrom helper import UsesQApplication\n\nclass QListWidgetItemConstructor(UsesQApplication):\n\n    def setUp(self):\n        super(QListWidgetItemConstructor, self).setUp()\n        self.widgetList = QtGui.QListWidget()\n\n    def tearDown(self):\n        del self.widgetList\n        super(QListWidgetItemConstructor, self).tearDown()\n\n    def testConstructorWithParent(self):\n        # Bug 235 - QListWidgetItem constructor not saving ownership\n        QtGui.QListWidgetItem(self.widgetList)\n        item = self.widgetList.item(0)\n        self.assertEqual(item.listWidget(), self.widgetList)\n\n    def testConstructorWithNone(self):\n        # Bug 452 - QListWidgetItem() not casting NoneType to null correctly.\n        item = QtGui.QListWidgetItem(None, 123)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qmainwindow_test.py",
    "content": "import unittest\nimport sys\nimport weakref\n\nfrom PySide import QtGui\nfrom PySide import QtCore\n\nfrom helper import UsesQApplication\n\nclass MainWindow(QtGui.QMainWindow):\n    def __init__(self):\n        QtGui.QMainWindow.__init__(self)\n\n        self.createToolbar()\n\n    def createToolbar(self):\n        pointerButton = QtGui.QToolButton()\n        pointerToolbar = self.addToolBar(\"Pointer type\")\n        pointerToolbar.addWidget(pointerButton)\n\nclass MyButton(QtGui.QPushButton):\n    def __init__(self, parent=None):\n        QtGui.QPushButton.__init__(self)\n        self._called = False\n\n    def myCallback(self):\n        self._called = True\n\n\nclass TestMainWindow(UsesQApplication):\n\n    def testCreateToolbar(self):\n        w = MainWindow()\n        w.show()\n        QtCore.QTimer.singleShot(1000, self.app.quit)\n        self.app.exec_()\n\n    def objDel(self, obj):\n        self.app.quit()\n\n    def testRefCountToNull(self):\n        w = QtGui.QMainWindow()\n        c = QtGui.QWidget()\n        self.assertEqual(sys.getrefcount(c), 2)\n        w.setCentralWidget(c)\n        self.assertEqual(sys.getrefcount(c), 3)\n        wr = weakref.ref(c, self.objDel)\n        w.setCentralWidget(None)\n        c = None\n        self.app.exec_()\n\n    def testRefCountToAnother(self):\n        w = QtGui.QMainWindow()\n        c = QtGui.QWidget()\n        self.assertEqual(sys.getrefcount(c), 2)\n        w.setCentralWidget(c)\n        self.assertEqual(sys.getrefcount(c), 3)\n\n        c2 = QtGui.QWidget()\n        w.setCentralWidget(c2)\n        self.assertEqual(sys.getrefcount(c2), 3)\n\n        wr = weakref.ref(c, self.objDel)\n        w.setCentralWidget(None)\n        c = None\n\n        self.app.exec_()\n\n    def testSignalDisconect(self):\n        w = QtGui.QMainWindow()\n        b = MyButton(\"button\")\n        b.clicked.connect(b.myCallback)\n        w.setCentralWidget(b)\n\n        b = MyButton(\"button\")\n        b.clicked.connect(b.myCallback)\n        w.setCentralWidget(b)\n\n        b.click()\n        self.assertEqual(b._called, True)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qmatrix_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QPoint\nfrom PySide.QtGui import QMatrix, QMatrix4x4\n\n\ndef qpointTimesQMatrix(point, matrix):\n    '''As seen in \"QPoint QMatrix::map(const QPoint &p) const\" C++ implementation.'''\n    return QPoint(matrix.m11() * point.x() + matrix.m21() * point.y() + matrix.dx(),\n                  matrix.m12() * point.x() + matrix.m22() * point.y() + matrix.dy())\n\nclass QMatrixTest(unittest.TestCase):\n\n    def testMatrix(self):\n        matrix = QMatrix(11, 12, 21, 22, 100, 200)\n        point = QPoint(3, 3)\n        self.assertEqual(point * matrix, qpointTimesQMatrix(point, matrix))\n\n    def testMatrixWithWrongType(self):\n        matrix = QMatrix(11, 12, 21, 22, 100, 200)\n        point = QPoint(3, 3)\n        self.assertRaises(TypeError, matrix.__mul__, point)\n\n    def testMatrix4x4(self):\n        self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 3.0])\n        self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 'I',\n                                                  4.0, 5.0, 6.0, 7.0,\n                                                  8.0, 9.0, 'N', 11.0,\n                                                  12.0, 'd', 14.0, 'T'])\n\n        my_data = [0.0, 1.0, 2.0, 3.0,\n                   4.0, 5.0, 6.0, 7.0,\n                   8.0, 9.0, 10.0, 11.0,\n                   12.0, 13.0, 14.0, 15.0]\n        my_datac = [0.0, 4.0, 8.0, 12.0,\n                    1.0, 5.0, 9.0, 13.0,\n                    2.0, 6.0, 10.0, 14.0,\n                    3.0, 7.0, 11.0, 15.0]\n\n        m = QMatrix4x4(my_data)\n        d = m.data()\n        self.assert_(my_datac, d)\n\n        d = m.copyDataTo()\n        self.assert_(my_data == list(d))\n\n    def testMatrixMapping(self):\n        m = QMatrix(1.0, 2.0, 1.0, 3.0, 100.0, 200.0)\n        res = m.map(5, 5)\n        self.assertAlmostEqual(res[0], 5 * 1.0 + 5 * 1.0 + 100.0)\n        self.assertAlmostEqual(res[1], 5 * 2.0 + 5 * 3.0 + 200.0)\n        res = m.map(5.0, 5.0)\n        self.assertAlmostEqual(res[0], 5.0 * 1.0 + 5.0 * 1.0 + 100.0)\n        self.assertAlmostEqual(res[1], 5.0 * 2.0 + 5.0 * 3.0 + 200.0)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qmenu_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtGui import QMenu, QKeySequence, QIcon\nfrom PySide.QtCore import SLOT\n\nfrom helper import UsesQApplication\n\nclass QMenuAddAction(UsesQApplication):\n\n    def setUp(self):\n        super(QMenuAddAction, self).setUp()\n        self.menu = QMenu()\n\n    def tearDown(self):\n        del self.menu\n        super(QMenuAddAction, self).tearDown()\n\n    def testAddActionWithoutKeySequenceCallable(self):\n        # bug #280\n        action = self.menu.addAction(self.app.tr('aaa'), lambda : 1)\n\n    def testAddActionKeySequenceCallable(self):\n        # bug #228\n        action = self.menu.addAction(self.app.tr('aaa'), lambda : 1,\n                                    QKeySequence(self.app.tr('Ctrl+O')))\n\n    def testAddActionKeySequenceSlot(self):\n        action = self.menu.addAction('Quit', self.app, SLOT('quit()'),\n                                    QKeySequence('Ctrl+O'))\n\nclass QMenuAddActionWithIcon(UsesQApplication):\n\n    def setUp(self):\n        super(QMenuAddActionWithIcon, self).setUp()\n        self.menu = QMenu()\n        self.icon = QIcon()\n\n    def tearDown(self):\n        del self.menu\n        del self.icon\n        super(QMenuAddActionWithIcon, self).tearDown()\n\n    def testAddActionWithoutKeySequenceCallable(self):\n        # bug #280\n        action = self.menu.addAction(self.icon, self.app.tr('aaa'), lambda : 1)\n\n    def testAddActionKeySequenceCallable(self):\n        # bug #228\n        action = self.menu.addAction(self.icon, self.app.tr('aaa'), lambda : 1,\n                                    QKeySequence(self.app.tr('Ctrl+O')))\n\n    def testAddActionKeySequenceSlot(self):\n        action = self.menu.addAction(self.icon, 'Quit', self.app, SLOT('quit()'),\n                                    QKeySequence('Ctrl+O'))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qmenuadd_test.py",
    "content": "# -*- coding: utf-8 -*-\n\n''' Test the QMenu.addAction() method'''\n\nimport unittest\nimport sys\n\nfrom PySide import QtGui\n\nfrom helper import UsesQApplication\n\nclass QMenuAddAction(UsesQApplication):\n\n    def openFile(self, *args):\n        self.arg = args\n\n    def testQMenuAddAction(self):\n        fileMenu = QtGui.QMenu(\"&File\")\n\n        addNewAction = fileMenu.addAction(\"&Open...\", self.openFile)\n        addNewAction.trigger()\n        self.assertEquals(self.arg, ())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qobject_mi_test.py",
    "content": "﻿'''Test cases for multiple inheritance from 2 QObjects'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject\nfrom PySide.QtGui import *\n\nfrom helper import UsesQApplication\n\nclass WidgetValidator(QWidget, QIntValidator):\n    def __init__(self, parent=None):\n        QWidget.__init__(self, parent)\n        QIntValidator.__init__(self, parent)\n\n\nclass DoubleQObjectInheritanceTest(UsesQApplication):\n\n    def testDouble(self):\n        '''Double inheritance from QObject classes'''\n\n        obj = WidgetValidator()\n\n        #QObject methods\n        obj.setObjectName('aaaa')\n        self.assertEqual(obj.objectName(), 'aaaa')\n\n        #QWidget methods\n        obj.setVisible(False)\n        self.assertFalse(obj.isVisible())\n\n        #QIntValidator methods\n        state, string, number = obj.validate('aaaa', 0)\n        self.assertEqual(state, QValidator.Invalid)\n        state, string, number = obj.validate('33', 0)\n        self.assertEqual(state, QValidator.Acceptable)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qpainter_test.py",
    "content": "import unittest\n\nfrom PySide.QtGui import QPainter, QLinearGradient\nfrom PySide.QtCore import QLine, QLineF, QPoint, QPointF, QRect, QRectF, Qt\n\nclass QPainterDrawText(unittest.TestCase):\n\n    def setUp(self):\n        self.painter = QPainter()\n        self.text = 'teste!'\n\n    def tearDown(self):\n        del self.text\n        del self.painter\n\n    def testDrawText(self):\n        # bug #254\n        rect = self.painter.drawText(100, 100, 100, 100,\n                                     Qt.AlignCenter | Qt.TextWordWrap,\n                                     self.text)\n        self.assert_(isinstance(rect, QRect))\n\n    def testDrawTextWithRect(self):\n        # bug #225\n        rect = QRect(100, 100, 100, 100)\n        newRect = self.painter.drawText(rect, Qt.AlignCenter | Qt.TextWordWrap,\n                                        self.text)\n\n        self.assert_(isinstance(newRect, QRect))\n\n    def testDrawTextWithRectF(self):\n        '''QPainter.drawText(QRectF, ... ,QRectF*) inject code'''\n        rect = QRectF(100, 52.3, 100, 100)\n        newRect = self.painter.drawText(rect, Qt.AlignCenter | Qt.TextWordWrap,\n                                        self.text)\n\n        self.assert_(isinstance(newRect, QRectF))\n\n    def testDrawOverloads(self):\n        '''Calls QPainter.drawLines overloads, if something is\n           wrong Exception and chaos ensues. Bug #395'''\n        self.painter.drawLines([QLine(QPoint(0,0), QPoint(1,1))])\n        self.painter.drawLines([QPoint(0,0), QPoint(1,1)])\n        self.painter.drawLines([QPointF(0,0), QPointF(1,1)])\n        self.painter.drawLines([QLineF(QPointF(0,0), QPointF(1,1))])\n        self.painter.drawPoints([QPoint(0,0), QPoint(1,1)])\n        self.painter.drawPoints([QPointF(0,0), QPointF(1,1)])\n        self.painter.drawConvexPolygon([QPointF(10.0, 80.0),\n                                        QPointF(20.0, 10.0),\n                                        QPointF(80.0, 30.0),\n                                        QPointF(90.0, 70.0)])\n        self.painter.drawConvexPolygon([QPoint(10.0, 80.0),\n                                        QPoint(20.0, 10.0),\n                                        QPoint(80.0, 30.0),\n                                        QPoint(90.0, 70.0)])\n        self.painter.drawPolygon([QPointF(10.0, 80.0),\n                                  QPointF(20.0, 10.0),\n                                  QPointF(80.0, 30.0),\n                                  QPointF(90.0, 70.0)])\n        self.painter.drawPolygon([QPoint(10.0, 80.0),\n                                  QPoint(20.0, 10.0),\n                                  QPoint(80.0, 30.0),\n                                  QPoint(90.0, 70.0)])\n        self.painter.drawPolyline([QPointF(10.0, 80.0),\n                                   QPointF(20.0, 10.0),\n                                   QPointF(80.0, 30.0),\n                                   QPointF(90.0, 70.0)])\n        self.painter.drawPolyline([QPoint(10.0, 80.0),\n                                   QPoint(20.0, 10.0),\n                                   QPoint(80.0, 30.0),\n                                   QPoint(90.0, 70.0)])\n\nclass SetBrushWithOtherArgs(unittest.TestCase):\n    '''Using qpainter.setBrush with args other than QBrush'''\n\n    def testSetBrushGradient(self):\n        painter = QPainter()\n        gradient = QLinearGradient(0, 0, 0, 0)\n        painter.setBrush(gradient)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qpen_test.py",
    "content": "\nimport unittest\nfrom helper import UsesQApplication\n\nfrom PySide.QtCore import Qt, QTimer\nfrom PySide.QtGui import QPen, QPainter, QWidget\n\nclass Painting(QWidget):\n    def __init__(self):\n        QWidget.__init__(self)\n        self.penFromEnum = None\n        self.penFromInteger = None\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setPen(Qt.NoPen)\n        self.penFromEnum = painter.pen()\n        painter.setPen(int(Qt.NoPen))\n        self.penFromInteger = painter.pen()\n\n\nclass QPenTest(UsesQApplication):\n\n    def testCtorWithCreatedEnums(self):\n        '''A simple case of QPen creation using created enums.'''\n        width = 0\n        style = Qt.PenStyle(0)\n        cap = Qt.PenCapStyle(0)\n        join = Qt.PenJoinStyle(0)\n        pen = QPen(Qt.blue, width, style, cap, join)\n\n    def testSetPenWithPenStyleEnum(self):\n        '''Calls QPainter.setPen with both enum and integer. Bug #511.'''\n        w = Painting()\n        w.show()\n        QTimer.singleShot(1000, self.app.quit)\n        self.app.exec_()\n        self.assertEqual(w.penFromEnum.style(), Qt.NoPen)\n        self.assertEqual(w.penFromInteger.style(), Qt.SolidLine)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qpicture_test.py",
    "content": "import unittest\n\nimport os\nfrom helper import UsesQApplication\nfrom PySide.QtCore import QTimer\nfrom PySide.QtGui import QPicture, QPainter, QWidget\n\nclass MyWidget(QWidget):\n    def paintEvent(self, e):\n        p = QPainter(self)\n        p.drawPicture(0, 0, self._picture)\n        self._app.quit()\n\nclass QPictureTest(UsesQApplication):\n    def testFromData(self):\n        picture = QPicture()\n        painter = QPainter()\n        painter.begin(picture)\n        painter.drawEllipse(10,20, 80,70)\n        painter.end()\n\n        data = picture.data()\n        picture2 = QPicture()\n        picture2.setData(data)\n\n        self.assertEqual(picture2.data(), picture.data())\n\n        w = MyWidget()\n        w._picture = picture2\n        w._app = self.app\n\n        QTimer.singleShot(300, w.show)\n        self.app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qpixmap_constructor.py",
    "content": "#!/usr/bin/python\n\nimport unittest\n\nfrom PySide.QtGui import QLabel, QPixmap\n\nfrom helper import UsesQApplication\n\nxpm = [\n    \"27 22 206 2\",\n    \"  \tc None\",\n    \". \tc #FEFEFE\",\n    \"+ \tc #FFFFFF\",\n    \"@ \tc #F9F9F9\",\n    \"# \tc #ECECEC\",\n    \"$ \tc #D5D5D5\",\n    \"% \tc #A0A0A0\",\n    \"& \tc #767676\",\n    \"* \tc #525252\",\n    \"= \tc #484848\",\n    \"- \tc #4E4E4E\",\n    \"; \tc #555555\",\n    \"> \tc #545454\",\n    \", \tc #5A5A5A\",\n    \"' \tc #4B4B4B\",\n    \") \tc #4A4A4A\",\n    \"! \tc #4F4F4F\",\n    \"~ \tc #585858\",\n    \"{ \tc #515151\",\n    \"] \tc #4C4C4C\",\n    \"^ \tc #B1B1B1\",\n    \"/ \tc #FCFCFC\",\n    \"( \tc #FDFDFD\",\n    \"_ \tc #C1C1C1\",\n    \": \tc #848484\",\n    \"< \tc #616161\",\n    \"[ \tc #5E5E5E\",\n    \"} \tc #CECECE\",\n    \"| \tc #E2E2E2\",\n    \"1 \tc #E4E4E4\",\n    \"2 \tc #DFDFDF\",\n    \"3 \tc #D2D2D2\",\n    \"4 \tc #D8D8D8\",\n    \"5 \tc #D4D4D4\",\n    \"6 \tc #E6E6E6\",\n    \"7 \tc #F1F1F1\",\n    \"8 \tc #838383\",\n    \"9 \tc #8E8E8E\",\n    \"0 \tc #8F8F8F\",\n    \"a \tc #CBCBCB\",\n    \"b \tc #CCCCCC\",\n    \"c \tc #E9E9E9\",\n    \"d \tc #F2F2F2\",\n    \"e \tc #EDEDED\",\n    \"f \tc #B5B5B5\",\n    \"g \tc #A6A6A6\",\n    \"h \tc #ABABAB\",\n    \"i \tc #BBBBBB\",\n    \"j \tc #B0B0B0\",\n    \"k \tc #EAEAEA\",\n    \"l \tc #6C6C6C\",\n    \"m \tc #BCBCBC\",\n    \"n \tc #F5F5F5\",\n    \"o \tc #FAFAFA\",\n    \"p \tc #B6B6B6\",\n    \"q \tc #F3F3F3\",\n    \"r \tc #CFCFCF\",\n    \"s \tc #FBFBFB\",\n    \"t \tc #CDCDCD\",\n    \"u \tc #DDDDDD\",\n    \"v \tc #999999\",\n    \"w \tc #F0F0F0\",\n    \"x \tc #2B2B2B\",\n    \"y \tc #C3C3C3\",\n    \"z \tc #A4A4A4\",\n    \"A \tc #D7D7D7\",\n    \"B \tc #E7E7E7\",\n    \"C \tc #6E6E6E\",\n    \"D \tc #9D9D9D\",\n    \"E \tc #BABABA\",\n    \"F \tc #AEAEAE\",\n    \"G \tc #898989\",\n    \"H \tc #646464\",\n    \"I \tc #BDBDBD\",\n    \"J \tc #CACACA\",\n    \"K \tc #2A2A2A\",\n    \"L \tc #212121\",\n    \"M \tc #B7B7B7\",\n    \"N \tc #F4F4F4\",\n    \"O \tc #737373\",\n    \"P \tc #828282\",\n    \"Q \tc #4D4D4D\",\n    \"R \tc #000000\",\n    \"S \tc #151515\",\n    \"T \tc #B2B2B2\",\n    \"U \tc #D6D6D6\",\n    \"V \tc #D3D3D3\",\n    \"W \tc #2F2F2F\",\n    \"X \tc #636363\",\n    \"Y \tc #A1A1A1\",\n    \"Z \tc #BFBFBF\",\n    \"` \tc #E0E0E0\",\n    \" .\tc #6A6A6A\",\n    \"..\tc #050505\",\n    \"+.\tc #A3A3A3\",\n    \"@.\tc #202020\",\n    \"#.\tc #5F5F5F\",\n    \"$.\tc #B9B9B9\",\n    \"%.\tc #C7C7C7\",\n    \"&.\tc #D0D0D0\",\n    \"*.\tc #3E3E3E\",\n    \"=.\tc #666666\",\n    \"-.\tc #DBDBDB\",\n    \";.\tc #424242\",\n    \">.\tc #C2C2C2\",\n    \",.\tc #1A1A1A\",\n    \"'.\tc #2C2C2C\",\n    \").\tc #F6F6F6\",\n    \"!.\tc #AAAAAA\",\n    \"~.\tc #DCDCDC\",\n    \"{.\tc #2D2D2D\",\n    \"].\tc #2E2E2E\",\n    \"^.\tc #A7A7A7\",\n    \"/.\tc #656565\",\n    \"(.\tc #333333\",\n    \"_.\tc #464646\",\n    \":.\tc #C4C4C4\",\n    \"<.\tc #B8B8B8\",\n    \"[.\tc #292929\",\n    \"}.\tc #979797\",\n    \"|.\tc #EFEFEF\",\n    \"1.\tc #909090\",\n    \"2.\tc #8A8A8A\",\n    \"3.\tc #575757\",\n    \"4.\tc #676767\",\n    \"5.\tc #C5C5C5\",\n    \"6.\tc #7A7A7A\",\n    \"7.\tc #797979\",\n    \"8.\tc #989898\",\n    \"9.\tc #EEEEEE\",\n    \"0.\tc #707070\",\n    \"a.\tc #C8C8C8\",\n    \"b.\tc #111111\",\n    \"c.\tc #AFAFAF\",\n    \"d.\tc #474747\",\n    \"e.\tc #565656\",\n    \"f.\tc #E3E3E3\",\n    \"g.\tc #494949\",\n    \"h.\tc #5B5B5B\",\n    \"i.\tc #222222\",\n    \"j.\tc #353535\",\n    \"k.\tc #D9D9D9\",\n    \"l.\tc #0A0A0A\",\n    \"m.\tc #858585\",\n    \"n.\tc #E5E5E5\",\n    \"o.\tc #0E0E0E\",\n    \"p.\tc #9A9A9A\",\n    \"q.\tc #6F6F6F\",\n    \"r.\tc #868686\",\n    \"s.\tc #060606\",\n    \"t.\tc #1E1E1E\",\n    \"u.\tc #E8E8E8\",\n    \"v.\tc #A5A5A5\",\n    \"w.\tc #0D0D0D\",\n    \"x.\tc #030303\",\n    \"y.\tc #272727\",\n    \"z.\tc #131313\",\n    \"A.\tc #1F1F1F\",\n    \"B.\tc #757575\",\n    \"C.\tc #F7F7F7\",\n    \"D.\tc #414141\",\n    \"E.\tc #080808\",\n    \"F.\tc #6B6B6B\",\n    \"G.\tc #313131\",\n    \"H.\tc #C0C0C0\",\n    \"I.\tc #C9C9C9\",\n    \"J.\tc #0B0B0B\",\n    \"K.\tc #232323\",\n    \"L.\tc #434343\",\n    \"M.\tc #3D3D3D\",\n    \"N.\tc #282828\",\n    \"O.\tc #7C7C7C\",\n    \"P.\tc #252525\",\n    \"Q.\tc #3A3A3A\",\n    \"R.\tc #F8F8F8\",\n    \"S.\tc #1B1B1B\",\n    \"T.\tc #949494\",\n    \"U.\tc #3B3B3B\",\n    \"V.\tc #242424\",\n    \"W.\tc #383838\",\n    \"X.\tc #6D6D6D\",\n    \"Y.\tc #818181\",\n    \"Z.\tc #939393\",\n    \"`.\tc #9E9E9E\",\n    \" +\tc #929292\",\n    \".+\tc #7D7D7D\",\n    \"++\tc #ADADAD\",\n    \"@+\tc #DADADA\",\n    \"#+\tc #919191\",\n    \"$+\tc #E1E1E1\",\n    \"%+\tc #BEBEBE\",\n    \"&+\tc #ACACAC\",\n    \"*+\tc #9C9C9C\",\n    \"=+\tc #B3B3B3\",\n    \"-+\tc #808080\",\n    \";+\tc #A8A8A8\",\n    \">+\tc #393939\",\n    \",+\tc #747474\",\n    \"'+\tc #7F7F7F\",\n    \")+\tc #D1D1D1\",\n    \"!+\tc #606060\",\n    \"~+\tc #5C5C5C\",\n    \"{+\tc #686868\",\n    \"]+\tc #7E7E7E\",\n    \"^+\tc #787878\",\n    \"/+\tc #595959\",\n    \". . . + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / . . + + \",\n    \". ( + _ : < [ & } | 1 2 $ 3 4 5 3 6 7 + + 8 9 + . + . \",\n    \". + 0 9 a ( 3 a b c d e c f g h i g j $ k + l m + . + \",\n    \"+ 2 8 n o p | ( q r s . # t + + + u ^ v e w + x + + + \",\n    \"+ y z . @ A k B 7 n + ( s | p 8 C D 2 E 4 + + F G + . \",\n    \"# H I $ J G K L - M N . 2 O P Q R R S T U s s V W j + \",\n    \"X Y Z @ o ` _ g  ...+.( 4 @.#.m G $.%.7 &.X *.=.-.;.&.\",\n    \"Q >.C ,.'.} e + ).!.k + . + + . ~.{.> ].x f 7 ^./.k (.\",\n    \"_.:.4 @ <.[.}.|.1.2.+ + + >.} 4 B + ( @ _ 3.4.5.6.r 7.\",\n    \"3.8.9.~ 0.+ a.Q b.+ + c.d.#.=.$ |.b #.e.z ^ ; ^. .f.g.\",\n    \"-.h.+ i.S M + # p j.% n 9.5.k.H l.m.V ^.n.o.M + M p.q.\",\n    \"7 r.N s.1.R t.<.|.| u.v.~ w.x.E + s y.z.A.B.C.+ 5 D.q \",\n    \").p.2 E.0.9 F.%.O {._ @.+ + i { [ i.G.H.P I.+ s q.} + \",\n    \").p.6 J.R b.K.L.M.A.! b.g.K [.R M k + N.I + + >.O.+ . \",\n    \").8.9.N.P...R R R R E.t.W n.+ Q.R.6 @.| + . + S.+ + . \",\n    \"n }.w T.U.B.<.i.@ Y + + U.+ c u V.= B B 7 u.W.c + . + \",\n    \"N T.# + }.X.Y.,.8.F.8 Z.[.`. +.+}.4 ++@+O.< ~.+ ( . + \",\n    \"d #+1 + _ ~.u.$+b $.y @+| $+%+I.&+k.h W +.9.+ ( . + . \",\n    \"w 0 |.*+. >.<.=+++++p a.p -+;+5.k.>+,+@ + . . + . + + \",\n    \"q '+9.R.^ I.t b %.I.)+4 $+n.I.,+ .|.+ . . . + . + + + \",\n    \". p !+( + + + + + + E 0. .-+8.f.+ + . . + + . + + + + \",\n    \". ( A ~+{+]+^+l > /+D f.c q . + . . + + . + + + + + + \"\n]\n\nclass QStringSequenceTest(UsesQApplication):\n    def testQPixmapConstructor(self):\n        label = QLabel()\n        pixmap1 = QPixmap(xpm)\n        self.assertFalse(pixmap1.isNull())\n        self.assertEqual(pixmap1.width(), 27)\n        self.assertEqual(pixmap1.height(), 22)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qpixmap_test.py",
    "content": "import unittest\n\nimport os\nfrom helper import UsesQApplication\nfrom PySide.QtGui import *\nfrom PySide.QtCore import *\n\nclass QPixmapTest(UsesQApplication):\n    def testQVariantConstructor(self):\n        obj = QObject()\n        pixmap = QPixmap()\n        obj.setProperty('foo', pixmap)\n        self.assertEqual(type(obj.property('foo')), QPixmap)\n\n    def testQSizeConstructor(self):\n        pixmap = QPixmap(QSize(10,20))\n        self.assert_(pixmap.size().height(), 20)\n\n    def testQStringConstructor(self):\n        pixmap = QPixmap(\"Testing!\")\n\n    def testQPixmapLoadFromDataWithQFile(self):\n        f = QFile(os.path.join(os.path.dirname(__file__), 'sample.png'))\n        self.assert_(f.open(QIODevice.ReadOnly))\n        data = f.read(f.size())\n        f.close()\n        pixmap = QPixmap()\n        self.assert_(pixmap.loadFromData(data))\n\n    def testQPixmapLoadFromDataWithPython(self):\n        data = open(os.path.join(os.path.dirname(__file__),'sample.png'),'rb').read()\n        pixmap = QPixmap()\n        self.assert_(pixmap.loadFromData(data))\n\n\nclass QPixmapToImage(UsesQApplication):\n\n    def testFilledImage(self):\n        '''QPixmap.fill + toImage + image.pixel'''\n        pixmap = QPixmap(100, 200)\n        pixmap.fill(Qt.red) # Default Qt.white\n\n        self.assertEqual(pixmap.height(), 200)\n        self.assertEqual(pixmap.width(), 100)\n\n        image = pixmap.toImage()\n\n        self.assertEqual(image.height(), 200)\n        self.assertEqual(image.width(), 100)\n\n        pixel = image.pixel(10,10)\n        self.assertEqual(pixel, QColor(Qt.red).rgba())\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qpixmapcache_test.py",
    "content": "import unittest\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QPixmapCache, QPixmap\n\n\nclass QPixmapCacheTest(UsesQApplication):\n\n    def testWithString(self):\n        pm1 = QPixmap()\n        ok = QPixmapCache.find('img', pm1)\n        self.assertFalse(ok)\n\n        self.assertEqual(QPixmapCache.find('img'), None)\n\n        pm2 = QPixmap()\n        ok = QPixmapCache.insert('img', pm2)\n        self.assertTrue(ok)\n\n        pm3 = QPixmap()\n        ok = QPixmapCache.find('img', pm3)\n        self.assertTrue(ok)\n        b1 = QPixmapCache.find('img').toImage().bits()\n        b2 = pm3.toImage().bits()\n        self.assertEqual(QPixmapCache.find('img').toImage().bits(), pm3.toImage().bits())\n\n    def testWithKey(self):\n        pm1 = QPixmap()\n        ok = QPixmapCache.find(QPixmapCache.Key(), pm1)\n        self.assertFalse(ok)\n\n        self.assertEqual(QPixmapCache.find(QPixmapCache.Key()), None)\n\n        pm2 = QPixmap()\n        key = QPixmapCache.insert(pm2)\n\n        pm3 = QPixmap()\n        ok = QPixmapCache.find(key, pm3)\n        self.assertTrue(ok)\n\n        self.assertEqual(QPixmapCache.find(key).toImage().bits(), pm3.toImage().bits())\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qpolygonf_test.py",
    "content": "\nimport unittest\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass QPolygonFNotIterableTest(unittest.TestCase):\n    \"\"\"Test if a QPolygonF is iterable\"\"\"\n    def testIt(self):\n        p = QPolygonF(4)\n        self.assertEqual(len(p), 4)\n\n        for i in range(0, 4):\n            p[i] = QPointF(float(i), float(i))\n\n        i = 0\n        for point in p:\n            self.assertEqual(int(point.x()), i)\n            self.assertEqual(int(point.y()), i)\n            i += 1;\n\n    def testPolygonShiftOperators(self):\n        p = QPolygon()\n        self.assertEqual(len(p), 0)\n        p << QPoint(10, 20) << QPoint(20, 30) << [QPoint(20, 30), QPoint(40, 50)]\n        self.assertEqual(len(p), 4)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qpushbutton_test.py",
    "content": "import unittest\n\nfrom helper import UsesQApplication\nfrom PySide.QtGui import QPushButton, QMenu, QWidget\nfrom PySide.QtCore import QTimer\n\nclass MyWidget(QWidget):\n    def __init__(self):\n        QWidget.__init__(self)\n\n        m = QMenu(self)\n        b = QPushButton(\"Hello\", self)\n        b.setMenu(m)\n\n\nclass QPushButtonTest(UsesQApplication):\n    def createMenu(self, button):\n        m = QMenu()\n        button.setMenu(m)\n\n    def testSetMenu(self):\n        w = MyWidget()\n        w.show()\n\n        timer = QTimer.singleShot(100, self.app.quit)\n        self.app.exec_()\n\n    def buttonCb(self, checked):\n        self._clicked = True\n\n    def testBoolinSignal(self):\n        b = QPushButton()\n        b.setCheckable(True)\n        self._clicked = False\n        b.toggled[bool].connect(self.buttonCb)\n        b.toggle()\n        self.assert_(self._clicked)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qradialgradient_test.py",
    "content": "import unittest\n\nfrom PySide.QtGui import QRadialGradient\nfrom PySide.QtCore import QPointF\n\nclass QRadialGradientConstructor(unittest.TestCase):\n    def _compare(self, qptf, tpl):\n        self.assertEqual((qptf.x(), qptf.y()), tpl)\n\n    def _assertValues(self, grad):\n        self._compare(grad.center(), (1.0, 2.0))\n        self._compare(grad.focalPoint(), (3.0, 4.0))\n        self.assertEqual(grad.radius(), 5.0)\n\n    def testAllInt(self):\n        grad = QRadialGradient(1, 2, 5, 3, 4)\n        self._assertValues(grad)\n\n    def testQPointF(self):\n        grad = QRadialGradient(QPointF(1, 2), 5, QPointF(3, 4))\n        self._assertValues(grad)\n\n    def testSetQPointF(self):\n        grad = QRadialGradient()\n        grad.setCenter(QPointF(1, 2))\n        self._compare(grad.center(), (1.0, 2.0))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qregion_test.py",
    "content": "import unittest\nimport sys\n\nfrom PySide.QtGui import QRegion\nfrom PySide.QtCore import QPoint\nfrom helper import UsesQApplication\n\nclass QRegionTest(UsesQApplication):\n\n    def testFunctionUnit(self):\n        r = QRegion(0, 0, 10, 10)\n        r2 = QRegion(5, 5, 10, 10)\n \n        ru = r.united(r2)\n        self.assert_(ru.contains(QPoint(0,0)))\n        self.assert_(ru.contains(QPoint(5,5)))\n        self.assert_(ru.contains(QPoint(10,10)))\n        self.assert_(ru.contains(QPoint(14,14)))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qshortcut_test.py",
    "content": "# -*- coding: utf-8 -*-\n\n''' Test the QShortcut constructor'''\n\nimport unittest\nimport sys\n\nfrom PySide import QtGui, QtCore\n\nclass Foo(QtGui.QWidget):\n    def __init__(self):\n        QtGui.QWidget.__init__(self)\n        self.ok = False\n        self.copy = False\n\n    def slot_of_foo(self):\n        self.ok = True\n\n    def slot_of_copy(self):\n        self.copy = True\n\nclass MyShortcut(QtGui.QShortcut):\n    def __init__(self, keys, wdg, slot):\n        QtGui.QShortcut.__init__(self, keys, wdg, slot)\n\n    def emit_signal(self):\n        self.emit(QtCore.SIGNAL(\"activated()\"))\n\nclass QAppPresence(unittest.TestCase):\n\n    def testQShortcut(self):\n        self.qapp = QtGui.QApplication([])\n        f = Foo()\n\n        self.sc = MyShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return), f, f.slot_of_foo)\n        self.scstd = MyShortcut(QtGui.QKeySequence.Copy, f, f.slot_of_copy)\n        QtCore.QTimer.singleShot(0, self.init);\n        self.qapp.exec_()\n        self.assertEquals(f.ok, True)\n        self.assertEquals(f.copy, True)\n\n    def init(self):\n        self.sc.emit_signal();\n        self.scstd.emit_signal();\n        self.qapp.quit()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qsplitter_test.py",
    "content": "import unittest\nfrom PySide.QtGui import QSplitter\n\nfrom helper import UsesQApplication\n\nclass QSplitterTest(UsesQApplication):\n\n    def testGetRange(self):\n        splitter = QSplitter()\n        _min, _max = splitter.getRange(0)\n        self.assert_(isinstance(_min, int))\n        self.assert_(isinstance(_max, int))\n\nif __name__ == \"__main__\":\n   unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qstandarditemmodel_test.py",
    "content": "import unittest\nimport sys\n\nfrom PySide.QtGui import QStandardItemModel, QWidget, QStandardItem\nimport shiboken\n\nfrom helper import UsesQApplication\n\nclass QStandardItemModelTest(UsesQApplication):\n\n    def setUp(self):\n       super(QStandardItemModelTest, self).setUp()\n       self.window = QWidget()\n       self.model = QStandardItemModel(0, 3, self.window)\n\n    def tearDown(self):\n       del self.window\n       del self.model\n       super(QStandardItemModelTest, self).tearDown()\n\n    def testInsertRow(self):\n        # bug #227\n        self.model.insertRow(0)\n\n    def testClear(self):\n\n        model = QStandardItemModel()\n        root = model.invisibleRootItem()\n        model.clear()\n        self.assertFalse(shiboken.isValid(root))\n\n\nclass QStandardItemModelRef(UsesQApplication):\n    def testRefCount(self):\n        model = QStandardItemModel(5, 5)\n        items = []\n        for r in range(5):\n            row = []\n            for c in range(5):\n                row.append(QStandardItem(\"%d,%d\" % (r,c)) )\n                self.assertEqual(sys.getrefcount(row[c]), 2)\n\n            model.insertRow(r, row)\n\n            for c in range(5):\n                ref_after = sys.getrefcount(row[c])\n                # check if the ref count was incremented after insertRow\n                self.assertEqual(ref_after, 3)\n\n            items.append(row)\n            row = None\n\n        for r in range(3):\n            my_row = model.takeRow(0)\n            my_row = None\n            for c in range(5):\n                # only rest 1 reference\n                self.assertEqual(sys.getrefcount(items[r][c]), 2)\n\n        my_i = model.item(0,0)\n        # ref(my_i) + parent_ref + items list ref\n        self.assertEqual(sys.getrefcount(my_i), 4)\n\n        model.clear()\n        # ref(my_i)\n        self.assertEqual(sys.getrefcount(my_i), 3)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qstring_qkeysequence_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Tests conversions of QString to and from QKeySequence.'''\n\nimport unittest\nimport py3kcompat as py3k\nfrom helper import UsesQApplication\n\nfrom PySide.QtGui import QKeySequence, QAction\n\nclass QStringQKeySequenceTest(UsesQApplication):\n    '''Tests conversions of QString to and from QKeySequence.'''\n\n    def testQStringFromQKeySequence(self):\n        '''Creates a QString from a QKeySequence.'''\n        keyseq = 'Ctrl+A'\n        a = QKeySequence(keyseq)\n        self.assertEqual(a, keyseq)\n\n    def testPythonStringAsQKeySequence(self):\n        '''Passes a Python string to an argument expecting a QKeySequence.'''\n        keyseq = py3k.unicode_('Ctrl+A')\n        action = QAction(None)\n        action.setShortcut(keyseq)\n        shortcut = action.shortcut()\n        self.assert_(isinstance(shortcut, QKeySequence))\n        self.assertEqual(shortcut.toString(), keyseq)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qstyle_test.py",
    "content": "\nimport unittest\nfrom helper import UsesQApplication\n\nfrom PySide.QtGui import QWidget, QLabel, QFontComboBox, QStyleFactory\n\nclass SetStyleTest(UsesQApplication):\n    '''Tests setting the same QStyle for all objects in a UI hierarchy.'''\n\n    def testSetStyle(self):\n        '''All this test have to do is not break with some invalid Python wrapper.'''\n\n        def setStyleHelper(widget, style):\n            widget.setStyle(style)\n            widget.setPalette(style.standardPalette())\n            for child in widget.children():\n                if isinstance(child, QWidget):\n                    setStyleHelper(child, style)\n\n        container = QWidget()\n        # QFontComboBox is used because it has an QLineEdit created in C++ inside it,\n        # and if the QWidget.setStyle(style) steals the ownership of the style\n        # for the C++ originated widget everything will break.\n        fontComboBox = QFontComboBox(container)\n        label = QLabel(container)\n        label.setText('Label')\n        style = QStyleFactory.create(QStyleFactory.keys()[0])\n        setStyleHelper(container, style)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qtableview_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import QAbstractTableModel\nfrom PySide.QtGui import QTableWidget\nfrom helper import UsesQApplication\n\nclass QPenTest(UsesQApplication):\n\n    def testItemModel(self):\n        tv = QTableWidget()\n\n        self.assertEqual(type(tv.model()), QAbstractTableModel)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qtabwidget_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtGui import *\nfrom helper import TimedQApplication\n\ndef makeBug643(tab):\n    button = QPushButton('Foo')\n    tab.insertTab(0, button, 'Foo')\n\nclass RemoveTabMethod(TimedQApplication):\n    def setUp(self):\n        TimedQApplication.setUp(self)\n        self.tab = QTabWidget()\n\n    def tearDown(self):\n        del self.tab\n        TimedQApplication.tearDown(self)\n\n\n    def testRemoveTabPresence(self):\n        self.assert_(getattr(self.tab, 'removeTab'))\n\n    def testInsertTab(self):\n        makeBug643(self.tab)\n        self.assertEqual(self.tab.count(), 1)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qtextdocument_undoredo_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtGui import QTextDocument, QTextCursor\n\nclass QTextDocumentTest(unittest.TestCase):\n\n    def testUndoRedo(self):\n        text = 'foobar'\n        doc = QTextDocument(text)\n\n        self.assertFalse(doc.isRedoAvailable())\n        self.assertTrue(doc.isUndoAvailable())\n        self.assertEqual(doc.toPlainText(), text)\n\n        cursor = QTextCursor(doc)\n        doc.undo(cursor)\n\n        self.assertTrue(doc.isRedoAvailable())\n        self.assertFalse(doc.isUndoAvailable())\n        self.assertEqual(doc.toPlainText(), '')\n\n        doc.redo(cursor)\n\n        self.assertFalse(doc.isRedoAvailable())\n        self.assertTrue(doc.isUndoAvailable())\n        self.assertEqual(doc.toPlainText(), text)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qtextedit_signal_test.py",
    "content": "from PySide import QtGui, QtCore\nfrom helper import UsesQApplication\n\nimport unittest\n\nclass MyWindow(QtGui.QMainWindow):\n    appendText = QtCore.Signal(str)\n\n    @QtCore.Slot()\n    def onButtonPressed(self):\n        self.appendText.emit(\"PySide\")\n\n    def __init__(self, parent=None):\n        super(MyWindow, self).__init__(parent)\n\n        self.textEdit = QtGui.QTextEdit()\n        self.btn = QtGui.QPushButton(\"ClickMe\")\n        self.btn.clicked.connect(self.onButtonPressed)\n        self.appendText.connect(self.textEdit.append)\n\n    def start(self):\n        self.btn.click()\n\n    def text(self):\n        return self.textEdit.toPlainText()\n\n\nclass testSignalWithCPPSlot(UsesQApplication):\n\n    def testEmission(self):\n        w = MyWindow()\n        w.start()\n        self.assertEqual(w.text(), \"PySide\")\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qtextedit_test.py",
    "content": "'''Test cases for QTextEdit and ownership problems.'''\n\nimport unittest\nfrom sys import getrefcount\nfrom PySide.QtGui import QTextEdit\n\nfrom helper import UsesQApplication\n\nclass DontTouchReference(UsesQApplication):\n    '''Check if the QTextTable returned by QTextCursor.insertTable() is not\n    referenced by the QTextCursor that returns it.'''\n\n    def setUp(self):\n        super(DontTouchReference, self).setUp()\n        self.editor = QTextEdit()\n        self.cursor = self.editor.textCursor()\n        self.table = self.cursor.insertTable(1, 1)\n\n    def testQTextTable(self):\n        # methods which return QTextTable should not increment its reference\n        self.assertEqual(getrefcount(self.table), 2)\n        f = self.cursor.currentFrame()\n        del f\n        self.assertEqual(getrefcount(self.table), 2)\n        # destroying the cursor should not raise any \"RuntimeError: internal\n        # C++ object already deleted.\" when accessing the QTextTable\n        del self.cursor\n        self.assertEqual(getrefcount(self.table), 2)\n        cell = self.table.cellAt(0, 0)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qtextline_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtGui import QTextLayout\nfrom helper import UsesQApplication\n\nclass QTextLineTest(UsesQApplication):\n\n    def testCursorToX(self):\n        textLayout = QTextLayout()\n        textLayout.beginLayout()\n        line = textLayout.createLine()\n        self.assert_(line.isValid())\n        x, cursorPos = line.cursorToX(0)\n        self.assertEqual(type(x), float)\n        self.assertEqual(type(cursorPos), int)\n        x, cursorPos = line.cursorToX(1)\n        self.assertEqual(type(x), float)\n        self.assertEqual(type(cursorPos), int)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qtoolbar_test.py",
    "content": "\n'''Test cases for QToolbar'''\n\nimport unittest\n\nfrom PySide.QtGui import QToolBar, QMainWindow, QAction\n\nfrom helper import UsesQApplication\n\nclass AddActionText(UsesQApplication):\n    '''Test case for calling QToolbar.addAction passing a text'''\n\n    def setUp(self):\n        #Acquire resources\n        super(AddActionText, self).setUp()\n        self.window = QMainWindow()\n        self.toolbar = QToolBar()\n        self.window.addToolBar(self.toolbar)\n\n    def tearDown(self):\n        #Release resources\n        super(AddActionText, self).tearDown()\n        del self.toolbar\n        del self.window\n\n    def testText(self):\n        #QToolBar.addAction(text) - add a QToolButton\n        self.toolbar.addAction('aaaa')\n        self.assertEqual(len(self.toolbar.actions()), 1)\n        action = self.toolbar.actions()[0]\n        self.assert_(isinstance(action, QAction))\n        self.assertEqual(action.text(), 'aaaa')\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qtoolbox_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtGui import QToolBox, QWidget, QIcon\n\nfrom helper import UsesQApplication\n\nclass OwnershipControl(UsesQApplication):\n\n    def setUp(self):\n        super(OwnershipControl, self).setUp()\n        self.toolbox = QToolBox()\n\n    def tearDown(self):\n        del self.toolbox\n        super(OwnershipControl, self).tearDown()\n\n    def testAddItem(self):\n        # Was losing ownership of the widget.\n        index = self.toolbox.addItem(QWidget(), 'item')\n        item = self.toolbox.widget(index)\n        self.assert_(isinstance(item, QWidget))\n\n    def testAddItemWithIcon(self):\n        index = self.toolbox.addItem(QWidget(), QIcon(), 'item')\n        item = self.toolbox.widget(index)\n        self.assert_(isinstance(item, QWidget))\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qtransform_test.py",
    "content": "import unittest\nfrom PySide.QtCore import QPointF\nfrom PySide.QtGui import QTransform, QPolygonF, QPolygonF\n\nclass QTransformTest(unittest.TestCase):\n\n    def testMap(self):\n        transform = QTransform()\n        values = (10.0, 20.0)\n        tx, ty = transform.map(*values)\n        self.assert_(isinstance(tx, float))\n        self.assert_(isinstance(ty, float))\n        self.assertEqual((tx, ty), values)\n\n    def testquadToQuad(self):\n        q1 = QPolygonF()\n        q1.append(QPointF(10.0, 10.0))\n        q1.append(QPointF(20.0, 10.0))\n        q1.append(QPointF(10.0, -10.0))\n        q1.append(QPointF(20.0, -10.0))\n\n        q2 = QPolygonF()\n        q2.append(QPointF(20.0, 20.0))\n        q2.append(QPointF(30.0, 20.0))\n        q2.append(QPointF(20.0, -20.0))\n        q2.append(QPointF(30.0, -20.0))\n\n        t1 = QTransform()\n        r1 = QTransform.quadToQuad(q1, q2, t1)\n        r2 = QTransform.quadToQuad(q1, q2)\n\n        self.assertTrue(r1)\n        self.assert_(r2)\n\n        self.assertEqual(t1, r2)\n\n    def testquadToSquare(self):\n        q1 = QPolygonF()\n        q1.append(QPointF(10.0, 10.0))\n        q1.append(QPointF(20.0, 10.0))\n        q1.append(QPointF(10.0, -10.0))\n        q1.append(QPointF(20.0, -10.0))\n\n        t1 = QTransform()\n        r1 = QTransform.quadToSquare(q1, t1)\n        r2 = QTransform.quadToSquare(q1)\n\n        self.assertTrue(r1)\n        self.assert_(r2)\n\n        self.assertEqual(t1, r2)\n\n\n    def testsquareToQuad(self):\n        q1 = QPolygonF()\n        q1.append(QPointF(10.0, 10.0))\n        q1.append(QPointF(20.0, 10.0))\n        q1.append(QPointF(10.0, -10.0))\n        q1.append(QPointF(20.0, -10.0))\n\n        t1 = QTransform()\n        r1 = QTransform.squareToQuad(q1, t1)\n        r2 = QTransform.squareToQuad(q1)\n\n        self.assertTrue(r1)\n        self.assert_(r2)\n\n        self.assertEqual(t1, r2)\n\n\nif __name__ == \"__main__\":\n   unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qvalidator_test.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtGui import *\n\nimport unittest\nfrom helper import UsesQApplication\n\nclass MyValidator1(QValidator):\n    def fixUp(self, input):\n        return \"fixed\"\n\n    def validate(self, input, pos):\n        return (QValidator.Acceptable, \"fixed\", 1)\n\nclass MyValidator2(QValidator):\n    def fixUp(self, input):\n        return \"fixed\"\n\n    def validate(self, input, pos):\n        return (QValidator.Acceptable, \"fixed\")\n\nclass MyValidator3(QValidator):\n    def fixUp(self, input):\n        return \"fixed\"\n\n    def validate(self, input, pos):\n        return (QValidator.Acceptable,)\n\nclass MyValidator4(QValidator):\n    def fixUp(self, input):\n        return \"fixed\"\n\n    def validate(self, input, pos):\n        return QValidator.Acceptable\n\nclass QValidatorTest(UsesQApplication):\n    def testValidator1(self):\n        line = QLineEdit()\n        line.setValidator(MyValidator1())\n        line.show()\n        line.setText(\"foo\")\n\n        QTimer.singleShot(0, line.close)\n        self.app.exec_()\n\n        self.assertEqual(line.text(), \"fixed\")\n        self.assertEqual(line.cursorPosition(), 1)\n\n    def testValidator2(self):\n        line = QLineEdit()\n        line.setValidator(MyValidator2())\n        line.show()\n        line.setText(\"foo\")\n\n        QTimer.singleShot(0, line.close)\n        self.app.exec_()\n\n        self.assertEqual(line.text(), \"fixed\")\n        self.assertEqual(line.cursorPosition(), 3)\n\n    def testValidator3(self):\n        line = QLineEdit()\n        line.setValidator(MyValidator3())\n        line.show()\n        line.setText(\"foo\")\n\n        QTimer.singleShot(0, line.close)\n        self.app.exec_()\n\n        self.assertEqual(line.text(), \"foo\")\n        self.assertEqual(line.cursorPosition(), 3)\n\n    def testValidator4(self):\n        line = QLineEdit()\n        line.setValidator(MyValidator4())\n        line.show()\n        line.setText(\"foo\")\n\n        QTimer.singleShot(0, line.close)\n        self.app.exec_()\n\n        self.assertEqual(line.text(), \"foo\")\n        self.assertEqual(line.cursorPosition(), 3)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qvariant_test.py",
    "content": "\nimport unittest\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass MyDiagram(QGraphicsScene):\n    pass\n\nclass MyItem(QGraphicsRectItem):\n    def itemChange(self, change, value):\n        return value;\n\nclass QGraphicsSceneOnQVariantTest(unittest.TestCase):\n    \"\"\"Test storage ot QGraphicsScene into QVariants\"\"\"\n    def testIt(self):\n        app = QApplication([])\n        s = MyDiagram()\n        i = MyItem()\n        s.addItem(i)\n        self.assertEqual(len(s.items()), 1)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/qwidget_setlayout_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\n\nfrom PySide.QtGui import QWidget, QVBoxLayout, QPushButton, QApplication, QHBoxLayout\nfrom helper import UsesQApplication\n\nclass QWidgetTest(UsesQApplication):\n\n    def test_setLayout(self):\n        layout = QVBoxLayout()\n        btn1 = QPushButton(\"button_v1\")\n        layout.addWidget(btn1)\n\n        btn2 = QPushButton(\"button_v2\")\n        layout.addWidget(btn2)\n\n        layout2 = QHBoxLayout()\n\n        btn1 = QPushButton(\"button_h1\")\n        layout2.addWidget(btn1)\n\n        btn2 = QPushButton(\"button_h2\")\n        layout2.addWidget(btn2)\n\n        layout.addLayout(layout2)\n\n        widget = QWidget()\n        widget.setLayout(layout)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/qwidget_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtGui import QWidget, QMainWindow\nfrom helper import UsesQApplication\n\nclass QWidgetInherit(QMainWindow):\n    def __init__(self):\n        QWidget.__init__(self)\n\nclass QWidgetTest(UsesQApplication):\n\n    def testInheritance(self):\n        self.assertRaises(TypeError, QWidgetInherit)\n\nclass QWidgetVisible(UsesQApplication):\n\n    def testBasic(self):\n        # Also related to bug #244, on existence of setVisible'''\n        widget = QWidget()\n        self.assert_(not widget.isVisible())\n        widget.setVisible(True)\n        self.assert_(widget.isVisible())\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/reference_count_test.py",
    "content": "\n'''Test cases for Reference count when the object is created in c++ side'''\n\nimport unittest\n\nimport sys\nimport weakref\nimport gc\n\n\nfrom PySide.QtCore import Qt, QPointF\nfrom PySide.QtGui import QApplication, QGraphicsScene, QGraphicsRectItem, QPolygonF, QGraphicsPolygonItem, QGraphicsRectItem\n\nfrom helper import UsesQApplication\n\ndestroyedRect = False\ndestroyedPol = False\n\ndef rect_del(o):\n    global destroyedRect\n    destroyedRect = True\n\ndef pol_del(o):\n    global destroyedPol\n    destroyedPol = True\n\nclass ReferenceCount(UsesQApplication):\n\n    def setUp(self):\n        super(ReferenceCount, self).setUp()\n        self.scene = QGraphicsScene()\n\n    def tearDown(self):\n        super(ReferenceCount, self).tearDown()\n\n    def beforeTest(self):\n        points = [QPointF(0, 0), QPointF(100, 100), QPointF(0, 100)]\n        pol = self.scene.addPolygon(QPolygonF(points))\n        self.assert_(isinstance(pol, QGraphicsPolygonItem))\n        self.wrp = weakref.ref(pol, pol_del)\n\n        #refcount need be 3 because one ref for QGraphicsScene, and one to rect obj\n        self.assertEqual(sys.getrefcount(pol), 3)\n\n    def testReferenceCount(self):\n        global destroyedRect\n        global destroyedPol\n\n        self.beforeTest()\n        \n        rect = self.scene.addRect(10.0, 10.0, 10.0, 10.0)\n        self.assert_(isinstance(rect, QGraphicsRectItem))\n\n        self.wrr = weakref.ref(rect, rect_del)\n\n        #refcount need be 3 because one ref for QGraphicsScene, and one to rect obj\n        self.assertEqual(sys.getrefcount(rect), 3)\n\n        del rect\n        #not destroyed because one ref continue in QGraphicsScene\n        self.assertEqual(destroyedRect, False)\n        self.assertEqual(destroyedPol, False)\n\n        del self.scene\n\n        #QGraphicsScene was destroyed and this destroy internal ref to rect\n        self.assertEqual(destroyedRect, True)\n        self.assertEqual(destroyedPol, True)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/repr_test.py",
    "content": "\nimport unittest\n\nimport PySide\nfrom PySide.QtCore import QPoint\nfrom PySide.QtGui import QMatrix\nfrom PySide.QtGui import QMatrix2x2, QMatrix2x3, QMatrix2x4\nfrom PySide.QtGui import QMatrix3x2, QMatrix3x3, QMatrix3x4\nfrom PySide.QtGui import QMatrix4x2, QMatrix4x3, QMatrix4x4\nfrom PySide.QtGui import QVector2D, QVector3D, QVector4D\nfrom PySide.QtGui import QColor, QTransform, QKeySequence, QQuaternion\nfrom PySide.QtGui import QPolygon\n\nclass ReprCopyHelper:\n    def testCopy(self):\n        copy = eval(self.original.__repr__())\n        self.assert_(copy is not self.original)\n        self.assertEqual(copy, self.original)\n\nclass QTransformReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8)\n\nclass QKeySequenceReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QKeySequence(\"Ctrl+P\")\n\nclass QQuaternionReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QQuaternion(1, 2, 3, 4)\n\nclass QVector2DReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QVector2D(1, 2)\n\nclass QVector3DReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QVector3D(1, 2, 3)\n\nclass QVector4DReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QVector4D(1, 2, 3, 4)\n\nclass QMatrixReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix(1, 2, 3, 4, 5, 6)\n\n\n# Avoid these tests until get gcc fixed\n# Related bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247\n\"\"\"\nclass QMatrix2x2ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix2x2([1, 2, 3, 4])\n\nclass QMatrix2x3ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix2x3([1, 2, 3, 4, 5, 6])\n\nclass QMatrix2x4ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix2x4([1, 2, 3, 4, 5, 6, 7, 8])\n\nclass QMatrix3x2ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix3x2([1, 2, 3, 4, 5, 6])\n\nclass QMatrix3x3ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix3x3([1, 2, 3, 4, 5, 6, 7, 8, 9])\n\nclass QMatrix3x4ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix3x4([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])\n\nclass QMatrix4x2ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix4x2([1, 2, 3, 4, 5, 6, 7, 8])\n\nclass QMatrix4x3ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix4x3([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])\n\nclass QMatrix4x4ReprCopy(ReprCopyHelper, unittest.TestCase):\n    def setUp(self):\n        self.original = QMatrix4x4([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])\n\"\"\"\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/returnquadruplesofnumbers_test.py",
    "content": "import unittest\nfrom PySide.QtGui import QLayout, QWidget, QGraphicsLayout, QGraphicsLayoutItem, QTextCursor, QPrinter\n\nfrom helper import UsesQApplication\n\nclass Layout(QLayout):\n    def __init__(self):\n        QLayout.__init__(self)\n\nclass GraphicsLayout(QGraphicsLayout):\n    def __init__(self):\n        QGraphicsLayout.__init__(self)\n\nclass GraphicsLayoutItem(QGraphicsLayoutItem):\n    def __init__(self):\n        QGraphicsLayoutItem.__init__(self)\n\nclass ReturnsQuadruplesOfNumbers(UsesQApplication):\n    def compareTuples(self, ta, tb):\n        for va,vb in zip(ta, tb):\n            if round(va) != round(vb):\n                return False\n        return True\n\n    def testQGraphicsLayoutGetContentsMargins(self):\n        obj = GraphicsLayout()\n        values = (10.0, 20.0, 30.0, 40.0)\n        obj.setContentsMargins(*values)\n        self.assert_(self.compareTuples(obj.getContentsMargins(), values))\n\n    def testQGraphicsLayoutItemGetContentsMargins(self):\n        obj = GraphicsLayoutItem()\n        self.assert_(self.compareTuples(obj.getContentsMargins(), (0.0, 0.0, 0.0, 0.0)))\n\n    def testQWidgetGetContentsMargins(self):\n        obj = QWidget()\n        values = (10, 20, 30, 40)\n        obj.setContentsMargins(*values)\n        self.assert_(self.compareTuples(obj.getContentsMargins(), values))\n\n    def testQLayoutGetContentsMargins(self):\n        obj = Layout()\n        values = (10, 20, 30, 40)\n        obj.setContentsMargins(*values)\n        self.assert_(self.compareTuples(obj.getContentsMargins(), values))\n\n    def testQTextCursorSelectedTableCells(self):\n        obj = QTextCursor()\n        self.assertEquals(obj.selectedTableCells(), (-1, -1, -1, -1))\n\n    def testQPrinterGetPageMargins(self):\n        # Bug #742\n        obj = QPrinter()\n        values = (10.0, 20.0, 30.0, 40.0, QPrinter.Point)\n        obj.setPageMargins(*values)\n        self.assert_(self.compareTuples(obj.getPageMargins(QPrinter.Point), values[:-1]))\n\nif __name__ == \"__main__\":\n   unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/standardpixmap_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtGui import QPixmap, QStyle\n\nfrom helper import UsesQApplication\n\nclass StandardPixmapTest(UsesQApplication):\n    def testDefaultOptions(self): # Bug 253\n        pixmap = self.app.style().standardPixmap(QStyle.SP_DirClosedIcon)\n        self.assert_(isinstance(pixmap, QPixmap))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/test_module_template.py",
    "content": "from PySide.QtGui import QWidget\nfrom PySide.QtCore import QObject\n\nclass MyQObject(QObject):\n    pass\n\nclass MyQWidget(QWidget):\n    pass\n\nclass Sentinel():\n    value = 10\n\n"
  },
  {
    "path": "tests/QtGui/timed_app_test.py",
    "content": "\nimport unittest\n\nfrom helper import TimedQApplication \n\nclass TestTimedApp(TimedQApplication):\n    '''Simple test case for TimedQApplication'''\n\n    def testFoo(self):\n        #Simple test of TimedQApplication\n        self.app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/virtual_protected_inheritance_test.py",
    "content": "\n'''Test cases for overriding inherited protected virtual methods'''\n\nimport unittest\n\nfrom PySide.QtCore import QTimerEvent\nfrom PySide.QtGui import QApplication, QSpinBox\n\nfrom helper import UsesQApplication\n\nclass MySpinButton(QSpinBox):\n    '''Simple example class of overriding QObject.timerEvent'''\n\n    def __init__(self, max_runs=5, app=None):\n        #Creates a new spinbox that will run <max_runs> and quit <app>\n        super(MySpinButton, self).__init__()\n\n        if app is None:\n            app = QApplication([])\n\n        self.app = app\n        self.max_runs = max_runs\n        self.runs = 0\n\n    def timerEvent(self, event):\n        #Timer event method\n        self.runs += 1\n\n        self.setValue(self.runs)\n\n        if self.runs == self.max_runs:\n            self.app.quit()\n\n        if not isinstance(event, QTimerEvent):\n            raise TypeError('Invalid event type. Must be TimerEvent')\n\nclass TimerEventTest(UsesQApplication):\n    '''Test case for running QObject.timerEvent from inherited class'''\n\n    qapplication = True\n\n    def setUp(self):\n        #Acquire resources\n        super(TimerEventTest, self).setUp()\n        self.widget = MySpinButton(app=self.app)\n\n    def tearDown(self):\n        #Release resources\n        del self.widget\n        super(TimerEventTest, self).tearDown()\n\n    def testMethod(self):\n        #QWidget.timerEvent overrinding (protected inherited)\n        timer_id = self.widget.startTimer(0)\n\n        self.app.exec_()\n\n        self.widget.killTimer(timer_id)\n\n        self.assert_(self.widget.runs >= self.widget.max_runs)\n\n\nif __name__ == '__main__':\n    unittest.main()\n    #app = QApplication([])\n    #widget  = MySpinButton(app=app)\n    #widget.startTimer(500)\n    #widget.show()\n    #app.exec_()\n\n"
  },
  {
    "path": "tests/QtGui/virtual_pure_override_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\n\nfrom PySide.QtGui import QGraphicsScene, QGraphicsRectItem, QGraphicsView, QApplication, QBrush, QColor\nfrom PySide.QtCore import QTimer\nfrom helper import UsesQApplication\n\nqgraphics_item_painted = False\n\nclass RoundRectItem(QGraphicsRectItem):\n\n    def __init__(self, x, y, w, h):\n        QGraphicsRectItem.__init__(self, x, y, w, h)\n\n    def paint(self, painter, qstyleoptiongraphicsitem, qwidget):\n        global qgraphics_item_painted\n        qgraphics_item_painted = True\n\n\nclass QGraphicsItemTest(UsesQApplication):\n\n    def createRoundRect(self, scene):\n        item = RoundRectItem(10, 10, 100, 100)\n        item.setBrush(QBrush(QColor(255, 0, 0)))\n        scene.addItem(item)\n        return item\n\n    def quit_app(self):\n        self.app.quit()\n\n    def test_setParentItem(self):\n        global qgraphics_item_painted\n\n        scene = QGraphicsScene()\n        scene.addText(\"test\")\n        view = QGraphicsView(scene)\n\n        rect = self.createRoundRect(scene)\n        view.show()\n        QTimer.singleShot(1000, self.quit_app)\n        self.app.exec_()\n        self.assert_(qgraphics_item_painted)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtGui/wrong_return_test.py",
    "content": "'''Test cases for Virtual functions with wrong return type'''\n\nimport unittest\nimport py3kcompat as py3k\nfrom PySide import QtGui\nfrom helper import UsesQApplication\n\nimport warnings\nwarnings.simplefilter('error')\n\n\nclass MyWidget(QtGui.QWidget):\n    def __init__(self, parent=None):\n        super(MyWidget, self).__init__(parent)\n\n    def sizeHint(self):\n        pass\n\nclass testCase(UsesQApplication):\n\n    def testVirtualReturn(self):\n        w = MyWidget()\n        if py3k.IS_PY3K:\n            self.assertWarns(RuntimeWarning, w.show)\n        else:\n            self.assertRaises(RuntimeWarning, w.show)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtGui/x11_symbols_test.py",
    "content": "\n''' Test the presence of X11 symbols in QtGui'''\n\nimport unittest\n\nfrom PySide.QtGui import *\n\nclass X11Test(unittest.TestCase):\n\n    def test(self):\n        qpixmapFuncs = dir(QPixmap)\n        self.assert_('handle' in qpixmapFuncs)\n        self.assert_('x11Info' in qpixmapFuncs)\n        self.assert_('x11PictureHandle' in qpixmapFuncs)\n        self.assert_('x11SetDefaultScreen' in qpixmapFuncs)\n\n    def testX11Functions(self):\n        qx11infoFuncs = dir(QX11Info)\n        self.assert_('display' in qx11infoFuncs)\n        self.assert_('appVisual' in qx11infoFuncs)\n        self.assert_('visual' in qx11infoFuncs)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtHelp/CMakeLists.txt",
    "content": "PYSIDE_TEST(help_test.py)\n"
  },
  {
    "path": "tests/QtHelp/help_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtHelp import QHelpEngine\n\nfrom helper import UsesQApplication\n\nclass QHelpEngineCreation(UsesQApplication):\n\n    def testConstructor(self):\n        helpEngine = QHelpEngine('mycollection.qch')\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtMaemo5/CMakeLists.txt",
    "content": "PYSIDE_TEST(pickselector_test.py)\nPYSIDE_TEST(qmaemo5import_test.py)\n"
  },
  {
    "path": "tests/QtMaemo5/pickselector_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtMaemo5 import QMaemo5ListPickSelector, QMaemo5ValueButton\n\nfrom helper import UsesQApplication\n\nclass PickSelectorTest(UsesQApplication):\n    def testOwnership(self):\n        pickselector = QMaemo5ListPickSelector()\n        button = QMaemo5ValueButton(\"test\")\n        button.setPickSelector(pickselector)\n        del pickselector\n        self.assert_(button.pickSelector())\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtMaemo5/qmaemo5import_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtMaemo5 import *\nfrom PySide import QtGui\n\nfrom helper import UsesQApplication\n\nclass QtMamo5Test(UsesQApplication):\n\n    def testObjectCreate(self):\n        bar = QMaemo5EditBar()\n        self.assert_(isinstance(bar, QMaemo5EditBar))\n\n    def testGui(self):\n        getattr(QtGui, 'QAbstractKineticScroller')\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtMultimedia/CMakeLists.txt",
    "content": "PYSIDE_TEST(audio_test.py)\n"
  },
  {
    "path": "tests/QtMultimedia/audio_test.py",
    "content": "\n'''Test cases for QHttp'''\n\nimport unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtMultimedia import *\n\nclass testAudioDevices(unittest.TestCase):\n\n    def testListDevices(self):\n        valid = False\n        devices = QAudioDeviceInfo.availableDevices(QAudio.AudioOutput)\n        if not len(devices):\n            return\n\n        valid = True\n        for devInfo in devices:\n            if devInfo.deviceName() == 'null':\n                # skip the test if the only device found is a invalid device\n                if len(devices) == 1:\n                    return\n                else:\n                    continue\n            fmt = QAudioFormat()\n            for codec in devInfo.supportedCodecs():\n                fmt.setCodec(codec)\n                for frequency in devInfo.supportedFrequencies():\n                    fmt.setFrequency(frequency)\n                    for channels in devInfo.supportedChannels():\n                        fmt.setChannels(channels)\n                        for sampleType in devInfo.supportedSampleTypes():\n                            fmt.setSampleType(sampleType)\n                            for sampleSize in devInfo.supportedSampleSizes():\n                                fmt.setSampleSize(sampleSize)\n                                for endian in devInfo.supportedByteOrders():\n                                    fmt.setByteOrder(endian)\n                                    if devInfo.isFormatSupported(fmt):\n                                        return\n        self.assert_(False)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtNetwork/CMakeLists.txt",
    "content": "PYSIDE_TEST(bug_446.py)\nPYSIDE_TEST(bug_1084.py)\nPYSIDE_TEST(basic_auth_test.py)\nPYSIDE_TEST(accessManager_test.py)\nPYSIDE_TEST(http_test.py)\nPYSIDE_TEST(tcpserver_test.py)\nPYSIDE_TEST(udpsocket_test.py)\nPYSIDE_TEST(qipv6address_test.py)\n"
  },
  {
    "path": "tests/QtNetwork/accessManager_test.py",
    "content": "\n'''Test cases for QHttp'''\n\nimport unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtNetwork import *\n\nfrom helper import UsesQCoreApplication\nfrom httpd import TestServer\n\nclass AccessManagerCase(UsesQCoreApplication):\n\n    def setUp(self):\n        super(AccessManagerCase, self).setUp()\n        self.httpd = TestServer()\n        self.httpd.start()\n        self.called = False\n\n    def tearDown(self):\n        super(AccessManagerCase, self).tearDown()\n        if self.httpd:\n            self.httpd.shutdown()\n            self.httpd = None\n\n    def goAway(self):\n        self.httpd.shutdown()\n        self.app.quit()\n        self.httpd = None\n\n    def slot_replyFinished(self, reply):\n        self.assertEqual(type(reply), QNetworkReply)\n        self.called = True\n        self.goAway()\n\n    def testNetworkRequest(self):\n        manager = QNetworkAccessManager()\n        manager.finished.connect(self.slot_replyFinished)\n        manager.get(QNetworkRequest(QUrl(\"http://127.0.0.1:%s\" % self.httpd.port())))\n        self.app.exec_()\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtNetwork/basic_auth_test.py",
    "content": "﻿import unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtNetwork import *\n\nfrom helper import UsesQCoreApplication\nfrom httpd import TestServer\n\nclass testAuthenticationSignal(UsesQCoreApplication):\n\n    def setUp(self):\n        super(testAuthenticationSignal, self).setUp()\n        self.httpd = TestServer(secure=True)\n        self.httpd.start()\n        self._resultOk = False\n\n    def tearDown(self):\n        if self.httpd:\n            self.httpd.shutdown()\n            del self.httpd\n        super(testAuthenticationSignal, self).tearDown()\n\n    def goAway(self):\n        self.httpd.shutdown()\n        self.app.quit()\n        self.httpd = None\n\n    def onAuthRequest(self, hostname, port, auth):\n        self.assertTrue(isinstance(auth, QAuthenticator))\n        self._resultOk = True\n        self.goAway()\n\n    def testwaitSignal(self):\n        http = QHttp('127.0.0.1', self.httpd.port())\n        http.connect(SIGNAL(\"authenticationRequired(const QString&, quint16, QAuthenticator*)\"), self.onAuthRequest)\n        path = QUrl.toPercentEncoding(\"/index.html\", \"!$&'()*+,;=:@/\")\n        data = http.get(str(path))\n        self.app.exec_()\n        self.assertTrue(self._resultOk)\n\n    def testwaitSignal2(self):\n        http = QHttp('127.0.0.1', self.httpd.port())\n        # Using new signal slot syntax causes a segfault\n        http.authenticationRequired.connect(self.onAuthRequest)\n        path = QUrl.toPercentEncoding(\"/index.html\", \"!$&'()*+,;=:@/\")\n        data = http.get(str(path))\n        self.app.exec_()\n        self.assertTrue(self._resultOk)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtNetwork/bug_1084.py",
    "content": "''' unit test for BUG #1084 '''\n\nimport unittest\nfrom PySide import QtNetwork\nimport py3kcompat as py3k\n\nclass QTcpSocketTestCase(unittest.TestCase):\n    def setUp(self):\n        self.sock = QtNetwork.QTcpSocket()\n        self.sock.connectToHost('127.0.0.1', 25)\n\n    def testIt(self):\n        self.sock.write(py3k.unicode_('quit'))\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtNetwork/bug_446.py",
    "content": "import unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtNetwork import *\n\nfrom helper import UsesQCoreApplication\n\nclass HttpSignalsCase(UsesQCoreApplication):\n    '''Test case for launching QHttp signals'''\n    DATA = \"PySide rocks\"\n\n    def onError(self):\n        self.assert_(False)\n\n    def onNewConnection(self):\n        self.serverConnection = self.server.nextPendingConnection()\n        self.serverConnection.error.connect(self.onError)\n        self.serverConnection.write(HttpSignalsCase.DATA)\n        self.server.close()\n\n    def onReadReady(self):\n        data = self.client.read(100)\n        self.assertEqual(data.size(), len(HttpSignalsCase.DATA))\n        self.assertEqual(data, HttpSignalsCase.DATA)\n        self.done()\n\n    def onClientConnect(self):\n        self.client.readyRead.connect(self.onReadReady)\n\n    def initServer(self):\n        self.server = QTcpServer()\n        self.server.newConnection.connect(self.onNewConnection)\n        self.assert_(self.server.listen())\n        self.client = QTcpSocket()\n        self.client.connected.connect(self.onClientConnect)\n        self.client.connectToHost(QHostAddress(QHostAddress.LocalHost), self.server.serverPort())\n\n    def done(self):\n        self.serverConnection.close()\n        self.client.close()\n        self.app.quit()\n\n    def testRun(self):\n        self.initServer()\n        self.app.exec_()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtNetwork/http_test.py",
    "content": "\n'''Test cases for QHttp'''\n\nimport unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtNetwork import *\n\nfrom helper import UsesQCoreApplication\nfrom httpd import TestServer\n\nclass HttpSignalsCase(UsesQCoreApplication):\n    '''Test case for launching QHttp signals'''\n\n    def setUp(self):\n        super(HttpSignalsCase, self).setUp()\n        self.httpd = TestServer()\n        self.httpd.start()\n        self.http = QHttp(\"127.0.0.1\" , self.httpd.port())\n        self.called = False\n\n    def tearDown(self):\n        if self.httpd:\n            self.httpd.shutdown()\n            del self.httpd\n        self.http = None\n        self.httpd = None\n        super(HttpSignalsCase, self).tearDown()\n\n    def goAway(self):\n        self.httpd.shutdown()\n        self.app.quit()\n\n    def callback(self, ident):\n        self.called = True\n        self.goAway()\n\n    def testDefaultArgs(self):\n        #QHttp signal requestStarted signal\n        # @bug 114\n        self.http.requestStarted.connect(self.callback)\n        self.http.get(\"index.html\")\n        self.app.exec_()\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtNetwork/qipv6address_test.py",
    "content": "'''Test cases for QIPv6Address'''\n\nimport unittest\n\nfrom PySide.QtNetwork import *\n\nclass QIPv6AddressGetItemTest(unittest.TestCase):\n    def testLength(self):\n        ip = QIPv6Address()\n        self.assertEqual(len(ip), 16)\n\n    def testSetItemNegativeIndex(self):\n        ip = QIPv6Address()\n        ip[-1] = 8\n        self.assertEqual(ip[-1], 8)\n\n    def testSetItemLargeIndex(self):\n        ip = QIPv6Address()\n        self.assertRaises(IndexError, ip.__setitem__, 32, 16)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtNetwork/tcpserver_test.py",
    "content": "\n'''Test cases for QTCPServer'''\n\nimport unittest\n\nfrom PySide.QtNetwork import QTcpServer\n\nclass ListenDefaultArgsCase(unittest.TestCase):\n    '''Test case for TcpServer.listen with default args'''\n\n    def setUp(self):\n        #Acquire resources\n        self.server = QTcpServer()\n\n    def tearDown(self):\n        #Release resources\n        del self.server\n\n    def testDefaultArgs(self):\n        # @bug 108\n        #Default arguments for QTcpServer.listen\n        self.server.listen()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtNetwork/udpsocket_test.py",
    "content": "\n'''Test cases for QUdpSocket'''\n\nimport unittest\n\nfrom PySide.QtCore import QUrl, QObject, SIGNAL, QCoreApplication, QTimer\nfrom PySide.QtNetwork import QUdpSocket, QHostAddress\n\nclass HttpSignalsCase(unittest.TestCase):\n    '''Test case for bug #124 - readDatagram signature\n\n    QUdpSocket.readDatagram must return a tuple with the datagram, host and\n    port, while receiving only the max payload size.'''\n\n    def setUp(self):\n        #Acquire resources\n        self.called = False\n        self.app = QCoreApplication([])\n\n        self.socket = QUdpSocket()\n\n        self.server = QUdpSocket()\n        self.server.bind(QHostAddress(QHostAddress.LocalHost), 45454)\n\n    def tearDown(self):\n        #Release resources\n        del self.socket\n        del self.server\n        del self.app\n\n    def sendPackage(self):\n        addr = QHostAddress(QHostAddress.LocalHost)\n        self.socket.writeDatagram('datagram', addr, 45454)\n\n    def callback(self):\n        while self.server.hasPendingDatagrams():\n            datagram, host, port = self.server.readDatagram(self.server.pendingDatagramSize())\n            self.called = True\n            self.app.quit()\n\n    def testDefaultArgs(self):\n        #QUdpSocket.readDatagram pythonic return\n        # @bug 124\n        QObject.connect(self.server, SIGNAL('readyRead()'), self.callback)\n        self.sendPackage()\n        self.app.exec_()\n\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtOpenGL/CMakeLists.txt",
    "content": "if(${QTVERSION} VERSION_GREATER 4.6.9)\n    PYSIDE_TEST(qglbuffer_test.py)\nendif()\nPYSIDE_TEST(qglwidget_test.py)\n"
  },
  {
    "path": "tests/QtOpenGL/qglbuffer_test.py",
    "content": "#!/usr/bin/python\n'''Unit tests for QGLBuffer'''\n\nimport unittest\n\nfrom PySide.QtCore import QByteArray\nfrom PySide.QtOpenGL import QGLBuffer, QGLWidget\nimport py3kcompat as py3k\nfrom helper import UsesQApplication\n\nclass QGLBufferTest(UsesQApplication):\n    def testIt(self):\n        w = QGLWidget()\n        w.makeCurrent()\n\n        b = QGLBuffer()\n        b.setUsagePattern(QGLBuffer.DynamicDraw)\n\n        self.assertTrue(b.create())\n        self.assertTrue(b.bufferId() != 0)\n        self.assertTrue(b.bind())\n\n        data = QByteArray(\"12345\")\n        b.allocate(data)\n        self.assertEqual(b.size(), data.size())\n\n        m = b.map(QGLBuffer.ReadOnly)\n        if m:\n            self.assertEqual(m, py3k.buffer(py3k.b(data.data())))\n            b.unmap()\n\n            m = b.map(QGLBuffer.ReadWrite)\n            m[3] = py3k.b('A')\n            b.unmap()\n            result, rdata = b.read(3, 1)\n            self.assertTrue(result)\n            self.assertEqual(py3k.b('A'), rdata.data())\n        else:\n            print(\" memory mapping is not possible in this OpenGL implementation.\")\n        b.release()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtOpenGL/qglwidget_test.py",
    "content": "import unittest\nfrom PySide.QtGui import *\nfrom PySide.QtOpenGL import *\n\nclass TestQGLWidget (unittest.TestCase):\n    def testIt(self):\n        \"\"\"Just test if the bindTexture(*, GLenum, GLint) methods overloads exists\"\"\"\n        app = QApplication([])\n        img = QImage()\n        w = QGLWidget()\n        a = w.bindTexture(img, 0, 0) # ok if it throws nothing.. :-)\n\n\n\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtScript/CMakeLists.txt",
    "content": "PYSIDE_TEST(base_test.py)\nPYSIDE_TEST(bug_1022.py)\nPYSIDE_TEST(engine_test.py)\nPYSIDE_TEST(property_test.py)\nPYSIDE_TEST(qscriptvalue_test.py)\n"
  },
  {
    "path": "tests/QtScript/base_test.py",
    "content": "from PySide import QtScript\n\n\n#only test if the module import works fine bug #278\n"
  },
  {
    "path": "tests/QtScript/bug_1022.py",
    "content": "import unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtScript import *\n\nclass QScriptValueTest(unittest.TestCase):\n    def testQScriptValue(self): \n        app = QCoreApplication([])\n        engine = QScriptEngine()\n        repr(engine.evaluate('1 + 1'))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtScript/engine_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QObject\nfrom PySide.QtScript import  QScriptEngine\n\nclass QScriptEngineTest(unittest.TestCase):\n\n    def testQScriptEngine(self):\n         engine = QScriptEngine()\n         obj = engine.evaluate(\"({ unitName: 'Celsius', toKelvin: function(x) { return x + 273; } })\")\n         toKelvin = obj.property(\"toKelvin\")\n         result = toKelvin.call(obj, [100])\n         self.assertEqual(result.toNumber(), 373)\n"
  },
  {
    "path": "tests/QtScript/property_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import QObject, Property, QCoreApplication\nfrom PySide.QtScript import  QScriptEngine\n\nclass MyObject(QObject):\n    def __init__(self, parent = None):\n        QObject.__init__(self, parent)\n        self._p = 100\n\n    def setX(self, value):\n        self._p = value\n\n    def getX(self):\n        return self._p\n\n    def resetX(self):\n        self._p = 100\n\n    def delX(self):\n        self._p = 0\n\n    x = Property(int, getX, setX, resetX, delX)\n\n\nclass QPropertyTest(unittest.TestCase):\n\n    def testSimple(self):\n        o = MyObject()\n        self.assertEqual(o.x, 100)\n        o.x = 42\n        self.assertEqual(o.x, 42)\n\n    def testHasProperty(self):\n        o = MyObject()\n        o.setProperty(\"x\", 10)\n        self.assertEqual(o.x, 10)\n        self.assertEqual(o.property(\"x\"), 10)\n\n    def testMetaProperty(self):\n        o = MyObject()\n        m = o.metaObject()\n        found = False\n        for i in range(m.propertyCount()):\n            mp = m.property(i)\n            if mp.name() == \"x\":\n                found = True\n                break\n        self.assert_(found)\n\n    def testScriptQProperty(self):\n        qapp = QCoreApplication([])\n        myEngine = QScriptEngine()\n        obj = MyObject()\n        scriptObj = myEngine.newQObject(obj)\n        myEngine.globalObject().setProperty(\"obj\", scriptObj)\n        myEngine.evaluate(\"obj.x = 42\")\n        self.assertEqual(scriptObj.property(\"x\").toInt32(), 42)\n        self.assertEqual(obj.property(\"x\"), 42)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtScript/qscriptvalue_test.py",
    "content": "import unittest\nimport PySide\nfrom PySide.QtScript import *\n\nfrom helper import UsesQApplication\n\nclass TestQScriptValue (UsesQApplication):\n\n    def testOperator(self):\n        engine = QScriptEngine()\n        value = engine.evaluate('x = {\"a\": 1, \"b\":2}')\n        self.assertEqual(value['a'], 1)\n        self.assertRaises(KeyError, value.__getitem__, 'c')\n        value = engine.evaluate('x = [\"x\", \"y\", \"z\"]')\n        self.assertEqual(value[2], 'z')\n        self.assertRaises(IndexError, value.__getitem__, 23)\n\n    def testRepr(self):\n        value = QScriptValue(\"somePerson = { firstName: 'John', lastName: 'Doe' }\")\n        value2 = eval(repr(value))\n        self.assertEqual(value.toString(), value2.toString())\n        self.assertEqual(value.toVariant(), value2.toVariant())\n\n    def testIteratorProtocol(self):\n        engine = QScriptEngine()\n        value = engine.evaluate('x = {\"a\": 1, \"b\":2}')\n        d = {}\n        for k, v in QScriptValueIterator(value):\n            d[k] = v\n        self.assertEqual(d, {'a': 1, 'b': 2})\n\n        d = {}\n        for k, v in value:\n            d[k] = v\n        self.assertEqual(d, {'a': 1, 'b': 2})\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtScriptTools/CMakeLists.txt",
    "content": "PYSIDE_TEST(debugger_test.py)\n"
  },
  {
    "path": "tests/QtScriptTools/debugger_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import SIGNAL, QTimer\nfrom PySide.QtScript import QScriptEngine\nfrom PySide.QtScriptTools import QScriptEngineDebugger\n\nfrom helper import UsesQApplication\n\nclass DebuggerTest(UsesQApplication):\n\n    def setUp(self):\n        UsesQApplication.setUp(self)\n        self.engine = QScriptEngine()\n        self.debugger = QScriptEngineDebugger()\n        self.has_suspended = 0\n        self.has_resumed = 0\n        self.count = 3\n\n    def suspended(self):\n        self.has_suspended += 1\n        # Will emit evaluationResumed until there are more instructions to be run\n        QTimer.singleShot(100, self.debugger.action(QScriptEngineDebugger.StepIntoAction).trigger)\n\n    def resumed(self):\n        # Will be called when debugger.state() change from Suspended to Running\n        # except for the first time.\n        self.has_resumed += 1\n\n    def testBasic(self):\n        '''Interrupt and resume evaluation with QScriptEngineDebugger'''\n\n        self.debugger.attachTo(self.engine)\n        self.debugger.setAutoShowStandardWindow(False)\n        self.debugger.connect(SIGNAL('evaluationSuspended()'), self.suspended)\n        self.debugger.connect(SIGNAL('evaluationResumed()'), self.resumed)\n\n        self.debugger.action(QScriptEngineDebugger.InterruptAction).trigger()\n        self.engine.evaluate(\"3+4\\n2+1\\n5+1\")\n        self.assert_(self.has_resumed >= 1)\n        self.assert_(self.has_suspended >= 1)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtSql/CMakeLists.txt",
    "content": "PYSIDE_TEST(bug_1013.py)\nPYSIDE_TEST(qsqldatabaseandqueries_test.py)\nPYSIDE_TEST(qvarianttype_test.py)\n"
  },
  {
    "path": "tests/QtSql/bug_1013.py",
    "content": "from PySide.QtCore import *\nfrom PySide.QtSql import *\nimport unittest\n\nclass TestBug1013 (unittest.TestCase):\n\n    def someSlot(self, row, record):\n        record.setValue(0, 2)\n        self._wasCalled = True\n\n    def testIt(self):\n        app = QCoreApplication([])\n        db = QSqlDatabase.addDatabase('QSQLITE')\n        db.setDatabaseName(':memory:')\n        db.open()\n        query = QSqlQuery()\n        query.exec_('CREATE TABLE \"foo\" (id INT);')\n        model = QSqlTableModel()\n        model.setTable('foo')\n\n        self._wasCalled = False\n        model.primeInsert.connect(self.someSlot)\n        model.select()\n        QTimer.singleShot(0,lambda: model.insertRow(0) and app.quit())\n        app.exec_()\n        self.assertTrue(self._wasCalled)\n        self.assertEqual(model.data(model.index(0, 0)), 2)\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtSql/qsqldatabaseandqueries_test.py",
    "content": "#!/usr/bin/python\n'''Test cases for QtSql database creation, destruction and queries'''\n\nimport sys\nimport unittest\n\nfrom PySide import QtSql\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass Foo(QWidget):\n    def __init__(self):\n        QWidget.__init__(self)\n        self.model = QtSql.QSqlTableModel()\n\nclass SqlDatabaseCreationDestructionAndQueries(unittest.TestCase):\n    '''Test cases for QtSql database creation, destruction and queries'''\n\n    def setUp(self):\n        #Acquire resources\n        self.assertFalse(not QtSql.QSqlDatabase.drivers(), \"installed Qt has no DB drivers\")\n        self.assertTrue(\"QSQLITE\" in QtSql.QSqlDatabase.drivers(), \"\\\"QSQLITE\\\" driver not available in this Qt version\")\n        self.db = QtSql.QSqlDatabase.addDatabase(\"QSQLITE\")\n        self.db.setDatabaseName(\":memory:\")\n        self.assertTrue(self.db.open())\n\n    def tearDown(self):\n        #Release resources\n        self.db.close()\n        QtSql.QSqlDatabase.removeDatabase(\":memory:\")\n        del self.db\n\n    def testTableCreationAndDestruction(self):\n        #Test table creation and destruction\n        query = QtSql.QSqlQuery()\n        query.exec_(\"CREATE TABLE dummy(id int primary key, dummyfield varchar(20))\")\n        query.exec_(\"DROP TABLE dummy\")\n        query.clear()\n\n    def testTableInsertionAndRetrieval(self):\n        #Test table creation, insertion and retrieval\n        query = QtSql.QSqlQuery()\n        query.exec_(\"CREATE TABLE person(id int primary key, \"\n                    \"firstname varchar(20), lastname varchar(20))\")\n        query.exec_(\"INSERT INTO person VALUES(101, 'George', 'Harrison')\")\n        query.prepare(\"INSERT INTO person (id, firstname, lastname) \"\n                      \"VALUES (:id, :firstname, :lastname)\")\n        query.bindValue(\":id\", 102)\n        query.bindValue(\":firstname\", \"John\")\n        query.bindValue(\":lastname\", \"Lennon\")\n        query.exec_()\n\n        lastname = ''\n        query.exec_(\"SELECT lastname FROM person where id=101\")\n        self.assertTrue(query.isActive())\n        query.next()\n        lastname = query.value(0)\n        self.assertEqual(lastname, 'Harrison')\n\n    def testTableModelDeletion(self):\n        app = QApplication([])\n\n        bar = Foo()\n        model = bar.model\n        del bar\n        del app\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtSql/qvarianttype_test.py",
    "content": "'''Test cases for QVariant::Type converter'''\nimport unittest\nimport py3kcompat as py3k\nfrom PySide.QtSql import QSqlField\n\nclass QVariantTypeTest(unittest.TestCase):\n    def testQVariantType(self):\n        f = QSqlField(\"name\", str)\n        self.assertEqual(f.type(), py3k.unicode)\n\n        f = QSqlField(\"name\", \"QString\")\n        self.assertEqual(f.type(),  py3k.unicode)\n\n        f = QSqlField(\"name\", \"double\")\n        self.assertEqual(f.type(), float)\n\n        f = QSqlField(\"name\", float)\n        self.assertEqual(f.type(), float)\n\n        f = QSqlField(\"name\", int)\n        self.assertEqual(f.type(), int)\n\n        if not py3k.IS_PY3K:\n            f = QSqlField(\"name\", long)\n            self.assertEqual(f.type(), int) # long isn't registered in QVariant:Type, just in QMetaType::Type\n\n        #f = QSqlField(\"name\", QObject)\n        #self.assertEqual(f.type(), None)\n\n        f = QSqlField(\"name\", None)\n        self.assertEqual(f.type(), None)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtSvg/CMakeLists.txt",
    "content": "PYSIDE_TEST(qsvggenerator_test.py)\nPYSIDE_TEST(qsvgrenderer_test.py)\nPYSIDE_TEST(qsvgwidget_test.py)\n"
  },
  {
    "path": "tests/QtSvg/qsvggenerator_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom sys import getrefcount\nfrom PySide.QtCore import QBuffer\nfrom PySide.QtSvg import QSvgGenerator\n\nclass QSvgGeneratorTest(unittest.TestCase):\n\n    def testRefCountOfTOutputDevice(self):\n        generator = QSvgGenerator()\n        iodevice1 = QBuffer()\n        refcount1 = getrefcount(iodevice1)\n\n        generator.setOutputDevice(iodevice1)\n\n        self.assertEqual(generator.outputDevice(), iodevice1)\n        self.assertEqual(getrefcount(generator.outputDevice()), refcount1 + 1)\n\n        iodevice2 = QBuffer()\n        refcount2 = getrefcount(iodevice2)\n\n        generator.setOutputDevice(iodevice2)\n\n        self.assertEqual(generator.outputDevice(), iodevice2)\n        self.assertEqual(getrefcount(generator.outputDevice()), refcount2 + 1)\n        self.assertEqual(getrefcount(iodevice1), refcount1)\n\n        del generator\n\n        self.assertEqual(getrefcount(iodevice2), refcount2)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtSvg/qsvgrenderer_test.py",
    "content": "#!/usr/bin/python\nimport unittest, os\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtSvg import *\n\nclass QSvgRendererTest(unittest.TestCase):\n\n    def testLoad(self):\n        tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg')\n        app = QApplication([])\n\n        fromFile = QSvgRenderer(tigerPath)\n        self.assertTrue(fromFile.isValid())\n\n        tigerFile = QFile(tigerPath)\n        tigerFile.open(QFile.ReadOnly)\n        tigerData = tigerFile.readAll()\n        fromContents = QSvgRenderer(tigerData)\n        self.assertTrue(fromContents.isValid())\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtSvg/qsvgwidget_test.py",
    "content": "#!/usr/bin/python\nimport unittest, os\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtSvg import *\n\nclass QSvgWidgetTest(unittest.TestCase):\n\n    def testLoad(self):\n        tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg')\n\n        app = QApplication([])\n        fromFile = QSvgWidget()\n        fromFile.load(tigerPath)\n        self.assertTrue(fromFile.renderer().isValid())\n\n        tigerFile = QFile(tigerPath)\n        tigerFile.open(QFile.ReadOnly)\n        tigerData = tigerFile.readAll()\n        fromContents = QSvgWidget()\n        fromContents.load(tigerData)\n        self.assertTrue(fromContents.renderer().isValid())\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtTest/CMakeLists.txt",
    "content": "PYSIDE_TEST(click_test.py)\nPYSIDE_TEST(eventfilter_test.py)\nPYSIDE_TEST(touchevent_test.py)\n"
  },
  {
    "path": "tests/QtTest/click_test.py",
    "content": "\n'''QtTest mouse click functionalities'''\n\nimport unittest\n\nfrom PySide.QtCore import Qt, QObject\nfrom PySide.QtGui import QPushButton, QLineEdit\nfrom PySide.QtTest import QTest\n\nfrom helper import UsesQApplication\n\nclass MouseClickTest(UsesQApplication):\n\n    def testBasic(self):\n        '''QTest.mouseClick with QCheckBox'''\n        button = QPushButton()\n        button.setCheckable(True)\n        button.setChecked(False)\n\n        QTest.mouseClick(button, Qt.LeftButton)\n        self.assert_(button.isChecked())\n\n        QTest.mouseClick(button, Qt.LeftButton)\n        self.assertFalse(button.isChecked())\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtTest/eventfilter_test.py",
    "content": "\n'''Tests for QKeyEvent'''\n\nimport unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtTest import QTest\n\nfrom helper import UsesQApplication\n\n\nclass KeyEventFilter(QObject):\n\n    def __init__(self, widget, eventType, key):\n        QObject.__init__(self)\n\n        self.widget = widget\n        self.eventType = eventType\n        self.key = key\n\n        self.processed = False\n\n    def eventFilter(self, obj, event):\n        if self.widget == obj and event.type() == self.eventType and \\\n               isinstance(event, QKeyEvent) and event.key() == self.key:\n            self.processed = True\n            return True\n\n        return False\n\nclass EventFilterTest(UsesQApplication):\n\n    def testKeyEvent(self):\n        widget = QLineEdit()\n        key = Qt.Key_A\n        eventFilter = KeyEventFilter(widget, QEvent.KeyPress, key)\n        widget.installEventFilter(eventFilter)\n\n        QTest.keyClick(widget, key)\n\n        self.assert_(eventFilter.processed)\n\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtTest/touchevent_test.py",
    "content": "from PySide.QtGui import QWidget\nfrom PySide.QtCore import QPoint, QTimer, Qt, QEvent\nfrom PySide.QtTest import QTest\n\nimport unittest\n\nfrom helper import UsesQApplication\n\nclass MyWidget(QWidget):\n    def __init__(self, parent = None):\n        QWidget.__init__(self, parent)\n        self._sequence = []\n        self.setAttribute(Qt.WA_AcceptTouchEvents)\n        QTimer.singleShot(200, self.generateEvent)\n\n    def event(self, e):\n        self._sequence.append(e.type())\n        return QWidget.event(self, e)\n\n    def generateEvent(self):\n        o = QTest.touchEvent(self)\n        o.press(0, QPoint(10, 10))\n        o.commit()\n        del o\n\n        QTest.touchEvent(self).press(0, QPoint(10, 10))\n        QTest.touchEvent(self).stationary(0).press(1, QPoint(40, 10))\n        QTest.touchEvent(self).move(0, QPoint(12, 12)).move(1, QPoint(45, 5))\n        QTest.touchEvent(self).release(0, QPoint(12, 12)).release(1, QPoint(45, 5))\n\n        QTimer.singleShot(200, self.deleteLater)\n\n\nclass TouchEventTest(UsesQApplication):\n    def testCreateEvent(self):\n        w = MyWidget()\n        w.show()\n        self.app.exec_()\n        # same values as C++\n        self.assertEqual(w._sequence.count(QEvent.Type.TouchBegin), 2)\n        self.assertEqual(w._sequence.count(QEvent.Type.TouchUpdate), 2)\n        self.assertEqual(w._sequence.count(QEvent.Type.TouchEnd), 1)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtUiTools/CMakeLists.txt",
    "content": "PYSIDE_TEST(bug_360.py)\nPYSIDE_TEST(bug_376.py)\nPYSIDE_TEST(bug_392.py)\nPYSIDE_TEST(bug_426.py)\nPYSIDE_TEST(bug_552.py)\nPYSIDE_TEST(bug_797.py)\nPYSIDE_TEST(bug_909.py)\nPYSIDE_TEST(bug_913.py)\nPYSIDE_TEST(bug_958.py)\nPYSIDE_TEST(bug_965.py)\nPYSIDE_TEST(bug_1060.py)\nPYSIDE_TEST(uiloader_test.py)\nPYSIDE_TEST(ui_test.py)\n"
  },
  {
    "path": "tests/QtUiTools/action.ui",
    "content": "<ui version=\"4.0\">\n    <class>main_window</class>\n    <widget class=\"QMainWindow\" name=\"main_window\">\n      <widget class=\"QWidget\" name=\"centralwidget\"/>\n      <widget class=\"QMenuBar\" name=\"menubar\"/>\n      <widget class=\"QStatusBar\" name=\"statusbar\">\n        <action name=\"actionFoo\">\n          <property name=\"text\">\n            <string>foo</string>\n          </property>\n        </action>\n      </widget>\n    </widget>\n    <resources/>\n    <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/bug_1060.py",
    "content": "''' unit test for BUG #1060 '''\n\nfrom PySide.QtGui import QApplication\nfrom PySide.QtUiTools import QUiLoader\nfrom helper import adjust_filename\n\nclass MyQUiLoader(QUiLoader):\n    def __init__(self):\n        super(MyQUiLoader, self).__init__()\n\n    def createWidget(self, *args):\n        return super(MyQUiLoader, self).createWidget(*args)\n\nif __name__ == \"__main__\":\n    app = QApplication([])\n\n    ui = MyQUiLoader().load(adjust_filename(\"bug_1060.ui\", __file__))\n    ui.show()\n"
  },
  {
    "path": "tests/QtUiTools/bug_1060.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Dialog</class>\n <widget class=\"QDialog\" name=\"Dialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>100</width>\n    <height>100</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Dialog</string>\n  </property>\n </widget>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/bug_360.py",
    "content": "import unittest\nimport os\nfrom helper import UsesQApplication\n\nfrom PySide import QtCore, QtGui\nfrom PySide.QtUiTools import QUiLoader\n\nclass MyQUiLoader(QUiLoader):\n    def __init__(self, baseinstance):\n        QUiLoader.__init__(self)\n        self.baseinstance = baseinstance\n        self._widgets = []\n\n    def createWidget(self, className, parent=None, name=\"\"):\n        widget = QUiLoader.createWidget(self, className, parent, name)\n        self._widgets.append(widget)\n        if parent is None:\n            return self.baseinstance\n        else:\n            setattr(self.baseinstance, name, widget)\n            return widget\n\nclass ButTest(UsesQApplication):\n    def testCase(self):\n        w = QtGui.QWidget()\n        loader = MyQUiLoader(w)\n\n        filePath = os.path.join(os.path.dirname(__file__), 'minimal.ui')\n        ui = loader.load(filePath)\n\n        self.assertEqual(len(loader._widgets), 1)\n        self.assertEqual(type(loader._widgets[0]), QtGui.QFrame)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtUiTools/bug_376.py",
    "content": "import unittest\nimport os\nfrom helper import UsesQApplication\n\nfrom PySide import QtCore, QtGui\nfrom PySide.QtUiTools import QUiLoader\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        w = QtGui.QWidget()\n        loader = QUiLoader()\n\n        filePath = os.path.join(os.path.dirname(__file__), 'test.ui')\n        result = loader.load(filePath, w)\n        self.assert_(isinstance(result.child_object, QtGui.QFrame))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtUiTools/bug_392.py",
    "content": "import unittest\nimport os\nfrom helper import UsesQApplication\n\nfrom PySide import QtGui\nfrom PySide.QtUiTools import QUiLoader\n\nclass MyWidget(QtGui.QComboBox):\n    def __init__(self, parent=None):\n        QtGui.QComboBox.__init__(self, parent)\n\n    def isPython(self):\n        return True\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        w = QtGui.QWidget()\n        loader = QUiLoader()\n\n        filePath = os.path.join(os.path.dirname(__file__), 'action.ui')\n        result = loader.load(filePath, w)\n        self.assert_(isinstance(result.actionFoo, QtGui.QAction))\n\n    def testPythonCustomWidgets(self):\n        w = QtGui.QWidget()\n        loader = QUiLoader()\n        loader.registerCustomWidget(MyWidget)\n\n        filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget.ui')\n        result = loader.load(filePath, w)\n        self.assert_(isinstance(result.custom, MyWidget))\n        self.assert_(result.custom.isPython())\n\n    def testPythonCustomWidgetsTwice(self):\n        w = QtGui.QWidget()\n        loader = QUiLoader()\n        loader.registerCustomWidget(MyWidget)\n\n        filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget2.ui')\n        result = loader.load(filePath, w)\n        self.assert_(isinstance(result.custom, MyWidget))\n        self.assert_(isinstance(result.custom2, MyWidget))\n        self.assert_(result.custom.isPython())\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtUiTools/bug_426.py",
    "content": "import sys\nimport os\nfrom PySide import QtCore, QtGui\nfrom PySide.QtUiTools import QUiLoader\n\nclass Window(object):\n    def __init__(self):\n        loader = QUiLoader()\n        filePath = os.path.join(os.path.dirname(__file__), 'bug_426.ui')\n        self.widget = loader.load(filePath)\n        self.group = QtGui.QActionGroup(self.widget)\n        self.widget.show()\n        QtCore.QTimer.singleShot(0, self.widget.close)\n\nif __name__ == \"__main__\":\n    app = QtGui.QApplication(sys.argv)\n    win = Window()\n    sys.exit(app.exec_())\n"
  },
  {
    "path": "tests/QtUiTools/bug_426.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Form</class>\n <widget class=\"QWidget\" name=\"Form\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>400</width>\n    <height>300</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Form</string>\n  </property>\n </widget>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/bug_552.py",
    "content": "from helper import adjust_filename\nfrom PySide import QtGui, QtCore\nfrom PySide.QtUiTools import QUiLoader\n\nclass View_1(QtGui.QWidget):\n\n    def __init__(self):\n        QtGui.QWidget.__init__(self)\n        loader = QUiLoader()\n        widget = loader.load(adjust_filename('bug_552.ui', __file__), self)\n        self.children = []\n        for child in widget.findChildren(QtCore.QObject, None):\n            self.children.append(child)\n        self.t = widget.tabWidget\n        self.t.removeTab(0)\n\napp = QtGui.QApplication([])\nwindow = View_1()\nwindow.show()\n\n# If it doesn't crash it works :-)\n"
  },
  {
    "path": "tests/QtUiTools/bug_552.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Form</class>\n <widget class=\"QWidget\" name=\"Form\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>400</width>\n    <height>300</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Form</string>\n  </property>\n  <widget class=\"QTabWidget\" name=\"tabWidget\">\n   <property name=\"geometry\">\n    <rect>\n     <x>130</x>\n     <y>80</y>\n     <width>139</width>\n     <height>80</height>\n    </rect>\n   </property>\n   <property name=\"currentIndex\">\n    <number>0</number>\n   </property>\n   <widget class=\"QWidget\" name=\"tab\">\n    <attribute name=\"title\">\n     <string>Tab 1</string>\n    </attribute>\n   </widget>\n   <widget class=\"QWidget\" name=\"tab_2\">\n    <attribute name=\"title\">\n     <string>Tab 2</string>\n    </attribute>\n   </widget>\n  </widget>\n </widget>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/bug_797.py",
    "content": "from PySide import QtUiTools\nfrom PySide import QtCore\nfrom PySide import QtGui\nfrom helper import adjust_filename\n\napp = QtGui.QApplication([])\nloader = QtUiTools.QUiLoader()\nfile = QtCore.QFile(adjust_filename('bug_552.ui', __file__))\nw = QtGui.QWidget()\n# An exception can't be thrown\nmainWindow = loader.load(file, w)\n"
  },
  {
    "path": "tests/QtUiTools/bug_909.py",
    "content": "import sys\nimport unittest\n\nfrom PySide.QtCore import QFile\nfrom PySide.QtGui import QTabWidget\nfrom PySide.QtUiTools import QUiLoader\n\nfrom helper import UsesQApplication\nfrom helper import adjust_filename\n\nclass TestDestruction(UsesQApplication):\n    def testBug909(self):\n        fileName = QFile(adjust_filename('bug_909.ui', __file__))\n        loader = QUiLoader()\n        main_win = loader.load(fileName)\n        self.assertEqual(sys.getrefcount(main_win), 2)\n        fileName.close()\n\n        tw = QTabWidget(main_win)\n        main_win.setCentralWidget(tw)\n        main_win.show()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtUiTools/bug_909.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>MainWindow</class>\n <widget class=\"QMainWindow\" name=\"MainWindow\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>600</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>MainWindow</string>\n  </property>\n  <widget class=\"QWidget\" name=\"centralwidget\"/>\n  <widget class=\"QMenuBar\" name=\"menubar\">\n   <property name=\"geometry\">\n    <rect>\n     <x>0</x>\n     <y>0</y>\n     <width>800</width>\n     <height>25</height>\n    </rect>\n   </property>\n  </widget>\n  <widget class=\"QStatusBar\" name=\"statusbar\"/>\n </widget>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/bug_913.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport unittest\nfrom helper import adjust_filename\n\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtUiTools import *\n\nclass TestBug913 (unittest.TestCase):\n\n    def testIt(self):\n        app = QApplication([])\n\n        loader = QUiLoader()\n        widget = loader.load(adjust_filename('bug_913.ui', __file__))\n        widget.tabWidget.currentIndex() # direct child is available as member\n        widget.le_first.setText('foo') # child of QTabWidget must also be available!\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtUiTools/bug_913.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Form</class>\n <widget class=\"QWidget\" name=\"Form\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>400</width>\n    <height>300</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Form</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <widget class=\"QTabWidget\" name=\"tabWidget\">\n     <widget class=\"QWidget\" name=\"tab\">\n      <attribute name=\"title\">\n       <string>Tab 1</string>\n      </attribute>\n      <layout class=\"QFormLayout\" name=\"formLayout\">\n       <item row=\"0\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label\">\n         <property name=\"text\">\n          <string>First name:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"0\" column=\"1\">\n        <widget class=\"QLineEdit\" name=\"le_first\"/>\n       </item>\n       <item row=\"1\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_2\">\n         <property name=\"text\">\n          <string>Last name:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"1\">\n        <widget class=\"QLineEdit\" name=\"le_last\"/>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tab_2\">\n      <attribute name=\"title\">\n       <string>Tab 2</string>\n      </attribute>\n     </widget>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/bug_958.py",
    "content": "import unittest\nfrom PySide import QtGui, QtUiTools\nfrom helper import adjust_filename\nfrom helper import TimedQApplication\n\nclass Gui_Qt(QtGui.QMainWindow):\n    def __init__(self, parent=None):\n        super(Gui_Qt, self).__init__(parent)\n\n        lLoader = QtUiTools.QUiLoader()\n\n        # this used to cause a segfault because the old inject code used to destroy the parent layout\n        self._cw = lLoader.load(adjust_filename('bug_958.ui', __file__),  self)\n\n        self.setCentralWidget(self._cw)\n\nclass BugTest(TimedQApplication):\n    def testCase(self):\n        lMain = Gui_Qt()\n        lMain.show()\n        self.app.exec_()\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtUiTools/bug_958.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>customWidget</class>\n <widget class=\"QWidget\" name=\"customWidget\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>626</width>\n    <height>578</height>\n   </rect>\n  </property>\n  <property name=\"minimumSize\">\n   <size>\n    <width>500</width>\n    <height>0</height>\n   </size>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Form</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <widget class=\"QTableWidget\" name=\"resultTable\"/>\n   </item>\n   <item>\n    <widget class=\"QProgressBar\" name=\"progressBar\">\n     <property name=\"value\">\n      <number>0</number>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"actionLayout\">\n     <item>\n      <widget class=\"QPushButton\" name=\"processButton\">\n       <property name=\"text\">\n        <string>&amp;Berechnen</string>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/bug_965.py",
    "content": "from PySide.QtUiTools import QUiLoader\nimport unittest\n\nfrom helper import UsesQApplication\nfrom helper import adjust_filename\n\nclass MyQUiLoader(QUiLoader):\n    def __init__(self):\n        super(MyQUiLoader, self).__init__()\n\n    def createWidget(self, className, parent=None, name=\"\"):\n        return None\n\nclass BugTest(UsesQApplication):\n    def testCase(self):\n        loader = MyQUiLoader()\n        self.assertRaises(RuntimeError, loader.load, adjust_filename('bug_965.ui', __file__))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtUiTools/bug_965.ui",
    "content": "<ui version=\"4.0\" >\n <author></author>\n <comment></comment>\n <exportmacro></exportmacro>\n <class>MainWindow</class>\n <widget class=\"QMainWindow\" name=\"MainWindow\" >\n  <property name=\"objectName\" >\n   <string notr=\"true\" >MainWindow</string>\n  </property>\n  <property name=\"geometry\" >\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>800</width>\n    <height>600</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\" >\n   <string>MainWindow</string>\n  </property>\n  <widget class=\"QMenuBar\" name=\"menubar\" />\n  <widget class=\"QWidget\" name=\"centralwidget\" />\n  <widget class=\"QStatusBar\" name=\"statusbar\" />\n </widget>\n <pixmapfunction></pixmapfunction>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/minimal.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Form</class>\n <widget class=\"QFrame\" name=\"Form\">\n </widget>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/pycustomwidget.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>qwidget</class>\n <widget class=\"QWidget\" name=\"qwidget\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>400</width>\n    <height>300</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string/>\n  </property>\n  <widget class=\"MyWidget\" name=\"custom\">\n   <property name=\"geometry\">\n    <rect>\n     <x>10</x>\n     <y>10</y>\n     <width>79</width>\n     <height>23</height>\n    </rect>\n   </property>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MyWidget</class>\n   <extends>QComboBox</extends>\n   <header>customwidget</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/pycustomwidget2.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>qwidget</class>\n <widget class=\"QWidget\" name=\"qwidget\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>400</width>\n    <height>300</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string/>\n  </property>\n\n  <widget class=\"MyWidget\" name=\"custom\">\n   <property name=\"geometry\">\n    <rect>\n     <x>10</x>\n     <y>10</y>\n     <width>79</width>\n     <height>23</height>\n    </rect>\n   </property>\n  </widget>\n\n <widget class=\"MyWidget\" name=\"custom2\">\n   <property name=\"geometry\">\n    <rect>\n     <x>10</x>\n     <y>10</y>\n     <width>79</width>\n     <height>23</height>\n    </rect>\n   </property>\n </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>MyWidget</class>\n   <extends>QComboBox</extends>\n   <header>customwidget</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/test.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Form</class>\n <widget class=\"QWidget\" name=\"Form\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>185</width>\n    <height>133</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Form</string>\n  </property>\n  <widget class=\"QFrame\" name=\"child_object\">\n   <property name=\"geometry\">\n    <rect>\n     <x>0</x>\n     <y>0</y>\n     <width>181</width>\n     <height>131</height>\n    </rect>\n   </property>\n   <property name=\"frameShape\">\n    <enum>QFrame::StyledPanel</enum>\n   </property>\n   <property name=\"frameShadow\">\n    <enum>QFrame::Raised</enum>\n   </property>\n   <widget class=\"QPushButton\" name=\"grandson_object\">\n    <property name=\"geometry\">\n     <rect>\n      <x>50</x>\n      <y>60</y>\n      <width>80</width>\n      <height>25</height>\n     </rect>\n    </property>\n    <property name=\"text\">\n     <string>PushButton</string>\n    </property>\n   </widget>\n  </widget>\n </widget>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "tests/QtUiTools/ui_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtUiTools import QUiLoader\n\nfrom helper import UsesQApplication\n\nclass QUiLoaderCreation(UsesQApplication):\n\n    def testConstructor(self):\n        loader = QUiLoader()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtUiTools/uiloader_test.py",
    "content": "import unittest\nimport os\nfrom helper import UsesQApplication\n\nfrom PySide.QtGui import QWidget\nfrom PySide.QtUiTools import QUiLoader\n\ndef get_file_path():\n    for path in file_path:\n        if os.path.exists(path):\n            return path\n    return \"\"\n\nclass QUioaderTeste(UsesQApplication):\n    def testLoadFile(self):\n        filePath = os.path.join(os.path.dirname(__file__), 'test.ui')\n        loader = QUiLoader()\n        parent = QWidget()\n        w = loader.load(filePath, parent)\n        self.assertNotEqual(w, None)\n\n        self.assertEqual(len(parent.children()), 1)\n\n        child = w.findChild(QWidget, \"child_object\")\n        self.assertNotEqual(child, None)\n        self.assertEqual(w.findChild(QWidget, \"grandson_object\"), child.findChild(QWidget, \"grandson_object\"))\n\n    def testLoadFileUnicodeFilePath(self):\n        filePath = str(os.path.join(os.path.dirname(__file__), 'test.ui'))\n        loader = QUiLoader()\n        parent = QWidget()\n        w = loader.load(filePath, parent)\n        self.assertNotEqual(w, None)\n\n        self.assertEqual(len(parent.children()), 1)\n\n        child = w.findChild(QWidget, \"child_object\")\n        self.assertNotEqual(child, None)\n        self.assertEqual(w.findChild(QWidget, \"grandson_object\"), child.findChild(QWidget, \"grandson_object\"))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtWebKit/CMakeLists.txt",
    "content": "PYSIDE_TEST(bug_448.py)\nPYSIDE_TEST(bug_694.py)\nPYSIDE_TEST(bug_803.py)\nPYSIDE_TEST(bug_899.py)\nPYSIDE_TEST(bug_959.py)\nPYSIDE_TEST(qvariantlist_property_test.py)\nPYSIDE_TEST(qml_plugin_test.py)\nPYSIDE_TEST(shouldInterruptjavascript_test.py)\nPYSIDE_TEST(webpage_test.py)\nPYSIDE_TEST(webview_test.py)\nPYSIDE_TEST(webframe_test.py)\n"
  },
  {
    "path": "tests/QtWebKit/bug_448.py",
    "content": "\n'''Test cases for bug: http://bugs.openbossa.org/show_bug.cgi?id=448'''\n\nimport unittest\nimport sys\n\nfrom PySide.QtGui import QApplication\nfrom PySide.QtWebKit import QWebView\n\nclass Bug448(unittest.TestCase):\n    def onError(self, erros):\n        pass\n\n    def testReturnOwnership(self):\n        app = QApplication(sys.argv)\n        webview = QWebView()\n        webview.page().networkAccessManager().sslErrors.connect(self.onError)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/bug_694.py",
    "content": "import sys\nimport unittest\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\nfrom PySide.QtWebKit import *\n\nclass ErrorPage (QWebPage):\n\n    def __init__(self):\n        QWebPage.__init__(self)\n        self.rcv_extension = None\n        self.rcv_url = None\n        self.rcv_url_copy = None\n        self.rcv_option_type = None\n        self.rcv_output_type = None\n\n\n    def supportsExtension(self, extension):\n        return extension == QWebPage.ErrorPageExtension\n\n    def extension(self, extension, option, output):\n        self.rcv_extension = extension\n        self.rcv_url = option.url\n        self.rcv_url_copy = QUrl(option.url)\n        self.rcv_option_type = type(option)\n        self.rcv_output_type = type(output)\n        return True\n\nclass TestWebPageExtension(unittest.TestCase):\n    def testIt(self):\n        app = QApplication([])\n        ep = ErrorPage()\n        view = QWebView()\n        view.setPage(ep)\n        view.load(\"foo://bar\") # Some malformmed url\n        view.show()\n\n        # If the timeout is 0 the webpage isn't even loaded on Qt4.6-i386, so we use 100 :-)\n        QTimer.singleShot(100, app.quit)\n        app.exec_()\n\n        self.assertEqual(ep.rcv_extension, QWebPage.ErrorPageExtension)\n        self.assertRaises(RuntimeError, ep.rcv_url.__str__)\n\n        self.assertEqual(ep.rcv_url_copy, \"foo://bar\")\n        self.assertEqual(ep.rcv_option_type, QWebPage.ErrorPageExtensionOption)\n        self.assertEqual(ep.rcv_output_type, QWebPage.ErrorPageExtensionReturn)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/bug_803.py",
    "content": "import unittest\nfrom PySide.QtGui import *\nfrom PySide.QtWebKit import *\n\nclass TestBug803 (unittest.TestCase):\n\n    def testIt(self):\n        app = QApplication([])\n        page = QWebPage()\n        frame = page.mainFrame()\n        frame.setHtml(\"<html><head></head><body><p>1</p><p>2</p></body></html>\")\n        elems = frame.findAllElements(\"p\")\n        self.assertEqual(len(elems), 2)\n        self.assertEqual(elems[0].toPlainText(), \"1\")\n        self.assertEqual(elems[1].toPlainText(), \"2\")\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/bug_899.py",
    "content": "import unittest\nfrom PySide.QtCore import Property, QObject\nfrom PySide.QtWebKit import QWebView\nfrom helper import TimedQApplication\n\nclass TestLambdaPropery(TimedQApplication):\n\n    def testBug899(self):\n        html = '''\n        <html><body>\n        <script type=\"text/javascript\">\n        document.write(\"<p>\"+py_obj.list1+\"</p>\")\n        document.write(\"<p>\"+py_obj.list2+\"</p>\")\n        </script>\n        </body></html>\n        '''\n\n        class Obj(object):\n            list1 = ['foo', 'bar', 'baz']\n            list2 = ['fi', 'fo', 'fum']\n\n        obj = Obj()\n\n        wrapper_dict = {}\n        for name in ('list1', 'list2'):\n            getter = lambda arg=None, name=name: getattr(obj, name)\n            wrapper_dict[name] = Property('QVariantList', getter)\n        wrapper = type('PyObj', (QObject,), wrapper_dict)\n\n        view = QWebView()\n        view.page().mainFrame().addToJavaScriptWindowObject('py_obj', wrapper())\n        view.setHtml(html)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/bug_959.py",
    "content": "from PySide.QtCore import QObject, Slot, QTimer\nfrom PySide.QtWebKit import QWebView\nfrom PySide.QtGui import QApplication\nfrom PySide import QtCore\n\nimport sys\nimport unittest\n\nfrom helper import UsesQApplication\n\nfunctionID = -1\ncurrentWebView = None\n\nclass JSFuncs(QObject):\n    @Slot(str,result=str)\n    def slot_str_str(self, x):\n        global functionID\n        functionID = 0\n        return x.upper()\n\n    @Slot(str,result='QVariant')\n    def slot_str_list(self, x):\n        global functionID\n        functionID = 1\n        return [x, x]\n\n    @Slot('QStringList',result=str)\n    def slot_strlist_str(self, x):\n        global functionID\n        functionID = 2\n        return x[-1]\n\n    @Slot('QVariant',result=str)\n    def slot_variant_str(self, x):\n        global functionID\n        functionID = 3\n        return str(x)\n\n    @Slot('QVariantList',result=str)\n    def slot_variantlist_str(self, x):\n        global functionID\n        functionID = 4\n        return str(x[-1])\n\n    @Slot('QVariantMap',result=str)\n    def slot_variantmap_str(self, x):\n        global functionID\n        functionID = 5\n        return str(x[\"foo\"])\n\n\n\nPAGE_DATA = \"data:text/html,<!doctype html><html><body onload='%s'></body></html>\"\nFUNCTIONS_LIST = ['jsfuncs.slot_str_str(\"hello\")',\n                  'jsfuncs.slot_str_list(\"hello\")',\n                  'jsfuncs.slot_strlist_str([\"hello\",\"world\"])',\n                  'jsfuncs.slot_variant_str(\"hello\")',\n                  'jsfuncs.slot_variantlist_str([\"hello\",\"world\"])',\n                  'jsfuncs.slot_variantmap_str({\"foo\": \"bar\"})']\n\n\ndef onLoadFinished( result ):\n    QTimer.singleShot( 100, createNextWebView )\n\ndef createNextWebView():\n    global functionID\n\n    nListCount = len(FUNCTIONS_LIST) - 1\n    functionID = functionID + 1\n    print functionID\n\n    if functionID < nListCount:\n        createWebView( functionID )\n    else:\n        QTimer.singleShot(300, QApplication.instance().quit)\n\n\ndef createWebView( nIndex ):\n    global functionID\n    global currentWebView\n\n    functionID = nIndex\n    currentWebView = QWebView()\n    currentWebView._jsfuncs = JSFuncs()\n    currentWebView.page().mainFrame().addToJavaScriptWindowObject(\"jsfuncs\", currentWebView._jsfuncs)\n    QObject.connect( currentWebView, QtCore.SIGNAL('loadFinished( bool )'), onLoadFinished )\n    currentWebView.load(PAGE_DATA % FUNCTIONS_LIST[ nIndex ])\n    currentWebView.show()\n\nclass Bug959(UsesQApplication):\n\n    def testJavaScriptInWebViewForCrash( self ):\n        # wait for the webview load to be finished before creating the next webview\n        # don't create the webview inside of onLoadFinished\n        # also call onLoadFinished with the correct number of variables\n        createNextWebView()\n        self.app.exec_()\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/fox.html",
    "content": "<html>\n<title>Title</title>\n<meta name=\"description\" content=\"PySide Test METADATA.\" />\n<body>\n<p>The quick <b>brown</b> fox <i>jumps</i> over the lazy dog.</p>\n</body>\n</html>\n"
  },
  {
    "path": "tests/QtWebKit/qml_plugin_test.py",
    "content": "\nimport os\nimport sys\nimport unittest\n\nfrom PySide.QtCore import QUrl, QTimer\nfrom PySide.QtGui import QApplication, QLabel\nfrom PySide.QtWebKit import QWebPluginFactory, QWebView, QWebSettings\n\nfrom helper import UsesQApplication\n\nclass PluginFactory(QWebPluginFactory):\n\n    def plugins(self):\n        plugins = []\n\n        mime = self.MimeType()\n        mime.name = 'DummyFile'\n        mime.fileExtensions = ['.pys']\n\n        plugin = self.Plugin()\n        plugin.name = 'DummyPlugin'\n        plugin.mimeTypes = [mime]\n\n        plugins.append(plugin)\n\n        return plugins\n\n    def create(self, mimeType, url, argumentNames, argumentValues):\n        if mimeType != 'application/x-dummy':\n            return None\n\n        for name, value in zip(argumentNames, argumentValues):\n            if name == 'text':\n                text = value\n        else:\n            text = \"Webkit plugins!\"\n\n        widget = QLabel(text)\n        return widget\n\nclass TestPlugin(UsesQApplication):\n\n    def testPlugin(self):\n        view = QWebView()\n        fac = PluginFactory()\n        view.page().setPluginFactory(fac)\n        QWebSettings.globalSettings().setAttribute(QWebSettings.PluginsEnabled, True)\n\n        view.load(QUrl(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'qmlplugin', 'index.html')))\n\n        view.resize(840, 600)\n        view.show()\n\n        QTimer.singleShot(500, self.app.quit)\n\n        self.app.exec_()\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/qmlplugin/dummy.pys",
    "content": "Foobar!\n"
  },
  {
    "path": "tests/QtWebKit/qmlplugin/index.html",
    "content": "<html><body>\n    <h1>Custom Plugin</h1>\n    <object type=\"application/x-dummy\" data=\"./dummy.pys\" text=\"My text\">\n    </object>\n</body></html>\n"
  },
  {
    "path": "tests/QtWebKit/qvariantlist_property_test.py",
    "content": "import unittest\nfrom PySide.QtCore import Property, QObject\nfrom PySide.QtWebKit import QWebView\nfrom helper import TimedQApplication\n\nclass TestLoadFinished(TimedQApplication):\n\n    def setUp(self):\n        TimedQApplication.setUp(self, timeout=1000)\n\n    def tearDown(self):\n        TimedQApplication.tearDown(self)\n\n    def testQVariantListProperty(self):\n        class Obj(object):\n            list = ['foo', 'bar', 'baz']\n\n        obj = Obj()\n\n        wrapper_dict = {}\n        for name in ['list']:\n            getter = lambda arg=None, name=name: getattr(obj, name)\n            wrapper_dict[name] = Property('QVariantList', getter)\n        wrapper = type('PyObj', (QObject,), wrapper_dict)\n\n        view = QWebView()\n        frame = view.page().mainFrame()\n        frame.addToJavaScriptWindowObject('py_obj', wrapper())\n\n        html = '''\n        <html><body>\n        <script type=\"text/javascript\">\n        document.write(py_obj.list)\n        </script>\n        </body></html>\n        '''\n        view.setHtml(html)\n        view.show()\n        self.app.exec_()\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/shouldInterruptjavascript_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide import QtCore, QtWebKit\n\nfrom helper import UsesQApplication\n\nclass QWebPageHeadless(QtWebKit.QWebPage):\n    # FIXME: This is not working, the slot is not overriden!\n    # http://doc.qt.nokia.com/4.7-snapshot/qwebpage.html#shouldInterruptJavaScript\n    @QtCore.Slot()\n    def shouldInterruptJavaScript(self):\n        self._interrupted = True\n        QtCore.QTimer.singleShot(300, self._app.quit)\n        return True\n\nclass TestSlotOverride(UsesQApplication):\n    def testFunctionCall(self):\n        page = QWebPageHeadless()\n        page._interrupted = False\n        page._app = self.app\n        page.mainFrame().setHtml('<script>while(1);</script>')\n        self.app.exec_()\n        self.assertTrue(page._interrupted)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/webframe_test.py",
    "content": "import unittest\nimport sys\n\nfrom PySide.QtCore import QObject, SIGNAL, QUrl\nfrom PySide.QtWebKit import *\nfrom PySide.QtNetwork import QNetworkRequest\n\nfrom helper import adjust_filename, UsesQApplication\n\n\n\nclass TestWebFrame(UsesQApplication):\n    def load_finished(self, ok):\n        self.assert_(ok)\n        page = self.view.page()\n        self.assert_(page)\n        frame = page.mainFrame()\n        self.assert_(frame)\n        meta = frame.metaData()\n        self.assertEqual(meta['description'], ['PySide Test METADATA.'])\n        self.app.quit()\n\n    def testMetaData(self):\n        self.view = QWebView()\n        QObject.connect(self.view, SIGNAL('loadFinished(bool)'),\n                        self.load_finished)\n        url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__))\n        self.view.setUrl(url)\n        self.app.exec_()\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtWebKit/webpage_test.py",
    "content": "\n'''Test cases for QWebPage'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL, QUrl\nfrom PySide.QtWebKit import QWebPage\nfrom PySide.QtNetwork import QNetworkAccessManager\n\nfrom helper import adjust_filename, TimedQApplication\n\n#Define a global timeout because TimedQApplication uses a singleton!\n#Use a value big enough to run all the tests.\nTIMEOUT = 1000\n\nclass TestFindText(TimedQApplication):\n    '''Test cases for finding text'''\n\n    def setUp(self):\n        TimedQApplication.setUp(self, timeout=TIMEOUT)\n        self.page = QWebPage()\n        QObject.connect(self.page, SIGNAL('loadFinished(bool)'),\n                        self.load_finished)\n        self.called = False\n\n    def tearDown(self):\n        #Release resources\n        del self.page\n        self.called = False\n        TimedQApplication.tearDown(self)\n\n    def testFindSelectText(self):\n        url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__))\n        self.page.mainFrame().load(url)\n        self.app.exec_()\n        self.assert_(self.called)\n\n    def load_finished(self, ok):\n        #Callback to check if load was successful\n        if ok:\n            self.called = True\n            self.assert_(self.page.findText('fox'))\n            self.assertEqual(self.page.selectedText(), 'fox')\n        self.app.quit()\n\nclass SetNetworkAccessManagerCase(TimedQApplication):\n\n    def setUp(self):\n        TimedQApplication.setUp(self, timeout=TIMEOUT)\n\n    def testSetNetworkAccessManager(self):\n        page = QWebPage()\n        manager = QNetworkAccessManager()\n        page.setNetworkAccessManager(manager)\n\n    def testNetWorkAccessManager(self):\n        page = QWebPage()\n        a = page.networkAccessManager()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtWebKit/webview_test.py",
    "content": "\n'''Test cases for QWebView'''\n\nimport unittest\nimport py3kcompat as py3k\nimport sys\n\nfrom PySide.QtCore import QObject, SIGNAL, QUrl\nfrom PySide.QtWebKit import QWebPage, QWebView\nfrom PySide.QtNetwork import QNetworkRequest\n\nfrom helper import adjust_filename, TimedQApplication\n\n\nclass testWebPage(QWebPage):\n    def sayMyName(self):\n        return 'testWebPage'\n\nclass TestLoadFinished(TimedQApplication):\n    '''Test case for signal QWebView.loadFinished(bool)'''\n\n    def setUp(self):\n        #Acquire resources\n        TimedQApplication.setUp(self, timeout=1000)\n        self.view = QWebView()\n        QObject.connect(self.view, SIGNAL('loadFinished(bool)'),\n                        self.load_finished)\n        self.called = False\n\n    def tearDown(self):\n        #Release resources\n        del self.view\n        self.called = False\n        TimedQApplication.tearDown(self)\n\n    def testLoadFinishedFromFile(self):\n        url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__))\n        self.view.setUrl(url)\n        self.app.exec_()\n\n        self.assert_(self.called)\n\n    def testSetPageAndGetPage(self):\n        twp = testWebPage()\n        self.view.setPage(twp)\n        del twp\n        p = self.view.page()\n        self.assertEqual(p.sayMyName(), 'testWebPage')\n\n        # Setting the same webpage should not incref the python obj\n        refCount = sys.getrefcount(p)\n        self.view.setPage(p)\n        self.assertEquals(sys.getrefcount(p), refCount)\n\n        # Changing the webpage obj should decref the old one\n        twp2 = testWebPage()\n        self.view.setPage(twp2)\n        self.assertEquals(sys.getrefcount(p), refCount - 1)\n\n    def load_finished(self, ok):\n        #Callback to check if load was successful\n        self.app.quit()\n        if ok:\n            self.called = True\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/QtXml/CMakeLists.txt",
    "content": "PYSIDE_TEST(qdomdocument_test.py)\nPYSIDE_TEST(qxmlsimplereader_test.py)\n"
  },
  {
    "path": "tests/QtXml/qdomdocument_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtCore import QByteArray\nfrom PySide.QtXml import QDomDocument, QDomElement\n\nclass QDomDocumentTest(unittest.TestCase):\n\n    def setUp(self):\n        self.dom = QDomDocument()\n\n        self.goodXmlData = QByteArray('''\n        <typesystem package=\"PySide.QtXml\">\n            <value-type name=\"QDomDocument\"/>\n            <value-type name=\"QDomElement\"/>\n        </typesystem>\n        ''')\n\n        self.badXmlData = QByteArray('''\n        <typesystem package=\"PySide.QtXml\">\n            <value-type name=\"QDomDocument\">\n        </typesystem>\n        ''')\n\n    def tearDown(self):\n        del self.dom\n        del self.goodXmlData\n        del self.badXmlData\n\n    def testQDomDocumentSetContentWithBadXmlData(self):\n        '''Sets invalid xml as the QDomDocument contents.'''\n        ok, errorStr, errorLine, errorColumn = self.dom.setContent(self.badXmlData, True)\n        self.assertFalse(ok)\n        self.assertEqual(errorStr, 'tag mismatch')\n        self.assertEqual(errorLine, 4)\n        self.assertEqual(errorColumn, 21)\n\n    def testQDomDocumentSetContentWithGoodXmlData(self):\n        '''Sets valid xml as the QDomDocument contents.'''\n        ok, errorStr, errorLine, errorColumn = self.dom.setContent(self.goodXmlData, True)\n        self.assert_(ok)\n        self.assertEqual(errorStr, '')\n        self.assertEqual(errorLine, 0)\n        self.assertEqual(errorColumn, 0)\n\n    def testQDomDocumentData(self):\n        '''Checks the QDomDocument elements for the valid xml contents.'''\n\n        def checkAttribute(element, attribute, value):\n            self.assert_(isinstance(root, QDomElement))\n            self.assertFalse(element.isNull())\n            self.assert_(element.hasAttribute(attribute))\n            self.assertEqual(element.attribute(attribute), value)\n\n        ok, errorStr, errorLine, errorColumn = self.dom.setContent(self.goodXmlData, True)\n        root = self.dom.documentElement()\n        self.assertEqual(root.tagName(), 'typesystem')\n        checkAttribute(root, 'package', 'PySide.QtXml')\n\n        child = root.firstChildElement('value-type')\n        checkAttribute(child, 'name', 'QDomDocument')\n\n        child = child.nextSiblingElement('value-type')\n        checkAttribute(child, 'name', 'QDomElement')\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtXml/qxmlsimplereader_test.py",
    "content": "#!/usr/bin/python\nimport unittest\nfrom PySide.QtXml import QXmlSimpleReader\n\nclass QXmlSimpleReaderTest(unittest.TestCase):\n\n    def testQXmlSimpleReaderInstatiation(self):\n        '''QXmlSimpleReader must be a concrete class not an abstract one.'''\n        reader = QXmlSimpleReader()\n\n    def testQXmlSimpleReaderFeatures(self):\n        '''Calls the QXmlSimpleReader.features method. The features checked\n        (at least the first two) can be found in the QXmlSimpleReader documentation:\n        http://qt.nokia.com/doc/4.6/qxmlsimplereader.html#setFeature\n        '''\n        reader = QXmlSimpleReader()\n        hasFeature, ok = reader.feature('http://xml.org/sax/features/namespaces')\n        self.assertEqual((hasFeature, ok), (True, True))\n\n        hasFeature, ok = reader.feature('http://xml.org/sax/features/namespace-prefixes')\n        self.assertEqual((hasFeature, ok), (False, True))\n\n        hasFeature, ok = reader.feature('foobar')\n        self.assertEqual((hasFeature, ok), (False, False))\n\n    def testQXmlSimpleReaderProperty(self):\n        '''Tries to get a non existent property.'''\n        reader = QXmlSimpleReader()\n        prop, ok = reader.property('foo')\n        self.assertEqual((prop, ok), (None, False))\n        reader.setProperty('foo', 'Something')\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/QtXmlPatterns/CMakeLists.txt",
    "content": "PYSIDE_TEST(import_test.py)\n"
  },
  {
    "path": "tests/QtXmlPatterns/import_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom PySide.QtCore import *\nfrom PySide.QtXmlPatterns import QXmlSchema\nfrom helper import UsesQCoreApplication\n\nclass QXmlPatternsTest(UsesQCoreApplication):\n\n    def testSchema(self):\n        data = QByteArray('''<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\n                              <xsd:schema\n                                 xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\"\n                                  xmlns=\\\"http://qt.nokia.com/xmlschematest\\\"\n                                  targetNamespace=\\\"http://qt.nokia.com/xmlschematest\\\"\n                                  version=\\\"1.0\\\"\n                                  elementFormDefault=\\\"qualified\\\">\n                              </xsd:schema>''')\n\n        buf = QBuffer(data)\n        buf.open(QIODevice.ReadOnly)\n\n        schema = QXmlSchema()\n        schema.load(buf)\n        self.assert_(schema.isValid())\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/mac/CMakeLists.txt",
    "content": "PYSIDE_TEST(qmacstyle_test.py)\n"
  },
  {
    "path": "tests/mac/qmacstyle_test.py",
    "content": "from PySide.QtGui import QApplication, QLabel, QMacStyle\nfrom PySide.QtCore import QObject\n\nimport unittest\n\nfrom helper import UsesQApplication\n\nclass QMacStyleTest(UsesQApplication):\n    def testWidgetStyle(self):\n        w = QLabel('Hello')\n        self.assertTrue(isinstance(w.style(), QMacStyle))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/manually/README.txt",
    "content": "To run these tests is necessary some manuall input (most of then not supported by QTest[1]),\nbecause of that this is not part of automatic test context.\n\n\n[1]http://bugreports.qt.nokia.com/browse/QTBUG-13397\n"
  },
  {
    "path": "tests/manually/bug_841.py",
    "content": "import sys\r\n\r\nfrom PySide.QtGui import QStandardItem, QStandardItemModel, QMainWindow, QTreeView, QAbstractItemView, QApplication, QMessageBox\r\n\r\nclass Item(QStandardItem):\r\n    def __init__(self, text):\r\n        super(Item, self).__init__()\r\n        self.setText(text)\r\n        self.setDragEnabled(True)\r\n        self.setDropEnabled(True)\r\n\r\n    def clone(self):\r\n        ret = Item(self.text())\r\n        return ret\r\n\r\nclass Project(QStandardItemModel):\r\n    def __init__(self):\r\n        super(Project, self).__init__()\r\n        self.setItemPrototype(Item(\"Prototype\"))\r\n        # add some items so we have stuff to move around\r\n        self.appendRow(Item(\"ABC\"))\r\n        self.appendRow(Item(\"DEF\"))\r\n        self.appendRow(Item(\"GHI\"))\r\n\r\nclass MainWindow(QMainWindow):\r\n    def __init__(self):\r\n        super(MainWindow, self).__init__()\r\n\r\n        self.model = Project()\r\n        self.view = QTreeView(self)\r\n        self.view.setModel(self.model)\r\n        self.view.setDragEnabled(True)\r\n        self.view.setDragDropMode(QAbstractItemView.InternalMove)\r\n        self.setCentralWidget(self.view)\r\n\r\n    def mousePressEvent(self, e):\r\n        print e.x(), e.y()\r\n        return QMainWindow.mousePressEvent(self, e)\r\n\r\ndef main():\r\n    app = QApplication(sys.argv)\r\n    w = MainWindow()\r\n    w.show()\r\n    QMessageBox.information(None, \"Info\", \"Just drag and drop the items.\")\r\n    sys.exit(app.exec_())\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "tests/phonon/CMakeLists.txt",
    "content": "if (NOT WIN32 OR NOT ${QTVERSION} VERSION_EQUAL 4.7.1)\n    # Any usage of Phonon::createPath will fail on Win32 and Qt 4.7.1.\n    # Check: http://bugreports.qt.nokia.com/browse/QTBUG-13062\n    PYSIDE_TEST(basic_playing_test.py)\nendif()\nPYSIDE_TEST(bug_328.py)\nPYSIDE_TEST(bug_786.py)\nPYSIDE_TEST(capabilities_test.py)\nPYSIDE_TEST(qobjectdescription_test.py)\n"
  },
  {
    "path": "tests/phonon/basic_playing_test.py",
    "content": "\nimport os\nimport unittest\nfrom PySide.phonon import Phonon\nfrom helper import UsesQCoreApplication\n\nsample_file = os.path.join(os.path.dirname(__file__), 'tone.wav')\n\ndef checkBackendCapabilities(func):\n    def function(self, *args, **kw):\n        if Phonon.BackendCapabilities.isMimeTypeAvailable('audio/x-wav'):\n            func(self, *args, **kw)\n        else:\n            print('Wav format not supported! Playback test skipped!')\n    return function\n\n\nclass TestSimplePlaying(UsesQCoreApplication):\n    def setUp(self):\n        super(TestSimplePlaying, self).setUp()\n        self.app.setApplicationName('Dummy')\n        self.source = Phonon.MediaSource(sample_file)\n        self.media = Phonon.MediaObject()\n        self.media.setCurrentSource(self.source)\n\n        self.media.finished.connect(self.app.quit)\n        self.called = False\n\n        # prevent locking with:\n        # request to play a stream, but no valid audio ...\n        self.output = Phonon.AudioOutput()\n        self.path = Phonon.createPath(self.media, self.output)\n\n    def tearDown(self):\n        super(TestSimplePlaying, self).tearDown()\n        del self.path\n        del self.output\n        del self.media\n        del self.source\n\n    @checkBackendCapabilities\n    def testFinishedSignal(self):\n        # Should pass if finished() is called\n        self.media.play()\n        self.app.exec_()\n\n    def testMediaSource(self):\n        self.assertEqual(self.media.currentSource(), self.source)\n\n    def testPathCreation(self):\n        # FIXME Both functions below are not exported by PyQt4\n        self.assertEqual(self.path.sink(), self.output)\n        self.assertEqual(self.path.source(), self.media)\n\n    def state_cb(self, newState, OldState):\n        self.called = True\n\n    @checkBackendCapabilities\n    def testStateChanged(self):\n        self.media.stateChanged['Phonon::State', 'Phonon::State'].connect(self.state_cb)\n        self.media.play()\n        self.app.exec_()\n        self.assertTrue(self.called)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/phonon/bug_328.py",
    "content": "#!/usr/bin/python\n\nfrom PySide import QtCore, QtGui\nfrom PySide.phonon import Phonon\nimport unittest\n\nclass TestBug(unittest.TestCase):\n    def myCB(self):\n        pass\n\n    def testForNotifierSignals(self):\n        # this test only check if the signals are present\n        notifier = Phonon.BackendCapabilities.Notifier()\n        notifier.capabilitiesChanged.connect(self.myCB)\n        notifier.availableAudioOutputDevicesChanged.connect(self.myCB)\n\n        self.assert_(True)\n\n"
  },
  {
    "path": "tests/phonon/bug_786.py",
    "content": "import unittest\nfrom PySide.QtGui import *\nfrom PySide.phonon import *\n\n\nclass TestBug786 (unittest.TestCase):\n\n    def testIt(self):\n        app = QApplication([])\n        app.setApplicationName(\"PySide Phonon Unit Test\")\n        devices = Phonon.BackendCapabilities.availableAudioOutputDevices()\n        if len(devices) > 1:\n            if devices[0].index() != devices[0].index():\n                self.assertNotEqual(devices[0], devices[1])\n            self.assertEqual(devices[0], devices[0])\n\n        effects = Phonon.BackendCapabilities.availableAudioEffects()\n        if len(effects) > 1:\n            self.assertNotEqual(effects[0], effects[1])\n            self.assertEqual(effects[0], effects[0])\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/phonon/capabilities_test.py",
    "content": "\nimport unittest\nimport py3kcompat as py3k\n\nfrom PySide import phonon\n\nfrom helper import UsesQCoreApplication\n\nclass CapabilitiesTest(UsesQCoreApplication):\n    def setUp(self):\n        super(CapabilitiesTest, self).setUp()\n        self.app.setApplicationName(\"Dummy\")\n\n    def tearDown(self):\n        super(CapabilitiesTest, self).tearDown()\n\n\n    def testExists(self):\n        self.assertTrue(phonon.Phonon.BackendCapabilities)\n\n    def testNotifierIdentity(self):\n        # Notifier is a singleton\n        self.assertEqual(phonon.Phonon.BackendCapabilities.notifier(),\n                         phonon.Phonon.BackendCapabilities.notifier())\n\n        self.assertTrue(phonon.Phonon.BackendCapabilities.notifier() is\n                     phonon.Phonon.BackendCapabilities.notifier())\n\n    def testDevices(self):\n        # TODO Improve this test\n        devices = phonon.Phonon.BackendCapabilities.availableAudioOutputDevices()\n        for device in devices:\n            self.assertTrue(isinstance(device, phonon.Phonon.AudioOutputDevice))\n\n    def testMimeTypes(self):\n        # TODO Improve this test\n        mimeTypes = phonon.Phonon.BackendCapabilities.availableMimeTypes()\n        for mime in mimeTypes:\n            self.assertTrue(isinstance(mime, py3k.unicode))\n\n    def testAudioEffects(self):\n        # TODO Improve this test\n        effects = phonon.Phonon.BackendCapabilities.availableAudioEffects()\n        for effect in effects:\n            self.assertTrue(isinstance(effect, phonon.Phonon.EffectDescription))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/phonon/qobjectdescription_test.py",
    "content": "import unittest\n\nfrom PySide.QtCore import *\nfrom PySide import phonon\n\nfrom helper import UsesQCoreApplication\n\nclass CapabilitiesTest(UsesQCoreApplication):\n    def testFromIndex(self):\n        devices = phonon.Phonon.BackendCapabilities.availableAudioOutputDevices()\n        for device in devices:\n            self.assert_(isinstance(device, phonon.Phonon.AudioOutputDevice))\n            other = phonon.Phonon.AudioOutputDevice.fromIndex(device.index())\n            self.assertEqual(device.name(), other.name())\n            self.assertEqual(device.index(), other.index())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/pysidetest/CMakeLists.txt",
    "content": "project(pysidetest)\nproject(testbinding)\n\ncmake_minimum_required(VERSION 2.6)\n\nset(QT_USE_QTCORE 1)\ninclude(${QT_USE_FILE})\nadd_definitions(${QT_DEFINITIONS})\nadd_definitions(-DQT_SHARED)\nadd_definitions(-DRXX_ALLOCATOR_INIT_0)\n\nset(pysidetest_SRC\ntestobject.cpp\ntestview.cpp\nhiddenobject.cpp\n)\n\nset(pysidetest_MOC_HEADERS\ntestobject.h\ntestview.h\nhiddenobject.h\n)\n\nqt4_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS})\n\nset(testbinding_SRC\n${CMAKE_CURRENT_BINARY_DIR}/testbinding/testobject_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/testbinding/intvalue_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/testbinding/pysidecpp_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/testbinding/pysidecpp_testobjectwithnamespace_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/testbinding/pysidecpp2_testobjectwithoutnamespace_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/testbinding/testview_wrapper.cpp\n${CMAKE_CURRENT_BINARY_DIR}/testbinding/testbinding_module_wrapper.cpp\n)\n\nadd_custom_command(OUTPUT ${testbinding_SRC}\nCOMMAND ${SHIBOKEN_BINARY} ${GENERATOR_EXTRA_FLAGS}\n        ${CMAKE_CURRENT_SOURCE_DIR}/pysidetest_global.h\n        --include-paths=${pyside_BINARY_DIR}${PATH_SEP}${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}${PATH_SEP}${QT_QTCORE_INCLUDE_DIR}${PATH_SEP}${QT_QTGUI_INCLUDE_DIR}\n        --typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}${PATH_SEP}${QtCore_BINARY_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}\n        --output-directory=${CMAKE_CURRENT_BINARY_DIR}\n        ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_pysidetest.xml\nWORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}\nCOMMENT \"Running generator for test binding...\"\n)\n\ninclude_directories(${CMAKE_CURRENT_SOURCE_DIR}\n                    ${CMAKE_CURRENT_BINARY_DIR}\n                    ${QT_INCLUDE_DIR}\n                    ${QT_QTCORE_INCLUDE_DIR}\n                    ${QT_QTGUI_INCLUDE_DIR}\n                    ${SHIBOKEN_INCLUDE_DIR}\n                    ${pyside_SOURCE_DIR}\n                    ${QtCore_BINARY_DIR}/PySide/QtCore\n                    ${QtGui_BINARY_DIR}/PySide/QtGui\n                    ${libpyside_SOURCE_DIR}\n                    ${SHIBOKEN_PYTHON_INCLUDE_DIR})\n\nadd_library(pysidetest SHARED ${pysidetest_SRC} ${pysidetest_MOC_SRC})\ntarget_link_libraries(pysidetest ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})\n\nadd_library(testbinding MODULE ${testbinding_SRC})\nset_property(TARGET testbinding PROPERTY PREFIX \"\")\nif(WIN32)\n    set_target_properties(testbinding PROPERTIES SUFFIX \".pyd\")\nendif()\ntarget_link_libraries(testbinding\n                      pysidetest\n                      pyside\n                      ${PYTHON_LIBRARIES}\n                      ${SHIBOKEN_LIBRARY}\n                      ${QT_QTCORE_LIBRARY}\n                      ${QT_QTGUI_LIBRARY}\n                      ${SBK_PYTHON_LIBRARIES})\n\nadd_dependencies(testbinding pyside QtCore QtGui libpyside pysidetest)\n\nPYSIDE_TEST(application_test.py)\nPYSIDE_TEST(decoratedslot_test.py)\nPYSIDE_TEST(delegatecreateseditor_test.py)\nPYSIDE_TEST(enum_test.py)\nPYSIDE_TEST(homonymoussignalandmethod_test.py)\nPYSIDE_TEST(list_signal_test.py)\nPYSIDE_TEST(modelview_test.py)\nPYSIDE_TEST(qvariant_test.py)\nPYSIDE_TEST(signalandnamespace_test.py)\nPYSIDE_TEST(signalwithdefaultvalue_test.py)\nPYSIDE_TEST(signalemissionfrompython_test.py)\nPYSIDE_TEST(version_test.py)\nPYSIDE_TEST(typedef_signal_test.py)\nPYSIDE_TEST(bug_1016.py)\nPYSIDE_TEST(utils_test.py)\n"
  },
  {
    "path": "tests/pysidetest/application_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom testbinding import TestObject\nfrom PySide.QtGui import QApplication\n\nclass QApplicationInstance(unittest.TestCase):\n\n    def appDestroyed(self):\n        sefl.assert_(False)\n\n    def testInstanceObject(self):\n        TestObject.createApp()\n        app1 = QApplication.instance()\n        app2 = QApplication.instance()\n        app1.setObjectName(\"MyApp\")\n        self.assertEqual(app1, app2)\n        self.assertEqual(app2.objectName(), app1.objectName())\n        app1.destroyed.connect(self.appDestroyed)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/bug_1016.py",
    "content": "from testbinding import *\nimport unittest\n\nclass TestBug1016 (unittest.TestCase):\n\n    def testIt(self):\n        obj = getHiddenObject()\n        self.assertEqual(obj.callMe(), None)\n        self.assertTrue(obj.wasCalled())\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
  },
  {
    "path": "tests/pysidetest/decoratedslot_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom PySide.QtCore import QObject\nfrom testbinding import TestObject\n\nclass Receiver(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n        self.called = False\n\n    def ReceiverDecorator(func):\n        def decoratedFunction(self, *args, **kw):\n            func(self, *args, **kw)\n        return decoratedFunction\n\n    # This method with the same name of the internal decorated function\n    # is here to test the binding capabilities.\n    def decoratedFunction(self):\n        pass\n\n    @ReceiverDecorator\n    def slot(self):\n        self.called = True\n\n\nclass DecoratedSlotTest(unittest.TestCase):\n\n    def testCallingOfDecoratedSlot(self):\n        obj = TestObject(0)\n        receiver = Receiver()\n        obj.staticMethodDouble.connect(receiver.slot)\n        obj.emitStaticMethodDoubleSignal()\n        self.assert_(receiver.called)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/delegatecreateseditor_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom helper import UsesQApplication\n\nfrom testbinding import TestView\nfrom PySide.QtCore import Qt\nfrom PySide.QtGui import QAbstractItemDelegate, QComboBox\n\nid_text = 'This is me'\n\nclass DelegateDoesntKeepReferenceToEditor(QAbstractItemDelegate):\n    def createEditor(self, parent, option, index):\n        comboBox = QComboBox(parent)\n        comboBox.addItem(id_text)\n        return comboBox\n\n\nclass DelegateKeepsReferenceToEditor(QAbstractItemDelegate):\n    def __init__(self, parent=None):\n        QAbstractItemDelegate.__init__(self, parent)\n        self.comboBox = QComboBox()\n        self.comboBox.addItem(id_text)\n\n    def createEditor(self, parent, option, index):\n        self.comboBox.setParent(parent)\n        return self.comboBox\n\n\nclass EditorCreatedByDelegateTest(UsesQApplication):\n\n    def testDelegateDoesntKeepReferenceToEditor(self):\n        view = TestView(None)\n        delegate = DelegateDoesntKeepReferenceToEditor()\n        view.setItemDelegate(delegate)\n        editor = view.getEditorWidgetFromItemDelegate()\n        self.assertEqual(type(editor), QComboBox)\n        self.assertEqual(editor.count(), 1)\n        self.assertEqual(editor.itemData(0, Qt.DisplayRole), id_text)\n        editor.metaObject()\n\n    def testDelegateKeepsReferenceToEditor(self):\n        view = TestView(None)\n        delegate = DelegateKeepsReferenceToEditor()\n        view.setItemDelegate(delegate)\n        editor = view.getEditorWidgetFromItemDelegate()\n        self.assertEqual(type(editor), QComboBox)\n        self.assertEqual(editor.count(), 1)\n        self.assertEqual(editor.itemData(0, Qt.DisplayRole), id_text)\n        editor.metaObject()\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/enum_test.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport unittest\nfrom testbinding import Enum1, TestObjectWithoutNamespace\n\nclass ListConnectionTest(unittest.TestCase):\n\n    def testEnumVisibility(self):\n        self.assertEqual(Enum1.Option1, 1)\n        self.assertEqual(Enum1.Option2, 2)\n        self.assertEqual(TestObjectWithoutNamespace.Enum2.Option3, 3)\n        self.assertEqual(TestObjectWithoutNamespace.Enum2.Option4, 4)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/hiddenobject.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"hiddenobject.h\"\n\nvoid HiddenObject::callMe()\n{\n    m_called = true;\n}\n\nbool HiddenObject::wasCalled()\n{\n    return m_called;\n}\n\nQObject* getHiddenObject()\n{\n    return new HiddenObject();\n}\n"
  },
  {
    "path": "tests/pysidetest/hiddenobject.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef HIDDENOBJECT_H\n#define HIDDENOBJECT_H\n\n#ifdef pysidetest_EXPORTS\n#define PYSIDE_EXPORTS 1\n#endif\n#include \"pysidemacros.h\"\n#include <QObject>\n\n// This class shouldn't be exported!\nclass HiddenObject : public QObject\n{\n    Q_OBJECT\npublic:\n    HiddenObject() : m_called(false) {}\n    Q_INVOKABLE void callMe();\npublic slots:\n    bool wasCalled();\nprivate:\n    bool m_called;\n};\n\n// Return a instance of HiddenObject\nPYSIDE_API QObject* getHiddenObject();\n\n\n#endif\n"
  },
  {
    "path": "tests/pysidetest/homonymoussignalandmethod_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom testbinding import TestObject\n\n'''Tests the behaviour of homonymous signals and slots.'''\n\nclass HomonymousSignalAndMethodTest(unittest.TestCase):\n\n    def setUp(self):\n        self.value = 123\n        self.called = False\n        self.obj = TestObject(self.value)\n\n    def tearDown(self):\n        del self.value\n        del self.called\n        del self.obj\n\n    def testIdValueSignalEmission(self):\n        def callback(idValue):\n            self.assertEqual(idValue, self.value)\n        self.obj.idValue.connect(callback)\n        self.obj.emitIdValueSignal()\n\n    def testStaticMethodDoubleSignalEmission(self):\n        def callback():\n            self.called = True\n        self.obj.staticMethodDouble.connect(callback)\n        self.obj.emitStaticMethodDoubleSignal()\n        self.assert_(self.called)\n\n    def testSignalNotCallable(self):\n        self.assertRaises(TypeError, self.obj.justASignal)\n\n    def testCallingInstanceMethodWithArguments(self):\n        self.assertRaises(TypeError, TestObject.idValue, 1)\n\n    def testCallingInstanceMethodWithoutArguments(self):\n        self.assertRaises(TypeError, TestObject.idValue)\n\n    def testHomonymousSignalAndMethod(self):\n        self.assertEqual(self.obj.idValue(), self.value)\n\n    def testHomonymousSignalAndStaticMethod(self):\n        self.assertEqual(TestObject.staticMethodDouble(3), 6)\n\n    def testHomonymousSignalAndStaticMethodFromInstance(self):\n        self.assertEqual(self.obj.staticMethodDouble(4), 8)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/list_signal_test.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport unittest\nfrom testbinding import TestObject\nfrom PySide.QtCore import QObject\n\nclass ListConnectionTest(unittest.TestCase):\n\n    def childrenChanged(self, children):\n        self._child = children[0]\n\n    def testConnection(self):\n        o = TestObject(0)\n        c = QObject()\n        c.setObjectName(\"child\")\n        self._child = None\n        o.childrenChanged.connect(self.childrenChanged)\n        o.addChild(c)\n        self.assertEquals(self._child.objectName(), \"child\")\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/modelview_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nimport py3kcompat as py3k\nfrom testbinding import TestView\nfrom PySide.QtCore import QAbstractListModel, QObject, QModelIndex\n\n'''Tests model/view relationship.'''\n\nobject_name = 'test object'\n\nclass MyObject(QObject):\n    pass\n\nclass ListModelKeepsReference(QAbstractListModel):\n    def __init__(self, parent=None):\n        QAbstractListModel.__init__(self, parent)\n        self.obj = MyObject()\n        self.obj.setObjectName(object_name)\n\n    def rowCount(self, parent=QModelIndex()):\n        return 1\n\n    def data(self, index, role):\n        return self.obj\n\nclass ListModelDoesntKeepsReference(QAbstractListModel):\n    def rowCount(self, parent=QModelIndex()):\n        return 1\n\n    def data(self, index, role):\n        obj = MyObject()\n        obj.setObjectName(object_name)\n        return obj\n\nclass ListModelThatReturnsString(QAbstractListModel):\n    def rowCount(self, parent=QModelIndex()):\n        return 1\n\n    def data(self, index, role):\n        self.obj = 'string'\n        return self.obj\n\n\nclass ModelViewTest(unittest.TestCase):\n\n    def testListModelDoesntKeepsReference(self):\n        model = ListModelDoesntKeepsReference()\n        view = TestView(model)\n        obj = view.getData()\n        self.assertEqual(type(obj), MyObject)\n        self.assertEqual(obj.objectName(), object_name)\n        obj.metaObject()\n\n    def testListModelKeepsReference(self):\n        model = ListModelKeepsReference()\n        view = TestView(model)\n        obj = view.getData()\n        self.assertEqual(type(obj), MyObject)\n        self.assertEqual(obj.objectName(), object_name)\n\n    def testListModelThatReturnsString(self):\n        model = ListModelThatReturnsString()\n        view = TestView(model)\n        obj = view.getData()\n        self.assertEqual(type(obj), py3k.unicode)\n        self.assertEqual(obj, 'string')\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/pysidetest_global.h",
    "content": "// PySide global.h file\n#include \"pyside_global.h\"\n#include \"testobject.h\"\n#include \"testview.h\"\n#define PYSIDE_API\n#include \"hiddenobject.h\"\n"
  },
  {
    "path": "tests/pysidetest/qvariant_test.py",
    "content": "import unittest\n\nfrom testbinding import TestObject\nfrom PySide.QtCore import Qt\nfrom PySide.QtGui import QKeySequence\n\nfrom helper import UsesQApplication\n\nclass QVariantTest(UsesQApplication):\n\n    def testQKeySequenceQVariantOperator(self):\n        # bug #775\n        ks = QKeySequence(Qt.SHIFT, Qt.CTRL, Qt.Key_P, Qt.Key_R)\n        self.assertEqual(TestObject.checkType(ks), 76)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/pysidetest/signalandnamespace_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom testbinding import PySideCPP, TestObjectWithoutNamespace\n\nclass ModelViewTest(unittest.TestCase):\n\n    def callback(self, o):\n        self._called = o\n\n    def testWithoutNamespace(self):\n        self._called = None\n        o = PySideCPP.TestObjectWithNamespace(None)\n        o.emitSignal.connect(self.callback)\n        o.emitSignal.emit(o)\n        self.assert_(o == self._called)\n\n        self._called = None\n        o = PySideCPP.TestObjectWithNamespace(None)\n        o.emitSignal.connect(self.callback)\n        o.callSignal(o)\n        self.assert_(o == self._called)\n\n    def testWithNamespace(self):\n        self._called = None\n        o = PySideCPP.TestObjectWithNamespace(None)\n        o.emitSignalWithNamespace.connect(self.callback)\n        o.emitSignalWithNamespace.emit(o)\n        self.assert_(o == self._called)\n\n        self._called = None\n        o = PySideCPP.TestObjectWithNamespace(None)\n        o.emitSignalWithNamespace.connect(self.callback)\n        o.callSignalWithNamespace(o)\n        self.assert_(o == self._called)\n\n\n    def testWithoutNamespace1(self):\n        self._called = None\n        o = TestObjectWithoutNamespace(None)\n        o.emitSignal.connect(self.callback)\n        o.emitSignal.emit(o)\n        self.assert_(o == self._called)\n\n        self._called = None\n        o = TestObjectWithoutNamespace(None)\n        o.emitSignal.connect(self.callback)\n        o.callSignal(o)\n        self.assert_(o == self._called)\n\n    def testWithNamespace1(self):\n        self._called = None\n        o = TestObjectWithoutNamespace(None)\n        o.emitSignalWithNamespace.connect(self.callback)\n        o.emitSignalWithNamespace.emit(o)\n        self.assert_(o == self._called)\n\n        self._called = None\n        o = TestObjectWithoutNamespace(None)\n        o.emitSignalWithNamespace.connect(self.callback)\n        o.callSignalWithNamespace(o)\n        self.assert_(o == self._called)\n\n    def testTypedfWithouNamespace(self):\n        self._called = None\n        o = PySideCPP.TestObjectWithNamespace(None)\n        o.emitSignalWithTypedef.connect(self.callback)\n        o.emitSignalWithTypedef.emit(10)\n        self.assertEqual(10, self._called)\n\n        self._called = None\n        o = PySideCPP.TestObjectWithNamespace(None)\n        o.emitSignalWithTypedef.connect(self.callback)\n        o.callSignalWithTypedef(10)\n        self.assertEqual(10, self._called)\n\n    def testTypedefWithNamespace(self):\n        self._called = None\n        o = TestObjectWithoutNamespace(None)\n        o.emitSignalWithTypedef.connect(self.callback)\n        o.emitSignalWithTypedef.emit(10)\n        self.assertEqual(10, self._called)\n\n        self._called = None\n        o = TestObjectWithoutNamespace(None)\n        o.emitSignalWithTypedef.connect(self.callback)\n        o.callSignalWithTypedef(10)\n        self.assertEqual(10, self._called)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/signalemissionfrompython_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom testbinding import TestObject\nfrom PySide.QtCore import QObject, SIGNAL\n\n'''Tests the behaviour of signals with default values when emitted from Python.'''\n\nclass SignalEmissionFromPython(unittest.TestCase):\n\n    def setUp(self):\n        self.obj1 = TestObject(0)\n        self.obj2 = TestObject(0)\n        self.one_called = 0\n        self.two_called = 0\n\n    def tearDown(self):\n        del self.obj1\n        del self.obj2\n        del self.one_called\n        del self.two_called\n\n    def testConnectNewStyleEmitVoidSignal(self):\n        def callbackOne():\n            self.one_called += 1\n            self.obj2.signalWithDefaultValue.emit()\n        def callbackTwo():\n            self.two_called += 1\n        self.obj1.signalWithDefaultValue.connect(callbackOne)\n        self.obj2.signalWithDefaultValue.connect(callbackTwo)\n        self.obj1.emitSignalWithDefaultValue_void()\n        self.obj2.emitSignalWithDefaultValue_void()\n        self.assertEqual(self.one_called, 1)\n        self.assertEqual(self.two_called, 2)\n\n    def testConnectOldStyleEmitVoidSignal(self):\n        def callbackOne():\n            self.one_called += 1\n            self.obj2.signalWithDefaultValue.emit()\n        def callbackTwo():\n            self.two_called += 1\n        QObject.connect(self.obj1, SIGNAL('signalWithDefaultValue()'), callbackOne)\n        QObject.connect(self.obj2, SIGNAL('signalWithDefaultValue()'), callbackTwo)\n        self.obj1.emitSignalWithDefaultValue_void()\n        self.obj2.emitSignalWithDefaultValue_void()\n        self.assertEqual(self.one_called, 1)\n        self.assertEqual(self.two_called, 2)\n\n    def testConnectNewStyleEmitBoolSignal(self):\n        def callbackOne():\n            self.one_called += 1\n            self.obj2.signalWithDefaultValue[bool].emit(True)\n        def callbackTwo():\n            self.two_called += 1\n        self.obj1.signalWithDefaultValue.connect(callbackOne)\n        self.obj2.signalWithDefaultValue.connect(callbackTwo)\n        self.obj1.emitSignalWithDefaultValue_void()\n        self.obj2.emitSignalWithDefaultValue_void()\n        self.assertEqual(self.one_called, 1)\n        self.assertEqual(self.two_called, 2)\n\n    def testConnectOldStyleEmitBoolSignal(self):\n        def callbackOne():\n            self.one_called += 1\n            self.obj2.signalWithDefaultValue[bool].emit(True)\n        def callbackTwo():\n            self.two_called += 1\n        QObject.connect(self.obj1, SIGNAL('signalWithDefaultValue()'), callbackOne)\n        QObject.connect(self.obj2, SIGNAL('signalWithDefaultValue()'), callbackTwo)\n        self.obj1.emitSignalWithDefaultValue_void()\n        self.obj2.emitSignalWithDefaultValue_void()\n        self.assertEqual(self.one_called, 1)\n        self.assertEqual(self.two_called, 2)\n\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/signalwithdefaultvalue_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom testbinding import TestObject\nfrom PySide.QtCore import QObject, SIGNAL\n\n'''Tests the behaviour of signals with default values.'''\n\nclass SignalWithDefaultValueTest(unittest.TestCase):\n\n    def setUp(self):\n        self.obj = TestObject(0)\n        self.void_called = False\n        self.bool_called = False\n\n    def tearDown(self):\n        del self.obj\n        del self.void_called\n        del self.bool_called\n\n    def testConnectNewStyleEmitVoidSignal(self):\n        def callbackVoid():\n            self.void_called = True\n        def callbackBool(value):\n            self.bool_called = True\n        self.obj.signalWithDefaultValue.connect(callbackVoid)\n        self.obj.signalWithDefaultValue[bool].connect(callbackBool)\n        self.obj.emitSignalWithDefaultValue_void()\n        self.assert_(self.void_called)\n        self.assert_(self.bool_called)\n\n    def testConnectNewStyleEmitBoolSignal(self):\n        def callbackVoid():\n            self.void_called = True\n        def callbackBool(value):\n            self.bool_called = True\n        self.obj.signalWithDefaultValue.connect(callbackVoid)\n        self.obj.signalWithDefaultValue[bool].connect(callbackBool)\n        self.obj.emitSignalWithDefaultValue_bool()\n        self.assert_(self.void_called)\n        self.assert_(self.bool_called)\n\n    def testConnectOldStyleEmitVoidSignal(self):\n        def callbackVoid():\n            self.void_called = True\n        def callbackBool(value):\n            self.bool_called = True\n        QObject.connect(self.obj, SIGNAL('signalWithDefaultValue()'), callbackVoid)\n        QObject.connect(self.obj, SIGNAL('signalWithDefaultValue(bool)'), callbackBool)\n        self.obj.emitSignalWithDefaultValue_void()\n        self.assert_(self.void_called)\n        self.assert_(self.bool_called)\n\n    def testConnectOldStyleEmitBoolSignal(self):\n        def callbackVoid():\n            self.void_called = True\n        def callbackBool(value):\n            self.bool_called = True\n        QObject.connect(self.obj, SIGNAL('signalWithDefaultValue()'), callbackVoid)\n        QObject.connect(self.obj, SIGNAL('signalWithDefaultValue(bool)'), callbackBool)\n        self.obj.emitSignalWithDefaultValue_bool()\n        self.assert_(self.void_called)\n        self.assert_(self.bool_called)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/pysidetest/symbols.filter",
    "content": "{\nlocal:\n_ZSt*;\n_ZNSt*;\n_ZNSs*;\n_ZNKSt*;\n};\n"
  },
  {
    "path": "tests/pysidetest/testobject.cpp",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"testobject.h\"\n\nvoid TestObject::emitIdValueSignal()\n{\n    emit idValue(m_idValue);\n}\n\nvoid TestObject::emitStaticMethodDoubleSignal()\n{\n    emit staticMethodDouble();\n}\n\nvoid TestObject::emitSignalWithDefaultValue_void()\n{\n    emit signalWithDefaultValue();\n}\n\nvoid TestObject::emitSignalWithDefaultValue_bool()\n{\n    emit signalWithDefaultValue(true);\n}\n\nvoid TestObject::emitSignalWithTypedefValue(int value)\n{\n    emit signalWithTypedefValue(TypedefValue(value));\n}\n"
  },
  {
    "path": "tests/pysidetest/testobject.h",
    "content": "/*\n * This file is part of the PySide project.\n *\n * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n *\n * Contact: PySide team <contact@pyside.org>\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2.1 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef TESTOBJECT_H\n#define TESTOBJECT_H\n\n#include <QObject>\n#include <QApplication>\n#include <QMetaType>\n#include <QVariant>\n#ifdef pysidetest_EXPORTS\n#define PYSIDE_EXPORTS 1\n#endif\n#include \"pysidemacros.h\"\n\nclass IntValue\n{\npublic:\n\n    IntValue(int val): value(val){};\n    IntValue() : value(0) {};\n    int value;\n};\n\ntypedef IntValue TypedefValue;\n\nclass PYSIDE_API TestObject : public QObject\n{\n    Q_OBJECT\npublic:\n    static void createApp() { int argc=0; new QApplication(argc, 0); };\n    static int checkType(const QVariant& var) { return (int)var.type(); }\n\n    TestObject(int idValue, QObject* parent = 0) : QObject(parent), m_idValue(idValue) {}\n    int idValue() const { return m_idValue; }\n    static int staticMethodDouble(int value) { return value * 2; }\n    void addChild(QObject* c) { m_children.append(c); emit childrenChanged(m_children); }\n\n    void emitIdValueSignal();\n    void emitStaticMethodDoubleSignal();\n\n    void emitSignalWithDefaultValue_void();\n    void emitSignalWithDefaultValue_bool();\n\n    void emitSignalWithTypedefValue(int value);\n\nsignals:\n    void idValue(int newValue);\n    void justASignal();\n    void staticMethodDouble();\n    void childrenChanged(const QList<QObject*>&);\n    void signalWithDefaultValue(bool value = false);\n    void signalWithTypedefValue(TypedefValue value);\n\nprivate:\n    int m_idValue;\n    QList<QObject*> m_children;\n};\n\n\ntypedef int PySideInt;\n\n\nnamespace PySideCPP {\n\nclass PYSIDE_API TestObjectWithNamespace :  public QObject\n{\n    Q_OBJECT\npublic:\n    TestObjectWithNamespace(QObject* parent) : QObject(parent) {}\n    QString name() { return \"TestObjectWithNamespace\"; }\n\n    void callSignal(TestObjectWithNamespace* obj) { emitSignal(obj); }\n    void callSignalWithNamespace(TestObjectWithNamespace* obj) { emitSignalWithNamespace(obj); }\n    void callSignalWithTypedef(int val) { emitSignalWithTypedef(val); }\n\nsignals:\n    void emitSignal(TestObjectWithNamespace* obj);\n    void emitSignalWithNamespace(PySideCPP::TestObjectWithNamespace* obj);\n    void emitSignalWithTypedef(PySideInt val);\n};\n\n\n} // Namespace PySideCPP\n\nnamespace PySideCPP2 {\n\nenum Enum1 { Option1 = 1, Option2 = 2 };\n\n\ntypedef long PySideLong;\n\nclass PYSIDE_API TestObjectWithoutNamespace :  public QObject\n{\n    Q_OBJECT\npublic:\n    enum Enum2 { Option3 = 3, Option4 =  4};\n    TestObjectWithoutNamespace(QObject* parent) : QObject(parent) {}\n    QString name() { return \"TestObjectWithoutNamespace\"; }\n\n    void callSignal(TestObjectWithoutNamespace* obj) { emitSignal(obj); }\n    void callSignalWithNamespace(TestObjectWithoutNamespace* obj) { emitSignalWithNamespace(obj); }\n    void callSignalWithTypedef(long val) { emitSignalWithTypedef(val); }\n\nsignals:\n    void emitSignal(TestObjectWithoutNamespace* obj);\n    void emitSignalWithNamespace(PySideCPP2::TestObjectWithoutNamespace* obj);\n    void emitSignalWithTypedef(PySideLong val);\n};\n\n\n} // Namespace PySideCPP2\n\n#endif // TESTOBJECT_H\n\n"
  },
  {
    "path": "tests/pysidetest/testview.cpp",
    "content": "#include \"testview.h\"\n\n#include <QDebug>\n#include <QWidget>\n#include <QAbstractListModel>\n#include <QAbstractItemDelegate>\n\nQVariant\nTestView::getData()\n{\n    QModelIndex index;\n    return m_model->data(index);\n}\n\nQWidget*\nTestView::getEditorWidgetFromItemDelegate() const\n{\n    if (!m_delegate)\n        return 0;\n\n    QModelIndex index;\n    QStyleOptionViewItem options;\n    return m_delegate->createEditor(0, options, index);\n}\n"
  },
  {
    "path": "tests/pysidetest/testview.h",
    "content": "#ifndef TESTVIEW_H\n#define TESTVIEW_H\n\n#include <QObject>\n#ifdef pysidetest_EXPORTS\n#define PYSIDE_EXPORTS 1\n#endif\n#include \"pysidemacros.h\"\n\nclass QWidget;\nclass QAbstractListModel;\nclass QAbstractItemDelegate;\n\nclass PYSIDE_API TestView : public QObject\n{\n    Q_OBJECT\npublic:\n    TestView(QAbstractListModel* model, QObject* parent = 0) : QObject(parent), m_model(model) {}\n    QAbstractListModel* model() { return m_model; }\n    QVariant getData();\n\n    void setItemDelegate(QAbstractItemDelegate* delegate) { m_delegate = delegate; }\n    QWidget* getEditorWidgetFromItemDelegate() const;\n\nprivate:\n    QAbstractListModel* m_model;\n    QAbstractItemDelegate* m_delegate;\n};\n\n#endif // TESTVIEW_H\n\n"
  },
  {
    "path": "tests/pysidetest/typedef_signal_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import QObject\nfrom testbinding import TestObject\n\nclass Receiver(QObject):\n\n    def __init__(self):\n        QObject.__init__(self)\n        self.received = None\n\n    def slot(self, value):\n        self.received = value\n\nclass TypedefSignal(unittest.TestCase):\n\n    def testTypedef(self):\n        obj = TestObject(0)\n        receiver = Receiver()\n\n        obj.signalWithTypedefValue.connect(receiver.slot)\n        obj.emitSignalWithTypedefValue(2)\n        self.assertEqual(receiver.received.value, 2)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/pysidetest/typesystem_pysidetest.xml",
    "content": "<?xml version=\"1.0\"?>\n<typesystem package=\"testbinding\">\n    <load-typesystem name=\"typesystem_core.xml\" generate=\"no\" />\n    <load-typesystem name=\"typesystem_gui.xml\" generate=\"no\"/>\n    <value-type name=\"IntValue\"/>\n    <primitive-type name=\"TypedefValue\">\n        <!--\n        A conversion rule is used here because ApiExtractor can't associate\n        a primitive typedef to a non-primitive type. That would be a good\n        improvement to ApiExtractor.\n        -->\n        <conversion-rule>\n            <native-to-target>\n            return %CONVERTTOPYTHON[IntValue](%in);\n            </native-to-target>\n            <target-to-native>\n                <add-conversion type=\"IntValue\">\n                IntValue value = %CONVERTTOCPP[IntValue](%in);\n                %out = %OUTTYPE(value);\n                </add-conversion>\n            </target-to-native>\n        </conversion-rule>\n    </primitive-type>\n    <object-type name=\"TestObject\" />\n\n    <primitive-type name=\"PySideInt\"/>\n    <primitive-type name=\"PySideCPP2::PySideLong\"/>\n    <!--<primitive-type name=\"PySideLong\"/>-->\n\n    <function signature=\"getHiddenObject()\" />\n\n    <inject-code position=\"end\">\n    Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter&lt;long&gt;(), \"PySideLong\");\n    Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter&lt;long&gt;(), \"PySideCPP2::PySideLong\");\n    qRegisterMetaType&lt;PySideInt>(\"PySideInt\");\n    qRegisterMetaType&lt;PySideCPP2::PySideLong>(\"PySideLong\");\n    </inject-code>\n\n    <namespace-type name=\"PySideCPP\">\n        <object-type name=\"TestObjectWithNamespace\"/>\n    </namespace-type>\n\n    <namespace-type name=\"PySideCPP2\" generate=\"no\">\n        <enum-type name=\"Enum1\" />\n        <object-type name=\"TestObjectWithoutNamespace\">\n            <enum-type name=\"Enum2\" />\n        </object-type>\n    </namespace-type>\n\n    <object-type name=\"TestView\" >\n        <modify-function signature=\"TestView(QAbstractListModel*,QObject*)\">\n            <modify-argument index=\"1\">\n                <reference-count action=\"set\"/>\n            </modify-argument>\n        </modify-function>\n    </object-type>\n</typesystem>\n"
  },
  {
    "path": "tests/pysidetest/utils_test.py",
    "content": "# This file is part of PySide: Python for Qt\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n#\n# Contact: PySide team <contact@pyside.org>\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public License\n# version 2 as published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n\nimport unittest\nimport sys\nimport os\n\n\nif sys.platform == 'win32':\n    from PySide._utils import _get_win32_case_sensitive_name\n\n    class Win32UtilsTest(unittest.TestCase):\n        def testWin32CaseSensitiveName(self):\n            from tempfile import mkdtemp\n            caseSensitiveName = 'CaseSensitiveName'\n            tmpdir = mkdtemp(caseSensitiveName)\n            try:\n                path = _get_win32_case_sensitive_name(tmpdir.lower())\n                self.assertTrue(path.endswith(caseSensitiveName))\n            finally:\n                if os.path.exists(tmpdir):\n                    os.rmdir(tmpdir)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/pysidetest/version_test.py",
    "content": "#!/usr/bin/python\n\nimport unittest\nfrom PySide import __version_info__, __version__, QtCore\n\nclass CheckForVariablesTest(unittest.TestCase):\n    def testVesions(self):\n        self.assert_(__version_info__ >= (1, 0, 0))\n        self.assert_(__version_info__ < (99, 99, 99))\n        self.assert_(__version__)\n\n        self.assert_(QtCore.__version_info__ >= (4, 5, 0))\n        self.assert_(QtCore.__version__)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/run_test.sh",
    "content": "#!/bin/sh\n\n# This is a nasty workaround of a CTest limitation\n# of setting the environment variables for the test.\n\n# $1: LD_LIBRARY_PATH\n# $2: $PYTHONPATH\n# $3: python executable\n# $4: test file\n\nexport LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH\nexport PYTHONPATH=$2:$PYTHONPATH\n$3 $4\n"
  },
  {
    "path": "tests/signals/CMakeLists.txt",
    "content": "PYSIDE_TEST(args_dont_match_test.py)\nPYSIDE_TEST(bug_311.py)\nPYSIDE_TEST(bug_312.py)\nPYSIDE_TEST(bug_319.py)\nPYSIDE_TEST(decorators_test.py)\nPYSIDE_TEST(disconnect_test.py)\nPYSIDE_TEST(invalid_callback_test.py)\nPYSIDE_TEST(lambda_gui_test.py)\nPYSIDE_TEST(lambda_test.py)\nPYSIDE_TEST(leaking_signal_test.py)\nPYSIDE_TEST(multiple_connections_gui_test.py)\nPYSIDE_TEST(multiple_connections_test.py)\nPYSIDE_TEST(pysignal_test.py)\nPYSIDE_TEST(qobject_destroyed_test.py)\nPYSIDE_TEST(qobject_receivers_test.py)\nPYSIDE_TEST(qobject_sender_test.py)\nPYSIDE_TEST(ref01_test.py)\nPYSIDE_TEST(ref02_test.py)\nPYSIDE_TEST(ref03_test.py)\nPYSIDE_TEST(ref04_test.py)\nPYSIDE_TEST(ref05_test.py)\nPYSIDE_TEST(ref06_test.py)\nPYSIDE_TEST(segfault_proxyparent_test.py)\nPYSIDE_TEST(self_connect_test.py)\nPYSIDE_TEST(short_circuit_test.py)\nPYSIDE_TEST(signal2signal_connect_test.py)\nPYSIDE_TEST(signal_autoconnect_test.py)\nPYSIDE_TEST(signal_connectiontype_support_test.py)\nPYSIDE_TEST(signal_emission_gui_test.py)\nPYSIDE_TEST(signal_emission_test.py)\nPYSIDE_TEST(signal_func_test.py)\nPYSIDE_TEST(signal_manager_refcount_test.py)\nPYSIDE_TEST(signal_number_limit_test.py)\nPYSIDE_TEST(signal_object_test.py)\nPYSIDE_TEST(signal_signature_test.py)\nPYSIDE_TEST(signal_with_primitive_type_test.py)\nPYSIDE_TEST(slot_reference_count_test.py)\nPYSIDE_TEST(static_metaobject_test.py)\n"
  },
  {
    "path": "tests/signals/args_dont_match_test.py",
    "content": "#!/usr/bin/env python\n\nimport unittest\nfrom PySide.QtCore import *\n\nclass ArgsDontMatch(unittest.TestCase):\n\n    def callback(self, arg1):\n        self.ok = True\n\n    def testConnectSignalToSlotWithLessArgs(self):\n        self.ok = False\n        obj1 = QObject()\n        QObject.connect(obj1, SIGNAL('the_signal(int, int, int)'), self.callback)\n        obj1.emit(SIGNAL('the_signal(int, int, int)'), 1, 2, 3)\n\n        self.assert_(self.ok)\n\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/bug_311.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide import QtCore\nfrom helper import UsesQCoreApplication\n\nclass DerivedDate(QtCore.QDate):\n    def __init__(self,y,m,d):\n        super(DerivedDate,self).__init__(y,m,d)\n\nclass Emitter(QtCore.QObject):\n    dateSignal1 = QtCore.Signal(QtCore.QDate)\n    dateSignal2 = QtCore.Signal(DerivedDate)\n    tupleSignal = QtCore.Signal(tuple)\n\nclass SignaltoSignalTest(UsesQCoreApplication):\n    def myCb(self, dt):\n        self._dt = dt\n\n    def testBug(self):\n        e = Emitter()\n        d = DerivedDate(2010,8,24)\n        self._dt = None\n        e.dateSignal1.connect(self.myCb)\n        e.dateSignal1.emit(d)\n        self.assertEqual(self._dt, d)\n\n        self._dt = None\n        e.dateSignal2.connect(self.myCb)\n        e.dateSignal2.emit(d)\n        self.assertEqual(self._dt, d)\n\n        myTuple = (5, 6, 7)\n        self._dt = None\n        e.tupleSignal.connect(self.myCb)\n        e.tupleSignal.emit(myTuple)\n        self.assertEqual(myTuple, self._dt)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/bug_312.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport sys\nfrom PySide.QtCore import QObject, SIGNAL\n\nMAX_LOOPS = 5\nMAX_OBJECTS = 200\n\nclass Dummy(object):\n    def __init__(self, parent):\n        self._parent = parent\n\n    def callback(self):\n        self._called = True\n\nclass MultipleSlots(unittest.TestCase):\n    def myCB(self):\n        self._count += 1\n\n    \"\"\"\n    def testUnboundSignal(self):\n        o = QObject()\n        self._count  = 0\n        for i in range(MAX_OBJECTS):\n            QObject.connect(o, SIGNAL(\"fire()\"), lambda: self.myCB())\n\n        o.emit(SIGNAL(\"fire()\"))\n        self.assertEqual(self._count, MAX_OBJECTS)\n\n    \"\"\"\n    def testDisconnectCleanup(self):\n        for c in range(MAX_LOOPS):\n            self._count = 0\n            self._senders = []\n            for i in range(MAX_OBJECTS):\n                o = QObject()\n                QObject.connect(o, SIGNAL(\"fire()\"), lambda: self.myCB())\n                self._senders.append(o)\n                o.emit(SIGNAL(\"fire()\"))\n\n            self.assertEqual(self._count, MAX_OBJECTS)\n\n            #delete all senders will disconnect the signals\n            self._senders = []\n\nif __name__ == '__main__':\n    unittest.main()\n\n\n"
  },
  {
    "path": "tests/signals/bug_319.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide import QtCore\nfrom helper import UsesQCoreApplication\n\nclass Listener(QtCore.QObject):\n    def __init__(self):\n        QtCore.QObject.__init__(self, None)\n        self._phrase = []\n\n    @QtCore.Slot(tuple)\n    def listen(self, words):\n        for w in words:\n            self._phrase.append(w)\n\nclass Communicate(QtCore.QObject):\n    # create a new signal on the fly and name it 'speak'\n    speak = QtCore.Signal(tuple)\n\nclass SignaltoSignalTest(UsesQCoreApplication):\n    def testBug(self):\n        someone = Communicate()\n        someone2 = Listener()\n        # connect signal and slot\n        someone.speak.connect(someone2.listen)\n        # emit 'speak' signal\n        talk = (\"one\",\"two\",\"three\")\n        someone.speak.emit(talk)\n        self.assertEqual(someone2._phrase, list(talk))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/decorators_test.py",
    "content": "#!/usr/bin/env python\n\nimport unittest\n\nfrom PySide.QtCore import QObject, Slot, SIGNAL, SLOT\n\nclass MyObject(QObject):\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n        self._slotCalledCount = 0\n\n    @Slot()\n    def mySlot(self):\n        self._slotCalledCount = self._slotCalledCount + 1\n\n    @Slot(int)\n    @Slot('QString')\n    def mySlot2(self, arg0):\n        self._slotCalledCount = self._slotCalledCount + 1\n\n    @Slot(name='mySlot3')\n    def foo(self):\n        self._slotCalledCount = self._slotCalledCount + 1\n\n    @Slot(str, int)\n    def mySlot4(self, a, b):\n        self._slotCalledCount = self._slotCalledCount + 1\n\n    @Slot(result=int)\n    def mySlot5(self):\n        self._slotCalledCount = self._slotCalledCount + 1\n\n    @Slot(result=QObject)\n    def mySlot6(self):\n        self._slotCalledCount = self._slotCalledCount + 1\n\nclass StaticMetaObjectTest(unittest.TestCase):\n\n    def testSignalPropagation(self):\n        o = MyObject()\n        m = o.metaObject()\n        self.assertTrue(m.indexOfSlot('mySlot()') > 0)\n        self.assertTrue(m.indexOfSlot('mySlot2(int)') > 0)\n        self.assertTrue(m.indexOfSlot('mySlot2(QString)') > 0)\n        self.assertTrue(m.indexOfSlot('mySlot3()') > 0)\n        self.assertTrue(m.indexOfSlot('mySlot4(QString,int)') > 0)\n\n    def testEmission(self):\n        o = MyObject()\n        o.connect(SIGNAL(\"mySignal()\"), o, SLOT(\"mySlot()\"))\n        o.emit(SIGNAL(\"mySignal()\"))\n        self.assertTrue(o._slotCalledCount == 1)\n\n    def testResult(self):\n        o = MyObject()\n        mo = o.metaObject()\n        i = mo.indexOfSlot('mySlot5()')\n        m = mo.method(i)\n        self.assertEqual(m.typeName(), \"int\")\n\n    def testResultObject(self):\n        o = MyObject()\n        mo = o.metaObject()\n        i = mo.indexOfSlot('mySlot6()')\n        m = mo.method(i)\n        self.assertEqual(m.typeName(), \"QObject*\")\n\nclass SlotWithoutArgs(unittest.TestCase):\n\n    def testError(self):\n        # It should be an error to call the slot without the\n        # arguments, as just @Slot would end up in a slot\n        # accepting argument functions\n        self.assertRaises(TypeError, Slot, lambda: 3)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/disconnect_test.py",
    "content": "import unittest\nfrom PySide.QtCore import *\nfrom testbinding import TestObject\n\n\nclass Foo(QObject):\n    bar = Signal()\n\nclass TestDisconnect(unittest.TestCase):\n    def theSlot1(self):\n        self.called1 = True\n\n    def theSlot2(self):\n        self.called2 = True\n\n    def testIt(self):\n        self.called1 = False\n        self.called2 = False\n        f = Foo()\n        f.bar.connect(self.theSlot1)\n        f.bar.connect(self.theSlot2)\n        f.bar.emit()\n        self.assertTrue(self.called1)\n        self.assertTrue(self.called2)\n\n        self.called1 = False\n        self.called2 = False\n        f.bar.disconnect()\n        f.bar.emit()\n        self.assertFalse(self.called1)\n        self.assertFalse(self.called2)\n\n    def testDuringCallback(self):\n        \"\"\" Test to see if the C++ object for a connection is accessed after the\n        method returns.  This causes a segfault if the memory that was used by the\n        C++ object has been reused. \"\"\"\n\n        self.called = False\n        obj = TestObject(0)\n        def callback():\n            obj.signalWithDefaultValue.disconnect(callback)\n\n            # Connect more callbacks to try to overwrite memory\n            for i in range(1000):\n                obj.signalWithDefaultValue.connect(lambda: None)\n\n            self.called = True\n\n            # A non-None return value is needed\n            return True\n        obj.signalWithDefaultValue.connect(callback)\n        obj.signalWithDefaultValue.emit()\n        self.assert_(self.called)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/invalid_callback_test.py",
    "content": "\n'''Test cases for passing invalid callbacks to QObject.connect'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL\n\nclass InvalidCallback(unittest.TestCase):\n    '''Test case for passing an invalid callback to QObject.connect'''\n\n    def setUp(self):\n        #Acquire resources\n        self.obj = QObject()\n\n    def tearDown(self):\n        #Release resources\n        try:\n            del self.obj\n        except AttributeError:\n            pass\n\n    def testIntegerCb(self):\n        #Test passing an int as callback to QObject.connect\n        self.assertRaises(TypeError, QObject.connect, self.obj,\n                            SIGNAL('destroyed()'), 42)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/lambda_gui_test.py",
    "content": "\n'''Connecting lambda to gui signals'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL\n\ntry:\n    from PySide.QtGui import QSpinBox, QPushButton\n    hasQtGui = True\nexcept ImportError:\n    hasQtGui = False\n\nfrom helper import UsesQApplication\n\nif hasQtGui:\n    class Control:\n        def __init__(self):\n            self.arg = False\n\n    class QtGuiSigLambda(UsesQApplication):\n\n        def testButton(self):\n            #Connecting a lambda to a QPushButton.clicked()\n            obj = QPushButton('label')\n            ctr = Control()\n            func = lambda: setattr(ctr, 'arg', True)\n            QObject.connect(obj, SIGNAL('clicked()'), func)\n            obj.click()\n            self.assert_(ctr.arg)\n            QObject.disconnect(obj, SIGNAL('clicked()'), func)\n\n\n        def testSpinButton(self):\n            #Connecting a lambda to a QPushButton.clicked()\n            obj = QSpinBox()\n            ctr = Control()\n            arg = 444\n            func = lambda x: setattr(ctr, 'arg', 444)\n            QObject.connect(obj, SIGNAL('valueChanged(int)'), func)\n            obj.setValue(444)\n            self.assertEqual(ctr.arg, arg)\n            QObject.disconnect(obj, SIGNAL('valueChanged(int)'), func)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/lambda_test.py",
    "content": "#!/usr/bin/env python\n\n'''Connecting lambda to signals'''\n\nimport sys\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL, QProcess\n\nfrom helper import UsesQCoreApplication\n\n\nclass Dummy(QObject):\n\n    def __init__(self, *args):\n        super(Dummy, self).__init__(*args)\n\n\nclass BasicCase(unittest.TestCase):\n\n    def testSimplePythonSignalNoArgs(self):\n        #Connecting a lambda to a simple python signal without arguments\n        obj = Dummy()\n        QObject.connect(obj, SIGNAL('foo()'),\n                        lambda: setattr(obj, 'called', True))\n        obj.emit(SIGNAL('foo()'))\n        self.assert_(obj.called)\n\n    def testSimplePythonSignal(self):\n        #Connecting a lambda to a simple python signal witharguments\n        obj = Dummy()\n        arg = 42\n        QObject.connect(obj, SIGNAL('foo(int)'),\n                        lambda x: setattr(obj, 'arg', 42))\n        obj.emit(SIGNAL('foo(int)'), arg)\n        self.assertEqual(obj.arg, arg)\n\n\nclass QtSigLambda(UsesQCoreApplication):\n\n    qapplication = True\n\n    def testNoArgs(self):\n        '''Connecting a lambda to a signal without arguments'''\n        proc = QProcess()\n        dummy = Dummy()\n        QObject.connect(proc, SIGNAL('started()'),\n                        lambda: setattr(dummy, 'called', True))\n        proc.start(sys.executable, ['-c', '\"\"'])\n        proc.waitForFinished()\n        self.assert_(dummy.called)\n\n    def testWithArgs(self):\n        '''Connecting a lambda to a signal with arguments'''\n        proc = QProcess()\n        dummy = Dummy()\n        QObject.connect(proc, SIGNAL('finished(int)'),\n                        lambda x: setattr(dummy, 'called', x))\n        proc.start(sys.executable, ['-c', '\"\"'])\n        proc.waitForFinished()\n        self.assertEqual(dummy.called, proc.exitCode())\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/leaking_signal_test.py",
    "content": "\nimport unittest\nfrom PySide import QtCore\nimport weakref\n\nclass LeakingSignal(unittest.TestCase):\n\n    def testLeakingSignal(self):\n        # Was segfaulting when the signal was garbage collected.\n        class Emitter(QtCore.QObject):\n            my_signal = QtCore.Signal(object)\n\n        emitter = Emitter()\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/multiple_connections_gui_test.py",
    "content": "import unittest\nimport random\nfrom functools import partial\n\nfrom PySide.QtCore import QObject, SIGNAL\n\ntry:\n    from PySide.QtGui import QPushButton, QSpinBox\n    hasQtGui = True\nexcept ImportError:\n    hasQtGui = False\n\nfrom helper import BasicPySlotCase, UsesQApplication\n\nclass MultipleSignalConnections(unittest.TestCase):\n    '''Base class for multiple signal connection testing'''\n\n    def run_many(self, sender, signal, emitter, receivers, args=None):\n        \"\"\"Utility method to connect a list of receivers to a signal.\n        sender - QObject that will emit the signal\n        signal - string with the signal signature\n        emitter - the callable that will trigger the signal\n        receivers - list of BasicPySlotCase instances\n        args - tuple with the arguments to be sent.\n        \"\"\"\n\n        if args is None:\n            args = tuple()\n\n        for rec in receivers:\n            rec.setUp()\n            QObject.connect(sender, SIGNAL(signal), rec.cb)\n            rec.args = tuple(args)\n\n        emitter(*args)\n\n        for rec in receivers:\n            self.assert_(rec.called)\n\n\nif hasQtGui:\n    class QtGuiMultipleSlots(UsesQApplication, MultipleSignalConnections):\n        '''Multiple connections to QtGui signals'''\n\n        def testButtonClick(self):\n            \"\"\"Multiple connections to QPushButton.clicked()\"\"\"\n            sender = QPushButton('button')\n            receivers = [BasicPySlotCase() for x in range(30)]\n            self.run_many(sender, 'clicked()', sender.click, receivers)\n\n        def testSpinBoxValueChanged(self):\n            \"\"\"Multiple connections to QSpinBox.valueChanged(int)\"\"\"\n            sender = QSpinBox()\n            #FIXME if number of receivers if higher than 50, segfaults\n            receivers = [BasicPySlotCase() for x in range(10)]\n            self.run_many(sender, 'valueChanged(int)', sender.setValue,\n                          receivers, (1,))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/multiple_connections_test.py",
    "content": "\nimport sys\nimport unittest\nfrom functools import partial\n\nfrom PySide.QtCore import QObject, SIGNAL, QProcess\n\nfrom helper import BasicPySlotCase, UsesQCoreApplication\n\n\nclass MultipleSignalConnections(unittest.TestCase):\n    '''Base class for multiple signal connection testing'''\n\n    def run_many(self, sender, signal, emitter, receivers, args=None):\n        \"\"\"Utility method to connect a list of receivers to a signal.\n        sender - QObject that will emit the signal\n        signal - string with the signal signature\n        emitter - the callable that will trigger the signal\n        receivers - list of BasicPySlotCase instances\n        args - tuple with the arguments to be sent.\n        \"\"\"\n\n        if args is None:\n            args = tuple()\n        for rec in receivers:\n            rec.setUp()\n            self.assert_(QObject.connect(sender, SIGNAL(signal), rec.cb))\n            rec.args = tuple(args)\n\n        emitter(*args)\n\n        for rec in receivers:\n            self.assert_(rec.called)\n\n\nclass PythonMultipleSlots(UsesQCoreApplication, MultipleSignalConnections):\n    '''Multiple connections to python signals'''\n\n    def testPythonSignal(self):\n        \"\"\"Multiple connections to a python signal (short-circuit)\"\"\"\n\n        class Dummy(QObject):\n            pass\n\n        sender = Dummy()\n        receivers = [BasicPySlotCase() for x in range(10)]\n        self.run_many(sender, 'foobar', partial(sender.emit,SIGNAL('foobar')), receivers, (0, ))\n\n\nclass QProcessMultipleSlots(UsesQCoreApplication, MultipleSignalConnections):\n    '''Multiple connections to QProcess signals'''\n\n    def testQProcessStarted(self):\n        '''Multiple connections to QProcess.started()'''\n        sender = QProcess()\n        receivers = [BasicPySlotCase() for x in range(10)]\n\n        def start_proc(*args):\n            sender.start(sys.executable, ['-c', '\"\"'])\n            sender.waitForFinished()\n\n        self.run_many(sender, 'started()', start_proc, receivers)\n\n    def testQProcessFinished(self):\n        '''Multiple connections to QProcess.finished(int)'''\n        sender = QProcess()\n        receivers = [BasicPySlotCase() for x in range(10)]\n\n        def start_proc(*args):\n            sender.start(sys.executable, ['-c', '\"\"'])\n            sender.waitForFinished()\n\n        self.run_many(sender, 'finished(int)', start_proc, receivers, (0,))\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/pysignal_test.py",
    "content": "\nimport unittest\nfrom PySide.QtCore import QObject, SIGNAL, SLOT, Qt\n\ntry:\n    from PySide.QtGui import QSpinBox, QApplication, QWidget\n    hasQtGui = True\nexcept ImportError:\n    hasQtGui = False\n\nfrom helper import UsesQApplication\n\nclass Dummy(QObject):\n    \"\"\"Dummy class used in this test.\"\"\"\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n\n    def callDummy(self):\n        self.emit(SIGNAL(\"dummy(PyObject)\"), \"PyObject\")\n\n    def callDummy2(self):\n        lst = []\n        lst.append(\"item1\")\n        lst.append(\"item2\")\n        lst.append(\"item3\")\n        self.emit(SIGNAL(\"dummy2(PyObject, PyObject)\"), \"PyObject0\", lst)\n\n\nclass PyObjectType(UsesQApplication):\n    def mySlot(self, arg):\n        self.assertEqual(arg, \"PyObject\")\n        self.called = True\n        self.callCount += 1\n\n    def mySlot2(self, arg0, arg1):\n        self.assertEqual(arg0, \"PyObject0\")\n        self.assertEqual(arg1[0], \"item1\")\n        self.assertEqual(arg1[1], \"item2\")\n        self.assertEqual(arg1[2], \"item3\")\n        self.callCount += 1\n        if self.running:\n            self.app.quit()\n\n    def setUp(self):\n        super(PyObjectType, self).setUp()\n        self.callCount = 0\n        self.running = False\n\n    def testWithOneArg(self):\n        o = Dummy()\n        o.connect(SIGNAL(\"dummy(PyObject)\"), self.mySlot)\n        o.callDummy()\n        self.assertEqual(self.callCount, 1)\n\n    def testWithTwoArg(self):\n        o = Dummy()\n        o.connect(SIGNAL(\"dummy2(PyObject,PyObject)\"), self.mySlot2)\n        o.callDummy2()\n        self.assertEqual(self.callCount, 1)\n\n    def testAsyncSignal(self):\n        self.called = False\n        self.running = True\n        o = Dummy()\n        o.connect(SIGNAL(\"dummy2(PyObject,PyObject)\"), self.mySlot2, Qt.QueuedConnection)\n        o.callDummy2()\n        self.app.exec_()\n        self.assertEqual(self.callCount, 1)\n\n    def testTwice(self):\n        self.called = False\n        self.running = True\n        o = Dummy()\n        o.connect(SIGNAL(\"dummy2(PyObject,PyObject)\"), self.mySlot2, Qt.QueuedConnection)\n        o.callDummy2()\n        o.callDummy2()\n        self.app.exec_()\n        self.assertEqual(self.callCount, 2)\n\nclass PythonSigSlot(unittest.TestCase):\n    def setUp(self):\n        self.called = False\n\n    def tearDown(self):\n        try:\n            del self.args\n        except:\n            pass\n\n    def callback(self, *args):\n        if tuple(self.args) == args:\n            self.called = True\n\n    def testNoArgs(self):\n        \"\"\"Python signal and slots without arguments\"\"\"\n        obj1 = Dummy()\n\n        QObject.connect(obj1, SIGNAL('foo()'), self.callback)\n        self.args = tuple()\n        obj1.emit(SIGNAL('foo()'), *self.args)\n\n        self.assert_(self.called)\n\n    def testWithArgs(self):\n        \"\"\"Python signal and slots with integer arguments\"\"\"\n        obj1 = Dummy()\n\n        QObject.connect(obj1, SIGNAL('foo(int)'), self.callback)\n        self.args = (42,)\n        obj1.emit(SIGNAL('foo(int)'), *self.args)\n\n        self.assert_(self.called)\n\n\n    def testDisconnect(self):\n        obj1 = Dummy()\n\n        QObject.connect(obj1, SIGNAL('foo(int)'), self.callback)\n        QObject.disconnect(obj1, SIGNAL('foo(int)'), self.callback)\n\n        self.args = (42, )\n        obj1.emit(SIGNAL('foo(int)'), *self.args)\n\n        self.assert_(not self.called)\n\n\nif hasQtGui:\n    class SpinBoxPySignal(UsesQApplication):\n        \"\"\"Tests the connection of python signals to QSpinBox qt slots.\"\"\"\n\n        def setUp(self):\n            super(SpinBoxPySignal, self).setUp()\n            self.obj = Dummy()\n            self.spin = QSpinBox()\n            self.spin.setValue(0)\n\n        def tearDown(self):\n            super(SpinBoxPySignal, self).tearDown()\n            del self.obj\n            del self.spin\n\n        def testValueChanged(self):\n            \"\"\"Emission of a python signal to QSpinBox setValue(int)\"\"\"\n            QObject.connect(self.obj, SIGNAL('dummy(int)'), self.spin, SLOT('setValue(int)'))\n            self.assertEqual(self.spin.value(), 0)\n\n            self.obj.emit(SIGNAL('dummy(int)'), 4)\n            self.assertEqual(self.spin.value(), 4)\n\n        def testValueChangedMultiple(self):\n            \"\"\"Multiple emissions of a python signal to QSpinBox setValue(int)\"\"\"\n            QObject.connect(self.obj, SIGNAL('dummy(int)'), self.spin, SLOT('setValue(int)'))\n            self.assertEqual(self.spin.value(), 0)\n\n            self.obj.emit(SIGNAL('dummy(int)'), 4)\n            self.assertEqual(self.spin.value(), 4)\n\n            self.obj.emit(SIGNAL('dummy(int)'), 77)\n            self.assertEqual(self.spin.value(), 77)\n\n\nif hasQtGui:\n    class WidgetPySignal(UsesQApplication):\n        \"\"\"Tests the connection of python signals to QWidget qt slots.\"\"\"\n\n        def setUp(self):\n            super(WidgetPySignal, self).setUp()\n            self.obj = Dummy()\n            self.widget = QWidget()\n\n        def tearDown(self):\n            super(WidgetPySignal, self).tearDown()\n            del self.obj\n            del self.widget\n\n        def testShow(self):\n            \"\"\"Emission of a python signal to QWidget slot show()\"\"\"\n            self.widget.hide()\n\n            QObject.connect(self.obj, SIGNAL('dummy()'), self.widget, SLOT('show()'))\n            self.assert_(not self.widget.isVisible())\n\n            self.obj.emit(SIGNAL('dummy()'))\n            self.assert_(self.widget.isVisible())\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/qobject_destroyed_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL\n\nclass QObjectDestroyed(unittest.TestCase):\n    \"\"\"Very simple test case for the destroyed() signal of QObject\"\"\"\n\n    def setUp(self):\n        self.called = False\n\n    def destroyed_cb(self):\n        self.called = True\n\n    def testDestroyed(self):\n        \"\"\"Emission of QObject.destroyed() to a python slot\"\"\"\n        obj = QObject()\n        QObject.connect(obj, SIGNAL('destroyed()'), self.destroyed_cb)\n        del obj\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/qobject_receivers_test.py",
    "content": "# -*- coding: utf-8 -*-\n\n''' Test case for QObject.receivers()'''\n\nimport unittest\nfrom PySide.QtCore import *\n\ndef cute_slot():\n    pass\n\nclass TestQObjectReceivers(unittest.TestCase):\n    '''Test case for QObject::receivers'''\n\n    def testBasic(self):\n        sender = QObject()\n        receiver1 = QObject()\n        receiver2 = QObject()\n        self.assertEqual(sender.receivers(SIGNAL(\"\")), 0)\n        sender.connect(sender, SIGNAL(\"destroyed()\"), receiver1, SLOT(\"deleteLater()\"))\n        self.assertEqual(sender.receivers(SIGNAL(\"destroyed()\")), 1)\n        sender.connect(sender, SIGNAL(\"destroyed()\"), receiver2, SLOT(\"deleteLater()\"))\n        self.assertEqual(sender.receivers(SIGNAL(\"destroyed()\")), 2)\n        sender.disconnect(sender, SIGNAL(\"destroyed()\"), receiver2, SLOT(\"deleteLater()\"))\n        self.assertEqual(sender.receivers(SIGNAL(\"destroyed()\")), 1)\n        del receiver2\n        del receiver1\n        del sender\n\n    def testPySlots(self):\n        sender = QObject()\n        receiver = QObject()\n        sender.connect(sender, SIGNAL(\"destroyed()\"), cute_slot)\n        self.assertEqual(sender.receivers(SIGNAL(\"destroyed( )\")), 1)\n        sender.connect(sender, SIGNAL(\"destroyed()\"), receiver, SLOT(\"deleteLater()\"))\n        self.assertEqual(sender.receivers(SIGNAL(\"destroyed()\")), 2)\n        del sender\n        del receiver\n\n    def testPySignals(self):\n        sender = QObject()\n        receiver = QObject()\n        sender.connect(sender, SIGNAL(\"some_dynamic_signal()\"), cute_slot)\n        self.assertEqual(sender.receivers(SIGNAL(\"some_dynamic_signal(  )\")), 1)\n        sender.connect(sender, SIGNAL(\"some_dynamic_signal()\"), receiver, SLOT(\"deleteLater()\"))\n        self.assertEqual(sender.receivers(SIGNAL(\"some_dynamic_signal(  )\")), 2)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/qobject_sender_test.py",
    "content": "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n'''Test cases for QObject.sender()'''\n\nimport unittest\nfrom PySide.QtCore import *\nfrom helper import UsesQCoreApplication\n\nclass ExtQTimer(QTimer):\n    def __init__(self):\n        QTimer.__init__(self)\n\nclass Receiver(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n        self.the_sender = None\n\n    def callback(self):\n        self.the_sender = self.sender()\n        if QCoreApplication.instance():\n            QCoreApplication.instance().exit()\n\nclass ObjectSenderTest(unittest.TestCase):\n    '''Test case for QObject.sender() method.'''\n\n    def testSenderPythonSignal(self):\n        sender = QObject()\n        recv = Receiver()\n        QObject.connect(sender, SIGNAL('foo()'), recv.callback)\n        sender.emit(SIGNAL('foo()'))\n        self.assertEquals(sender, recv.the_sender)\n\nclass ObjectSenderCheckOnReceiverTest(unittest.TestCase):\n    '''Test case for QObject.sender() method, this one tests the equality on the Receiver object.'''\n\n    def testSenderPythonSignal(self):\n        sender = QObject()\n        recv = Receiver()\n        QObject.connect(sender, SIGNAL('foo()'), recv.callback)\n        sender.emit(SIGNAL('foo()'))\n        self.assertEquals(sender, recv.the_sender)\n\nclass ObjectSenderWithQAppTest(UsesQCoreApplication):\n    '''Test case for QObject.sender() method with QApplication.'''\n\n    def testSenderCppSignal(self):\n        sender = QTimer()\n        sender.setObjectName('foo')\n        recv = Receiver()\n        QObject.connect(sender, SIGNAL('timeout()'), recv.callback)\n        sender.start(10)\n        self.app.exec_()\n        self.assertEquals(sender, recv.the_sender)\n\n    def testSenderCppSignalSingleShotTimer(self):\n        recv = Receiver()\n        QTimer.singleShot(10, recv.callback)\n        self.app.exec_()\n        self.assertTrue(isinstance(recv.the_sender, QObject))\n\n    def testSenderCppSignalWithPythonExtendedClass(self):\n        sender = ExtQTimer()\n        recv = Receiver()\n        QObject.connect(sender, SIGNAL('timeout()'), recv.callback)\n        sender.start(10)\n        self.app.exec_()\n        self.assertEquals(sender, recv.the_sender)\n\nclass ObjectSenderWithQAppCheckOnReceiverTest(UsesQCoreApplication):\n    '''Test case for QObject.sender() method with QApplication.'''\n\n    def testSenderCppSignal(self):\n        sender = QTimer()\n        sender.setObjectName('foo')\n        recv = Receiver()\n        QObject.connect(sender, SIGNAL('timeout()'), recv.callback)\n        sender.start(10)\n        self.app.exec_()\n        self.assertEquals(sender, recv.the_sender)\n\n    def testSenderCppSignalWithPythonExtendedClass(self):\n        sender = ExtQTimer()\n        recv = Receiver()\n        QObject.connect(sender, SIGNAL('timeout()'), recv.callback)\n        sender.start(10)\n        self.app.exec_()\n        self.assertEquals(sender, recv.the_sender)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/ref01_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide.QtCore import QObject, Signal\n\nclass BoundAndUnboundSignalsTest(unittest.TestCase):\n\n    def setUp(self):\n        self.methods = set(('connect', 'disconnect', 'emit'))\n\n    def tearDown(self):\n        del self.methods\n\n    def testUnboundSignal(self):\n        self.assertEqual(type(QObject.destroyed), Signal)\n        self.assertFalse(self.methods.issubset(dir(QObject.destroyed)))\n\n    def testBoundSignal(self):\n        obj = QObject()\n        self.assertNotEqual(type(obj.destroyed), Signal)\n        self.assert_(self.methods.issubset(dir(obj.destroyed)))\n\nif __name__ == '__main__':\n    unittest.main()\n\n\n"
  },
  {
    "path": "tests/signals/ref02_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide.QtCore import QCoreApplication, QTimeLine\nfrom helper import UsesQCoreApplication\n\nclass NativeSignalsTest(UsesQCoreApplication):\n\n    def setUp(self):\n        UsesQCoreApplication.setUp(self)\n        self.called = False\n        self.timeline = QTimeLine(100)\n\n    def tearDown(self):\n        del self.called\n        del self.timeline\n        UsesQCoreApplication.tearDown(self)\n\n    def testSignalWithIntArgument(self):\n\n        def valueChangedSlot(value):\n            self.called = True\n            self.assertEqual(type(value), float)\n            self.app.quit()\n\n        self.timeline.valueChanged.connect(valueChangedSlot)\n        self.timeline.start()\n\n        self.app.exec_()\n        self.assert_(self.called)\n\n    def testSignalWithoutArguments(self):\n\n        def finishedSlot():\n            self.called = True\n            self.app.quit()\n\n        self.timeline.finished.connect(finishedSlot)\n        self.timeline.start()\n\n        self.app.exec_()\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/ref03_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom sys import getrefcount\nfrom PySide.QtCore import QObject\n\nclass DisconnectSignalsTest(unittest.TestCase):\n\n    def setUp(self):\n        self.emitter = QObject()\n\n    def tearDown(self):\n        del self.emitter\n\n    def testConnectionRefCount(self):\n\n        def destroyedSlot():\n            pass\n\n        self.assertEqual(getrefcount(destroyedSlot), 2)\n        self.emitter.destroyed.connect(destroyedSlot)\n        self.assertEqual(getrefcount(destroyedSlot), 3)\n        self.emitter.destroyed.disconnect(destroyedSlot)\n        self.assertEqual(getrefcount(destroyedSlot), 2)\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/ref04_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide.QtCore import QObject, Signal\n\nclass ExtQObject(QObject):\n\n    mySignal = Signal()\n\n    def __init__(self):\n        QObject.__init__(self)\n\n\nclass UserSignalTest(unittest.TestCase):\n\n    def setUp(self):\n        self.emitter = ExtQObject()\n        self.counter = 0\n\n    def tearDown(self):\n        del self.emitter\n        del self.counter\n\n    def testConnectEmitDisconnect(self):\n\n        def slot():\n            self.counter += 1\n\n        self.emitter.mySignal.connect(slot)\n\n        self.assertEqual(self.counter, 0)\n        self.emitter.mySignal.emit()\n        self.assertEqual(self.counter, 1)\n        self.emitter.mySignal.emit()\n        self.assertEqual(self.counter, 2)\n\n        self.emitter.mySignal.disconnect(slot)\n\n        self.emitter.mySignal.emit()\n        self.assertEqual(self.counter, 2)\n\n#    def testConnectWithConfigureMethod(self):\n#\n#        def slot():\n#            self.counter += 1\n#\n#        self.emitter.pyqtConfigure(mySignal=slot)\n#        self.assertEqual(self.counter, 0)\n#        self.emitter.mySignal.emit()\n#        self.assertEqual(self.counter, 1)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/ref05_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide.QtCore import QObject, QCoreApplication, QTimeLine, Slot\nfrom helper import UsesQCoreApplication\n\nclass ExtQObject(QObject):\n\n    def __init__(self):\n        QObject.__init__(self)\n        self.counter = 0\n\n    @Slot('qreal')\n    def foo(self, value):\n        self.counter += 1\n\n\nclass UserSlotTest(UsesQCoreApplication):\n\n    def setUp(self):\n        UsesQCoreApplication.setUp(self)\n        self.receiver = ExtQObject()\n        self.timeline = QTimeLine(100)\n\n    def tearDown(self):\n        del self.timeline\n        del self.receiver\n        UsesQCoreApplication.tearDown(self)\n\n    def testUserSlot(self):\n        self.timeline.setUpdateInterval(10)\n\n        self.timeline.finished.connect(self.app.quit)\n\n        self.timeline.valueChanged.connect(self.receiver.foo)\n        self.timeline.start()\n\n        self.app.exec_()\n\n        self.assert_(self.receiver.counter > 1)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/ref06_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide.QtCore import QObject, QCoreApplication, QTimeLine, Signal, Slot\nfrom helper import UsesQCoreApplication\n\nclass ExtQObject(QObject):\n    signalbetween = Signal('qreal')\n\n    def __init__(self):\n        QObject.__init__(self)\n        self.counter = 0\n\n    @Slot('qreal')\n    def foo(self, value):\n        self.counter += 1\n\n\nclass SignaltoSignalTest(UsesQCoreApplication):\n\n    def setUp(self):\n        UsesQCoreApplication.setUp(self)\n        self.receiver = ExtQObject()\n        self.timeline = QTimeLine(100)\n\n    def tearDown(self):\n        del self.timeline\n        del self.receiver\n        UsesQCoreApplication.tearDown(self)\n\n    def testSignaltoSignal(self):\n        self.timeline.setUpdateInterval(10)\n\n        self.timeline.finished.connect(self.app.quit)\n\n        self.timeline.valueChanged.connect(self.receiver.signalbetween)\n        self.receiver.signalbetween.connect(self.receiver.foo)\n\n        self.timeline.start()\n\n        self.app.exec_()\n\n        self.assert_(self.receiver.counter > 1)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/segfault_proxyparent_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL\n\n# Description of the problem\n# After creating an PyObject that inherits from QObject, connecting it,\n# deleting it and later creating another Python QObject-based object, this\n# new object will point to the same memory position as the first one.\n\n# Somehow the underlying QObject also points to the same position.\n\n# In PyQt4, the connection works fine with the same memory behavior,\n# so it looks like specific to SIP.\n\nclass Dummy(QObject):\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n\nclass Joe(QObject):\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n\nclass SegfaultCase(unittest.TestCase):\n    \"\"\"Test case for the segfault happening when parent() is called inside\n    ProxyObject\"\"\"\n\n    def setUp(self):\n        self.called = False\n\n    def tearDown(self):\n        try:\n            del self.args\n        except:\n            pass\n\n    def callback(self, *args):\n        if tuple(self.args) == args:\n            self.called = True\n\n    def testSegfault(self):\n        \"\"\"Regression: Segfault for qobjects in the same memory position.\"\"\"\n        obj = Dummy()\n        QObject.connect(obj, SIGNAL('bar(int)'), self.callback)\n        self.args = (33,)\n        obj.emit(SIGNAL('bar(int)'), self.args[0])\n        self.assert_(self.called)\n        del obj\n\n        obj = Joe()\n        QObject.connect(obj, SIGNAL('bar(int)'), self.callback)\n        self.args = (33,)\n        obj.emit(SIGNAL('bar(int)'), self.args[0])\n        self.assert_(self.called)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/self_connect_test.py",
    "content": "#!/usr/bin/env python\n\n'''Using self.connect(signal, method)'''\n\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL, SLOT\nfrom PySide.QtGui import QPushButton, QWidget\n\nfrom helper import UsesQApplication\n\n\nclass SelfConnect(UsesQApplication):\n\n    def testButtonClickClose(self):\n        button = QPushButton()\n        button.connect(button, SIGNAL('clicked()'), SLOT('close()'))\n\n        button.show()\n        self.assert_(button.isVisible())\n        button.click()\n        self.assert_(not button.isVisible())\n\n    def testWindowButtonClickClose(self):\n        button = QPushButton()\n        window = QWidget()\n        window.connect(button, SIGNAL('clicked()'), SLOT('close()'))\n\n        window.show()\n        self.assert_(window.isVisible())\n        button.click()\n        self.assert_(not window.isVisible())\n\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/short_circuit_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL, SLOT\n\nclass Dummy(QObject):\n    \"\"\"Dummy class used in this test.\"\"\"\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n\nclass ShortCircuitSignals(unittest.TestCase):\n    def setUp(self):\n        self.called = False\n\n    def tearDown(self):\n        try:\n            del self.args\n        except:\n            pass\n\n    def callback(self, *args):\n        if tuple(self.args) == args:\n            self.called = True\n\n    def testNoArgs(self):\n        \"\"\"Short circuit signal without arguments\"\"\"\n        obj1 = Dummy()\n\n        QObject.connect(obj1, SIGNAL('foo'), self.callback)\n        self.args = tuple()\n        obj1.emit(SIGNAL('foo'), *self.args)\n\n        self.assert_(self.called)\n\n    def testWithArgs(self):\n        \"\"\"Short circuit signal with integer arguments\"\"\"\n        obj1 = Dummy()\n\n        QObject.connect(obj1, SIGNAL('foo'), self.callback)\n        self.args = (42,)\n        obj1.emit(SIGNAL('foo'), *self.args)\n\n        self.assert_(self.called)\n\n    def testMultipleArgs(self):\n        \"\"\"Short circuit signal with multiple arguments\"\"\"\n        obj1 = Dummy()\n\n        QObject.connect(obj1, SIGNAL('foo'), self.callback)\n        self.args = (42,33,'char')\n        obj1.emit(SIGNAL('foo'), *self.args)\n\n        self.assert_(self.called)\n\n    def testComplexArgs(self):\n        \"\"\"Short circuit signal with complex arguments\"\"\"\n        obj1 = Dummy()\n\n        QObject.connect(obj1, SIGNAL('foo'), self.callback)\n        self.args = (42, obj1)\n        obj1.emit(SIGNAL('foo'), *self.args)\n\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/signal2signal_connect_test.py",
    "content": "# -*- coding: utf-8 -*-\n\n''' Test case for signal to signal connections.'''\n\nimport unittest\nfrom PySide.QtCore import *\n\ndef cute_slot():\n    pass\n\nclass TestSignal2SignalConnect(unittest.TestCase):\n    '''Test case for signal to signal connections'''\n\n    def setUp(self):\n        #Set up the basic resources needed\n        self.sender = QObject()\n        self.forwarder = QObject()\n        self.args = None\n        self.called = False\n\n    def tearDown(self):\n        #Delete used resources\n        try:\n            del self.sender\n        except:\n            pass\n        try:\n            del self.forwarder\n        except:\n            pass\n        del self.args\n\n    def callback_noargs(self):\n        #Default callback without arguments\n        self.called = True\n\n    def callback_args(self, *args):\n        #Default callback with arguments\n        if args == self.args:\n            self.called = True\n        else:\n            raise TypeError(\"Invalid arguments\")\n\n    def callback_qobject(self, *args):\n        #Default callback for QObject as argument\n        if args[0].objectName() == self.args[0]:\n            self.called = True\n        else:\n            raise TypeError(\"Invalid arguments\")\n\n\n    def testSignalWithoutArguments(self):\n        QObject.connect(self.sender, SIGNAL(\"destroyed()\"),\n                        self.forwarder, SIGNAL(\"forward()\"))\n        QObject.connect(self.forwarder, SIGNAL(\"forward()\"),\n                        self.callback_noargs)\n        del self.sender\n        self.assert_(self.called)\n\n\n    def testSignalWithOnePrimitiveTypeArgument(self):\n        QObject.connect(self.sender, SIGNAL(\"mysignal(int)\"),\n                        self.forwarder, SIGNAL(\"mysignal(int)\"))\n        QObject.connect(self.forwarder, SIGNAL(\"mysignal(int)\"),\n                        self.callback_args)\n        self.args = (19,)\n        self.sender.emit(SIGNAL('mysignal(int)'), *self.args)\n        self.assert_(self.called)\n\n\n    def testSignalWithMultiplePrimitiveTypeArguments(self):\n        QObject.connect(self.sender, SIGNAL(\"mysignal(int,int)\"),\n                        self.forwarder, SIGNAL(\"mysignal(int,int)\"))\n        QObject.connect(self.forwarder, SIGNAL(\"mysignal(int,int)\"),\n                        self.callback_args)\n        self.args = (23, 29)\n        self.sender.emit(SIGNAL('mysignal(int,int)'), *self.args)\n        self.assert_(self.called)\n\n\n    def testSignalWithOneStringArgument(self):\n        QObject.connect(self.sender, SIGNAL(\"mysignal(QString)\"),\n                        self.forwarder, SIGNAL(\"mysignal(QString)\"))\n        QObject.connect(self.forwarder, SIGNAL(\"mysignal(QString)\"),\n                        self.callback_args)\n        self.args = ('myargument',)\n        self.sender.emit(SIGNAL('mysignal(QString)'), *self.args)\n        self.assert_(self.called)\n\n\n    def testSignalWithOneQObjectArgument(self):\n        QObject.connect(self.sender, SIGNAL('destroyed(QObject*)'),\n                        self.forwarder, SIGNAL('forward(QObject*)'))\n        QObject.connect(self.forwarder, SIGNAL('forward(QObject*)'),\n                        self.callback_qobject)\n\n        obj_name = 'sender'\n        self.sender.setObjectName(obj_name)\n        self.args = (obj_name, )\n        del self.sender\n        self.assert_(self.called)\n\n\nif __name__ == '__main__':\n    unittest.main()\n\n\n"
  },
  {
    "path": "tests/signals/signal_autoconnect_test.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport unittest\n\nfrom PySide.QtCore import *\nfrom PySide.QtGui import *\n\nclass MyObject(QWidget):\n    def __init__(self, parent=None):\n        QWidget.__init__(self, parent)\n        self._method_called = False\n\n    @Slot()\n    def on_button_clicked(self):\n        self._method_called = True\n\n\nclass AutoConnectionTest(unittest.TestCase):\n\n    def testConnection(self):\n        app = QApplication([])\n\n        win = MyObject()\n        btn = QPushButton(\"click\", win)\n        btn.setObjectName(\"button\")\n        QMetaObject.connectSlotsByName(win)\n        btn.click()\n        self.assert_(win._method_called)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/signal_connectiontype_support_test.py",
    "content": "\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL, Qt\n\nclass Dummy(QObject):\n    \"\"\"Dummy class used in this test.\"\"\"\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n\nclass TestConnectionTypeSupport(unittest.TestCase):\n    def callback(self, *args):\n        if tuple(self.args) == args:\n            self.called = True\n\n    def testNoArgs(self):\n        \"\"\"Connect signal using a Qt.ConnectionType as argument\"\"\"\n        obj1 = Dummy()\n\n        QObject.connect(obj1, SIGNAL('foo'), self.callback, Qt.DirectConnection)\n        self.args = tuple()\n        obj1.emit(SIGNAL('foo'), *self.args)\n\n        self.assert_(self.called)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/signal_emission_gui_test.py",
    "content": "#!/usr/bin/env python\n\n\"\"\"Tests covering signal emission and receiving to python slots\"\"\"\n\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL, SLOT\n\ntry:\n    from PySide.QtGui import QSpinBox, QPushButton\n    hasQtGui = True\nexcept ImportError:\n    hasQtGui = False\n\nfrom helper import BasicPySlotCase, UsesQApplication\n\nif hasQtGui:\n    class ButtonPySlot(UsesQApplication, BasicPySlotCase):\n        \"\"\"Tests the connection of python slots to QPushButton signals\"\"\"\n\n        def testButtonClicked(self):\n            \"\"\"Connection of a python slot to QPushButton.clicked()\"\"\"\n            button = QPushButton('Mylabel')\n            QObject.connect(button, SIGNAL('clicked()'), self.cb)\n            self.args = tuple()\n            button.emit(SIGNAL('clicked(bool)'), False)\n            self.assert_(self.called)\n\n        def testButtonClick(self):\n            \"\"\"Indirect qt signal emission using the QPushButton.click() method \"\"\"\n            button = QPushButton('label')\n            QObject.connect(button, SIGNAL('clicked()'), self.cb)\n            self.args = tuple()\n            button.click()\n            self.assert_(self.called)\n\n\nif hasQtGui:\n    class SpinBoxPySlot(UsesQApplication, BasicPySlotCase):\n        \"\"\"Tests the connection of python slots to QSpinBox signals\"\"\"\n\n        def setUp(self):\n            super(SpinBoxPySlot, self).setUp()\n            self.spin = QSpinBox()\n\n        def tearDown(self):\n            del self.spin\n            super(SpinBoxPySlot, self).tearDown()\n\n        def testSpinBoxValueChanged(self):\n            \"\"\"Connection of a python slot to QSpinBox.valueChanged(int)\"\"\"\n            QObject.connect(self.spin, SIGNAL('valueChanged(int)'), self.cb)\n            self.args = [3]\n            self.spin.emit(SIGNAL('valueChanged(int)'), *self.args)\n            self.assert_(self.called)\n\n        def testSpinBoxValueChangedImplicit(self):\n            \"\"\"Indirect qt signal emission using QSpinBox.setValue(int)\"\"\"\n            QObject.connect(self.spin, SIGNAL('valueChanged(int)'), self.cb)\n            self.args = [42]\n            self.spin.setValue(self.args[0])\n            self.assert_(self.called)\n\n        def atestSpinBoxValueChangedFewArgs(self):\n            \"\"\"Emission of signals with fewer arguments than needed\"\"\"\n            # XXX: PyQt4 crashes on the assertRaises\n            QObject.connect(self.spin, SIGNAL('valueChanged(int)'), self.cb)\n            self.args = (554,)\n            self.assertRaises(TypeError, self.spin.emit, SIGNAL('valueChanged(int)'))\n\nif hasQtGui:\n    class QSpinBoxQtSlots(UsesQApplication):\n        \"\"\"Tests the connection to QSpinBox qt slots\"\"\"\n\n        qapplication = True\n\n        def testSetValueIndirect(self):\n            \"\"\"Indirect signal emission: QSpinBox using valueChanged(int)/setValue(int)\"\"\"\n            spinSend = QSpinBox()\n            spinRec = QSpinBox()\n\n            spinRec.setValue(5)\n\n            QObject.connect(spinSend, SIGNAL('valueChanged(int)'), spinRec, SLOT('setValue(int)'))\n            self.assertEqual(spinRec.value(), 5)\n            spinSend.setValue(3)\n            self.assertEqual(spinRec.value(), 3)\n            self.assertEqual(spinSend.value(), 3)\n\n        def testSetValue(self):\n            \"\"\"Direct signal emission: QSpinBox using valueChanged(int)/setValue(int)\"\"\"\n            spinSend = QSpinBox()\n            spinRec = QSpinBox()\n\n            spinRec.setValue(5)\n            spinSend.setValue(42)\n\n            QObject.connect(spinSend, SIGNAL('valueChanged(int)'), spinRec, SLOT('setValue(int)'))\n            self.assertEqual(spinRec.value(), 5)\n            self.assertEqual(spinSend.value(), 42)\n            spinSend.emit(SIGNAL('valueChanged(int)'), 3)\n\n            self.assertEqual(spinRec.value(), 3)\n            #Direct emission shouldn't change the value of the emitter\n            self.assertEqual(spinSend.value(), 42)\n\n            spinSend.emit(SIGNAL('valueChanged(int)'), 66)\n            self.assertEqual(spinRec.value(), 66)\n            self.assertEqual(spinSend.value(), 42)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/signal_emission_test.py",
    "content": "#!/usr/bin/env python\n\n\"\"\"Tests covering signal emission and receiving to python slots\"\"\"\n\nimport sys\nimport unittest\nimport functools\n\nfrom PySide.QtCore import QObject, SIGNAL, SLOT, QProcess, QTimeLine\n\nfrom helper import BasicPySlotCase, UsesQCoreApplication\n\n\nclass ArgsOnEmptySignal(UsesQCoreApplication):\n    '''Trying to emit a signal without arguments passing some arguments'''\n\n    def testArgsToNoArgsSignal(self):\n        '''Passing arguments to a signal without arguments'''\n        process = QProcess()\n        self.assertRaises(TypeError, process.emit, SIGNAL('started()'), 42)\n\n\nclass MoreArgsOnEmit(UsesQCoreApplication):\n    '''Trying to pass more args than needed to emit (signals with args)'''\n\n    def testMoreArgs(self):\n        '''Passing more arguments than needed'''\n        process = QProcess()\n        self.assertRaises(TypeError, process.emit, SIGNAL('finished(int)'), 55, 55)\n\nclass Dummy(QObject):\n    '''Dummy class'''\n    pass\n\nclass PythonSignalToCppSlots(UsesQCoreApplication):\n    '''Connect python signals to C++ slots'''\n\n    def testWithoutArgs(self):\n        '''Connect python signal to QTimeLine.toggleDirection()'''\n        timeline = QTimeLine()\n        dummy = Dummy()\n        QObject.connect(dummy, SIGNAL('dummy()'),\n                        timeline, SLOT('toggleDirection()'))\n\n        orig_dir = timeline.direction()\n        dummy.emit(SIGNAL('dummy()'))\n        new_dir = timeline.direction()\n\n        if orig_dir == QTimeLine.Forward:\n            self.assertEqual(new_dir, QTimeLine.Backward)\n        else:\n            self.assertEqual(new_dir, QTimeLine.Forward)\n\n    def testWithArgs(self):\n        '''Connect python signals to QTimeLine.setCurrentTime(int)'''\n        timeline = QTimeLine()\n        dummy = Dummy()\n\n        QObject.connect(dummy, SIGNAL('dummy(int)'),\n                        timeline, SLOT('setCurrentTime(int)'))\n\n        current = timeline.currentTime()\n        dummy.emit(SIGNAL('dummy(int)'), current+42)\n        self.assertEqual(timeline.currentTime(), current+42)\n\nclass CppSignalsToCppSlots(UsesQCoreApplication):\n    '''Connection between C++ slots and signals'''\n\n    def testWithoutArgs(self):\n        '''Connect QProcess.started() to QTimeLine.togglePaused()'''\n        process = QProcess()\n        timeline = QTimeLine()\n\n        QObject.connect(process, SIGNAL('finished(int, QProcess::ExitStatus)'),\n                        timeline, SLOT('toggleDirection()'))\n\n        orig_dir = timeline.direction()\n\n        process.start(sys.executable, ['-c', '\"print 42\"'])\n        process.waitForFinished()\n\n        new_dir = timeline.direction()\n\n        if orig_dir == QTimeLine.Forward:\n            self.assertEqual(new_dir, QTimeLine.Backward)\n        else:\n            self.assertEqual(new_dir, QTimeLine.Forward)\n\ncalled = False\ndef someSlot(args=None):\n    global called\n    called = True\n\nclass DynamicSignalsToFuncPartial(UsesQCoreApplication):\n\n    def testIt(self):\n        global called\n        called = False\n        o = QObject()\n        o.connect(o, SIGNAL(\"ASignal\"), functools.partial(someSlot, \"partial ..\"))\n        o.emit(SIGNAL(\"ASignal\"))\n        self.assertTrue(called)\n\nclass EmitUnknownType(UsesQCoreApplication):\n    def testIt(self):\n        a = QObject()\n        a.connect(SIGNAL('foobar(Dummy)'), lambda x: 42) # Just connect with an unknown type\n        self.assertRaises(TypeError, a.emit, SIGNAL('foobar(Dummy)'), 22)\n\nclass EmitEnum(UsesQCoreApplication):\n    \"\"\"Test emission of enum arguments\"\"\"\n\n    def slot(self, arg):\n        self.arg = arg\n\n    def testIt(self):\n        self.arg = None\n        p = QProcess()\n        p.stateChanged.connect(self.slot)\n        p.stateChanged.emit(QProcess.NotRunning)\n        self.assertEqual(self.arg, QProcess.NotRunning)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/signal_func_test.py",
    "content": "# -*- coding: utf-8 -*-\n\nimport unittest\n\nfrom PySide.QtCore import SIGNAL, SLOT\n\nclass SIGNALSLOTTests(unittest.TestCase):\n    '''Test the output of SIGNAL and SLOT.'''\n\n    def testSIGNAL(self):\n        #SIGNAL function\n        a = \"foobar\"\n        self.assertEqual(str(SIGNAL(a)), \"2foobar\")\n\n    def testSLOT(self):\n        #SLOT function\n        a = \"foobar\"\n        self.assertEqual(str(SLOT(a)), \"1foobar\")\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/signal_manager_refcount_test.py",
    "content": "#!/usr/bin/python\n\nfrom sys import getrefcount\nimport unittest\nfrom PySide.QtCore import QObject, SIGNAL\n\nclass SignalManagerRefCount(unittest.TestCase):\n    \"\"\"Simple test case to check if the signal_manager is erroneously incrementing the object refcounter\"\"\"\n\n    def testObjectRefcount(self):\n        \"\"\"Emission of QObject.destroyed() to a python slot\"\"\"\n        def callback():\n            pass\n        obj = QObject()\n        refcount = getrefcount(obj)\n        QObject.connect(obj, SIGNAL('destroyed()'), callback)\n        self.assertEqual(refcount, getrefcount(obj))\n        QObject.disconnect(obj, SIGNAL('destroyed()'), callback)\n        self.assertEqual(refcount, getrefcount(obj))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/signal_number_limit_test.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nfrom PySide import QtCore\n\nclass Emitter(QtCore.QObject):\n    s1 = QtCore.Signal()\n    s2 = QtCore.Signal()\n    s3 = QtCore.Signal()\n    s4 = QtCore.Signal()\n    s5 = QtCore.Signal()\n    s6 = QtCore.Signal()\n    s7 = QtCore.Signal()\n    s8 = QtCore.Signal()\n    s9 = QtCore.Signal()\n    s10 = QtCore.Signal()\n    s11 = QtCore.Signal()\n    s12 = QtCore.Signal()\n    s13 = QtCore.Signal()\n    s14 = QtCore.Signal()\n\nclass SignalNumberLimitTest(unittest.TestCase):\n    def myCb(self):\n        self._count += 1\n\n    def testBug(self):\n        e = Emitter()\n        e.s1.connect(self.myCb)\n        e.s2.connect(self.myCb)\n        e.s3.connect(self.myCb)\n        e.s4.connect(self.myCb)\n        e.s5.connect(self.myCb)\n        e.s6.connect(self.myCb)\n        e.s7.connect(self.myCb)\n        e.s8.connect(self.myCb)\n        e.s9.connect(self.myCb)\n        e.s10.connect(self.myCb)\n        e.s11.connect(self.myCb)\n        e.s12.connect(self.myCb)\n        e.s13.connect(self.myCb)\n        e.s14.connect(self.myCb)\n\n        self._count = 0\n        e.s1.emit()\n        e.s2.emit()\n        e.s3.emit()\n        e.s4.emit()\n        e.s5.emit()\n        e.s6.emit()\n        e.s7.emit()\n        e.s8.emit()\n        e.s9.emit()\n        e.s10.emit()\n        e.s11.emit()\n        e.s12.emit()\n        e.s13.emit()\n        e.s14.emit()\n        self.assertEqual(self._count, 14)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/signal_object_test.py",
    "content": "#!/usr/bin/env python\n\nimport unittest\n\nfrom PySide.QtCore import QTimer, Signal, QObject, Slot, Qt\nfrom helper import UsesQCoreApplication\n\nclass MyObject(QTimer):\n    sig1 = Signal()\n    sig2 = Signal(int, name='rangeChanged')\n    sig3 = Signal(int)\n    sig4 = Signal((int,), (str,))\n    sig5 = Signal((str,), (int,))\n    sig6 = Signal(QObject)\n\n    @Slot(int)\n    def myRange(self, r):\n        self._range = r\n\n    def slot1(self):\n        self._called = True\n\n    def slotString(self, s):\n        self._s = s\n\n    def slotObject(self, o):\n        self._o = o\n\n\nclass SignalObjectTest(UsesQCoreApplication):\n    def cb(self):\n        self._cb_called = True\n        self.app.exit()\n\n    def testsingleConnect(self):\n        o = MyObject()\n        o.sig1.connect(o.slot1)\n        o.sig1.emit()\n        self.assertTrue(o._called)\n\n    def testSignalWithArgs(self):\n        o = MyObject()\n        o.sig3.connect(o.myRange)\n        o.sig3.emit(10)\n        self.assertEqual(o._range, 10)\n\n    def testSignatureParse(self):\n        o = MyObject()\n        o.sig2.connect(o.myRange)\n        o.sig2.emit(10)\n\n    def testDictOperator(self):\n        o = MyObject()\n        o.sig4[str].connect(o.slotString)\n        o.sig4[str].emit(\"PySide\")\n        self.assertEqual(o._s, \"PySide\")\n\n    def testGeneretedSignal(self):\n        o = MyObject()\n        o.timeout.connect(self.cb)\n        o.start(100)\n        self.app.exec_()\n        self.assertTrue(self._cb_called)\n\n    def testConnectionType(self):\n        o = MyObject()\n        o.timeout.connect(self.cb, type=Qt.DirectConnection)\n        o.start(100)\n        self.app.exec_()\n        self.assertTrue(self._cb_called)\n\n    def testSignalWithSignal(self):\n        o = MyObject()\n        o.sig2.connect(o.myRange)\n        o.sig5.connect(o.sig2)\n        o.sig5[int].emit(10)\n        self.assertEqual(o._range, 10)\n\n    def testSignalWithObject(self):\n        o = MyObject()\n        o.sig6.connect(o.slotObject)\n        arg = QObject()\n        o.sig6.emit(arg)\n        self.assertEqual(arg, o._o)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/signal_signature_test.py",
    "content": "# -*- coding: utf-8 -*-\n\n'''Test case for signal signature received by QObject::connectNotify().'''\n\nimport unittest\nfrom PySide.QtCore import *\nfrom helper import UsesQCoreApplication\n\nclass Obj(QObject):\n    def __init__(self):\n        QObject.__init__(self)\n        self.signal = ''\n\n    def connectNotify(self, signal):\n        self.signal = signal\n\ndef callback(arg=None):\n    pass\n\nclass TestConnectNotifyWithNewStyleSignals(UsesQCoreApplication):\n    '''Test case for signal signature received by QObject::connectNotify().'''\n\n    def testOldStyle(self):\n        sender = Obj()\n        receiver = QObject()\n        sender.connect(SIGNAL('destroyed()'), receiver, SLOT('deleteLater()'))\n        self.assertEqual(sender.signal, SIGNAL('destroyed()'))\n\n    def testOldStyleWithPythonCallback(self):\n        sender = Obj()\n        sender.connect(SIGNAL('destroyed()'), callback)\n        self.assertEqual(sender.signal, SIGNAL('destroyed()'))\n\n    def testNewStyle(self):\n        sender = Obj()\n\n        sender.destroyed.connect(callback)\n        self.assertEqual(sender.signal, SIGNAL('destroyed()'))\n\n        sender.destroyed[QObject].connect(callback)\n        self.assertEqual(sender.signal, SIGNAL('destroyed(QObject*)'))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "tests/signals/signal_with_primitive_type_test.py",
    "content": "# -*- coding: utf-8 -*-\nimport unittest\nfrom PySide.QtCore import *\n\n\nclass SignalPrimitiveTypeTest(unittest.TestCase):\n\n    def signalValueChanged(self, v):\n        self.called = True\n        self._app.quit()\n\n    def createTimeLine(self):\n        self.called = False\n        tl = QTimeLine(10000)\n        QObject.connect(tl, SIGNAL(\"valueChanged(qreal)\"), self.signalValueChanged)\n        return tl\n\n    def testTimeLine(self):\n        self._valueChangedCount = 0\n        self._app = QCoreApplication([])\n        tl = self.createTimeLine()\n        tl.start()\n        self._app.exec_()\n        self.assert_(self.called)\n\nif __name__ == '__main__':\n    unittest.main()\n\n\n"
  },
  {
    "path": "tests/signals/slot_reference_count_test.py",
    "content": "\n''' Forced disconnection: Delete one end of the signal connection'''\n\nimport unittest\nfrom sys import getrefcount\n\nfrom PySide.QtCore import QObject, SIGNAL, SLOT\n\nclass Dummy(QObject):\n    def dispatch(self):\n        self.emit(SIGNAL('foo()'))\n\nclass PythonSignalRefCount(unittest.TestCase):\n\n    def setUp(self):\n        self.emitter = Dummy()\n\n    def tearDown(self):\n        self.emitter\n\n    def testRefCount(self):\n        def cb(*args):\n            pass\n\n        self.assertEqual(getrefcount(cb), 2)\n\n        QObject.connect(self.emitter, SIGNAL('foo()'), cb)\n        self.assertEqual(getrefcount(cb), 3)\n\n        QObject.disconnect(self.emitter, SIGNAL('foo()'), cb)\n        self.assertEqual(getrefcount(cb), 2)\n\nclass CppSignalRefCount(unittest.TestCase):\n\n    def setUp(self):\n        self.emitter = QObject()\n\n    def tearDown(self):\n        self.emitter\n\n    def testRefCount(self):\n        def cb(*args):\n            pass\n\n        self.assertEqual(getrefcount(cb), 2)\n\n        QObject.connect(self.emitter, SIGNAL('destroyed()'), cb)\n        self.assertEqual(getrefcount(cb), 3)\n\n        QObject.disconnect(self.emitter, SIGNAL('destroyed()'), cb)\n        self.assertEqual(getrefcount(cb), 2)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/signals/static_metaobject_test.py",
    "content": "#!/usr/bin/env python\n\n\"\"\"Tests covering signal emission and receiving to python slots\"\"\"\n\nimport unittest\n\nfrom PySide.QtCore import QObject, SIGNAL\nfrom helper import UsesQCoreApplication\n\nclass MyObject(QObject):\n    def __init__(self, parent=None):\n        QObject.__init__(self, parent)\n        self._slotCalledCount = 0\n\n    def mySlot(self):\n        self._slotCalledCount = self._slotCalledCount + 1\n\n\nclass StaticMetaObjectTest(UsesQCoreApplication):\n\n    def testSignalPropagation(self):\n        o = MyObject()\n        o2 = MyObject()\n\n        # SIGNAL foo not created yet\n        self.assertEqual(o.metaObject().indexOfSignal(\"foo()\"), -1)\n\n        o.connect(SIGNAL(\"foo()\"), o2.mySlot)\n        # SIGNAL foo create after connect\n        self.assert_(o.metaObject().indexOfSignal(\"foo()\") > 0)\n\n        # SIGNAL does not propagate to others objects of the same type\n        self.assertEqual(o2.metaObject().indexOfSignal(\"foo()\"), -1)\n\n        del o\n        del o2\n        o = MyObject()\n        # The SIGNAL was destroyed with old objects\n        self.assertEqual(o.metaObject().indexOfSignal(\"foo()\"), -1)\n\n\n    def testSharedSignalEmission(self):\n        o = QObject()\n        m = MyObject()\n\n        o.connect(SIGNAL(\"foo2()\"), m.mySlot)\n        m.connect(SIGNAL(\"foo2()\"), m.mySlot)\n        o.emit(SIGNAL(\"foo2()\"))\n        self.assertEqual(m._slotCalledCount, 1)\n        del o\n        m.emit(SIGNAL(\"foo2()\"))\n        self.assertEqual(m._slotCalledCount, 2)\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/tools/list-class-hierarchy.py",
    "content": "#!/usr/bin/python\n\n# This file is part of PySide: Python for Qt\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n#\n# Contact: PySide team <contact@pyside.org>\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# version 2 as published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n\n\n# This is a small script printing out Qt binding class hierarchies\n# for comparison purposes.\n#\n# Usage:\n#\n# ./list-class-hierarchy.py PySide > pyside.list\n# ./list-class-hierarchy.py PyQt4 > pyqt4.list\n#\n# meld pyside.list pyqt4.list\n\nimport sys\nimport pdb\nfrom inspect import isclass\n\nignore = [\"staticMetaObject\",\n          \"pyqtConfigure\",\n          \"registerUserData\",\n          \"thread\",\n         ]\n\ndef recurse_into(el,obj):\n    #s = el.split('.')[-1]\n    #pdb.set_trace()\n    symbols = []\n    for item in sorted(dir(obj)):\n        if item[0]=='_':\n            continue\n        mel = el + '.' + item\n        try:\n            mobj = eval(mel)\n        except Exception:\n            continue\n\n        if item in ignore:\n            continue\n        else:\n            symbols.append(mel)\n\n        if isclass(mobj):\n            symbols += recurse_into(mel,mobj)\n\n    return symbols\n\nif __name__=='__main__':\n    modules = [ 'QtCore',\n                'QtGui',\n                'QtHelp',\n               #'QtMultimedia',\n                'QtNetwork',\n                'QtOpenGL',\n                'QtScript',\n                'QtScriptTools',\n                'QtSql',\n                'QtSvg',\n                'QtTest',\n               #'QtUiTools',\n                'QtWebKit',\n                'QtXml',\n                'QtXmlPatterns' ]\n\n    libraries = [\"PySide\", \"PyQt4\"]\n    librarySymbols = {}\n    for l in libraries:\n        dictionary = []\n        if l ==\"PyQt4\":\n            import sip\n            sip.setapi('QDate',2)\n            sip.setapi('QDateTime',2)\n            sip.setapi('QString',2)\n            sip.setapi('QTextStream',2)\n            sip.setapi('QTime',2)\n            sip.setapi('QUrl',2)\n            sip.setapi('QVariant',2)\n\n        for m in modules:\n            exec \"from %s import %s\" % (l,m) in globals(), locals()\n            dictionary += recurse_into(m, eval(m))\n        librarySymbols[l] = dictionary\n\n    print \"PyQt4: \", len(librarySymbols[\"PyQt4\"]), \" PySide: \", len(librarySymbols[\"PySide\"])\n\n    for symbol in librarySymbols[\"PyQt4\"]:\n        if not (symbol in librarySymbols[\"PySide\"]):\n            print \"Symbol not found in PySide:\", symbol\n"
  },
  {
    "path": "tests/util/color.py",
    "content": "\n'''Function to print a colored line to terminal'''\n\nRED='\\033[0;31m%s\\033[m'\n\ndef print_colored(message, color=RED):\n    print color % message\n\nif __name__ == '__main__':\n    print '42 - the answer'\n    print_colored(\"But what's the question?\")\n    print 'Hum?'\n"
  },
  {
    "path": "tests/util/helper/__init__.py",
    "content": "\n'''Helper classes and functions'''\n\nimport os\nimport unittest\n\nfrom random import randint\n\nfrom PySide.QtCore import QCoreApplication, QTimer\n\ntry:\n    from PySide.QtGui import QApplication\nexcept ImportError:\n    has_gui = False\nelse:\n    has_gui = True\n\ndef adjust_filename(filename, orig_mod_filename):\n    dirpath = os.path.dirname(os.path.abspath(orig_mod_filename))\n    return os.path.join(dirpath, filename)\n\nclass NoQtGuiError(Exception):\n    def __init__(self):\n        Exception.__init__(self, 'No QtGui found')\n\nclass BasicPySlotCase(object):\n    '''Base class that tests python slots and signal emissions.\n\n    Python slots are defined as any callable passed to QObject.connect().\n    '''\n    def setUp(self):\n        self.called = False\n\n    def tearDown(self):\n        try:\n            del self.args\n        except:\n            pass\n\n    def cb(self, *args):\n        '''Simple callback with arbitrary arguments.\n\n        The test function must setup the 'args' attribute with a sequence\n        containing the arguments expected to be received by this slot.\n        Currently only a single connection is supported.\n        '''\n        if tuple(self.args) == args:\n            self.called = True\n        else:\n            raise ValueError('Invalid arguments for callback')\n\n\n_instance = None\n_timed_instance = None\n\nif has_gui:\n    class UsesQApplication(unittest.TestCase):\n        '''Helper class to provide QApplication instances'''\n\n        qapplication = True\n\n        def setUp(self):\n            '''Creates the QApplication instance'''\n\n            # Simple way of making instance a singleton\n            super(UsesQApplication, self).setUp()\n            global _instance\n            if _instance is None:\n                _instance = QApplication([])\n\n            self.app = _instance\n\n        def tearDown(self):\n            '''Deletes the reference owned by self'''\n            del self.app\n            super(UsesQApplication, self).tearDown()\n\n\n    class TimedQApplication(unittest.TestCase):\n        '''Helper class with timed QApplication exec loop'''\n\n        def setUp(self, timeout=100):\n            '''Setups this Application.\n\n            timeout - timeout in milisseconds'''\n            global _timed_instance\n            if _timed_instance is None:\n                _timed_instance = QApplication([])\n\n            self.app = _timed_instance\n            QTimer.singleShot(timeout, self.app.quit)\n\n        def tearDown(self):\n            '''Delete resources'''\n            del self.app\nelse:\n    class UsesQApplication(unittest.TestCase):\n        def setUp(self):\n            raise NoQtGuiError()\n    class TimedQapplication(unittest.TestCase):\n        def setUp(self):\n            raise NoQtGuiError()\n\n\n_core_instance = None\n\nclass UsesQCoreApplication(unittest.TestCase):\n    '''Helper class for test cases that require an QCoreApplication\n    Just connect or call self.exit_app_cb. When called, will ask\n    self.app to exit.\n    '''\n\n    def setUp(self):\n        '''Set up resources'''\n\n        global _core_instance\n        if _core_instance is None:\n            _core_instance = QCoreApplication([])\n\n        self.app = _core_instance\n\n    def tearDown(self):\n        '''Release resources'''\n        del self.app\n\n    def exit_app_cb(self):\n        '''Quits the application'''\n        self.app.exit(0)\n\n\ndef random_string(size=5):\n    '''Generate random string with the given size'''\n    return ''.join(map(chr, [randint(33, 126) for x in range(size)]))\n"
  },
  {
    "path": "tests/util/helper/docmodifier.py",
    "content": "\n'''Helper metaclass do 'decorate' docstrings from base test case classes'''\n\nimport types\n\n\ndef copy_func(func):\n    '''Helper function to copy a function object (except docstring)'''\n    return types.FunctionType(func.func_code, func.func_globals, func.func_name,\n                              func.func_defaults, func.func_closure)\n\n\nclass DocModifier(type):\n    '''Metaclass for modifiying method documentation.\n\n    It allows the managed class to modify the method documentation, adding\n    prefixes and suffixes to a given set of methods.\n\n    For example, you have some unittest.TestCases that run on different set\n    of data. These methods could be written once in a base class and the\n    inheriting class just setup different setUp/tearDown methods with the\n    proper data. To differentiate the methods when using docstrings, you\n    can add a suffix or prefix to the docstring.\n\n    Variables in the implementing class:\n\n    doc_prefix - The prefix to the docstring\n    doc_suffix - The suffix to the docstring\n    doc_filter - The function to filter the methods. If not provided, this\n                 no docstrings are changed.'''\n\n    def __new__(mcs, name, bases, dct):\n\n        # FIXME currently we have to define doc_filter on each subclass\n        filter_function = dct.get('doc_filter')\n        if not filter_function:\n            filter_function = lambda x: False\n\n        for base in bases:\n            for attr in [x for x in base.__dict__ if filter_function(x)]:\n                original = getattr(base, attr)\n\n                if original.__doc__:\n                    copy = copy_func(original)\n                    copy.__doc__ = (dct.get('doc_prefix', '') +\n                                    original.__doc__ +\n                                    dct.get('doc_suffix', ''))\n                    dct[attr] = copy\n\n        return type.__new__(mcs, name, bases, dct)\n\n    def __init__(mcs, name, bases, dct):\n        super(DocModifier, mcs).__init__(name, bases, dct)\n\n\nif __name__ == '__main__':\n\n    # tests\n    class BaseTest(object):\n        __metaclass__ = DocModifier\n\n        def testBase(self):\n            '''base'''\n\n        def testWithoutDoc(self):\n            pass\n\n    class Implementing(BaseTest):\n\n        doc_filter = lambda x: x.startswith('test')\n        doc_prefix = 'prefix'\n        doc_suffix = 'suffix'\n\n    class OnlyPrefix(BaseTest):\n\n        doc_filter = lambda x: x.startswith('test')\n        doc_prefix = 'prefix'\n\n    class OnlySuffix(BaseTest):\n\n        doc_filter = lambda x: x.startswith('test')\n        doc_suffix = 'suffix'\n\n    assert(Implementing.testBase.__doc__ == 'prefixbasesuffix')\n    assert(Implementing.testWithoutDoc.__doc__ == None)\n    assert(OnlySuffix.testBase.__doc__ == 'basesuffix')\n    assert(OnlySuffix.testWithoutDoc.__doc__ == None)\n    assert(OnlyPrefix.testBase.__doc__ == 'prefixbase')\n    assert(OnlyPrefix.testWithoutDoc.__doc__ == None)\n"
  },
  {
    "path": "tests/util/httpd.py",
    "content": "import os\nimport sys\nimport threading\nimport select\nimport random\nimport py3kcompat as py3k\n\nif py3k.IS_PY3K:\n    import socketserver as SocketServer\n    import http.server as BaseHTTPServer\nelse:\n    import SocketServer\n    import BaseHTTPServer\n\nclass TestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n    DATA = \"PySide Server\"\n    allow_reuse_address = True\n\n    def do_GET(self):\n        self.send_head()\n        self.wfile.write(TestHandler.DATA)\n\n    def do_HEAD(self):\n        self.send_head()\n\n    def send_head(self):\n        self.send_response(200)\n        self.send_header(\"Content-type\", \"text/plain\")\n        self.send_header(\"Content-Length\", str(len(TestHandler.DATA)))\n        self.end_headers()\n\nclass TestSecureHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n    DATA = \"PySide\"\n    allow_reuse_address = True\n\n    def do_GET(self):\n        self.send_head()\n        self.wfile.write(py3k.b(TestHandler.DATA))\n\n    def do_HEAD(self):\n        self.send_head()\n\n    def send_head(self):\n        try:\n            handler = self.marshall_handler()\n            handler.do_request(self)\n        except:\n            self.send_response(401)\n            self.send_header(\"WWW-Authenticate\", \"Basic realm='Secure Area'\")\n            self.send_header(\"Content-type\", \"text/plain\")\n            self.send_header(\"Content-Length\", str(len(TestHandler.DATA)))\n            self.end_headers()\n\n# Workaround for the missing shutdown method in python2.5\nclass CompatTCPServer(SocketServer.TCPServer):\n    def __init__(self, server_address, RequestHandlerClass):\n        SocketServer.TCPServer.__init__(self, server_address, RequestHandlerClass)\n\n        self.isPy25 = sys.version_info[0] == 2 and sys.version_info[1] == 5\n        if self.isPy25:\n            self.__is_shut_down = threading.Event()\n            self.__serving = False\n\n    def serve_forever(self, poll_interval=0.5):\n        \"\"\"Handle one request at a time until shutdown.\n\n        Polls for shutdown every poll_interval seconds. Ignores\n        self.timeout. If you need to do periodic tasks, do them in\n        another thread.\n        \"\"\"\n        if self.isPy25:\n            self.__serving = True\n            self.__is_shut_down.clear()\n            while self.__serving:\n                # XXX: Consider using another file descriptor or\n                # connecting to the socket to wake this up instead of\n                # polling. Polling reduces our responsiveness to a\n                # shutdown request and wastes cpu at all other times.\n                r, w, e = select.select([self], [], [], poll_interval)\n                if r:\n                    self.py25_handle_request_noblock()\n            self.__is_shut_down.set()\n        else:\n            SocketServer.TCPServer.serve_forever(self, poll_interval)\n\n    def py25_handle_request_noblock(self):\n        \"\"\"Handle one request, without blocking.\n\n        I assume that select.select has returned that the socket is\n        readable before this function was called, so there should be\n        no risk of blocking in get_request().\n        \"\"\"\n        if self.isPy25:\n            try:\n                request, client_address = self.get_request()\n            except socket.error:\n                return\n            if self.verify_request(request, client_address):\n                try:\n                    self.process_request(request, client_address)\n                except:\n                    self.handle_error(request, client_address)\n                    self.close_request(request)\n\n    def shutdown(self):\n        \"\"\"Stops the serve_forever loop.\n\n        Blocks until the loop has finished. This must be called while\n        serve_forever() is running in another thread, or it will\n        deadlock.\n        \"\"\"\n        if self.isPy25:\n            self.__serving = False\n            if not self.__is_shut_down:\n                self.__is_shut_down.wait()\n        else:\n            SocketServer.TCPServer.shutdown(self)\n\n\nclass TestServer(threading.Thread):\n\n    def __init__(self, secure=False):\n        threading.Thread.__init__(self)\n\n        self._port = int(os.getenv(\"PYSIDE_TESTSERVER_PORT\") or 12321)\n        self.keep_running = True\n\n        if secure:\n            handle = TestSecureHandler\n        else:\n            handle = TestHandler\n\n        while True:\n            try:\n                self.httpd = CompatTCPServer((''  , self._port), handle)\n                break\n            except:\n                self._port = self._port + random.randint(1, 100)\n\n    def port(self):\n        return self._port\n\n    def run(self):\n        self.httpd.serve_forever()\n\n    def shutdown(self):\n        self.httpd.shutdown()\n        self.join()\n\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtAssistant.py",
    "content": "\nfrom PyQt4.QtAssistant import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtCore.py",
    "content": "\nfrom PyQt4.QtCore import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtDesigner.py",
    "content": "\nfrom PyQt4.QtDesigner import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtGui.py",
    "content": "\nfrom PyQt4.QtGui import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtHelp.py",
    "content": "\nfrom PyQt4.QtHelp import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtNetwork.py",
    "content": "\nfrom PyQt4.QtNetwork import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtScript.py",
    "content": "\nfrom PyQt4.QtScript import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtSql.py",
    "content": "\nfrom PyQt4.QtSql import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtSvg.py",
    "content": "\nfrom PyQt4.QtSvg import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtTest.py",
    "content": "\nfrom PyQt4.QtTest import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtWebKit.py",
    "content": "\nfrom PyQt4.QtWebKit import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtXml.py",
    "content": "\nfrom PyQt4.QtXml import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/QtXmlPatterns.py",
    "content": "\nfrom PyQt4.QtXmlPatterns import *\n"
  },
  {
    "path": "tests/util/module_wrapper/PySide/__init__.py",
    "content": ""
  },
  {
    "path": "tests/util/module_wrapper/PySide/phonon.py",
    "content": "\nfrom PyQt4.phonon import *\n"
  },
  {
    "path": "tests/util/processtimer.py",
    "content": "#!/usr/bin/env python\n\nimport time,os\n\nclass TimeoutException(Exception):\n   def __init__(self, msg):\n      self.msg = msg\n\n   def __str__(self):\n      return repr(self.msg)\n\nclass ProcessTimer(object):\n   '''Timeout function for controlling a subprocess.Popen instance.\n\n   Naive implementation using busy loop, see later other means\n   of doing this.\n   '''\n\n   def __init__(self, proc, timeout):\n      self.proc = proc\n      self.timeout = timeout\n\n   def waitfor(self):\n      time_passed = 0\n      while(self.proc.poll() is None and time_passed < self.timeout):\n         time_passed = time_passed + 1\n         time.sleep(1)\n\n      if time_passed >= self.timeout:\n         raise TimeoutException(\"Timeout expired, possible deadlock\")\n\nif __name__ == \"__main__\":\n   #simple example\n\n   from subprocess import Popen\n\n   proc = Popen(['sleep','10'])\n   t = ProcessTimer(proc,5)\n   try:\n      t.waitfor()\n   except TimeoutException:\n      print \"timeout - PID: %d\" % (t.proc.pid)\n      #TODO: detect SO and kill accordingly\n      #Linux\n      os.kill(t.proc.pid, 9)\n      #Windows (not tested)\n      #subprocess.Popen(\"taskkill /F /T /PID %i\"%handle.pid , shell=True)\n   print \"exit code: %d\" % (t.proc.poll())\n\n"
  },
  {
    "path": "tests/util/py2xfunctions.py",
    "content": "def b(s):\n    return s\n\ndef l(n):\n    return long(n)\n\ndef unicode_(s):\n    if type(s) == str:\n        import codecs\n        c = codecs.lookup('utf-8')\n        s2 = c.decode(s, 'ignore')\n        return s2[0]\n    return u'%s' % s\n\nunicode = unicode\nunichr = unichr\nlong = long\nbuffer = buffer\n"
  },
  {
    "path": "tests/util/py3kcompat.py",
    "content": "# -*- coding: utf-8 -*-\n#\n# This file is part of the Shiboken Python Bindings Generator project.\n#\n# Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n#\n# Contact: PySide team <contact@pyside.org>\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public License\n# version 2.1 as published by the Free Software Foundation. Please\n# review the following information to ensure the GNU Lesser General\n# Public License version 2.1 requirements will be met:\n# http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\n# #\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301 USA\n\nimport sys\n\nIS_PY3K = sys.version_info[0] == 3\n\nif IS_PY3K:\n    from py3xfunctions import b, l, unicode_, unicode, unichr, long, unichr, buffer\nelse:\n    from py2xfunctions import b, l, unicode_, unicode, unichr, long, unichr, buffer\n\n"
  },
  {
    "path": "tests/util/py3xfunctions.py",
    "content": "def b(s):\n    if type(s) == bytes:\n        return s\n    return bytes(s, \"UTF8\")\n\ndef buffer_(s):\n    if s == None:\n        return None\n    elif type(s) == str:\n        return bytes(s, \"UTF8\")\n    elif type(s) == bytes:\n        return s\n    else:\n        memoryview(s)\n\ndef l(n):\n    return n\n\ndef unicode_(s):\n    return s\n\nunicode = str\nunichr = chr\nlong = int\nunichr = chr\nbuffer = buffer_\n"
  },
  {
    "path": "tests/util/pyqt_diff.py",
    "content": "\n'''Script to show the difference between PyQt4 and ours'''\n\nimport sys\n\nfrom color import print_colored\n\ndef check_module_diff(module_name):\n    '''Difference between PySide and PyQt4 versions of qt bindings.\n    Returns a tuple with the members present only on PySide and only on PyQt4'''\n    boost_module = getattr(__import__('PySide.' + module_name), module_name)\n    orig_module = getattr(__import__('PyQt4.' + module_name), module_name)\n\n    boost_set = set(dir(boost_module))\n    orig_set = set(dir(orig_module))\n\n    return sorted(boost_set - orig_set), sorted(orig_set - boost_set)\n\n\ndef main(argv=None):\n    if argv is None:\n        argv = sys.argv\n\n    module_name = argv[1] if len(argv) >= 2 else 'QtCore'\n\n    only_boost, only_orig = check_module_diff(module_name)\n\n    print_colored('Only on Boost version')\n    print only_boost\n\n    print_colored('Only on SIP version')\n    print only_orig\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "tests/util/pyqtcheck.py",
    "content": "#!/usr/bin/env python\n\nimport sys\nfrom optparse import OptionParser\n\nimport PyQt4\nfrom PyQt4 import QtCore, QtGui, QtNetwork\n\nmodules = [QtCore, QtGui, QtNetwork]\n\ndef search(klass, method=None):\n    for module in modules:\n        try:\n            klass_obj = getattr(module, klass)\n            print \"%s *found* on module %s\" % (klass, module.__name__)\n        except AttributeError:\n            print \"%s not found on module %s\" % (klass, module.__name__)\n            continue\n\n        if method is None:\n            continue\n\n        try:\n            meth_obj = getattr(klass_obj, method)\n\n            meth_name = \".\".join([klass, method])\n            klass_name = \".\".join([module.__name__, klass])\n            print \"\\\"%s\\\" *found* on class %s\" % (meth_name, klass_name)\n        except AttributeError:\n            print \"\\\"%s\\\" not found on class %s\" % (method, klass)\n\n\ndef main(argv=None):\n    if argv is None:\n        argv = sys.argv[1:]\n\n    try:\n        klass, method = argv[0].split(\".\")\n    except:\n        klass = argv[0]\n        method = None\n\n    search(klass, method)\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "tests/util/rename_imports.sh",
    "content": "#!/bin/bash\n# Rename import statements from .py script to use a specific module name\nset -e\n\nif [ $# -lt 3 ]; then\n\techo \"Usage: $0 <old_name> <new_name> <directories...>\"\n\texit 1\nfi\n\nold_name=$1; shift\nnew_name=$1; shift\n\nfind \"$@\" -name \"*.py\" -exec sed -ri \"s/(import|from) $old_name/\\1 $new_name/\" '{}' \\;\n"
  },
  {
    "path": "tests/util/test_processtimer.py",
    "content": "\n'Tests for processtimer.py'\n\nimport unittest\nimport os\n\nfrom subprocess import Popen, PIPE\nfrom processtimer import TimeoutException, ProcessTimer\n\nclass TimeoutTest(unittest.TestCase):\n\n    def tearDown(self):\n        try:\n            os.kill(self.proc.pid, 9)\n        except OSError:\n            pass\n\n    def testRaise(self):\n        self.proc = Popen(['python2.5', '-c', 'while True: pass' ], stdout=PIPE, stderr=PIPE)\n        timer = ProcessTimer(self.proc, 1)\n        self.assertRaises(TimeoutException, timer.waitfor)\n\nclass SimpleTest(unittest.TestCase):\n\n    def tearDown(self):\n        try:\n            os.kill(self.proc.pid, 9)\n        except OSError:\n            pass\n    def testSimple(self):\n        self.proc = Popen(['python2.5', '-c', '\"print\"'], stdout=PIPE, stderr=PIPE)\n        timer = ProcessTimer(self.proc, 10)\n        timer.waitfor()\n\nclass TestEchoOutput(unittest.TestCase):\n\n    def tearDown(self):\n        try:\n            os.kill(self.proc.pid, 9)\n        except OSError:\n            pass\n\n    def testOutput(self):\n        self.proc = Popen(['python2.5', '-c', 'print 1',], stdout=PIPE, stderr=PIPE)\n        timer = ProcessTimer(self.proc, 1)\n        timer.waitfor()\n        self.assertEqual(self.proc.stdout.read().strip(), '1')\n\nclass TestRetCode(unittest.TestCase):\n\n    def tearDown(self):\n        try:\n            os.kill(self.proc.pid, 9)\n        except OSError:\n            pass\n\n    def testSimple(self):\n        self.proc = Popen(['python2.5', '-c', 'print 1'], stdout=PIPE, stderr=PIPE)\n        timer = ProcessTimer(self.proc, 10)\n        timer.waitfor()\n\n        self.assertEqual(self.proc.poll(), 0)\n\n\nif __name__ == '__main__':\n    unittest.main()\n"
  },
  {
    "path": "tests/util/use_pyqt4.sh",
    "content": "\nOLD_PYTHONPATH=$PYTHONPATH\nPYTHONPATH=`pwd`/util/module_wrapper:$PYTHONPATH\n"
  },
  {
    "path": "tests/util/use_pyside.sh",
    "content": "\nPYTHONPATH=$OLD_PYTHONPATH\nunset OLD_PYTHONPATH\n"
  },
  {
    "path": "tests/util/valgrind-python.supp",
    "content": "#\n# This is a valgrind suppression file that should be used when using valgrind.\n#\n#  Here's an example of running valgrind:\n#\n#\tcd python/dist/src\n#\tvalgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \\\n#\t\t./python -E -tt ./Lib/test/regrtest.py -u bsddb,network\n#\n# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER\n# to use the preferred suppressions with Py_ADDRESS_IN_RANGE.\n#\n# If you do not want to recompile Python, you can uncomment\n# suppressions for PyObject_Free and PyObject_Realloc.\n#\n# See Misc/README.valgrind for more information.\n\n# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif\n{\n   ADDRESS_IN_RANGE/Invalid read of size 4\n   Memcheck:Addr4\n   fun:Py_ADDRESS_IN_RANGE\n}\n\n{\n   ADDRESS_IN_RANGE/Invalid read of size 4\n   Memcheck:Value4\n   fun:Py_ADDRESS_IN_RANGE\n}\n\n{\n   ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)\n   Memcheck:Value8\n   fun:Py_ADDRESS_IN_RANGE\n}\n\n{\n   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value\n   Memcheck:Cond\n   fun:Py_ADDRESS_IN_RANGE\n}\n\n#\n# Leaks (including possible leaks)\n#    Hmmm, I wonder if this masks some real leaks.  I think it does.\n#    Will need to fix that.\n#\n\n{\n   Handle PyMalloc confusing valgrind (possibly leaked)\n   Memcheck:Leak\n   fun:realloc\n   fun:_PyObject_GC_Resize\n   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING\n}\n\n{\n   Handle PyMalloc confusing valgrind (possibly leaked)\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyObject_GC_New\n   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING\n}\n\n{\n   Handle PyMalloc confusing valgrind (possibly leaked)\n   Memcheck:Leak\n   fun:malloc\n   fun:_PyObject_GC_NewVar\n   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING\n}\n\n#\n# Non-python specific leaks\n#\n\n{\n   Handle pthread issue (possibly leaked)\n   Memcheck:Leak\n   fun:calloc\n   fun:allocate_dtv\n   fun:_dl_allocate_tls_storage\n   fun:_dl_allocate_tls\n}\n\n{\n   Handle pthread issue (possibly leaked)\n   Memcheck:Leak\n   fun:memalign\n   fun:_dl_allocate_tls_storage\n   fun:_dl_allocate_tls\n}\n\n{\n   ADDRESS_IN_RANGE/Invalid read of size 4\n   Memcheck:Addr4\n   fun:PyObject_Free\n}\n\n{\n   ADDRESS_IN_RANGE/Invalid read of size 4\n   Memcheck:Value4\n   fun:PyObject_Free\n}\n\n{\n   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value\n   Memcheck:Cond\n   fun:PyObject_Free\n}\n\n{\n   ADDRESS_IN_RANGE/Invalid read of size 4\n   Memcheck:Addr4\n   fun:PyObject_Realloc\n}\n\n{\n   ADDRESS_IN_RANGE/Invalid read of size 4\n   Memcheck:Value4\n   fun:PyObject_Realloc\n}\n\n{\n   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value\n   Memcheck:Cond\n   fun:PyObject_Realloc\n}\n\n###\n### All the suppressions below are for errors that occur within libraries\n### that Python uses.  The problems to not appear to be related to Python's\n### use of the libraries.\n###\n\n{\n   Generic gentoo ld problems\n   Memcheck:Cond\n   obj:/lib/ld-2.3.4.so\n   obj:/lib/ld-2.3.4.so\n   obj:/lib/ld-2.3.4.so\n   obj:/lib/ld-2.3.4.so\n}\n\n{\n   DBM problems, see test_dbm\n   Memcheck:Param\n   write(buf)\n   fun:write\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   fun:dbm_close\n}\n\n{\n   DBM problems, see test_dbm\n   Memcheck:Value8\n   fun:memmove\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   fun:dbm_store\n   fun:dbm_ass_sub\n}\n\n{\n   DBM problems, see test_dbm\n   Memcheck:Cond\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   fun:dbm_store\n   fun:dbm_ass_sub\n}\n\n{\n   DBM problems, see test_dbm\n   Memcheck:Cond\n   fun:memmove\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   obj:/usr/lib/libdb1.so.2\n   fun:dbm_store\n   fun:dbm_ass_sub\n}\n\n{\n   GDBM problems, see test_gdbm\n   Memcheck:Param\n   write(buf)\n   fun:write\n   fun:gdbm_open\n\n}\n\n{\n   ZLIB problems, see test_gzip\n   Memcheck:Cond\n   obj:/lib/libz.so.1.2.3\n   obj:/lib/libz.so.1.2.3\n   fun:deflate\n}\n\n{\n   Avoid problems w/readline doing a putenv and leaking on exit\n   Memcheck:Leak\n   fun:malloc\n   fun:xmalloc\n   fun:sh_set_lines_and_columns\n   fun:_rl_get_screen_size\n   fun:_rl_init_terminal_io\n   obj:/lib/libreadline.so.4.3\n   fun:rl_initialize\n}\n\n###\n### These occur from somewhere within the SSL, when running\n###  test_socket_sll.  They are too general to leave on by default.\n###\n###{\n###   somewhere in SSL stuff\n###   Memcheck:Cond\n###   fun:memset\n###}\n###{\n###   somewhere in SSL stuff\n###   Memcheck:Value4\n###   fun:memset\n###}\n###\n###{\n###   somewhere in SSL stuff\n###   Memcheck:Cond\n###   fun:MD5_Update\n###}\n###\n###{\n###   somewhere in SSL stuff\n###   Memcheck:Value4\n###   fun:MD5_Update\n###}\n\n#\n# All of these problems come from using test_socket_ssl\n#\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   fun:BN_bin2bn\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   fun:BN_num_bits_word\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Value4\n   fun:BN_num_bits_word\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   fun:BN_mod_exp_mont_word\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   fun:BN_mod_exp_mont\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Param\n   write(buf)\n   fun:write\n   obj:/usr/lib/libcrypto.so.0.9.7\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   fun:RSA_verify\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Value4\n   fun:RSA_verify\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Value4\n   fun:DES_set_key_unchecked\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Value4\n   fun:DES_encrypt2\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   obj:/usr/lib/libssl.so.0.9.7\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Value4\n   obj:/usr/lib/libssl.so.0.9.7\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   fun:BUF_MEM_grow_clean\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   fun:memcpy\n   fun:ssl3_read_bytes\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Cond\n   fun:SHA1_Update\n}\n\n{\n   from test_socket_ssl\n   Memcheck:Value4\n   fun:SHA1_Update\n}\n\n\n"
  }
]