[Python-modules-commits] [pyqt5] 01/05: New upstream version 5.9.1+dfsg

Dmitry Shachnev mitya57 at moszumanska.debian.org
Thu Nov 9 13:01:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

mitya57 pushed a commit to branch debian/master
in repository pyqt5.

commit 2f5427a446fc5433fd8331a224b57bab70d1f30f
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Thu Nov 9 15:57:48 2017 +0300

    New upstream version 5.9.1+dfsg
---
 ChangeLog                                          | 153 +++++
 NEWS                                               |   6 +
 config-tests/cfgtest_QtCore.cpp                    |   6 +
 configure.py                                       | 141 ++--
 examples/ipc/sharedmemory/sharedmemory.py          |   2 +-
 pyrcc/pyrcc_main.py                                |  11 -
 pyrcc/pyrccmod.sip                                 |   1 -
 pyuic/uic/uiparser.py                              |  24 +-
 qpy/QtCore/qpycore_enums_flags.cpp                 |   2 +-
 qpy/QtCore/qpycore_event_handlers.cpp              |   4 +-
 qpy/QtCore/qpycore_pyqtboundsignal.cpp             |   6 +-
 qpy/QtCore/qpycore_pyqtsignal.cpp                  |  11 +-
 qpy/QtCore/qpycore_qjsonvalue.cpp                  |  11 +-
 qpy/QtCore/qpycore_qmessagelogger.cpp              |   3 +-
 qpy/QtGui/qpyopengl_value_array.cpp                |  19 +-
 qpy/QtQml/qpyqml_qjsvalue.cpp                      |  12 +-
 qpy/QtQml/qpyqmllistproperty.cpp                   |   4 +-
 qpy/pyrcc/rcc.h                                    |   5 +-
 sip/QtBluetooth/qpybluetooth_qlist.sip             |   2 +
 sip/QtCore/QtCoremod.sip                           |   2 +-
 sip/QtCore/qcryptographichash.sip                  |  12 +
 sip/QtCore/qglobal.sip                             |   4 +-
 sip/QtCore/qjsonarray.sip                          |   1 +
 sip/QtCore/qoperatingsystemversion.sip             |   5 +
 sip/QtCore/qpycore_qhash.sip                       |  10 +-
 sip/QtCore/qpycore_qlist.sip                       |  43 +-
 sip/QtCore/qpycore_qmap.sip                        |  10 +-
 sip/QtCore/qpycore_qpair.sip                       |  30 +-
 sip/QtCore/qpycore_qset.sip                        |   2 +
 sip/QtCore/qpycore_qvector.sip                     |  13 +-
 sip/QtCore/qstringlist.sip                         |   1 +
 sip/QtCore/qthreadpool.sip                         |  16 +-
 sip/QtCore/qurl.sip                                |  24 +-
 sip/QtGui/qpygui_qlist.sip                         |   8 +-
 sip/QtGui/qpygui_qpair.sip                         |  12 +-
 sip/QtGui/qpygui_qvector.sip                       |   4 +
 sip/QtMultimedia/qpymultimedia_qlist.sip           |  28 +-
 sip/QtNetwork/qpynetwork_qhash.sip                 |   8 +-
 sip/QtPrintSupport/qpyprintsupport_qlist.sip       |  16 +-
 sip/QtWebEngineWidgets/qwebenginepage.sip          |   2 +-
 sip/QtWidgets/qpywidgets_qlist.sip                 |   7 +-
 sip/QtWidgets/qtabbar.sip                          |   4 +
 sip/_QOpenGLFunctions_ES2/qopenglfunctions_es2.sip | 751 +++++++++++++++++++++
 sip/pyrcc/pyrcc_main.py                            |  11 -
 sip/pyrcc/pyrccmod.sip                             |   1 -
 45 files changed, 1236 insertions(+), 212 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1563fe2..eae6365 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,158 @@
