Added inject codes for methods like QString::toDouble, QByteArray::toFloat, etc.
This commit is contained in:
parent
b8a07a9e0e
commit
5521bb2fd0
4 changed files with 88 additions and 13 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
include(icecc.cmake) # this must be the first line!
|
include(icecc.cmake) # this must be the first line!
|
||||||
|
|
||||||
project(pyside)
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -DNDEBUG -Os -Wl,-O1 -Wl,--hash-style=gnu -Wno-strict-aliasing")
|
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -DNDEBUG -Os -Wl,-O1 -Wl,--hash-style=gnu -Wno-strict-aliasing")
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
project(pyside)
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
|
||||||
DESTINATION ${SITE_PACKAGE}/${BINDING_NAME})
|
DESTINATION ${SITE_PACKAGE}/${BINDING_NAME})
|
||||||
|
|
||||||
|
|
@ -6,7 +7,7 @@ add_custom_command(OUTPUT ${${sources}}
|
||||||
COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
|
COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../global.h
|
${CMAKE_CURRENT_SOURCE_DIR}/../global.h
|
||||||
--include-paths=${QT_INCLUDE_DIR}
|
--include-paths=${QT_INCLUDE_DIR}
|
||||||
--typesystem-paths=${typesystem_SOURCE_DIR}
|
--typesystem-paths=${pyside_SOURCE_DIR}
|
||||||
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
|
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
|
||||||
--license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt
|
--license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${module}.xml
|
${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${module}.xml
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<typesystem package="PySide.QtCore">
|
<typesystem package="PySide.QtCore">
|
||||||
|
<load-typesystem name="typesystem_templates.xml" generate="no"/>
|
||||||
<!--
|
<!--
|
||||||
Stream manipulators does not fits into python language,
|
Stream manipulators does not fits into python language,
|
||||||
so we need to do a lot of inject code to handle them.
|
so we need to do a lot of inject code to handle them.
|
||||||
|
|
@ -907,10 +908,24 @@
|
||||||
<modify-function signature="fromStdString(std::string)" remove="all"/>
|
<modify-function signature="fromStdString(std::string)" remove="all"/>
|
||||||
<modify-function signature="toStdString()const" remove="all"/>
|
<modify-function signature="toStdString()const" remove="all"/>
|
||||||
<modify-function signature="toStdWString()const" remove="all"/>
|
<modify-function signature="toStdWString()const" remove="all"/>
|
||||||
<!-- <modify-function signature="operator+=(char)" remove="all"/> -->
|
<modify-function signature="operator+=(char)" remove="all"/>
|
||||||
<modify-function signature="toUShort(bool*,int)const" remove="all" />
|
<modify-function signature="toUShort(bool*,int)const" remove="all" />
|
||||||
<modify-function signature="toDouble(bool*)const" remove="all" />
|
<modify-function signature="toDouble(bool*)const">
|
||||||
<modify-function signature="toFloat(bool*)const" remove="all" />
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
<modify-function signature="toFloat(bool*)const">
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
<modify-function signature="toInt(bool*,int)const" remove="all" />
|
<modify-function signature="toInt(bool*,int)const" remove="all" />
|
||||||
<modify-function signature="toLong(bool*,int)const" remove="all" />
|
<modify-function signature="toLong(bool*,int)const" remove="all" />
|
||||||
<modify-function signature="toLongLong(bool*,int)const" remove="all" />
|
<modify-function signature="toLongLong(bool*,int)const" remove="all" />
|
||||||
|
|
@ -1215,11 +1230,46 @@
|
||||||
<modify-function signature="QVariant(const QUrl&)" remove="all"/>
|
<modify-function signature="QVariant(const QUrl&)" remove="all"/>
|
||||||
<modify-function signature="QVariant(const QLocale&)" remove="all"/>
|
<modify-function signature="QVariant(const QLocale&)" remove="all"/>
|
||||||
<modify-function signature="QVariant(const QRegExp&)" remove="all"/>
|
<modify-function signature="QVariant(const QRegExp&)" remove="all"/>
|
||||||
<modify-function signature="toDouble(bool*)const" remove="all" />
|
<modify-function signature="toDouble(bool*)const">
|
||||||
<modify-function signature="toInt(bool*)const" remove="all" />
|
<modify-argument index="1">
|
||||||
<modify-function signature="toLongLong(bool*)const" remove="all" />
|
<remove-argument/>
|
||||||
<modify-function signature="toUInt(bool*)const" remove="all" />
|
</modify-argument>
|
||||||
<modify-function signature="toULongLong(bool*)const" remove="all" />
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
<modify-function signature="toInt(bool*)const">
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
<modify-function signature="toLongLong(bool*)const">
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
<modify-function signature="toUInt(bool*)const">
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
<modify-function signature="toULongLong(bool*)const">
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
</value-type>
|
</value-type>
|
||||||
<value-type name="QStringList">
|
<value-type name="QStringList">
|
||||||
<modify-function signature="fromVector(QVector<QString>)" remove="all" />
|
<modify-function signature="fromVector(QVector<QString>)" remove="all" />
|
||||||
|
|
@ -1415,8 +1465,22 @@
|
||||||
<modify-argument index="0" replace-value="this"/>
|
<modify-argument index="0" replace-value="this"/>
|
||||||
<rename to="setFloat"/>
|
<rename to="setFloat"/>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="toDouble(bool*)const" remove="all" />
|
<modify-function signature="toDouble(bool*)const">
|
||||||
<modify-function signature="toFloat(bool*)const" remove="all" />
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
|
<modify-function signature="toFloat(bool*)const">
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="only_bool*_fix"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
<modify-function signature="toInt(bool*,int)const" remove="all" />
|
<modify-function signature="toInt(bool*,int)const" remove="all" />
|
||||||
<modify-function signature="toUShort(bool*,int)const" remove="all" />
|
<modify-function signature="toUShort(bool*,int)const" remove="all" />
|
||||||
<add-function signature="__len__">
|
<add-function signature="__len__">
|
||||||
|
|
|
||||||
12
PySide/typesystem_templates.xml
Normal file
12
PySide/typesystem_templates.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<typesystem>
|
||||||
|
<!-- Templates to fix bool* parameters -->
|
||||||
|
|
||||||
|
<template name="only_bool*_fix">
|
||||||
|
bool ok_;
|
||||||
|
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&ok_);
|
||||||
|
%0 = PyTuple_Pack(2, %CONVERTTOPYTHON[%RETURN_TYPE](retval_), %CONVERTTOPYTHON[%RETURN_TYPE](ok_));
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</typesystem>
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue