Skip to content

Commit c612ef3

Browse files
committedJul 17, 2013
Set sip api in __init__.py
1 parent 35f9886 commit c612ef3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
 

‎python/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
# This will get replaced with a git SHA1 when you do a git archive
2424
__revision__ = '$Format:%H$'
2525

26+
import sip
27+
28+
try:
29+
apis = ["QDate", "QDateTime", "QString", "QTextStream", "QTime", "QUrl", "QVariant"]
30+
for api in apis:
31+
sip.setapi(api, 2)
32+
except ValueError:
33+
# API has already been set so we can't set it again.
34+
pass
35+
2636
try:
2737
# Add a __nonzero__ method onto QPyNullVariant so we can check for null values easier.
2838
# >>> value = QPyNullVariant("int")

‎src/core/qgsproject.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,8 @@ bool QgsProject::write()
958958
return false;
959959
}
960960

961+
962+
961963
QDomImplementation DomImplementation;
962964
DomImplementation.setInvalidDataPolicy( QDomImplementation::DropInvalidChars );
963965

0 commit comments

Comments
 (0)
Please sign in to comment.