+2017-11-02  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* NEWS:
+	Released as v5.9.1.
+	[6a8d6710ba64] [5.9.1] <5.9-maint>
+
+	* lib/configure.py:
+	Windows-specific fixes related to the detection of sip version
+	mismatches.
+	[2a30790477c1] <5.9-maint>
+
+2017-11-01  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* lib/configure.py:
+	Further fixes for --sip-incdir.
+	[4859965322a4] <5.9-maint>
+
+	* lib/configure.py:
+	Fixed the handling of the --sip-incdir option.
+	[e1ac86a6bc52] <5.9-maint>
+
+	* config-tests/cfgtest_QtCore.cpp, lib/configure.py:
+	configure.py now makes sure that the version numbers of the sip code
+	generator and sip.h match.
+	[d5b36b960994] <5.9-maint>
+
+	* lib/configure.py:
+	Added the --allow-sip-warnings option to configure.py.
+	[f4eebe2a30ee] <5.9-maint>
+
+2017-10-31  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* qpy/QtCore/qpycore_event_handlers.cpp:
+	Release the GIL when connecting a QObject monitor because of
+	reported deadlocks.
+	[f945685fa2b5] <5.9-maint>
+
+2017-10-07  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* PyQt5.msp:
+	Added support for Qt v5.9.2.
+	[f2ddcf108add] <5.9-maint>
+
+	* PyQt5.msp:
+	Rescanned QUrl with the fixed metasip to fix code that may not be
+	able to be handled by old versions of GCC. There will probably be
+	other cases but the only solution woukd be to rescan every single
+	class.
+	[dd92e57fbfaa] <5.9-maint>
+
+2017-10-06  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* pyuic/uic/uiparser.py:
+	Fixed pyuic handling of margins of QWidgets that are not layout
+	widgets.
+	[ee2eef5d82ee] <5.9-maint>
+
+2017-09-22  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* pyuic/uic/uiparser.py:
+	Fixed the default margins of nested layouts.
+	[0e7d014185b6] <5.9-maint>
+
+2017-09-06  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* qpy/QtCore/qpycore_event_handlers.cpp:
+	Fixed a memory leak caused by multiple identical connections when
+	monitoring a QObject's lifecycle.
+	[0abf2886cbef] <5.9-maint>
+
+2017-09-05  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* examples/ipc/sharedmemory/sharedmemory.py:
+	Fixed the shared memeory example.
+	[718b731a63a8] <5.9-maint>
+
+	* qpy/QtCore/qpycore_pyqtboundsignal.cpp,
+	qpy/QtCore/qpycore_qlist.sip, qpy/QtGui/qpygui_qlist.sip,
+	qpy/QtGui/qpygui_qpair.sip,
+	qpy/QtMultimedia/qpymultimedia_qlist.sip,
+	qpy/QtNetwork/qpynetwork_qhash.sip,
+	qpy/QtPrintSupport/qpyprintsupport_qlist.sip,
+	qpy/QtWidgets/qpywidgets_qlist.sip:
+	Removed all calls to sipCanConvertToEnum().
+	[c75deb889b1e] <5.9-maint>
+
+2017-08-31  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* qpy/QtCore/qpycore_enums_flags.cpp,
+	qpy/QtCore/qpycore_pyqtsignal.cpp, qpy/QtCore/qpycore_qhash.sip,
+	qpy/QtCore/qpycore_qlist.sip, qpy/QtCore/qpycore_qmap.sip,
+	qpy/QtCore/qpycore_qmessagelogger.cpp, qpy/QtCore/qpycore_qpair.sip,
+	qpy/QtCore/qpycore_qvector.sip, qpy/QtGui/qpyopengl_value_array.cpp,
+	qpy/QtQml/qpyqmllistproperty.cpp:
+	Removed all calls to SIPLong_AsLong().
+	[326d7caa3d2e] <5.9-maint>
+
+	* qpy/QtCore/qpycore_pyqtboundsignal.cpp,
+	qpy/QtCore/qpycore_qjsonvalue.cpp, qpy/QtCore/qpycore_qlist.sip,
+	qpy/QtGui/qpygui_qlist.sip, qpy/QtGui/qpygui_qpair.sip,
+	qpy/QtMultimedia/qpymultimedia_qlist.sip,
+	qpy/QtNetwork/qpynetwork_qhash.sip,
+	qpy/QtPrintSupport/qpyprintsupport_qlist.sip,
+	qpy/QtQml/qpyqml_qjsvalue.cpp, qpy/QtWidgets/qpywidgets_qlist.sip:
+	Migrated all handwritten code to use sipConvertToEnum().
+	[8f3251301f87] <5.9-maint>
+
+2017-08-30  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* rb-product:
+	SIP v4.19.4 is now required.
+	[302c09890e23] <5.9-maint>
+
+2017-07-25  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* pyrcc/pyrcc_main.py, pyrcc/pyrccmod.sip, qpy/pyrcc/rcc.h:
+	Removed the unimplemented -name option to pyrcc.
+	[307cff7f1dbb] <5.9-maint>
+
+2017-07-22  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* PyQt5.msp:
+	Fixed QTabBar when built without accessibility support.
+	[0c5314852dd2] <5.9-maint>
+
+2017-07-16  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* lib/configure.py:
+	Fixed the configuration tests' handling of disabled features.
+	[1a7f9ba28fed] <5.9-maint>
+
+2017-07-10  Phil Thompson  <phil at riverbankcomputing.com>
+
+	* qpy/QtBluetooth/qpybluetooth_qlist.sip, qpy/QtCore/qjsonarray.sip,
+	qpy/QtCore/qpycore_qlist.sip, qpy/QtCore/qpycore_qset.sip,
+	qpy/QtCore/qpycore_qvector.sip, qpy/QtCore/qstringlist.sip,
+	qpy/QtGui/qpygui_qvector.sip,
+	qpy/QtMultimedia/qpymultimedia_qlist.sip,
+	qpy/QtPrintSupport/qpyprintsupport_qlist.sip,
+	qpy/QtWidgets/qpywidgets_qlist.sip:
+	Clear the exception whenever PyObject_GetIter() fails when checking
+	if an object can be converted.
+	[07fc1c2b14a6] <5.9-maint>
+
+	* PyQt5.msp:
+	Release the GIL on all QThreadPool methods that access the internal
+	mutex.
+	[f710d0e81300] <5.9-maint>
+
 2017-07-03  Phil Thompson  <phil at riverbankcomputing.com>
 
+	* .hgtags:
+	Added tag 5.9 for changeset 307fa2afedd4
+	[d84f568cd92f]
+
 	* NEWS:
 	Released as v5.9.
 	[307fa2afedd4] [5.9]
diff --git a/NEWS b/NEWS
index 4258beb..a2173ab 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,9 @@
+v5.9.1 1st November 2017
+  - Added support for Qt v5.9.2.
+  - Added the --allow-sip-warnings option to configure.py.
+  - Removed the unimplemented -name option to pyrcc5.
+  - SIP v4.19.4 is required.
+
 v5.9 3rd July 2017
   - Added support for Qt v5.9.0 and v5.9.1.
   - Improved detection of the destruction of QObject-based instances by C++.
diff --git a/config-tests/cfgtest_QtCore.cpp b/config-tests/cfgtest_QtCore.cpp
index 7fad5ba..3bf0eb0 100644
--- a/config-tests/cfgtest_QtCore.cpp
+++ b/config-tests/cfgtest_QtCore.cpp
@@ -1,3 +1,5 @@
+#include <sip.h>
+
 #include <QCoreApplication>
 #include <QFile>
 #include <QLibraryInfo>
@@ -14,6 +16,10 @@ int main(int argc, char **argv)
 
     QTextStream out(&outf);
 
