From c612ef3fd3fb0ff9525029b7ab575b6282f399d2 Mon Sep 17 00:00:00 2001 From: Nathan Woodrow Date: Wed, 17 Jul 2013 20:44:21 +1000 Subject: [PATCH] Set sip api in __init__.py --- python/__init__.py | 10 ++++++++++ src/core/qgsproject.cpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/python/__init__.py b/python/__init__.py index 65347cc215f..496547e567c 100755 --- a/python/__init__.py +++ b/python/__init__.py @@ -23,6 +23,16 @@ __copyright__ = '(C) 2007, Martin Dobias' # This will get replaced with a git SHA1 when you do a git archive __revision__ = '$Format:%H$' +import sip + +try: + apis = ["QDate", "QDateTime", "QString", "QTextStream", "QTime", "QUrl", "QVariant"] + for api in apis: + sip.setapi(api, 2) +except ValueError: + # API has already been set so we can't set it again. + pass + try: # Add a __nonzero__ method onto QPyNullVariant so we can check for null values easier. # >>> value = QPyNullVariant("int") diff --git a/src/core/qgsproject.cpp b/src/core/qgsproject.cpp index 034490f83a8..54bf8fe1d91 100644 --- a/src/core/qgsproject.cpp +++ b/src/core/qgsproject.cpp @@ -958,6 +958,8 @@ bool QgsProject::write() return false; } + + QDomImplementation DomImplementation; DomImplementation.setInvalidDataPolicy( QDomImplementation::DropInvalidChars );