Compare commits
55 Commits
Author | SHA1 | Date | |
---|---|---|---|
aeee828e3f | |||
bca62e751d | |||
68428bc219 | |||
66ec016fab | |||
441611c62e | |||
426022bd63 | |||
15c15d9274 | |||
0508d7eb0d | |||
4d41f88e5a | |||
3521cf407f | |||
82347897a9 | |||
561f119f6a | |||
a719107bd0 | |||
48f3e5b53c | |||
00e035dc38 | |||
67ee830c7d | |||
|
25b8f81cca | ||
|
e756dbbffd | ||
|
7dfe643382 | ||
|
08ea430bf9 | ||
|
b736bd1807 | ||
|
4502f08c4b | ||
3f79929f94 | |||
463859c7a0 | |||
|
3b4e476f50 | ||
|
83af99f3bd | ||
4e92650402 | |||
|
c405e1fd9d | ||
|
dc97bd878e | ||
|
c27cdd01e3 | ||
fd60ac752f | |||
5f50e99082 | |||
|
6e94d0ad19 | ||
f5435260f5 | |||
65393eec96 | |||
f591293686 | |||
|
8b75df0b21 | ||
|
33ac1c18f8 | ||
|
a802ec096c | ||
|
a6887e9ee7 | ||
fc322ff7e1 | |||
c90cf6775a | |||
|
5853bf16a5 | ||
|
3476e0be1c | ||
|
3fd92d9ba8 | ||
5f6628f6e8 | |||
339777385f | |||
efadeabd79 | |||
e8d46fdfe9 | |||
e72d15977c | |||
|
da2c96706d | ||
|
54805f2d68 | ||
|
392b1a2812 | ||
|
615a219f4b | ||
|
7d85f1dcf5 |
33
.gitignore
vendored
33
.gitignore
vendored
@@ -1,25 +1,8 @@
|
||||
qgis_1.5.0.tar.gz
|
||||
/qgis_1.6.0.tar.gz
|
||||
/qgis-1.7.0.tar.bz2
|
||||
/qgis-1.7.1.tar.bz2
|
||||
/qgis-1.7.2.tar.bz2
|
||||
/qgis-1.7.3.tar.bz2
|
||||
/qgis-1.7.4.tar.bz2
|
||||
/qgis-1.8.0.tar.bz2
|
||||
/qgis-2.0.0.tar.bz2
|
||||
/qgis-2.0.1.tar.bz2
|
||||
/qgis-2.2.0.tar.bz2
|
||||
/qgis-2.4.0.tar.bz2
|
||||
/qgis-2.6.0.tar.bz2
|
||||
/qgis-2.6.1.tar.bz2
|
||||
/qgis-2.8.1.tar.bz2
|
||||
/qgis-2.8.2.tar.bz2
|
||||
/qgis-2.10.0.tar.bz2
|
||||
/qgis-2.10.1.tar.bz2
|
||||
/qgis-2.12.0.tar.bz2
|
||||
/qgis-2.12.1.tar.bz2
|
||||
/qgis-2.12.2.tar.bz2
|
||||
/qgis-2.12.3.tar.bz2
|
||||
/qgis-2.14.0.tar.bz2
|
||||
/qgis-2.14.1.tar.bz2
|
||||
/qgis-2.14.3.tar.bz2
|
||||
/qgis-2.18.0.tar.bz2
|
||||
/qgis-2.18.1.tar.bz2
|
||||
/qgis-2.18.2.tar.bz2
|
||||
/qgis-2.18.3.tar.bz2
|
||||
/qgis-2.18.4.tar.bz2
|
||||
/qgis-2.18.5.tar.bz2
|
||||
/qgis-2.18.6.tar.bz2
|
||||
/qgis-2.18.7.tar.bz2
|
||||
|
@@ -1,13 +0,0 @@
|
||||
diff --git a/src/app/qgswelcomepageitemsmodel.cpp b/src/app/qgswelcomepageitemsmodel.cpp
|
||||
index 4a42a6d..5a4b975 100644
|
||||
--- a/src/app/qgswelcomepageitemsmodel.cpp
|
||||
+++ b/src/app/qgswelcomepageitemsmodel.cpp
|
||||
@@ -114,7 +114,7 @@ QSize QgsWelcomePageItemDelegate::sizeHint( const QStyleOptionViewItem & option,
|
||||
index.data( QgsWelcomePageItemsModel::CrsRole ).toString() ) );
|
||||
doc.setTextWidth( width - ( !icon.isNull() ? icon.width() + 35 : 35 ) );
|
||||
|
||||
- return QSize( width, qMax( doc.size().height() + 10, ( double )icon.height() ) + 20 );
|
||||
+ return QSize( width, qMax( ( double ) doc.size().height() + 10, ( double )icon.height() ) + 20 );
|
||||
}
|
||||
|
||||
QgsWelcomePageItemsModel::QgsWelcomePageItemsModel( QObject* parent )
|
@@ -1,43 +0,0 @@
|
||||
From 30449e577f0cd432bd8c60787743fba54c1e51b9 Mon Sep 17 00:00:00 2001
|
||||
From: Nyall Dawson <nyall.dawson@gmail.com>
|
||||
Date: Thu, 3 Mar 2016 10:34:32 +1100
|
||||
Subject: [PATCH] Fix fetching subset of attributes with mssql (fix #14402),
|
||||
add test
|
||||
|
||||
---
|
||||
src/providers/mssql/qgsmssqlfeatureiterator.cpp | 2 +-
|
||||
tests/src/python/providertestbase.py | 11 +++++++++++
|
||||
2 files changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/providers/mssql/qgsmssqlfeatureiterator.cpp b/src/providers/mssql/qgsmssqlfeatureiterator.cpp
|
||||
index 53214d4..560d344 100644
|
||||
--- a/src/providers/mssql/qgsmssqlfeatureiterator.cpp
|
||||
+++ b/src/providers/mssql/qgsmssqlfeatureiterator.cpp
|
||||
@@ -284,7 +284,7 @@ bool QgsMssqlFeatureIterator::fetchFeature( QgsFeature& feature )
|
||||
for ( int i = 0; i < mAttributesToFetch.count(); i++ )
|
||||
{
|
||||
QVariant v = mQuery->value( i );
|
||||
- const QgsField &fld = mSource->mFields.at( i );
|
||||
+ const QgsField &fld = mSource->mFields.at( mAttributesToFetch.at( i ) );
|
||||
if ( v.type() != fld.type() )
|
||||
v = QgsVectorDataProvider::convertValue( fld.type(), v.toString() );
|
||||
feature.setAttribute( mAttributesToFetch.at( i ), v );
|
||||
diff --git a/tests/src/python/providertestbase.py b/tests/src/python/providertestbase.py
|
||||
index 7b8707e..26e6d86 100644
|
||||
--- a/tests/src/python/providertestbase.py
|
||||
+++ b/tests/src/python/providertestbase.py
|
||||
@@ -384,3 +384,14 @@ def testClosedIterators(self):
|
||||
|
||||
# Test rewinding closed iterator
|
||||
self.assertFalse(f_it.rewind(), 'Rewinding closed iterator successful, should not be allowed')
|
||||
+
|
||||
+ def testGetFeaturesSubsetAttributes(self):
|
||||
+ """ Test that expected results are returned when using subsets of attributes """
|
||||
+
|
||||
+ tests = {'pk': set([1, 2, 3, 4, 5]),
|
||||
+ 'cnt': set([-200, 300, 100, 200, 400]),
|
||||
+ 'name': set(['Pear', 'Orange', 'Apple', 'Honey', NULL]),
|
||||
+ 'name2': set(['NuLl', 'PEaR', 'oranGe', 'Apple', 'Honey'])}
|
||||
+ for field, expected in tests.iteritems():
|
||||
+ result = set([f[field] for f in self.provider.getFeatures(QgsFeatureRequest().setSubsetOfAttributes([field], self.provider.fields()))])
|
||||
+ self.assertEqual(result, expected, 'Expected {}, got {}'.format(expected, result))
|
13
qgis-lib64.patch
Normal file
13
qgis-lib64.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff -up qgis-2.16.2/CMakeLists.txt.lib64 qgis-2.16.2/CMakeLists.txt
|
||||
diff -up qgis-2.16.2/cmake/PyQtMacros.cmake.lib64 qgis-2.16.2/cmake/PyQtMacros.cmake
|
||||
--- qgis-2.16.2/cmake/PyQtMacros.cmake.lib64 2016-08-26 05:58:37.000000000 -0600
|
||||
+++ qgis-2.16.2/cmake/PyQtMacros.cmake 2016-09-21 16:25:55.921411011 -0600
|
||||
@@ -42,7 +42,7 @@ MACRO(PYQT_WRAP_UI outfiles )
|
||||
ELSE(WIN32)
|
||||
# TODO osx
|
||||
SET(PYUIC_WRAPPER "${CMAKE_SOURCE_DIR}/scripts/pyuic-wrapper.sh")
|
||||
- SET(PYUIC_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/lib")
|
||||
+ SET(PYUIC_WRAPPER_PATH "${QGIS_OUTPUT_DIRECTORY}/lib${LIB_SUFFIX}")
|
||||
ENDIF(WIN32)
|
||||
|
||||
FOREACH(it ${ARGN})
|
110
qgis.spec
110
qgis.spec
@@ -4,24 +4,22 @@
|
||||
# https://hub.qgis.org/issues/2854
|
||||
|
||||
# libspatialite is present for PPC and PPC64 in Fedora and EL7, but not in older EL
|
||||
%global configure_with_spatialite -D WITH_QSPATIALITE:BOOL=TRUE -D WITH_INTERNAL_SPATIALITE:BOOL=FALSE
|
||||
%global configure_with_spatialite -D WITH_QSPATIALITE:BOOL=TRUE
|
||||
%if (0%{?rhel} <= 6 && !0%{?fedora})
|
||||
%ifarch ppc ppc64
|
||||
%global configure_with_spatialite -D WITH_QSPATIALITE:BOOL=FALSE -D WITH_INTERNAL_SPATIALITE:BOOL=FALSE
|
||||
%global configure_with_spatialite -D WITH_QSPATIALITE:BOOL=FALSE
|
||||
%endif
|
||||
%endif
|
||||
|
||||
|
||||
# WARNING: Rebuild QGIS whenever a new version of GRASS is shipped! Even though
|
||||
# the soname might stay the same, it won't work anymore.
|
||||
#http://hub.qgis.org/issues/5274
|
||||
%global grass_version 7.0.4
|
||||
%if 0%{?fedora} >= 24
|
||||
%global configure_with_grass7 -D WITH_GRASS7:BOOL=TRUE
|
||||
%endif
|
||||
|
||||
#TODO: Run test suite (see debian/rules)
|
||||
|
||||
Name: qgis
|
||||
Version: 2.14.3
|
||||
Release: 3%{?dist}
|
||||
Version: 2.18.7
|
||||
Release: 1%{?dist}
|
||||
Summary: A user friendly Open Source Geographic Information System
|
||||
Group: Applications/Engineering
|
||||
|
||||
@@ -40,6 +38,16 @@ Source4: %{name}-server-README.fedora
|
||||
# MIME definitions
|
||||
# Based on debian/qgis.xml but excluding already defined or proprietary types
|
||||
Source5: %{name}-mime.xml
|
||||
# Fix builds on 64-bit machines
|
||||
# https://hub.qgis.org/issues/15602
|
||||
# https://github.com/qgis/QGIS/commit/718581ffb12b723f9a3c0ae01b7ec2d8aed9d4bb.patch
|
||||
Patch0: %{name}-lib64.patch
|
||||
|
||||
# Fix some SIP related FTBFS issues
|
||||
# upstream fix: qgsfiledownloader.sip:33:0: src/gui/qgsfiledownloader.h:94:5: error: overriding non-deleted function 'virtual QgsFileDownloader::~QgsFileDownloader()'
|
||||
# workaround (?): RuntimeError: qgis._core cannot import type 'QList<QVariant>' from PyQt4.QtCore
|
||||
# workaround (?): RuntimeError: qgis._core cannot import type 'QList<QPolygonF>' from PyQt4.QtCore
|
||||
Patch1: qgis_sip-ftbfs.patch
|
||||
|
||||
# Some plug-ins need Pyspatialite (bundled)
|
||||
# The license is not totally clear, see:
|
||||
@@ -56,7 +64,7 @@ BuildRequires: fcgi-devel
|
||||
BuildRequires: flex bison
|
||||
BuildRequires: gdal-devel
|
||||
BuildRequires: geos-devel
|
||||
BuildRequires: grass-devel = %{grass_version}
|
||||
BuildRequires: grass-devel
|
||||
BuildRequires: gsl-devel
|
||||
|
||||
%ifarch ppc ppc64
|
||||
@@ -78,7 +86,9 @@ BuildRequires: python2-devel
|
||||
# qca2 is a virtual provides of qca. Put here to make things easier for EPEL!
|
||||
BuildRequires: qca2-devel
|
||||
BuildRequires: qextserialport-devel
|
||||
BuildRequires: qjson-devel
|
||||
BuildRequires: qscintilla-devel
|
||||
BuildRequires: qscintilla-python
|
||||
BuildRequires: qscintilla-python-devel
|
||||
BuildRequires: qt4-devel
|
||||
#BuildRequires: qt-mobility-devel
|
||||
@@ -97,6 +107,8 @@ BuildRequires: sqlite-devel
|
||||
#BuildRequires: xorg-x11-server-Xvfb
|
||||
|
||||
Requires: gpsbabel
|
||||
# As found in BZ#1396818
|
||||
Requires: qca-ossl
|
||||
|
||||
# We don't want to provide private Python extension libs
|
||||
%if (0%{?fedora} || 0%{?rhel} > 6)
|
||||
@@ -134,7 +146,10 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
# The plug-in requires more than just the grass-libs.
|
||||
# This questions the sense of the libs package.
|
||||
Requires: grass
|
||||
# WARNING: Rebuild QGIS whenever a new version of GRASS is shipped! Even though
|
||||
# the soname might stay the same, it won't work anymore.
|
||||
#http://hub.qgis.org/issues/5274
|
||||
Requires: grass%{?_isa} = %{grass_version}
|
||||
|
||||
%description grass
|
||||
GRASS plugin for QGIS required to interface with the GRASS system.
|
||||
@@ -144,7 +159,7 @@ Summary: Python integration and plug-ins for QGIS
|
||||
Group: Applications/Engineering
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: gdal-python
|
||||
Requires: PyQt4
|
||||
Requires: PyQt4-webkit
|
||||
Requires: python-httplib2
|
||||
Requires: python-jinja2
|
||||
Requires: python-matplotlib
|
||||
@@ -177,6 +192,10 @@ Please refer to %{name}-server-README.fedora for details!
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1 -b .lib64
|
||||
%if 0%{?fedora} >= 26
|
||||
%patch1 -p1 -b .sip
|
||||
%endif
|
||||
|
||||
# Remove executable permissions from source code files
|
||||
find . \( -name "*.cpp" -o -name "*.h" \) -type f -perm /111 -execdir chmod -x {} \+
|
||||
@@ -210,11 +229,9 @@ gzip ChangeLog
|
||||
-D QGIS_MANUAL_SUBDIR=/share/man \
|
||||
-D QGIS_CGIBIN_SUBDIR=%{_libexecdir}/%{name} \
|
||||
-D WITH_BINDINGS:BOOL=TRUE \
|
||||
-D MAPSERVER_SKIP_ECW=TRUE \
|
||||
-D WITH_GRASS:BOOL=TRUE \
|
||||
-D WITH_GRASS7:BOOL=TRUE \
|
||||
%{configure_with_grass7} \
|
||||
-D GRASS_PREFIX=%{_libdir}/grass \
|
||||
-D WITH_MAPSERVER:BOOL=TRUE \
|
||||
-D WITH_CUSTOM_WIDGETS:BOOL=TRUE \
|
||||
-D BINDINGS_GLOBAL_INSTALL:BOOL=TRUE \
|
||||
-D ENABLE_TESTS:BOOL=FALSE \
|
||||
@@ -299,10 +316,6 @@ rm -f %{buildroot}%{_libexecdir}/%{name}/admin.sld
|
||||
# Remove install instructions
|
||||
rm -f %{buildroot}%{_datadir}/%{name}/doc/INSTALL
|
||||
|
||||
# Name of locale is wrong
|
||||
#mv %{buildroot}/usr/share/qgis/i18n/qgis_sr_Latn.qm \
|
||||
#%{buildroot}/usr/share/qgis/i18n/qgis_sr@latin.qm
|
||||
|
||||
%find_lang %{name} --with-qt
|
||||
|
||||
|
||||
@@ -346,9 +359,6 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
|
||||
%dir %{_datadir}/%{name}/i18n/
|
||||
%lang(zh-Hans) %{_datadir}/%{name}/i18n/%{name}_zh-Hans.qm
|
||||
%lang(zh-Hant) %{_datadir}/%{name}/i18n/%{name}_zh-Hant.qm
|
||||
%if 0%{?rhel}
|
||||
%lang(sr@latin) %{_datadir}/%{name}/i18n/%{name}_sr@latin.qm
|
||||
%endif
|
||||
%{_libdir}/lib%{name}_app.so.*
|
||||
%{_libdir}/lib%{name}_analysis.so.*
|
||||
%{_libdir}/lib%{name}_core.so.*
|
||||
@@ -408,6 +418,62 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Apr 26 2017 Daniele Viganò <daniele@vigano.me> - 2.18.7-1
|
||||
- New upstream release
|
||||
|
||||
* Sun Apr 09 2017 Daniele Viganò <daniele@vigano.me> - 2.18.6-2
|
||||
- Fix F26 builds
|
||||
|
||||
* Sun Apr 09 2017 Daniele Viganò <daniele@vigano.me> - 2.18.6-1
|
||||
- New upstream release
|
||||
|
||||
* Fri Apr 07 2017 Daniele Viganò <daniele@vigano.me> - 2.18.5-2
|
||||
- Build for F26
|
||||
|
||||
* Mon Mar 27 2017 Daniele Viganò <daniele@vigano.me> - 2.18.5-1
|
||||
- New upstream release
|
||||
|
||||
* Wed Mar 01 2017 Sandro Mani <manisandro@gmail.com> - 2.18.4-2
|
||||
- Add patch to fix FTBFS
|
||||
|
||||
* Wed Mar 01 2017 Daniele Viganò <daniele@vigano.me> - 2.18.4-1
|
||||
- New upstream release
|
||||
|
||||
* Wed Feb 01 2017 Daniele Viganò <daniele@vigano.me> - 2.18.3-1
|
||||
- New upstream release
|
||||
|
||||
* Fri Dec 16 2016 Volker Froehlich <volker27@gmx.at> - 2.18.2-1
|
||||
- New upstream release
|
||||
|
||||
* Sat Nov 26 2016 Volker Froehlich <volker27@gmx.at> - 2.18.1-1
|
||||
- New upstream release
|
||||
|
||||
* Sun Nov 20 2016 Volker Froehlich <volker27@gmx.at> - 2.18.0-2
|
||||
- Add qca-ossl to Requires, as of BZ#1396818
|
||||
|
||||
* Fri Oct 21 2016 Volker Froehlich <volker27@gmx.at> - 2.18.0-1
|
||||
- New upstream release
|
||||
|
||||
* Mon Sep 26 2016 Orion Poplawski <orion@cora.nwra.com> - 2.16.3-1
|
||||
- Update to 2.16.3
|
||||
- Add patch to fix qreal usage on arm
|
||||
|
||||
* Mon Sep 26 2016 Orion Poplawski <orion@cora.nwra.com> - 2.16.2-1
|
||||
- Update to 2.16.2 (bug #1378240)
|
||||
- Add patch to fix build on 64-bit machines
|
||||
- Drop unused cmake options
|
||||
- Move %%grass_version macro to grass-devel, make it an install requirement
|
||||
|
||||
* Mon Sep 26 2016 Dominik Mierzejewski <rpm@greysector.net> - 2.14.3-6
|
||||
- rebuilt for matplotlib-2.0.0
|
||||
|
||||
* Thu Aug 11 2016 Volker Froehlich <volker27@gmx.at> - 2.14.3-5
|
||||
- Replace dependency on PyQt4 with PyQt4-webkit, since webkit
|
||||
is in a sub-package now (BZ #1360485)
|
||||
|
||||
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.14.3-4
|
||||
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
||||
|
||||
* Tue Jun 07 2016 Volker Froehlich <volker27@gmx.at> - 2.14.3-3
|
||||
- Version bump to be newer than F24
|
||||
|
||||
|
186
qgis_sip-ftbfs.patch
Normal file
186
qgis_sip-ftbfs.patch
Normal file
@@ -0,0 +1,186 @@
|
||||
diff --git a/python/core/conversions.sip b/python/core/conversions.sip
|
||||
index f07d3ab1db..948821e91e 100644
|
||||
--- a/python/core/conversions.sip
|
||||
+++ b/python/core/conversions.sip
|
||||
@@ -2041,3 +2041,178 @@ register_from_qvariant_convertor = (void (*)(FromQVariantConvertorFn))sipImportS
|
||||
register_from_qvariant_convertor(null_from_qvariant_convertor);
|
||||
%End
|
||||
%End
|
||||
+
|
||||
+// QList<QVariant> is implemented as a Python list.
|
||||
+%MappedType QList<QVariant> /TypeHintIn="Sequence[QVariant]", TypeHintOut="List[QVariant]", TypeHintValue="[]"/
|
||||
+{
|
||||
+%TypeHeaderCode
|
||||
+#include <qlist.h>
|
||||
+%End
|
||||
+
|
||||
+%ConvertFromTypeCode
|
||||
+ // Create the list.
|
||||
+ PyObject *l;
|
||||
+
|
||||
+ if ((l = PyList_New(sipCpp->size())) == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ // Set the list elements.
|
||||
+ for (int i = 0; i < sipCpp->size(); ++i)
|
||||
+ {
|
||||
+ QVariant *t = new QVariant(sipCpp->at(i));
|
||||
+ PyObject *tobj;
|
||||
+
|
||||
+ if ((tobj = sipConvertFromNewType(t, sipType_QVariant, sipTransferObj)) == NULL)
|
||||
+ {
|
||||
+ Py_DECREF(l);
|
||||
+ delete t;
|
||||
+
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ PyList_SET_ITEM(l, i, tobj);
|
||||
+ }
|
||||
+
|
||||
+ return l;
|
||||
+%End
|
||||
+
|
||||
+%ConvertToTypeCode
|
||||
+ SIP_SSIZE_T len;
|
||||
+
|
||||
+ // Check the type if that is all that is required.
|
||||
+ if (sipIsErr == NULL)
|
||||
+ {
|
||||
+ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ for (SIP_SSIZE_T i = 0; i < len; ++i)
|
||||
+ {
|
||||
+ PyObject *itm = PySequence_ITEM(sipPy, i);
|
||||
+ bool ok = (itm && sipCanConvertToType(itm, sipType_QVariant, SIP_NOT_NONE));
|
||||
+
|
||||
+ Py_XDECREF(itm);
|
||||
+
|
||||
+ if (!ok)
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ QList<QVariant> *ql = new QList<QVariant>;
|
||||
+ len = PySequence_Size(sipPy);
|
||||
+
|
||||
+ for (SIP_SSIZE_T i = 0; i < len; ++i)
|
||||
+ {
|
||||
+ PyObject *itm = PySequence_ITEM(sipPy, i);
|
||||
+ int state;
|
||||
+ QVariant *t = reinterpret_cast<QVariant *>(sipConvertToType(itm, sipType_QVariant, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
|
||||
+
|
||||
+ Py_DECREF(itm);
|
||||
+
|
||||
+ if (*sipIsErr)
|
||||
+ {
|
||||
+ sipReleaseType(t, sipType_QVariant, state);
|
||||
+
|
||||
+ delete ql;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ ql->append(*t);
|
||||
+
|
||||
+ sipReleaseType(t, sipType_QVariant, state);
|
||||
+ }
|
||||
+
|
||||
+ *sipCppPtr = ql;
|
||||
+
|
||||
+ return sipGetState(sipTransferObj);
|
||||
+%End
|
||||
+};
|
||||
+
|
||||
+
|
||||
+// QList<QPolygonF> is implemented as a Python list.
|
||||
+%MappedType QList<QPolygonF> /TypeHintIn="Sequence[QPolygonF]", TypeHintOut="List[QPolygonF]", TypeHintValue="[]"/
|
||||
+{
|
||||
+%TypeHeaderCode
|
||||
+#include <qlist.h>
|
||||
+%End
|
||||
+
|
||||
+%ConvertFromTypeCode
|
||||
+ // Create the list.
|
||||
+ PyObject *l;
|
||||
+
|
||||
+ if ((l = PyList_New(sipCpp->size())) == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
+ // Set the list elements.
|
||||
+ for (int i = 0; i < sipCpp->size(); ++i)
|
||||
+ {
|
||||
+ QPolygonF *t = new QPolygonF(sipCpp->at(i));
|
||||
+ PyObject *tobj;
|
||||
+
|
||||
+ if ((tobj = sipConvertFromNewType(t, sipType_QPolygonF, sipTransferObj)) == NULL)
|
||||
+ {
|
||||
+ Py_DECREF(l);
|
||||
+ delete t;
|
||||
+
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ PyList_SET_ITEM(l, i, tobj);
|
||||
+ }
|
||||
+
|
||||
+ return l;
|
||||
+%End
|
||||
+
|
||||
+%ConvertToTypeCode
|
||||
+ SIP_SSIZE_T len;
|
||||
+
|
||||
+ // Check the type if that is all that is required.
|
||||
+ if (sipIsErr == NULL)
|
||||
+ {
|
||||
+ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ for (SIP_SSIZE_T i = 0; i < len; ++i)
|
||||
+ {
|
||||
+ PyObject *itm = PySequence_ITEM(sipPy, i);
|
||||
+ bool ok = (itm && sipCanConvertToType(itm, sipType_QPolygonF, SIP_NOT_NONE));
|
||||
+
|
||||
+ Py_XDECREF(itm);
|
||||
+
|
||||
+ if (!ok)
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ QList<QPolygonF> *ql = new QList<QPolygonF>;
|
||||
+ len = PySequence_Size(sipPy);
|
||||
+
|
||||
+ for (SIP_SSIZE_T i = 0; i < len; ++i)
|
||||
+ {
|
||||
+ PyObject *itm = PySequence_ITEM(sipPy, i);
|
||||
+ int state;
|
||||
+ QPolygonF *t = reinterpret_cast<QPolygonF *>(sipConvertToType(itm, sipType_QPolygonF, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
|
||||
+
|
||||
+ Py_DECREF(itm);
|
||||
+
|
||||
+ if (*sipIsErr)
|
||||
+ {
|
||||
+ sipReleaseType(t, sipType_QPolygonF, state);
|
||||
+
|
||||
+ delete ql;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ ql->append(*t);
|
||||
+
|
||||
+ sipReleaseType(t, sipType_QPolygonF, state);
|
||||
+ }
|
||||
+
|
||||
+ *sipCppPtr = ql;
|
||||
+
|
||||
+ return sipGetState(sipTransferObj);
|
||||
+%End
|
||||
+};
|
||||
--
|
||||
2.12.0
|
||||
|
Reference in New Issue
Block a user