+    // This allows the version of sip.h to be checked against the code
+    // generator.
+    out << SIP_VERSION_STR << '\n';
+
     // This is not a feature and needs to be handled separately.
 #if defined(QT_SHARED) || defined(QT_DLL)
     out << "shared\n";
diff --git a/configure.py b/configure.py
index b24866d..a1e56e8 100644
--- a/configure.py
+++ b/configure.py
@@ -28,9 +28,9 @@ import sys
 
 
 # Initialise the constants.
-PYQT_VERSION_STR = "5.9"
+PYQT_VERSION_STR = "5.9.1"
 
-SIP_MIN_VERSION = '4.19.3'
+SIP_MIN_VERSION = '4.19.4'
 
 
 class ModuleMetadata:
@@ -521,7 +521,8 @@ class TargetConfiguration:
         self.qt_shared = False
         self.qt_version = 0
         self.sip = self._find_exe('sip5', 'sip')
-        self.sip_inc_dir = ''
+        self.sip_h_version = None
+        self.sip_inc_dir = self.py_venv_inc_dir
         self.static = False
         self.sysroot = ''
         self.vend_enabled = False
@@ -601,26 +602,12 @@ class TargetConfiguration:
                 self.pyqt_sip_dir)
         self.pyuic_interpreter = parser.get(section, 'pyuic_interpreter',
                 self.pyuic_interpreter)
+
+        self.sip_inc_dir = self.py_venv_inc_dir
  
     def from_introspection(self, verbose, debug):
         """ Initialise the configuration by introspecting the system. """
 
-        inform("Determining the details of your Qt installation...")
-
-        # Compile and run the QtCore test program.
-        test = compile_test_program(self, verbose, 'QtCore', debug=debug)
-        if test is None:
-            error("Failed to determine the detail of your Qt installation. Try again using the --verbose flag to see more detail about the problem.")
-
-        lines = run_test_program('QtCore', test, verbose)
-
-        self.qt_shared = (lines[0] == 'shared')
-        self.pyqt_disabled_features = lines[1:-1]
-
-        if self.pyqt_disabled_features:
-            inform("Disabled QtCore features: %s" % ', '.join(
-                    self.pyqt_disabled_features))
-
         # Get the details of the Python interpreter library.
         py_major = self.py_version >> 16
         py_minor = (self.py_version >> 8) & 0x0ff
@@ -684,6 +671,25 @@ class TargetConfiguration:
             self.pyqt_stubs_dir = self._apply_sysroot(self.pyqt_stubs_dir)
             self.pyqt_sip_dir = self._apply_sysroot(self.pyqt_sip_dir)
 
+        inform("Determining the details of your Qt installation...")
+
+        # Compile and run the QtCore test program.
+        test = compile_test_program(self, verbose, 'QtCore', debug=debug,
+                uses_sip_h=True)
+        if test is None:
+            error("Failed to determine the detail of your Qt installation. Try again using the --verbose flag to see more detail about the problem.")
+
+        lines = run_test_program('QtCore', test, verbose)
+
+        self.sip_h_version = lines[0]
+
+        self.qt_shared = (lines[1] == 'shared')
+        self.pyqt_disabled_features = lines[2:-1]
+
+        if self.pyqt_disabled_features:
+            inform("Disabled QtCore features: %s" % ', '.join(
+                    self.pyqt_disabled_features))
+
     def _apply_sysroot(self, dir_name):
         """ Replace any leading sys.prefix of a directory name with sysroot.
         """
@@ -768,7 +774,6 @@ class TargetConfiguration:
         if self.py_platform.startswith('linux') or self.py_platform == 'darwin':
             self.prot_is_public = True
 
-        self.sip_inc_dir = self.py_venv_inc_dir
         self.vend_inc_dir = self.py_venv_inc_dir
         self.vend_lib_dir = self.py_lib_dir
 
@@ -819,6 +824,9 @@ class TargetConfiguration:
         if opts.qmakespec is not None:
             self.qmake_spec = opts.qmakespec
 
+        if opts.sipincdir is not None:
+            self.sip_inc_dir = opts.sipincdir
+
     def apply_post_options(self, opts):
         """ Apply options from the command line that override the previous
         configuration.  opts are the command line options.
@@ -904,9 +912,6 @@ class TargetConfiguration:
         elif not opts.install_sipfiles:
             self.pyqt_sip_dir = ''
 
-        if opts.sipincdir is not None:
-            self.sip_inc_dir = opts.sipincdir
-
         if opts.static:
             self.static = True
 
@@ -931,12 +936,35 @@ class TargetConfiguration:
                     "Using the VendorID package when building static "
                     "libraries makes no sense.")
 
-    def get_pylib_link_arguments(self):
+    def get_pylib_link_arguments(self, name=True):
         """ Return a string to append to qmake's LIBS macro to link against the
         Python interpreter library.
         """
 
-        return qmake_quote('-L' + self.py_pylib_dir) + ' -l' + self.py_pylib_lib
+        args = qmake_quote('-L' + self.py_pylib_dir)
+
+        if name:
+            args += ' -l' + self.py_pylib_lib
+
+        return args
+
+    def add_sip_h_directives(self, pro_lines):
+        """ Add the directives required by sip.h to a sequence of .pro file
+        lines.
+        """
+
+        # Make sure the include directory is searched before the Python include
+        # directory if they are different.
+        pro_lines.append('INCLUDEPATH += %s' % qmake_quote(self.sip_inc_dir))
+        if self.py_inc_dir != self.sip_inc_dir:
+            pro_lines.append('INCLUDEPATH += %s' % qmake_quote(self.py_inc_dir))
+
+        # Python.h on Windows seems to embed the need for pythonXY.lib, so tell
+        # it where it is.
+        if not self.static:
+            pro_lines.extend(['win32 {',
+                    '    LIBS += ' + self.get_pylib_link_arguments(name=False),
+                    '}'])
 
     @staticmethod
     def _find_exe(*exes):
@@ -1111,6 +1139,10 @@ def create_optparser(target_config):
             metavar="DIR",
             help="the directory containing the sip.h header file is DIR "
                     "[default: %s]" % target_config.sip_inc_dir)
+    g.add_option("--allow-sip-warnings", dest='fatal_warnings',
+            default=True, action='store_false',
+            help="allow sip to issue non-fatal warning messages "
+                    "[default: warning messages are treated as errors]")
 
     g.add_option("--no-python-dbus", dest='nopydbus',
             default=False, action='store_true',
@@ -1396,11 +1428,12 @@ def check_5_6_modules(target_config, disabled_modules, verbose):
             'const char *v = QTWEBENGINE_VERSION_STR')
 
 
-def generate_makefiles(target_config, verbose, parts, tracing):
+def generate_makefiles(target_config, verbose, parts, tracing, fatal_warnings):
     """ Generate the makefiles to build everything.  target_config is the
     target configuration.  verbose is set if the output is to be displayed.
     parts is the number of parts the generated code should be split into.
     tracing is set if the generated code should include tracing calls.
