diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-05-09 11:30:08 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-05-09 11:30:10 +0200 |
commit | 352a80482b0afdc1df5acf526e4ada2c0d30b806 (patch) | |
tree | f2286a8a81a3e573e7123fa1a6a56d61fdb91726 | |
parent | 08676d1464e828a52d6e90273c7aac6549c35274 (diff) | |
parent | 25bc996071c4878ebcec18e695c1c681aefd74bc (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I5d7b278fab717c99a74d990d5b426120ee9c0c06
29 files changed, 1158 insertions, 582 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index efc8f687..89d4dc7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,11 +11,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Macros/ option(USE_PYTHON_VERSION "Use specific python version to build pyside2." "") if (USE_PYTHON_VERSION) - find_package(PythonLibs ${USE_PYTHON_VERSION} REQUIRED) find_package(PythonInterp ${USE_PYTHON_VERSION} REQUIRED) + find_package(PythonLibs ${USE_PYTHON_VERSION} REQUIRED) else() - find_package(PythonLibs 2.6) find_package(PythonInterp 2.6) + find_package(PythonLibs 2.6) endif() # Queries the python sysconfig for the abi flags which need to be inserted into extension suffixes. @@ -104,7 +104,7 @@ if (UNIX AND NOT APPLE) endif () find_package(Shiboken2 2.0.0 REQUIRED) -find_package(Qt5 5.3.0 REQUIRED COMPONENTS Core) +find_package(Qt5 5.6.0 REQUIRED COMPONENTS Core) add_definitions(${Qt5Core_DEFINITIONS}) find_file(GL_H "gl.h" PATH_SUFFIXES "GL") @@ -188,38 +188,6 @@ else() CACHE STRING "PySide version [full]" FORCE) endif() -find_package(Qt5Core) -find_package(Qt5Concurrent) # new in Qt5, from QtCore -find_package(Qt5Gui) # reduced, small version without widgets -find_package(Qt5Widgets) # widgets in their separate module -find_package(Qt5PrintSupport) -find_package(Qt5Xml) -find_package(Qt5XmlPatterns) -find_package(Qt5Svg) -find_package(Qt5Sql) -find_package(Qt5Designer) -find_package(Qt5UiTools) -find_package(Qt5Test) -find_package(Qt5Network) -find_package(Qt5WebKit) -find_package(Qt5WebKitWidgets) -find_package(Qt5OpenGL) -find_package(Qt5Script) -find_package(Qt5ScriptTools) -find_package(Qt5Help) -find_package(Qt5Multimedia) -find_package(Qt5Quick) -find_package(Qt5Qml) -find_package(Qt5QuickWidgets) -find_package(Qt5WebChannel) -find_package(Qt5WebEngine) -find_package(Qt5WebEngineWidgets) -find_package(Qt5WebSockets) - -if(UNIX AND NOT APPLE) - find_package(Qt5X11Extras) # new in Qt5, from QtGui -endif() - string(REGEX MATCHALL "[0-9]+" qt_version_helper "${Qt5Core_VERSION}") list(GET qt_version_helper 0 QT_VERSION_MAJOR) @@ -299,7 +267,14 @@ if (NOT SITE_PACKAGE) endif() endif() -set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero) +set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken + --enable-parent-ctor-heuristic + --enable-pyside-extensions + --enable-return-value-heuristic + --use-isnull-as-nb_nonzero) +# 2017-04-24 The protected hack can unfortunately not be disabled, because +# Clang does produce linker errors when we disable the hack. +# But the ugly workaround in Python is replaced by a shiboken change. if(WIN32 OR DEFINED AVOID_PROTECTED_HACK) message(STATUS "PySide2 will be generated avoiding the protected hack!") set(GENERATOR_EXTRA_FLAGS ${GENERATOR_EXTRA_FLAGS} --avoid-protected-hack) @@ -309,9 +284,12 @@ else() endif() add_subdirectory(libpyside) +find_package(Qt5UiTools) +find_package(Qt5Designer) if(Qt5UiTools_FOUND AND Qt5Designer_FOUND) add_subdirectory(plugins) endif() + # project directories add_subdirectory(PySide2) if (BUILD_TESTS) diff --git a/PySide2/CMakeLists.txt b/PySide2/CMakeLists.txt index 72ce3501..d016bc3a 100644 --- a/PySide2/CMakeLists.txt +++ b/PySide2/CMakeLists.txt @@ -2,56 +2,21 @@ project(pyside2) include(PySideModules) -find_package(Qt5Core) -find_package(Qt5Concurrent) -find_package(Qt5Gui) -find_package(Qt5Widgets) -find_package(Qt5PrintSupport) -find_package(Qt5Network) -find_package(Qt5WebKit) -find_package(Qt5WebKitWidgets) -find_package(Qt5Xml) -find_package(Qt5XmlPatterns) -find_package(Qt5Svg) -find_package(Qt5Test) -find_package(Qt5Sql) -find_package(Qt5Designer) -find_package(Qt5OpenGL) -find_package(Qt5UiTools) -find_package(Qt5Help) -find_package(Qt5Script) -find_package(Qt5ScriptTools) -find_package(Qt5Multimedia) -find_package(Qt5MultimediaWidgets) -find_package(Qt5Qml) -find_package(Qt5Quick) -find_package(Qt5QuickWidgets) -find_package(Qt5WebChannel) -find_package(Qt5WebEngine) -find_package(Qt5WebEngineWidgets) -find_package(Qt5WebSockets) - -if(UNIX AND NOT APPLE) - find_package(Qt5X11Extras) -endif() - -# Configure include based on platform -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in" - "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" @ONLY) - -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in" - "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" @ONLY) - -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_utils.py.in" - "${CMAKE_CURRENT_BINARY_DIR}/_utils.py" @ONLY) - -macro(CHECK_PACKAGE_FOUND name) +macro(COLLECT_MODULE_IF_FOUND shortname) + set(name "Qt5${shortname}") + find_package(${name}) set(_name_found "${name}_FOUND") if(${_name_found}) - message("module ${name} found") + message(STATUS "module ${name} found (${ARGN})") # Hoist this to the parent scope to make sure all tests get built set("${name}_FOUND" 1 PARENT_SCOPE) + # also put the module at the end of pyside2_global.h + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h.add" + "#include \"Qt${shortname}/Qt${shortname}\"\n") + # record the shortnames for the tests + list(APPEND all_module_shortnames ${shortname}) + set(all_module_shortnames ${all_module_shortnames} PARENT_SCOPE) else() if("${ARGN}" STREQUAL "opt") message(STATUS "optional module ${name} skipped") @@ -64,98 +29,18 @@ macro(CHECK_PACKAGE_FOUND name) endif() endmacro() -##### -# This macro was needed to skip classes which did not build, yet. -# It replaces shiboken by a script that filters the missing classes -# away of the xxx_module_wrapper.cpp file. -# You can use it like so: -# -# skip_missing_classes(QtWidgets_SRC) -# create_pyside_module(QtWidgets -# ... -# - -macro(skip_missing_classes sources) - # this line signals postprocessing to macro "create_pyside_module". - set(${sources}_skipped_files 1) - # you just need to pass exactly the same sources variable. - string(REPLACE ";" "\n" _escaped_sources "${${sources}}") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/filter_init.py" - "if True: # allow the indentation - files = '''\n${_escaped_sources}\n'''.strip().split('\\n') - import sys, os, re, pprint - pprint.pprint(files) - nset = set() - for fname in files: - name = os.path.splitext(os.path.basename(fname))[0] - print(name) - if name.endswith('module_wrapper'): - fn = fname - else: - name = name.split('_wrapper') - assert name[1] == '' - nset.add(name[0]) - print(fn) - with open(fn) as f: - lines = f.readlines() - removals = set() - for idx, line in enumerate(lines): - res = re.search(' init_(\\w+)', line) - if res and res.group(1).lower() not in nset: - removals.add(res.group(1)) - lines[idx] = '//' + line - with open(fn, 'w') as f: - f.writelines(lines) - removals = sorted(list(removals)) - print('Removals:', removals) - fix_header_fname = '${CMAKE_CURRENT_SOURCE_DIR}/fixup_headers.py' - if sys.platform == 'win32' and os.path.exists(fix_header_fname): - global target_dir - target_dir = '${${PROJECT_NAME}_GEN_DIR}' - - with open(fix_header_fname) as f: - code = compile(f.read(), 'nebbich', 'exec') - exec(code, globals(), locals()) - ") -endmacro() - -CHECK_PACKAGE_FOUND(Qt5Core) -CHECK_PACKAGE_FOUND(Qt5Concurrent essential) -CHECK_PACKAGE_FOUND(Qt5Gui essential) -CHECK_PACKAGE_FOUND(Qt5Widgets essential) -CHECK_PACKAGE_FOUND(Qt5PrintSupport essential) -CHECK_PACKAGE_FOUND(Qt5Xml) -CHECK_PACKAGE_FOUND(Qt5XmlPatterns opt) -CHECK_PACKAGE_FOUND(Qt5Svg opt) -CHECK_PACKAGE_FOUND(Qt5Sql essential) -CHECK_PACKAGE_FOUND(Qt5Designer opt) -CHECK_PACKAGE_FOUND(Qt5UiTools opt) -CHECK_PACKAGE_FOUND(Qt5Test essential) -CHECK_PACKAGE_FOUND(Qt5Network essential) -CHECK_PACKAGE_FOUND(Qt5WebKit opt) -CHECK_PACKAGE_FOUND(Qt5WebKitWidgets opt) -CHECK_PACKAGE_FOUND(Qt5Script opt) -CHECK_PACKAGE_FOUND(Qt5ScriptTools opt) -CHECK_PACKAGE_FOUND(Qt5Help opt) -CHECK_PACKAGE_FOUND(Qt5Multimedia opt) -CHECK_PACKAGE_FOUND(Qt5MultimediaWidgets opt) -CHECK_PACKAGE_FOUND(Qt5Qml opt) -CHECK_PACKAGE_FOUND(Qt5Quick opt) -CHECK_PACKAGE_FOUND(Qt5QuickWidgets opt) -CHECK_PACKAGE_FOUND(Qt5WebChannel opt) -CHECK_PACKAGE_FOUND(Qt5WebEngineWidgets opt) -CHECK_PACKAGE_FOUND(Qt5WebSockets opt) - -if(UNIX AND NOT APPLE) - CHECK_PACKAGE_FOUND(Qt5X11Extras opt) -endif() - # note: the order of this list is relevant for dependencies. -# For instance: Qt5Printsupport must come before Qt5WebKitWidgets -HAS_QT_MODULE(Qt5Core_FOUND QtCore) +# For instance: Qt5Printsupport must come before Qt5WebKitWidgets. +COLLECT_MODULE_IF_FOUND(Core) +COLLECT_MODULE_IF_FOUND(Gui essential) +COLLECT_MODULE_IF_FOUND(Widgets essential) +COLLECT_MODULE_IF_FOUND(PrintSupport essential) +COLLECT_MODULE_IF_FOUND(Sql essential) +COLLECT_MODULE_IF_FOUND(Network essential) +COLLECT_MODULE_IF_FOUND(Test essential) if(NOT MSVC) # right now this does not build on windows - HAS_QT_MODULE(Qt5Concurrent_FOUND QtConcurrent) + COLLECT_MODULE_IF_FOUND(Concurrent essential) else() # Note: in order to use this variable in a sibling project (tests), # we need to either make the value persistent like so: @@ -164,53 +49,71 @@ else() # This is preferable, because there are no sticky side effects. set(DISABLE_QtConcurrent 1 PARENT_SCOPE) ENDIF() -HAS_QT_MODULE(Qt5Gui_FOUND QtGui) -HAS_QT_MODULE(Qt5Widgets_FOUND QtWidgets) -# This module is deprecated and should be replaces by QtGui. -# See http://doc.qt.io/qt-5/qtgui-index.html -# Update: We support QtOpenGL now! -# Note: The dependency is wrong: QtWidgets is needed! -HAS_QT_MODULE(Qt5OpenGL_FOUND QtOpenGL) -HAS_QT_MODULE(Qt5PrintSupport_FOUND QtPrintSupport) -HAS_QT_MODULE(Qt5Svg_FOUND QtSvg) -HAS_QT_MODULE(Qt5Sql_FOUND QtSql) -HAS_QT_MODULE(Qt5Network_FOUND QtNetwork) -HAS_QT_MODULE(Qt5Xml_FOUND QtXml) -HAS_QT_MODULE(Qt5XmlPatterns_FOUND QtXmlPatterns) -HAS_QT_MODULE(Qt5Test_FOUND QtTest) -HAS_QT_MODULE(Qt5WebKit_FOUND QtWebKit) +if(UNIX AND NOT APPLE) + COLLECT_MODULE_IF_FOUND(X11Extras essential) +endif() +if(WIN32) + COLLECT_MODULE_IF_FOUND(WinExtras essential) +endif() +if(APPLE) + COLLECT_MODULE_IF_FOUND(MacExtras essential) +endif() +COLLECT_MODULE_IF_FOUND(Xml) +COLLECT_MODULE_IF_FOUND(XmlPatterns opt) +COLLECT_MODULE_IF_FOUND(Help opt) +COLLECT_MODULE_IF_FOUND(Multimedia opt) +COLLECT_MODULE_IF_FOUND(MultimediaWidgets opt) +COLLECT_MODULE_IF_FOUND(OpenGL opt) +COLLECT_MODULE_IF_FOUND(Qml opt) +COLLECT_MODULE_IF_FOUND(Quick opt) +COLLECT_MODULE_IF_FOUND(QuickWidgets opt) +COLLECT_MODULE_IF_FOUND(Script opt) if(NOT MSVC) # right now this does not build on windows - HAS_QT_MODULE(Qt5WebKitWidgets_FOUND QtWebKitWidgets) + COLLECT_MODULE_IF_FOUND(ScriptTools opt) else() - set(DISABLE_QtWebKitWidgets 1 PARENT_SCOPE) + set(DISABLE_QtScriptTools 1 PARENT_SCOPE) ENDIF() - +COLLECT_MODULE_IF_FOUND(Svg opt) if(Qt5Designer_FOUND) - HAS_QT_MODULE(Qt5UiTools_FOUND QtUiTools) + COLLECT_MODULE_IF_FOUND(UiTools opt) else() set(DISABLE_QtUiTools 1 PARENT_SCOPE) endif() -HAS_QT_MODULE(Qt5Script_FOUND QtScript) +COLLECT_MODULE_IF_FOUND(WebChannel opt) +# still forgotten: +#COLLECT_MODULE_IF_FOUND(WebEngineCore opt) +#COLLECT_MODULE_IF_FOUND(WebEngine opt) +COLLECT_MODULE_IF_FOUND(WebEngineWidgets opt) +COLLECT_MODULE_IF_FOUND(WebKit opt) if(NOT MSVC) # right now this does not build on windows - HAS_QT_MODULE(Qt5ScriptTools_FOUND QtScriptTools) + COLLECT_MODULE_IF_FOUND(WebKitWidgets opt) else() - set(DISABLE_QtScriptTools 1 PARENT_SCOPE) + set(DISABLE_QtWebKitWidgets 1 PARENT_SCOPE) ENDIF() -HAS_QT_MODULE(Qt5Help_FOUND QtHelp) -HAS_QT_MODULE(Qt5Multimedia_FOUND QtMultimedia) -HAS_QT_MODULE(Qt5MultimediaWidgets_FOUND QtMultimediaWidgets) -HAS_QT_MODULE(Qt5Qml_FOUND QtQml) -HAS_QT_MODULE(Qt5Quick_FOUND QtQuick) -HAS_QT_MODULE(Qt5QuickWidgets_FOUND QtQuickWidgets) -HAS_QT_MODULE(Qt5WebChannel_FOUND QtWebChannel) -HAS_QT_MODULE(Qt5WebEngineWidgets_FOUND QtWebEngineWidgets) -HAS_QT_MODULE(Qt5WebSockets_FOUND QtWebSockets) +COLLECT_MODULE_IF_FOUND(WebSockets opt) -if(UNIX AND NOT APPLE) - has_qt_module(Qt5X11Extras_FOUND QtX11Extras) -endif() +# Configure include based on platform +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" @ONLY) + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in" + "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" @ONLY) + +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_utils.py.in" + "${CMAKE_CURRENT_BINARY_DIR}/_utils.py" @ONLY) + +# Add the collected includes to the global include +file(READ "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h.add" GLOBAL_APPEND) +file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h" "${GLOBAL_APPEND}") +file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/pyside2_global.h.add") + +# now compile all modules. +foreach(shortname IN LISTS all_module_shortnames) + set(name "Qt5${shortname}") + HAS_QT_MODULE(${name}_FOUND Qt${shortname}) +endforeach() # install install(FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" diff --git a/PySide2/QtCore/CMakeLists.txt b/PySide2/QtCore/CMakeLists.txt index b743ad1f..afef603c 100644 --- a/PySide2/QtCore/CMakeLists.txt +++ b/PySide2/QtCore/CMakeLists.txt @@ -71,6 +71,7 @@ ${QtCore_GEN_DIR}/qline_wrapper.cpp ${QtCore_GEN_DIR}/qlinef_wrapper.cpp ${QtCore_GEN_DIR}/qlocale_wrapper.cpp ${QtCore_GEN_DIR}/qmargins_wrapper.cpp +${QtCore_GEN_DIR}/qmarginsf_wrapper.cpp ${QtCore_GEN_DIR}/qmessagelogcontext_wrapper.cpp ${QtCore_GEN_DIR}/qmetaclassinfo_wrapper.cpp ${QtCore_GEN_DIR}/qmetaenum_wrapper.cpp diff --git a/PySide2/QtCore/typesystem_core_common.xml b/PySide2/QtCore/typesystem_core_common.xml index 943fda98..53cc5faa 100644 --- a/PySide2/QtCore/typesystem_core_common.xml +++ b/PySide2/QtCore/typesystem_core_common.xml @@ -3953,6 +3953,7 @@ s1.addTransition(button.clicked, s1h)</code> </object-type> <value-type name="QMargins" since="4.6"/> + <value-type name="QMarginsF" since="5.3"/> <object-type name="QParallelAnimationGroup" since="4.6"/> diff --git a/PySide2/QtGui/CMakeLists.txt b/PySide2/QtGui/CMakeLists.txt index 3fa2effd..a6a8c104 100644 --- a/PySide2/QtGui/CMakeLists.txt +++ b/PySide2/QtGui/CMakeLists.txt @@ -8,6 +8,7 @@ ${QtGui_GEN_DIR}/qabstracttextdocumentlayout_selection_wrapper.cpp ${QtGui_GEN_DIR}/qabstracttextdocumentlayout_wrapper.cpp ${QtGui_GEN_DIR}/qaccessibleevent_wrapper.cpp ${QtGui_GEN_DIR}/qactionevent_wrapper.cpp +${QtGui_GEN_DIR}/qbackingstore_wrapper.cpp ${QtGui_GEN_DIR}/qbitmap_wrapper.cpp ${QtGui_GEN_DIR}/qbrush_wrapper.cpp ${QtGui_GEN_DIR}/qclipboard_wrapper.cpp @@ -23,6 +24,7 @@ ${QtGui_GEN_DIR}/qdragenterevent_wrapper.cpp ${QtGui_GEN_DIR}/qdragleaveevent_wrapper.cpp ${QtGui_GEN_DIR}/qdragmoveevent_wrapper.cpp ${QtGui_GEN_DIR}/qdropevent_wrapper.cpp +${QtGui_GEN_DIR}/qenterevent_wrapper.cpp ${QtGui_GEN_DIR}/qexposeevent_wrapper.cpp ${QtGui_GEN_DIR}/qfileopenevent_wrapper.cpp ${QtGui_GEN_DIR}/qfocusevent_wrapper.cpp @@ -66,7 +68,10 @@ ${QtGui_GEN_DIR}/qmoveevent_wrapper.cpp ${QtGui_GEN_DIR}/qmovie_wrapper.cpp ${QtGui_GEN_DIR}/qpagedpaintdevice_margins_wrapper.cpp ${QtGui_GEN_DIR}/qpagedpaintdevice_wrapper.cpp +${QtGui_GEN_DIR}/qpagelayout_wrapper.cpp +${QtGui_GEN_DIR}/qpagesize_wrapper.cpp ${QtGui_GEN_DIR}/qpaintdevice_wrapper.cpp +${QtGui_GEN_DIR}/qpaintdevicewindow_wrapper.cpp ${QtGui_GEN_DIR}/qpaintengine_wrapper.cpp ${QtGui_GEN_DIR}/qpaintenginestate_wrapper.cpp ${QtGui_GEN_DIR}/qpainter_pixmapfragment_wrapper.cpp @@ -76,12 +81,14 @@ ${QtGui_GEN_DIR}/qpainterpath_wrapper.cpp ${QtGui_GEN_DIR}/qpainterpathstroker_wrapper.cpp ${QtGui_GEN_DIR}/qpaintevent_wrapper.cpp ${QtGui_GEN_DIR}/qpalette_wrapper.cpp +${QtGui_GEN_DIR}/qpdfwriter_wrapper.cpp ${QtGui_GEN_DIR}/qpen_wrapper.cpp ${QtGui_GEN_DIR}/qpicture_wrapper.cpp ${QtGui_GEN_DIR}/qpictureio_wrapper.cpp ${QtGui_GEN_DIR}/qpixmap_wrapper.cpp ${QtGui_GEN_DIR}/qpixmapcache_key_wrapper.cpp ${QtGui_GEN_DIR}/qpixmapcache_wrapper.cpp +${QtGui_GEN_DIR}/qpixelformat_wrapper.cpp ${QtGui_GEN_DIR}/qpolygon_wrapper.cpp ${QtGui_GEN_DIR}/qpolygonf_wrapper.cpp ${QtGui_GEN_DIR}/qpytextobject_wrapper.cpp @@ -106,6 +113,10 @@ ${QtGui_GEN_DIR}/qscreen_wrapper.cpp ${QtGui_GEN_DIR}/qopenglshader_wrapper.cpp #${QtGui_GEN_DIR}/qopenglshaderprogram_wrapper.cpp ${QtGui_GEN_DIR}/qopenglframebufferobject_wrapper.cpp +${QtGui_GEN_DIR}/qrasterwindow_wrapper.cpp +${QtGui_GEN_DIR}/qrawfont_wrapper.cpp +${QtGui_GEN_DIR}/qstatictext_wrapper.cpp +${QtGui_GEN_DIR}/qstylehints_wrapper.cpp ${QtGui_GEN_DIR}/qsurface_wrapper.cpp ${QtGui_GEN_DIR}/qsurfaceformat_wrapper.cpp ${QtGui_GEN_DIR}/qsyntaxhighlighter_wrapper.cpp @@ -182,11 +193,6 @@ set(QtGui_libraries pyside2 ${Qt5Gui_LIBRARIES}) set(QtGui_deps QtCore) -if(WIN32) - # has a fix for VS2015 - skip_missing_classes(QtGui_SRC) -endif() - create_pyside_module(QtGui QtGui_include_dirs QtGui_libraries diff --git a/PySide2/QtGui/fixup_headers.py b/PySide2/QtGui/fixup_headers.py deleted file mode 100644 index cf9d1f19..00000000 --- a/PySide2/QtGui/fixup_headers.py +++ /dev/null @@ -1,78 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of PySide2. -## -## $QT_BEGIN_LICENSE:LGPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 3 as published by the Free Software -## Foundation and appearing in the file LICENSE.LGPL3 included in the -## packaging of this file. Please review the following information to -## ensure the GNU Lesser General Public License version 3 requirements -## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 2.0 or (at your option) the GNU General -## Public license version 3 or any later version approved by the KDE Free -## Qt Foundation. The licenses are as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-2.0.html and -## https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -from __future__ import print_function - -""" -This script adds a constructor to wrappers where the constructor -of the base class is not reachable (private). - -It is run via the equivalent of an execfile command. -This patch became necessary when VS2015 became the standard compiler. -""" - -import os - -def patch(fname, snippet, path=target_dir): - fpath = os.path.join(path, fname) - with open(fpath, 'r') as f: - lines = f.readlines() - for idx, line in enumerate(lines): - if line.rstrip() == "public:": - break - else: - raise SyntaxError("no public section found") - lines[idx+1:idx+1] = snippet - with open(fpath, 'w') as f: - f.writelines(lines) - print("+++ patched file:", fpath) - -snippets = { - "qclipboard_wrapper.h" : """\ - QClipboardWrapper(QObject *parent); - ~QClipboardWrapper(); -""", - "qsessionmanager_wrapper.h" : """\ - QSessionManagerWrapper(QGuiApplication *app, QString &id, QString &key); - ~QSessionManagerWrapper(); -""", -} - -for snippet, addition in snippets.items(): - patch(snippet, addition) diff --git a/PySide2/QtGui/typesystem_gui_common.xml b/PySide2/QtGui/typesystem_gui_common.xml index 90ba5f9a..7a0db8a4 100644 --- a/PySide2/QtGui/typesystem_gui_common.xml +++ b/PySide2/QtGui/typesystem_gui_common.xml @@ -105,6 +105,10 @@ <rejection class="QAccessibleEvent" field-name="m_type"/> + <rejection class="QEnterEvent" field-name="l"/> + <rejection class="QEnterEvent" field-name="w"/> + <rejection class="QEnterEvent" field-name="s"/> + <rejection class="QInputEvent" field-name="modState"/> <rejection class="QInputEvent" field-name="modState"/> @@ -291,6 +295,9 @@ </add-function> </value-type> + <value-type name="QStaticText"> + <enum-type name="PerformanceHint"/> + </value-type> <value-type name="QTextFragment" /> <value-type name="QBitmap" > <modify-function signature="fromData(QSize,const uchar*,QImage::Format)"> @@ -1738,6 +1745,7 @@ </modify-argument> </modify-function> </object-type> + <object-type name="QEnterEvent" copyable="false" polymorphic-id-expression="%1->type() == QEvent::Enter"/> <object-type name="QExposeEvent" polymorphic-id-expression="%1->type() == QEvent::Expose" /> <object-type name="QFileOpenEvent" polymorphic-id-expression="%1->type() == QEvent::FileOpen" /> <object-type name="QFocusEvent" polymorphic-id-expression="%1->type() == QEvent::FocusIn || %1->type() == QEvent::FocusOut" /> @@ -3186,6 +3194,7 @@ <suppress-warning text="enum 'QCoreApplication::ApplicationFlags' is specified in typesystem, but not declared" /> <!-- Qt5: here the new QWindow stuff and what it pulls in --> + <object-type name="QBackingStore"/> <object-type name="QSurface"> <enum-type name="SurfaceClass"/> <enum-type name="SurfaceType"/> @@ -3267,7 +3276,37 @@ typesystem. <object-type name="QOpenGLShaderProgram" /> --> + <value-type name="QPageLayout"> + <enum-type name="Mode"/> + <enum-type name="Orientation"/> + <enum-type name="Unit"/> + </value-type> + <value-type name="QPageSize"> + <enum-type name="PageSizeId"/> + <enum-type name="Unit"/> + <enum-type name="SizeMatchPolicy"/> + </value-type> + <object-type name="QPaintDeviceWindow"/> + <value-type name="QPixelFormat"> + <enum-type name="AlphaUsage"/> + <enum-type name="AlphaPosition"/> + <enum-type name="AlphaPremultiplied"/> + <enum-type name="ByteOrder"/> + <enum-type name="ColorModel"/> + <enum-type name="TypeInterpretation"/> + <enum-type name="YUVLayout"/> + </value-type> + <object-type name="QPdfWriter"/> + <value-type name="QRawFont"> + <enum-type name="AntialiasingType"/> + <enum-type name="LayoutFlag" flags="LayoutFlags"/> + <modify-function signature="advancesForGlyphIndexes(const quint32*,QPointF*,int)const" remove="all"/> + <modify-function signature="advancesForGlyphIndexes(const quint32*,QPointF*,int,QFlags<QRawFont::LayoutFlag>)const" remove="all"/> + <modify-function signature="glyphIndexesForChars(const QChar*,int,quint32*,int*)const" remove="all"/> + </value-type> + <object-type name="QRasterWindow"/> <object-type name="QScreen" /> + <object-type name="QStyleHints"/> </typesystem> diff --git a/PySide2/QtHelp/CMakeLists.txt b/PySide2/QtHelp/CMakeLists.txt index 2c7c2fdd..ba8b419f 100644 --- a/PySide2/QtHelp/CMakeLists.txt +++ b/PySide2/QtHelp/CMakeLists.txt @@ -42,11 +42,6 @@ set(QtHelp_libraries pyside2 set(QtHelp_deps QtWidgets) -if(WIN32) - # has a fix for VS2015 - skip_missing_classes(QtHelp_SRC) -endif() - create_pyside_module(QtHelp QtHelp_include_dirs QtHelp_libraries diff --git a/PySide2/QtHelp/fixup_headers.py b/PySide2/QtHelp/fixup_headers.py deleted file mode 100644 index d25b04b2..00000000 --- a/PySide2/QtHelp/fixup_headers.py +++ /dev/null @@ -1,74 +0,0 @@ -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of PySide2. -## -## $QT_BEGIN_LICENSE:LGPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 3 as published by the Free Software -## Foundation and appearing in the file LICENSE.LGPL3 included in the -## packaging of this file. Please review the following information to -## ensure the GNU Lesser General Public License version 3 requirements -## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 2.0 or (at your option) the GNU General -## Public license version 3 or any later version approved by the KDE Free -## Qt Foundation. The licenses are as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-2.0.html and -## https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -from __future__ import print_function - -""" -This script adds a constructor to wrappers where the constructor -of the base class is not reachable (private). - -It is run via the equivalent of an execfile command. -This patch became necessary when VS2015 became the standard compiler. -""" - -import os - -def patch(fname, snippet, path=target_dir): - fpath = os.path.join(path, fname) - with open(fpath, 'r') as f: - lines = f.readlines() - for idx, line in enumerate(lines): - if line.rstrip() == "public:": - break - else: - raise SyntaxError("no public section found") - lines[idx+1:idx+1] = snippet - with open(fpath, 'w') as f: - f.writelines(lines) - print("+++ patched file:", fpath) - -snippets = { - "qhelpindexmodel_wrapper.h" : """\ - QHelpIndexModelWrapper(QHelpEnginePrivate *helpEngine); - ~QHelpIndexModelWrapper(); -""", -} - -for snippet, addition in snippets.items(): - patch(snippet, addition) diff --git a/PySide2/QtMacExtras/CMakeLists.txt b/PySide2/QtMacExtras/CMakeLists.txt new file mode 100644 index 00000000..9bb8dd00 --- /dev/null +++ b/PySide2/QtMacExtras/CMakeLists.txt @@ -0,0 +1,43 @@ +project(QtMacExtras) + +set(QtMacExtras_SRC +#${QtMacExtras_GEN_DIR}/qmacpasteboardmime_wrapper.cpp +${QtMacExtras_GEN_DIR}/qmactoolbar_wrapper.cpp +${QtMacExtras_GEN_DIR}/qmactoolbaritem_wrapper.cpp + +# module is always needed +${QtMacExtras_GEN_DIR}/QtMacExtras_module_wrapper.cpp +) + +make_path(QtMacExtras_typesystem_path ${QtMacExtras_SOURCE_DIR} + ${QtCore_SOURCE_DIR} + ${QtCore_BINARY_DIR} + ${QtGui_SOURCE_DIR} + ${QtGui_BINARY_DIR}) + +set(QtMacExtras_include_dirs ${QtMacExtras_SOURCE_DIR} + ${QtMacExtras_BINARY_DIR} + ${Qt5MacExtras_INCLUDE_DIRS} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${QtCore_GEN_DIR} + ${QtGui_GEN_DIR} + ${SHIBOKEN_PYTHON_INCLUDE_DIR} + ${SHIBOKEN_INCLUDE_DIR} + ${libpyside_SOURCE_DIR}) + +set(QtMacExtras_libraries pyside2 + ${Qt5MacExtras_LIBRARIES} + ${SHIBOKEN_PYTHON_LIBRARIES} + ${Qt5Core_LIBRARIES} + ${Qt5Gui_LIBRARIES}) + +set(QtMacExtras_deps QtCore QtGui) + +create_pyside_module(QtMacExtras + QtMacExtras_include_dirs + QtMacExtras_libraries + QtMacExtras_deps + QtMacExtras_typesystem_path + QtMacExtras_SRC + "") diff --git a/PySide2/QtMacExtras/typesystem_macextras.xml b/PySide2/QtMacExtras/typesystem_macextras.xml new file mode 100644 index 00000000..f52597cd --- /dev/null +++ b/PySide2/QtMacExtras/typesystem_macextras.xml @@ -0,0 +1,55 @@ +<?xml version="1.0"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<typesystem package="PySide2.QtMacExtras"> + <load-typesystem name="typesystem_core.xml" generate="no"/> + <load-typesystem name="typesystem_gui.xml" generate="no"/> + + <!-- + <object-type name="QMacPasteboardMime" since="5.2"> + <enum-type name="QMacPasteboardMimeType"/> + </object-type> + --> + <object-type name="QMacToolBar" since="5.3"/> + <object-type name="QMacToolBarItem" since="5.3"> + <enum-type name="StandardItem"/> + </object-type> +</typesystem> diff --git a/PySide2/QtMultimedia/CMakeLists.txt b/PySide2/QtMultimedia/CMakeLists.txt index 51b5a042..a17455ee 100644 --- a/PySide2/QtMultimedia/CMakeLists.txt +++ b/PySide2/QtMultimedia/CMakeLists.txt @@ -1,21 +1,82 @@ project(QtMultimedia) set(QtMultimedia_SRC -${QtMultimedia_GEN_DIR}/qaudio_wrapper.cpp +${QtMultimedia_GEN_DIR}/qabstractaudiodeviceinfo_wrapper.cpp +${QtMultimedia_GEN_DIR}/qabstractaudioinput_wrapper.cpp +${QtMultimedia_GEN_DIR}/qabstractaudiooutput_wrapper.cpp ${QtMultimedia_GEN_DIR}/qabstractvideobuffer_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideosurfaceformat_wrapper.cpp +${QtMultimedia_GEN_DIR}/qabstractvideofilter_wrapper.cpp ${QtMultimedia_GEN_DIR}/qabstractvideosurface_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudiobuffer_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudiodecoder_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudiodecodercontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudiodeviceinfo_wrapper.cpp -${QtMultimedia_GEN_DIR}/qabstractaudiodeviceinfo_wrapper.cpp -${QtMultimedia_GEN_DIR}/qabstractaudiooutput_wrapper.cpp -${QtMultimedia_GEN_DIR}/qabstractaudioinput_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudioencodersettingscontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudioencodersettings_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudioformat_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudioinputselectorcontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudioinput_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudiooutputselectorcontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudiooutput_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideoframe_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudioprobe_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudiorecorder_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudiorolecontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qaudio_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameracapturebufferformatcontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameracapturedestinationcontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameracontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameraexposurecontrol_wrapper.cpp +# Private destructor: ${QtMultimedia_GEN_DIR}/qcameraexposure_wrapper.cpp +# Private destructor: ${${QtMultimedia_GEN_DIR}/qcamerafocus_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcamerafocuszone_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcamera_frameraterange_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameraimagecapturecontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameraimagecapture_wrapper.cpp +# Private destructor: ${QtMultimedia_GEN_DIR}/qcameraimageprocessing_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameraimageprocessingcontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcamerainfocontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcamerainfo_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameralockscontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameraviewfindersettingscontrol2_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameraviewfindersettingscontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameraviewfindersettings_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcamera_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcamerazoomcontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qimageencodercontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qimageencodersettings_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaaudioprobecontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaavailabilitycontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qmediabindableinterface_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediacontainercontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediacontent_wrapper.cpp ${QtMultimedia_GEN_DIR}/qmediacontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediagaplessplaybackcontrol_wrapper.cpp +# Causes compile errors: ${QtMultimedia_GEN_DIR}/qmediametadata_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmedianetworkaccesscontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qmediaobject_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaplayercontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaplayer_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaplaylist_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediarecordercontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediarecorder_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaresource_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediatimerange_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmultimedia_wrapper.cpp +${QtMultimedia_GEN_DIR}/qradiodatacontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qradiodata_wrapper.cpp +${QtMultimedia_GEN_DIR}/qradiotunercontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qradiotuner_wrapper.cpp +${QtMultimedia_GEN_DIR}/qsoundeffect_wrapper.cpp +${QtMultimedia_GEN_DIR}/qsound_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideodeviceselectorcontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideoencodersettingscontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideoencodersettings_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideofilterrunnable_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideoframe_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideoprobe_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideorenderercontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideosurfaceformat_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideowindowcontrol_wrapper.cpp # module is always needed ${QtMultimedia_GEN_DIR}/qtmultimedia_module_wrapper.cpp @@ -36,8 +97,8 @@ set(QtMultimedia_include_dirs ${QtMultimedia_SOURCE_DIR} ${SHIBOKEN_PYTHON_INCLUDE_DIR} ${QtCore_GEN_DIR} ${QtGui_GEN_DIR} - ${QtNetwork_GEN_DIR} - ) + ${QtNetwork_GEN_DIR}) + set(QtMultimedia_libraries pyside2 ${SHIBOKEN_PYTHON_LIBRARIES} ${SHIBOKEN_LIBRARY} diff --git a/PySide2/QtMultimedia/typesystem_multimedia.xml b/PySide2/QtMultimedia/typesystem_multimedia.xml index faf52961..275719f5 100644 --- a/PySide2/QtMultimedia/typesystem_multimedia.xml +++ b/PySide2/QtMultimedia/typesystem_multimedia.xml @@ -40,115 +40,6 @@ ****************************************************************************/ --> <typesystem package="PySide2.QtMultimedia"> - <load-typesystem name="typesystem_core.xml" generate="no" /> - <load-typesystem name="typesystem_gui.xml" generate="no" /> - <load-typesystem name="typesystem_network.xml" generate="no" /> - - <namespace-type name="QAudio"> - <enum-type name="Error"/> - <enum-type name="Mode"/> - <enum-type name="Role" since="5.6"/> - <enum-type name="State"/> - <enum-type name="VolumeScale" since="5.8"/> - </namespace-type> - - <value-type name="QVideoSurfaceFormat"> - <enum-type name="Direction"/> - <enum-type name="YCbCrColorSpace"/> - </value-type> - <object-type name="QAbstractVideoBuffer"> - <enum-type name="HandleType"/> - <enum-type name="MapMode"/> - <modify-function signature="map(QAbstractVideoBuffer::MapMode, int*, int*)" remove="all"/> - <!-- TODO: discuss a way to have this working with the virtual method. - <modify-function signature="map(QAbstractVideoBuffer::MapMode, int*, int*)"> - <modify-argument index="0"> - <replace-type modified-type="PyObject"/> - </modify-argument> - <modify-argument index="2"> - <remove-argument/> - </modify-argument> - <modify-argument index="3"> - <remove-argument/> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_arg,int*,int*"/> - </inject-code> - </modify-function> - --> - <!-- TODO: PYSIDE-354, arrays are not supported --> - <modify-function signature="mapPlanes(QAbstractVideoBuffer::MapMode,int*,Array,Array)" remove="all"/> - </object-type> - <object-type name="QAbstractVideoSurface"> - <enum-type name="Error"/> - </object-type> - <object-type name="QVideoFrame"> - <enum-type name="FieldType"/> - <enum-type name="PixelFormat"/> - </object-type> - - <value-type name="QAudioFormat"> - <enum-type name="Endian"/> - <enum-type name="SampleType"/> - </value-type> - <value-type name="QAudioDeviceInfo"/> - <object-type name="QAbstractAudioDeviceInfo"/> - - <object-type name="QAbstractAudioOutput"> - <modify-function signature="start()"> - <modify-argument index="return"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="start(QIODevice *)"> - <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - - <object-type name="QAbstractAudioInput"> - <modify-function signature="start()"> - <modify-argument index="return"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="start(QIODevice *)"> - <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - - <object-type name="QAudioInput"> - <modify-function signature="start()"> - <modify-argument index="return"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="start(QIODevice*)"> - <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - - <object-type name="QAudioOutput"> - <modify-function signature="start()"> - <modify-argument index="return"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="start(QIODevice*)"> - <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - - <!-- For QtMultimediaWidgets --> - <object-type name="QMediaBindableInterface"/> - <object-type name="QMediaControl"/> - <object-type name="QMediaObject"/> - + <load-typesystem name="typesystem_multimedia_common.xml" generate="yes"/> + <load-typesystem name="typesystem_multimedia_forward_declarations.xml" generate="yes"/> </typesystem> diff --git a/PySide2/QtMultimedia/typesystem_multimedia_common.xml b/PySide2/QtMultimedia/typesystem_multimedia_common.xml new file mode 100644 index 00000000..9565b433 --- /dev/null +++ b/PySide2/QtMultimedia/typesystem_multimedia_common.xml @@ -0,0 +1,365 @@ +<?xml version="1.0"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<typesystem package="PySide2.QtMultimedia"> + <load-typesystem name="typesystem_core.xml" generate="no" /> + <load-typesystem name="typesystem_gui.xml" generate="no" /> + <load-typesystem name="typesystem_network.xml" generate="no" /> + + <namespace-type name="QAudio"> + <enum-type name="Error"/> + <enum-type name="Mode"/> + <enum-type name="Role" since="5.6"/> + <enum-type name="State"/> + <enum-type name="VolumeScale" since="5.8"/> + </namespace-type> + + <value-type name="QVideoSurfaceFormat"> + <enum-type name="Direction"/> + <enum-type name="YCbCrColorSpace"/> + </value-type> + <object-type name="QAbstractVideoBuffer"> + <enum-type name="HandleType"/> + <enum-type name="MapMode"/> + <modify-function signature="map(QAbstractVideoBuffer::MapMode, int*, int*)" remove="all"/> + <!-- TODO: discuss a way to have this working with the virtual method. + <modify-function signature="map(QAbstractVideoBuffer::MapMode, int*, int*)"> + <modify-argument index="0"> + <replace-type modified-type="PyObject"/> + </modify-argument> + <modify-argument index="2"> + <remove-argument/> + </modify-argument> + <modify-argument index="3"> + <remove-argument/> + </modify-argument> + <inject-code class="target" position="beginning"> + <insert-template name="fix_arg,int*,int*"/> + </inject-code> + </modify-function> + --> + <!-- TODO: PYSIDE-354, arrays are not supported --> + <modify-function signature="mapPlanes(QAbstractVideoBuffer::MapMode,int*,Array,Array)" remove="all"/> + </object-type> + <object-type name="QAbstractVideoSurface"> + <enum-type name="Error"/> + </object-type> + <object-type name="QAbstractVideoFilter"/> + <value-type name="QVideoFrame"> + <enum-type name="FieldType"/> + <enum-type name="PixelFormat"/> + <modify-function signature="bits(int)" remove="all"/> + <modify-function signature="bits(int) const" remove="all"/> + </value-type> + + <value-type name="QAudioBuffer"/> + <object-type name="QAudioDecoder"> + <enum-type name="Error"/> + <enum-type name="State"/> + </object-type> + <value-type name="QAudioFormat"> + <enum-type name="Endian"/> + <enum-type name="SampleType"/> + </value-type> + <value-type name="QAudioDeviceInfo"/> + <object-type name="QAbstractAudioDeviceInfo"/> + + <object-type name="QAbstractAudioOutput"> + <modify-function signature="start()"> + <modify-argument index="return"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + <modify-function signature="start(QIODevice *)"> + <modify-argument index="1"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + </object-type> + + <object-type name="QAbstractAudioInput"> + <modify-function signature="start()"> + <modify-argument index="return"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + <modify-function signature="start(QIODevice *)"> + <modify-argument index="1"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + </object-type> + + <object-type name="QAudioDecoderControl"/> + <object-type name="QAudioProbe"/> + <value-type name="QAudioEncoderSettings"/> + <object-type name="QAudioEncoderSettingsControl"> + <modify-function signature="supportedSampleRates(const QAudioEncoderSettings &, bool *) const" remove="all"/> + </object-type> + + <object-type name="QAudioInput"> + <modify-function signature="start()"> + <modify-argument index="return"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + <modify-function signature="start(QIODevice*)"> + <modify-argument index="1"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + </object-type> + <object-type name="QAudioInputSelectorControl"/> + + <object-type name="QAudioOutput"> + <modify-function signature="start()"> + <modify-argument index="return"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + <modify-function signature="start(QIODevice*)"> + <modify-argument index="1"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + </object-type> + <object-type name="QAudioOutputSelectorControl"/> + <object-type name="QAudioRecorder"/> + <object-type name="QAudioRoleControl"/> + + <object-type name="QCamera"> + <value-type name="FrameRateRange"/> + <enum-type name="CaptureMode" flags="CaptureModes"/> + <enum-type name="Error"/> + <enum-type name="LockChangeReason"/> + <enum-type name="LockStatus"/> + <enum-type name="LockType" flags="LockTypes"/> + <enum-type name="Position"/> + <enum-type name="State"/> + <enum-type name="Status"/> + <modify-function signature="setViewfinder(QVideoWidget *)"> + <modify-argument index="1"> + <replace-type modified-type="QObject *" /> + </modify-argument> + <inject-code class="target" position="beginning"> + %BEGIN_ALLOW_THREADS + QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); + %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); + %END_ALLOW_THREADS + </inject-code> + </modify-function> + <modify-function signature="setViewfinder(QGraphicsVideoItem *)"> + <modify-argument index="1"> + <replace-type modified-type="QObject *" /> + </modify-argument> + <inject-code class="target" position="beginning"> + %BEGIN_ALLOW_THREADS + QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); + %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); + %END_ALLOW_THREADS + </inject-code> + </modify-function> + </object-type> + <object-type name="QCameraCaptureBufferFormatControl"/> + <object-type name="QCameraCaptureDestinationControl"/> + <object-type name="QCameraControl"> + <enum-type name="PropertyChangeType"/> + </object-type> + <!-- Private destructor + <object-type name="QCameraExposure"> + <enum-type name="FlashMode" flags="FlashModes"/> + <enum-type name="ExposureMode"/> + <enum-type name="MeteringMode"/> + <modify-function signature="supportedApertures(bool *) const" remove="all"/> + <modify-function signature="supportedIsoSensitivities(bool *) const" remove="all"/> + <modify-function signature="supportedShutterSpeeds(bool *) const" remove="all"/> + </object-type> + --> + <object-type name="QCameraExposureControl"> + <enum-type name="ExposureParameter"/> + <modify-function signature="supportedParameterRange(QCameraExposureControl::ExposureParameter, bool *) const" remove="all"/> + </object-type> + <value-type name="QCameraFocusZone"> + <enum-type name="FocusZoneStatus"/> + </value-type> + <!-- Private destructor + <object-type name="QCameraFocus"> + <enum-type name="FocusMode" flags="FocusModes"/> + <enum-type name="FocusPointMode"/> + </object-type> + --> + <value-type name="QCameraInfo"/> + <object-type name="QCameraInfoControl"/> + <object-type name="QCameraImageCapture"> + <enum-type name="CaptureDestination" flags="CaptureDestinations"/> + <enum-type name="DriveMode"/> + <enum-type name="Error"/> + <modify-function signature="supportedResolutions(const QImageEncoderSettings &, bool *) const" remove="all"/> + </object-type> + <object-type name="QCameraImageCaptureControl"/> + <!-- Private destructor + <object-type name="QCameraImageProcessing"> + <enum-type name="WhiteBalanceMode"/> + <enum-type name="ColorFilter"/> + </object-type> + --> + <object-type name="QCameraImageProcessingControl"> + <enum-type name="ProcessingParameter"/> + </object-type> + <object-type name="QCameraLocksControl"/> + <value-type name="QCameraViewfinderSettings"/> + <object-type name="QCameraViewfinderSettingsControl"> + <enum-type name="ViewfinderParameter"/> + </object-type> + <object-type name="QCameraViewfinderSettingsControl2"/> + <object-type name="QCameraZoomControl"/> + + <value-type name="QImageEncoderSettings"/> + <object-type name="QImageEncoderControl"> + <modify-function signature="supportedResolutions(const QImageEncoderSettings &, bool *) const" remove="all"/> + </object-type> + + <object-type name="QMediaAudioProbeControl"/> + <object-type name="QMediaAvailabilityControl"/> + <object-type name="QMediaBindableInterface"/> + <object-type name="QMediaContainerControl"/> + <value-type name="QMediaContent"/> + <object-type name="QMediaGaplessPlaybackControl"/> + <object-type name="QMediaControl"/> + <object-type name="QMediaNetworkAccessControl"/> + <!-- Causes compile errors + <namespace-type name="QMediaMetaData"/> + --> + <object-type name="QMediaObject"/> + <object-type name="QMediaPlayer"> + <enum-type name="State"/> + <enum-type name="MediaStatus"/> + <enum-type name="Flag" flags="Flags"/> + <enum-type name="Error"/> + <modify-function signature="setVideoOutput(QVideoWidget *)"> + <modify-argument index="1"> + <replace-type modified-type="QObject *" /> + </modify-argument> + <inject-code class="target" position="beginning"> + %BEGIN_ALLOW_THREADS + QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); + %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); + %END_ALLOW_THREADS + </inject-code> + </modify-function> + <modify-function signature="setVideoOutput(QGraphicsVideoItem *)"> + <modify-argument index="1"> + <replace-type modified-type="QObject *" /> + </modify-argument> + <inject-code class="target" position="beginning"> + %BEGIN_ALLOW_THREADS + QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1); + %CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); + %END_ALLOW_THREADS + </inject-code> + </modify-function> + </object-type> + <object-type name="QMediaPlayerControl"/> + <object-type name="QMediaPlaylist"> + <enum-type name="PlaybackMode"/> + <enum-type name="Error"/> + </object-type> + <object-type name="QMediaRecorder"> + <enum-type name="Error"/> + <enum-type name="State"/> + <enum-type name="Status"/> + <modify-function signature="supportedAudioSampleRates(const QAudioEncoderSettings &, bool *) const" remove="all"/> + <modify-function signature="supportedFrameRates(const QVideoEncoderSettings &, bool *) const" remove="all"/> + <modify-function signature="supportedResolutions(const QVideoEncoderSettings &, bool *) const" remove="all"/> + </object-type> + <object-type name="QMediaRecorderControl"/> + <value-type name="QMediaResource"/> + <value-type name="QMediaTimeRange"/> + + <namespace-type name="QMultimedia"> + <enum-type name="SupportEstimate"/> + <enum-type name="EncodingQuality"/> + <enum-type name="EncodingMode"/> + <enum-type name="AvailabilityStatus"/> + </namespace-type> + + <object-type name="QRadioData"> + <enum-type name="Error"/> + <enum-type name="ProgramType"/> + </object-type> + <object-type name="QRadioDataControl"/> + <object-type name="QRadioTuner"> + <enum-type name="Band"/> + <enum-type name="Error"/> + <enum-type name="SearchMode"/> + <enum-type name="State"/> + <enum-type name="StereoMode"/> + </object-type> + <object-type name="QRadioTunerControl"/> + <object-type name="QSound"> + <enum-type name="Loop"/> + </object-type> + <object-type name="QSoundEffect"> + <enum-type name="Loop"/> + <enum-type name="Status"/> + </object-type> + + <object-type name="QVideoDeviceSelectorControl"/> + <value-type name="QVideoEncoderSettings"/> + <object-type name="QVideoEncoderSettingsControl"> + <modify-function signature="supportedFrameRates(const QVideoEncoderSettings &, bool *) const" remove="all"/> + <modify-function signature="supportedResolutions(const QVideoEncoderSettings &, bool *) const" remove="all"/> + </object-type> + <object-type name="QVideoFilterRunnable"> + <enum-type name="RunFlag" flags="RunFlags"/> + </object-type> + <object-type name="QVideoProbe"/> + <object-type name="QVideoRendererControl"/> + <object-type name="QVideoWindowControl"/> + + <suppress-warning text="Final class 'QMediaObject' set to non-final, as it is extended by other classes"/> + <suppress-warning text="Pure virtual method 'QAbstractVideoBuffer::map(QAbstractVideoBuffer::MapMode,int*,int*)' must be implement but was completely removed on type system."/> + <suppress-warning text="Pure virtual method 'QImageEncoderControl::supportedResolutions(QImageEncoderSettings,bool*)const' must be implement but was completely removed on type system."/> + <suppress-warning text="Pure virtual method 'QCameraExposureControl::supportedParameterRange(QCameraExposureControl::ExposureParameter,bool*)const' must be implement but was completely removed on type system."/> + <suppress-warning text="Pure virtual method 'QVideoEncoderSettingsControl::supportedFrameRates(QVideoEncoderSettings,bool*)const' must be implement but was completely removed on type system."/> + <suppress-warning text="Pure virtual method 'QVideoEncoderSettingsControl::supportedResolutions(QVideoEncoderSettings,bool*)const' must be implement but was completely removed on type system."/> + <suppress-warning text="Pure virtual method 'QAudioEncoderSettingsControl::supportedSampleRates(QAudioEncoderSettings,bool*)const' must be implement but was completely removed on type system."/> +</typesystem> diff --git a/PySide2/QtMultimedia/typesystem_multimedia_forward_declarations.xml b/PySide2/QtMultimedia/typesystem_multimedia_forward_declarations.xml new file mode 100644 index 00000000..df6e28c8 --- /dev/null +++ b/PySide2/QtMultimedia/typesystem_multimedia_forward_declarations.xml @@ -0,0 +1,45 @@ +<?xml version="1.0"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<typesystem package="PySide2.QtMultimedia"> + <custom-type name="QVideoWidget"/> + <custom-type name="QGraphicsVideoItem"/> +</typesystem> diff --git a/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml b/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml index 7de4c73d..76214bae 100644 --- a/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml +++ b/PySide2/QtMultimediaWidgets/typesystem_multimediawidgets.xml @@ -42,7 +42,7 @@ <typesystem package="PySide2.QtMultimediaWidgets"> <load-typesystem name="typesystem_core.xml" generate="no" /> <load-typesystem name="typesystem_gui.xml" generate="no" /> - <load-typesystem name="typesystem_multimedia.xml" generate="no" /> + <load-typesystem name="typesystem_multimedia_common.xml" generate="no" /> <load-typesystem name="typesystem_widgets.xml" generate="no" /> <object-type name="QCameraViewfinder"/> diff --git a/PySide2/QtWinExtras/CMakeLists.txt b/PySide2/QtWinExtras/CMakeLists.txt new file mode 100644 index 00000000..4de43701 --- /dev/null +++ b/PySide2/QtWinExtras/CMakeLists.txt @@ -0,0 +1,51 @@ +project(QtWinExtras) + +set(QtWinExtras_SRC +${QtWinExtras_GEN_DIR}/qwincolorizationchangeevent_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwincompositionchangeevent_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwinevent_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwinjumplist_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwinjumplistcategory_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwinjumplistitem_wrapper.cpp +#${QtWinExtras_GEN_DIR}/qwinmime_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwintaskbarbutton_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwintaskbarprogress_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwinthumbnailtoolbar_wrapper.cpp +${QtWinExtras_GEN_DIR}/qwinthumbnailtoolbutton_wrapper.cpp + +# module is always needed +${QtWinExtras_GEN_DIR}/qtwinextras_module_wrapper.cpp +) + +make_path(QtWinExtras_typesystem_path ${QtWinExtras_SOURCE_DIR} + ${QtCore_SOURCE_DIR} + ${QtCore_BINARY_DIR} + ${QtGui_SOURCE_DIR} + ${QtGui_BINARY_DIR}) + +set(QtWinExtras_include_dirs ${QtWinExtras_SOURCE_DIR} + ${QtWinExtras_BINARY_DIR} + ${Qt5WinExtras_INCLUDE_DIRS} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${QtCore_GEN_DIR} + ${QtGui_GEN_DIR} + ${SHIBOKEN_PYTHON_INCLUDE_DIR} + ${SHIBOKEN_INCLUDE_DIR} + ${libpyside_SOURCE_DIR}) + +set(QtWinExtras_libraries pyside2 + ${Qt5WinExtras_LIBRARIES} + ${SHIBOKEN_PYTHON_LIBRARIES} + ${Qt5Core_LIBRARIES} + ${Qt5Gui_LIBRARIES}) + +set(QtWinExtras_deps QtCore QtGui) + +create_pyside_module(QtWinExtras + QtWinExtras_include_dirs + QtWinExtras_libraries + QtWinExtras_deps + QtWinExtras_typesystem_path + QtWinExtras_SRC + "") diff --git a/PySide2/QtWinExtras/typesystem_winextras.xml b/PySide2/QtWinExtras/typesystem_winextras.xml new file mode 100644 index 00000000..d7d400be --- /dev/null +++ b/PySide2/QtWinExtras/typesystem_winextras.xml @@ -0,0 +1,61 @@ +<?xml version="1.0"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of PySide2. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> +<typesystem package="PySide2.QtWinExtras"> + <load-typesystem name="typesystem_core.xml" generate="no"/> + <load-typesystem name="typesystem_gui.xml" generate="no"/> + + <object-type name="QWinEvent" since="5.2"/> + <object-type name="QWinColorizationChangeEvent" since="5.2"/> + <object-type name="QWinCompositionChangeEvent" since="5.2"/> + <object-type name="QWinJumpList" since="5.2"/> + <object-type name="QWinJumpListCategory" since="5.2"> + <enum-type name="Type"/> + </object-type> + <object-type name="QWinJumpListItem" since="5.2"> + <enum-type name="Type"/> + </object-type> + <!-- <object-type name="QWinMime" since="5.4"/> --> + <object-type name="QWinTaskbarButton" since="5.2"/> + <object-type name="QWinTaskbarProgress" since="5.2"/> + <object-type name="QWinThumbnailToolBar" since="5.2"/> + <object-type name="QWinThumbnailToolButton" since="5.2"/> +</typesystem> diff --git a/PySide2/global.h.in b/PySide2/global.h.in index eef63ee5..40b107ee 100644 --- a/PySide2/global.h.in +++ b/PySide2/global.h.in @@ -55,81 +55,33 @@ #define QT_ANNOTATE_ACCESS_SPECIFIER(a) __attribute__((annotate(#a))) #include <QtCore/QtCore> -#include <QtConcurrent/QtConcurrent> -#include <QtGui/QtGui> -#include <QtWidgets/QtWidgets> -#include <QtOpenGL/QtOpenGL> +#if @Qt5Gui_FOUND@ +# include <QtGui/QtGui> +#endif +#if @Qt5Widgets_FOUND@ +# include <QtWidgets/QtWidgets> +#endif + #include "qpytextobject.h" // PySide class + #if @ENABLE_X11@ -#if @Qt5X11Extras_FOUND@ -#include <QtX11Extras/QX11Info> -#endif +# if @Qt5X11Extras_FOUND@ +# include <QtX11Extras/QX11Info> +# endif +#elif @ENABLE_MAC@ +# include <QtGui/qmacstyle_mac.h> #endif -#include <QtXml/QtXml> -#include <QtXmlPatterns/QtXmlPatterns> -#include <QtUiTools/QtUiTools> -#include <QtNetwork/QtNetwork> -#include <QtMultimedia/QtMultimedia> -#include <QtPrintSupport/QtPrintSupport> // QT_WIDGETS_LIB must be defined to QSqlRelationalDelegate become visible. // It also changes code generation in pysideqtesttouch.h #define QT_WIDGETS_LIB -#include <QtSql/QtSql> -#include <QtSvg/QtSvg> -#if @Qt5WebKit_FOUND@ -# include <QtWebKit/QtWebKit> -#endif - -#if @Qt5WebKitWidgets_FOUND@ -# include <QtWebKitWidgets/QtWebKitWidgets> -#endif #if @Qt5Test_FOUND@ -# include <QtTest/qtest_gui.h> # include "pysideqtesttouch.h" #endif -#if @Qt5Quick_FOUND@ -# include <QtQuick/QtQuick> -#endif - -#if @Qt5Qml_FOUND@ -# include <QtQml/QtQml> -#endif - -#if @Qt5QuickWidgets_FOUND@ -# include <QtQuickWidgets/QtQuickWidgets> -#endif - -#if @Qt5WebEngineWidgets_FOUND@ -# include <QtWebEngineWidgets/QtWebEngineWidgets> -#endif - -#if @Qt5MultimediaWidgets_FOUND@ -# include <QtMultimediaWidgets/QtMultimediaWidgets> -#endif - -#if @Qt5WebChannel_FOUND@ -# include <QtWebChannel/QtWebChannel> -#endif - -#if @Qt5WebSockets_FOUND@ -# include <QtWebSockets/QtWebSockets> -#endif - -#if @Qt5Script_FOUND@ -# include <QtScript/QtScript> -#endif - -#if @Qt5ScriptTools_FOUND@ -# include <QtScriptTools/QtScriptTools> -#endif - -//QtHelp needs to be included after QtSql. Why? -#include <QtHelp/QtHelp> - #ifndef QT_NO_OPENGL -#include <@GL_H@> -#include <QtOpenGL/QtOpenGL> +# include <@GL_H@> #endif // QT_NO_OPENGL + +// Here are now all configured modules appended: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bd1385d2..2b7e3b0e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -49,38 +49,10 @@ else() add_subdirectory(pysidetest) add_subdirectory(signals) - TEST_QT_MODULE(Qt5Core_FOUND QtCore) - TEST_QT_MODULE(Qt5Concurrent_FOUND QtConcurrent) - TEST_QT_MODULE(Qt5Gui_FOUND QtGui) - TEST_QT_MODULE(Qt5Widgets_FOUND QtWidgets) - TEST_QT_MODULE(Qt5PrintSupport_FOUND QtPrintSupport) - TEST_QT_MODULE(Qt5Network_FOUND QtNetwork) - TEST_QT_MODULE(Qt5WebKit_FOUND QtWebKit) - TEST_QT_MODULE(Qt5WebKitWidgets_FOUND QtWebKitWidgets) - TEST_QT_MODULE(Qt5Xml_FOUND QtXml) - TEST_QT_MODULE(Qt5XmlPatterns_FOUND QtXmlPatterns) - TEST_QT_MODULE(Qt5Svg_FOUND QtSvg) - TEST_QT_MODULE(Qt5Test_FOUND QtTest) - TEST_QT_MODULE(Qt5Sql_FOUND QtSql) - #TEST_QT_MODULE(Qt5Designer_FOUND QtDesigner) - TEST_QT_MODULE(Qt5OpenGL_FOUND QtOpenGL) - TEST_QT_MODULE(Qt5UiTools_FOUND QtUiTools) - TEST_QT_MODULE(Qt5Help_FOUND QtHelp) - TEST_QT_MODULE(Qt5Script_FOUND QtScript) - TEST_QT_MODULE(Qt5ScriptTools_FOUND QtScriptTools) - TEST_QT_MODULE(Qt5Multimedia_FOUND QtMultimedia) - TEST_QT_MODULE(Qt5MultimediaWidgets_FOUND QtMultimediaWidgets) - TEST_QT_MODULE(Qt5Qml_FOUND QtQml) - TEST_QT_MODULE(Qt5Quick_FOUND QtQuick) - TEST_QT_MODULE(Qt5QuickWidgets_FOUND QtQuickWidgets) - TEST_QT_MODULE(Qt5WebChannel_FOUND QtWebChannel) - #TEST_QT_MODULE(Qt5WebEngine_FOUND QtWebEngine) - TEST_QT_MODULE(Qt5WebEngineWidgets_FOUND QtWebEngineWidgets) - TEST_QT_MODULE(Qt5WebSockets_FOUND QtWebSockets) - - if(UNIX AND NOT APPLE) - TEST_QT_MODULE(Qt5X11Extras_FOUND QtX11Extras) - endif() + foreach(shortname IN LISTS all_module_shortnames) + message(STATUS "preparing tests for module 'Qt${shortname}'") + TEST_QT_MODULE(Qt5${shortname}_FOUND Qt${shortname}) + endforeach() #platform specific if (ENABLE_MAC) diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index f41a0f8b..63cf3c35 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -29,12 +29,16 @@ PYSIDE_TEST(qitemselection_test.py) PYSIDE_TEST(qmatrix_test.py) PYSIDE_TEST(qopenglbuffer_test.py) PYSIDE_TEST(qpainter_test.py) +PYSIDE_TEST(qpdfwriter_test.py) +PYSIDE_TEST(qpixelformat_test.py) PYSIDE_TEST(qpixmap_test.py) PYSIDE_TEST(qpixmapcache_test.py) PYSIDE_TEST(qpolygonf_test.py) PYSIDE_TEST(qkeysequence_test.py) PYSIDE_TEST(qradialgradient_test.py) +PYSIDE_TEST(qrasterwindow_test.py) PYSIDE_TEST(qregion_test.py) +PYSIDE_TEST(qstylehints_test.py) PYSIDE_TEST(qtextdocument_undoredo_test.py) PYSIDE_TEST(qtextdocumentwriter_test.py) PYSIDE_TEST(qtextline_test.py) diff --git a/tests/QtGui/qpdfwriter_test.py b/tests/QtGui/qpdfwriter_test.py new file mode 100644 index 00000000..f97c85b3 --- /dev/null +++ b/tests/QtGui/qpdfwriter_test.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from helper import UsesQApplication +from PySide2.QtGui import QPageLayout, QPageSize, QPdfWriter, QTextDocument +from PySide2.QtCore import QDir, QMarginsF, QTemporaryFile + +class QPdfWriterTest(UsesQApplication): + + def testWrite(self): + temporaryFile = QTemporaryFile(QDir.tempPath() + "/pdfwriter_test_XXXXXX.pdf") + self.assertTrue(temporaryFile.open()) + pdfWriter = QPdfWriter(temporaryFile) + pdfWriter.setPageLayout(QPageLayout(QPageSize(QPageSize.A4), QPageLayout.Portrait, QMarginsF(10, 10, 10, 10))) + doc = QTextDocument("Some text") + doc.print_(pdfWriter) + temporaryFile.close() + self.assertTrue(temporaryFile.size() > 0) + +if __name__ == '__main__': + unittest.main() diff --git a/tests/QtGui/qpixelformat_test.py b/tests/QtGui/qpixelformat_test.py new file mode 100644 index 00000000..c7f14ff2 --- /dev/null +++ b/tests/QtGui/qpixelformat_test.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit test for QPixelFormat''' + +import unittest + +from helper import UsesQApplication +from PySide2.QtCore import QSize, Qt +from PySide2.QtGui import QColor, QImage, QPixelFormat + +class QPixelFormatTest(UsesQApplication): + def test(self): + image = QImage(QSize(200, 200), QImage.Format_ARGB32) + image.fill(QColor(Qt.red)) + pixelFormat = image.pixelFormat() + print(pixelFormat.greenSize()) + self.assertEqual(pixelFormat.alphaSize(), 8) + self.assertEqual(pixelFormat.redSize(), 8) + self.assertEqual(pixelFormat.greenSize(), 8) + self.assertEqual(pixelFormat.blueSize(), 8) + self.assertEqual(pixelFormat.bitsPerPixel(), 32) + +if __name__ == '__main__': + unittest.main() diff --git a/tests/QtGui/qrasterwindow_test.py b/tests/QtGui/qrasterwindow_test.py new file mode 100644 index 00000000..db756ff8 --- /dev/null +++ b/tests/QtGui/qrasterwindow_test.py @@ -0,0 +1,86 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit test for QBackingStore, QRasterWindow and QStaticText''' + +import unittest + +from helper import UsesQApplication +from PySide2.QtCore import QEvent, QPoint, QRect, QSize, QTimer, Qt +from PySide2.QtGui import QColor, QBackingStore, QPaintDevice, QPainter, QWindow, QPaintDeviceWindow, QRasterWindow, QRegion, QStaticText + +# QWindow rendering via QBackingStore +class TestBackingStoreWindow(QWindow): + def __init__(self): + super(TestBackingStoreWindow, self).__init__() + self.backingStore = QBackingStore(self) + self.text = QStaticText("BackingStoreWindow") + + def event(self, event): + if event.type() == QEvent.Resize: + self.backingStore.resize(self.size()) + self.render() + elif event.type() == QEvent.UpdateRequest or event.type() == QEvent.Expose: + self.backingStore.flush(QRegion(QRect(QPoint(0, 0), self.size()))) + + return QWindow.event(self, event) + + def render(self): + clientRect = QRect(QPoint(0, 0), self.size()) + painter = QPainter(self.backingStore.paintDevice()) + painter.fillRect(clientRect, QColor(Qt.green)) + painter.drawStaticText(QPoint(10, 10), self.text) + +# Window using convenience class QRasterWindow +class TestRasterWindow(QRasterWindow): + def __init__(self): + super(TestRasterWindow, self).__init__() + self.text = QStaticText("QRasterWindow") + + def paintEvent(self, event): + clientRect = QRect(QPoint(0, 0), self.size()) + painter = QPainter(self) + painter.fillRect(clientRect, QColor(Qt.red)) + painter.drawStaticText(QPoint(10, 10), self.text) + +class QRasterWindowTest(UsesQApplication): + def test(self): + rasterWindow = TestRasterWindow() + rasterWindow.setFramePosition(QPoint(100, 100)) + rasterWindow.resize(QSize(400, 400)) + rasterWindow.show() + backingStoreWindow = TestBackingStoreWindow() + backingStoreWindow.setFramePosition(QPoint(600, 100)) + backingStoreWindow.resize(QSize(400, 400)) + backingStoreWindow.show() + + QTimer.singleShot(100, self.app.quit) + self.app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/tests/QtGui/qstylehints_test.py b/tests/QtGui/qstylehints_test.py new file mode 100644 index 00000000..c3d99aa3 --- /dev/null +++ b/tests/QtGui/qstylehints_test.py @@ -0,0 +1,42 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit test for QStyleHints''' + +import unittest + +from helper import UsesQApplication +from PySide2.QtGui import QStyleHints + +class QStyleHintsTest(UsesQApplication): + def test(self): + styleHints = self.app.styleHints() + self.assertTrue(styleHints.startDragDistance() > 0) + +if __name__ == '__main__': + unittest.main() diff --git a/tests/QtMacExtras/CMakeLists.txt b/tests/QtMacExtras/CMakeLists.txt new file mode 100644 index 00000000..79c5c83a --- /dev/null +++ b/tests/QtMacExtras/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/tests/QtMacExtras/this_module_loads_test.py b/tests/QtMacExtras/this_module_loads_test.py new file mode 100644 index 00000000..0bf67354 --- /dev/null +++ b/tests/QtMacExtras/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/tests/QtWinExtras/CMakeLists.txt b/tests/QtWinExtras/CMakeLists.txt new file mode 100644 index 00000000..79c5c83a --- /dev/null +++ b/tests/QtWinExtras/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/tests/QtWinExtras/this_module_loads_test.py b/tests/QtWinExtras/this_module_loads_test.py new file mode 100644 index 00000000..0bf67354 --- /dev/null +++ b/tests/QtWinExtras/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise |