Skip to content

Commit

Permalink
Set sip api in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Jul 17, 2013
1 parent 35f9886 commit c612ef3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/__init__.py
Expand Up @@ -23,6 +23,16 @@
# 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")
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsproject.cpp
Expand Up @@ -958,6 +958,8 @@ bool QgsProject::write()
return false;
}



QDomImplementation DomImplementation;
DomImplementation.setInvalidDataPolicy( QDomImplementation::DropInvalidChars );

Expand Down

0 comments on commit c612ef3

Please sign in to comment.