+    fatal_warnings is set if warnings are fatal.
     """
 
     # For the top-level .pro file.
@@ -1437,7 +1470,8 @@ def generate_makefiles(target_config, verbose, parts, tracing):
             qpy_headers = []
 
         generate_sip_module_code(target_config, verbose, parts, tracing, mname,
-                sip_flags, metadata.public, qpy_sources, qpy_headers)
+                fatal_warnings, sip_flags, metadata.public, qpy_sources,
+                qpy_headers)
         subdirs.append(mname)
 
     # Generate the composite module.
@@ -1458,7 +1492,7 @@ def generate_makefiles(target_config, verbose, parts, tracing):
     f.close()
 
     generate_sip_module_code(target_config, verbose, parts, tracing, 'Qt',
-            sip_flags, False)
+            fatal_warnings, sip_flags, False)
     subdirs.append('Qt')
 
     wrappers = []
@@ -2168,16 +2202,14 @@ int main(int, char **)
     if source is None:
         for disabled in run_test_program(mname, test, verbose):
             if disabled:
-                inform("Disabled %s features: %s" % (mname,
-                        ', '.join(disabled)))
-
-            target_config.pyqt_disabled_features.extend(disabled)
+                inform("Disabled %s feature: %s" % (mname, disabled))
+                target_config.pyqt_disabled_features.append(disabled)
 
     # Include the module in the build.
     target_config.pyqt_modules.append(mname)
 
 
-def compile_test_program(target_config, verbose, mname, source=None, debug=None):
+def compile_test_program(target_config, verbose, mname, source=None, debug=None, uses_sip_h=False):
     """ Compile the source of a Qt program and return the name of the
     executable or None if it couldn't be created.  target_config is the target
     configuration.  verbose is set if the output is to be displayed.  mname is
@@ -2185,7 +2217,7 @@ def compile_test_program(target_config, verbose, mname, source=None, debug=None)
     program.  If it is None then the source is expected to be found in the
     config-tests directory.  debug is set if debug, rather than release, mode
     is to be used.  If it is None then the mode is taken from the target
-    configuration.
+    configuration.  uses_sip_h is set if the test program uses sip.h.
     """
 
     metadata = MODULE_METADATA[mname]
@@ -2208,6 +2240,10 @@ def compile_test_program(target_config, verbose, mname, source=None, debug=None)
     pro_lines = []
     pro_add_qt_dependencies(target_config, metadata, pro_lines, debug)
     pro_lines.append('TARGET = %s' % name)
+
+    if uses_sip_h:
+        target_config.add_sip_h_directives(pro_lines)
+
     pro_lines.append('SOURCES = %s' % name_source)
 
     f = open_for_writing(name_pro)
@@ -2349,16 +2385,16 @@ def mk_dir(name):
         pass
 
 
-def generate_sip_module_code(target_config, verbose, parts, tracing, mname, sip_flags, doc_support, qpy_sources=None, qpy_headers=None):
+def generate_sip_module_code(target_config, verbose, parts, tracing, mname, fatal_warnings, sip_flags, doc_support, qpy_sources=None, qpy_headers=None):
     """ Generate the code for a module.  target_config is the target
     configuration.  verbose is set if the output is to be displayed.  parts is
     the number of parts the generated code should be split into.  tracing is
     set if the generated code should include tracing calls.  mname is the name
