Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
281 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,46 @@ | ||
from PyQt5.QtCore import * | ||
NULL = QVariant() | ||
QPyNullVariant = QVariant() | ||
|
||
from types import MethodType | ||
|
||
|
||
def __nonzero__(self): | ||
if self.isNull(): | ||
return False | ||
else: | ||
return super().__nonzero__() | ||
|
||
|
||
def __repr__(self): | ||
if self.isNull(): | ||
return 'NULL' | ||
else: | ||
return super().__repr__(self) | ||
|
||
|
||
def __eq__(self, other): | ||
if self.isNull(): | ||
return (isinstance(other, QVariant) and other.isNull())or other is None | ||
else: | ||
return super().__eq__(self, other) | ||
|
||
|
||
def __ne__(self, other): | ||
if self.isNull(): | ||
return not (isinstance(other, QVariant) and other.isNull()) and other is not None | ||
else: | ||
return super().__ne__(self, other) | ||
|
||
|
||
def __hash__(self): | ||
if self.isNull(): | ||
return 2178309 | ||
else: | ||
return super.__hash__(self) | ||
|
||
QVariant.__nonzero__ = __nonzero__ | ||
QVariant.__repr__ = __repr__ | ||
QVariant.__eq__ = __eq__ | ||
QVariant.__ne__ = __ne__ | ||
QVariant.__hash__ = __hash__ | ||
|
||
NULL = QVariant(QVariant.Int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
SET (QGIS_SIP_HELPER_SRCS | ||
qgissiphelper.cpp | ||
) | ||
|
||
SET (QGIS_SIP_HELPER_HDRS | ||
qgissiphelper.h | ||
) | ||
|
||
INCLUDE_DIRECTORIES(SYSTEM | ||
${PYTHON_INCLUDE_PATH} | ||
${SIP_INCLUDE_DIR} | ||
${Qt5Core_INCLUDE_DIRS} | ||
${Qt5Xml_INCLUDE_DIRS} | ||
${Qt5Gui_INCLUDE_DIRS} | ||
${Qt5Widgets_INCLUDE_DIRS} | ||
${Qt5PrintSupport_INCLUDE_DIRS} | ||
) | ||
|
||
INCLUDE_DIRECTORIES( | ||
${CMAKE_CURRENT_BINARY_DIR}/../core | ||
../../src/core | ||
../../src/core/auth | ||
../../src/core/pal | ||
../../src/core/composer | ||
../../src/core/diagram | ||
../../src/core/effects | ||
../../src/core/dxf | ||
../../src/core/geometry | ||
../../src/core/gps | ||
../../src/core/layertree | ||
../../src/core/raster | ||
../../src/core/symbology-ng | ||
. | ||
) | ||
|
||
ADD_CUSTOM_TARGET(generate_sip_core_cpp_files DEPENDS ${SIP_CORE_CPP_FILES}) | ||
ADD_LIBRARY(qgis_sip_helpers OBJECT ${QGIS_SIP_HELPER_SRCS} ${QGIS_SIP_HELPER_HDRS}) | ||
ADD_DEPENDENCIES(qgis_sip_helpers generate_sip_core_cpp_files) | ||
SET_TARGET_PROPERTIES(qgis_sip_helpers PROPERTIES POSITION_INDEPENDENT_CODE TRUE) |
Oops, something went wrong.