Set sip api in __init__.py

This commit is contained in:
Nathan Woodrow 2013-07-17 20:44:21 +10:00
parent 35f9886df5
commit c612ef3fd3
2 changed files with 12 additions and 0 deletions

View File

@ -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")

View File

@ -958,6 +958,8 @@ bool QgsProject::write()
return false;
}
QDomImplementation DomImplementation;
DomImplementation.setInvalidDataPolicy( QDomImplementation::DropInvalidChars );