-    of the module to generate the code for.  sip_flags is the string of flags
-    to pass to sip.  doc_support is set if documentation support is to be
-    generated for the module.  qpy_sources is the optional list of QPy support
-    code source files.  qpy_headers is the optional list of QPy support code
-    header files.
+    of the module to generate the code for.  fatal_warnings is set if warnings
+    are fatal.  sip_flags is the string of flags to pass to sip.  doc_support
+    is set if documentation support is to be generated for the module.
+    qpy_sources is the optional list of QPy support code source files.
+    qpy_headers is the optional list of QPy support code header files.
     """
 
     inform("Generating the C++ source for the %s module..." % mname)
@@ -2366,7 +2402,10 @@ def generate_sip_module_code(target_config, verbose, parts, tracing, mname, sip_
     mk_clean_dir(mname)
 
     # Build the SIP command line.
-    argv = [quote(target_config.sip), '-w', '-f', sip_flags]
+    argv = [quote(target_config.sip), '-w', sip_flags]
+
+    if fatal_warnings:
+        argv.append('-f')
 
     # Make sure any unknown Qt version gets treated as the latest Qt v5.
     argv.append('-B')
@@ -2498,18 +2537,16 @@ def generate_module_makefile(target_config, verbose, mname, include_paths=None,
 
     if not target_config.static:
         debug_suffix = target_config.get_win32_debug_suffix()
-        link = target_config.get_pylib_link_arguments()
 
         shared = '''
 win32 {
     PY_MODULE = %s%s.pyd
     target.files = %s%s.pyd
-    LIBS += %s
 } else {
     PY_MODULE = %s.so
     target.files = %s.so
 }
-''' % (target_name, debug_suffix, target_name, debug_suffix, link, target_name, target_name)
+''' % (target_name, debug_suffix, target_name, debug_suffix, target_name, target_name)
 
         pro_lines.extend(shared.split('\n'))
 
@@ -2548,11 +2585,7 @@ win32 {
     # This is needed for Windows.
     pro_lines.append('INCLUDEPATH += .')
 
-    # Make sure the SIP include directory is searched before the Python include
-    # directory if they are different.
-    pro_lines.append('INCLUDEPATH += %s' % qmake_quote(target_config.sip_inc_dir))
-    if target_config.py_inc_dir != target_config.sip_inc_dir:
-        pro_lines.append('INCLUDEPATH += %s' % qmake_quote(target_config.py_inc_dir))
+    target_config.add_sip_h_directives(pro_lines)
 
     if metadata.qpy_lib:
         # This is the easiest way to make sure it is set for handwritten code.
@@ -2877,6 +2910,13 @@ def main(argv):
     # Check SIP is what we need.
     sip_version = check_sip(target_config)
 
+    if target_config.sip_h_version is not None:
+        if target_config.sip_h_version != sip_version:
+            error("%s has version %s but %s has version %s." % (
+                    os.path.join(target_config.sip_inc_dir, 'sip.h'),
+                    target_config.sip_h_version, target_config.sip,
+                    sip_version))
+
     # Check Qt is what we need.
     check_qt(target_config)
 
@@ -2894,7 +2934,8 @@ def main(argv):
 
     # Generate the makefiles.
     generate_makefiles(target_config, opts.verbose,
-            opts.split if opts.concat else 0, opts.tracing)
+            opts.split if opts.concat else 0, opts.tracing,
+            opts.fatal_warnings)
 
 
 ###############################################################################
diff --git a/examples/ipc/sharedmemory/sharedmemory.py b/examples/ipc/sharedmemory/sharedmemory.py
index fc8eb6e..72c97fc 100755
--- a/examples/ipc/sharedmemory/sharedmemory.py
+++ b/examples/ipc/sharedmemory/sharedmemory.py
@@ -129,7 +129,7 @@ class Dialog(QDialog):
         self.sharedMemory.lock()
 
         # Copy image data from buf into shared memory area.
-        self.sharedMemory.data()[:] = buf.data().data()
+        self.sharedMemory.data()[:size] = buf.data()[:size]
         self.sharedMemory.unlock()
 
     def loadFromMemory(self):
diff --git a/pyrcc/pyrcc_main.py b/pyrcc/pyrcc_main.py
index 95728d5..45796e8 100644
--- a/pyrcc/pyrcc_main.py
+++ b/pyrcc/pyrcc_main.py
@@ -24,7 +24,6 @@ from .pyrcc import *
 
 
 # Initialise the globals.
-initName = ''
 verbose = False
 compressLevel = CONSTANT_COMPRESSLEVEL_DEFAULT
 compressThreshold = CONSTANT_COMPRESSTHRESHOLD_DEFAULT
@@ -38,7 +37,6 @@ def processResourceFile(filenamesIn, filenameOut, listFiles):
     # Setup.
     library = RCCResourceLibrary()
     library.setInputFiles(filenamesIn)
-    library.setInitName(initName)
     library.setVerbose(verbose)
     library.setCompressLevel(compressLevel)
     library.setCompressThreshold(compressThreshold)
@@ -84,7 +82,6 @@ def showHelp(error):
 "\n"
 "Options:\n"
 "    -o file           Write output to file rather than stdout\n"
-"    -name name        Create an external initialization function with name\n"
 "    -threshold level  Threshold to consider compressing files\n"
 "    -compress level   Compress input files by level\n"
 "    -root path        Prefix resource access path with root path\n"
@@ -120,14 +117,6 @@ def main():
                 outFilename = sys.argv[i]
                 i += 1
 
-            elif opt == "name":
-                if i >= argc:
-                    errorMsg = "Missing target name"
-                    break
-
-                initName = sys.argv[i]
-                i += 1
-
             elif opt == "root":
                 if i >= argc:
                     errorMsg = "Missing root path"
diff --git a/pyrcc/pyrccmod.sip b/pyrcc/pyrccmod.sip
index 4a75a08..d2a303e 100644
--- a/pyrcc/pyrccmod.sip
+++ b/pyrcc/pyrccmod.sip
@@ -65,7 +65,6 @@ public:
     QStringList dataFiles() const;
 
     void setVerbose(bool b);
-    void setInitName(const QString &n);
     void setCompressLevel(int c);
     void setCompressThreshold(int t);
     void setResourceRoot(QString str);
diff --git a/pyuic/uic/uiparser.py b/pyuic/uic/uiparser.py
index 7ef3799..e47e23f 100644
--- a/pyuic/uic/uiparser.py
+++ b/pyuic/uic/uiparser.py
@@ -1,6 +1,6 @@
 #############################################################################
 ##
-## Copyright (C) 2016 Riverbank Computing Limited.
+## Copyright (C) 2017 Riverbank Computing Limited.
 ## Copyright (C) 2006 Thorsten Marek.
 ## All right reserved.
 ##
@@ -138,9 +138,9 @@ class WidgetStack(list):
 
     def topIsLayoutWidget(self):
         # A plain QWidget is a layout widget unless it's parent is a
-        # QMainWindow or a QTabWidget.  Note that the corresponding uic test is
-        # a little more complicated as it involves features not supported by
-        # pyuic.
+        # QMainWindow or a container widget.  Note that the corresponding uic
+        # test is a little more complicated as it involves features not
+        # supported by pyuic.
 
         if type(self[-1]) is not QtWidgets.QWidget:
             return False
@@ -148,7 +148,17 @@ class WidgetStack(list):
         if len(self) < 2:
             return False
 
-        return type(self[-2]) not in (QtWidgets.QMainWindow, QtWidgets.QTabWidget)
+        parent = self[-2]
+
+        return isinstance(parent, QtWidgets.QWidget) and type(parent) not in (
+                QtWidgets.QMainWindow,
+                QtWidgets.QStackedWidget,
+                QtWidgets.QToolBox,
+                QtWidgets.QTabWidget,
+                QtWidgets.QScrollArea,
+                QtWidgets.QMdiArea,
+                QtWidgets.QWizard,
+                QtWidgets.QDockWidget)
 
 
 class ButtonGroup(object):
@@ -444,8 +454,8 @@ class UIParser(object):
         # different.  The following will select, in order of preference,
         # separate margins, the same margin in all directions, and the default
         # margin.
-        margin = self.wprops.getProperty(elem, 'margin',
-                self.defaults['margin'])
+        margin = -1 if self.stack.topIsLayout() else self.defaults['margin']
+        margin = self.wprops.getProperty(elem, 'margin', margin)
         left = self.wprops.getProperty(elem, 'leftMargin', margin)
         top = self.wprops.getProperty(elem, 'topMargin', margin)
         right = self.wprops.getProperty(elem, 'rightMargin', margin)
diff --git a/qpy/QtCore/qpycore_enums_flags.cpp b/qpy/QtCore/qpycore_enums_flags.cpp
index a1e1372..88ce053 100644
--- a/qpy/QtCore/qpycore_enums_flags.cpp
+++ b/qpy/QtCore/qpycore_enums_flags.cpp
@@ -90,7 +90,7 @@ static PyObject *parse_enums_flags(PyObject *args, bool flags)
         {
             PyErr_Clear();
 
-            int i_value = SIPLong_AsLong(value);
+            int i_value = sipLong_AsInt(value);
 
             if (PyErr_Occurred())
                 continue;
diff --git a/qpy/QtCore/qpycore_event_handlers.cpp b/qpy/QtCore/qpycore_event_handlers.cpp
index 55d83c5..cb0bccb 100644
--- a/qpy/QtCore/qpycore_event_handlers.cpp
+++ b/qpy/QtCore/qpycore_event_handlers.cpp
@@ -75,8 +75,10 @@ void PyQtMonitor::monitor(QObject *cppInst)
     // to monitoring.  Note that subsequently calling disconnect() would cause
     // a crash - this is why we keep a separate record of C++ instances
     // currently being monitored and never explicitly disconnect the monitor.
+    Py_BEGIN_ALLOW_THREADS
     connect(cppInst, SIGNAL(destroyed(QObject *)),
-            SLOT(on_destroyed(QObject *)));
+            SLOT(on_destroyed(QObject *)), Qt::UniqueConnection);
+    Py_END_ALLOW_THREADS
 }
 
 
diff --git a/qpy/QtCore/qpycore_pyqtboundsignal.cpp b/qpy/QtCore/qpycore_pyqtboundsignal.cpp
index 1c6e70f..72e9ff4 100644
--- a/qpy/QtCore/qpycore_pyqtboundsignal.cpp
+++ b/qpy/QtCore/qpycore_pyqtboundsignal.cpp
@@ -385,7 +385,9 @@ static PyObject *pyqtBoundSignal_connect(PyObject *self, PyObject *args,
 
     if (py_type)
     {
-        if (!sipCanConvertToEnum(py_type, sipType_Qt_ConnectionType))
+        int v = sipConvertToEnum(py_type, sipType_Qt_ConnectionType);
+
+        if (PyErr_Occurred())
         {
             PyErr_Format(PyExc_TypeError,
                     "Qt.ConnectionType expected, not '%s'",
@@ -394,7 +396,7 @@ static PyObject *pyqtBoundSignal_connect(PyObject *self, PyObject *args,
             return 0;
         }
 
-        q_type = (Qt::ConnectionType)SIPLong_AsLong(py_type);
+        q_type = static_cast<Qt::ConnectionType>(v);
     }
 
     QObject *q_tx = bs->bound_qobject, *q_rx;
diff --git a/qpy/QtCore/qpycore_pyqtsignal.cpp b/qpy/QtCore/qpycore_pyqtsignal.cpp
index 516c485..9763f8f 100644
--- a/qpy/QtCore/qpycore_pyqtsignal.cpp
+++ b/qpy/QtCore/qpycore_pyqtsignal.cpp
@@ -341,15 +341,14 @@ static int pyqtSignal_init(PyObject *self, PyObject *args, PyObject *kwd_args)
             else if (qstrcmp(PyString_AsString(key), "revision") == 0)
 #endif
             {
-                PyErr_Clear();
-
-                revision = SIPLong_AsLong(value);
+                revision = sipLong_AsInt(value);
 
                 if (PyErr_Occurred())
                 {
-                    PyErr_Format(PyExc_TypeError,
-                            "signal 'revision' must be an int, not %s",
-                            sipPyTypeName(Py_TYPE(value)));
+                    if (PyErr_ExceptionMatches(PyExc_TypeError))
+                        PyErr_Format(PyExc_TypeError,
+                                "signal 'revision' must be an int, not %s",
+                                sipPyTypeName(Py_TYPE(value)));
 
                     Py_XDECREF(name_obj);
                     return -1;
diff --git a/qpy/QtCore/qpycore_qjsonvalue.cpp b/qpy/QtCore/qpycore_qjsonvalue.cpp
index c682e35..d2e2dce 100644
--- a/qpy/QtCore/qpycore_qjsonvalue.cpp
+++ b/qpy/QtCore/qpycore_qjsonvalue.cpp
@@ -28,6 +28,7 @@
 // See if a Python object can be converted to a QJsonValue.
 int qpycore_canConvertTo_QJsonValue(PyObject *py)
 {
+    // Note that the API doesn't provide a test for constrained named enums.
     if (PyObject_TypeCheck(py, sipTypeAsPyTypeObject(sipType_QJsonValue_Type)))
         return 1;
 
@@ -65,7 +66,15 @@ int qpycore_convertTo_QJsonValue(PyObject *py, PyObject *transferObj,
 {
     if (PyObject_TypeCheck(py, sipTypeAsPyTypeObject(sipType_QJsonValue_Type)))
     {
-        *cpp = new QJsonValue((QJsonValue::Type)SIPLong_AsLong(py));
+        int v = sipConvertToEnum(py, sipType_QJsonValue_Type);
+
+        if (PyErr_Occurred())
+        {
+            *isErr = 1;
+            return 0;
+        }
+
+        *cpp = new QJsonValue(static_cast<QJsonValue::Type>(v));
 
         return sipGetState(transferObj);
     }
diff --git a/qpy/QtCore/qpycore_qmessagelogger.cpp b/qpy/QtCore/qpycore_qmessagelogger.cpp
index de46887..ba5625d 100644
--- a/qpy/QtCore/qpycore_qmessagelogger.cpp
+++ b/qpy/QtCore/qpycore_qmessagelogger.cpp
@@ -84,7 +84,8 @@ int qpycore_current_context(const char **file, const char **function)
 #endif
     *file = SIPBytes_AsString(saved_file);
 
-    linenr = SIPLong_AsLong(linenr_obj);
+    // Ignore any overflow exception.
+    linenr = sipLong_AsInt(linenr_obj);
 
     Py_XDECREF(saved_function);
 #if PY_MAJOR_VERSION >= 3
diff --git a/qpy/QtGui/qpyopengl_value_array.cpp b/qpy/QtGui/qpyopengl_value_array.cpp
index b6aaf25..95ea2ec 100644
--- a/qpy/QtGui/qpyopengl_value_array.cpp
+++ b/qpy/QtGui/qpyopengl_value_array.cpp
@@ -369,52 +369,45 @@ static void *convert_values(Array *array, PyObject *values, GLenum gl_type,
 }
 
 
-#if PY_MAJOR_VERSION >= 3
-#define Long_AsUnsignedLong PyLong_AsUnsignedLongMask
-#else
-#define Long_AsUnsignedLong PyInt_AsUnsignedLongMask
-#endif
-
-
 // Convert a Python object to a GLbyte.
 static void convert_byte(PyObject *itm, void *array, Py_ssize_t i)
 {
-    reinterpret_cast<GLbyte *>(array)[i] = SIPLong_AsLong(itm);
+    reinterpret_cast<GLbyte *>(array)[i] = sipLong_AsSignedChar(itm);
 }
 
 
 // Convert a Python object to a GLubyte.
 static void convert_ubyte(PyObject *itm, void *array, Py_ssize_t i)
 {
-    reinterpret_cast<GLubyte *>(array)[i] = Long_AsUnsignedLong(itm);
+    reinterpret_cast<GLubyte *>(array)[i] = sipLong_AsUnsignedChar(itm);
 }
 
 
 // Convert a Python object to a GLshort.
 static void convert_short(PyObject *itm, void *array, Py_ssize_t i)
 {
-    reinterpret_cast<GLshort *>(array)[i] = SIPLong_AsLong(itm);
+    reinterpret_cast<GLshort *>(array)[i] = sipLong_AsShort(itm);
 }
 
 
 // Convert a Python object to a GLushort.
 static void convert_ushort(PyObject *itm, void *array, Py_ssize_t i)
 {
-    reinterpret_cast<GLushort *>(array)[i] = Long_AsUnsignedLong(itm);
+    reinterpret_cast<GLushort *>(array)[i] = sipLong_AsUnsignedShort(itm);
 }
 
 
 // Convert a Python object to a GLint.
 static void convert_int(PyObject *itm, void *array, Py_ssize_t i)
 {
-    reinterpret_cast<GLint *>(array)[i] = SIPLong_AsLong(itm);
+    reinterpret_cast<GLint *>(array)[i] = sipLong_AsInt(itm);
 }
 
 
 // Convert a Python object to a GLuint.
 static void convert_uint(PyObject *itm, void *array, Py_ssize_t i)
 {
-    reinterpret_cast<GLuint *>(array)[i] = Long_AsUnsignedLong(itm);
+    reinterpret_cast<GLuint *>(array)[i] = sipLong_AsUnsignedInt(itm);
 }
 
 
diff --git a/qpy/QtQml/qpyqml_qjsvalue.cpp b/qpy/QtQml/qpyqml_qjsvalue.cpp
index 4487bd1..04e22c1 100644
--- a/qpy/QtQml/qpyqml_qjsvalue.cpp
+++ b/qpy/QtQml/qpyqml_qjsvalue.cpp
@@ -28,6 +28,8 @@
 // See if a Python object can be converted to a QJSValue.
 int qpyqml_canConvertTo_QJSValue(PyObject *py)
 {
+    // Note that the API doesn't provide the ability to test for a constrained
+    // named enum.
     if (PyObject_TypeCheck(py, sipTypeAsPyTypeObject(sipType_QJSValue_SpecialValue)))
         return 1;
 
@@ -58,7 +60,15 @@ int qpyqml_convertTo_QJSValue(PyObject *py, PyObject *transferObj,
 {
     if (PyObject_TypeCheck(py, sipTypeAsPyTypeObject(sipType_QJSValue_SpecialValue)))
     {
-        *cpp = new QJSValue((QJSValue::SpecialValue)SIPLong_AsLong(py));
+        int v = sipConvertToEnum(py, sipType_QJSValue_SpecialValue);
+
+        if (PyErr_Occurred())
+        {
+            *isErr = 1;
+            return 0;
+        }
+
+        *cpp = new QJSValue(static_cast<QJSValue::SpecialValue>(v));
 
         return sipGetState(transferObj);
     }
diff --git a/qpy/QtQml/qpyqmllistproperty.cpp b/qpy/QtQml/qpyqmllistproperty.cpp
index 8631466..f1f5db6 100644
--- a/qpy/QtQml/qpyqmllistproperty.cpp
+++ b/qpy/QtQml/qpyqmllistproperty.cpp
@@ -309,9 +309,7 @@ static int list_count(QQmlListProperty<QObject> *p)
 
         if (py_res)
         {
-            PyErr_Clear();
-
-            res = SIPLong_AsLong(py_res);
+            res = sipLong_AsInt(py_res);
 
             if (PyErr_Occurred())
             {
diff --git a/qpy/pyrcc/rcc.h b/qpy/pyrcc/rcc.h
index d4200a7..1ed1fa9 100644
--- a/qpy/pyrcc/rcc.h
+++ b/qpy/pyrcc/rcc.h
@@ -86,9 +86,6 @@ public:
     inline void setVerbose(bool b) { mVerbose = b; }
     inline bool verbose() const { return mVerbose; }
 
-    inline void setInitName(const QString &n) { mInitName = n; }
-    inline QString initName() const { return mInitName; }
-
     inline void setCompressLevel(int c) { mCompressLevel = c; }
     inline int compressLevel() const { return mCompressLevel; }
 
@@ -110,7 +107,7 @@ private:
     bool writeInitializer(FILE *out);
 
     QStringList mFileNames;
-    QString mResourceRoot, mInitName;
+    QString mResourceRoot;
     bool mVerbose;
     int mCompressLevel;
     int mCompressThreshold;
diff --git a/sip/QtBluetooth/qpybluetooth_qlist.sip b/sip/QtBluetooth/qpybluetooth_qlist.sip
index fc05e0b..d4d5e3b 100644
--- a/sip/QtBluetooth/qpybluetooth_qlist.sip
+++ b/sip/QtBluetooth/qpybluetooth_qlist.sip
@@ -57,6 +57,7 @@
 
     if (!sipIsErr)
     {
+        PyErr_Clear();
         Py_XDECREF(iter);
 
         return (iter
@@ -168,6 +169,7 @@
 
     if (!sipIsErr)
     {
+        PyErr_Clear();
         Py_XDECREF(iter);
 
         return (iter
diff --git a/sip/QtCore/QtCoremod.sip b/sip/QtCore/QtCoremod.sip
index 2f37811..019e764 100644
--- a/sip/QtCore/QtCoremod.sip
+++ b/sip/QtCore/QtCoremod.sip
@@ -22,7 +22,7 @@
 
 %Module(name=PyQt5.QtCore, call_super_init=True, default_VirtualErrorHandler=PyQt5, keyword_arguments="Optional", use_limited_api=True)
 
-%Timeline {Qt_5_0_0 Qt_5_0_1 Qt_5_0_2 Qt_5_1_0 Qt_5_1_1 Qt_5_2_0 Qt_5_2_1 Qt_5_3_0 Qt_5_3_1 Qt_5_3_2 Qt_5_4_0 Qt_5_4_1 Qt_5_4_2 Qt_5_5_0 Qt_5_5_1 Qt_5_6_0 Qt_5_6_1 Qt_5_6_2 Qt_5_6_3 Qt_5_6_4 Qt_5_6_5 Qt_5_6_6 Qt_5_6_7 Qt_5_6_8 Qt_5_6_9 Qt_5_7_0 Qt_5_7_1 Qt_5_8_0 Qt_5_8_1 Qt_5_9_0 Qt_5_9_1}
+%Timeline {Qt_5_0_0 Qt_5_0_1 Qt_5_0_2 Qt_5_1_0 Qt_5_1_1 Qt_5_2_0 Qt_5_2_1 Qt_5_3_0 Qt_5_3_1 Qt_5_3_2 Qt_5_4_0 Qt_5_4_1 Qt_5_4_2 Qt_5_5_0 Qt_5_5_1 Qt_5_6_0 Qt_5_6_1 Qt_5_6_2 Qt_5_6_3 Qt_5_6_4 Qt_5_6_5 Qt_5_6_6 Qt_5_6_7 Qt_5_6_8 Qt_5_6_9 Qt_5_7_0 Qt_5_7_1 Qt_5_8_0 Qt_5_8_1 Qt_5_9_0 Qt_5_9_1 Qt_5_9_2}
 
 %Platforms {WS_X11 WS_WIN WS_MACX}
 
diff --git a/sip/QtCore/qcryptographichash.sip b/sip/QtCore/qcryptographichash.sip
index 0b89aa5..8be35f4 100644
--- a/sip/QtCore/qcryptographichash.sip
+++ b/sip/QtCore/qcryptographichash.sip
@@ -48,6 +48,18 @@ public:
 %If (Qt_5_1_0 -)
         Sha3_512,
 %End
+%If (Qt_5_9_2 -)
+        Keccak_224,
+%End
+%If (Qt_5_9_2 -)
+        Keccak_256,
+%End
+%If (Qt_5_9_2 -)
+        Keccak_384,
+%End
+%If (Qt_5_9_2 -)
... 1702 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pyqt5.git



More information about the Python-modules-commits mailing list