##// END OF EJS Templates
jeandet -
r6:70816373a99c default
parent child
Show More
@@ -0,0 +1,175
1 #!/bin/bash
2
3 #
4 # file is included into the qmake systym in the common.prf file
5 #
6
7
8
9
10 #
11 #
12 #
13
14 main() {
15
16
17
18 verbose=0
19 fix_release_lib=1
20 fix_debug_lib=0
21
22 # parsing command line options
23 while getopts ":vh?dra" opt; do
24 case $opt in
25 h)
26 echo "Help for osx-file-dylib -[vh]
27 v : verbose output
28 d : fix debug libs
29 r : fix release libs (default)
30 a : fix all libs
31 " >&2
32 exit
33 ;;
34 v)
35 echo "-v was triggered!" >&2
36 verbose=1 # means it is on
37 ;;
38 d)
39 fix_debug_lib=1 # means it is on
40 ;;
41 r)
42 fix_release_lib=1 # means it is on
43 ;;
44 a)
45 fix_release_lib=1
46 fix_debug_lib=1
47 ;;
48 \?)
49 echo "Invalid option: -$OPTARG" >&2
50 ;;
51 esac
52 done
53
54
55
56 BASEPATH=`pwd`
57
58 if [ $verbose == 1 ] ; then
59 echo "Basepath = " $BASEPATH
60 ls -l *.dylib
61 fi
62
63
64 # first the release files
65 if [ $fix_release_lib == 1 ] ; then
66 fixit libPythonQt.1.0.0.dylib libPythonQt_QtAll.1.0.0.dylib $verbose
67 fi
68
69 # then the debug libs
70 if [ $fix_debug_lib == 1 ] ; then
71 fixit libPythonQt_d.1.0.0.dylib libPythonQt_QtAll_d.1.0.0.dylib $verbose
72 fi
73
74 if [ $verbose ] ; then
75 #tput bold
76 echo $LIBPYTHONQT
77 #tput sgr0
78 otool -L $LIBPYTHONQT
79 #install_name_tool -id $FULLLIBPYTHONQT $FULLLIBPYTHONQT
80 #otool -L $LIBPYTHONQT
81
82 #tput bold
83 echo $LIBPYTHONQTALL
84 #tput sgr0
85 otool -L $LIBPYTHONQTALL
86 #install_name_tool -id $FULLLIBPYTHONQTALL $FULLLIBPYTHONQTALL
87
88 #install_name_tool -change libPythonQt.1.dylib $FULLLIBPYTHONQT $LIBPYTHONQTALL
89
90 #otool -L $LIBPYTHONQTALL
91 fi
92 }
93
94
95
96
97
98
99
100 function fixit {
101 #
102 # fixit(LIBPYTHONQT, LIBPYTHONQTALL, VERBOSE)
103 #
104
105
106 LIBPYTHONQT=$1
107 LIBPYTHONQTALL=$2
108 VERBOSE=$3
109
110 BASEPATH=`pwd`
111 FULLLIBPYTHONQT=$BASEPATH"/"$LIBPYTHONQT
112 FULLLIBPYTHONQTALL=$BASEPATH"/"$LIBPYTHONQTALL
113
114
115 if [ -e $LIBPYTHONQT ]
116 then
117 #tput bold
118 echo "fixing " $LIBPYTHONQT
119 #tput sgr0
120 #otool -L $LIBPYTHONQT
121 install_name_tool -id $FULLLIBPYTHONQT $FULLLIBPYTHONQT
122 #otool -L $LIBPYTHONQT
123 else
124 #tput bold
125 echo "[Warning] " $LIBPYTHONQT " is missing here:" `pwd`
126 #tput sgr0
127 fi
128
129
130 if [ -e $LIBPYTHONQTALL ]
131 then
132 #tput bold
133 echo "fixing " $LIBPYTHONQTALL
134 #tput sgr0
135 #otool -L $LIBPYTHONQTALL
136 install_name_tool -id $FULLLIBPYTHONQTALL $FULLLIBPYTHONQTALL
137
138 echo "libPython:" $LIBPYTHONQT
139 # if debug then
140 if [[ $LIBPYTHONQTALL == *_d.*dylib ]]
141 then
142 LIBPYTHONQT1=libPythonQt_d.1.dylib
143 else
144 LIBPYTHONQT1=libPythonQt.1.dylib
145 fi
146
147 install_name_tool -change $LIBPYTHONQT1 $FULLLIBPYTHONQT $LIBPYTHONQTALL
148
149
150 #otool -L $LIBPYTHONQTALL
151 else
152 #tput bold
153 echo "[Warning] " $LIBPYTHONQTALL " is missing here:" `pwd`
154 #tput sgr0
155 fi
156
157
158
159 }
160
161
162
163 # now we actually call main
164 main $@
165
166
167
168
169
170
171
172
173
174
175
@@ -1,184 +1,186
1 project(PythonQt)
1 project(PythonQt)
2 cmake_minimum_required(VERSION 2.8.10)
2 cmake_minimum_required(VERSION 2.8.10)
3
3
4 IF(POLICY CMP0020)
4 IF(POLICY CMP0020)
5 cmake_policy(SET CMP0020 NEW)
5 cmake_policy(SET CMP0020 NEW)
6 ENDIF()
6 ENDIF()
7
7
8 include(CTestUseLaunchers OPTIONAL)
8 include(CTestUseLaunchers OPTIONAL)
9
9
10 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
10 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
11
11
12 #-----------------------------------------------------------------------------
12 #-----------------------------------------------------------------------------
13 # Version
13 # Version
14 SET(PythonQt_VERSION 2.2.0)
14 SET(PythonQt_VERSION 2.2.0)
15
15
16 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
17 # Debug
17 # Debug
18 option(PythonQt_DEBUG "Enable/Disable PythonQt debug output" OFF)
18 option(PythonQt_DEBUG "Enable/Disable PythonQt debug output" OFF)
19 if(PythonQt_DEBUG)
19 if(PythonQt_DEBUG)
20 add_definitions(-DPYTHONQT_DEBUG)
20 add_definitions(-DPYTHONQT_DEBUG)
21 else()
21 else()
22 remove_definitions(-DPYTHONQT_DEBUG)
22 remove_definitions(-DPYTHONQT_DEBUG)
23 endif()
23 endif()
24
24
25 if(NOT CMAKE_BUILD_TYPE)
25 if(NOT CMAKE_BUILD_TYPE)
26 set(CMAKE_BUILD_TYPE Release)
26 set(CMAKE_BUILD_TYPE Release)
27 endif()
27 endif()
28
28
29 #-----------------------------------------------------------------------------
29 #-----------------------------------------------------------------------------
30 # Qt
30 # Qt
31 option(PythonQt_Qt5 "Use Qt 5.x" OFF)
31 option(PythonQt_Qt5 "Use Qt 5.x" OFF)
32 if(PythonQt_Qt5)
32 if(PythonQt_Qt5)
33 include(PythonQt_Qt_5x)
33 include(PythonQt_Qt_5x)
34 else(PythonQt_Qt5)
34 else(PythonQt_Qt5)
35 include(PythonQt_Qt_4x)
35 include(PythonQt_Qt_4x)
36 endif(PythonQt_Qt5)
36 endif(PythonQt_Qt5)
37
37
38 #-----------------------------------------------------------------------------
38 #-----------------------------------------------------------------------------
39 # The variable "generated_cpp_suffix" allows to conditionnally compile the generated wrappers
39 # The variable "generated_cpp_suffix" allows to conditionnally compile the generated wrappers
40 # associated with the Qt version being used.
40 # associated with the Qt version being used.
41 set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
41 set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
42
42
43 if("${generated_cpp_suffix}" STREQUAL "_48")
43 if("${generated_cpp_suffix}" STREQUAL "_48")
44 set(generated_cpp_suffix "")
44 set(generated_cpp_suffix "")
45 endif()
45 endif()
46 if("${generated_cpp_suffix}" STREQUAL "_46")
46 if("${generated_cpp_suffix}" STREQUAL "_46")
47 set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version
47 set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version
48 endif()
48 endif()
49 if("${generated_cpp_suffix}" STREQUAL "_51")
49
50 # All 5.x use the same for now
51 if("${QT_VERSION_MAJOR}" STREQUAL "5")
50 set(generated_cpp_suffix "_50")
52 set(generated_cpp_suffix "_50")
51 endif()
53 endif()
52
54
53 #-----------------------------------------------------------------------------
55 #-----------------------------------------------------------------------------
54 # Generator
56 # Generator
55 if(PythonQt_Qt5)
57 if(PythonQt_Qt5)
56 add_subdirectory(generator_50 EXCLUDE_FROM_ALL)
58 add_subdirectory(generator_50 EXCLUDE_FROM_ALL)
57 add_custom_target(generator)
59 add_custom_target(generator)
58 add_dependencies(generator pythonqt_generator)
60 add_dependencies(generator pythonqt_generator)
59 endif()
61 endif()
60
62
61 # TODO
63 # TODO
62
64
63 #-----------------------------------------------------------------------------
65 #-----------------------------------------------------------------------------
64 # Build options
66 # Build options
65
67
66 #option(PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF)
68 #option(PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF)
67 #
69 #
68 #set(qtlibs core gui network opengl sql svg uitools webkit xml xmlpatterns)
70 #set(qtlibs core gui network opengl sql svg uitools webkit xml xmlpatterns)
69 #foreach(qtlib ${qtlibs})
71 #foreach(qtlib ${qtlibs})
70 # OPTION(PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
72 # OPTION(PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
71 #endforeach()
73 #endforeach()
72
74
73 # Force option if it applies
75 # Force option if it applies
74 #if(PythonQt_Wrap_QtAll)
76 #if(PythonQt_Wrap_QtAll)
75 # list(REMOVE_ITEM qtlibs xmlpatterns) # xmlpatterns wrapper does *NOT* build at all :(
77 # list(REMOVE_ITEM qtlibs xmlpatterns) # xmlpatterns wrapper does *NOT* build at all :(
76 # foreach(qtlib ${qtlibs})
78 # foreach(qtlib ${qtlibs})
77 # if(NOT ${PythonQt_Wrap_Qt${qtlib}})
79 # if(NOT ${PythonQt_Wrap_Qt${qtlib}})
78 # set(PythonQt_Wrap_Qt${qtlib} ON CACHE BOOL "Make all of Qt${qtlib} available in python" FORCE)
80 # set(PythonQt_Wrap_Qt${qtlib} ON CACHE BOOL "Make all of Qt${qtlib} available in python" FORCE)
79 # message(STATUS "Enabling [PythonQt_Wrap_Qt${qtlib}] because of [PythonQt_Wrap_QtAll] evaluates to True")
81 # message(STATUS "Enabling [PythonQt_Wrap_Qt${qtlib}] because of [PythonQt_Wrap_QtAll] evaluates to True")
80 # endif()
82 # endif()
81 # endforeach()
83 # endforeach()
82 #endif()
84 #endif()
83
85
84 #-----------------------------------------------------------------------------
86 #-----------------------------------------------------------------------------
85 # Add extra sources
87 # Add extra sources
86 #foreach(qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns)
88 #foreach(qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns)
87 #
89 #
88 # if (${PythonQt_Wrap_Qt${qtlib}})
90 # if (${PythonQt_Wrap_Qt${qtlib}})
89 #
91 #
90 # ADD_DEFINITIONS(-DPYTHONQT_WRAP_Qt${qtlib})
92 # ADD_DEFINITIONS(-DPYTHONQT_WRAP_Qt${qtlib})
91 #
93 #
92 # set(file_prefix generated_cpp${generated_cpp_suffix}/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
94 # set(file_prefix generated_cpp${generated_cpp_suffix}/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
93 #
95 #
94 # foreach(index RANGE 0 11)
96 # foreach(index RANGE 0 11)
95 #
97 #
96 # # Source files
98 # # Source files
97 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.cpp)
99 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.cpp)
98 # list(APPEND sources ${file_prefix}${index}.cpp)
100 # list(APPEND sources ${file_prefix}${index}.cpp)
99 # endif()
101 # endif()
100 #
102 #
101 # # Headers that should run through moc
103 # # Headers that should run through moc
102 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.h)
104 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.h)
103 # list(APPEND moc_sources ${file_prefix}${index}.h)
105 # list(APPEND moc_sources ${file_prefix}${index}.h)
104 # endif()
106 # endif()
105 #
107 #
106 # endforeach()
108 # endforeach()
107 #
109 #
108 # list(APPEND sources ${file_prefix}_init.cpp)
110 # list(APPEND sources ${file_prefix}_init.cpp)
109 #
111 #
110 # endif()
112 # endif()
111 #endforeach()
113 #endforeach()
112
114
113 #-----------------------------------------------------------------------------
115 #-----------------------------------------------------------------------------
114 # Find Python
116 # Find Python
115 option(PythonQt_Python3 "Use Python 3.x (3.3+)" OFF)
117 option(PythonQt_Python3 "Use Python 3.x (3.3+)" OFF)
116 option(PythonQt_Python "Use specific Python Version" OFF)
118 option(PythonQt_Python "Use specific Python Version" OFF)
117 if(PythonQt_Python)
119 if(PythonQt_Python)
118 find_package(Python ${PythonQt_Python} REQUIRED EXACT)
120 find_package(Python ${PythonQt_Python} REQUIRED EXACT)
119 elseif(PythonQt_Python3)
121 elseif(PythonQt_Python3)
120 find_package(Python 3.3 REQUIRED)
122 find_package(Python 3.3 REQUIRED)
121 else()
123 else()
122 find_package(Python 2.6 REQUIRED)
124 find_package(Python 2.6 REQUIRED)
123 endif()
125 endif()
124
126
125 if(NOT ${PYTHON_VERSION} VERSION_LESS 3)
127 if(NOT ${PYTHON_VERSION} VERSION_LESS 3)
126 set(PythonQt_Python3 ON)
128 set(PythonQt_Python3 ON)
127 else()
129 else()
128 set(PythonQt_Python3 OFF)
130 set(PythonQt_Python3 OFF)
129 endif()
131 endif()
130
132
131 include_directories(${PYTHON_INCLUDE_DIRS})
133 include_directories(${PYTHON_INCLUDE_DIRS})
132 add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
134 add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
133
135
134 #-----------------------------------------------------------------------------
136 #-----------------------------------------------------------------------------
135 # Library Name
137 # Library Name
136 # The variable PythonQt contains the PythonQt core library name
138 # The variable PythonQt contains the PythonQt core library name
137 # It incorporates library mayor versions
139 # It incorporates library mayor versions
138 set(PythonQt PythonQt)
140 set(PythonQt PythonQt)
139
141
140 if(PythonQt_Qt5)
142 if(PythonQt_Qt5)
141 set(PythonQt ${PythonQt}5)
143 set(PythonQt ${PythonQt}5)
142 endif()
144 endif()
143
145
144 if(PythonQt_Python3)
146 if(PythonQt_Python3)
145 set(PythonQt ${PythonQt}_3)
147 set(PythonQt ${PythonQt}_3)
146 endif()
148 endif()
147
149
148 set(CMAKE_DEBUG_POSTFIX "_d")
150 set(CMAKE_DEBUG_POSTFIX "_d")
149
151
150 message(STATUS "Building ${PythonQt} (Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} + Python ${PYTHON_VERSION} | ${CMAKE_BUILD_TYPE})")
152 message(STATUS "Building ${PythonQt} (Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} + Python ${PYTHON_VERSION} | ${CMAKE_BUILD_TYPE})")
151
153
152 #-----------------------------------------------------------------------------
154 #-----------------------------------------------------------------------------
153 # Core
155 # Core
154 add_subdirectory(src)
156 add_subdirectory(src)
155
157
156 #-----------------------------------------------------------------------------
158 #-----------------------------------------------------------------------------
157 # Tests
159 # Tests
158 add_subdirectory(tests EXCLUDE_FROM_ALL)
160 add_subdirectory(tests EXCLUDE_FROM_ALL)
159 # test alias
161 # test alias
160 add_custom_target(test COMMAND tests/PythonQtTest WORKING_DIRECTORY ${CURRENT_BINARY_DIR})
162 add_custom_target(test COMMAND tests/PythonQtTest WORKING_DIRECTORY ${CURRENT_BINARY_DIR})
161 add_dependencies(test PythonQtTest)
163 add_dependencies(test PythonQtTest)
162
164
163 #-----------------------------------------------------------------------------
165 #-----------------------------------------------------------------------------
164 # Extenseions (QtAll)
166 # Extenseions (QtAll)
165 add_subdirectory(extensions)
167 add_subdirectory(extensions)
166 # QtAll alias
168 # QtAll alias
167 add_custom_target(QtAll)
169 add_custom_target(QtAll)
168 add_dependencies(QtAll ${PythonQt_QtAll})
170 add_dependencies(QtAll ${PythonQt_QtAll})
169
171
170 #-----------------------------------------------------------------------------
172 #-----------------------------------------------------------------------------
171 # Examples
173 # Examples
172 include_directories(src)
174 include_directories(src)
173 include_directories(extensions/PythonQt_QtAll)
175 include_directories(extensions/PythonQt_QtAll)
174 add_subdirectory(examples EXCLUDE_FROM_ALL)
176 add_subdirectory(examples EXCLUDE_FROM_ALL)
175
177
176 #-----------------------------------------------------------------------------
178 #-----------------------------------------------------------------------------
177 # uninstall target
179 # uninstall target
178 configure_file(
180 configure_file(
179 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
181 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
180 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
182 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
181 IMMEDIATE @ONLY)
183 IMMEDIATE @ONLY)
182
184
183 add_custom_target(uninstall
185 add_custom_target(uninstall
184 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
186 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
@@ -1,5 +1,10
1 TEMPLATE = subdirs
1 TEMPLATE = subdirs
2
2
3 CONFIG += ordered
3 CONFIG += ordered
4 #SUBDIRS = src extensions tests examples generator_50
4 SUBDIRS = src extensions tests examples
5 SUBDIRS = src extensions generator_50
5
6 #contains(QT_MAJOR_VERSION, 5) {
7 #SUBDIRS += generator_50
8 #} else {
9 #SUBDIRS += generator
10 #}
@@ -1,189 +1,189
1 # - Find python
1 # - Find python
2 # This module searches for both the python interpreter and the python libraries
2 # This module searches for both the python interpreter and the python libraries
3 # and determines where they are located
3 # and determines where they are located
4 #
4 #
5 #
5 #
6 # PYTHON_FOUND - The requested Python components were found
6 # PYTHON_FOUND - The requested Python components were found
7 # PYTHON_EXECUTABLE - path to the Python interpreter
7 # PYTHON_EXECUTABLE - path to the Python interpreter
8 # PYTHON_INCLUDE_DIRS - path to the Python header files
8 # PYTHON_INCLUDE_DIRS - path to the Python header files
9 # PYTHON_LIBRARIES - the libraries to link against for python
9 # PYTHON_LIBRARIES - the libraries to link against for python
10 # PYTHON_VERSION - the python version
10 # PYTHON_VERSION - the python version
11 #
11 #
12
12
13 #=============================================================================
13 #=============================================================================
14 # Copyright 2010 Branan Purvine-Riley
14 # Copyright 2010 Branan Purvine-Riley
15 # 2013 Orochimarufan
15 # 2013 Orochimarufan
16 #
16 #
17 # Redistribution and use in source and binary forms, with or without
17 # Redistribution and use in source and binary forms, with or without
18 # modification, are permitted provided that the following conditions
18 # modification, are permitted provided that the following conditions
19 # are met:
19 # are met:
20 #
20 #
21 # * Redistributions of source code must retain the above copyright
21 # * Redistributions of source code must retain the above copyright
22 # notice, this list of conditions and the following disclaimer.
22 # notice, this list of conditions and the following disclaimer.
23 #
23 #
24 # * Redistributions in binary form must reproduce the above copyright
24 # * Redistributions in binary form must reproduce the above copyright
25 # notice, this list of conditions and the following disclaimer in the
25 # notice, this list of conditions and the following disclaimer in the
26 # documentation and/or other materials provided with the distribution.
26 # documentation and/or other materials provided with the distribution.
27 #
27 #
28 # * Neither the names of Kitware, Inc., the Insight Software Consortium,
28 # * Neither the names of Kitware, Inc., the Insight Software Consortium,
29 # nor the names of their contributors may be used to endorse or promote
29 # nor the names of their contributors may be used to endorse or promote
30 # products derived from this software without specific prior written
30 # products derived from this software without specific prior written
31 # permission.
31 # permission.
32 #
32 #
33 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
40 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
41 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
43 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 #=============================================================================
44 #=============================================================================
45
45
46 IF("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
46 IF("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
47 SET(PYTHON_3_OK "TRUE")
47 SET(PYTHON_3_OK "TRUE")
48 SET(PYTHON_2_OK "FALSE") # redundant in version selection code, but skips a FOREACH
48 SET(PYTHON_2_OK "FALSE") # redundant in version selection code, but skips a FOREACH
49 ELSE("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
49 ELSE("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
50 SET(PYTHON_2_OK "TRUE")
50 SET(PYTHON_2_OK "TRUE")
51 # don't set PYTHON_3_OK to false here - if the user specified it we want to search for Python 2 & 3
51 # don't set PYTHON_3_OK to false here - if the user specified it we want to search for Python 2 & 3
52 ENDIF("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
52 ENDIF("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
53
53
54 # This is heavily inspired by FindBoost.cmake, with the addition of a second version list to keep
54 # This is heavily inspired by FindBoost.cmake, with the addition of a second version list to keep
55 # python 2 and python 3 separate
55 # python 2 and python 3 separate
56 IF(Python_FIND_VERSION_EXACT)
56 IF(Python_FIND_VERSION_EXACT)
57 SET(_PYTHON_TEST_VERSIONS "${Python_FIND_VERSION_MAJOR}.${Python_FIND_VERSION_MINOR}")
57 SET(_PYTHON_TEST_VERSIONS "${Python_FIND_VERSION_MAJOR}.${Python_FIND_VERSION_MINOR}")
58 ELSE(Python_FIND_VERSION_EXACT)
58 ELSE(Python_FIND_VERSION_EXACT)
59 # Version lists
59 # Version lists
60 SET(_PYTHON_3_KNOWN_VERSIONS ${PYTHON_3_ADDITIONAL_VERSIONS}
60 SET(_PYTHON_3_KNOWN_VERSIONS ${PYTHON_3_ADDITIONAL_VERSIONS}
61 "3.3" "3.2" "3.1" "3.0")
61 "3.4" "3.3" "3.2" "3.1" "3.0")
62 SET(_PYTHON_2_KNOWN_VERSIONS ${PYTHON_2_ADDITIONAL_VERSIONS}
62 SET(_PYTHON_2_KNOWN_VERSIONS ${PYTHON_2_ADDITIONAL_VERSIONS}
63 "2.7" "2.6" "2.5" "2.4" "2.3" "2.2" "2.1" "2.0" "1.6" "1.5")
63 "2.7" "2.6" "2.5" "2.4" "2.3" "2.2" "2.1" "2.0" "1.6" "1.5")
64 SET(_PYTHON_2_TEST_VERSIONS)
64 SET(_PYTHON_2_TEST_VERSIONS)
65 SET(_PYTHON_3_TEST_VERSIONS)
65 SET(_PYTHON_3_TEST_VERSIONS)
66 SET(_PYTHON_TEST_VERSIONS)
66 SET(_PYTHON_TEST_VERSIONS)
67 IF(Python_FIND_VERSION)
67 IF(Python_FIND_VERSION)
68 # python 3 versions
68 # python 3 versions
69 IF(PYTHON_3_OK)
69 IF(PYTHON_3_OK)
70 FOREACH(version ${_PYTHON_3_KNOWN_VERSIONS})
70 FOREACH(version ${_PYTHON_3_KNOWN_VERSIONS})
71 IF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
71 IF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
72 LIST(APPEND _PYTHON_3_TEST_VERSIONS ${version})
72 LIST(APPEND _PYTHON_3_TEST_VERSIONS ${version})
73 ENDIF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
73 ENDIF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
74 ENDFOREACH(version)
74 ENDFOREACH(version)
75 ENDIF(PYTHON_3_OK)
75 ENDIF(PYTHON_3_OK)
76 # python 2 versions
76 # python 2 versions
77 IF(PYTHON_2_OK)
77 IF(PYTHON_2_OK)
78 FOREACH(version ${_PYTHON_2_KNOWN_VERSIONS})
78 FOREACH(version ${_PYTHON_2_KNOWN_VERSIONS})
79 IF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
79 IF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
80 LIST(APPEND _PYTHON_2_TEST_VERSIONS ${version})
80 LIST(APPEND _PYTHON_2_TEST_VERSIONS ${version})
81 ENDIF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
81 ENDIF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
82 ENDFOREACH(version)
82 ENDFOREACH(version)
83 ENDIF(PYTHON_2_OK)
83 ENDIF(PYTHON_2_OK)
84 # all versions
84 # all versions
85 ELSE(Python_FIND_VERSION)
85 ELSE(Python_FIND_VERSION)
86 IF(PYTHON_3_OK)
86 IF(PYTHON_3_OK)
87 LIST(APPEND _PYTHON_3_TEST_VERSIONS ${_PYTHON_3_KNOWN_VERSIONS})
87 LIST(APPEND _PYTHON_3_TEST_VERSIONS ${_PYTHON_3_KNOWN_VERSIONS})
88 ENDIF(PYTHON_3_OK)
88 ENDIF(PYTHON_3_OK)
89 IF(PYTHON_2_OK)
89 IF(PYTHON_2_OK)
90 LIST(APPEND _PYTHON_2_TEST_VERSIONS ${_PYTHON_2_KNOWN_VERSIONS})
90 LIST(APPEND _PYTHON_2_TEST_VERSIONS ${_PYTHON_2_KNOWN_VERSIONS})
91 ENDIF(PYTHON_2_OK)
91 ENDIF(PYTHON_2_OK)
92 ENDIF(Python_FIND_VERSION)
92 ENDIF(Python_FIND_VERSION)
93 # fix python3 version flags
93 # fix python3 version flags
94 IF(PYTHON_3_OK)
94 IF(PYTHON_3_OK)
95 FOREACH(version ${_PYTHON_3_TEST_VERSIONS})
95 FOREACH(version ${_PYTHON_3_TEST_VERSIONS})
96 IF(${version} VERSION_GREATER 3.1)
96 IF(${version} VERSION_GREATER 3.1)
97 LIST(APPEND _PYTHON_TEST_VERSIONS "${version}mu" "${version}m" "${version}u" "${version}")
97 LIST(APPEND _PYTHON_TEST_VERSIONS "${version}mu" "${version}m" "${version}u" "${version}")
98 ELSE(${version} VERSION_GREATER 3.1)
98 ELSE(${version} VERSION_GREATER 3.1)
99 LIST(APPEND _PYTHON_TEST_VERSIONS ${version})
99 LIST(APPEND _PYTHON_TEST_VERSIONS ${version})
100 ENDIF(${version} VERSION_GREATER 3.1)
100 ENDIF(${version} VERSION_GREATER 3.1)
101 ENDFOREACH(version)
101 ENDFOREACH(version)
102 ENDIF(PYTHON_3_OK)
102 ENDIF(PYTHON_3_OK)
103 IF(PYTHON_2_OK)
103 IF(PYTHON_2_OK)
104 LIST(APPEND _PYTHON_TEST_VERSIONS ${_PYTHON_2_TEST_VERSIONS})
104 LIST(APPEND _PYTHON_TEST_VERSIONS ${_PYTHON_2_TEST_VERSIONS})
105 ENDIF(PYTHON_2_OK)
105 ENDIF(PYTHON_2_OK)
106 ENDIF(Python_FIND_VERSION_EXACT)
106 ENDIF(Python_FIND_VERSION_EXACT)
107
107
108 SET(_PYTHON_EXE_VERSIONS)
108 SET(_PYTHON_EXE_VERSIONS)
109 FOREACH(version ${_PYTHON_TEST_VERSIONS})
109 FOREACH(version ${_PYTHON_TEST_VERSIONS})
110 LIST(APPEND _PYTHON_EXE_VERSIONS python${version})
110 LIST(APPEND _PYTHON_EXE_VERSIONS python${version})
111 ENDFOREACH(version ${_PYTHON_TEST_VERSIONS})
111 ENDFOREACH(version ${_PYTHON_TEST_VERSIONS})
112
112
113 IF(WIN32)
113 IF(WIN32)
114 SET(_PYTHON_REGISTRY_KEYS)
114 SET(_PYTHON_REGISTRY_KEYS)
115 FOREACH(version ${_PYTHON_TEST_VERSIONS})
115 FOREACH(version ${_PYTHON_TEST_VERSIONS})
116 LIST(APPEND _PYTHON_REGISTRY_KEYS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${version}\\InstallPath])
116 LIST(APPEND _PYTHON_REGISTRY_KEYS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${version}\\InstallPath])
117 ENDFOREACH(version ${_PYTHON_TEST_VERSIONS})
117 ENDFOREACH(version ${_PYTHON_TEST_VERSIONS})
118 # this will find any standard windows Python install before it finds anything from Cygwin
118 # this will find any standard windows Python install before it finds anything from Cygwin
119 FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python ${_PYTHON_EXE_VERSIONS} PATHS ${_PYTHON_REGISTRY_KEYS})
119 FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python ${_PYTHON_EXE_VERSIONS} PATHS ${_PYTHON_REGISTRY_KEYS})
120 ELSE(WIN32)
120 ELSE(WIN32)
121 FIND_PROGRAM(PYTHON_EXECUTABLE NAMES ${_PYTHON_EXE_VERSIONS} PATHS)
121 FIND_PROGRAM(PYTHON_EXECUTABLE NAMES ${_PYTHON_EXE_VERSIONS} PATHS)
122 ENDIF(WIN32)
122 ENDIF(WIN32)
123
123
124 EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}" "-c" "from sys import *; stdout.write('%i.%i.%i' % version_info[:3])" OUTPUT_VARIABLE PYTHON_VERSION)
124 EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}" "-c" "from sys import *; stdout.write('%i.%i.%i' % version_info[:3])" OUTPUT_VARIABLE PYTHON_VERSION)
125
125
126 # Get our library path and include directory from python
126 # Get our library path and include directory from python
127 IF(${PYTHON_VERSION} VERSION_GREATER 3.1)
127 IF(${PYTHON_VERSION} VERSION_GREATER 3.1)
128 SET(_PYTHON_SYSCONFIG "sysconfig")
128 SET(_PYTHON_SYSCONFIG "sysconfig")
129 SET(_PYTHON_SC_INCLUDE "sysconfig.get_path('include')")
129 SET(_PYTHON_SC_INCLUDE "sysconfig.get_path('include')")
130 ELSE()
130 ELSE()
131 SET(_PYTHON_SYSCONFIG "distutils.sysconfig")
131 SET(_PYTHON_SYSCONFIG "distutils.sysconfig")
132 SET(_PYTHON_SC_INCLUDE "distutils.sysconfig.get_python_inc()")
132 SET(_PYTHON_SC_INCLUDE "distutils.sysconfig.get_python_inc()")
133 ENDIF()
133 ENDIF()
134
134
135 IF(WIN32)
135 IF(WIN32)
136 EXECUTE_PROCESS(
136 EXECUTE_PROCESS(
137 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('prefix'))"
137 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('prefix'))"
138 OUTPUT_VARIABLE _PYTHON_PREFIX
138 OUTPUT_VARIABLE _PYTHON_PREFIX
139 )
139 )
140 EXECUTE_PROCESS(
140 EXECUTE_PROCESS(
141 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('py_version_nodot'))"
141 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('py_version_nodot'))"
142 OUTPUT_VARIABLE _PYTHON_VERSION_MAJOR
142 OUTPUT_VARIABLE _PYTHON_VERSION_MAJOR
143 )
143 )
144 SET(_PYTHON_LIBRARY_PATH ${_PYTHON_PREFIX}/libs)
144 SET(_PYTHON_LIBRARY_PATH ${_PYTHON_PREFIX}/libs)
145 SET(_PYTHON_LIBRARY_NAME libpython${_PYTHON_VERSION_MAJOR}.a)
145 SET(_PYTHON_LIBRARY_NAME libpython${_PYTHON_VERSION_MAJOR}.a)
146 ELSE(WIN32)
146 ELSE(WIN32)
147 EXECUTE_PROCESS(
147 EXECUTE_PROCESS(
148 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LIBDIR'))"
148 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LIBDIR'))"
149 OUTPUT_VARIABLE _PYTHON_LIBRARY_PATH
149 OUTPUT_VARIABLE _PYTHON_LIBRARY_PATH
150 )
150 )
151 EXECUTE_PROCESS(
151 EXECUTE_PROCESS(
152 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LDLIBRARY'))"
152 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LDLIBRARY'))"
153 OUTPUT_VARIABLE _PYTHON_LIBRARY_NAME
153 OUTPUT_VARIABLE _PYTHON_LIBRARY_NAME
154 )
154 )
155 # Multiarch
155 # Multiarch
156 EXECUTE_PROCESS(
156 EXECUTE_PROCESS(
157 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_vars().get('MULTIARCH', 'PYTHON_LIBRARY_MULTIARCH-NOTFOUND'))"
157 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_vars().get('MULTIARCH', 'PYTHON_LIBRARY_MULTIARCH-NOTFOUND'))"
158 OUTPUT_VARIABLE _PYTHON_LIBRARY_MULTIARCH
158 OUTPUT_VARIABLE _PYTHON_LIBRARY_MULTIARCH
159 )
159 )
160 IF(NOT "${_PYTHON_LIBRARY_MULTIARCH}" STREQUAL "PYTHON_LIBRARY_MULTIARCH-NOTFOUND")
160 IF(NOT "${_PYTHON_LIBRARY_MULTIARCH}" STREQUAL "PYTHON_LIBRARY_MULTIARCH-NOTFOUND")
161 SET(_PYTHON_LIBRARY_PATH_X ${_PYTHON_LIBRARY_PATH})
161 SET(_PYTHON_LIBRARY_PATH_X ${_PYTHON_LIBRARY_PATH})
162 SET(_PYTHON_LIBRARY_PATH)
162 SET(_PYTHON_LIBRARY_PATH)
163 FOREACH(path ${_PYTHON_LIBRARY_PATH_X})
163 FOREACH(path ${_PYTHON_LIBRARY_PATH_X})
164 LIST(APPEND _PYTHON_LIBRARY_PATH "${path}/${_PYTHON_LIBRARY_MULTIARCH}" "${path}")
164 LIST(APPEND _PYTHON_LIBRARY_PATH "${path}/${_PYTHON_LIBRARY_MULTIARCH}" "${path}")
165 ENDFOREACH(path)
165 ENDFOREACH(path)
166 ENDIF(NOT "${_PYTHON_LIBRARY_MULTIARCH}" STREQUAL "PYTHON_LIBRARY_MULTIARCH-NOTFOUND")
166 ENDIF(NOT "${_PYTHON_LIBRARY_MULTIARCH}" STREQUAL "PYTHON_LIBRARY_MULTIARCH-NOTFOUND")
167 ENDIF(WIN32)
167 ENDIF(WIN32)
168 EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}"
168 EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}"
169 "-c" "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SC_INCLUDE})"
169 "-c" "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SC_INCLUDE})"
170 OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
170 OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
171 )
171 )
172
172
173 FIND_FILE(PYTHON_LIBRARY ${_PYTHON_LIBRARY_NAME} PATHS ${_PYTHON_LIBRARY_PATH} NO_DEFAULT_PATH)
173 FIND_FILE(PYTHON_LIBRARY ${_PYTHON_LIBRARY_NAME} PATHS ${_PYTHON_LIBRARY_PATH} NO_DEFAULT_PATH)
174 FIND_FILE(PYTHON_HEADER "Python.h" PATHS ${PYTHON_INCLUDE_DIR} NO_DEFAULT_PATH)
174 FIND_FILE(PYTHON_HEADER "Python.h" PATHS ${PYTHON_INCLUDE_DIR} NO_DEFAULT_PATH)
175
175
176 set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
176 set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
177 set(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
177 set(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
178
178
179 INCLUDE(FindPackageHandleStandardArgs)
179 INCLUDE(FindPackageHandleStandardArgs)
180 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python
180 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python
181 REQUIRED_VARS PYTHON_EXECUTABLE PYTHON_HEADER PYTHON_LIBRARY
181 REQUIRED_VARS PYTHON_EXECUTABLE PYTHON_HEADER PYTHON_LIBRARY
182 VERSION_VAR PYTHON_VERSION
182 VERSION_VAR PYTHON_VERSION
183 )
183 )
184
184
185 MARK_AS_ADVANCED(PYTHON_EXECUTABLE)
185 MARK_AS_ADVANCED(PYTHON_EXECUTABLE)
186 MARK_AS_ADVANCED(PYTHON_INCLUDE_DIRS)
186 MARK_AS_ADVANCED(PYTHON_INCLUDE_DIRS)
187 MARK_AS_ADVANCED(PYTHON_LIBRARIES)
187 MARK_AS_ADVANCED(PYTHON_LIBRARIES)
188 MARK_AS_ADVANCED(PYTHON_VERSION)
188 MARK_AS_ADVANCED(PYTHON_VERSION)
189
189
@@ -1,45 +1,46
1 #include <PythonQt.h>
1 #include <PythonQt.h>
2 #include <QtGui>
2 #include <QtGui>
3 #include <QApplication>
3
4
4 int main (int argc, char* argv[]) {
5 int main (int argc, char* argv[]) {
5 QApplication app(argc, argv);
6 QApplication app(argc, argv);
6 PythonQt::init();
7 PythonQt::init();
7 PythonQtObjectPtr mainModule = PythonQt::self()->getMainModule();
8 PythonQtObjectPtr mainModule = PythonQt::self()->getMainModule();
8 mainModule.evalScript(QString("import sys\n"));
9 mainModule.evalScript(QString("import sys\n"));
9 Q_ASSERT(!mainModule.isNull());
10 Q_ASSERT(!mainModule.isNull());
10 {
11 {
11 // evaluate a python file embedded in executable as resource:
12 // evaluate a python file embedded in executable as resource:
12 mainModule.evalFile(":eyed3tagger.py");
13 mainModule.evalFile(":eyed3tagger.py");
13 // create an object, hold onto its reference
14 // create an object, hold onto its reference
14 PythonQtObjectPtr tag = mainModule.evalScript("EyeD3Tagger()\n", Py_eval_input);
15 PythonQtObjectPtr tag = mainModule.evalScript("EyeD3Tagger()\n", Py_eval_input);
15 Q_ASSERT(!tag.isNull());
16 Q_ASSERT(!tag.isNull());
16 tag.call("setFileName", QVariantList() << "t.mp3");
17 tag.call("setFileName", QVariantList() << "t.mp3");
17 QVariant fn = tag.call("fileName", QVariantList());
18 QVariant fn = tag.call("fileName", QVariantList());
18 Q_ASSERT(fn.toString() == QString("t.mp3"));
19 Q_ASSERT(fn.toString() == QString("t.mp3"));
19 // tag goes out of scope, reference count decremented.
20 // tag goes out of scope, reference count decremented.
20 }
21 }
21 {
22 {
22 // Allow the python system path to recognize QFile paths in the sys.path
23 // Allow the python system path to recognize QFile paths in the sys.path
23 PythonQt::self()->setImporter(NULL);
24 PythonQt::self()->setImporter(NULL);
24 // append the Qt resource root directory to the sys.path
25 // append the Qt resource root directory to the sys.path
25 mainModule.evalScript("sys.path.append(':')\n");
26 mainModule.evalScript("sys.path.append(':')\n");
26 mainModule.evalScript("import eyed3tagger\n");
27 mainModule.evalScript("import eyed3tagger\n");
27 PythonQtObjectPtr tag = mainModule.evalScript("eyed3tagger.EyeD3Tagger()\n", Py_eval_input);
28 PythonQtObjectPtr tag = mainModule.evalScript("eyed3tagger.EyeD3Tagger()\n", Py_eval_input);
28 Q_ASSERT(!tag.isNull());
29 Q_ASSERT(!tag.isNull());
29 tag.call("setFileName", QVariantList() << "t.mp3");
30 tag.call("setFileName", QVariantList() << "t.mp3");
30 QVariant fn = tag.call("fileName", QVariantList());
31 QVariant fn = tag.call("fileName", QVariantList());
31 Q_ASSERT(fn.toString() == QString("t.mp3"));
32 Q_ASSERT(fn.toString() == QString("t.mp3"));
32 }
33 }
33 { // alternative using import and loading it as a real module from sys.path
34 { // alternative using import and loading it as a real module from sys.path
34 // import sys first
35 // import sys first
35 mainModule.evalScript(QString("sys.path.append('%1')\n").arg(QDir::currentPath()));
36 mainModule.evalScript(QString("sys.path.append('%1')\n").arg(QDir::currentPath()));
36 mainModule.evalScript("import eyed3tagger\n");
37 mainModule.evalScript("import eyed3tagger\n");
37 PythonQtObjectPtr tag = mainModule.evalScript("eyed3tagger.EyeD3Tagger()\n", Py_eval_input);
38 PythonQtObjectPtr tag = mainModule.evalScript("eyed3tagger.EyeD3Tagger()\n", Py_eval_input);
38 Q_ASSERT(!tag.isNull());
39 Q_ASSERT(!tag.isNull());
39 tag.call("setFileName", QVariantList() << "t.mp3");
40 tag.call("setFileName", QVariantList() << "t.mp3");
40 QVariant fn = tag.call("fileName", QVariantList());
41 QVariant fn = tag.call("fileName", QVariantList());
41 Q_ASSERT(fn.toString() == QString("t.mp3"));
42 Q_ASSERT(fn.toString() == QString("t.mp3"));
42 }
43 }
43 qDebug() << "finished";
44 qDebug() << "finished";
44 return 0;
45 return 0;
45 }
46 }
@@ -1,15 +1,21
1
1
2 TARGET = CPPPyWrapperExample
2 TARGET = CPPPyWrapperExample
3 TEMPLATE = app
3 TEMPLATE = app
4
4
5 mac:CONFIG -= app_bundle
5 mac:CONFIG -= app_bundle
6
6
7 DESTDIR = ../../lib
7 DESTDIR = ../../lib
8
8
9 contains(QT_MAJOR_VERSION, 5) {
10 QT += widgets
11 }
12
13
9 include ( ../../build/common.prf )
14 include ( ../../build/common.prf )
10 include ( ../../build/PythonQt.prf )
15 CONFIG+=BUILDING_QTALL
16 include ( ../../build/pythonqt.prf )
11
17
12 SOURCES += \
18 SOURCES += \
13 CPPPyWrapperExample.cpp
19 CPPPyWrapperExample.cpp
14
20
15 RESOURCES += CPPPyWrapperExample.qrc
21 RESOURCES += CPPPyWrapperExample.qrc
@@ -1,35 +1,36
1 TARGET = NicePyConsole
1 TARGET = NicePyConsole
2 TEMPLATE = app
2 TEMPLATE = app
3
3
4 DESTDIR = ../../lib
4 DESTDIR = ../../lib
5
5
6 contains(QT_MAJOR_VERSION, 5) {
6 contains(QT_MAJOR_VERSION, 5) {
7 QT += widgets
7 QT += widgets
8 }
8 }
9
9
10 mac:CONFIG-= app_bundle
10 mac:CONFIG-= app_bundle
11
11
12 include ( ../../build/common.prf )
12 include ( ../../build/common.prf )
13 include ( ../../build/PythonQt.prf )
13 CONFIG+=BUILDING_QTALL
14 include ( ../../build/pythonqt.prf )
14 include ( ../../build/PythonQt_QtAll.prf )
15 include ( ../../build/PythonQt_QtAll.prf )
15
16
16
17
17 HEADERS += \
18 HEADERS += \
18 SimpleConsole.h \
19 SimpleConsole.h \
19 NicePyConsole.h \
20 NicePyConsole.h \
20 PygmentsHighlighter.h \
21 PygmentsHighlighter.h \
21 PythonCompleter.h \
22 PythonCompleter.h \
22 PythonCompleterPopup.h
23 PythonCompleterPopup.h
23
24
24 SOURCES += \
25 SOURCES += \
25 SimpleConsole.cpp \
26 SimpleConsole.cpp \
26 NicePyConsole.cpp \
27 NicePyConsole.cpp \
27 main.cpp \
28 main.cpp \
28 PygmentsHighlighter.cpp \
29 PygmentsHighlighter.cpp \
29 PythonCompleter.cpp \
30 PythonCompleter.cpp \
30 PythonCompleterPopup.cpp
31 PythonCompleterPopup.cpp
31
32
32 OTHER_FILES += \
33 OTHER_FILES += \
33 PygmentsHighlighter.py \
34 PygmentsHighlighter.py \
34 PythonCompleter.py \
35 PythonCompleter.py \
35 module_completion.py
36 module_completion.py
@@ -1,22 +1,27
1 # --------- PyCPPWrapperExample profile -------------------
1 # --------- PyCPPWrapperExample profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6
6
7 TARGET = PyCPPWrapperExample
7 TARGET = PyCPPWrapperExample
8 TEMPLATE = app
8 TEMPLATE = app
9
9
10 DESTDIR = ../../lib
10 DESTDIR = ../../lib
11
11
12 contains(QT_MAJOR_VERSION, 5) {
13 QT += widgets
14 }
15
12 include ( ../../build/common.prf )
16 include ( ../../build/common.prf )
13 include ( ../../build/PythonQt.prf )
17 CONFIG+=BUILDING_QTALL
18 include ( ../../build/pythonqt.prf )
14
19
15 HEADERS += \
20 HEADERS += \
16 CustomObjects.h
21 CustomObjects.h
17
22
18 SOURCES += \
23 SOURCES += \
19 main.cpp \
24 main.cpp \
20 CustomObjects.cpp
25 CustomObjects.cpp
21
26
22 RESOURCES += PyCPPWrapperExample.qrc
27 RESOURCES += PyCPPWrapperExample.qrc
@@ -1,23 +1,27
1 # --------- PyCustomMetaTypeExample profile -------------------
1 # --------- PyCustomMetaTypeExample profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6
6
7 TARGET = PyCustomMetaTypeExample
7 TARGET = PyCustomMetaTypeExample
8 TEMPLATE = app
8 TEMPLATE = app
9
9
10 DESTDIR = ../../lib
10 DESTDIR = ../../lib
11
11
12 contains(QT_MAJOR_VERSION, 5) {
13 QT += widgets
14 }
15
12 include ( ../../build/common.prf )
16 include ( ../../build/common.prf )
13 include ( ../../build/PythonQt.prf )
17 include ( ../../build/PythonQt.prf )
14
18
15
19
16 HEADERS += \
20 HEADERS += \
17 CustomObject.h
21 CustomObject.h
18
22
19 SOURCES += \
23 SOURCES += \
20 main.cpp \
24 main.cpp \
21 CustomObject.cpp
25 CustomObject.cpp
22
26
23 RESOURCES += PyCustomMetaTypeExample.qrc
27 RESOURCES += PyCustomMetaTypeExample.qrc
@@ -1,23 +1,27
1 # --------- PyGuiExample profile -------------------
1 # --------- PyGuiExample profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6
6
7 TARGET = PyDecoratorsExample
7 TARGET = PyDecoratorsExample
8 TEMPLATE = app
8 TEMPLATE = app
9
9
10 DESTDIR = ../../lib
10 DESTDIR = ../../lib
11
11
12 include ( ../../build/common.prf )
12 include ( ../../build/common.prf )
13 include ( ../../build/PythonQt.prf )
13 CONFIG+=BUILDING_QTALL
14 include ( ../../build/pythonqt.prf )
14
15
16 contains(QT_MAJOR_VERSION, 5) {
17 QT += widgets
18 }
15
19
16 HEADERS += \
20 HEADERS += \
17 PyExampleDecorators.h
21 PyExampleDecorators.h
18
22
19 SOURCES += \
23 SOURCES += \
20 main.cpp \
24 main.cpp \
21 PyExampleDecorators.cpp
25 PyExampleDecorators.cpp
22
26
23 RESOURCES += PyDecoratorsExample.qrc
27 RESOURCES += PyDecoratorsExample.qrc
@@ -1,95 +1,102
1 #ifndef _PYEXAMPLEDECORATORS_H
1 #ifndef _PYEXAMPLEDECORATORS_H
2 #define _PYEXAMPLEDECORATORS_H
2 #define _PYEXAMPLEDECORATORS_H
3
3
4 /*
4 /*
5 *
5 *
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 *
7 *
8 * This library is free software; you can redistribute it and/or
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
11 * version 2.1 of the License, or (at your option) any later version.
12 *
12 *
13 * This library is distributed in the hope that it will be useful,
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
16 * Lesser General Public License for more details.
17 *
17 *
18 * Further, this software is distributed without any warranty that it is
18 * Further, this software is distributed without any warranty that it is
19 * free of the rightful claim of any third person regarding infringement
19 * free of the rightful claim of any third person regarding infringement
20 * or the like. Any license provided herein, whether implied or
20 * or the like. Any license provided herein, whether implied or
21 * otherwise, applies only to this software file. Patent licenses, if
21 * otherwise, applies only to this software file. Patent licenses, if
22 * any, provided herein do not apply to combinations of this program with
22 * any, provided herein do not apply to combinations of this program with
23 * other software, or any other product whatsoever.
23 * other software, or any other product whatsoever.
24 *
24 *
25 * You should have received a copy of the GNU Lesser General Public
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 *
28 *
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 * 28359 Bremen, Germany or:
30 * 28359 Bremen, Germany or:
31 *
31 *
32 * http://www.mevis.de
32 * http://www.mevis.de
33 *
33 *
34 */
34 */
35
35
36 //----------------------------------------------------------------------------------
36 //----------------------------------------------------------------------------------
37 /*!
37 /*!
38 // \file PyExampleDecorators.h
38 // \file PyExampleDecorators.h
39 // \author Florian Link
39 // \author Florian Link
40 // \author Last changed by $Author: florian $
40 // \author Last changed by $Author: florian $
41 // \date 2007-4
41 // \date 2007-4
42 */
42 */
43 //----------------------------------------------------------------------------------
43 //----------------------------------------------------------------------------------
44
44
45 #include "PythonQt.h"
45 #include "PythonQt.h"
46 #include <QDebug>
46 #include <QDebug>
47 #include <QObject>
47 #include <QObject>
48 #include <QPushButton>
48 #include <QPushButton>
49
49
50 // an example CPP object
50 // an example CPP object
51 class YourCPPObject {
51 class YourCPPObject {
52 public:
52 public:
53 YourCPPObject(int arg1, float arg2) { a = arg1; b = arg2; }
53 YourCPPObject(int arg1, float arg2) { a = arg1; b = arg2; }
54
54
55 float doSomething(int arg1) { return arg1*a*b; };
55 float doSomething(int arg1) { return arg1*a*b; };
56
56
57 private:
57 private:
58
58
59 int a;
59 int a;
60 float b;
60 float b;
61 };
61 };
62
62
63 // an example decorator
63 // an example decorator
64 class PyExampleDecorators : public QObject
64 class PyExampleDecorators : public QObject
65 {
65 {
66 Q_OBJECT
66 Q_OBJECT
67
67
68 public slots:
68 public slots:
69 // add a constructor to QSize variant that takes a QPoint
69 // add a constructor to QSize variant that takes a QPoint
70 QSize* new_QSize(const QPoint& p) { return new QSize(p.x(), p.y()); }
70 QSize* new_QSize(const QPoint& p) { return new QSize(p.x(), p.y()); }
71
71
72 // add a constructor for QPushButton that takes a text and a parent widget
72 // add a constructor for QPushButton that takes a text and a parent widget
73 QPushButton* new_QPushButton(const QString& text, QWidget* parent=NULL) { return new QPushButton(text, parent); }
73 QPushButton* new_QPushButton(const QString& text, QWidget* parent=NULL) { return new QPushButton(text, parent); }
74
74
75 // add a constructor for a CPP object
75 // add a constructor for a CPP object
76 YourCPPObject* new_YourCPPObject(int arg1, float arg2) { return new YourCPPObject(arg1, arg2); }
76 YourCPPObject* new_YourCPPObject(int arg1, float arg2) { return new YourCPPObject(arg1, arg2); }
77
77
78 // add a destructor for a CPP object
78 // add a destructor for a CPP object
79 void delete_YourCPPObject(YourCPPObject* obj) { delete obj; }
79 void delete_YourCPPObject(YourCPPObject* obj) { delete obj; }
80
80
81 // add a static method to QWidget
81 // add a static method to QWidget
82 QWidget* static_QWidget_mouseGrabber() { return QWidget::mouseGrabber(); }
82 QWidget* static_QWidget_mouseGrabber() { return QWidget::mouseGrabber(); }
83
83
84 // add an additional slot to QWidget (make move() callable, which is not declared as a slot in QWidget)
84 // add an additional slot to QWidget (make move() callable, which is not declared as a slot in QWidget)
85 void move(QWidget* w, const QPoint& p) { w->move(p); }
85 void move(QWidget* w, const QPoint& p) { w->move(p); }
86
86
87 // add an additional slot to QWidget, overloading the above move method
87 // add an additional slot to QWidget, overloading the above move method
88 void move(QWidget* w, int x, int y) { w->move(x,y); }
88 void move(QWidget* w, int x, int y) { w->move(x,y); }
89
89
90 // add a method to your own CPP object
90 // add a method to your own CPP object
91 int doSomething(YourCPPObject* obj, int arg1) { return obj->doSomething(arg1); }
91 int doSomething(YourCPPObject* obj, int arg1) { return obj->doSomething(arg1); }
92
93 // add a docstring to your own CPP object
94 QString doc_YourCPPObject() {return "A C++ Class object";}
95
96 // add a docstrint to YourCPPObject::doSomething
97 QString doc_YourCPPObject_doSomething() {return "this function does something";}
98
92 };
99 };
93
100
94
101
95 #endif
102 #endif
@@ -1,28 +1,34
1 from PythonQt import QtCore, QtGui, example
1 from PythonQt import QtCore, QtGui, example
2
2
3 # call our new constructor of QSize
3 # call our new constructor of QSize
4 size = QtCore.QSize(QtCore.QPoint(1,2));
4 size = QtCore.QSize(QtCore.QPoint(1,2));
5
5
6 # call our new QPushButton constructor
6 # call our new QPushButton constructor
7 button = QtGui.QPushButton("sometext");
7 button = QtGui.QPushButton("sometext");
8
8
9 # call the move slot (overload1)
9 # call the move slot (overload1)
10 button.move(QtCore.QPoint(0,0))
10 button.move(QtCore.QPoint(0,0))
11
11
12 # call the move slot (overload2)
12 # call the move slot (overload2)
13 button.move(0,0)
13 button.move(0,0)
14
14
15 # call the static method
15 # call the static method
16 print QtGui.QWidget.mouseGrabber();
16 print QtGui.QWidget.mouseGrabber();
17
17
18 # create a CPP object via constructor
18 # create a CPP object via constructor
19 yourCpp = example.YourCPPObject(2,11.5)
19 yourCpp = example.YourCPPObject(2,11.5)
20
20
21 # call the wrapped method on CPP object
21 # call the wrapped method on CPP object
22 print yourCpp.doSomething(3);
22 print yourCpp.doSomething(3);
23
23
24 # show slots available on yourCpp
24 # show slots available on yourCpp
25 print dir(yourCpp)
25 print dir(yourCpp)
26
26
27 # show docstring of yourCpp
28 print yourCpp.__doc__
29
30 # show docstring of yourCpp.doSomething
31 print yourCpp.doSomething.__doc__
32
27 # destructor will be called:
33 # destructor will be called:
28 yourCpp = None
34 yourCpp = None
@@ -1,20 +1,25
1 # --------- PyScriptingConsole profile -------------------
1 # --------- PyScriptingConsole profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6
6
7 TARGET = PyGettingStarted
7 TARGET = PyGettingStarted
8 TEMPLATE = app
8 TEMPLATE = app
9
9
10 DESTDIR = ../../lib
10 DESTDIR = ../../lib
11
11
12 CONFIG += console
12 CONFIG += console
13
13
14 contains(QT_MAJOR_VERSION, 5) {
15 QT += widgets
16 }
17
14 include ( ../../build/common.prf )
18 include ( ../../build/common.prf )
15 include ( ../../build/PythonQt.prf )
19 CONFIG+=BUILDING_QTALL
20 include ( ../../build/pythonqt.prf )
16
21
17 SOURCES += \
22 SOURCES += \
18 main.cpp
23 main.cpp
19
24
20 RESOURCES += PyGettingStarted.qrc
25 RESOURCES += PyGettingStarted.qrc
@@ -1,21 +1,27
1 # --------- PyGuiExample profile -------------------
1 # --------- PyGuiExample profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6
6
7 TARGET = PyGuiExample
7 TARGET = PyGuiExample
8 TEMPLATE = app
8 TEMPLATE = app
9
9
10 mac:CONFIG -= app_bundle
10 mac:CONFIG -= app_bundle
11
11
12 DESTDIR = ../../lib
12 DESTDIR = ../../lib
13
13
14 contains(QT_MAJOR_VERSION, 5) {
15 QT += widgets
16 }
17
18
14 include ( ../../build/common.prf )
19 include ( ../../build/common.prf )
15 include ( ../../build/PythonQt.prf )
20 CONFIG+=BUILDING_QTALL
21 include ( ../../build/pythonqt.prf )
16 include ( ../../build/PythonQt_QtAll.prf )
22 include ( ../../build/PythonQt_QtAll.prf )
17
23
18 SOURCES += \
24 SOURCES += \
19 main.cpp
25 main.cpp
20
26
21 RESOURCES += PyGuiExample.qrc
27 RESOURCES += PyGuiExample.qrc
@@ -1,19 +1,24
1 # --------- PyLauncher profile -------------------
1 # --------- PyLauncher profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6
6
7 TARGET = PyLauncher
7 TARGET = PyLauncher
8 TEMPLATE = app
8 TEMPLATE = app
9
9
10 mac:CONFIG -= app_bundle
10 mac:CONFIG -= app_bundle
11
11
12 DESTDIR = ../../lib
12 DESTDIR = ../../lib
13
13
14 contains(QT_MAJOR_VERSION, 5) {
15 QT += widgets
16 }
17
14 include ( ../../build/common.prf )
18 include ( ../../build/common.prf )
15 include ( ../../build/PythonQt.prf )
19 CONFIG+=BUILDING_QTALL
20 include ( ../../build/pythonqt.prf )
16 include ( ../../build/PythonQt_QtAll.prf )
21 include ( ../../build/PythonQt_QtAll.prf )
17
22
18 SOURCES += \
23 SOURCES += \
19 main.cpp
24 main.cpp
@@ -1,87 +1,87
1 /*
1 /*
2 *
2 *
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 *
4 *
5 * This library is free software; you can redistribute it and/or
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
8 * version 2.1 of the License, or (at your option) any later version.
9 *
9 *
10 * This library is distributed in the hope that it will be useful,
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
13 * Lesser General Public License for more details.
14 *
14 *
15 * Further, this software is distributed without any warranty that it is
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
20 * other software, or any other product whatsoever.
21 *
21 *
22 * You should have received a copy of the GNU Lesser General Public
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
25 *
26 * Contact information: MeVis Research GmbH, Universitaetsallee 29,
26 * Contact information: MeVis Research GmbH, Universitaetsallee 29,
27 * 28359 Bremen, Germany or:
27 * 28359 Bremen, Germany or:
28 *
28 *
29 * http://www.mevis.de
29 * http://www.mevis.de
30 *
30 *
31 */
31 */
32
32
33 //----------------------------------------------------------------------------------
33 //----------------------------------------------------------------------------------
34 /*!
34 /*!
35 // \file PyExampleObject.cpp
35 // \file PyExampleObject.cpp
36 // \author Florian Link
36 // \author Florian Link
37 // \author Last changed by $Author: florian $
37 // \author Last changed by $Author: florian $
38 // \date 2006-10
38 // \date 2006-10
39 */
39 */
40 //----------------------------------------------------------------------------------
40 //----------------------------------------------------------------------------------
41
41
42 #include "PyExampleObject.h"
42 #include "PyExampleObject.h"
43 #include <QMessageBox>
43 #include <QMessageBox>
44 #include <QDir>
44 #include <QDir>
45
45
46 PyExampleObject::PyExampleObject():QObject(NULL)
46 PyExampleObject::PyExampleObject():QObject(NULL)
47 {
47 {
48 }
48 }
49
49
50 PyObject* PyExampleObject::getMainModule() {
50 PyObject* PyExampleObject::getMainModule() {
51 return PythonQt::self()->getMainModule();
51 return PythonQt::self()->getMainModule();
52 }
52 }
53
53
54 void PyExampleObject::showInformation(const QString& str)
54 void PyExampleObject::showInformation(const QString& str)
55 {
55 {
56 QMessageBox::information ( NULL, "Test", str);
56 QMessageBox::information ( NULL, "Test", str);
57 }
57 }
58
58
59 QStringList PyExampleObject::readDirectory(const QString& dir)
59 QStringList PyExampleObject::readDirectory(const QString& dir)
60 {
60 {
61 QDir d(dir);
61 QDir d(dir);
62 return d.entryList();
62 return d.entryList();
63 }
63 }
64
64
65 QMainWindow* PyExampleObject::createWindow()
65 QMainWindow* PyExampleObject::createWindow()
66 {
66 {
67 QMainWindow* m = new QMainWindow();
67 QMainWindow* m = new QMainWindow();
68 QPushButton* b = new QPushButton(m);
68 QPushButton* b = new QPushButton(m);
69 b->setObjectName("button1");
69 b->setObjectName("button1");
70
70
71 m->show();
71 m->show();
72 return m;
72 return m;
73 }
73 }
74
74
75 QObject* PyExampleObject::findChild(QObject* o, const QString& name)
75 QObject* PyExampleObject::findChild(QObject* o, const QString& name)
76 {
76 {
77 return qFindChild<QObject*>(o, name);
77 return o->findChild<QObject*>(name);
78 }
78 }
79
79
80 QVariantMap PyExampleObject::testMap()
80 QVariantMap PyExampleObject::testMap()
81 {
81 {
82 QVariantMap m;
82 QVariantMap m;
83 m.insert("a", QStringList() << "test1" << "test2");
83 m.insert("a", QStringList() << "test1" << "test2");
84 m.insert("b", 12);
84 m.insert("b", 12);
85 m.insert("c", 12.);
85 m.insert("c", 12.);
86 return m;
86 return m;
87 }
87 }
@@ -1,25 +1,30
1 # --------- PyScriptingConsole profile -------------------
1 # --------- PyScriptingConsole profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6
6
7 TARGET = PyScriptingConsole
7 TARGET = PyScriptingConsole
8 TEMPLATE = app
8 TEMPLATE = app
9
9
10 DESTDIR = ../../lib
10 DESTDIR = ../../lib
11
11
12 contains(QT_MAJOR_VERSION, 5) {
13 QT += widgets
14 }
15
12 mac:CONFIG-= app_bundle
16 mac:CONFIG-= app_bundle
13
17
14 include ( ../../build/common.prf )
18 include ( ../../build/common.prf )
15 include ( ../../build/PythonQt.prf )
19 CONFIG+=BUILDING_QTALL
16 include ( ../../build/PythonQt_QtAll.prf )
20 include ( ../../build/pythonqt.prf )
21 include ( ../../build/PythonQt_QtAll.prf )
17
22
18 HEADERS += \
23 HEADERS += \
19 PyExampleObject.h
24 PyExampleObject.h
20
25
21 SOURCES += \
26 SOURCES += \
22 PyExampleObject.cpp \
27 PyExampleObject.cpp \
23 main.cpp
28 main.cpp
24
29
25 RESOURCES += PyScriptingConsole.qrc
30 RESOURCES += PyScriptingConsole.qrc
@@ -1,9 +1,10
1 TEMPLATE = subdirs
1 TEMPLATE = subdirs
2 SUBDIRS = CPPPyWrapperExample \
2 SUBDIRS = CPPPyWrapperExample \
3 PyGettingStarted \
3 PyGettingStarted \
4 PyCPPWrapperExample \
4 PyCPPWrapperExample \
5 PyCustomMetaTypeExample \
5 PyCustomMetaTypeExample \
6 PyGuiExample \
6 PyGuiExample \
7 PyDecoratorsExample \
7 PyDecoratorsExample \
8 PyScriptingConsole \
8 PyScriptingConsole \
9 PyLauncher
9 PyLauncher \
10 NicePyConsole
@@ -1,67 +1,65
1 /*
1 /*
2 *
2 *
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 *
4 *
5 * This library is free software; you can redistribute it and/or
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
8 * version 2.1 of the License, or (at your option) any later version.
9 *
9 *
10 * This library is distributed in the hope that it will be useful,
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
13 * Lesser General Public License for more details.
14 *
14 *
15 * Further, this software is distributed without any warranty that it is
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
20 * other software, or any other product whatsoever.
21 *
21 *
22 * You should have received a copy of the GNU Lesser General Public
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
25 *
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 * 28359 Bremen, Germany or:
27 * 28359 Bremen, Germany or:
28 *
28 *
29 * http://www.mevis.de
29 * http://www.mevis.de
30 *
30 *
31 */
31 */
32
32
33 #include "PythonQt_QtAll.h"
33 #include "PythonQt_QtAll.h"
34
34
35 #include "PythonQt.h"
35 #include "PythonQt.h"
36
36
37 void PythonQt_init_QtGui(PyObject*);
37 void PythonQt_init_QtGui(PyObject*);
38 void PythonQt_init_QtSvg(PyObject*);
38 void PythonQt_init_QtSvg(PyObject*);
39 void PythonQt_init_QtSql(PyObject*);
39 void PythonQt_init_QtSql(PyObject*);
40 void PythonQt_init_QtNetwork(PyObject*);
40 void PythonQt_init_QtNetwork(PyObject*);
41 void PythonQt_init_QtCore(PyObject*);
41 void PythonQt_init_QtCore(PyObject*);
42 void PythonQt_init_QtWebKit(PyObject*);
42 void PythonQt_init_QtWebKit(PyObject*);
43 void PythonQt_init_QtOpenGL(PyObject*);
43 void PythonQt_init_QtOpenGL(PyObject*);
44 void PythonQt_init_QtXml(PyObject*);
44 void PythonQt_init_QtXml(PyObject*);
45 void PythonQt_init_QtXmlPatterns(PyObject*);
45 void PythonQt_init_QtXmlPatterns(PyObject*);
46 void PythonQt_init_QtUiTools(PyObject*);
46 void PythonQt_init_QtUiTools(PyObject*);
47 void PythonQt_init_QtPhonon(PyObject*);
47 void PythonQt_init_QtPhonon(PyObject*);
48
48
49 namespace PythonQt_QtAll
49 namespace PythonQt_QtAll
50 {
50 {
51 PYTHONQT_QTALL_EXPORT void init() {
51 PYTHONQT_QTALL_EXPORT void init() {
52 PythonQt_init_QtCore(0);
52 PythonQt_init_QtCore(0);
53 PythonQt_init_QtNetwork(0);
53 PythonQt_init_QtNetwork(0);
54 PythonQt_init_QtGui(0);
54 PythonQt_init_QtGui(0);
55 PythonQt_init_QtXml(0);
55 PythonQt_init_QtXml(0);
56 PythonQt_init_QtSvg(0);
56 PythonQt_init_QtSvg(0);
57 PythonQt_init_QtSql(0);
57 PythonQt_init_QtSql(0);
58 PythonQt_init_QtWebKit(0);
58 PythonQt_init_QtWebKit(0);
59 PythonQt_init_QtOpenGL(0);
59 PythonQt_init_QtOpenGL(0);
60 PythonQt_init_QtUiTools(0);
60 PythonQt_init_QtUiTools(0);
61 // Does not compile yet:
61 // Does not compile yet:
62 // PythonQt_init_QtXmlPatterns(0);
62 // PythonQt_init_QtXmlPatterns(0);
63 // PythonQt_init_QtPhonon(0);
63 // PythonQt_init_QtPhonon(0);
64 };
64 }
65 };
65 }
66
67
1 NO CONTENT: modified file chmod 100644 => 100755
NO CONTENT: modified file chmod 100644 => 100755
1 NO CONTENT: modified file chmod 100644 => 100755
NO CONTENT: modified file chmod 100644 => 100755
@@ -1,92 +1,100
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
3 ** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
6 **
7 ** This file is part of the Qt Script Generator project on Qt Labs.
7 ** This file is part of the Qt Script Generator project on Qt Labs.
8 **
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
14 ** this package.
15 **
15 **
16 ** GNU Lesser General Public License Usage
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file. Please review the following information to
20 ** packaging of this file. Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23 **
23 **
24 ** In addition, as a special exception, Nokia gives you certain additional
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27 **
27 **
28 ** If you have questions regarding the use of this file, please contact
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
29 ** Nokia at qt-info@nokia.com.
30 **
30 **
31 **
31 **
32 **
32 **
33 **
33 **
34 **
34 **
35 **
35 **
36 **
36 **
37 **
37 **
38 ** $QT_END_LICENSE$
38 ** $QT_END_LICENSE$
39 **
39 **
40 ****************************************************************************/
40 ****************************************************************************/
41
41
42 #ifndef PP_ITERATOR_H
42 #ifndef PP_ITERATOR_H
43 #define PP_ITERATOR_H
43 #define PP_ITERATOR_H
44
44
45 #include <iterator>
45 #include <iterator>
46
46
47 namespace rpp {
47 namespace rpp {
48
48
49 class pp_null_output_iterator
49 class pp_null_output_iterator
50 : public std::iterator<std::output_iterator_tag, void, void, void, void>
50 : public std::iterator<std::output_iterator_tag, void, void, void, void>
51 {
51 {
52 public:
52 public:
53 pp_null_output_iterator() {}
53 pp_null_output_iterator() {}
54
54
55 template <typename _Tp>
55 template <typename _Tp>
56 pp_null_output_iterator &operator=(_Tp const &)
56 pp_null_output_iterator &operator=(_Tp const &)
57 { return *this; }
57 { return *this; }
58
58
59 inline pp_null_output_iterator &operator * () { return *this; }
59 inline pp_null_output_iterator &operator * () { return *this; }
60 inline pp_null_output_iterator &operator ++ () { return *this; }
60 inline pp_null_output_iterator &operator ++ () { return *this; }
61 inline pp_null_output_iterator operator ++ (int) { return *this; }
61 inline pp_null_output_iterator operator ++ (int) { return *this; }
62 };
62 };
63
63
64 template <typename _Container>
64 template <typename _Container>
65 class pp_output_iterator
65 class pp_output_iterator
66 : public std::iterator<std::output_iterator_tag, void, void, void, void>
66 : public std::iterator<std::output_iterator_tag, void, void, void, void>
67 {
67 {
68 std::string &_M_result;
68 std::string &_M_result;
69
69
70 public:
70 public:
71 explicit pp_output_iterator(std::string &__result):
71 explicit pp_output_iterator(std::string &__result):
72 _M_result (__result) {}
72 _M_result (__result) {}
73
73
74 // this copy constructor was needed for Visual Studio 2012 release builds:
75 inline pp_output_iterator &operator=(const pp_output_iterator& other)
76 {
77 *(std::iterator<std::output_iterator_tag, void, void, void, void>*)(this) = other;
78 _M_result = other._M_result;
79 return *this;
80 }
81
74 inline pp_output_iterator &operator=(typename _Container::const_reference __v)
82 inline pp_output_iterator &operator=(typename _Container::const_reference __v)
75 {
83 {
76 if (_M_result.capacity () == _M_result.size ())
84 if (_M_result.capacity () == _M_result.size ())
77 _M_result.reserve (_M_result.capacity () << 2);
85 _M_result.reserve (_M_result.capacity () << 2);
78
86
79 _M_result.push_back(__v);
87 _M_result.push_back(__v);
80 return *this;
88 return *this;
81 }
89 }
82
90
83 inline pp_output_iterator &operator * () { return *this; }
91 inline pp_output_iterator &operator * () { return *this; }
84 inline pp_output_iterator &operator ++ () { return *this; }
92 inline pp_output_iterator &operator ++ () { return *this; }
85 inline pp_output_iterator operator ++ (int) { return *this; }
93 inline pp_output_iterator operator ++ (int) { return *this; }
86 };
94 };
87
95
88 } // namespace rpp
96 } // namespace rpp
89
97
90 #endif // PP_ITERATOR_H
98 #endif // PP_ITERATOR_H
91
99
92 // kate: space-indent on; indent-width 2; replace-tabs on;
100 // kate: space-indent on; indent-width 2; replace-tabs on;
@@ -1,5720 +1,5721
1 <?xml version="1.0"?>
1 <?xml version="1.0"?>
2 <typesystem package="com.trolltech.qt.gui"><rejection class="QAbstractTextDocumentLayout"/><rejection class="QColormap"/><rejection class="QIconEngineV2"/><rejection class="QInputMethodEvent"/><rejection class="QPainterPath::Element"/><rejection class="QTextBlock::iterator"/><rejection class="QTextEdit::ExtraSelection"/><rejection class="QTextFrame::iterator"/><rejection class="QTextLayout::FormatRange"/><rejection class="QTreeWidgetItemIterator"/><rejection class="QAccessibleFactoryInterface"/><rejection class="QIconEngineFactoryInterfaceV2"/><rejection class="QImageIOHandlerFactoryInterface"/><rejection class="QInputContextFactoryInterface"/><rejection class="QStyleFactoryInterface"/><rejection class="QPictureFormatInterface"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Cannot find enum constant for value 'DragMove' in 'QDragMoveEvent' or any of its super classes"/>
2 <typesystem package="com.trolltech.qt.gui"><rejection class="QAbstractTextDocumentLayout"/><rejection class="QColormap"/><rejection class="QIconEngineV2"/><rejection class="QInputMethodEvent"/><rejection class="QPainterPath::Element"/><rejection class="QTextBlock::iterator"/><rejection class="QTextEdit::ExtraSelection"/><rejection class="QTextFrame::iterator"/><rejection class="QTextLayout::FormatRange"/><rejection class="QTreeWidgetItemIterator"/><rejection class="QAccessibleFactoryInterface"/><rejection class="QIconEngineFactoryInterfaceV2"/><rejection class="QImageIOHandlerFactoryInterface"/><rejection class="QInputContextFactoryInterface"/><rejection class="QStyleFactoryInterface"/><rejection class="QPictureFormatInterface"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Cannot find enum constant for value 'DragMove' in 'QDragMoveEvent' or any of its super classes"/>
3
3
4 <rejection class="*" function-name="d_func"/>
4 <rejection class="*" function-name="d_func"/>
5
5
6 <rejection class="*" field-name="d_ptr"/>
6 <rejection class="*" field-name="d_ptr"/>
7 <rejection class="*" field-name="d"/>
7 <rejection class="*" field-name="d"/>
8
8
9
9
10 <rejection class="QGenericMatrix"/>
10 <rejection class="QGenericMatrix"/>
11 <rejection class="QPixmapFilterPrivate"/>
11 <rejection class="QPixmapFilterPrivate"/>
12 <rejection class="QPenPrivate"/>
12 <rejection class="QPenPrivate"/>
13 <rejection class="QGtkStyle"/>
13 <rejection class="QGtkStyle"/>
14 <rejection class="QWindowsCEStyle"/>
14 <rejection class="QWindowsCEStyle"/>
15 <rejection class="QWindowsMobileStyle"/>
15 <rejection class="QWindowsMobileStyle"/>
16 <rejection class="QAbstractUndoItem"/>
16 <rejection class="QAbstractUndoItem"/>
17 <rejection class="QAccessibleApplication"/>
17 <rejection class="QAccessibleApplication"/>
18 <rejection class="QBrushData"/>
18 <rejection class="QBrushData"/>
19 <rejection class="QImageTextKeyLang"/>
19 <rejection class="QImageTextKeyLang"/>
20 <rejection class="QItemEditorCreator"/>
20 <rejection class="QItemEditorCreator"/>
21 <rejection class="QLinkedList"/>
21 <rejection class="QLinkedList"/>
22 <rejection class="QLinkedListData"/>
22 <rejection class="QLinkedListData"/>
23 <rejection class="QLinkedListIterator"/>
23 <rejection class="QLinkedListIterator"/>
24 <rejection class="QLinkedListNode"/>
24 <rejection class="QLinkedListNode"/>
25 <rejection class="QMimeSource"/>
25 <rejection class="QMimeSource"/>
26 <rejection class="QPainterPathPrivate"/>
26 <rejection class="QPainterPathPrivate"/>
27 <rejection class="QRegionData"/>
27 <rejection class="QRegionData"/>
28 <rejection class="QStandardItemEditorCreator"/>
28 <rejection class="QStandardItemEditorCreator"/>
29 <rejection class="QStyleOptionQ3DockWindow"/>
29 <rejection class="QStyleOptionQ3DockWindow"/>
30 <rejection class="QStyleOptionQ3ListView"/>
30 <rejection class="QStyleOptionQ3ListView"/>
31 <rejection class="QStyleOptionQ3ListViewItem"/>
31 <rejection class="QStyleOptionQ3ListViewItem"/>
32 <rejection class="QTextFrameLayoutData"/>
32 <rejection class="QTextFrameLayoutData"/>
33 <rejection class="QUpdateLaterEvent"/>
33 <rejection class="QUpdateLaterEvent"/>
34 <rejection class="QVFbHeader"/>
34 <rejection class="QVFbHeader"/>
35 <rejection class="QWidgetData"/>
35 <rejection class="QWidgetData"/>
36 <rejection class="QWindowSurface"/>
36 <rejection class="QWindowSurface"/>
37 <rejection class="QWindowsXPStyle"/>
37 <rejection class="QWindowsXPStyle"/>
38 <rejection class="QWindowsVistaStyle"/>
38 <rejection class="QWindowsVistaStyle"/>
39 <rejection class="QWSEmbedWidget"/>
39 <rejection class="QWSEmbedWidget"/>
40 <rejection class="QRegion::QRegionData"/>
40 <rejection class="QRegion::QRegionData"/>
41 <rejection class="JObject_key"/>
41 <rejection class="JObject_key"/>
42 <rejection class="QAccessibleEditableTextInterface"/>
42 <rejection class="QAccessibleEditableTextInterface"/>
43 <rejection class="QAccessibleSimpleEditableTextInterface"/>
43 <rejection class="QAccessibleSimpleEditableTextInterface"/>
44 <rejection class="QAccessibleTextInterface"/>
44 <rejection class="QAccessibleTextInterface"/>
45 <rejection class="QAccessibleValueInterface"/>
45 <rejection class="QAccessibleValueInterface"/>
46 <rejection class="QIconEngineFactoryInterface"/>
46 <rejection class="QIconEngineFactoryInterface"/>
47 <rejection class="QIconEnginePlugin"/>
47 <rejection class="QIconEnginePlugin"/>
48 <rejection class="QWidgetItemV2"/>
48 <rejection class="QWidgetItemV2"/>
49 <rejection class="QAbstractItemDelegate" function-name="operator="/>
49 <rejection class="QAbstractItemDelegate" function-name="operator="/>
50 <rejection class="QAccessible" function-name="installFactory"/>
50 <rejection class="QAccessible" function-name="installFactory"/>
51 <rejection class="QAccessible" function-name="installRootObjectHandler"/>
51 <rejection class="QAccessible" function-name="installRootObjectHandler"/>
52 <rejection class="QAccessible" function-name="installUpdateHandler"/>
52 <rejection class="QAccessible" function-name="installUpdateHandler"/>
53 <rejection class="QAccessible" function-name="removeFactory"/>
53 <rejection class="QAccessible" function-name="removeFactory"/>
54 <rejection class="QApplication" function-name="compressEvent"/>
54 <rejection class="QApplication" function-name="compressEvent"/>
55 <rejection class="QBrush" function-name="cleanUp"/>
55 <rejection class="QBrush" function-name="cleanUp"/>
56 <rejection class="QPictureIO" function-name="defineIOHandler"/>
56 <rejection class="QPictureIO" function-name="defineIOHandler"/>
57 <rejection class="QPolygon" function-name="putPoints"/>
57 <rejection class="QPolygon" function-name="putPoints"/>
58 <rejection class="QPolygon" function-name="setPoints"/>
58 <rejection class="QPolygon" function-name="setPoints"/>
59 <rejection class="QPolygon" function-name="setPoint"/>
59 <rejection class="QPolygon" function-name="setPoint"/>
60 <rejection class="QPolygon" function-name="points"/>
60 <rejection class="QPolygon" function-name="points"/>
61 <rejection class="QPolygon" function-name="point"/>
61 <rejection class="QPolygon" function-name="point"/>
62 <rejection class="QPrinter" function-name="printerSelectionOption"/>
62 <rejection class="QPrinter" function-name="printerSelectionOption"/>
63 <rejection class="QPrinter" function-name="setPrinterSelectionOption"/>
63 <rejection class="QPrinter" function-name="setPrinterSelectionOption"/>
64 <rejection class="QWidget" function-name="create"/>
64 <rejection class="QWidget" function-name="create"/>
65 <rejection class="QWidget" function-name="find"/>
65 <rejection class="QWidget" function-name="find"/>
66 <rejection class="QWidget" function-name="handle"/>
66 <rejection class="QWidget" function-name="handle"/>
67 <rejection class="QWidget" function-name="styleChange"/>
67 <rejection class="QWidget" function-name="styleChange"/>
68 <rejection class="QWidget" function-name="internalWinId"/>
68 <rejection class="QWidget" function-name="internalWinId"/>
69 <rejection class="QActionGroup" function-name="selected"/>
69 <rejection class="QActionGroup" function-name="selected"/>
70 <rejection class="QPaintEngine" function-name="fix_neg_rect"/>
70 <rejection class="QPaintEngine" function-name="fix_neg_rect"/>
71 <rejection class="QTreeModel" function-name="node"/>
71 <rejection class="QTreeModel" function-name="node"/>
72 <rejection class="QTreeModel" function-name="initializeNode"/>
72 <rejection class="QTreeModel" function-name="initializeNode"/>
73 <rejection class="QTreeModel" function-name="queryChildren"/>
73 <rejection class="QTreeModel" function-name="queryChildren"/>
74 <rejection class="QTextObjectInterface"/>
74 <rejection class="QTextObjectInterface"/>
75 <rejection class="QAccessible" function-name="cast_helper"/>
75 <rejection class="QAccessible" function-name="cast_helper"/>
76 <rejection class="QAccessible2"/>
76 <rejection class="QAccessible2"/>
77 <rejection class="QAccessibleInterface" function-name="backgroundColor"/>
77 <rejection class="QAccessibleInterface" function-name="backgroundColor"/>
78 <rejection class="QAccessibleInterface" function-name="foregroundColor"/>
78 <rejection class="QAccessibleInterface" function-name="foregroundColor"/>
79 <rejection class="QAccessibleInterface" function-name="textInterface"/>
79 <rejection class="QAccessibleInterface" function-name="textInterface"/>
80 <rejection class="QAccessibleInterface" function-name="valueInterface"/>
80 <rejection class="QAccessibleInterface" function-name="valueInterface"/>
81 <rejection class="QAccessibleInterface" function-name="tableInterface"/>
81 <rejection class="QAccessibleInterface" function-name="tableInterface"/>
82 <rejection class="QAccessibleInterface" function-name="editableTextInterface"/>
82 <rejection class="QAccessibleInterface" function-name="editableTextInterface"/>
83 <rejection class="QAccessibleInterface" function-name="cast_helper"/>
83 <rejection class="QAccessibleInterface" function-name="cast_helper"/>
84 <rejection class="QAccessibleInterfaceEx" function-name="interface_cast"/>
84 <rejection class="QAccessibleInterfaceEx" function-name="interface_cast"/>
85 <rejection class="QAccessibleBridgePlugin"/>
85 <rejection class="QAccessibleBridgePlugin"/>
86 <rejection class="QAccessibleBridgeFactoryInterface"/>
86 <rejection class="QAccessibleBridgeFactoryInterface"/>
87 <rejection class="QTabletEvent" field-name="mExtra"/>
87 <rejection class="QTabletEvent" field-name="mExtra"/>
88 <rejection class="QWidgetItem" field-name="wid"/>
88 <rejection class="QWidgetItem" field-name="wid"/>
89 <rejection class="QFont" enum-name="ResolveProperties"/>
89 <rejection class="QFont" enum-name="ResolveProperties"/>
90 <rejection class="QGradient" enum-name="InterpolationMode"/>
90 <rejection class="QGradient" enum-name="InterpolationMode"/>
91 <rejection class="QIconEngineV2::AvailableSizesArgument"/>
91 <rejection class="QIconEngineV2::AvailableSizesArgument"/>
92 <rejection class="QIconEngineV2" enum-name="IconEngineHook"/>
92 <rejection class="QIconEngineV2" enum-name="IconEngineHook"/>
93 <rejection class="QGradient" enum-name="InterpolationMode"/>
93 <rejection class="QGradient" enum-name="InterpolationMode"/>
94 <rejection class="QGradient" function-name="setInterpolationMode"/>
94 <rejection class="QGradient" function-name="setInterpolationMode"/>
95 <rejection class="QGradient" function-name="interpolationMode"/>
95 <rejection class="QGradient" function-name="interpolationMode"/>
96 <rejection class="QAbstractTextDocumentLayout" function-name="handlerForObject"/>
96 <rejection class="QAbstractTextDocumentLayout" function-name="handlerForObject"/>
97
97
98 <enum-type name="QStaticText::PerformanceHint"/>
98 <enum-type name="QStaticText::PerformanceHint"/>
99 <enum-type name="QTextBlockFormat::LineHeightTypes"/>
99 <enum-type name="QTextBlockFormat::LineHeightTypes"/>
100 <enum-type name="QStyleOptionTabWidgetFrameV2::StyleOptionVersion"/>
100 <enum-type name="QStyleOptionTabWidgetFrameV2::StyleOptionVersion"/>
101 <enum-type name="QStyleOptionTabBarBaseV2::StyleOptionVersion"/>
101 <enum-type name="QStyleOptionTabBarBaseV2::StyleOptionVersion"/>
102 <enum-type name="QTabBar::SelectionBehavior"/>
102 <enum-type name="QTabBar::SelectionBehavior"/>
103 <enum-type name="QTabBar::ButtonPosition"/>
103 <enum-type name="QTabBar::ButtonPosition"/>
104 <enum-type name="QInputDialog::InputMode"/>
104 <enum-type name="QInputDialog::InputMode"/>
105 <enum-type name="QInputDialog::InputDialogOption" flags="QInputDialog::InputDialogOptions"/>
105 <enum-type name="QInputDialog::InputDialogOption" flags="QInputDialog::InputDialogOptions"/>
106 <enum-type name="QFontDialog::FontDialogOption" flags="QFontDialog::FontDialogOptions"/>
106 <enum-type name="QFontDialog::FontDialogOption" flags="QFontDialog::FontDialogOptions"/>
107 <enum-type name="QColorDialog::ColorDialogOption" flags="QColorDialog::ColorDialogOptions"/>
107 <enum-type name="QColorDialog::ColorDialogOption" flags="QColorDialog::ColorDialogOptions"/>
108 <enum-type name="QAbstractItemDelegate::EndEditHint"/>
108 <enum-type name="QAbstractItemDelegate::EndEditHint"/>
109 <enum-type name="QAbstractItemView::CursorAction"/>
109 <enum-type name="QAbstractItemView::CursorAction"/>
110 <enum-type name="QAbstractItemView::DragDropMode"/>
110 <enum-type name="QAbstractItemView::DragDropMode"/>
111 <enum-type name="QAbstractItemView::DropIndicatorPosition"/>
111 <enum-type name="QAbstractItemView::DropIndicatorPosition"/>
112 <enum-type name="QAbstractItemView::EditTrigger" flags="QAbstractItemView::EditTriggers"/>
112 <enum-type name="QAbstractItemView::EditTrigger" flags="QAbstractItemView::EditTriggers"/>
113 <enum-type name="QAbstractItemView::ScrollHint"/>
113 <enum-type name="QAbstractItemView::ScrollHint"/>
114 <enum-type name="QAbstractItemView::ScrollMode"/>
114 <enum-type name="QAbstractItemView::ScrollMode"/>
115 <enum-type name="QAbstractItemView::SelectionBehavior"/>
115 <enum-type name="QAbstractItemView::SelectionBehavior"/>
116 <enum-type name="QAbstractItemView::SelectionMode"/>
116 <enum-type name="QAbstractItemView::SelectionMode"/>
117 <enum-type name="QAbstractItemView::State"/>
117 <enum-type name="QAbstractItemView::State"/>
118 <enum-type name="QAbstractPrintDialog::PrintDialogOption" flags="QAbstractPrintDialog::PrintDialogOptions"/>
118 <enum-type name="QAbstractPrintDialog::PrintDialogOption" flags="QAbstractPrintDialog::PrintDialogOptions"/>
119 <enum-type name="QAbstractPrintDialog::PrintRange"/>
119 <enum-type name="QAbstractPrintDialog::PrintRange"/>
120 <enum-type name="QAbstractSlider::SliderAction"/>
120 <enum-type name="QAbstractSlider::SliderAction"/>
121 <enum-type name="QAbstractSlider::SliderChange"/>
121 <enum-type name="QAbstractSlider::SliderChange"/>
122 <enum-type name="QAbstractSpinBox::ButtonSymbols"/>
122 <enum-type name="QAbstractSpinBox::ButtonSymbols"/>
123 <enum-type name="QAbstractSpinBox::CorrectionMode"/>
123 <enum-type name="QAbstractSpinBox::CorrectionMode"/>
124 <enum-type name="QAbstractSpinBox::StepEnabledFlag" flags="QAbstractSpinBox::StepEnabled"/>
124 <enum-type name="QAbstractSpinBox::StepEnabledFlag" flags="QAbstractSpinBox::StepEnabled"/>
125 <enum-type name="QAccessible::Event"/>
125 <enum-type name="QAccessible::Event"/>
126 <enum-type name="QAccessible::Method"/>
126 <enum-type name="QAccessible::Method"/>
127 <enum-type name="QAccessible::RelationFlag" flags="QAccessible::Relation"/>
127 <enum-type name="QAccessible::RelationFlag" flags="QAccessible::Relation"/>
128 <enum-type name="QAccessible::Role"/>
128 <enum-type name="QAccessible::Role"/>
129 <enum-type name="QAccessible::StateFlag" flags="QAccessible::State"/>
129 <enum-type name="QAccessible::StateFlag" flags="QAccessible::State"/>
130 <enum-type name="QAccessible::Text"/>
130 <enum-type name="QAccessible::Text"/>
131 <enum-type name="QDesktopServices::StandardLocation"/>
131 <enum-type name="QDesktopServices::StandardLocation"/>
132 <enum-type name="QDirModel::Roles"/>
132 <enum-type name="QDirModel::Roles"/>
133 <enum-type name="QFont::Capitalization"/>
133 <enum-type name="QFont::Capitalization"/>
134 <enum-type name="QFont::SpacingType"/>
134 <enum-type name="QFont::SpacingType"/>
135 <enum-type name="QGraphicsItem::CacheMode"/>
135 <enum-type name="QGraphicsItem::CacheMode"/>
136 <enum-type name="QMdiArea::AreaOption" flags="QMdiArea::AreaOptions"/>
136 <enum-type name="QMdiArea::AreaOption" flags="QMdiArea::AreaOptions"/>
137 <enum-type name="QMdiArea::WindowOrder"/>
137 <enum-type name="QMdiArea::WindowOrder"/>
138 <enum-type name="QMdiArea::ViewMode"/>
138 <enum-type name="QMdiArea::ViewMode"/>
139 <enum-type name="QFileSystemModel::Roles"/>
139 <enum-type name="QFileSystemModel::Roles"/>
140 <enum-type name="QFormLayout::FieldGrowthPolicy"/>
140 <enum-type name="QFormLayout::FieldGrowthPolicy"/>
141 <enum-type name="QFormLayout::FormStyle"/>
141 <enum-type name="QFormLayout::FormStyle"/>
142 <enum-type name="QFormLayout::ItemRole"/>
142 <enum-type name="QFormLayout::ItemRole"/>
143 <enum-type name="QFormLayout::RowWrapPolicy"/>
143 <enum-type name="QFormLayout::RowWrapPolicy"/>
144 <enum-type name="QGraphicsProxyWidget::enum_1"/>
144 <enum-type name="QGraphicsProxyWidget::enum_1"/>
145 <enum-type name="QGraphicsWidget::enum_1"/>
145 <enum-type name="QGraphicsWidget::enum_1"/>
146 <enum-type name="QPlainTextEdit::LineWrapMode"/>
146 <enum-type name="QPlainTextEdit::LineWrapMode"/>
147 <enum-type name="QPrintPreviewWidget::ViewMode"/>
147 <enum-type name="QPrintPreviewWidget::ViewMode"/>
148 <enum-type name="QPrintPreviewWidget::ZoomMode"/>
148 <enum-type name="QPrintPreviewWidget::ZoomMode"/>
149 <enum-type name="QStyleOptionTabV3::StyleOptionVersion"/>
149 <enum-type name="QStyleOptionTabV3::StyleOptionVersion"/>
150 <enum-type name="QStyleOptionFrameV3::StyleOptionVersion"/>
150 <enum-type name="QStyleOptionFrameV3::StyleOptionVersion"/>
151 <enum-type name="QStyleOptionViewItemV4::StyleOptionVersion"/>
151 <enum-type name="QStyleOptionViewItemV4::StyleOptionVersion"/>
152 <enum-type name="QStyleOptionViewItemV4::ViewItemPosition"/>
152 <enum-type name="QStyleOptionViewItemV4::ViewItemPosition"/>
153
153
154 <enum-type name="QMdiSubWindow::SubWindowOption" flags="QMdiSubWindow::SubWindowOptions"/>
154 <enum-type name="QMdiSubWindow::SubWindowOption" flags="QMdiSubWindow::SubWindowOptions"/>
155
155
156 <enum-type name="QAction::ActionEvent"/>
156 <enum-type name="QAction::ActionEvent"/>
157 <enum-type name="QAction::MenuRole"/>
157 <enum-type name="QAction::MenuRole"/>
158 <enum-type name="QApplication::ColorSpec"/>
158 <enum-type name="QApplication::ColorSpec"/>
159 <enum-type name="QApplication::Type"/>
159 <enum-type name="QApplication::Type"/>
160 <enum-type name="QCalendarWidget::HorizontalHeaderFormat"/>
160 <enum-type name="QCalendarWidget::HorizontalHeaderFormat"/>
161 <enum-type name="QCalendarWidget::SelectionMode"/>
161 <enum-type name="QCalendarWidget::SelectionMode"/>
162 <enum-type name="QCalendarWidget::VerticalHeaderFormat"/>
162 <enum-type name="QCalendarWidget::VerticalHeaderFormat"/>
163 <enum-type name="QColor::Spec"/>
163 <enum-type name="QColor::Spec"/>
164 <enum-type name="QColormap::Mode"/>
164 <enum-type name="QColormap::Mode"/>
165 <enum-type name="QComboBox::InsertPolicy"/>
165 <enum-type name="QComboBox::InsertPolicy"/>
166 <enum-type name="QComboBox::SizeAdjustPolicy"/>
166 <enum-type name="QComboBox::SizeAdjustPolicy"/>
167 <enum-type name="QCompleter::CompletionMode"/>
167 <enum-type name="QCompleter::CompletionMode"/>
168 <enum-type name="QCompleter::ModelSorting"/>
168 <enum-type name="QCompleter::ModelSorting"/>
169 <enum-type name="QContextMenuEvent::Reason"/>
169 <enum-type name="QContextMenuEvent::Reason"/>
170 <enum-type name="QDataWidgetMapper::SubmitPolicy"/>
170 <enum-type name="QDataWidgetMapper::SubmitPolicy"/>
171 <enum-type name="QDateTimeEdit::Section" flags="QDateTimeEdit::Sections"/>
171 <enum-type name="QDateTimeEdit::Section" flags="QDateTimeEdit::Sections"/>
172 <enum-type name="QDialog::DialogCode"/>
172 <enum-type name="QDialog::DialogCode"/>
173 <enum-type name="QDialogButtonBox::ButtonLayout"/>
173 <enum-type name="QDialogButtonBox::ButtonLayout"/>
174 <enum-type name="QDialogButtonBox::ButtonRole"/>
174 <enum-type name="QDialogButtonBox::ButtonRole"/>
175 <enum-type name="QFileDialog::AcceptMode"/>
175 <enum-type name="QFileDialog::AcceptMode"/>
176 <enum-type name="QFileDialog::DialogLabel"/>
176 <enum-type name="QFileDialog::DialogLabel"/>
177 <enum-type name="QFileDialog::FileMode"/>
177 <enum-type name="QFileDialog::FileMode"/>
178 <enum-type name="QFileDialog::Option" flags="QFileDialog::Options"/>
178 <enum-type name="QFileDialog::Option" flags="QFileDialog::Options"/>
179 <enum-type name="QFileDialog::ViewMode"/>
179 <enum-type name="QFileDialog::ViewMode"/>
180 <enum-type name="QFileIconProvider::IconType"/>
180 <enum-type name="QFileIconProvider::IconType"/>
181 <enum-type name="QFont::Stretch"/>
181 <enum-type name="QFont::Stretch"/>
182 <enum-type name="QFont::Style"/>
182 <enum-type name="QFont::Style"/>
183 <enum-type name="QFont::StyleStrategy"/>
183 <enum-type name="QFont::StyleStrategy"/>
184 <enum-type name="QFont::Weight"/>
184 <enum-type name="QFont::Weight"/>
185 <enum-type name="QFontComboBox::FontFilter" flags="QFontComboBox::FontFilters"/>
185 <enum-type name="QFontComboBox::FontFilter" flags="QFontComboBox::FontFilters"/>
186 <enum-type name="QFrame::Shadow" extensible="yes"/>
186 <enum-type name="QFrame::Shadow" extensible="yes"/>
187 <enum-type name="QFrame::Shape"/>
187 <enum-type name="QFrame::Shape"/>
188 <enum-type name="QFrame::StyleMask"/>
188 <enum-type name="QFrame::StyleMask"/>
189 <enum-type name="QGradient::CoordinateMode"/>
189 <enum-type name="QGradient::CoordinateMode"/>
190 <enum-type name="QGradient::Spread" lower-bound="QGradient.PadSpread" upper-bound="QGradient.RepeatSpread"/>
190 <enum-type name="QGradient::Spread" lower-bound="QGradient.PadSpread" upper-bound="QGradient.RepeatSpread"/>
191 <enum-type name="QGradient::Type"/>
191 <enum-type name="QGradient::Type"/>
192 <enum-type name="QGraphicsEllipseItem::enum_1"/>
192 <enum-type name="QGraphicsEllipseItem::enum_1"/>
193 <enum-type name="QGraphicsItem::Extension"/>
193 <enum-type name="QGraphicsItem::Extension"/>
194 <enum-type name="QGraphicsItem::GraphicsItemChange"/>
194 <enum-type name="QGraphicsItem::GraphicsItemChange"/>
195 <enum-type name="QGraphicsItem::GraphicsItemFlag" flags="QGraphicsItem::GraphicsItemFlags"/>
195 <enum-type name="QGraphicsItem::GraphicsItemFlag" flags="QGraphicsItem::GraphicsItemFlags"/>
196 <enum-type name="QGraphicsItem::enum_1"/>
196 <enum-type name="QGraphicsItem::enum_1"/>
197 <enum-type name="QGraphicsItemGroup::enum_1"/>
197 <enum-type name="QGraphicsItemGroup::enum_1"/>
198 <enum-type name="QGraphicsLineItem::enum_1"/>
198 <enum-type name="QGraphicsLineItem::enum_1"/>
199 <enum-type name="QGraphicsPathItem::enum_1"/>
199 <enum-type name="QGraphicsPathItem::enum_1"/>
200 <enum-type name="QGraphicsPixmapItem::ShapeMode"/>
200 <enum-type name="QGraphicsPixmapItem::ShapeMode"/>
201 <enum-type name="QGraphicsPixmapItem::enum_1"/>
201 <enum-type name="QGraphicsPixmapItem::enum_1"/>
202 <enum-type name="QGraphicsPolygonItem::enum_1"/>
202 <enum-type name="QGraphicsPolygonItem::enum_1"/>
203 <enum-type name="QGraphicsRectItem::enum_1"/>
203 <enum-type name="QGraphicsRectItem::enum_1"/>
204 <enum-type name="QGraphicsScene::ItemIndexMethod"/>
204 <enum-type name="QGraphicsScene::ItemIndexMethod"/>
205 <enum-type name="QGraphicsSceneContextMenuEvent::Reason"/>
205 <enum-type name="QGraphicsSceneContextMenuEvent::Reason"/>
206 <enum-type name="QGraphicsSimpleTextItem::enum_1"/>
206 <enum-type name="QGraphicsSimpleTextItem::enum_1"/>
207 <enum-type name="QGraphicsTextItem::enum_1"/>
207 <enum-type name="QGraphicsTextItem::enum_1"/>
208 <enum-type name="QGraphicsView::CacheModeFlag" flags="QGraphicsView::CacheMode"/>
208 <enum-type name="QGraphicsView::CacheModeFlag" flags="QGraphicsView::CacheMode"/>
209 <enum-type name="QGraphicsView::DragMode"/>
209 <enum-type name="QGraphicsView::DragMode"/>
210 <enum-type name="QGraphicsView::OptimizationFlag" flags="QGraphicsView::OptimizationFlags"/>
210 <enum-type name="QGraphicsView::OptimizationFlag" flags="QGraphicsView::OptimizationFlags"/>
211 <enum-type name="QGraphicsView::ViewportAnchor"/>
211 <enum-type name="QGraphicsView::ViewportAnchor"/>
212 <enum-type name="QGraphicsView::ViewportUpdateMode"/>
212 <enum-type name="QGraphicsView::ViewportUpdateMode"/>
213 <enum-type name="QIcon::Mode"/>
213 <enum-type name="QIcon::Mode"/>
214 <enum-type name="QIcon::State"/>
214 <enum-type name="QIcon::State"/>
215 <enum-type name="QImage::Format"/>
215 <enum-type name="QImage::Format"/>
216 <enum-type name="QImage::InvertMode"/>
216 <enum-type name="QImage::InvertMode"/>
217 <enum-type name="QImageIOHandler::ImageOption"/>
217 <enum-type name="QImageIOHandler::ImageOption"/>
218 <enum-type name="QImageReader::ImageReaderError"/>
218 <enum-type name="QImageReader::ImageReaderError"/>
219 <enum-type name="QImageWriter::ImageWriterError"/>
219 <enum-type name="QImageWriter::ImageWriterError"/>
220 <enum-type name="QInputContext::StandardFormat"/>
220 <enum-type name="QInputContext::StandardFormat"/>
221 <enum-type name="QInputMethodEvent::AttributeType"/>
221 <enum-type name="QInputMethodEvent::AttributeType"/>
222 <enum-type name="QItemSelectionModel::SelectionFlag" flags="QItemSelectionModel::SelectionFlags"/>
222 <enum-type name="QItemSelectionModel::SelectionFlag" flags="QItemSelectionModel::SelectionFlags"/>
223 <enum-type name="QKeySequence::SequenceFormat"/>
223 <enum-type name="QKeySequence::SequenceFormat"/>
224 <enum-type name="QKeySequence::SequenceMatch"/>
224 <enum-type name="QKeySequence::SequenceMatch"/>
225 <enum-type name="QKeySequence::StandardKey"/>
225 <enum-type name="QKeySequence::StandardKey"/>
226 <enum-type name="QLCDNumber::Mode"/>
226 <enum-type name="QLCDNumber::Mode"/>
227 <enum-type name="QLCDNumber::SegmentStyle"/>
227 <enum-type name="QLCDNumber::SegmentStyle"/>
228 <enum-type name="QLayout::SizeConstraint"/>
228 <enum-type name="QLayout::SizeConstraint"/>
229 <enum-type name="QLineEdit::EchoMode"/>
229 <enum-type name="QLineEdit::EchoMode"/>
230 <enum-type name="QListView::Flow"/>
230 <enum-type name="QListView::Flow"/>
231 <enum-type name="QListView::LayoutMode"/>
231 <enum-type name="QListView::LayoutMode"/>
232 <enum-type name="QListView::Movement"/>
232 <enum-type name="QListView::Movement"/>
233 <enum-type name="QListView::ResizeMode"/>
233 <enum-type name="QListView::ResizeMode"/>
234 <enum-type name="QListView::ViewMode"/>
234 <enum-type name="QListView::ViewMode"/>
235 <enum-type name="QListWidgetItem::ItemType"/>
235 <enum-type name="QListWidgetItem::ItemType"/>
236 <enum-type name="QMainWindow::DockOption" flags="QMainWindow::DockOptions"/>
236 <enum-type name="QMainWindow::DockOption" flags="QMainWindow::DockOptions"/>
237 <enum-type name="QMessageBox::ButtonRole"/>
237 <enum-type name="QMessageBox::ButtonRole"/>
238 <enum-type name="QMessageBox::Icon"/>
238 <enum-type name="QMessageBox::Icon"/>
239 <enum-type name="QMovie::CacheMode"/>
239 <enum-type name="QMovie::CacheMode"/>
240 <enum-type name="QMovie::MovieState"/>
240 <enum-type name="QMovie::MovieState"/>
241 <enum-type name="QPaintDevice::PaintDeviceMetric"/>
241 <enum-type name="QPaintDevice::PaintDeviceMetric"/>
242 <enum-type name="QPaintEngine::DirtyFlag" flags="QPaintEngine::DirtyFlags"/>
242 <enum-type name="QPaintEngine::DirtyFlag" flags="QPaintEngine::DirtyFlags"/>
243 <enum-type name="QPaintEngine::PaintEngineFeature" flags="QPaintEngine::PaintEngineFeatures"/>
243 <enum-type name="QPaintEngine::PaintEngineFeature" flags="QPaintEngine::PaintEngineFeatures"/>
244 <enum-type name="QPaintEngine::PolygonDrawMode"/>
244 <enum-type name="QPaintEngine::PolygonDrawMode"/>
245 <enum-type name="QPaintEngine::Type"/>
245 <enum-type name="QPaintEngine::Type"/>
246 <enum-type name="QPageSetupDialog::PageSetupDialogOption" flags="QPageSetupDialog::PageSetupDialogOptions"/>
246 <enum-type name="QPageSetupDialog::PageSetupDialogOption" flags="QPageSetupDialog::PageSetupDialogOptions"/>
247 <enum-type name="QPainter::CompositionMode"/>
247 <enum-type name="QPainter::CompositionMode"/>
248 <enum-type name="QPainter::RenderHint" flags="QPainter::RenderHints"/>
248 <enum-type name="QPainter::RenderHint" flags="QPainter::RenderHints"/>
249 <enum-type name="QPainterPath::ElementType"/>
249 <enum-type name="QPainterPath::ElementType"/>
250 <enum-type name="QPrintEngine::PrintEnginePropertyKey">
250 <enum-type name="QPrintEngine::PrintEnginePropertyKey">
251 <reject-enum-value name="PPK_PaperSize"/>
251 <reject-enum-value name="PPK_PaperSize"/>
252 </enum-type>
252 </enum-type>
253 <enum-type name="QPrinter::ColorMode"/>
253 <enum-type name="QPrinter::ColorMode"/>
254 <enum-type name="QPrinter::Orientation"/>
254 <enum-type name="QPrinter::Orientation"/>
255 <enum-type name="QPrinter::OutputFormat"/>
255 <enum-type name="QPrinter::OutputFormat"/>
256 <enum-type name="QPrinter::PageOrder"/>
256 <enum-type name="QPrinter::PageOrder"/>
257 <enum-type name="QPrinter::PaperSource"/>
257 <enum-type name="QPrinter::PaperSource"/>
258 <enum-type name="QPrinter::PrintRange"/>
258 <enum-type name="QPrinter::PrintRange"/>
259 <enum-type name="QPrinter::PrinterMode"/>
259 <enum-type name="QPrinter::PrinterMode"/>
260 <enum-type name="QPrinter::PrinterState"/>
260 <enum-type name="QPrinter::PrinterState"/>
261 <enum-type name="QPrinter::Unit"/>
261 <enum-type name="QPrinter::Unit"/>
262 <enum-type name="QPrinter::DuplexMode"/>
262 <enum-type name="QPrinter::DuplexMode"/>
263 <enum-type name="QProgressBar::Direction"/>
263 <enum-type name="QProgressBar::Direction"/>
264 <enum-type name="QRegion::RegionType"/>
264 <enum-type name="QRegion::RegionType"/>
265 <enum-type name="QRubberBand::Shape"/>
265 <enum-type name="QRubberBand::Shape"/>
266 <enum-type name="QSessionManager::RestartHint"/>
266 <enum-type name="QSessionManager::RestartHint"/>
267 <enum-type name="QSizePolicy::Policy"/>
267 <enum-type name="QSizePolicy::Policy"/>
268 <enum-type name="QSizePolicy::PolicyFlag"/>
268 <enum-type name="QSizePolicy::PolicyFlag"/>
269 <enum-type name="QSizePolicy::ControlType" flags="QSizePolicy::ControlTypes"/>
269 <enum-type name="QSizePolicy::ControlType" flags="QSizePolicy::ControlTypes"/>
270 <enum-type name="QStandardItem::ItemType"/>
270 <enum-type name="QStandardItem::ItemType"/>
271 <enum-type name="QStyle::SubControl" flags="QStyle::SubControls" extensible="yes" force-integer="yes"/>
271 <enum-type name="QStyle::SubControl" flags="QStyle::SubControls" extensible="yes" force-integer="yes"/>
272 <enum-type name="QStyle::ComplexControl" extensible="yes"/>
272 <enum-type name="QStyle::ComplexControl" extensible="yes"/>
273 <enum-type name="QStyle::ContentsType" extensible="yes"/>
273 <enum-type name="QStyle::ContentsType" extensible="yes"/>
274 <enum-type name="QStyle::ControlElement" extensible="yes"/>
274 <enum-type name="QStyle::ControlElement" extensible="yes"/>
275 <enum-type name="QStyle::PixelMetric" extensible="yes">
275 <enum-type name="QStyle::PixelMetric" extensible="yes">
276 <reject-enum-value name="PM_MDIFrameWidth"/>
276 <reject-enum-value name="PM_MDIFrameWidth"/>
277 <reject-enum-value name="PM_MDIMinimizedWidth"/>
277 <reject-enum-value name="PM_MDIMinimizedWidth"/>
278 </enum-type>
278 </enum-type>
279 <enum-type name="QStyle::PrimitiveElement" extensible="yes">
279 <enum-type name="QStyle::PrimitiveElement" extensible="yes">
280 <reject-enum-value name="PE_IndicatorItemViewItemCheck"/>
280 <reject-enum-value name="PE_IndicatorItemViewItemCheck"/>
281 <reject-enum-value name="PE_FrameStatusBarItem"/>
281 <reject-enum-value name="PE_FrameStatusBarItem"/>
282 </enum-type>
282 </enum-type>
283 <enum-type name="QStyle::StandardPixmap" extensible="yes"/>
283 <enum-type name="QStyle::StandardPixmap" extensible="yes"/>
284 <enum-type name="QStyle::StateFlag" flags="QStyle::State"/>
284 <enum-type name="QStyle::StateFlag" flags="QStyle::State"/>
285 <enum-type name="QStyle::SubElement" extensible="yes">
285 <enum-type name="QStyle::SubElement" extensible="yes">
286 <reject-enum-value name="SE_ItemViewItemCheckIndicator"/>
286 <reject-enum-value name="SE_ItemViewItemCheckIndicator"/>
287 </enum-type>
287 </enum-type>
288 <enum-type name="QStyleHintReturn::HintReturnType"/>
288 <enum-type name="QStyleHintReturn::HintReturnType"/>
289 <enum-type name="QStyleHintReturn::StyleOptionType"/>
289 <enum-type name="QStyleHintReturn::StyleOptionType"/>
290 <enum-type name="QStyleHintReturn::StyleOptionVersion"/>
290 <enum-type name="QStyleHintReturn::StyleOptionVersion"/>
291 <enum-type name="QStyleHintReturnVariant::StyleOptionType"/>
291 <enum-type name="QStyleHintReturnVariant::StyleOptionType"/>
292 <enum-type name="QStyleHintReturnVariant::StyleOptionVersion"/>
292 <enum-type name="QStyleHintReturnVariant::StyleOptionVersion"/>
293
293
294 <enum-type name="QStyleHintReturnMask::StyleOptionType"/>
294 <enum-type name="QStyleHintReturnMask::StyleOptionType"/>
295 <enum-type name="QStyleHintReturnMask::StyleOptionVersion"/>
295 <enum-type name="QStyleHintReturnMask::StyleOptionVersion"/>
296 <enum-type name="QStyleOption::StyleOptionType"/>
296 <enum-type name="QStyleOption::StyleOptionType"/>
297 <enum-type name="QStyleOption::OptionType" extensible="yes"/>
297 <enum-type name="QStyleOption::OptionType" extensible="yes"/>
298 <enum-type name="QStyleOption::StyleOptionVersion"/>
298 <enum-type name="QStyleOption::StyleOptionVersion"/>
299 <enum-type name="QStyleOptionButton::ButtonFeature" flags="QStyleOptionButton::ButtonFeatures"/>
299 <enum-type name="QStyleOptionButton::ButtonFeature" flags="QStyleOptionButton::ButtonFeatures"/>
300 <enum-type name="QStyleOptionButton::StyleOptionType"/>
300 <enum-type name="QStyleOptionButton::StyleOptionType"/>
301 <enum-type name="QStyleOptionButton::StyleOptionVersion"/>
301 <enum-type name="QStyleOptionButton::StyleOptionVersion"/>
302 <enum-type name="QStyleOptionComboBox::StyleOptionType"/>
302 <enum-type name="QStyleOptionComboBox::StyleOptionType"/>
303 <enum-type name="QStyleOptionComboBox::StyleOptionVersion"/>
303 <enum-type name="QStyleOptionComboBox::StyleOptionVersion"/>
304 <enum-type name="QStyleOptionComplex::StyleOptionType"/>
304 <enum-type name="QStyleOptionComplex::StyleOptionType"/>
305 <enum-type name="QStyleOptionComplex::StyleOptionVersion"/>
305 <enum-type name="QStyleOptionComplex::StyleOptionVersion"/>
306 <enum-type name="QStyleOptionDockWidget::StyleOptionType"/>
306 <enum-type name="QStyleOptionDockWidget::StyleOptionType"/>
307 <enum-type name="QStyleOptionDockWidget::StyleOptionVersion"/>
307 <enum-type name="QStyleOptionDockWidget::StyleOptionVersion"/>
308 <enum-type name="QStyleOptionDockWidgetV2::StyleOptionVersion"/>
308 <enum-type name="QStyleOptionDockWidgetV2::StyleOptionVersion"/>
309 <enum-type name="QStyleOptionFocusRect::StyleOptionType"/>
309 <enum-type name="QStyleOptionFocusRect::StyleOptionType"/>
310 <enum-type name="QStyleOptionFocusRect::StyleOptionVersion"/>
310 <enum-type name="QStyleOptionFocusRect::StyleOptionVersion"/>
311 <enum-type name="QStyleOptionFrame::StyleOptionType"/>
311 <enum-type name="QStyleOptionFrame::StyleOptionType"/>
312 <enum-type name="QStyleOptionFrame::StyleOptionVersion"/>
312 <enum-type name="QStyleOptionFrame::StyleOptionVersion"/>
313 <enum-type name="QStyleOptionFrameV2::FrameFeature" flags="QStyleOptionFrameV2::FrameFeatures"/>
313 <enum-type name="QStyleOptionFrameV2::FrameFeature" flags="QStyleOptionFrameV2::FrameFeatures"/>
314 <enum-type name="QStyleOptionFrameV2::StyleOptionVersion"/>
314 <enum-type name="QStyleOptionFrameV2::StyleOptionVersion"/>
315 <enum-type name="QStyleOptionGraphicsItem::StyleOptionType"/>
315 <enum-type name="QStyleOptionGraphicsItem::StyleOptionType"/>
316 <enum-type name="QStyleOptionGraphicsItem::StyleOptionVersion"/>
316 <enum-type name="QStyleOptionGraphicsItem::StyleOptionVersion"/>
317 <enum-type name="QStyleOptionGroupBox::StyleOptionType"/>
317 <enum-type name="QStyleOptionGroupBox::StyleOptionType"/>
318 <enum-type name="QStyleOptionGroupBox::StyleOptionVersion"/>
318 <enum-type name="QStyleOptionGroupBox::StyleOptionVersion"/>
319 <enum-type name="QStyleOptionHeader::SectionPosition"/>
319 <enum-type name="QStyleOptionHeader::SectionPosition"/>
320 <enum-type name="QStyleOptionHeader::SelectedPosition"/>
320 <enum-type name="QStyleOptionHeader::SelectedPosition"/>
321 <enum-type name="QStyleOptionHeader::SortIndicator"/>
321 <enum-type name="QStyleOptionHeader::SortIndicator"/>
322 <enum-type name="QStyleOptionHeader::StyleOptionType"/>
322 <enum-type name="QStyleOptionHeader::StyleOptionType"/>
323 <enum-type name="QStyleOptionHeader::StyleOptionVersion"/>
323 <enum-type name="QStyleOptionHeader::StyleOptionVersion"/>
324 <enum-type name="QStyleOptionMenuItem::CheckType"/>
324 <enum-type name="QStyleOptionMenuItem::CheckType"/>
325 <enum-type name="QStyleOptionMenuItem::MenuItemType"/>
325 <enum-type name="QStyleOptionMenuItem::MenuItemType"/>
326 <enum-type name="QStyleOptionMenuItem::StyleOptionType"/>
326 <enum-type name="QStyleOptionMenuItem::StyleOptionType"/>
327 <enum-type name="QStyleOptionMenuItem::StyleOptionVersion"/>
327 <enum-type name="QStyleOptionMenuItem::StyleOptionVersion"/>
328 <enum-type name="QStyleOptionProgressBar::StyleOptionType"/>
328 <enum-type name="QStyleOptionProgressBar::StyleOptionType"/>
329 <enum-type name="QStyleOptionProgressBar::StyleOptionVersion"/>
329 <enum-type name="QStyleOptionProgressBar::StyleOptionVersion"/>
330 <enum-type name="QStyleOptionProgressBarV2::StyleOptionType"/>
330 <enum-type name="QStyleOptionProgressBarV2::StyleOptionType"/>
331 <enum-type name="QStyleOptionProgressBarV2::StyleOptionVersion"/>
331 <enum-type name="QStyleOptionProgressBarV2::StyleOptionVersion"/>
332 <enum-type name="QStyleOptionRubberBand::StyleOptionType"/>
332 <enum-type name="QStyleOptionRubberBand::StyleOptionType"/>
333 <enum-type name="QStyleOptionRubberBand::StyleOptionVersion"/>
333 <enum-type name="QStyleOptionRubberBand::StyleOptionVersion"/>
334 <enum-type name="QStyleOptionSizeGrip::StyleOptionType"/>
334 <enum-type name="QStyleOptionSizeGrip::StyleOptionType"/>
335 <enum-type name="QStyleOptionSizeGrip::StyleOptionVersion"/>
335 <enum-type name="QStyleOptionSizeGrip::StyleOptionVersion"/>
336 <enum-type name="QStyleOptionSlider::StyleOptionType"/>
336 <enum-type name="QStyleOptionSlider::StyleOptionType"/>
337 <enum-type name="QStyleOptionSlider::StyleOptionVersion"/>
337 <enum-type name="QStyleOptionSlider::StyleOptionVersion"/>
338 <enum-type name="QStyleOptionSpinBox::StyleOptionType"/>
338 <enum-type name="QStyleOptionSpinBox::StyleOptionType"/>
339 <enum-type name="QStyleOptionSpinBox::StyleOptionVersion"/>
339 <enum-type name="QStyleOptionSpinBox::StyleOptionVersion"/>
340 <enum-type name="QStyleOptionTab::CornerWidget" flags="QStyleOptionTab::CornerWidgets"/>
340 <enum-type name="QStyleOptionTab::CornerWidget" flags="QStyleOptionTab::CornerWidgets"/>
341 <enum-type name="QStyleOptionTab::SelectedPosition"/>
341 <enum-type name="QStyleOptionTab::SelectedPosition"/>
342 <enum-type name="QStyleOptionTab::StyleOptionType"/>
342 <enum-type name="QStyleOptionTab::StyleOptionType"/>
343 <enum-type name="QStyleOptionTab::StyleOptionVersion"/>
343 <enum-type name="QStyleOptionTab::StyleOptionVersion"/>
344 <enum-type name="QStyleOptionTab::TabPosition"/>
344 <enum-type name="QStyleOptionTab::TabPosition"/>
345 <enum-type name="QStyleOptionTabBarBase::StyleOptionType"/>
345 <enum-type name="QStyleOptionTabBarBase::StyleOptionType"/>
346 <enum-type name="QStyleOptionTabBarBase::StyleOptionVersion"/>
346 <enum-type name="QStyleOptionTabBarBase::StyleOptionVersion"/>
347 <enum-type name="QStyleOptionTabV2::StyleOptionVersion"/>
347 <enum-type name="QStyleOptionTabV2::StyleOptionVersion"/>
348 <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionType"/>
348 <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionType"/>
349 <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionVersion"/>
349 <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionVersion"/>
350 <enum-type name="QStyleOptionTitleBar::StyleOptionType"/>
350 <enum-type name="QStyleOptionTitleBar::StyleOptionType"/>
351 <enum-type name="QStyleOptionTitleBar::StyleOptionVersion"/>
351 <enum-type name="QStyleOptionTitleBar::StyleOptionVersion"/>
352 <enum-type name="QStyleOptionToolBar::StyleOptionType"/>
352 <enum-type name="QStyleOptionToolBar::StyleOptionType"/>
353 <enum-type name="QStyleOptionToolBar::StyleOptionVersion"/>
353 <enum-type name="QStyleOptionToolBar::StyleOptionVersion"/>
354 <enum-type name="QStyleOptionToolBar::ToolBarFeature" flags="QStyleOptionToolBar::ToolBarFeatures"/>
354 <enum-type name="QStyleOptionToolBar::ToolBarFeature" flags="QStyleOptionToolBar::ToolBarFeatures"/>
355 <enum-type name="QStyleOptionToolBar::ToolBarPosition"/>
355 <enum-type name="QStyleOptionToolBar::ToolBarPosition"/>
356 <enum-type name="QStyleOptionToolBox::StyleOptionType"/>
356 <enum-type name="QStyleOptionToolBox::StyleOptionType"/>
357 <enum-type name="QStyleOptionToolBox::StyleOptionVersion"/>
357 <enum-type name="QStyleOptionToolBox::StyleOptionVersion"/>
358 <enum-type name="QStyleOptionToolButton::StyleOptionType"/>
358 <enum-type name="QStyleOptionToolButton::StyleOptionType"/>
359 <enum-type name="QStyleOptionToolButton::StyleOptionVersion"/>
359 <enum-type name="QStyleOptionToolButton::StyleOptionVersion"/>
360 <enum-type name="QStyleOptionToolButton::ToolButtonFeature" flags="QStyleOptionToolButton::ToolButtonFeatures">
360 <enum-type name="QStyleOptionToolButton::ToolButtonFeature" flags="QStyleOptionToolButton::ToolButtonFeatures">
361 <reject-enum-value name="MenuButtonPopup"/>
361 <reject-enum-value name="MenuButtonPopup"/>
362 </enum-type>
362 </enum-type>
363 <enum-type name="QStyleOptionViewItem::Position"/>
363 <enum-type name="QStyleOptionViewItem::Position"/>
364 <enum-type name="QStyleOptionViewItem::StyleOptionType"/>
364 <enum-type name="QStyleOptionViewItem::StyleOptionType"/>
365 <enum-type name="QStyleOptionViewItem::StyleOptionVersion"/>
365 <enum-type name="QStyleOptionViewItem::StyleOptionVersion"/>
366 <enum-type name="QStyleOptionViewItemV2::StyleOptionVersion"/>
366 <enum-type name="QStyleOptionViewItemV2::StyleOptionVersion"/>
367 <enum-type name="QStyleOptionViewItemV2::ViewItemFeature" flags="QStyleOptionViewItemV2::ViewItemFeatures"/>
367 <enum-type name="QStyleOptionViewItemV2::ViewItemFeature" flags="QStyleOptionViewItemV2::ViewItemFeatures"/>
368 <enum-type name="QSystemTrayIcon::ActivationReason"/>
368 <enum-type name="QSystemTrayIcon::ActivationReason"/>
369 <enum-type name="QSystemTrayIcon::MessageIcon"/>
369 <enum-type name="QSystemTrayIcon::MessageIcon"/>
370 <enum-type name="QTabBar::Shape"/>
370 <enum-type name="QTabBar::Shape"/>
371 <enum-type name="QTabWidget::TabPosition"/>
371 <enum-type name="QTabWidget::TabPosition"/>
372 <enum-type name="QTabWidget::TabShape"/>
372 <enum-type name="QTabWidget::TabShape"/>
373 <enum-type name="QTableWidgetItem::ItemType"/>
373 <enum-type name="QTableWidgetItem::ItemType"/>
374 <enum-type name="QTabletEvent::PointerType"/>
374 <enum-type name="QTabletEvent::PointerType"/>
375 <enum-type name="QTabletEvent::TabletDevice"/>
375 <enum-type name="QTabletEvent::TabletDevice"/>
376 <enum-type name="QTextCharFormat::UnderlineStyle"/>
376 <enum-type name="QTextCharFormat::UnderlineStyle"/>
377 <enum-type name="QTextCharFormat::VerticalAlignment"/>
377 <enum-type name="QTextCharFormat::VerticalAlignment"/>
378 <enum-type name="QTextCursor::MoveMode"/>
378 <enum-type name="QTextCursor::MoveMode"/>
379 <enum-type name="QTextCursor::MoveOperation"/>
379 <enum-type name="QTextCursor::MoveOperation"/>
380 <enum-type name="QTextCursor::SelectionType"/>
380 <enum-type name="QTextCursor::SelectionType"/>
381 <enum-type name="QTextDocument::FindFlag" flags="QTextDocument::FindFlags"/>
381 <enum-type name="QTextDocument::FindFlag" flags="QTextDocument::FindFlags"/>
382 <enum-type name="QTextDocument::MetaInformation"/>
382 <enum-type name="QTextDocument::MetaInformation"/>
383 <enum-type name="QTextDocument::ResourceType"/>
383 <enum-type name="QTextDocument::ResourceType"/>
384 <enum-type name="QTextEdit::AutoFormattingFlag" flags="QTextEdit::AutoFormatting"/>
384 <enum-type name="QTextEdit::AutoFormattingFlag" flags="QTextEdit::AutoFormatting"/>
385 <enum-type name="QTextEdit::LineWrapMode"/>
385 <enum-type name="QTextEdit::LineWrapMode"/>
386 <enum-type name="QTextFormat::ObjectTypes"/>
386 <enum-type name="QTextFormat::ObjectTypes"/>
387 <enum-type name="QTextFormat::PageBreakFlag" flags="QTextFormat::PageBreakFlags"/>
387 <enum-type name="QTextFormat::PageBreakFlag" flags="QTextFormat::PageBreakFlags"/>
388 <enum-type name="QTextFrameFormat::Position"/>
388 <enum-type name="QTextFrameFormat::Position"/>
389 <enum-type name="QTextFrameFormat::BorderStyle"/>
389 <enum-type name="QTextFrameFormat::BorderStyle"/>
390 <enum-type name="QTextItem::RenderFlag" flags="QTextItem::RenderFlags"/>
390 <enum-type name="QTextItem::RenderFlag" flags="QTextItem::RenderFlags"/>
391 <enum-type name="QTextLayout::CursorMode"/>
391 <enum-type name="QTextLayout::CursorMode"/>
392 <enum-type name="QTextLength::Type"/>
392 <enum-type name="QTextLength::Type"/>
393 <enum-type name="QTextLine::CursorPosition"/>
393 <enum-type name="QTextLine::CursorPosition"/>
394 <enum-type name="QTextLine::Edge"/>
394 <enum-type name="QTextLine::Edge"/>
395 <enum-type name="QTextListFormat::Style"/>
395 <enum-type name="QTextListFormat::Style"/>
396 <enum-type name="QTextOption::Flag" flags="QTextOption::Flags"/>
396 <enum-type name="QTextOption::Flag" flags="QTextOption::Flags"/>
397 <enum-type name="QTextOption::WrapMode"/>
397 <enum-type name="QTextOption::WrapMode"/>
398 <enum-type name="QTextOption::TabType"/>
398 <enum-type name="QTextOption::TabType"/>
399 <enum-type name="QToolButton::ToolButtonPopupMode"/>
399 <enum-type name="QToolButton::ToolButtonPopupMode"/>
400 <enum-type name="QTreeWidgetItem::ItemType"/>
400 <enum-type name="QTreeWidgetItem::ItemType"/>
401 <enum-type name="QTreeWidgetItemIterator::IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
401 <enum-type name="QTreeWidgetItemIterator::IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
402 <enum-type name="QValidator::State"/>
402 <enum-type name="QValidator::State"/>
403 <enum-type name="QWidget::RenderFlag" flags="QWidget::RenderFlags"/>
403 <enum-type name="QWidget::RenderFlag" flags="QWidget::RenderFlags"/>
404 <enum-type name="QWorkspace::WindowOrder"/>
404 <enum-type name="QWorkspace::WindowOrder"/>
405 <enum-type name="QDoubleValidator::Notation"/>
405 <enum-type name="QDoubleValidator::Notation"/>
406 <enum-type name="QGraphicsScene::SceneLayer" flags="QGraphicsScene::SceneLayers"/>
406 <enum-type name="QGraphicsScene::SceneLayer" flags="QGraphicsScene::SceneLayers"/>
407 <enum-type name="QStyleOptionToolBoxV2::SelectedPosition"/>
407 <enum-type name="QStyleOptionToolBoxV2::SelectedPosition"/>
408 <enum-type name="QStyleOptionToolBoxV2::StyleOptionVersion"/>
408 <enum-type name="QStyleOptionToolBoxV2::StyleOptionVersion"/>
409 <enum-type name="QStyleOptionToolBoxV2::TabPosition"/>
409 <enum-type name="QStyleOptionToolBoxV2::TabPosition"/>
410 <enum-type name="QStyleOptionViewItemV3::StyleOptionVersion"/>
410 <enum-type name="QStyleOptionViewItemV3::StyleOptionVersion"/>
411 <enum-type name="QTransform::TransformationType"/>
411 <enum-type name="QTransform::TransformationType"/>
412 <enum-type name="QTreeWidgetItem::ChildIndicatorPolicy"/>
412 <enum-type name="QTreeWidgetItem::ChildIndicatorPolicy"/>
413 <enum-type name="QWizard::WizardOption" flags="QWizard::WizardOptions"/>
413 <enum-type name="QWizard::WizardOption" flags="QWizard::WizardOptions"/>
414 <enum-type name="QWizard::WizardPixmap"/>
414 <enum-type name="QWizard::WizardPixmap"/>
415 <enum-type name="QWizard::WizardStyle"/>
415 <enum-type name="QWizard::WizardStyle"/>
416 <enum-type name="QImageIOPlugin::Capability" flags="QImageIOPlugin::Capabilities"/>
416 <enum-type name="QImageIOPlugin::Capability" flags="QImageIOPlugin::Capabilities"/>
417 <enum-type name="QStackedLayout::StackingMode"/>
417 <enum-type name="QStackedLayout::StackingMode"/>
418
418
419 <enum-type name="QWizard::WizardButton">
419 <enum-type name="QWizard::WizardButton">
420 <reject-enum-value name="NStandardButtons"/>
420 <reject-enum-value name="NStandardButtons"/>
421 <reject-enum-value name="NButtons"/>
421 <reject-enum-value name="NButtons"/>
422 </enum-type>
422 </enum-type>
423
423
424 <enum-type name="QAccessible::Action">
424 <enum-type name="QAccessible::Action">
425 <reject-enum-value name="FirstStandardAction"/>
425 <reject-enum-value name="FirstStandardAction"/>
426 <reject-enum-value name="LastStandardAction"/>
426 <reject-enum-value name="LastStandardAction"/>
427 </enum-type>
427 </enum-type>
428
428
429 <enum-type name="QBoxLayout::Direction">
429 <enum-type name="QBoxLayout::Direction">
430 <reject-enum-value name="Down"/>
430 <reject-enum-value name="Down"/>
431 <reject-enum-value name="Up"/>
431 <reject-enum-value name="Up"/>
432 </enum-type>
432 </enum-type>
433
433
434
434
435 <enum-type name="QClipboard::Mode">
435 <enum-type name="QClipboard::Mode">
436 <reject-enum-value name="LastMode"/>
436 <reject-enum-value name="LastMode"/>
437 </enum-type>
437 </enum-type>
438
438
439 <enum-type name="QDialogButtonBox::StandardButton" flags="QDialogButtonBox::StandardButtons">
439 <enum-type name="QDialogButtonBox::StandardButton" flags="QDialogButtonBox::StandardButtons">
440 <reject-enum-value name="FirstButton"/>
440 <reject-enum-value name="FirstButton"/>
441 <reject-enum-value name="LastButton"/>
441 <reject-enum-value name="LastButton"/>
442 <reject-enum-value name="YesAll"/>
442 <reject-enum-value name="YesAll"/>
443 <reject-enum-value name="NoAll"/>
443 <reject-enum-value name="NoAll"/>
444 <reject-enum-value name="Default"/>
444 <reject-enum-value name="Default"/>
445 <reject-enum-value name="Escape"/>
445 <reject-enum-value name="Escape"/>
446 <reject-enum-value name="FlagMask"/>
446 <reject-enum-value name="FlagMask"/>
447 <reject-enum-value name="ButtonMask"/>
447 <reject-enum-value name="ButtonMask"/>
448 </enum-type>
448 </enum-type>
449
449
450 <enum-type name="QDockWidget::DockWidgetFeature" flags="QDockWidget::DockWidgetFeatures"/>
450 <enum-type name="QDockWidget::DockWidgetFeature" flags="QDockWidget::DockWidgetFeatures"/>
451
451
452 <enum-type name="QFont::StyleHint">
452 <enum-type name="QFont::StyleHint">
453 <reject-enum-value name="SansSerif"/>
453 <reject-enum-value name="SansSerif"/>
454 <reject-enum-value name="Serif"/>
454 <reject-enum-value name="Serif"/>
455 <reject-enum-value name="TypeWriter"/>
455 <reject-enum-value name="TypeWriter"/>
456 <reject-enum-value name="Decorative"/>
456 <reject-enum-value name="Decorative"/>
457 </enum-type>
457 </enum-type>
458
458
459 <enum-type name="QFontDatabase::WritingSystem">
459 <enum-type name="QFontDatabase::WritingSystem">
460 <reject-enum-value name="Other"/>
460 <reject-enum-value name="Other"/>
461 </enum-type>
461 </enum-type>
462
462
463 <enum-type name="QHeaderView::ResizeMode">
463 <enum-type name="QHeaderView::ResizeMode">
464 <reject-enum-value name="Custom"/>
464 <reject-enum-value name="Custom"/>
465 </enum-type>
465 </enum-type>
466
466
467
467
468 <enum-type name="QMessageBox::StandardButton" flags="QMessageBox::StandardButtons">
468 <enum-type name="QMessageBox::StandardButton" flags="QMessageBox::StandardButtons">
469 <reject-enum-value name="FirstButton"/>
469 <reject-enum-value name="FirstButton"/>
470 <reject-enum-value name="LastButton"/>
470 <reject-enum-value name="LastButton"/>
471 <reject-enum-value name="YesAll"/>
471 <reject-enum-value name="YesAll"/>
472 <reject-enum-value name="NoAll"/>
472 <reject-enum-value name="NoAll"/>
473 </enum-type>
473 </enum-type>
474
474
475 <enum-type name="QPalette::ColorGroup">
475 <enum-type name="QPalette::ColorGroup">
476 <reject-enum-value name="Normal"/>
476 <reject-enum-value name="Normal"/>
477 </enum-type>
477 </enum-type>
478
478
479 <enum-type name="QPalette::ColorRole">
479 <enum-type name="QPalette::ColorRole">
480 <reject-enum-value name="NColorRoles"/>
480 <reject-enum-value name="NColorRoles"/>
481 <reject-enum-value name="Foreground"/>
481 <reject-enum-value name="Foreground"/>
482 <reject-enum-value name="Background"/>
482 <reject-enum-value name="Background"/>
483 </enum-type>
483 </enum-type>
484
484
485 <enum-type name="QPrinter::PageSize">
485 <enum-type name="QPrinter::PageSize">
486 <reject-enum-value name="NPageSize"/>
486 <reject-enum-value name="NPageSize"/>
487 <reject-enum-value name="NPaperSize"/>
487 <reject-enum-value name="NPaperSize"/>
488 </enum-type>
488 </enum-type>
489
489
490 <enum-type name="QSlider::TickPosition">
490 <enum-type name="QSlider::TickPosition">
491 <reject-enum-value name="TicksLeft"/>
491 <reject-enum-value name="TicksLeft"/>
492 <reject-enum-value name="TicksRight"/>
492 <reject-enum-value name="TicksRight"/>
493 </enum-type>
493 </enum-type>
494
494
495 <enum-type name="QStyle::StyleHint" extensible="yes">
495 <enum-type name="QStyle::StyleHint" extensible="yes">
496 <reject-enum-value name="SH_ScrollBar_StopMouseOverSlider"/>
496 <reject-enum-value name="SH_ScrollBar_StopMouseOverSlider"/>
497 </enum-type>
497 </enum-type>
498
498
499
499
500 <enum-type name="QTextFormat::FormatType"/>
500 <enum-type name="QTextFormat::FormatType"/>
501
501
502 <enum-type name="QTextFormat::Property">
502 <enum-type name="QTextFormat::Property">
503 <reject-enum-value name="FontSizeIncrement"/>
503 <reject-enum-value name="FontSizeIncrement"/>
504 <reject-enum-value name="FirstFontProperty"/>
504 <reject-enum-value name="FirstFontProperty"/>
505 <reject-enum-value name="LastFontProperty"/>
505 <reject-enum-value name="LastFontProperty"/>
506 </enum-type>
506 </enum-type>
507
507
508 <enum-type name="QAction::Priority"/>
508 <enum-type name="QAction::Priority"/>
509 <enum-type name="QAction::SoftKeyRole"/>
509 <enum-type name="QAction::SoftKeyRole"/>
510 <enum-type name="QGraphicsEffect::ChangeFlag" flags="QGraphicsEffect::ChangeFlags"/>
510 <enum-type name="QGraphicsEffect::ChangeFlag" flags="QGraphicsEffect::ChangeFlags"/>
511 <enum-type name="QGraphicsItem::PanelModality"/>
511 <enum-type name="QGraphicsItem::PanelModality"/>
512 <enum-type name="QPinchGesture::WhatChange" flags="QPinchGesture::WhatChanged"/>
512 <enum-type name="QPinchGesture::WhatChange" flags="QPinchGesture::WhatChanged"/>
513 <enum-type name="QPinchGesture::ChangeFlag" flags="QPinchGesture::ChangeFlags"/>
513 <enum-type name="QPinchGesture::ChangeFlag" flags="QPinchGesture::ChangeFlags"/>
514 <enum-type name="QGraphicsBlurEffect::BlurHint" flags="QGraphicsBlurEffect::BlurHints"/>
514 <enum-type name="QGraphicsBlurEffect::BlurHint" flags="QGraphicsBlurEffect::BlurHints"/>
515 <enum-type name="QGraphicsEffect::PixmapPadMode"/>
515 <enum-type name="QGraphicsEffect::PixmapPadMode"/>
516 <enum-type name="QGestureRecognizer::ResultFlag" flags="QGestureRecognizer::Result"/>
516 <enum-type name="QGestureRecognizer::ResultFlag" flags="QGestureRecognizer::Result"/>
517 <enum-type name="QGestureRecognizer::LineHeightTypes"/>
517 <enum-type name="QGestureRecognizer::LineHeightTypes"/>
518 <enum-type name="QStyle::RequestSoftwareInputPanel"/>
518 <enum-type name="QStyle::RequestSoftwareInputPanel"/>
519 <enum-type name="QSwipeGesture::SwipeDirection"/>
519 <enum-type name="QSwipeGesture::SwipeDirection"/>
520 <enum-type name="QTouchEvent::DeviceType"/>
520 <enum-type name="QTouchEvent::DeviceType"/>
521 <enum-type name="QFont::HintingPreference"/>
521 <enum-type name="QFont::HintingPreference"/>
522 <enum-type name="QGesture::GestureCancelPolicy"/>
522 <enum-type name="QGesture::GestureCancelPolicy"/>
523 <enum-type name="QTextDocument::Stacks"/>
523 <enum-type name="QTextDocument::Stacks"/>
524 <enum-type name="QPainter::PixmapFragmentHint"/>
524 <enum-type name="QPainter::PixmapFragmentHint"/>
525
525
526 <object-type name="QAbstractProxyModel"/>
526 <object-type name="QAbstractProxyModel"/>
527 <object-type name="QDirModel"/>
527 <object-type name="QDirModel"/>
528 <object-type name="QFileSystemModel"/>
528 <object-type name="QFileSystemModel"/>
529 <object-type name="QPrinterInfo"/>
529 <object-type name="QPrinterInfo"/>
530 <object-type name="QSortFilterProxyModel"/>
530 <object-type name="QSortFilterProxyModel"/>
531 <object-type name="QProxyModel"/>
531 <object-type name="QProxyModel"/>
532 <object-type name="QTextOption"/>
532 <object-type name="QTextOption"/>
533 <object-type name="QFontDatabase"/>
533 <object-type name="QFontDatabase"/>
534 <object-type name="QGestureRecognizer" force-abstract="yes"/>
534 <object-type name="QGestureRecognizer" force-abstract="yes"/>
535
535
536 <value-type name="QPixmapCache::Key"/>
536 <value-type name="QPixmapCache::Key"/>
537 <value-type name="QTileRules"/>
537 <value-type name="QTileRules"/>
538 <value-type name="QVector2D"/>
538 <value-type name="QVector2D"/>
539 <value-type name="QVector3D"/>
539 <value-type name="QVector3D"/>
540 <value-type name="QVector4D"/>
540 <value-type name="QVector4D"/>
541 <value-type name="QTouchEvent::TouchPoint"/>
541 <value-type name="QTouchEvent::TouchPoint"/>
542
542
543
543
544 <value-type name="QTransform">
544 <value-type name="QTransform">
545 <modify-function signature="operator=(QTransform)" remove="all"/>
545 <modify-function signature="operator=(QTransform)" remove="all"/>
546 <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
546 <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
547 <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
547 <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
548
548
549 <modify-function signature="operator*=(double)" access="private"/>
549 <modify-function signature="operator*=(double)" access="private"/>
550 <modify-function signature="operator+=(double)" access="private"/>
550 <modify-function signature="operator+=(double)" access="private"/>
551 <modify-function signature="operator-=(double)" access="private"/>
551 <modify-function signature="operator-=(double)" access="private"/>
552 <modify-function signature="operator/=(double)" access="private"/>
552 <modify-function signature="operator/=(double)" access="private"/>
553 <modify-function signature="operator*(QTransform)const" rename="multiplied"/>
553 <modify-function signature="operator*(QTransform)const" rename="multiplied"/>
554 <modify-function signature="operator*=(QTransform)" access="private"/>
554 <modify-function signature="operator*=(QTransform)" access="private"/>
555
555
556 <modify-function signature="inverted(bool*)const">
556 <modify-function signature="inverted(bool*)const">
557 <modify-argument index="1">
557 <modify-argument index="1">
558 <remove-argument/>
558 <remove-argument/>
559 </modify-argument>
559 </modify-argument>
560 </modify-function>
560 </modify-function>
561 </value-type>
561 </value-type>
562
562
563 <value-type name="QStyleOption" delete-in-main-thread="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type == QStyleOption::SO_Default">
563 <value-type name="QStyleOption" delete-in-main-thread="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type == QStyleOption::SO_Default">
564 <modify-function signature="operator=(QStyleOption)" remove="all"/>
564 <modify-function signature="operator=(QStyleOption)" remove="all"/>
565 <modify-function signature="init(const QWidget*)" remove="all"/> <!--### Obsolete in 4.3-->
565 <modify-function signature="init(const QWidget*)" remove="all"/> <!--### Obsolete in 4.3-->
566 </value-type>
566 </value-type>
567 <value-type name="QStyleOptionGraphicsItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGraphicsItem::Type &amp;&amp; %1-&gt;version == QStyleOptionGraphicsItem::Version"/>
567 <value-type name="QStyleOptionGraphicsItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGraphicsItem::Type &amp;&amp; %1-&gt;version == QStyleOptionGraphicsItem::Version"/>
568 <value-type name="QStyleOptionSizeGrip" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSizeGrip::Type &amp;&amp; %1-&gt;version == QStyleOptionSizeGrip::Version"/>
568 <value-type name="QStyleOptionSizeGrip" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSizeGrip::Type &amp;&amp; %1-&gt;version == QStyleOptionSizeGrip::Version"/>
569 <value-type name="QStyleOptionButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionButton::Type &amp;&amp; %1-&gt;version == QStyleOptionButton::Version"/>
569 <value-type name="QStyleOptionButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionButton::Type &amp;&amp; %1-&gt;version == QStyleOptionButton::Version"/>
570 <value-type name="QStyleOptionComboBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComboBox::Type &amp;&amp; %1-&gt;version == QStyleOptionComboBox::Version"/>
570 <value-type name="QStyleOptionComboBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComboBox::Type &amp;&amp; %1-&gt;version == QStyleOptionComboBox::Version"/>
571 <value-type name="QStyleOptionComplex" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComplex::Type &amp;&amp; %1-&gt;version == QStyleOptionComplex::Version"/>
571 <value-type name="QStyleOptionComplex" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionComplex::Type &amp;&amp; %1-&gt;version == QStyleOptionComplex::Version"/>
572 <value-type name="QStyleOptionDockWidget" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidget::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidget::Version"/>
572 <value-type name="QStyleOptionDockWidget" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidget::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidget::Version"/>
573 <value-type name="QStyleOptionDockWidgetV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidgetV2::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidgetV2::Version">
573 <value-type name="QStyleOptionDockWidgetV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionDockWidgetV2::Type &amp;&amp; %1-&gt;version == QStyleOptionDockWidgetV2::Version">
574 <modify-function signature="operator=(QStyleOptionDockWidget)" remove="all"/>
574 <modify-function signature="operator=(QStyleOptionDockWidget)" remove="all"/>
575 </value-type>
575 </value-type>
576 <value-type name="QStyleOptionFocusRect" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFocusRect::Type &amp;&amp; %1-&gt;version == QStyleOptionFocusRect::Version"/>
576 <value-type name="QStyleOptionFocusRect" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFocusRect::Type &amp;&amp; %1-&gt;version == QStyleOptionFocusRect::Version"/>
577 <value-type name="QStyleOptionFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionFrame::Version"/>
577 <value-type name="QStyleOptionFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionFrame::Version"/>
578
578
579 <value-type name="QStyleOptionFrameV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrameV2::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV2::Version">
579 <value-type name="QStyleOptionFrameV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrameV2::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV2::Version">
580 <modify-function signature="operator=(QStyleOptionFrame)" remove="all"/>
580 <modify-function signature="operator=(QStyleOptionFrame)" remove="all"/>
581 </value-type>
581 </value-type>
582 <value-type name="QStyleOptionFrameV3" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrameV3::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV3::Version">
582 <value-type name="QStyleOptionFrameV3" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionFrameV3::Type &amp;&amp; %1-&gt;version == QStyleOptionFrameV3::Version">
583 <modify-function signature="operator=(QStyleOptionFrame)" remove="all"/>
583 <modify-function signature="operator=(QStyleOptionFrame)" remove="all"/>
584 </value-type>
584 </value-type>
585
585
586 <value-type name="QStyleOptionGroupBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGroupBox::Type &amp;&amp; %1-&gt;version == QStyleOptionGroupBox::Version"/>
586 <value-type name="QStyleOptionGroupBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionGroupBox::Type &amp;&amp; %1-&gt;version == QStyleOptionGroupBox::Version"/>
587 <value-type name="QStyleOptionHeader" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionHeader::Type &amp;&amp; %1-&gt;version == QStyleOptionHeader::Version"/>
587 <value-type name="QStyleOptionHeader" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionHeader::Type &amp;&amp; %1-&gt;version == QStyleOptionHeader::Version"/>
588 <value-type name="QStyleOptionMenuItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionMenuItem::Type &amp;&amp; %1-&gt;version == QStyleOptionMenuItem::Version"/>
588 <value-type name="QStyleOptionMenuItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionMenuItem::Type &amp;&amp; %1-&gt;version == QStyleOptionMenuItem::Version"/>
589 <value-type name="QStyleOptionProgressBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBar::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBar::Version"/>
589 <value-type name="QStyleOptionProgressBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBar::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBar::Version"/>
590
590
591 <value-type name="QStyleOptionProgressBarV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBarV2::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBarV2::Version">
591 <value-type name="QStyleOptionProgressBarV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionProgressBarV2::Type &amp;&amp; %1-&gt;version == QStyleOptionProgressBarV2::Version">
592 <modify-function signature="operator=(QStyleOptionProgressBar)" remove="all"/>
592 <modify-function signature="operator=(QStyleOptionProgressBar)" remove="all"/>
593 </value-type>
593 </value-type>
594
594
595 <value-type name="QStyleOptionRubberBand" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionRubberBand::Type &amp;&amp; %1-&gt;version == QStyleOptionRubberBand::Version"/>
595 <value-type name="QStyleOptionRubberBand" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionRubberBand::Type &amp;&amp; %1-&gt;version == QStyleOptionRubberBand::Version"/>
596 <value-type name="QStyleOptionSlider" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSlider::Type &amp;&amp; %1-&gt;version == QStyleOptionSlider::Version"/>
596 <value-type name="QStyleOptionSlider" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSlider::Type &amp;&amp; %1-&gt;version == QStyleOptionSlider::Version"/>
597 <value-type name="QStyleOptionSpinBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSpinBox::Type &amp;&amp; %1-&gt;version == QStyleOptionSpinBox::Version"/>
597 <value-type name="QStyleOptionSpinBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionSpinBox::Type &amp;&amp; %1-&gt;version == QStyleOptionSpinBox::Version"/>
598 <value-type name="QStyleOptionTab" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTab::Type &amp;&amp; %1-&gt;version == QStyleOptionTab::Version"/>
598 <value-type name="QStyleOptionTab" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTab::Type &amp;&amp; %1-&gt;version == QStyleOptionTab::Version"/>
599 <value-type name="QStyleOptionTabV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV2::Version">
599 <value-type name="QStyleOptionTabV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV2::Version">
600 <modify-function signature="operator=(const QStyleOptionTab &amp;)" remove="all"/>
600 <modify-function signature="operator=(const QStyleOptionTab &amp;)" remove="all"/>
601 </value-type>
601 </value-type>
602 <value-type name="QStyleOptionTabV3" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabV3::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV3::Version">
602 <value-type name="QStyleOptionTabV3" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabV3::Type &amp;&amp; %1-&gt;version == QStyleOptionTabV3::Version">
603 <modify-function signature="operator=(QStyleOptionTab)" remove="all"/>
603 <modify-function signature="operator=(QStyleOptionTab)" remove="all"/>
604 </value-type>
604 </value-type>
605 <value-type name="QStyleOptionTabBarBase" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBase::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBase::Version"/>
605 <value-type name="QStyleOptionTabBarBase" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBase::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBase::Version"/>
606 <value-type name="QStyleOptionTabBarBaseV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBaseV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBaseV2::Version">
606 <value-type name="QStyleOptionTabBarBaseV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabBarBaseV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabBarBaseV2::Version">
607 <modify-function signature="operator=(QStyleOptionTabBarBase)" remove="all"/>
607 <modify-function signature="operator=(QStyleOptionTabBarBase)" remove="all"/>
608 </value-type>
608 </value-type>
609 <value-type name="QStyleOptionTabWidgetFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabWidgetFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrame::Version"/>
609 <value-type name="QStyleOptionTabWidgetFrame" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabWidgetFrame::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrame::Version"/>
610 <value-type name="QStyleOptionTabWidgetFrameV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabWidgetFrameV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrameV2::Version"/>
610 <value-type name="QStyleOptionTabWidgetFrameV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTabWidgetFrameV2::Type &amp;&amp; %1-&gt;version == QStyleOptionTabWidgetFrameV2::Version"/>
611 <value-type name="QStyleOptionTitleBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTitleBar::Type &amp;&amp; %1-&gt;version == QStyleOptionTitleBar::Version"/>
611 <value-type name="QStyleOptionTitleBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionTitleBar::Type &amp;&amp; %1-&gt;version == QStyleOptionTitleBar::Version"/>
612 <value-type name="QStyleOptionToolBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBar::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBar::Version"/>
612 <value-type name="QStyleOptionToolBar" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBar::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBar::Version"/>
613 <value-type name="QStyleOptionToolBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBox::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBox::Version"/>
613 <value-type name="QStyleOptionToolBox" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBox::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBox::Version"/>
614 <value-type name="QStyleOptionToolBoxV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBoxV2::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBoxV2::Version">
614 <value-type name="QStyleOptionToolBoxV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolBoxV2::Type &amp;&amp; %1-&gt;version == QStyleOptionToolBoxV2::Version">
615 <modify-function signature="operator=(QStyleOptionToolBox)" remove="all"/>
615 <modify-function signature="operator=(QStyleOptionToolBox)" remove="all"/>
616 </value-type>
616 </value-type>
617 <value-type name="QStyleOptionToolButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolButton::Type &amp;&amp; %1-&gt;version == QStyleOptionToolButton::Version"/>
617 <value-type name="QStyleOptionToolButton" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionToolButton::Type &amp;&amp; %1-&gt;version == QStyleOptionToolButton::Version"/>
618 <value-type name="QStyleOptionViewItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItem::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItem::Version"/>
618 <value-type name="QStyleOptionViewItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItem::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItem::Version"/>
619 <value-type name="QStyleOptionViewItemV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV2::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV2::Version">
619 <value-type name="QStyleOptionViewItemV2" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV2::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV2::Version">
620 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
620 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
621 </value-type>
621 </value-type>
622 <value-type name="QStyleOptionViewItemV3" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV3::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV3::Version">
622 <value-type name="QStyleOptionViewItemV3" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV3::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV3::Version">
623 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
623 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
624 </value-type>
624 </value-type>
625 <value-type name="QStyleOptionViewItemV4" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV4::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV4::Version">
625 <value-type name="QStyleOptionViewItemV4" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type == QStyleOptionViewItemV4::Type &amp;&amp; %1-&gt;version == QStyleOptionViewItemV4::Version">
626 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
626 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
627 </value-type>
627 </value-type>
628 <value-type name="QTextFragment" delete-in-main-thread="yes">
628 <value-type name="QTextFragment" delete-in-main-thread="yes">
629 <modify-function signature="operator=(QTextFragment)" remove="all"/>
629 <modify-function signature="operator=(QTextFragment)" remove="all"/>
630 </value-type>
630 </value-type>
631 <value-type name="QBitmap" delete-in-main-thread="yes">
631 <value-type name="QBitmap" delete-in-main-thread="yes">
632 <modify-function signature="operator=(const QPixmap &amp;)" remove="all"/>
632 <modify-function signature="operator=(const QPixmap &amp;)" remove="all"/>
633 <modify-function signature="QBitmap(QString,const char*)" access="private">
633 <modify-function signature="QBitmap(QString,const char*)" access="private">
634 <modify-argument index="2"> <remove-default-expression/> </modify-argument>
634 <modify-argument index="2"> <remove-default-expression/> </modify-argument>
635 </modify-function>
635 </modify-function>
636
636
637 <modify-function signature="fromData(QSize,const unsigned char*,QImage::Format)">
637 <modify-function signature="fromData(QSize,const unsigned char*,QImage::Format)">
638 <access modifier="private"/>
638 <access modifier="private"/>
639 <modify-argument index="3">
639 <modify-argument index="3">
640 <remove-default-expression/>
640 <remove-default-expression/>
641 </modify-argument>
641 </modify-argument>
642 </modify-function>
642 </modify-function>
643
643
644 <modify-function signature="fromData(QSize,const uchar*,QImage::Format)" remove="all"/>
644 <modify-function signature="fromData(QSize,const uchar*,QImage::Format)" remove="all"/>
645
645
646 <modify-function signature="QBitmap(QString,const char*)">
646 <modify-function signature="QBitmap(QString,const char*)">
647 <modify-argument index="2">
647 <modify-argument index="2">
648 <replace-type modified-type="QString"/>
648 <replace-type modified-type="QString"/>
649 <conversion-rule class="native">
649 <conversion-rule class="native">
650 <insert-template name="core.convert_string_arg_to_char*"/>
650 <insert-template name="core.convert_string_arg_to_char*"/>
651 </conversion-rule>
651 </conversion-rule>
652 </modify-argument>
652 </modify-argument>
653 </modify-function>
653 </modify-function>
654 </value-type>
654 </value-type>
655 <value-type name="QTextInlineObject" delete-in-main-thread="yes"/>
655 <value-type name="QTextInlineObject" delete-in-main-thread="yes"/>
656 <value-type name="QSizePolicy"/>
656 <value-type name="QSizePolicy"/>
657 <value-type name="QTableWidgetSelectionRange"/>
657 <value-type name="QTableWidgetSelectionRange"/>
658 <value-type name="QTextDocumentFragment" delete-in-main-thread="yes">
658 <value-type name="QTextDocumentFragment" delete-in-main-thread="yes">
659 <modify-function signature="operator=(QTextDocumentFragment)" remove="all"/>
659 <modify-function signature="operator=(QTextDocumentFragment)" remove="all"/>
660 </value-type>
660 </value-type>
661 <value-type name="QTextOption" delete-in-main-thread="yes">
661 <value-type name="QTextOption" delete-in-main-thread="yes">
662 <modify-function signature="operator=(const QTextOption &amp;)" remove="all"/>
662 <modify-function signature="operator=(const QTextOption &amp;)" remove="all"/>
663 </value-type>
663 </value-type>
664 <value-type name="QTextLine" delete-in-main-thread="yes">
664 <value-type name="QTextLine" delete-in-main-thread="yes">
665 <modify-function signature="cursorToX(int*,QTextLine::Edge)const">
665 <modify-function signature="cursorToX(int*,QTextLine::Edge)const">
666 <remove/>
666 <remove/>
667 </modify-function>
667 </modify-function>
668 </value-type>
668 </value-type>
669 <value-type name="QTextTableFormat" delete-in-main-thread="yes"/>
669 <value-type name="QTextTableFormat" delete-in-main-thread="yes"/>
670 <value-type name="QTextImageFormat" delete-in-main-thread="yes"/>
670 <value-type name="QTextImageFormat" delete-in-main-thread="yes"/>
671 <value-type name="QTextFrameFormat" delete-in-main-thread="yes">
671 <value-type name="QTextFrameFormat" delete-in-main-thread="yes">
672 <modify-function signature="isValid()const" access="non-final"/>
672 <modify-function signature="isValid()const" access="non-final"/>
673 </value-type>
673 </value-type>
674 <value-type name="QTextLength" delete-in-main-thread="yes"/>
674 <value-type name="QTextLength" delete-in-main-thread="yes"/>
675 <value-type name="QItemSelectionRange">
675 <value-type name="QItemSelectionRange">
676 <modify-function signature="intersect(QItemSelectionRange)const" remove="all"/> <!--### Obsolete in 4.3-->
676 <modify-function signature="intersect(QItemSelectionRange)const" remove="all"/> <!--### Obsolete in 4.3-->
677 </value-type>
677 </value-type>
678
678
679 <value-type name="QPainterPath">
679 <value-type name="QPainterPath">
680 <modify-function signature="operator=(QPainterPath)" remove="all"/>
680 <modify-function signature="operator=(QPainterPath)" remove="all"/>
681 </value-type>
681 </value-type>
682 <value-type name="QPalette">
682 <value-type name="QPalette">
683 <modify-function signature="operator=(const QPalette&amp;)" remove="all"/>
683 <modify-function signature="operator=(const QPalette&amp;)" remove="all"/>
684
684
685 <modify-function signature="QPalette(QColor, QColor, QColor, QColor, QColor, QColor, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
685 <modify-function signature="QPalette(QColor, QColor, QColor, QColor, QColor, QColor, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
686 <modify-function signature="background()const" remove="all"/> <!--### Obsolete in 4.3-->
686 <modify-function signature="background()const" remove="all"/> <!--### Obsolete in 4.3-->
687 <modify-function signature="foreground()const" remove="all"/> <!--### Obsolete in 4.3-->
687 <modify-function signature="foreground()const" remove="all"/> <!--### Obsolete in 4.3-->
688 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
688 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
689 </value-type>
689 </value-type>
690 <value-type name="QKeySequence">
690 <value-type name="QKeySequence">
691 <modify-function signature="operator=(QKeySequence)" remove="all"/>
691 <modify-function signature="operator=(QKeySequence)" remove="all"/>
692 <modify-function signature="operator int()const" access="private"/>
692 <modify-function signature="operator int()const" access="private"/>
693 <modify-function signature="operator[](uint)const" access="private"/>
693 <modify-function signature="operator[](uint)const" access="private"/>
694 </value-type>
694 </value-type>
695
695
696 <value-type name="QPicture" delete-in-main-thread="yes">
696 <value-type name="QPicture" delete-in-main-thread="yes">
697 <modify-function signature="operator=(QPicture)" remove="all"/>
697 <modify-function signature="operator=(QPicture)" remove="all"/>
698 <modify-function signature="pictureFormat(QString)">
698 <modify-function signature="pictureFormat(QString)">
699 <remove/>
699 <remove/>
700 </modify-function>
700 </modify-function>
701
701
702 <modify-function signature="inputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
702 <modify-function signature="inputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
703 <modify-function signature="inputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
703 <modify-function signature="inputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
704 <modify-function signature="outputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
704 <modify-function signature="outputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
705 <modify-function signature="outputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
705 <modify-function signature="outputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
706
706
707 <modify-function signature="setData(const char*,uint)" remove="all"/>
707 <modify-function signature="setData(const char*,uint)" remove="all"/>
708
708
709 <modify-function signature="load(QIODevice*,const char*)">
709 <modify-function signature="load(QIODevice*,const char*)">
710 <modify-argument index="2">
710 <modify-argument index="2">
711 <replace-type modified-type="QString"/>
711 <replace-type modified-type="QString"/>
712 <conversion-rule class="native">
712 <conversion-rule class="native">
713 <insert-template name="core.convert_string_arg_to_char*"/>
713 <insert-template name="core.convert_string_arg_to_char*"/>
714 </conversion-rule>
714 </conversion-rule>
715 </modify-argument>
715 </modify-argument>
716 </modify-function>
716 </modify-function>
717
717
718 <modify-function signature="load(QString,const char*)">
718 <modify-function signature="load(QString,const char*)">
719 <modify-argument index="2">
719 <modify-argument index="2">
720 <replace-type modified-type="QString"/>
720 <replace-type modified-type="QString"/>
721 <conversion-rule class="native">
721 <conversion-rule class="native">
722 <insert-template name="core.convert_string_arg_to_char*"/>
722 <insert-template name="core.convert_string_arg_to_char*"/>
723 </conversion-rule>
723 </conversion-rule>
724 </modify-argument>
724 </modify-argument>
725 </modify-function>
725 </modify-function>
726
726
727 <modify-function signature="save(QIODevice*,const char*)">
727 <modify-function signature="save(QIODevice*,const char*)">
728 <modify-argument index="2">
728 <modify-argument index="2">
729 <replace-type modified-type="QString"/>
729 <replace-type modified-type="QString"/>
730 <conversion-rule class="native">
730 <conversion-rule class="native">
731 <insert-template name="core.convert_string_arg_to_char*"/>
731 <insert-template name="core.convert_string_arg_to_char*"/>
732 </conversion-rule>
732 </conversion-rule>
733 </modify-argument>
733 </modify-argument>
734 </modify-function>
734 </modify-function>
735
735
736 <modify-function signature="save(QString,const char*)">
736 <modify-function signature="save(QString,const char*)">
737 <modify-argument index="2">
737 <modify-argument index="2">
738 <replace-type modified-type="QString"/>
738 <replace-type modified-type="QString"/>
739 <conversion-rule class="native">
739 <conversion-rule class="native">
740 <insert-template name="core.convert_string_arg_to_char*"/>
740 <insert-template name="core.convert_string_arg_to_char*"/>
741 </conversion-rule>
741 </conversion-rule>
742 </modify-argument>
742 </modify-argument>
743 </modify-function>
743 </modify-function>
744 </value-type>
744 </value-type>
745
745
746 <value-type name="QRegion" expense-limit="4096">
746 <value-type name="QRegion" expense-limit="4096">
747 <modify-function signature="operator=(QRegion)" remove="all"/>
747 <modify-function signature="operator=(QRegion)" remove="all"/>
748 <modify-function signature="operator&amp;=(QRegion)" remove="all"/>
748 <modify-function signature="operator&amp;=(QRegion)" remove="all"/>
749 <modify-function signature="operator+=(QRegion)" remove="all"/>
749 <modify-function signature="operator+=(QRegion)" remove="all"/>
750 <modify-function signature="operator-=(QRegion)" remove="all"/>
750 <modify-function signature="operator-=(QRegion)" remove="all"/>
751 <modify-function signature="operator^=(QRegion)" remove="all"/>
751 <modify-function signature="operator^=(QRegion)" remove="all"/>
752 <modify-function signature="operator|=(QRegion)" remove="all"/>
752 <modify-function signature="operator|=(QRegion)" remove="all"/>
753 <modify-function signature="operator&amp;(QRegion)const" remove="all"/>
753 <modify-function signature="operator&amp;(QRegion)const" remove="all"/>
754 <modify-function signature="operator+(QRegion)const" remove="all"/>
754 <modify-function signature="operator+(QRegion)const" remove="all"/>
755 <modify-function signature="operator-(QRegion)const" remove="all"/>
755 <modify-function signature="operator-(QRegion)const" remove="all"/>
756 <modify-function signature="operator^(QRegion)const" remove="all"/>
756 <modify-function signature="operator^(QRegion)const" remove="all"/>
757 <modify-function signature="operator|(QRegion)const" remove="all"/>
757 <modify-function signature="operator|(QRegion)const" remove="all"/>
758 <modify-function signature="eor(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
758 <modify-function signature="eor(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
759 <modify-function signature="intersect(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
759 <modify-function signature="intersect(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
760 <modify-function signature="subtract(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
760 <modify-function signature="subtract(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
761 <modify-function signature="unite(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
761 <modify-function signature="unite(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
762 <modify-function signature="operator&amp;=(QRect)" remove="all"/>
762 <modify-function signature="operator&amp;=(QRect)" remove="all"/>
763 <modify-function signature="operator+=(QRect)" remove="all"/>
763 <modify-function signature="operator+=(QRect)" remove="all"/>
764
764
765 </value-type>
765 </value-type>
766
766
767 <value-type name="QTextBlock" delete-in-main-thread="yes">
767 <value-type name="QTextBlock" delete-in-main-thread="yes">
768 <modify-function signature="operator=(QTextBlock)" remove="all"/>
768 <modify-function signature="operator=(QTextBlock)" remove="all"/>
769 <modify-function signature="setUserData(QTextBlockUserData *)">
769 <modify-function signature="setUserData(QTextBlockUserData *)">
770 <modify-argument index="1">
770 <modify-argument index="1">
771 <define-ownership class="java" owner="c++"/>
771 <define-ownership class="java" owner="c++"/>
772 </modify-argument>
772 </modify-argument>
773 </modify-function>
773 </modify-function>
774 </value-type>
774 </value-type>
775 <value-type name="QTextBlockFormat" delete-in-main-thread="yes"/>
775 <value-type name="QTextBlockFormat" delete-in-main-thread="yes"/>
776 <value-type name="QTextTableCellFormat" delete-in-main-thread="yes"/>
776 <value-type name="QTextTableCellFormat" delete-in-main-thread="yes"/>
777 <value-type name="QTextCharFormat" delete-in-main-thread="yes">
777 <value-type name="QTextCharFormat" delete-in-main-thread="yes">
778 <modify-function signature="isValid()const" access="non-final"/>
778 <modify-function signature="isValid()const" access="non-final"/>
779
779
780 <modify-function signature="anchorName()const" remove="all"/> <!--### Obsolete in 4.3-->
780 <modify-function signature="anchorName()const" remove="all"/> <!--### Obsolete in 4.3-->
781 <modify-function signature="setAnchorName(QString)" remove="all"/> <!--### Obsolete in 4.3-->
781 <modify-function signature="setAnchorName(QString)" remove="all"/> <!--### Obsolete in 4.3-->
782 </value-type>
782 </value-type>
783 <value-type name="QTextFormat" delete-in-main-thread="yes">
783 <value-type name="QTextFormat" delete-in-main-thread="yes">
784 <modify-function signature="operator=(QTextFormat)" remove="all"/>
784 <modify-function signature="operator=(QTextFormat)" remove="all"/>
785 <modify-function signature="isValid()const" access="non-final"/>
785 <modify-function signature="isValid()const" access="non-final"/>
786
786
787
787
788 <modify-function signature="setProperty(int,QVector&lt;QTextLength&gt;)" rename="setLengthVectorProperty"/>
788 <modify-function signature="setProperty(int,QVector&lt;QTextLength&gt;)" rename="setLengthVectorProperty"/>
789 <inject-code class="native" position="constructor">
789 <inject-code class="native" position="constructor">
790 if ((context-&gt;argumentCount() == 1) &amp;&amp; (qMetaTypeId&lt;QTextFormat&gt;() == context-&gt;argument(0).toVariant().userType())) {
790 if ((context-&gt;argumentCount() == 1) &amp;&amp; (qMetaTypeId&lt;QTextFormat&gt;() == context-&gt;argument(0).toVariant().userType())) {
791 QTextFormat _q_arg0 = qscriptvalue_cast&lt;QTextFormat&gt;(context-&gt;argument(0));
791 QTextFormat _q_arg0 = qscriptvalue_cast&lt;QTextFormat&gt;(context-&gt;argument(0));
792 QTextFormat _q_cpp_result(_q_arg0);
792 QTextFormat _q_cpp_result(_q_arg0);
793 QScriptValue _q_result = context-&gt;engine()-&gt;newVariant(context-&gt;thisObject(), qVariantFromValue(_q_cpp_result));
793 QScriptValue _q_result = context-&gt;engine()-&gt;newVariant(context-&gt;thisObject(), qVariantFromValue(_q_cpp_result));
794 return _q_result;
794 return _q_result;
795 }
795 }
796 </inject-code>
796 </inject-code>
797 </value-type>
797 </value-type>
798
798
799 <value-type name="QTextListFormat" delete-in-main-thread="yes"/>
799 <value-type name="QTextListFormat" delete-in-main-thread="yes"/>
800 <value-type name="QPolygon">
800 <value-type name="QPolygon">
801 <modify-function signature="QPolygon(int, const int *)" remove="all"/>
801 <modify-function signature="QPolygon(int, const int *)" remove="all"/>
802 <modify-function signature="operator+(QVector&lt;QPoint&gt;)const" remove="all"/>
802 <modify-function signature="operator+(QVector&lt;QPoint&gt;)const" remove="all"/>
803 <modify-function signature="operator&lt;&lt;(QPoint)" remove="all"/>
803 <modify-function signature="operator&lt;&lt;(QPoint)" remove="all"/>
804 <modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)" remove="all"/>
804 <modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)" remove="all"/>
805
805
806
806
807 </value-type>
807 </value-type>
808
808
809 <value-type name="QPolygonF">
809 <value-type name="QPolygonF">
810 <modify-function signature="operator+(QVector&lt;QPointF&gt;)const" remove="all"/>
810 <modify-function signature="operator+(QVector&lt;QPointF&gt;)const" remove="all"/>
811 <modify-function signature="operator&lt;&lt;(QPointF)" remove="all"/>
811 <modify-function signature="operator&lt;&lt;(QPointF)" remove="all"/>
812 <modify-function signature="operator&lt;&lt;(QVector&lt;QPointF&gt;)" remove="all"/>
812 <modify-function signature="operator&lt;&lt;(QVector&lt;QPointF&gt;)" remove="all"/>
813 </value-type>
813 </value-type>
814
814
815 <value-type name="QIcon" delete-in-main-thread="yes">
815 <value-type name="QIcon" delete-in-main-thread="yes">
816 <modify-function signature="operator=(QIcon)" remove="all"/>
816 <modify-function signature="operator=(QIcon)" remove="all"/>
817 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
817 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
818 <modify-function signature="QIcon(QIconEngineV2 *)">
818 <modify-function signature="QIcon(QIconEngineV2 *)">
819 <modify-argument index="1">
819 <modify-argument index="1">
820 <define-ownership class="java" owner="c++"/>
820 <define-ownership class="java" owner="c++"/>
821 </modify-argument>
821 </modify-argument>
822 </modify-function>
822 </modify-function>
823 <modify-function signature="QIcon(QIconEngine *)">
823 <modify-function signature="QIcon(QIconEngine *)">
824 <modify-argument index="1">
824 <modify-argument index="1">
825 <define-ownership class="java" owner="c++"/>
825 <define-ownership class="java" owner="c++"/>
826 </modify-argument>
826 </modify-argument>
827 </modify-function>
827 </modify-function>
828 </value-type>
828 </value-type>
829
829
830 <value-type name="QTextFrame::iterator" delete-in-main-thread="yes">
830 <value-type name="QTextFrame::iterator" delete-in-main-thread="yes">
831 <include file-name="QTextFrame" location="global"/>
831 <include file-name="QTextFrame" location="global"/>
832 <modify-function signature="operator++(int)" remove="all"/>
832 <modify-function signature="operator++(int)" remove="all"/>
833 <modify-function signature="operator--(int)" remove="all"/>
833 <modify-function signature="operator--(int)" remove="all"/>
834 <modify-function signature="operator=(QTextFrame::iterator)" remove="all"/>
834 <modify-function signature="operator=(QTextFrame::iterator)" remove="all"/>
835 <modify-function signature="operator++()" access="private"/>
835 <modify-function signature="operator++()" access="private"/>
836 <modify-function signature="operator--()" access="private"/>
836 <modify-function signature="operator--()" access="private"/>
837 </value-type>
837 </value-type>
838
838
839 <value-type name="QTreeWidgetItemIterator" delete-in-main-thread="yes">
839 <value-type name="QTreeWidgetItemIterator" delete-in-main-thread="yes">
840 <custom-constructor>
840 <custom-constructor>
841 return new QTreeWidgetItemIterator(*copy);
841 return new QTreeWidgetItemIterator(*copy);
842 </custom-constructor>
842 </custom-constructor>
843 <custom-destructor>
843 <custom-destructor>
844 delete copy;
844 delete copy;
845 </custom-destructor>
845 </custom-destructor>
846 <modify-function signature="operator=(QTreeWidgetItemIterator)" remove="all"/>
846 <modify-function signature="operator=(QTreeWidgetItemIterator)" remove="all"/>
847 <modify-function signature="operator++(int)" remove="all"/>
847 <modify-function signature="operator++(int)" remove="all"/>
848 <modify-function signature="operator--(int)" remove="all"/>
848 <modify-function signature="operator--(int)" remove="all"/>
849 <modify-function signature="operator+=(int)" access="private"/>
849 <modify-function signature="operator+=(int)" access="private"/>
850 <modify-function signature="operator-=(int)" access="private"/>
850 <modify-function signature="operator-=(int)" access="private"/>
851 <modify-function signature="operator++()" access="private"/>
851 <modify-function signature="operator++()" access="private"/>
852 <modify-function signature="operator--()" access="private"/>
852 <modify-function signature="operator--()" access="private"/>
853 <modify-function signature="operator*()const" access="private"/>
853 <modify-function signature="operator*()const" access="private"/>
854 </value-type>
854 </value-type>
855
855
856 <value-type name="QTextBlock::iterator" delete-in-main-thread="yes">
856 <value-type name="QTextBlock::iterator" delete-in-main-thread="yes">
857 <include file-name="QTextBlock" location="global"/>
857 <include file-name="QTextBlock" location="global"/>
858
858
859 <modify-function signature="operator++()" access="private"/>
859 <modify-function signature="operator++()" access="private"/>
860 <modify-function signature="operator--()" access="private"/>
860 <modify-function signature="operator--()" access="private"/>
861 <modify-function signature="operator++(int)" remove="all"/>
861 <modify-function signature="operator++(int)" remove="all"/>
862 <modify-function signature="operator--(int)" remove="all"/>
862 <modify-function signature="operator--(int)" remove="all"/>
863 </value-type>
863 </value-type>
864
864
865 <value-type name="QAbstractTextDocumentLayout::PaintContext" delete-in-main-thread="yes">
865 <value-type name="QAbstractTextDocumentLayout::PaintContext" delete-in-main-thread="yes">
866 <include file-name="QAbstractTextDocumentLayout" location="global"/>
866 <include file-name="QAbstractTextDocumentLayout" location="global"/>
867 </value-type>
867 </value-type>
868 <value-type name="QAbstractTextDocumentLayout::Selection" delete-in-main-thread="yes"/>
868 <value-type name="QAbstractTextDocumentLayout::Selection" delete-in-main-thread="yes"/>
869
869
870 <value-type name="QPixmap" delete-in-main-thread="yes">
870 <value-type name="QPixmap" delete-in-main-thread="yes">
871 <modify-function signature="operator=(QPixmap)" remove="all"/>
871 <modify-function signature="operator=(QPixmap)" remove="all"/>
872 <modify-function signature="operator!()const" remove="all"/>
872 <modify-function signature="operator!()const" remove="all"/>
873 <modify-function signature="QPixmap(const char **)" remove="all"/>
873 <modify-function signature="QPixmap(const char **)" remove="all"/>
874 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
874 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
875
875
876 <modify-function signature="loadFromData(const uchar *,uint,const char *,QFlags&lt;Qt::ImageConversionFlag&gt;)" remove="all"/>
876 <modify-function signature="loadFromData(const uchar *,uint,const char *,QFlags&lt;Qt::ImageConversionFlag&gt;)" remove="all"/>
877
877
878 <modify-function signature="QPixmap(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
878 <modify-function signature="QPixmap(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
879 <modify-argument index="2">
879 <modify-argument index="2">
880 <replace-type modified-type="QString"/>
880 <replace-type modified-type="QString"/>
881 <conversion-rule class="native">
881 <conversion-rule class="native">
882 <insert-template name="core.convert_string_arg_to_char*"/>
882 <insert-template name="core.convert_string_arg_to_char*"/>
883 </conversion-rule>
883 </conversion-rule>
884 </modify-argument>
884 </modify-argument>
885 </modify-function>
885 </modify-function>
886
886
887 <modify-function signature="load(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
887 <modify-function signature="load(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
888 <modify-argument index="2">
888 <modify-argument index="2">
889 <replace-type modified-type="QString"/>
889 <replace-type modified-type="QString"/>
890 <conversion-rule class="native">
890 <conversion-rule class="native">
891 <insert-template name="core.convert_string_arg_to_char*"/>
891 <insert-template name="core.convert_string_arg_to_char*"/>
892 </conversion-rule>
892 </conversion-rule>
893 </modify-argument>
893 </modify-argument>
894 </modify-function>
894 </modify-function>
895
895
896 <modify-function signature="loadFromData(QByteArray,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
896 <modify-function signature="loadFromData(QByteArray,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
897 <modify-argument index="2">
897 <modify-argument index="2">
898 <replace-type modified-type="QString"/>
898 <replace-type modified-type="QString"/>
899 <conversion-rule class="native">
899 <conversion-rule class="native">
900 <insert-template name="core.convert_string_arg_to_char*"/>
900 <insert-template name="core.convert_string_arg_to_char*"/>
901 </conversion-rule>
901 </conversion-rule>
902 </modify-argument>
902 </modify-argument>
903 </modify-function>
903 </modify-function>
904
904
905 <modify-function signature="save(QIODevice*,const char*,int)const">
905 <modify-function signature="save(QIODevice*,const char*,int)const">
906 <modify-argument index="2">
906 <modify-argument index="2">
907 <replace-type modified-type="QString"/>
907 <replace-type modified-type="QString"/>
908 <conversion-rule class="native">
908 <conversion-rule class="native">
909 <insert-template name="core.convert_string_arg_to_char*"/>
909 <insert-template name="core.convert_string_arg_to_char*"/>
910 </conversion-rule>
910 </conversion-rule>
911 </modify-argument>
911 </modify-argument>
912 </modify-function>
912 </modify-function>
913
913
914 <modify-function signature="save(QString,const char*,int)const">
914 <modify-function signature="save(QString,const char*,int)const">
915 <modify-argument index="2">
915 <modify-argument index="2">
916 <replace-type modified-type="QString"/>
916 <replace-type modified-type="QString"/>
917 <conversion-rule class="native">
917 <conversion-rule class="native">
918 <insert-template name="core.convert_string_arg_to_char*"/>
918 <insert-template name="core.convert_string_arg_to_char*"/>
919 </conversion-rule>
919 </conversion-rule>
920 </modify-argument>
920 </modify-argument>
921 </modify-function>
921 </modify-function>
922 </value-type>
922 </value-type>
923
923
924 <value-type name="QTextCursor" delete-in-main-thread="yes">
924 <value-type name="QTextCursor" delete-in-main-thread="yes">
925 <extra-includes>
925 <extra-includes>
926 <include file-name="QTextBlock" location="global"/>
926 <include file-name="QTextBlock" location="global"/>
927 <include file-name="QTextDocumentFragment" location="global"/>
927 <include file-name="QTextDocumentFragment" location="global"/>
928 </extra-includes>
928 </extra-includes>
929 <modify-function signature="operator=(QTextCursor)" remove="all"/>
929 <modify-function signature="operator=(QTextCursor)" remove="all"/>
930 <modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
930 <modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
931 <access modifier="private"/>
931 <access modifier="private"/>
932 </modify-function>
932 </modify-function>
933 </value-type>
933 </value-type>
934
934
935 <value-type name="QTextLayout::FormatRange">
935 <value-type name="QTextLayout::FormatRange">
936 <include file-name="QTextLayout" location="global"/>
936 <include file-name="QTextLayout" location="global"/>
937 </value-type>
937 </value-type>
938
938
939 <value-type name="QInputMethodEvent::Attribute">
939 <value-type name="QInputMethodEvent::Attribute">
940 <include file-name="QInputMethodEvent" location="global"/>
940 <include file-name="QInputMethodEvent" location="global"/>
941 <custom-constructor>
941 <custom-constructor>
942 return new QInputMethodEvent::Attribute(copy-&gt;type, copy-&gt;start, copy-&gt;length, copy-&gt;value);
942 return new QInputMethodEvent::Attribute(copy-&gt;type, copy-&gt;start, copy-&gt;length, copy-&gt;value);
943 </custom-constructor>
943 </custom-constructor>
944 <custom-destructor>
944 <custom-destructor>
945 delete copy;
945 delete copy;
946 </custom-destructor>
946 </custom-destructor>
947 </value-type>
947 </value-type>
948
948
949 <value-type name="QItemSelection" delete-in-main-thread="yes">
949 <value-type name="QItemSelection" delete-in-main-thread="yes">
950
950
951 <modify-function signature="operator+(const QList&lt;QItemSelectionRange&gt;&amp;)const" remove="all"/>
951 <modify-function signature="operator+(const QList&lt;QItemSelectionRange&gt;&amp;)const" remove="all"/>
952 <modify-function signature="operator+=(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
952 <modify-function signature="operator+=(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
953 <modify-function signature="operator+=(const QItemSelectionRange&amp;)" remove="all"/>
953 <modify-function signature="operator+=(const QItemSelectionRange&amp;)" remove="all"/>
954 <modify-function signature="operator&lt;&lt;(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
954 <modify-function signature="operator&lt;&lt;(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
955 <modify-function signature="operator&lt;&lt;(QItemSelectionRange)" remove="all"/>
955 <modify-function signature="operator&lt;&lt;(QItemSelectionRange)" remove="all"/>
956 </value-type>
956 </value-type>
957
957
958 <value-type name="QMatrix4x4">
958 <value-type name="QMatrix4x4">
959 <modify-function signature="data()const" remove="all"/>
959 <modify-function signature="data()const" remove="all"/>
960 <modify-function signature="operator()(int, int)const" remove="all"/>
960 <modify-function signature="operator()(int, int)const" remove="all"/>
961 </value-type>
961 </value-type>
962 <value-type name="QMatrix">
962 <value-type name="QMatrix">
963 <extra-includes>
963 <extra-includes>
964 <include file-name="QPainterPath" location="global"/>
964 <include file-name="QPainterPath" location="global"/>
965 </extra-includes>
965 </extra-includes>
966
966
967 <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
967 <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
968 <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
968 <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
969 <modify-function signature="operator=(QMatrix)" remove="all"/>
969 <modify-function signature="operator=(QMatrix)" remove="all"/>
970
970
971 <modify-function signature="operator*(QMatrix)const" access="private"/>
971 <modify-function signature="operator*(QMatrix)const" access="private"/>
972 <modify-function signature="operator*=(QMatrix)" access="private"/>
972 <modify-function signature="operator*=(QMatrix)" access="private"/>
973 <modify-function signature="rotate(double)" access="private" rename="rotate_private"/>
973 <modify-function signature="rotate(double)" access="private" rename="rotate_private"/>
974 <modify-function signature="scale(double,double)" access="private" rename="scale_private"/>
974 <modify-function signature="scale(double,double)" access="private" rename="scale_private"/>
975 <modify-function signature="shear(double,double)" access="private" rename="shear_private"/>
975 <modify-function signature="shear(double,double)" access="private" rename="shear_private"/>
976 <modify-function signature="translate(double,double)" access="private" rename="translate_private"/>
976 <modify-function signature="translate(double,double)" access="private" rename="translate_private"/>
977
977
978 <modify-function signature="inverted(bool*)const">
978 <modify-function signature="inverted(bool*)const">
979 <access modifier="private"/>
979 <access modifier="private"/>
980 <modify-argument index="1">
980 <modify-argument index="1">
981 <remove-default-expression/>
981 <remove-default-expression/>
982 </modify-argument>
982 </modify-argument>
983 </modify-function>
983 </modify-function>
984
984
985 <inject-code>
985 <inject-code>
986 <insert-template name="core.unary_other_type">
986 <insert-template name="core.unary_other_type">
987 <replace from="%FUNCTION_NAME" to="rotate"/>
987 <replace from="%FUNCTION_NAME" to="rotate"/>
988 <replace from="%OUT_TYPE" to="QMatrix"/>
988 <replace from="%OUT_TYPE" to="QMatrix"/>
989 <replace from="%IN_TYPE" to="double"/>
989 <replace from="%IN_TYPE" to="double"/>
990 </insert-template>
990 </insert-template>
991
991
992 <insert-template name="core.private_function_return_self">
992 <insert-template name="core.private_function_return_self">
993 <replace from="%RETURN_TYPE" to="QMatrix"/>
993 <replace from="%RETURN_TYPE" to="QMatrix"/>
994 <replace from="%FUNCTION_NAME" to="scale"/>
994 <replace from="%FUNCTION_NAME" to="scale"/>
995 <replace from="%ARGUMENTS" to="double sx, double sy"/>
995 <replace from="%ARGUMENTS" to="double sx, double sy"/>
996 <replace from="%ARGUMENT_NAMES" to="sx, sy"/>
996 <replace from="%ARGUMENT_NAMES" to="sx, sy"/>
997 </insert-template>
997 </insert-template>
998
998
999 <insert-template name="core.private_function_return_self">
999 <insert-template name="core.private_function_return_self">
1000 <replace from="%RETURN_TYPE" to="QMatrix"/>
1000 <replace from="%RETURN_TYPE" to="QMatrix"/>
1001 <replace from="%FUNCTION_NAME" to="shear"/>
1001 <replace from="%FUNCTION_NAME" to="shear"/>
1002 <replace from="%ARGUMENTS" to="double sh, double sv"/>
1002 <replace from="%ARGUMENTS" to="double sh, double sv"/>
1003 <replace from="%ARGUMENT_NAMES" to="sh, sv"/>
1003 <replace from="%ARGUMENT_NAMES" to="sh, sv"/>
1004 </insert-template>
1004 </insert-template>
1005
1005
1006 <insert-template name="core.private_function_return_self">
1006 <insert-template name="core.private_function_return_self">
1007 <replace from="%RETURN_TYPE" to="QMatrix"/>
1007 <replace from="%RETURN_TYPE" to="QMatrix"/>
1008 <replace from="%FUNCTION_NAME" to="translate"/>
1008 <replace from="%FUNCTION_NAME" to="translate"/>
1009 <replace from="%ARGUMENTS" to="double dx, double dy"/>
1009 <replace from="%ARGUMENTS" to="double dx, double dy"/>
1010 <replace from="%ARGUMENT_NAMES" to="dx, dy"/>
1010 <replace from="%ARGUMENT_NAMES" to="dx, dy"/>
1011 </insert-template>
1011 </insert-template>
1012 </inject-code>
1012 </inject-code>
1013
1013
1014 <modify-function signature="inverted(bool*)const">
1014 <modify-function signature="inverted(bool*)const">
1015 <modify-argument index="1">
1015 <modify-argument index="1">
1016 <remove-argument/>
1016 <remove-argument/>
1017 </modify-argument>
1017 </modify-argument>
1018 </modify-function>
1018 </modify-function>
1019 </value-type>
1019 </value-type>
1020
1020
1021 <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient">
1021 <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient">
1022 <custom-constructor>
1022 <custom-constructor>
1023 return new QConicalGradient(copy-&gt;center(), copy-&gt;angle());
1023 return new QConicalGradient(copy-&gt;center(), copy-&gt;angle());
1024 </custom-constructor>
1024 </custom-constructor>
1025 <custom-destructor>
1025 <custom-destructor>
1026 delete copy;
1026 delete copy;
1027 </custom-destructor>
1027 </custom-destructor>
1028 </value-type>
1028 </value-type>
1029
1029
1030 <value-type name="QFontInfo" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1030 <value-type name="QFontInfo" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1031 <custom-constructor>
1031 <custom-constructor>
1032 return new QFontInfo(*copy);
1032 return new QFontInfo(*copy);
1033 </custom-constructor>
1033 </custom-constructor>
1034 <custom-destructor>
1034 <custom-destructor>
1035 delete copy;
1035 delete copy;
1036 </custom-destructor>
1036 </custom-destructor>
1037 <modify-function signature="operator=(QFontInfo)" remove="all"/>
1037 <modify-function signature="operator=(QFontInfo)" remove="all"/>
1038
1038
1039
1039
1040 <modify-function signature="QFontInfo(QFontInfo)">
1040 <modify-function signature="QFontInfo(QFontInfo)">
1041 <modify-argument index="1">
1041 <modify-argument index="1">
1042 <replace-type modified-type="QFontInfo*"/>
1042 <replace-type modified-type="QFontInfo*"/>
1043 <conversion-rule class="native">
1043 <conversion-rule class="native">
1044 QFontInfo &amp; %out% = *qscriptvalue_cast&lt;QFontInfo*&gt;(%in%);
1044 QFontInfo &amp; %out% = *qscriptvalue_cast&lt;QFontInfo*&gt;(%in%);
1045 </conversion-rule>
1045 </conversion-rule>
1046 </modify-argument>
1046 </modify-argument>
1047 </modify-function>
1047 </modify-function>
1048 </value-type>
1048 </value-type>
1049
1049
1050 <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient">
1050 <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient">
1051 <custom-constructor>
1051 <custom-constructor>
1052 return new QRadialGradient(copy-&gt;center(), copy-&gt;radius(), copy-&gt;focalPoint());
1052 return new QRadialGradient(copy-&gt;center(), copy-&gt;radius(), copy-&gt;focalPoint());
1053 </custom-constructor>
1053 </custom-constructor>
1054 <custom-destructor>
1054 <custom-destructor>
1055 delete copy;
1055 delete copy;
1056 </custom-destructor>
1056 </custom-destructor>
1057 </value-type>
1057 </value-type>
1058
1058
1059 <value-type name="QPainterPath::Element">
1059 <value-type name="QPainterPath::Element">
1060 <modify-field name="x" write="false"/>
1060 <modify-field name="x" write="false"/>
1061 <modify-field name="y" write="false"/>
1061 <modify-field name="y" write="false"/>
1062 <modify-field name="type" write="false"/>
1062 <modify-field name="type" write="false"/>
1063 <include file-name="QPainterPath" location="global"/>
1063 <include file-name="QPainterPath" location="global"/>
1064 <modify-function signature="operator QPointF()const" access="private"/>
1064 <modify-function signature="operator QPointF()const" access="private"/>
1065 </value-type>
1065 </value-type>
1066
1066
1067 <value-type name="QTextEdit::ExtraSelection" delete-in-main-thread="yes">
1067 <value-type name="QTextEdit::ExtraSelection" delete-in-main-thread="yes">
1068 <include file-name="QTextEdit" location="global"/>
1068 <include file-name="QTextEdit" location="global"/>
1069 </value-type>
1069 </value-type>
1070
1070
1071 <value-type name="QFont" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1071 <value-type name="QFont" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1072 <extra-includes>
1072 <extra-includes>
1073 <include file-name="QStringList" location="global"/>
1073 <include file-name="QStringList" location="global"/>
1074 </extra-includes>
1074 </extra-includes>
1075 <modify-function signature="operator=(QFont)" remove="all"/>
1075 <modify-function signature="operator=(QFont)" remove="all"/>
1076 </value-type>
1076 </value-type>
1077
1077
1078 <value-type name="QTextTableCell" delete-in-main-thread="yes">
1078 <value-type name="QTextTableCell" delete-in-main-thread="yes">
1079 <extra-includes>
1079 <extra-includes>
1080 <include file-name="QTextCursor" location="global"/>
1080 <include file-name="QTextCursor" location="global"/>
1081 </extra-includes>
1081 </extra-includes>
1082 <modify-function signature="operator=(QTextTableCell)" remove="all"/>
1082 <modify-function signature="operator=(QTextTableCell)" remove="all"/>
1083 </value-type>
1083 </value-type>
1084
1084
1085 <value-type name="QImage" expense-limit="67108864" expense-cost="height()*bytesPerLine()">
1085 <value-type name="QImage" expense-limit="67108864" expense-cost="height()*bytesPerLine()">
1086 <modify-function signature="QImage(const char *, const char *)">
1086 <modify-function signature="QImage(const char *, const char *)">
1087 <remove/>
1087 <remove/>
1088 </modify-function>
1088 </modify-function>
1089 <modify-function signature="QImage(const char **)">
1089 <modify-function signature="QImage(const char **)">
1090 <access modifier="private"/>
1090 <access modifier="private"/>
1091 </modify-function>
1091 </modify-function>
1092 <modify-function signature="QImage(const unsigned char*,int,int,int,QImage::Format)">
1092 <modify-function signature="QImage(const unsigned char*,int,int,int,QImage::Format)">
1093 <remove/>
1093 <remove/>
1094 </modify-function>
1094 </modify-function>
1095 <modify-function signature="bits()const">
1095 <modify-function signature="bits()const">
1096 <remove/>
1096 <remove/>
1097 </modify-function>
1097 </modify-function>
1098 <modify-function signature="scanLine(int)const">
1098 <modify-function signature="scanLine(int)const">
1099 <remove/>
1099 <remove/>
1100 </modify-function>
1100 </modify-function>
1101 <modify-function signature="constBits()const">
1101 <modify-function signature="constBits()const">
1102 <remove/>
1102 <remove/>
1103 </modify-function>
1103 </modify-function>
1104 <modify-function signature="constScanLine(int)const">
1104 <modify-function signature="constScanLine(int)const">
1105 <remove/>
1105 <remove/>
1106 </modify-function>
1106 </modify-function>
1107 <modify-function signature="QImage(const unsigned char *, int, int, QImage::Format)">
1107 <modify-function signature="QImage(const unsigned char *, int, int, QImage::Format)">
1108 <remove/>
1108 <remove/>
1109 </modify-function>
1109 </modify-function>
1110
1110
1111 <extra-includes>
1111 <extra-includes>
1112 <include file-name="QStringList" location="global"/>
1112 <include file-name="QStringList" location="global"/>
1113 <include file-name="QMatrix" location="global"/>
1113 <include file-name="QMatrix" location="global"/>
1114 </extra-includes>
1114 </extra-includes>
1115 <modify-function signature="save(const QString &amp;, const char *, int) const">
1115 <modify-function signature="save(const QString &amp;, const char *, int) const">
1116 <access modifier="private"/>
1116 <access modifier="private"/>
1117 <rename to="private_save"/>
1117 <rename to="private_save"/>
1118 <modify-argument index="2">
1118 <modify-argument index="2">
1119 <remove-default-expression/>
1119 <remove-default-expression/>
1120 </modify-argument>
1120 </modify-argument>
1121 <modify-argument index="3">
1121 <modify-argument index="3">
1122 <remove-default-expression/>
1122 <remove-default-expression/>
1123 </modify-argument>
1123 </modify-argument>
1124 </modify-function>
1124 </modify-function>
1125
1125
1126 <modify-function signature="QImage(unsigned char*,int,int,QImage::Format)">
1126 <modify-function signature="QImage(unsigned char*,int,int,QImage::Format)">
1127 <access modifier="private"/>
1127 <access modifier="private"/>
1128 </modify-function>
1128 </modify-function>
1129
1129
1130 <modify-function signature="QImage(QString,const char*)">
1130 <modify-function signature="QImage(QString,const char*)">
1131 <access modifier="private"/>
1131 <access modifier="private"/>
1132 <modify-argument index="2">
1132 <modify-argument index="2">
1133 <remove-default-expression/>
1133 <remove-default-expression/>
1134 </modify-argument>
1134 </modify-argument>
1135 </modify-function>
1135 </modify-function>
1136
1136
1137 <modify-function signature="load(QString,const char*)">
1137 <modify-function signature="load(QString,const char*)">
1138 <access modifier="private"/>
1138 <access modifier="private"/>
1139 <modify-argument index="2">
1139 <modify-argument index="2">
1140 <remove-default-expression/>
1140 <remove-default-expression/>
1141 </modify-argument>
1141 </modify-argument>
1142 </modify-function>
1142 </modify-function>
1143
1143
1144 <modify-function signature="load(QIODevice*,const char*)">
1144 <modify-function signature="load(QIODevice*,const char*)">
1145 <access modifier="private"/>
1145 <access modifier="private"/>
1146 </modify-function>
1146 </modify-function>
1147
1147
1148 <modify-function signature="loadFromData(const unsigned char*,int,const char*)">
1148 <modify-function signature="loadFromData(const unsigned char*,int,const char*)">
1149 <access modifier="private"/>
1149 <access modifier="private"/>
1150 <modify-argument index="2">
1150 <modify-argument index="2">
1151 <remove-default-expression/>
1151 <remove-default-expression/>
1152 </modify-argument>
1152 </modify-argument>
1153 <modify-argument index="3">
1153 <modify-argument index="3">
1154 <remove-default-expression/>
1154 <remove-default-expression/>
1155 </modify-argument>
1155 </modify-argument>
1156 </modify-function>
1156 </modify-function>
1157
1157
1158 <modify-function signature="loadFromData(QByteArray,const char*)">
1158 <modify-function signature="loadFromData(QByteArray,const char*)">
1159 <access modifier="private"/>
1159 <access modifier="private"/>
1160 <modify-argument index="2">
1160 <modify-argument index="2">
1161 <remove-default-expression/>
1161 <remove-default-expression/>
1162 </modify-argument>
1162 </modify-argument>
1163 </modify-function>
1163 </modify-function>
1164
1164
1165 <modify-function signature="operator=(QImage)" remove="all"/>
1165 <modify-function signature="operator=(QImage)" remove="all"/>
1166
1166
1167 <modify-function signature="setText(const char*,const char*,QString)">
1167 <modify-function signature="setText(const char*,const char*,QString)">
1168 <remove/>
1168 <remove/>
1169 </modify-function>
1169 </modify-function>
1170
1170
1171 <modify-function signature="text(const char*,const char*)const">
1171 <modify-function signature="text(const char*,const char*)const">
1172 <remove/>
1172 <remove/>
1173 </modify-function>
1173 </modify-function>
1174
1174
1175 <modify-function signature="fromData(QByteArray,const char*)">
1175 <modify-function signature="fromData(QByteArray,const char*)">
1176 <access modifier="private"/>
1176 <access modifier="private"/>
1177 <modify-argument index="2">
1177 <modify-argument index="2">
1178 <remove-default-expression/>
1178 <remove-default-expression/>
1179 </modify-argument>
1179 </modify-argument>
1180 </modify-function>
1180 </modify-function>
1181
1181
1182 <modify-function signature="fromData(const unsigned char*,int,const char*)">
1182 <modify-function signature="fromData(const unsigned char*,int,const char*)">
1183 <remove/>
1183 <remove/>
1184 </modify-function>
1184 </modify-function>
1185
1185
1186 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
1186 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
1187 <modify-function signature="textLanguages()const" remove="all"/> <!--### Obsolete in 4.3-->
1187 <modify-function signature="textLanguages()const" remove="all"/> <!--### Obsolete in 4.3-->
1188
1188
1189 <modify-function signature="QImage(const char**)" remove="all"/>
1189 <modify-function signature="QImage(const char**)" remove="all"/>
1190 <modify-function signature="QImage(const uchar *,int,int,QImage::Format)" remove="all"/>
1190 <modify-function signature="QImage(const uchar *,int,int,QImage::Format)" remove="all"/>
1191 <modify-function signature="QImage(const uchar *,int,int,int,QImage::Format)" remove="all"/>
1191 <modify-function signature="QImage(const uchar *,int,int,int,QImage::Format)" remove="all"/>
1192 <modify-function signature="QImage(uchar *,int,int,QImage::Format)" remove="all"/>
1192 <modify-function signature="QImage(uchar *,int,int,QImage::Format)" remove="all"/>
1193 <modify-function signature="QImage(uchar *,int,int,int,QImage::Format)" remove="all"/>
1193 <modify-function signature="QImage(uchar *,int,int,int,QImage::Format)" remove="all"/>
1194 <modify-function signature="setColorTable(const QVector&lt;uint&gt;)" remove="all"/>
1194 <modify-function signature="setColorTable(const QVector&lt;uint&gt;)" remove="all"/>
1195 <modify-function signature="loadFromData(const uchar *,int,const char *)" remove="all"/>
1195 <modify-function signature="loadFromData(const uchar *,int,const char *)" remove="all"/>
1196 <modify-function signature="fromData(const uchar *,int,const char *)" remove="all"/>
1196 <modify-function signature="fromData(const uchar *,int,const char *)" remove="all"/>
1197 <modify-function signature="bits()" remove="all"/>
1197 <modify-function signature="bits()" remove="all"/>
1198 <modify-function signature="scanLine(int)" remove="all"/>
1198 <modify-function signature="scanLine(int)" remove="all"/>
1199
1199
1200 <modify-function signature="QImage(QString,const char*)">
1200 <modify-function signature="QImage(QString,const char*)">
1201 <modify-argument index="2">
1201 <modify-argument index="2">
1202 <replace-type modified-type="QString"/>
1202 <replace-type modified-type="QString"/>
1203 <conversion-rule class="native">
1203 <conversion-rule class="native">
1204 <insert-template name="core.convert_string_arg_to_char*"/>
1204 <insert-template name="core.convert_string_arg_to_char*"/>
1205 </conversion-rule>
1205 </conversion-rule>
1206 </modify-argument>
1206 </modify-argument>
1207 </modify-function>
1207 </modify-function>
1208
1208
1209 <modify-function signature="fromData(QByteArray,const char*)">
1209 <modify-function signature="fromData(QByteArray,const char*)">
1210 <modify-argument index="2">
1210 <modify-argument index="2">
1211 <replace-type modified-type="QString"/>
1211 <replace-type modified-type="QString"/>
1212 <conversion-rule class="native">
1212 <conversion-rule class="native">
1213 <insert-template name="core.convert_string_arg_to_char*"/>
1213 <insert-template name="core.convert_string_arg_to_char*"/>
1214 </conversion-rule>
1214 </conversion-rule>
1215 </modify-argument>
1215 </modify-argument>
1216 </modify-function>
1216 </modify-function>
1217
1217
1218 <modify-function signature="load(QString,const char*)">
1218 <modify-function signature="load(QString,const char*)">
1219 <modify-argument index="2">
1219 <modify-argument index="2">
1220 <replace-type modified-type="QString"/>
1220 <replace-type modified-type="QString"/>
1221 <conversion-rule class="native">
1221 <conversion-rule class="native">
1222 <insert-template name="core.convert_string_arg_to_char*"/>
1222 <insert-template name="core.convert_string_arg_to_char*"/>
1223 </conversion-rule>
1223 </conversion-rule>
1224 </modify-argument>
1224 </modify-argument>
1225 </modify-function>
1225 </modify-function>
1226
1226
1227 <modify-function signature="load(QIODevice*,const char*)">
1227 <modify-function signature="load(QIODevice*,const char*)">
1228 <modify-argument index="2">
1228 <modify-argument index="2">
1229 <replace-type modified-type="QString"/>
1229 <replace-type modified-type="QString"/>
1230 <conversion-rule class="native">
1230 <conversion-rule class="native">
1231 <insert-template name="core.convert_string_arg_to_char*"/>
1231 <insert-template name="core.convert_string_arg_to_char*"/>
1232 </conversion-rule>
1232 </conversion-rule>
1233 </modify-argument>
1233 </modify-argument>
1234 </modify-function>
1234 </modify-function>
1235
1235
1236 <modify-function signature="loadFromData(QByteArray,const char*)">
1236 <modify-function signature="loadFromData(QByteArray,const char*)">
1237 <modify-argument index="2">
1237 <modify-argument index="2">
1238 <replace-type modified-type="QString"/>
1238 <replace-type modified-type="QString"/>
1239 <conversion-rule class="native">
1239 <conversion-rule class="native">
1240 <insert-template name="core.convert_string_arg_to_char*"/>
1240 <insert-template name="core.convert_string_arg_to_char*"/>
1241 </conversion-rule>
1241 </conversion-rule>
1242 </modify-argument>
1242 </modify-argument>
1243 </modify-function>
1243 </modify-function>
1244
1244
1245 <modify-function signature="save(QString,const char*,int)const">
1245 <modify-function signature="save(QString,const char*,int)const">
1246 <modify-argument index="2">
1246 <modify-argument index="2">
1247 <replace-type modified-type="QString"/>
1247 <replace-type modified-type="QString"/>
1248 <conversion-rule class="native">
1248 <conversion-rule class="native">
1249 <insert-template name="core.convert_string_arg_to_char*"/>
1249 <insert-template name="core.convert_string_arg_to_char*"/>
1250 </conversion-rule>
1250 </conversion-rule>
1251 </modify-argument>
1251 </modify-argument>
1252 </modify-function>
1252 </modify-function>
1253
1253
1254 <modify-function signature="save(QIODevice*,const char*,int)const">
1254 <modify-function signature="save(QIODevice*,const char*,int)const">
1255 <modify-argument index="2">
1255 <modify-argument index="2">
1256 <replace-type modified-type="QString"/>
1256 <replace-type modified-type="QString"/>
1257 <conversion-rule class="native">
1257 <conversion-rule class="native">
1258 <insert-template name="core.convert_string_arg_to_char*"/>
1258 <insert-template name="core.convert_string_arg_to_char*"/>
1259 </conversion-rule>
1259 </conversion-rule>
1260 </modify-argument>
1260 </modify-argument>
1261 </modify-function>
1261 </modify-function>
1262 <inject-code class="pywrap-h">
1262 <inject-code class="pywrap-h">
1263 QImage* new_QImage( const uchar * data, int width, int height, QImage::Format format )
1263 QImage* new_QImage( const uchar * data, int width, int height, QImage::Format format )
1264 {
1264 {
1265 QImage* image = new QImage(width, height, format);
1265 QImage* image = new QImage(width, height, format);
1266 memcpy(image-&gt;bits(), data, image-&gt;byteCount());
1266 memcpy(image-&gt;bits(), data, image-&gt;byteCount());
1267 return image;
1267 return image;
1268 }
1268 }
1269
1269
1270 PyObject* bits(QImage* image) {
1270 PyObject* bits(QImage* image) {
1271 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;bits(), image-&gt;bytesPerLine()* image-&gt;height());
1271 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;bits(), image-&gt;bytesPerLine()* image-&gt;height());
1272 }
1272 }
1273
1273
1274 #if QT_VERSION &gt;= QT_VERSION_CHECK(4,7,0)
1274 #if QT_VERSION &gt;= QT_VERSION_CHECK(4,7,0)
1275 PyObject* constBits(QImage* image) {
1275 PyObject* constBits(QImage* image) {
1276 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;constBits(), image-&gt;byteCount());
1276 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;constBits(), image-&gt;byteCount());
1277 }
1277 }
1278 #endif
1278 #endif
1279
1279
1280 PyObject* scanLine(QImage* image, int line) {
1280 PyObject* scanLine(QImage* image, int line) {
1281 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;scanLine(line), image-&gt;bytesPerLine());
1281 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;scanLine(line), image-&gt;bytesPerLine());
1282 }
1282 }
1283
1283
1284 #if QT_VERSION &gt;= QT_VERSION_CHECK(4,7,0)
1284 #if QT_VERSION &gt;= QT_VERSION_CHECK(4,7,0)
1285 PyObject* constScanLine(QImage* image, int line) {
1285 PyObject* constScanLine(QImage* image, int line) {
1286 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;constScanLine(line), image-&gt;bytesPerLine());
1286 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;constScanLine(line), image-&gt;bytesPerLine());
1287 }
1287 }
1288 #endif
1288 #endif
1289
1289
1290 </inject-code>
1290 </inject-code>
1291 </value-type>
1291 </value-type>
1292
1292
1293 <value-type name="QColormap" delete-in-main-thread="yes">
1293 <value-type name="QColormap" delete-in-main-thread="yes">
1294 <modify-function signature="operator=(QColormap)" remove="all"/>
1294 <modify-function signature="operator=(QColormap)" remove="all"/>
1295 <extra-includes>
1295 <extra-includes>
1296 <include file-name="QColor" location="global"/>
1296 <include file-name="QColor" location="global"/>
1297 </extra-includes>
1297 </extra-includes>
1298 <custom-constructor>
1298 <custom-constructor>
1299 return new QColormap(*copy);
1299 return new QColormap(*copy);
1300 </custom-constructor>
1300 </custom-constructor>
1301 <custom-destructor>
1301 <custom-destructor>
1302 delete copy;
1302 delete copy;
1303 </custom-destructor>
1303 </custom-destructor>
1304 </value-type>
1304 </value-type>
1305
1305
1306 <value-type name="QCursor" delete-in-main-thread="yes">
1306 <value-type name="QCursor" delete-in-main-thread="yes">
1307 <extra-includes>
1307 <extra-includes>
1308 <include file-name="QPixmap" location="global"/>
1308 <include file-name="QPixmap" location="global"/>
1309 </extra-includes>
1309 </extra-includes>
1310 <modify-function signature="operator=(QCursor)" remove="all"/>
1310 <modify-function signature="operator=(QCursor)" remove="all"/>
1311 </value-type>
1311 </value-type>
1312
1312
1313 <value-type name="QFontDatabase" delete-in-main-thread="yes">
1313 <value-type name="QFontDatabase" delete-in-main-thread="yes">
1314 <extra-includes>
1314 <extra-includes>
1315 <include file-name="QStringList" location="global"/>
1315 <include file-name="QStringList" location="global"/>
1316 </extra-includes>
1316 </extra-includes>
1317 </value-type>
1317 </value-type>
1318
1318
1319 <value-type name="QPen">
1319 <value-type name="QPen">
1320 <extra-includes>
1320 <extra-includes>
1321 <include file-name="QBrush" location="global"/>
1321 <include file-name="QBrush" location="global"/>
1322 </extra-includes>
1322 </extra-includes>
1323
1323
1324 <modify-function signature="operator=(QPen)" remove="all"/>
1324 <modify-function signature="operator=(QPen)" remove="all"/>
1325 </value-type>
1325 </value-type>
1326
1326
1327 <value-type name="QBrush">
1327 <value-type name="QBrush">
1328 <modify-function signature="QBrush(Qt::GlobalColor, Qt::BrushStyle)" remove="all"/>
1328 <modify-function signature="QBrush(Qt::GlobalColor, Qt::BrushStyle)" remove="all"/>
1329 <modify-function signature="operator=(const QBrush &amp;)" remove="all"/>
1329 <modify-function signature="operator=(const QBrush &amp;)" remove="all"/>
1330
1330
1331 <extra-includes>
1331 <extra-includes>
1332 <include file-name="QPixmap" location="global"/>
1332 <include file-name="QPixmap" location="global"/>
1333 </extra-includes>
1333 </extra-includes>
1334
1334
1335 <modify-function signature="QBrush(QGradient)">
1335 <modify-function signature="QBrush(QGradient)">
1336 <modify-argument index="1">
1336 <modify-argument index="1">
1337 <replace-type modified-type="QGradient*"/>
1337 <replace-type modified-type="QGradient*"/>
1338 <conversion-rule class="native">
1338 <conversion-rule class="native">
1339 QGradient &amp; %out% = *qscriptvalue_cast&lt;QGradient*&gt;(%in%);
1339 QGradient &amp; %out% = *qscriptvalue_cast&lt;QGradient*&gt;(%in%);
1340 </conversion-rule>
1340 </conversion-rule>
1341 </modify-argument>
1341 </modify-argument>
1342 </modify-function>
1342 </modify-function>
1343 </value-type>
1343 </value-type>
1344
1344
1345 <value-type name="QColor">
1345 <value-type name="QColor">
1346 <modify-function signature="QColor(QColor::Spec)" remove="all"/>
1346 <modify-function signature="QColor(QColor::Spec)" remove="all"/>
1347 <modify-function signature="operator=(QColor)" remove="all"/>
1347 <modify-function signature="operator=(QColor)" remove="all"/>
1348 <modify-function signature="operator=(Qt::GlobalColor)" remove="all"/>
1348 <modify-function signature="operator=(Qt::GlobalColor)" remove="all"/>
1349
1349
1350 <modify-function signature="QColor(const char*)">
1350 <modify-function signature="QColor(const char*)">
1351 <remove/>
1351 <remove/>
1352 </modify-function>
1352 </modify-function>
1353
1353
1354 <modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
1354 <modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
1355 <remove/>
1355 <remove/>
1356 </modify-function>
1356 </modify-function>
1357
1357
1358 <modify-function signature="getCmykF(double*,double*,double*,double*,double*)">
1358 <modify-function signature="getCmykF(double*,double*,double*,double*,double*)">
1359 <remove/>
1359 <remove/>
1360 </modify-function>
1360 </modify-function>
1361
1361
1362 <modify-function signature="getHsv(int*,int*,int*,int*)const">
1362 <modify-function signature="getHsv(int*,int*,int*,int*)const">
1363 <remove/>
1363 <remove/>
1364 </modify-function>
1364 </modify-function>
1365
1365
1366 <modify-function signature="getHsvF(double*,double*,double*,double*)const">
1366 <modify-function signature="getHsvF(double*,double*,double*,double*)const">
1367 <remove/>
1367 <remove/>
1368 </modify-function>
1368 </modify-function>
1369
1369
1370 <modify-function signature="getRgb(int*,int*,int*,int*)const">
1370 <modify-function signature="getRgb(int*,int*,int*,int*)const">
1371 <remove/>
1371 <remove/>
1372 </modify-function>
1372 </modify-function>
1373
1373
1374 <modify-function signature="getRgbF(double*,double*,double*,double*)const">
1374 <modify-function signature="getRgbF(double*,double*,double*,double*)const">
1375 <remove/>
1375 <remove/>
1376 </modify-function>
1376 </modify-function>
1377
1377
1378 <modify-function signature="dark(int)const" remove="all"/> <!--### Obsolete in 4.3-->
1378 <modify-function signature="dark(int)const" remove="all"/> <!--### Obsolete in 4.3-->
1379 <modify-function signature="light(int)const" remove="all"/> <!--### Obsolete in 4.3-->
1379 <modify-function signature="light(int)const" remove="all"/> <!--### Obsolete in 4.3-->
1380 </value-type>
1380 </value-type>
1381
1381
1382 <value-type name="QFontMetricsF" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1382 <value-type name="QFontMetricsF" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1383 <custom-constructor>
1383 <custom-constructor>
1384 return new QFontMetricsF(*copy);
1384 return new QFontMetricsF(*copy);
1385 </custom-constructor>
1385 </custom-constructor>
1386 <custom-destructor>
1386 <custom-destructor>
1387 delete copy;
1387 delete copy;
1388 </custom-destructor>
1388 </custom-destructor>
1389 <modify-function signature="operator!=(const QFontMetricsF &amp;)">
1389 <modify-function signature="operator!=(const QFontMetricsF &amp;)">
1390 <remove/>
1390 <remove/>
1391 </modify-function>
1391 </modify-function>
1392 <modify-function signature="operator==(const QFontMetricsF &amp;)">
1392 <modify-function signature="operator==(const QFontMetricsF &amp;)">
1393 <remove/>
1393 <remove/>
1394 </modify-function>
1394 </modify-function>
1395
1395
1396 <modify-function signature="boundingRect(QRectF,int,QString,int,int*)const">
1396 <modify-function signature="boundingRect(QRectF,int,QString,int,int*)const">
1397 <access modifier="private"/>
1397 <access modifier="private"/>
1398 <modify-argument index="4">
1398 <modify-argument index="4">
1399 <remove-default-expression/>
1399 <remove-default-expression/>
1400 </modify-argument>
1400 </modify-argument>
1401 <modify-argument index="5">
1401 <modify-argument index="5">
1402 <remove-default-expression/>
1402 <remove-default-expression/>
1403 </modify-argument>
1403 </modify-argument>
1404 </modify-function>
1404 </modify-function>
1405
1405
1406 <modify-function signature="operator=(QFontMetrics)" remove="all"/>
1406 <modify-function signature="operator=(QFontMetrics)" remove="all"/>
1407 <modify-function signature="operator=(QFontMetricsF)" remove="all"/>
1407 <modify-function signature="operator=(QFontMetricsF)" remove="all"/>
1408
1408
1409 <modify-function signature="size(int,QString,int,int*)const">
1409 <modify-function signature="size(int,QString,int,int*)const">
1410 <access modifier="private"/>
1410 <access modifier="private"/>
1411 <modify-argument index="3">
1411 <modify-argument index="3">
1412 <remove-default-expression/>
1412 <remove-default-expression/>
1413 </modify-argument>
1413 </modify-argument>
1414 <modify-argument index="4">
1414 <modify-argument index="4">
1415 <remove-default-expression/>
1415 <remove-default-expression/>
1416 </modify-argument>
1416 </modify-argument>
1417 </modify-function>
1417 </modify-function>
1418
1418
1419 <modify-function signature="QFontMetricsF(QFontMetricsF)" remove="all"/>
1419 <modify-function signature="QFontMetricsF(QFontMetricsF)" remove="all"/>
1420 <modify-function signature="QFontMetricsF(QFontMetrics)" remove="all"/>
1420 <modify-function signature="QFontMetricsF(QFontMetrics)" remove="all"/>
1421 <modify-function signature="operator==(QFontMetricsF)const" remove="all"/>
1421 <modify-function signature="operator==(QFontMetricsF)const" remove="all"/>
1422 <modify-function signature="operator!=(QFontMetricsF)const" remove="all"/>
1422 <modify-function signature="operator!=(QFontMetricsF)const" remove="all"/>
1423 </value-type>
1423 </value-type>
1424 <value-type name="QTextOption::Tab"/>
1424 <value-type name="QTextOption::Tab"/>
1425
1425
1426 <value-type name="QFontMetrics" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1426 <value-type name="QFontMetrics" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1427 <custom-constructor>
1427 <custom-constructor>
1428 return new QFontMetrics(*copy);
1428 return new QFontMetrics(*copy);
1429 </custom-constructor>
1429 </custom-constructor>
1430 <custom-destructor>
1430 <custom-destructor>
1431 delete copy;
1431 delete copy;
1432 </custom-destructor>
1432 </custom-destructor>
1433 <modify-function signature="operator!=(const QFontMetrics &amp;)">
1433 <modify-function signature="operator!=(const QFontMetrics &amp;)">
1434 <remove/>
1434 <remove/>
1435 </modify-function>
1435 </modify-function>
1436 <modify-function signature="operator==(const QFontMetrics &amp;)">
1436 <modify-function signature="operator==(const QFontMetrics &amp;)">
1437 <remove/>
1437 <remove/>
1438 </modify-function>
1438 </modify-function>
1439
1439
1440 <modify-function signature="boundingRect(int,int,int,int,int,QString,int,int*)const">
1440 <modify-function signature="boundingRect(int,int,int,int,int,QString,int,int*)const">
1441 <access modifier="private"/>
1441 <access modifier="private"/>
1442 <modify-argument index="7">
1442 <modify-argument index="7">
1443 <remove-default-expression/>
1443 <remove-default-expression/>
1444 </modify-argument>
1444 </modify-argument>
1445 <modify-argument index="8">
1445 <modify-argument index="8">
1446 <remove-default-expression/>
1446 <remove-default-expression/>
1447 </modify-argument>
1447 </modify-argument>
1448 </modify-function>
1448 </modify-function>
1449
1449
1450 <modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
1450 <modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
1451 <access modifier="private"/>
1451 <access modifier="private"/>
1452 <modify-argument index="4">
1452 <modify-argument index="4">
1453 <remove-default-expression/>
1453 <remove-default-expression/>
1454 </modify-argument>
1454 </modify-argument>
1455 <modify-argument index="5">
1455 <modify-argument index="5">
1456 <remove-default-expression/>
1456 <remove-default-expression/>
1457 </modify-argument>
1457 </modify-argument>
1458 </modify-function>
1458 </modify-function>
1459
1459
1460 <modify-function signature="operator=(QFontMetrics)" remove="all"/>
1460 <modify-function signature="operator=(QFontMetrics)" remove="all"/>
1461
1461
1462 <modify-function signature="size(int,QString,int,int*)const">
1462 <modify-function signature="size(int,QString,int,int*)const">
1463 <access modifier="private"/>
1463 <access modifier="private"/>
1464 <modify-argument index="3">
1464 <modify-argument index="3">
1465 <remove-default-expression/>
1465 <remove-default-expression/>
1466 </modify-argument>
1466 </modify-argument>
1467 <modify-argument index="4">
1467 <modify-argument index="4">
1468 <remove-default-expression/>
1468 <remove-default-expression/>
1469 </modify-argument>
1469 </modify-argument>
1470 </modify-function>
1470 </modify-function>
1471
1471
1472
1472
1473 <modify-function signature="QFontMetrics(QFontMetrics)" remove="all"/>
1473 <modify-function signature="QFontMetrics(QFontMetrics)" remove="all"/>
1474 <modify-function signature="operator==(QFontMetrics)const" remove="all"/>
1474 <modify-function signature="operator==(QFontMetrics)const" remove="all"/>
1475 <modify-function signature="operator!=(QFontMetrics)const" remove="all"/>
1475 <modify-function signature="operator!=(QFontMetrics)const" remove="all"/>
1476 </value-type>
1476 </value-type>
1477
1477
1478 <value-type name="QGradient" force-abstract="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
1478 <value-type name="QGradient" force-abstract="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
1479 <custom-constructor>
1479 <custom-constructor>
1480 Q_UNUSED(copy)
1480 Q_UNUSED(copy)
1481 qWarning("Copying empty QGradient object");
1481 qWarning("Copying empty QGradient object");
1482 return new QGradient();
1482 return new QGradient();
1483 </custom-constructor>
1483 </custom-constructor>
1484 <custom-destructor>
1484 <custom-destructor>
1485 delete copy;
1485 delete copy;
1486 </custom-destructor>
1486 </custom-destructor>
1487 <modify-function signature="operator==(const QGradient &amp;)">
1487 <modify-function signature="operator==(const QGradient &amp;)">
1488 <remove/>
1488 <remove/>
1489 </modify-function>
1489 </modify-function>
1490 </value-type>
1490 </value-type>
1491
1491
1492 <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient">
1492 <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient">
1493 <custom-constructor>
1493 <custom-constructor>
1494 QLinearGradient *lg = new QLinearGradient(copy-&gt;start(), copy-&gt;finalStop());
1494 QLinearGradient *lg = new QLinearGradient(copy-&gt;start(), copy-&gt;finalStop());
1495 lg-&gt;setSpread(copy-&gt;spread());
1495 lg-&gt;setSpread(copy-&gt;spread());
1496 lg-&gt;setStops(copy-&gt;stops());
1496 lg-&gt;setStops(copy-&gt;stops());
1497 return (void *) lg;
1497 return (void *) lg;
1498 </custom-constructor>
1498 </custom-constructor>
1499 <custom-destructor>
1499 <custom-destructor>
1500 delete copy;
1500 delete copy;
1501 </custom-destructor>
1501 </custom-destructor>
1502 </value-type>
1502 </value-type>
1503
1503
1504 <value-type name="QPrinterInfo">
1504 <value-type name="QPrinterInfo">
1505 <modify-function signature="operator=(const QPrinterInfo &amp;)" remove="all"/>
1505 <modify-function signature="operator=(const QPrinterInfo &amp;)" remove="all"/>
1506 </value-type>
1506 </value-type>
1507
1507
1508 <value-type name="QMargins"/>
1508 <value-type name="QMargins"/>
1509
1509
1510 <interface-type name="QLayoutItem"/>
1510 <interface-type name="QLayoutItem"/>
1511 <interface-type name="QPaintDevice"/>
1511 <interface-type name="QPaintDevice"/>
1512
1512
1513 <interface-type name="QGraphicsItem" delete-in-main-thread="yes" polymorphic-base="yes">
1513 <interface-type name="QGraphicsItem" delete-in-main-thread="yes" polymorphic-base="yes">
1514 <modify-function signature="setCursorForItemOnly(QCursor)" remove="all"/>
1514 <modify-function signature="setCursorForItemOnly(QCursor)" remove="all"/>
1515
1515
1516 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
1516 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
1517 <modify-function signature="toGraphicsObject() const" remove="all"/>
1517 <modify-function signature="toGraphicsObject() const" remove="all"/>
1518
1518
1519 <modify-function signature="paint(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
1519 <modify-function signature="paint(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
1520 <modify-argument index="1" invalidate-after-use="yes"/>
1520 <modify-argument index="1" invalidate-after-use="yes"/>
1521 </modify-function>
1521 </modify-function>
1522 <modify-function signature="collidesWithItem(const QGraphicsItem*,Qt::ItemSelectionMode)const">
1522 <modify-function signature="collidesWithItem(const QGraphicsItem*,Qt::ItemSelectionMode)const">
1523 <modify-argument index="1" invalidate-after-use="yes"/>
1523 <modify-argument index="1" invalidate-after-use="yes"/>
1524 </modify-function>
1524 </modify-function>
1525
1525
1526 <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
1526 <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
1527 <modify-argument index="1" invalidate-after-use="yes"/>
1527 <modify-argument index="1" invalidate-after-use="yes"/>
1528 </modify-function>
1528 </modify-function>
1529 <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
1529 <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
1530 <modify-argument index="1" invalidate-after-use="yes"/>
1530 <modify-argument index="1" invalidate-after-use="yes"/>
1531 </modify-function>
1531 </modify-function>
1532 <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
1532 <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
1533 <modify-argument index="1" invalidate-after-use="yes"/>
1533 <modify-argument index="1" invalidate-after-use="yes"/>
1534 </modify-function>
1534 </modify-function>
1535 <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
1535 <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
1536 <modify-argument index="1" invalidate-after-use="yes"/>
1536 <modify-argument index="1" invalidate-after-use="yes"/>
1537 </modify-function>
1537 </modify-function>
1538 <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
1538 <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
1539 <modify-argument index="1" invalidate-after-use="yes"/>
1539 <modify-argument index="1" invalidate-after-use="yes"/>
1540 </modify-function>
1540 </modify-function>
1541 <modify-function signature="focusInEvent(QFocusEvent*)">
1541 <modify-function signature="focusInEvent(QFocusEvent*)">
1542 <modify-argument index="1" invalidate-after-use="yes"/>
1542 <modify-argument index="1" invalidate-after-use="yes"/>
1543 </modify-function>
1543 </modify-function>
1544 <modify-function signature="focusOutEvent(QFocusEvent*)">
1544 <modify-function signature="focusOutEvent(QFocusEvent*)">
1545 <modify-argument index="1" invalidate-after-use="yes"/>
1545 <modify-argument index="1" invalidate-after-use="yes"/>
1546 </modify-function>
1546 </modify-function>
1547 <modify-function signature="hoverEnterEvent(QGraphicsSceneHoverEvent*)">
1547 <modify-function signature="hoverEnterEvent(QGraphicsSceneHoverEvent*)">
1548 <modify-argument index="1" invalidate-after-use="yes"/>
1548 <modify-argument index="1" invalidate-after-use="yes"/>
1549 </modify-function>
1549 </modify-function>
1550 <modify-function signature="hoverLeaveEvent(QGraphicsSceneHoverEvent*)">
1550 <modify-function signature="hoverLeaveEvent(QGraphicsSceneHoverEvent*)">
1551 <modify-argument index="1" invalidate-after-use="yes"/>
1551 <modify-argument index="1" invalidate-after-use="yes"/>
1552 </modify-function>
1552 </modify-function>
1553 <modify-function signature="hoverMoveEvent(QGraphicsSceneHoverEvent*)">
1553 <modify-function signature="hoverMoveEvent(QGraphicsSceneHoverEvent*)">
1554 <modify-argument index="1" invalidate-after-use="yes"/>
1554 <modify-argument index="1" invalidate-after-use="yes"/>
1555 </modify-function>
1555 </modify-function>
1556 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
1556 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
1557 <modify-argument index="1" invalidate-after-use="yes"/>
1557 <modify-argument index="1" invalidate-after-use="yes"/>
1558 </modify-function>
1558 </modify-function>
1559 <modify-function signature="isObscuredBy(const QGraphicsItem*)const">
1559 <modify-function signature="isObscuredBy(const QGraphicsItem*)const">
1560 <modify-argument index="1" invalidate-after-use="yes"/>
1560 <modify-argument index="1" invalidate-after-use="yes"/>
1561 </modify-function>
1561 </modify-function>
1562 <modify-function signature="keyPressEvent(QKeyEvent*)">
1562 <modify-function signature="keyPressEvent(QKeyEvent*)">
1563 <modify-argument index="1" invalidate-after-use="yes"/>
1563 <modify-argument index="1" invalidate-after-use="yes"/>
1564 </modify-function>
1564 </modify-function>
1565 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
1565 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
1566 <modify-argument index="1" invalidate-after-use="yes"/>
1566 <modify-argument index="1" invalidate-after-use="yes"/>
1567 </modify-function>
1567 </modify-function>
1568 <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
1568 <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
1569 <modify-argument index="1" invalidate-after-use="yes"/>
1569 <modify-argument index="1" invalidate-after-use="yes"/>
1570 </modify-function>
1570 </modify-function>
1571 <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
1571 <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
1572 <modify-argument index="1" invalidate-after-use="yes"/>
1572 <modify-argument index="1" invalidate-after-use="yes"/>
1573 </modify-function>
1573 </modify-function>
1574 <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
1574 <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
1575 <modify-argument index="1" invalidate-after-use="yes"/>
1575 <modify-argument index="1" invalidate-after-use="yes"/>
1576 </modify-function>
1576 </modify-function>
1577 <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
1577 <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
1578 <modify-argument index="1" invalidate-after-use="yes"/>
1578 <modify-argument index="1" invalidate-after-use="yes"/>
1579 </modify-function>
1579 </modify-function>
1580 <modify-function signature="sceneEvent(QEvent*)">
1580 <modify-function signature="sceneEvent(QEvent*)">
1581 <modify-argument index="1" invalidate-after-use="yes"/>
1581 <modify-argument index="1" invalidate-after-use="yes"/>
1582 </modify-function>
1582 </modify-function>
1583 <modify-function signature="sceneEventFilter(QGraphicsItem*,QEvent*)">
1583 <modify-function signature="sceneEventFilter(QGraphicsItem*,QEvent*)">
1584 <modify-argument index="1" invalidate-after-use="yes"/>
1584 <modify-argument index="1" invalidate-after-use="yes"/>
1585 <modify-argument index="2" invalidate-after-use="yes"/>
1585 <modify-argument index="2" invalidate-after-use="yes"/>
1586 </modify-function>
1586 </modify-function>
1587 <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
1587 <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
1588 <modify-argument index="1" invalidate-after-use="yes"/>
1588 <modify-argument index="1" invalidate-after-use="yes"/>
1589 </modify-function>
1589 </modify-function>
1590
1590
1591 <modify-function signature="children()const" remove="all"/>
1591 <modify-function signature="children()const" remove="all"/>
1592 <modify-function signature="installSceneEventFilter(QGraphicsItem *)">
1592 <modify-function signature="installSceneEventFilter(QGraphicsItem *)">
1593 <modify-argument index="1">
1593 <modify-argument index="1">
1594 <!-- Safe to ignore because items in a scene are memory managed by the scene -->
1594 <!-- Safe to ignore because items in a scene are memory managed by the scene -->
1595 <reference-count action="ignore"/>
1595 <reference-count action="ignore"/>
1596 </modify-argument>
1596 </modify-argument>
1597 </modify-function>
1597 </modify-function>
1598 <modify-function signature="removeSceneEventFilter(QGraphicsItem *)">
1598 <modify-function signature="removeSceneEventFilter(QGraphicsItem *)">
1599 <modify-argument index="1">
1599 <modify-argument index="1">
1600 <!-- Safe to ignore because items in a scene are memory managed by the scene -->
1600 <!-- Safe to ignore because items in a scene are memory managed by the scene -->
1601 <reference-count action="ignore"/>
1601 <reference-count action="ignore"/>
1602 </modify-argument>
1602 </modify-argument>
1603 </modify-function>
1603 </modify-function>
1604
1604
1605 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1605 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1606 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1606 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1607 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1607 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1608 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1608 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1609
1609
1610 <modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
1610 <modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
1611 <modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
1611 <modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
1612 </interface-type>
1612 </interface-type>
1613
1613
1614 <object-type name="QAbstractGraphicsShapeItem" delete-in-main-thread="yes">
1614 <object-type name="QAbstractGraphicsShapeItem" delete-in-main-thread="yes">
1615 <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
1615 <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
1616 <inject-code position="end">
1616 <inject-code position="end">
1617 <argument-map index="1" meta-name="%1"/>
1617 <argument-map index="1" meta-name="%1"/>
1618 if (%1 != null) disableGarbageCollection();
1618 if (%1 != null) disableGarbageCollection();
1619 </inject-code>
1619 </inject-code>
1620 </modify-function>
1620 </modify-function>
1621
1621
1622 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1622 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1623 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1623 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1624 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1624 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1625 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1625 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1626 </object-type>
1626 </object-type>
1627
1627
1628 <object-type name="QAbstractItemView">
1628 <object-type name="QAbstractItemView">
1629 <modify-function signature="update()" remove="all"/>
1629 <modify-function signature="update()" remove="all"/>
1630 <modify-function signature="horizontalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
1630 <modify-function signature="horizontalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
1631 <modify-function signature="setHorizontalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
1631 <modify-function signature="setHorizontalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
1632 <modify-function signature="setVerticalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
1632 <modify-function signature="setVerticalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
1633 <modify-function signature="verticalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
1633 <modify-function signature="verticalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
1634
1634
1635 <modify-function signature="edit(QModelIndex,QAbstractItemView::EditTrigger,QEvent*)">
1635 <modify-function signature="edit(QModelIndex,QAbstractItemView::EditTrigger,QEvent*)">
1636 <modify-argument index="3" invalidate-after-use="yes"/>
1636 <modify-argument index="3" invalidate-after-use="yes"/>
1637 </modify-function>
1637 </modify-function>
1638 <modify-function signature="selectionCommand(QModelIndex,const QEvent*)const">
1638 <modify-function signature="selectionCommand(QModelIndex,const QEvent*)const">
1639 <modify-argument index="2" invalidate-after-use="yes"/>
1639 <modify-argument index="2" invalidate-after-use="yes"/>
1640 </modify-function>
1640 </modify-function>
1641
1641
1642
1642
1643 <!-- ### because the CursorAction enum is protected -->
1643 <!-- ### because the CursorAction enum is protected -->
1644 <modify-function signature="moveCursor(QAbstractItemView::CursorAction,QFlags&lt;Qt::KeyboardModifier&gt;)" remove="all"/>
1644 <modify-function signature="moveCursor(QAbstractItemView::CursorAction,QFlags&lt;Qt::KeyboardModifier&gt;)" remove="all"/>
1645 <inject-code class="shell-declaration">
1645 <inject-code class="shell-declaration">
1646 QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers)
1646 QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers)
1647 { return QModelIndex(); }
1647 { return QModelIndex(); }
1648 </inject-code>
1648 </inject-code>
1649 </object-type>
1649 </object-type>
1650
1650
1651 <object-type name="QAbstractPageSetupDialog"/>
1651 <object-type name="QAbstractPageSetupDialog"/>
1652 <object-type name="QAbstractPrintDialog"/>
1652 <object-type name="QAbstractPrintDialog"/>
1653 <object-type name="QAbstractSlider">
1653 <object-type name="QAbstractSlider">
1654 <modify-function signature="sliderChange(QAbstractSlider::SliderChange)" remove="all"/>
1654 <modify-function signature="sliderChange(QAbstractSlider::SliderChange)" remove="all"/>
1655 </object-type>
1655 </object-type>
1656 <object-type name="QAbstractTextDocumentLayout">
1656 <object-type name="QAbstractTextDocumentLayout">
1657 <modify-function signature="setPaintDevice(QPaintDevice*)">
1657 <modify-function signature="setPaintDevice(QPaintDevice*)">
1658 <modify-argument index="1">
1658 <modify-argument index="1">
1659 <reference-count action="set" variable-name="__rcPaintDevice"/>
1659 <reference-count action="set" variable-name="__rcPaintDevice"/>
1660 </modify-argument>
1660 </modify-argument>
1661 </modify-function>
1661 </modify-function>
1662
1662
1663 <modify-function signature="draw(QPainter*,QAbstractTextDocumentLayout::PaintContext)">
1663 <modify-function signature="draw(QPainter*,QAbstractTextDocumentLayout::PaintContext)">
1664 <modify-argument index="1" invalidate-after-use="yes"/>
1664 <modify-argument index="1" invalidate-after-use="yes"/>
1665 </modify-function>
1665 </modify-function>
1666 <modify-function signature="drawInlineObject(QPainter*,QRectF,QTextInlineObject,int,QTextFormat)">
1666 <modify-function signature="drawInlineObject(QPainter*,QRectF,QTextInlineObject,int,QTextFormat)">
1667 <modify-argument index="1" invalidate-after-use="yes"/>
1667 <modify-argument index="1" invalidate-after-use="yes"/>
1668 </modify-function>
1668 </modify-function>
1669
1669
1670 </object-type>
1670 </object-type>
1671 <object-type name="QAccessible">
1671 <object-type name="QAccessible">
1672 <modify-function signature="initialize()" remove="all"/>
1672 <modify-function signature="initialize()" remove="all"/>
1673 <modify-function signature="cleanup()" remove="all"/>
1673 <modify-function signature="cleanup()" remove="all"/>
1674 <modify-function signature="setRootObject(QObject *)">
1674 <modify-function signature="setRootObject(QObject *)">
1675 <modify-argument index="1">
1675 <modify-argument index="1">
1676 <reference-count action="ignore"/>
1676 <reference-count action="ignore"/>
1677 </modify-argument>
1677 </modify-argument>
1678 </modify-function>
1678 </modify-function>
1679 <modify-function signature="queryAccessibleInterface(QObject *)">
1679 <modify-function signature="queryAccessibleInterface(QObject *)">
1680 <modify-argument index="return">
1680 <modify-argument index="return">
1681 <define-ownership class="java" owner="java"/>
1681 <define-ownership class="java" owner="java"/>
1682 </modify-argument>
1682 </modify-argument>
1683 </modify-function>
1683 </modify-function>
1684 </object-type>
1684 </object-type>
1685 <object-type name="QAccessibleBridge">
1685 <object-type name="QAccessibleBridge">
1686 <modify-function signature="setRootObject(QAccessibleInterface *)">
1686 <modify-function signature="setRootObject(QAccessibleInterface *)">
1687 <modify-argument index="1">
1687 <modify-argument index="1">
1688 <define-ownership class="shell" owner="java"/>
1688 <define-ownership class="shell" owner="java"/>
1689 </modify-argument>
1689 </modify-argument>
1690 </modify-function>
1690 </modify-function>
1691 <modify-function signature="notifyAccessibilityUpdate(int,QAccessibleInterface*,int)">
1691 <modify-function signature="notifyAccessibilityUpdate(int,QAccessibleInterface*,int)">
1692 <modify-argument invalidate-after-use="yes" index="2"/>
1692 <modify-argument invalidate-after-use="yes" index="2"/>
1693 </modify-function>
1693 </modify-function>
1694 </object-type>
1694 </object-type>
1695 <object-type name="QAccessible2Interface"/>
1695 <object-type name="QAccessible2Interface"/>
1696 <object-type name="QAccessibleTableInterface">
1696 <object-type name="QAccessibleTableInterface">
1697 <modify-function signature="qAccessibleTableCastHelper()" remove="all"/>
1697 <modify-function signature="qAccessibleTableCastHelper()" remove="all"/>
1698 </object-type>
1698 </object-type>
1699
1699
1700 <object-type name="QAccessibleInterface">
1700 <object-type name="QAccessibleInterface">
1701 <modify-function signature="indexOfChild(const QAccessibleInterface*)const">
1701 <modify-function signature="indexOfChild(const QAccessibleInterface*)const">
1702 <modify-argument invalidate-after-use="yes" index="1"/>
1702 <modify-argument invalidate-after-use="yes" index="1"/>
1703 </modify-function>
1703 </modify-function>
1704 <modify-function signature="relationTo(int,const QAccessibleInterface*,int)const">
1704 <modify-function signature="relationTo(int,const QAccessibleInterface*,int)const">
1705 <modify-argument invalidate-after-use="yes" index="2"/>
1705 <modify-argument invalidate-after-use="yes" index="2"/>
1706 </modify-function>
1706 </modify-function>
1707 </object-type>
1707 </object-type>
1708 <object-type name="QAccessibleInterfaceEx"/>
1708 <object-type name="QAccessibleInterfaceEx"/>
1709 <object-type name="QAccessibleObject"/>
1709 <object-type name="QAccessibleObject"/>
1710 <object-type name="QAccessibleObjectEx"/>
1710 <object-type name="QAccessibleObjectEx"/>
1711 <object-type name="QAccessibleWidget"/>
1711 <object-type name="QAccessibleWidget"/>
1712 <object-type name="QAccessibleWidgetEx"/>
1712 <object-type name="QAccessibleWidgetEx"/>
1713 <object-type name="QActionGroup"/>
1713 <object-type name="QActionGroup"/>
1714 <object-type name="QCDEStyle">
1714 <object-type name="QCDEStyle">
1715 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1715 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1716 </object-type>
1716 </object-type>
1717 <object-type name="QCheckBox">
1717 <object-type name="QCheckBox">
1718 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
1718 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
1719 <access modifier="private"/>
1719 <access modifier="private"/>
1720 </modify-function>
1720 </modify-function>
1721 </object-type>
1721 </object-type>
1722 <object-type name="QCleanlooksStyle">
1722 <object-type name="QCleanlooksStyle">
1723 <modify-function signature="standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
1723 <modify-function signature="standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
1724 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1724 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1725 </object-type>
1725 </object-type>
1726 <object-type name="QCommonStyle">
1726 <object-type name="QCommonStyle">
1727 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
1727 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
1728 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1728 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1729 </object-type>
1729 </object-type>
1730 <object-type name="QDataWidgetMapper">
1730 <object-type name="QDataWidgetMapper">
1731 <modify-function signature="addMapping(QWidget*,int)">
1731 <modify-function signature="addMapping(QWidget*,int)">
1732 <modify-argument index="1">
1732 <modify-argument index="1">
1733 <reference-count action="add" variable-name="__rcMappings"/>
1733 <reference-count action="add" variable-name="__rcMappings"/>
1734 </modify-argument>
1734 </modify-argument>
1735 </modify-function>
1735 </modify-function>
1736 <modify-function signature="addMapping(QWidget*,int,QByteArray)">
1736 <modify-function signature="addMapping(QWidget*,int,QByteArray)">
1737 <modify-argument index="1">
1737 <modify-argument index="1">
1738 <reference-count action="add" variable-name="__rcMappings"/>
1738 <reference-count action="add" variable-name="__rcMappings"/>
1739 </modify-argument>
1739 </modify-argument>
1740 </modify-function>
1740 </modify-function>
1741 <modify-function signature="removeMapping(QWidget*)">
1741 <modify-function signature="removeMapping(QWidget*)">
1742 <modify-argument index="1">
1742 <modify-argument index="1">
1743 <reference-count action="remove" variable-name="__rcMappings"/>
1743 <reference-count action="remove" variable-name="__rcMappings"/>
1744 </modify-argument>
1744 </modify-argument>
1745 </modify-function>
1745 </modify-function>
1746 <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
1746 <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
1747 <modify-argument index="1">
1747 <modify-argument index="1">
1748 <reference-count action="set" variable-name="__rcItemDelegate"/>
1748 <reference-count action="set" variable-name="__rcItemDelegate"/>
1749 </modify-argument>
1749 </modify-argument>
1750 </modify-function>
1750 </modify-function>
1751 <modify-function signature="setModel(QAbstractItemModel*)">
1751 <modify-function signature="setModel(QAbstractItemModel*)">
1752 <modify-argument index="1">
1752 <modify-argument index="1">
1753 <reference-count action="set" variable-name="__rcModel"/>
1753 <reference-count action="set" variable-name="__rcModel"/>
1754 </modify-argument>
1754 </modify-argument>
1755 </modify-function>
1755 </modify-function>
1756 </object-type>
1756 </object-type>
1757 <object-type name="QDateEdit"/>
1757 <object-type name="QDateEdit"/>
1758 <object-type name="QDesktopServices">
1758 <object-type name="QDesktopServices">
1759 <modify-function signature="setUrlHandler(const QString &amp;, QObject *, const char *)" access="private">
1759 <modify-function signature="setUrlHandler(const QString &amp;, QObject *, const char *)" access="private">
1760 <modify-argument index="2">
1760 <modify-argument index="2">
1761 <reference-count action="ignore"/> <!-- Handled in injected code -->
1761 <reference-count action="ignore"/> <!-- Handled in injected code -->
1762 </modify-argument>
1762 </modify-argument>
1763 </modify-function>
1763 </modify-function>
1764 </object-type>
1764 </object-type>
1765 <object-type name="QDialog">
1765 <object-type name="QDialog">
1766 <modify-function signature="setExtension(QWidget*)" remove="all"/>
1766 <modify-function signature="setExtension(QWidget*)" remove="all"/>
1767 <modify-function signature="exec()" access="non-final"/>
1767 <modify-function signature="exec()" access="non-final"/>
1768 <modify-function signature="extension()const" remove="all"/> <!--### Obsolete in 4.3-->
1768 <modify-function signature="extension()const" remove="all"/> <!--### Obsolete in 4.3-->
1769 <modify-function signature="orientation()const" remove="all"/> <!--### Obsolete in 4.3-->
1769 <modify-function signature="orientation()const" remove="all"/> <!--### Obsolete in 4.3-->
1770 <modify-function signature="open()" virtual-slot="yes"/>
1770 <modify-function signature="open()" virtual-slot="yes"/>
1771 <modify-function signature="setOrientation(Qt::Orientation)" remove="all"/> <!--### Obsolete in 4.3-->
1771 <modify-function signature="setOrientation(Qt::Orientation)" remove="all"/> <!--### Obsolete in 4.3-->
1772 <modify-function signature="showExtension(bool)" remove="all"/> <!--### Obsolete in 4.3-->
1772 <modify-function signature="showExtension(bool)" remove="all"/> <!--### Obsolete in 4.3-->
1773 <modify-function signature="setVisible(bool)" allow-as-slot="yes"/>
1773 <modify-function signature="setVisible(bool)" allow-as-slot="yes"/>
1774 </object-type>
1774 </object-type>
1775 <object-type name="QDialogButtonBox">
1775 <object-type name="QDialogButtonBox">
1776 <modify-function signature="addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)">
1776 <modify-function signature="addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)">
1777 <modify-argument index="1">
1777 <modify-argument index="1">
1778 <reference-count action="ignore"/>
1778 <reference-count action="ignore"/>
1779 </modify-argument>
1779 </modify-argument>
1780 </modify-function>
1780 </modify-function>
1781 <modify-function signature="removeButton(QAbstractButton*)">
1781 <modify-function signature="removeButton(QAbstractButton*)">
1782 <modify-argument index="1">
1782 <modify-argument index="1">
1783 <reference-count action="ignore"/>
1783 <reference-count action="ignore"/>
1784 </modify-argument>
1784 </modify-argument>
1785 </modify-function>
1785 </modify-function>
1786 </object-type>
1786 </object-type>
1787 <object-type name="QDirModel">
1787 <object-type name="QDirModel">
1788 <modify-function signature="parent()const" remove="all"/>
1788 <modify-function signature="parent()const" remove="all"/>
1789 <modify-function signature="setIconProvider(QFileIconProvider*)">
1789 <modify-function signature="setIconProvider(QFileIconProvider*)">
1790 <modify-argument index="1">
1790 <modify-argument index="1">
1791 <reference-count action="set" variable-name="__rcIconProvider"/>
1791 <reference-count action="set" variable-name="__rcIconProvider"/>
1792 </modify-argument>
1792 </modify-argument>
1793 </modify-function>
1793 </modify-function>
1794 </object-type>
1794 </object-type>
1795 <object-type name="QDoubleValidator"/>
1795 <object-type name="QDoubleValidator"/>
1796 <object-type name="QFileIconProvider"/>
1796 <object-type name="QFileIconProvider"/>
1797 <object-type name="QWizard">
1797 <object-type name="QWizard">
1798 <!-- ### Requires correct class name in meta object -->
1798 <!-- ### Requires correct class name in meta object -->
1799 <modify-function signature="setDefaultProperty(const char *, const char *, const char *)" remove="all"/>
1799 <modify-function signature="setDefaultProperty(const char *, const char *, const char *)" remove="all"/>
1800 <modify-function signature="addPage(QWizardPage*)">
1800 <modify-function signature="addPage(QWizardPage*)">
1801 <modify-argument index="1">
1801 <modify-argument index="1">
1802 <no-null-pointer/>
1802 <no-null-pointer/>
1803 <reference-count action="ignore"/>
1803 <reference-count action="ignore"/>
1804 </modify-argument>
1804 </modify-argument>
1805 </modify-function>
1805 </modify-function>
1806 <modify-function signature="setButton(QWizard::WizardButton,QAbstractButton*)">
1806 <modify-function signature="setButton(QWizard::WizardButton,QAbstractButton*)">
1807 <modify-argument index="1">
1807 <modify-argument index="1">
1808 <reference-count action="ignore"/>
1808 <reference-count action="ignore"/>
1809 </modify-argument>
1809 </modify-argument>
1810 </modify-function>
1810 </modify-function>
1811 <modify-function signature="setPage(int,QWizardPage*)">
1811 <modify-function signature="setPage(int,QWizardPage*)">
1812 <modify-argument index="2">
1812 <modify-argument index="2">
1813 <no-null-pointer/>
1813 <no-null-pointer/>
1814 <reference-count action="ignore"/>
1814 <reference-count action="ignore"/>
1815 </modify-argument>
1815 </modify-argument>
1816 </modify-function>
1816 </modify-function>
1817
1817
1818 </object-type>
1818 </object-type>
1819 <object-type name="QWizardPage">
1819 <object-type name="QWizardPage">
1820 <!-- ### Reduced functionality due to meta object having missing information -->
1820 <!-- ### Reduced functionality due to meta object having missing information -->
1821 <modify-function signature="registerField(const QString &amp;, QWidget *, const char *, const char *)">
1821 <modify-function signature="registerField(const QString &amp;, QWidget *, const char *, const char *)">
1822 <access modifier="private"/>
1822 <access modifier="private"/>
1823 <modify-argument index="3">
1823 <modify-argument index="3">
1824 <remove-default-expression/>
1824 <remove-default-expression/>
1825 </modify-argument>
1825 </modify-argument>
1826 <modify-argument index="4">
1826 <modify-argument index="4">
1827 <remove-default-expression/>
1827 <remove-default-expression/>
1828 </modify-argument>
1828 </modify-argument>
1829 </modify-function>
1829 </modify-function>
1830
1830
1831 </object-type>
1831 </object-type>
1832 <object-type name="QFocusFrame">
1832 <object-type name="QFocusFrame">
1833 <modify-function signature="initStyleOption(QStyleOption*)const">
1833 <modify-function signature="initStyleOption(QStyleOption*)const">
1834 <access modifier="private"/>
1834 <access modifier="private"/>
1835 </modify-function>
1835 </modify-function>
1836 <modify-function signature="setWidget(QWidget*)">
1836 <modify-function signature="setWidget(QWidget*)">
1837 <modify-argument index="1">
1837 <modify-argument index="1">
1838 <reference-count action="set" variable-name="__rcWidget"/>
1838 <reference-count action="set" variable-name="__rcWidget"/>
1839 </modify-argument>
1839 </modify-argument>
1840 </modify-function>
1840 </modify-function>
1841 <inject-code>
1841 <inject-code>
1842 <insert-template name="gui.init_style_option">
1842 <insert-template name="gui.init_style_option">
1843 <replace from="%TYPE" to="QStyleOption"/>
1843 <replace from="%TYPE" to="QStyleOption"/>
1844 </insert-template>
1844 </insert-template>
1845 </inject-code>
1845 </inject-code>
1846 </object-type>
1846 </object-type>
1847 <object-type name="QFontComboBox"/>
1847 <object-type name="QFontComboBox"/>
1848 <object-type name="QFontDialog">
1848 <object-type name="QFontDialog">
1849 <inject-code class="native" position="beginning">
1849 <inject-code class="native" position="beginning">
1850 Q_DECLARE_METATYPE(QScriptValue)
1850 Q_DECLARE_METATYPE(QScriptValue)
1851 </inject-code>
1851 </inject-code>
1852 <modify-function signature="getFont(bool*,QWidget*)">
1852 <modify-function signature="getFont(bool*,QWidget*)">
1853 <modify-argument index="1">
1853 <modify-argument index="1">
1854 <remove-argument/>
1854 <remove-argument/>
1855 <conversion-rule class="native">
1855 <conversion-rule class="native">
1856 <insert-template name="core.prepare_removed_bool*_argument"/>
1856 <insert-template name="core.prepare_removed_bool*_argument"/>
1857 </conversion-rule>
1857 </conversion-rule>
1858 </modify-argument>
1858 </modify-argument>
1859 <modify-argument index="return">
1859 <modify-argument index="return">
1860 <conversion-rule class="native">
1860 <conversion-rule class="native">
1861 <insert-template name="core.convert_to_null_or_wrap"/>
1861 <insert-template name="core.convert_to_null_or_wrap"/>
1862 </conversion-rule>
1862 </conversion-rule>
1863 </modify-argument>
1863 </modify-argument>
1864 </modify-function>
1864 </modify-function>
1865
1865
1866 <modify-function signature="getFont(bool*,QFont,QWidget*)">
1866 <modify-function signature="getFont(bool*,QFont,QWidget*)">
1867 <modify-argument index="1">
1867 <modify-argument index="1">
1868 <remove-argument/>
1868 <remove-argument/>
1869 <conversion-rule class="native">
1869 <conversion-rule class="native">
1870 <insert-template name="core.prepare_removed_bool*_argument"/>
1870 <insert-template name="core.prepare_removed_bool*_argument"/>
1871 </conversion-rule>
1871 </conversion-rule>
1872 </modify-argument>
1872 </modify-argument>
1873 <modify-argument index="return">
1873 <modify-argument index="return">
1874 <conversion-rule class="native">
1874 <conversion-rule class="native">
1875 <insert-template name="core.convert_to_null_or_wrap"/>
1875 <insert-template name="core.convert_to_null_or_wrap"/>
1876 </conversion-rule>
1876 </conversion-rule>
1877 </modify-argument>
1877 </modify-argument>
1878 </modify-function>
1878 </modify-function>
1879
1879
1880 <modify-function signature="getFont(bool*,QFont,QWidget*,QString)">
1880 <modify-function signature="getFont(bool*,QFont,QWidget*,QString)">
1881 <modify-argument index="1">
1881 <modify-argument index="1">
1882 <remove-argument/>
1882 <remove-argument/>
1883 <conversion-rule class="native">
1883 <conversion-rule class="native">
1884 <insert-template name="core.prepare_removed_bool*_argument"/>
1884 <insert-template name="core.prepare_removed_bool*_argument"/>
1885 </conversion-rule>
1885 </conversion-rule>
1886 </modify-argument>
1886 </modify-argument>
1887 <modify-argument index="return">
1887 <modify-argument index="return">
1888 <conversion-rule class="native">
1888 <conversion-rule class="native">
1889 <insert-template name="core.convert_to_null_or_wrap"/>
1889 <insert-template name="core.convert_to_null_or_wrap"/>
1890 </conversion-rule>
1890 </conversion-rule>
1891 </modify-argument>
1891 </modify-argument>
1892 </modify-function>
1892 </modify-function>
1893 </object-type>
1893 </object-type>
1894
1894
1895 <object-type name="QGraphicsEllipseItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsEllipseItem::Type" />
1895 <object-type name="QGraphicsEllipseItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsEllipseItem::Type" />
1896 <object-type name="QGraphicsItemAnimation">
1896 <object-type name="QGraphicsItemAnimation">
1897 <modify-function signature="setItem(QGraphicsItem*)">
1897 <modify-function signature="setItem(QGraphicsItem*)">
1898 <modify-argument index="1">
1898 <modify-argument index="1">
1899 <reference-count action="set" variable-name="__rcItem"/>
1899 <reference-count action="set" variable-name="__rcItem"/>
1900 </modify-argument>
1900 </modify-argument>
1901 </modify-function>
1901 </modify-function>
1902 <modify-function signature="setTimeLine(QTimeLine*)">
1902 <modify-function signature="setTimeLine(QTimeLine*)">
1903 <modify-argument index="1">
1903 <modify-argument index="1">
1904 <reference-count action="set" variable-name="__rcTimeLine"/>
1904 <reference-count action="set" variable-name="__rcTimeLine"/>
1905 </modify-argument>
1905 </modify-argument>
1906 </modify-function>
1906 </modify-function>
1907
1907
1908 <extra-includes>
1908 <extra-includes>
1909 <include file-name="QPair" location="global"/>
1909 <include file-name="QPair" location="global"/>
1910 </extra-includes>
1910 </extra-includes>
1911 </object-type>
1911 </object-type>
1912 <object-type name="QGraphicsItemGroup" delete-in-main-thread="yes"
1912 <object-type name="QGraphicsItemGroup" delete-in-main-thread="yes"
1913 polymorphic-id-expression="%1-&gt;type() == QGraphicsItemGroup::Type">
1913 polymorphic-id-expression="%1-&gt;type() == QGraphicsItemGroup::Type">
1914 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1914 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1915 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1915 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1916 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1916 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1917 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1917 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1918 </object-type>
1918 </object-type>
1919 <object-type name="QGraphicsLineItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsLineItem::Type">
1919 <object-type name="QGraphicsLineItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsLineItem::Type">
1920 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1920 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1921 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1921 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1922 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1922 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1923 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1923 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1924 </object-type>
1924 </object-type>
1925 <object-type name="QGraphicsPathItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPathItem::Type"/>
1925 <object-type name="QGraphicsPathItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPathItem::Type"/>
1926
1926
1927 <object-type name="QGraphicsPixmapItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPixmapItem::Type">
1927 <object-type name="QGraphicsPixmapItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPixmapItem::Type">
1928 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1928 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1929 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1929 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1930 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1930 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1931 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1931 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1932 </object-type>
1932 </object-type>
1933 <object-type name="QGraphicsPolygonItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPolygonItem::Type"/>
1933 <object-type name="QGraphicsPolygonItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPolygonItem::Type"/>
1934 <object-type name="QGraphicsRectItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsRectItem::Type"/>
1934 <object-type name="QGraphicsRectItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsRectItem::Type"/>
1935 <object-type name="QGraphicsSimpleTextItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsSimpleTextItem::Type"/>
1935 <object-type name="QGraphicsSimpleTextItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsSimpleTextItem::Type"/>
1936 <object-type name="QHBoxLayout"/>
1936 <object-type name="QHBoxLayout"/>
1937 <object-type name="QHeaderView">
1937 <object-type name="QHeaderView">
1938 <modify-function signature="initStyleOption(QStyleOptionHeader*)const">
1938 <modify-function signature="initStyleOption(QStyleOptionHeader*)const">
1939 <access modifier="private"/>
1939 <access modifier="private"/>
1940 </modify-function>
1940 </modify-function>
1941
1941
1942 <modify-function signature="paintSection(QPainter*,QRect,int)const">
1942 <modify-function signature="paintSection(QPainter*,QRect,int)const">
1943 <modify-argument index="1" invalidate-after-use="yes"/>
1943 <modify-argument index="1" invalidate-after-use="yes"/>
1944 </modify-function>
1944 </modify-function>
1945
1945
1946 <inject-code>
1946 <inject-code>
1947 <insert-template name="gui.init_style_option">
1947 <insert-template name="gui.init_style_option">
1948 <replace from="%TYPE" to="QStyleOptionHeader"/>
1948 <replace from="%TYPE" to="QStyleOptionHeader"/>
1949 </insert-template>
1949 </insert-template>
1950 </inject-code>
1950 </inject-code>
1951 <modify-function signature="setModel(QAbstractItemModel*)">
1951 <modify-function signature="setModel(QAbstractItemModel*)">
1952 <modify-argument index="1">
1952 <modify-argument index="1">
1953 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcModel"/>
1953 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcModel"/>
1954 </modify-argument>
1954 </modify-argument>
1955 </modify-function>
1955 </modify-function>
1956 </object-type>
1956 </object-type>
1957 <object-type name="QIconEngine">
1957 <object-type name="QIconEngine">
1958 <modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
1958 <modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
1959 <modify-argument index="1" invalidate-after-use="yes"/>
1959 <modify-argument index="1" invalidate-after-use="yes"/>
1960 </modify-function>
1960 </modify-function>
1961 </object-type>
1961 </object-type>
1962 <object-type name="QIconEngineV2">
1962 <object-type name="QIconEngineV2">
1963 <modify-function signature="read(QDataStream&amp;)">
1963 <modify-function signature="read(QDataStream&amp;)">
1964 <modify-argument index="1" invalidate-after-use="yes"/>
1964 <modify-argument index="1" invalidate-after-use="yes"/>
1965 </modify-function>
1965 </modify-function>
1966 <modify-function signature="write(QDataStream&amp;)const">
1966 <modify-function signature="write(QDataStream&amp;)const">
1967 <modify-argument index="1" invalidate-after-use="yes"/>
1967 <modify-argument index="1" invalidate-after-use="yes"/>
1968 </modify-function>
1968 </modify-function>
1969
1969
1970 <modify-function signature="virtual_hook(int,void*)" remove="all"/>
1970 <modify-function signature="virtual_hook(int,void*)" remove="all"/>
1971 <modify-function signature="clone()const">
1971 <modify-function signature="clone()const">
1972 <modify-argument index="return">
1972 <modify-argument index="return">
1973 <define-ownership class="shell" owner="c++"/>
1973 <define-ownership class="shell" owner="c++"/>
1974 </modify-argument>
1974 </modify-argument>
1975 </modify-function>
1975 </modify-function>
1976 </object-type>
1976 </object-type>
1977 <object-type name="QImageWriter">
1977 <object-type name="QImageWriter">
1978 <modify-function signature="setDevice(QIODevice*)">
1978 <modify-function signature="setDevice(QIODevice*)">
1979 <modify-argument index="1">
1979 <modify-argument index="1">
1980 <reference-count action="set" variable-name="__rcDevice"/>
1980 <reference-count action="set" variable-name="__rcDevice"/>
1981 </modify-argument>
1981 </modify-argument>
1982 </modify-function>
1982 </modify-function>
1983 <modify-function signature="description()const" remove="all"/> <!--### Obsolete in 4.3-->
1983 <modify-function signature="description()const" remove="all"/> <!--### Obsolete in 4.3-->
1984 <modify-function signature="setDescription(QString)" remove="all"/> <!--### Obsolete in 4.3-->
1984 <modify-function signature="setDescription(QString)" remove="all"/> <!--### Obsolete in 4.3-->
1985 </object-type>
1985 </object-type>
1986 <object-type name="QInputContextFactory"/>
1986 <object-type name="QInputContextFactory"/>
1987 <object-type name="QIntValidator"/>
1987 <object-type name="QIntValidator"/>
1988 <object-type name="QItemDelegate">
1988 <object-type name="QItemDelegate">
1989 <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const">
1989 <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const">
1990 <remove/>
1990 <remove/>
1991 </modify-function>
1991 </modify-function>
1992
1992
1993 <modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const">
1993 <modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const">
1994 <modify-argument index="1" invalidate-after-use="yes"/>
1994 <modify-argument index="1" invalidate-after-use="yes"/>
1995 </modify-function>
1995 </modify-function>
1996 <modify-function signature="drawDecoration(QPainter*,QStyleOptionViewItem,QRect,QPixmap)const">
1996 <modify-function signature="drawDecoration(QPainter*,QStyleOptionViewItem,QRect,QPixmap)const">
1997 <modify-argument index="1" invalidate-after-use="yes"/>
1997 <modify-argument index="1" invalidate-after-use="yes"/>
1998 </modify-function>
1998 </modify-function>
1999 <modify-function signature="drawDisplay(QPainter*,QStyleOptionViewItem,QRect,QString)const">
1999 <modify-function signature="drawDisplay(QPainter*,QStyleOptionViewItem,QRect,QString)const">
2000 <modify-argument index="1" invalidate-after-use="yes"/>
2000 <modify-argument index="1" invalidate-after-use="yes"/>
2001 </modify-function>
2001 </modify-function>
2002 <modify-function signature="drawFocus(QPainter*,QStyleOptionViewItem,QRect)const">
2002 <modify-function signature="drawFocus(QPainter*,QStyleOptionViewItem,QRect)const">
2003 <modify-argument index="1" invalidate-after-use="yes"/>
2003 <modify-argument index="1" invalidate-after-use="yes"/>
2004 </modify-function>
2004 </modify-function>
2005
2005
2006
2006
2007 <modify-function signature="selected(QPixmap,QPalette,bool)const">
2007 <modify-function signature="selected(QPixmap,QPalette,bool)const">
2008 <remove/>
2008 <remove/>
2009 </modify-function>
2009 </modify-function>
2010 <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
2010 <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
2011 <modify-argument index="1">
2011 <modify-argument index="1">
2012 <reference-count action="set" variable-name="__rcItemEditorFactory"/>
2012 <reference-count action="set" variable-name="__rcItemEditorFactory"/>
2013 </modify-argument>
2013 </modify-argument>
2014 </modify-function>
2014 </modify-function>
2015 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
2015 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
2016 <modify-argument index="1">
2016 <modify-argument index="1">
2017 <reference-count action="ignore"/>
2017 <reference-count action="ignore"/>
2018 </modify-argument>
2018 </modify-argument>
2019 </modify-function>
2019 </modify-function>
2020 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
2020 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
2021 <modify-argument index="1">
2021 <modify-argument index="1">
2022 <reference-count action="ignore"/>
2022 <reference-count action="ignore"/>
2023 </modify-argument>
2023 </modify-argument>
2024 </modify-function>
2024 </modify-function>
2025
2025
2026 </object-type>
2026 </object-type>
2027 <object-type name="QItemEditorCreatorBase"/>
2027 <object-type name="QItemEditorCreatorBase"/>
2028 <object-type name="QItemEditorFactory">
2028 <object-type name="QItemEditorFactory">
2029 <modify-function signature="registerEditor(QVariant::Type, QItemEditorCreatorBase *)">
2029 <modify-function signature="registerEditor(QVariant::Type, QItemEditorCreatorBase *)">
2030 <modify-argument index="2">
2030 <modify-argument index="2">
2031 <define-ownership class="java" owner="c++"/>
2031 <define-ownership class="java" owner="c++"/>
2032 </modify-argument>
2032 </modify-argument>
2033 </modify-function>
2033 </modify-function>
2034 <modify-function signature="setDefaultFactory(QItemEditorFactory *)">
2034 <modify-function signature="setDefaultFactory(QItemEditorFactory *)">
2035 <modify-argument index="1">
2035 <modify-argument index="1">
2036 <reference-count action="set" variable-name="__rcDefaultItemEditorFactory"/>
2036 <reference-count action="set" variable-name="__rcDefaultItemEditorFactory"/>
2037 </modify-argument>
2037 </modify-argument>
2038 </modify-function>
2038 </modify-function>
2039 </object-type>
2039 </object-type>
2040 <object-type name="QItemSelectionModel"/>
2040 <object-type name="QItemSelectionModel"/>
2041 <object-type name="QTreeModel"/>
2041 <object-type name="QTreeModel"/>
2042 <object-type name="QListView"/>
2042 <object-type name="QListView"/>
2043 <object-type name="QColumnView">
2043 <object-type name="QColumnView">
2044 <modify-function signature="setPreviewWidget(QWidget*)">
2044 <modify-function signature="setPreviewWidget(QWidget*)">
2045 <modify-argument index="1">
2045 <modify-argument index="1">
2046 <reference-count action="ignore"/>
2046 <reference-count action="ignore"/>
2047 </modify-argument>
2047 </modify-argument>
2048 </modify-function>
2048 </modify-function>
2049 <modify-function signature="setModel(QAbstractItemModel*)">
2049 <modify-function signature="setModel(QAbstractItemModel*)">
2050 <modify-argument index="1">
2050 <modify-argument index="1">
2051 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2051 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2052 </modify-argument>
2052 </modify-argument>
2053 </modify-function>
2053 </modify-function>
2054 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2054 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2055 <modify-argument index="1">
2055 <modify-argument index="1">
2056 <no-null-pointer/>
2056 <no-null-pointer/>
2057 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2057 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2058 </modify-argument>
2058 </modify-argument>
2059 </modify-function>
2059 </modify-function>
2060 </object-type>
2060 </object-type>
2061 <object-type name="QMainWindow">
2061 <object-type name="QMainWindow">
2062 <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*,Qt::Orientation)">
2062 <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*,Qt::Orientation)">
2063 <modify-argument index="2">
2063 <modify-argument index="2">
2064 <reference-count action="ignore"/>
2064 <reference-count action="ignore"/>
2065 </modify-argument>
2065 </modify-argument>
2066 </modify-function>
2066 </modify-function>
2067 <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*)">
2067 <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*)">
2068 <modify-argument index="2">
2068 <modify-argument index="2">
2069 <reference-count action="ignore"/>
2069 <reference-count action="ignore"/>
2070 </modify-argument>
2070 </modify-argument>
2071 </modify-function>
2071 </modify-function>
2072 <modify-function signature="addToolBar(QToolBar*)">
2072 <modify-function signature="addToolBar(QToolBar*)">
2073 <modify-argument index="1">
2073 <modify-argument index="1">
2074 <reference-count action="ignore"/>
2074 <reference-count action="ignore"/>
2075 </modify-argument>
2075 </modify-argument>
2076 </modify-function>
2076 </modify-function>
2077 <modify-function signature="addToolBar(Qt::ToolBarArea,QToolBar*)">
2077 <modify-function signature="addToolBar(Qt::ToolBarArea,QToolBar*)">
2078 <modify-argument index="2">
2078 <modify-argument index="2">
2079 <reference-count action="ignore"/>
2079 <reference-count action="ignore"/>
2080 </modify-argument>
2080 </modify-argument>
2081 </modify-function>
2081 </modify-function>
2082 <modify-function signature="insertToolBar(QToolBar*,QToolBar*)">
2082 <modify-function signature="insertToolBar(QToolBar*,QToolBar*)">
2083 <modify-argument index="2">
2083 <modify-argument index="2">
2084 <reference-count action="ignore"/>
2084 <reference-count action="ignore"/>
2085 </modify-argument>
2085 </modify-argument>
2086 <modify-argument index="2">
2086 <modify-argument index="2">
2087 <reference-count action="ignore"/>
2087 <reference-count action="ignore"/>
2088 </modify-argument>
2088 </modify-argument>
2089 </modify-function>
2089 </modify-function>
2090 <modify-function signature="insertToolBarBreak(QToolBar*)">
2090 <modify-function signature="insertToolBarBreak(QToolBar*)">
2091 <modify-argument index="1">
2091 <modify-argument index="1">
2092 <reference-count action="ignore"/>
2092 <reference-count action="ignore"/>
2093 </modify-argument>
2093 </modify-argument>
2094 </modify-function>
2094 </modify-function>
2095 <modify-function signature="removeDockWidget(QDockWidget*)">
2095 <modify-function signature="removeDockWidget(QDockWidget*)">
2096 <modify-argument index="1">
2096 <modify-argument index="1">
2097 <reference-count action="ignore"/>
2097 <reference-count action="ignore"/>
2098 </modify-argument>
2098 </modify-argument>
2099 </modify-function>
2099 </modify-function>
2100 <modify-function signature="removeToolBar(QToolBar*)">
2100 <modify-function signature="removeToolBar(QToolBar*)">
2101 <modify-argument index="1">
2101 <modify-argument index="1">
2102 <reference-count action="ignore"/>
2102 <reference-count action="ignore"/>
2103 </modify-argument>
2103 </modify-argument>
2104 </modify-function>
2104 </modify-function>
2105 <modify-function signature="removeToolBarBreak(QToolBar*)">
2105 <modify-function signature="removeToolBarBreak(QToolBar*)">
2106 <modify-argument index="1">
2106 <modify-argument index="1">
2107 <reference-count action="ignore"/>
2107 <reference-count action="ignore"/>
2108 </modify-argument>
2108 </modify-argument>
2109 </modify-function>
2109 </modify-function>
2110 <modify-function signature="setCentralWidget(QWidget*)">
2110 <modify-function signature="setCentralWidget(QWidget*)">
2111 <modify-argument index="1">
2111 <modify-argument index="1">
2112 <reference-count action="ignore"/>
2112 <reference-count action="ignore"/>
2113 </modify-argument>
2113 </modify-argument>
2114 </modify-function>
2114 </modify-function>
2115 <modify-function signature="setMenuBar(QMenuBar*)">
2115 <modify-function signature="setMenuBar(QMenuBar*)">
2116 <modify-argument index="1">
2116 <modify-argument index="1">
2117 <reference-count action="ignore"/>
2117 <reference-count action="ignore"/>
2118 </modify-argument>
2118 </modify-argument>
2119 </modify-function>
2119 </modify-function>
2120 <modify-function signature="setMenuWidget(QWidget*)">
2120 <modify-function signature="setMenuWidget(QWidget*)">
2121 <modify-argument index="1">
2121 <modify-argument index="1">
2122 <reference-count action="ignore"/>
2122 <reference-count action="ignore"/>
2123 </modify-argument>
2123 </modify-argument>
2124 </modify-function>
2124 </modify-function>
2125 <modify-function signature="setStatusBar(QStatusBar*)">
2125 <modify-function signature="setStatusBar(QStatusBar*)">
2126 <modify-argument index="1">
2126 <modify-argument index="1">
2127 <reference-count action="ignore"/>
2127 <reference-count action="ignore"/>
2128 </modify-argument>
2128 </modify-argument>
2129 </modify-function>
2129 </modify-function>
2130
2130
2131 </object-type>
2131 </object-type>
2132 <object-type name="QMdiArea">
2132 <object-type name="QMdiArea">
2133 <modify-function signature="addSubWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
2133 <modify-function signature="addSubWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
2134 <modify-argument index="1">
2134 <modify-argument index="1">
2135 <reference-count action="ignore"/>
2135 <reference-count action="ignore"/>
2136 </modify-argument>
2136 </modify-argument>
2137 </modify-function>
2137 </modify-function>
2138
2138
2139 <modify-function signature="removeSubWindow(QWidget*)">
2139 <modify-function signature="removeSubWindow(QWidget*)">
2140 <modify-argument index="1">
2140 <modify-argument index="1">
2141 <reference-count action="ignore"/>
2141 <reference-count action="ignore"/>
2142 </modify-argument>
2142 </modify-argument>
2143 </modify-function>
2143 </modify-function>
2144
2144
2145 <modify-function signature="setActiveSubWindow(QMdiSubWindow*)">
2145 <modify-function signature="setActiveSubWindow(QMdiSubWindow*)">
2146 <modify-argument index="1">
2146 <modify-argument index="1">
2147 <reference-count action="ignore"/>
2147 <reference-count action="ignore"/>
2148 </modify-argument>
2148 </modify-argument>
2149 </modify-function>
2149 </modify-function>
2150
2150
2151 <modify-function signature="setupViewport(QWidget*)">
2151 <modify-function signature="setupViewport(QWidget*)">
2152 <modify-argument index="1">
2152 <modify-argument index="1">
2153 <reference-count action="ignore"/>
2153 <reference-count action="ignore"/>
2154 </modify-argument>
2154 </modify-argument>
2155 </modify-function>
2155 </modify-function>
2156
2156
2157 </object-type>
2157 </object-type>
2158 <object-type name="QMdiSubWindow">
2158 <object-type name="QMdiSubWindow">
2159 <modify-function signature="setSystemMenu(QMenu*)">
2159 <modify-function signature="setSystemMenu(QMenu*)">
2160 <modify-argument index="1">
2160 <modify-argument index="1">
2161 <reference-count action="ignore"/>
2161 <reference-count action="ignore"/>
2162 </modify-argument>
2162 </modify-argument>
2163 </modify-function>
2163 </modify-function>
2164 <modify-function signature="setWidget(QWidget*)">
2164 <modify-function signature="setWidget(QWidget*)">
2165 <modify-argument index="1">
2165 <modify-argument index="1">
2166 <reference-count action="ignore"/>
2166 <reference-count action="ignore"/>
2167 </modify-argument>
2167 </modify-argument>
2168 </modify-function>
2168 </modify-function>
2169 </object-type>
2169 </object-type>
2170 <object-type name="QMenu">
2170 <object-type name="QMenu">
2171 <modify-function signature="insertSeparator(QAction*)">
2171 <modify-function signature="insertSeparator(QAction*)">
2172 <modify-argument index="1">
2172 <modify-argument index="1">
2173 <reference-count action="ignore"/>
2173 <reference-count action="ignore"/>
2174 </modify-argument>
2174 </modify-argument>
2175 </modify-function>
2175 </modify-function>
2176 <modify-function signature="setActiveAction(QAction*)">
2176 <modify-function signature="setActiveAction(QAction*)">
2177 <modify-argument index="1">
2177 <modify-argument index="1">
2178 <reference-count action="ignore"/>
2178 <reference-count action="ignore"/>
2179 </modify-argument>
2179 </modify-argument>
2180 </modify-function>
2180 </modify-function>
2181 <modify-function signature="setDefaultAction(QAction*)">
2181 <modify-function signature="setDefaultAction(QAction*)">
2182 <modify-argument index="1">
2182 <modify-argument index="1">
2183 <reference-count action="ignore"/>
2183 <reference-count action="ignore"/>
2184 </modify-argument>
2184 </modify-argument>
2185 </modify-function>
2185 </modify-function>
2186 <modify-function signature="setNoReplayFor(QWidget*)">
2186 <modify-function signature="setNoReplayFor(QWidget*)">
2187 <remove/>
2187 <remove/>
2188 </modify-function>
2188 </modify-function>
2189
2189
2190 <inject-code class="pywrap-h">
2190 <inject-code class="pywrap-h">
2191 QAction* addAction (QMenu* menu, const QString &amp; text, PyObject* callable, const QKeySequence &amp; shortcut = 0) {
2191 QAction* addAction (QMenu* menu, const QString &amp; text, PyObject* callable, const QKeySequence &amp; shortcut = 0) {
2192 QAction* a = menu-&gt;addAction(text);
2192 QAction* a = menu-&gt;addAction(text);
2193 a-&gt;setShortcut(shortcut);
2193 a-&gt;setShortcut(shortcut);
2194 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2194 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2195 return a;
2195 return a;
2196 }
2196 }
2197
2197
2198 QAction* addAction (QMenu* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable, const QKeySequence&amp; shortcut = 0)
2198 QAction* addAction (QMenu* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable, const QKeySequence&amp; shortcut = 0)
2199 {
2199 {
2200 QAction* a = menu-&gt;addAction(text);
2200 QAction* a = menu-&gt;addAction(text);
2201 a-&gt;setIcon(icon);
2201 a-&gt;setIcon(icon);
2202 a-&gt;setShortcut(shortcut);
2202 a-&gt;setShortcut(shortcut);
2203 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2203 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2204 return a;
2204 return a;
2205 }
2205 }
2206 </inject-code>
2206 </inject-code>
2207 </object-type>
2207 </object-type>
2208
2208
2209 <object-type name="QMenuBar">
2209 <object-type name="QMenuBar">
2210
2210
2211 <modify-function signature="setActiveAction(QAction*)">
2211 <modify-function signature="setActiveAction(QAction*)">
2212 <modify-argument index="1">
2212 <modify-argument index="1">
2213 <reference-count action="ignore"/>
2213 <reference-count action="ignore"/>
2214 </modify-argument>
2214 </modify-argument>
2215 </modify-function>
2215 </modify-function>
2216 <modify-function signature="setCornerWidget(QWidget*,Qt::Corner) ">
2216 <modify-function signature="setCornerWidget(QWidget*,Qt::Corner) ">
2217 <modify-argument index="1">
2217 <modify-argument index="1">
2218 <reference-count action="ignore"/>
2218 <reference-count action="ignore"/>
2219 </modify-argument>
2219 </modify-argument>
2220 </modify-function>
2220 </modify-function>
2221
2221
2222 <inject-code class="pywrap-h">
2222 <inject-code class="pywrap-h">
2223 QAction* addAction (QMenuBar* menu, const QString &amp; text, PyObject* callable)
2223 QAction* addAction (QMenuBar* menu, const QString &amp; text, PyObject* callable)
2224 {
2224 {
2225 QAction* a = menu-&gt;addAction(text);
2225 QAction* a = menu-&gt;addAction(text);
2226 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2226 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2227 return a;
2227 return a;
2228 }
2228 }
2229 </inject-code>
2229 </inject-code>
2230 </object-type>
2230 </object-type>
2231 <object-type name="QMotifStyle">
2231 <object-type name="QMotifStyle">
2232 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2232 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2233 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2233 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2234 </object-type>
2234 </object-type>
2235 <object-type name="QPainterPathStroker"/>
2235 <object-type name="QPainterPathStroker"/>
2236
2236
2237 <object-type name="QPictureIO">
2237 <object-type name="QPictureIO">
2238 <modify-function signature="QPictureIO(QIODevice*,const char*)">
2238 <modify-function signature="QPictureIO(QIODevice*,const char*)">
2239 <access modifier="private"/>
2239 <access modifier="private"/>
2240 <modify-argument index="1">
2240 <modify-argument index="1">
2241 <reference-count action="set" variable-name="__rcDevice"/>
2241 <reference-count action="set" variable-name="__rcDevice"/>
2242 </modify-argument>
2242 </modify-argument>
2243 </modify-function>
2243 </modify-function>
2244
2244
2245 <modify-function signature="setIODevice(QIODevice*)">
2245 <modify-function signature="setIODevice(QIODevice*)">
2246 <modify-argument index="1">
2246 <modify-argument index="1">
2247 <reference-count action="set" variable-name="__rcDevice"/>
2247 <reference-count action="set" variable-name="__rcDevice"/>
2248 </modify-argument>
2248 </modify-argument>
2249 </modify-function>
2249 </modify-function>
2250
2250
2251 <modify-function signature="QPictureIO(QString,const char*)">
2251 <modify-function signature="QPictureIO(QString,const char*)">
2252 <access modifier="private"/>
2252 <access modifier="private"/>
2253 </modify-function>
2253 </modify-function>
2254
2254
2255 <modify-function signature="format()const">
2255 <modify-function signature="format()const">
2256 <access modifier="private"/>
2256 <access modifier="private"/>
2257 <rename to="format_private"/>
2257 <rename to="format_private"/>
2258 </modify-function>
2258 </modify-function>
2259
2259
2260 <modify-function signature="parameters()const">
2260 <modify-function signature="parameters()const">
2261 <access modifier="private"/>
2261 <access modifier="private"/>
2262 <rename to="parameters_private"/>
2262 <rename to="parameters_private"/>
2263 </modify-function>
2263 </modify-function>
2264
2264
2265 <modify-function signature="setFormat(const char*)">
2265 <modify-function signature="setFormat(const char*)">
2266 <access modifier="private"/>
2266 <access modifier="private"/>
2267 </modify-function>
2267 </modify-function>
2268
2268
2269 <modify-function signature="setParameters(const char*)">
2269 <modify-function signature="setParameters(const char*)">
2270 <access modifier="private"/>
2270 <access modifier="private"/>
2271 </modify-function>
2271 </modify-function>
2272
2272
2273
2273
2274 <modify-function signature="QPictureIO(QIODevice*,const char*)">
2274 <modify-function signature="QPictureIO(QIODevice*,const char*)">
2275 <modify-argument index="2">
2275 <modify-argument index="2">
2276 <replace-type modified-type="QString"/>
2276 <replace-type modified-type="QString"/>
2277 <conversion-rule class="native">
2277 <conversion-rule class="native">
2278 <insert-template name="core.convert_string_arg_to_char*"/>
2278 <insert-template name="core.convert_string_arg_to_char*"/>
2279 </conversion-rule>
2279 </conversion-rule>
2280 </modify-argument>
2280 </modify-argument>
2281 </modify-function>
2281 </modify-function>
2282
2282
2283 <modify-function signature="QPictureIO(QString,const char*)">
2283 <modify-function signature="QPictureIO(QString,const char*)">
2284 <modify-argument index="2">
2284 <modify-argument index="2">
2285 <replace-type modified-type="QString"/>
2285 <replace-type modified-type="QString"/>
2286 <conversion-rule class="native">
2286 <conversion-rule class="native">
2287 <insert-template name="core.convert_string_arg_to_char*"/>
2287 <insert-template name="core.convert_string_arg_to_char*"/>
2288 </conversion-rule>
2288 </conversion-rule>
2289 </modify-argument>
2289 </modify-argument>
2290 </modify-function>
2290 </modify-function>
2291
2291
2292 <modify-function signature="setFormat(const char*)">
2292 <modify-function signature="setFormat(const char*)">
2293 <modify-argument index="1">
2293 <modify-argument index="1">
2294 <replace-type modified-type="QString"/>
2294 <replace-type modified-type="QString"/>
2295 <conversion-rule class="native">
2295 <conversion-rule class="native">
2296 <insert-template name="core.convert_string_arg_to_char*"/>
2296 <insert-template name="core.convert_string_arg_to_char*"/>
2297 </conversion-rule>
2297 </conversion-rule>
2298 </modify-argument>
2298 </modify-argument>
2299 </modify-function>
2299 </modify-function>
2300
2300
2301 <modify-function signature="setParameters(const char*)">
2301 <modify-function signature="setParameters(const char*)">
2302 <modify-argument index="1">
2302 <modify-argument index="1">
2303 <replace-type modified-type="QString"/>
2303 <replace-type modified-type="QString"/>
2304 <conversion-rule class="native">
2304 <conversion-rule class="native">
2305 <insert-template name="core.convert_string_arg_to_char*"/>
2305 <insert-template name="core.convert_string_arg_to_char*"/>
2306 </conversion-rule>
2306 </conversion-rule>
2307 </modify-argument>
2307 </modify-argument>
2308 </modify-function>
2308 </modify-function>
2309 </object-type>
2309 </object-type>
2310
2310
2311 <object-type name="QPixmapCache">
2311 <object-type name="QPixmapCache">
2312 <modify-function signature="find(QString)">
2312 <modify-function signature="find(QString)">
2313 <remove/>
2313 <remove/>
2314 </modify-function>
2314 </modify-function>
2315 <modify-function signature="find(QString,QPixmap*)" remove="all"/>
2315 <modify-function signature="find(QString,QPixmap*)" remove="all"/>
2316
2316
2317 <modify-function signature="find(QString,QPixmap&amp;)">
2317 <modify-function signature="find(QString,QPixmap&amp;)">
2318 <access modifier="private"/>
2318 <access modifier="private"/>
2319 </modify-function>
2319 </modify-function>
2320 </object-type>
2320 </object-type>
2321 <object-type name="QPlastiqueStyle">
2321 <object-type name="QPlastiqueStyle">
2322 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2322 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2323 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2323 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2324 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
2324 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
2325 </object-type>
2325 </object-type>
2326 <object-type name="QPrintDialog">
2326 <object-type name="QPrintDialog">
2327 </object-type>
2327 </object-type>
2328 <object-type name="QPrintEngine"/>
2328 <object-type name="QPrintEngine"/>
2329 <object-type name="QProgressBar">
2329 <object-type name="QProgressBar">
2330 <modify-function signature="initStyleOption(QStyleOptionProgressBar*)const">
2330 <modify-function signature="initStyleOption(QStyleOptionProgressBar*)const">
2331 <access modifier="private"/>
2331 <access modifier="private"/>
2332 </modify-function>
2332 </modify-function>
2333 </object-type>
2333 </object-type>
2334 <object-type name="QPushButton">
2334 <object-type name="QPushButton">
2335 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
2335 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
2336 <access modifier="private"/>
2336 <access modifier="private"/>
2337 </modify-function>
2337 </modify-function>
2338
2338
2339 <modify-function signature="setMenu(QMenu*)">
2339 <modify-function signature="setMenu(QMenu*)">
2340 <modify-argument index="1">
2340 <modify-argument index="1">
2341 <reference-count action="set" variable-name="__rcMenu"/>
2341 <reference-count action="set" variable-name="__rcMenu"/>
2342 </modify-argument>
2342 </modify-argument>
2343 </modify-function>
2343 </modify-function>
2344 </object-type>
2344 </object-type>
2345 <object-type name="QRegExpValidator"/>
2345 <object-type name="QRegExpValidator"/>
2346 <object-type name="QScrollArea">
2346 <object-type name="QScrollArea">
2347 <modify-function signature="setWidget(QWidget*)">
2347 <modify-function signature="setWidget(QWidget*)">
2348 <modify-argument index="1">
2348 <modify-argument index="1">
2349 <reference-count action="ignore"/>
2349 <reference-count action="ignore"/>
2350 </modify-argument>
2350 </modify-argument>
2351 </modify-function>
2351 </modify-function>
2352 </object-type>
2352 </object-type>
2353 <object-type name="QSessionManager"/>
2353 <object-type name="QSessionManager"/>
2354 <object-type name="QShortcut">
2354 <object-type name="QShortcut">
2355 <modify-function signature="QShortcut(QKeySequence,QWidget*,const char*,const char*,Qt::ShortcutContext)">
2355 <modify-function signature="QShortcut(QKeySequence,QWidget*,const char*,const char*,Qt::ShortcutContext)">
2356 <access modifier="private"/>
2356 <access modifier="private"/>
2357 <modify-argument index="3">
2357 <modify-argument index="3">
2358 <remove-default-expression/>
2358 <remove-default-expression/>
2359 </modify-argument>
2359 </modify-argument>
2360 <modify-argument index="4">
2360 <modify-argument index="4">
2361 <remove-default-expression/>
2361 <remove-default-expression/>
2362 </modify-argument>
2362 </modify-argument>
2363 <modify-argument index="5">
2363 <modify-argument index="5">
2364 <remove-default-expression/>
2364 <remove-default-expression/>
2365 </modify-argument>
2365 </modify-argument>
2366 </modify-function>
2366 </modify-function>
2367 </object-type>
2367 </object-type>
2368 <object-type name="QSizeGrip"/>
2368 <object-type name="QSizeGrip"/>
2369 <object-type name="QSound"/>
2369 <object-type name="QSound"/>
2370 <object-type name="QSpacerItem"/>
2370 <object-type name="QSpacerItem"/>
2371 <object-type name="QStandardItem">
2371 <object-type name="QStandardItem">
2372 <modify-function signature="operator=(QStandardItem)" remove="all"/>
2372 <modify-function signature="operator=(QStandardItem)" remove="all"/>
2373 <modify-function signature="operator&lt;(QStandardItem)const">
2373 <modify-function signature="operator&lt;(QStandardItem)const">
2374 <modify-argument index="1" invalidate-after-use="yes"/>
2374 <modify-argument index="1" invalidate-after-use="yes"/>
2375 </modify-function>
2375 </modify-function>
2376 <modify-function signature="read(QDataStream&amp;)">
2376 <modify-function signature="read(QDataStream&amp;)">
2377 <modify-argument index="1" invalidate-after-use="yes"/>
2377 <modify-argument index="1" invalidate-after-use="yes"/>
2378 </modify-function>
2378 </modify-function>
2379 <modify-function signature="write(QDataStream&amp;)const">
2379 <modify-function signature="write(QDataStream&amp;)const">
2380 <modify-argument index="1" invalidate-after-use="yes"/>
2380 <modify-argument index="1" invalidate-after-use="yes"/>
2381 </modify-function>
2381 </modify-function>
2382
2382
2383
2383
2384 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
2384 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
2385 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
2385 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
2386 <modify-function signature="operator=(QStandardItem)" remove="all"/>
2386 <modify-function signature="operator=(QStandardItem)" remove="all"/>
2387 <modify-function signature="operator&lt;(QStandardItem)const" remove="all"/>
2387 <modify-function signature="operator&lt;(QStandardItem)const" remove="all"/>
2388 </object-type>
2388 </object-type>
2389 <object-type name="QStatusBar">
2389 <object-type name="QStatusBar">
2390 <modify-function signature="addPermanentWidget(QWidget *, int)">
2390 <modify-function signature="addPermanentWidget(QWidget *, int)">
2391 <modify-argument index="1">
2391 <modify-argument index="1">
2392 <reference-count action="ignore"/>
2392 <reference-count action="ignore"/>
2393 </modify-argument>
2393 </modify-argument>
2394 </modify-function>
2394 </modify-function>
2395 <modify-function signature="addWidget(QWidget *, int)">
2395 <modify-function signature="addWidget(QWidget *, int)">
2396 <modify-argument index="1">
2396 <modify-argument index="1">
2397 <reference-count action="ignore"/>
2397 <reference-count action="ignore"/>
2398 </modify-argument>
2398 </modify-argument>
2399 </modify-function>
2399 </modify-function>
2400 <modify-function signature="removeWidget(QWidget *)">
2400 <modify-function signature="removeWidget(QWidget *)">
2401 <modify-argument index="1">
2401 <modify-argument index="1">
2402 <reference-count action="ignore"/>
2402 <reference-count action="ignore"/>
2403 </modify-argument>
2403 </modify-argument>
2404 </modify-function>
2404 </modify-function>
2405 <modify-function signature="insertPermanentWidget(int, QWidget *, int)">
2405 <modify-function signature="insertPermanentWidget(int, QWidget *, int)">
2406 <modify-argument index="2">
2406 <modify-argument index="2">
2407 <reference-count action="ignore"/>
2407 <reference-count action="ignore"/>
2408 </modify-argument>
2408 </modify-argument>
2409 </modify-function>
2409 </modify-function>
2410 <modify-function signature="insertWidget(int, QWidget *, int)">
2410 <modify-function signature="insertWidget(int, QWidget *, int)">
2411 <modify-argument index="2">
2411 <modify-argument index="2">
2412 <reference-count action="ignore"/>
2412 <reference-count action="ignore"/>
2413 </modify-argument>
2413 </modify-argument>
2414 </modify-function>
2414 </modify-function>
2415 </object-type>
2415 </object-type>
2416 <object-type name="QStringListModel"/>
2416 <object-type name="QStringListModel"/>
2417 <object-type name="QStyleFactory"/>
2417 <object-type name="QStyleFactory"/>
2418 <object-type name="QStyleHintReturn"/>
2418 <object-type name="QStyleHintReturn"/>
2419 <object-type name="QStyleHintReturnVariant"/>
2419 <object-type name="QStyleHintReturnVariant"/>
2420 <object-type name="QStyleHintReturnMask"/>
2420 <object-type name="QStyleHintReturnMask"/>
2421 <object-type name="QStylePainter" delete-in-main-thread="yes"/>
2421 <object-type name="QStylePainter" delete-in-main-thread="yes"/>
2422 <object-type name="QSyntaxHighlighter">
2422 <object-type name="QSyntaxHighlighter">
2423 <modify-function signature="setCurrentBlockUserData(QTextBlockUserData*)">
2423 <modify-function signature="setCurrentBlockUserData(QTextBlockUserData*)">
2424 <modify-argument index="1">
2424 <modify-argument index="1">
2425 <define-ownership class="java" owner="c++"/>
2425 <define-ownership class="java" owner="c++"/>
2426 </modify-argument>
2426 </modify-argument>
2427 </modify-function>
2427 </modify-function>
2428 <modify-function signature="setDocument(QTextDocument*)">
2428 <modify-function signature="setDocument(QTextDocument*)">
2429 <modify-argument index="1">
2429 <modify-argument index="1">
2430 <reference-count action="set" variable-name="__rcDocument"/>
2430 <reference-count action="set" variable-name="__rcDocument"/>
2431 </modify-argument>
2431 </modify-argument>
2432 </modify-function>
2432 </modify-function>
2433
2433
2434 </object-type>
2434 </object-type>
2435 <object-type name="QSystemTrayIcon">
2435 <object-type name="QSystemTrayIcon">
2436 <modify-function signature="setContextMenu(QMenu*)">
2436 <modify-function signature="setContextMenu(QMenu*)">
2437 <modify-argument index="1">
2437 <modify-argument index="1">
2438 <reference-count action="set" variable-name="__rcContextMenu"/>
2438 <reference-count action="set" variable-name="__rcContextMenu"/>
2439 </modify-argument>
2439 </modify-argument>
2440 </modify-function>
2440 </modify-function>
2441 </object-type>
2441 </object-type>
2442 <object-type name="QTableView">
2442 <object-type name="QTableView">
2443 <modify-function signature="setHorizontalHeader(QHeaderView*)">
2443 <modify-function signature="setHorizontalHeader(QHeaderView*)">
2444 <modify-argument index="1">
2444 <modify-argument index="1">
2445 <reference-count action="ignore"/>
2445 <reference-count action="ignore"/>
2446 </modify-argument>
2446 </modify-argument>
2447 </modify-function>
2447 </modify-function>
2448 <modify-function signature="setVerticalHeader(QHeaderView*)">
2448 <modify-function signature="setVerticalHeader(QHeaderView*)">
2449 <modify-argument index="1">
2449 <modify-argument index="1">
2450 <reference-count action="ignore"/>
2450 <reference-count action="ignore"/>
2451 </modify-argument>
2451 </modify-argument>
2452 </modify-function>
2452 </modify-function>
2453 <modify-function signature="setModel(QAbstractItemModel*)">
2453 <modify-function signature="setModel(QAbstractItemModel*)">
2454 <modify-argument index="1">
2454 <modify-argument index="1">
2455 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2455 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2456 </modify-argument>
2456 </modify-argument>
2457 </modify-function>
2457 </modify-function>
2458 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2458 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2459 <modify-argument index="1">
2459 <modify-argument index="1">
2460 <no-null-pointer/>
2460 <no-null-pointer/>
2461 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2461 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2462 </modify-argument>
2462 </modify-argument>
2463 </modify-function>
2463 </modify-function>
2464
2464
2465 <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
2465 <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
2466 </object-type>
2466 </object-type>
2467 <object-type name="QTextBlockGroup" delete-in-main-thread="yes"/>
2467 <object-type name="QTextBlockGroup" delete-in-main-thread="yes"/>
2468 <object-type name="QTextBlockUserData" delete-in-main-thread="yes"/>
2468 <object-type name="QTextBlockUserData" delete-in-main-thread="yes"/>
2469 <object-type name="QTextItem" delete-in-main-thread="yes"/>
2469 <object-type name="QTextItem" delete-in-main-thread="yes"/>
2470 <object-type name="QTextList" delete-in-main-thread="yes">
2470 <object-type name="QTextList" delete-in-main-thread="yes">
2471 <modify-function signature="format()const" rename="textListFormat"/>
2471 <modify-function signature="format()const" rename="textListFormat"/>
2472
2472
2473 <modify-function signature="isEmpty()const" remove="all"/> <!--### Obsolete in 4.3-->
2473 <modify-function signature="isEmpty()const" remove="all"/> <!--### Obsolete in 4.3-->
2474 </object-type>
2474 </object-type>
2475 <object-type name="QTextObject" delete-in-main-thread="yes"/>
2475 <object-type name="QTextObject" delete-in-main-thread="yes"/>
2476
2476
2477 <!-- The original QTextObjectInterface has been rejected and replaced by this, since the original
2477 <!-- The original QTextObjectInterface has been rejected and replaced by this, since the original
2478 usage is based on an interface pattern we can't mimic in Java (our users can't implement our
2478 usage is based on an interface pattern we can't mimic in Java (our users can't implement our
2479 interfaces.) The new class inherits both QObject and QTextObjectInterface, and can be extended
2479 interfaces.) The new class inherits both QObject and QTextObjectInterface, and can be extended
2480 in Java to get a type that can properly be used with registerHandler() in
2480 in Java to get a type that can properly be used with registerHandler() in
2481 QAbstractTextDocumentLayout. -->
2481 QAbstractTextDocumentLayout. -->
2482 <object-type name="QtJambiTextObjectInterface" delete-in-main-thread="yes" java-name="QTextObjectInterface">
2482 <object-type name="QtJambiTextObjectInterface" delete-in-main-thread="yes" java-name="QTextObjectInterface">
2483 <modify-function signature="drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)">
2483 <modify-function signature="drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)">
2484 <modify-argument index="1" invalidate-after-use="yes"/>
2484 <modify-argument index="1" invalidate-after-use="yes"/>
2485 </modify-function>
2485 </modify-function>
2486 </object-type>
2486 </object-type>
2487
2487
2488 <object-type name="QTimeEdit"/>
2488 <object-type name="QTimeEdit"/>
2489 <object-type name="QToolBox">
2489 <object-type name="QToolBox">
2490 <modify-function signature="addItem(QWidget*,QString)">
2490 <modify-function signature="addItem(QWidget*,QString)">
2491 <modify-argument index="1">
2491 <modify-argument index="1">
2492 <reference-count action="ignore"/>
2492 <reference-count action="ignore"/>
2493 </modify-argument>
2493 </modify-argument>
2494 </modify-function>
2494 </modify-function>
2495 <modify-function signature="addItem(QWidget*,QIcon,QString)">
2495 <modify-function signature="addItem(QWidget*,QIcon,QString)">
2496 <modify-argument index="1">
2496 <modify-argument index="1">
2497 <reference-count action="ignore"/>
2497 <reference-count action="ignore"/>
2498 </modify-argument>
2498 </modify-argument>
2499 </modify-function>
2499 </modify-function>
2500 <modify-function signature="insertItem(int,QWidget*,QIcon,QString)">
2500 <modify-function signature="insertItem(int,QWidget*,QIcon,QString)">
2501 <modify-argument index="2">
2501 <modify-argument index="2">
2502 <reference-count action="ignore"/>
2502 <reference-count action="ignore"/>
2503 </modify-argument>
2503 </modify-argument>
2504 </modify-function>
2504 </modify-function>
2505 <modify-function signature="insertItem(int,QWidget*,QString)">
2505 <modify-function signature="insertItem(int,QWidget*,QString)">
2506 <modify-argument index="2">
2506 <modify-argument index="2">
2507 <reference-count action="ignore"/>
2507 <reference-count action="ignore"/>
2508 </modify-argument>
2508 </modify-argument>
2509 </modify-function>
2509 </modify-function>
2510 <modify-function signature="setCurrentWidget(QWidget*) ">
2510 <modify-function signature="setCurrentWidget(QWidget*) ">
2511 <modify-argument index="1">
2511 <modify-argument index="1">
2512 <reference-count action="ignore"/>
2512 <reference-count action="ignore"/>
2513 </modify-argument>
2513 </modify-argument>
2514 </modify-function>
2514 </modify-function>
2515 </object-type>
2515 </object-type>
2516 <object-type name="QToolButton">
2516 <object-type name="QToolButton">
2517 <modify-function signature="initStyleOption(QStyleOptionToolButton*)const">
2517 <modify-function signature="initStyleOption(QStyleOptionToolButton*)const">
2518 <access modifier="private"/>
2518 <access modifier="private"/>
2519 </modify-function>
2519 </modify-function>
2520
2520
2521 <modify-function signature="setDefaultAction(QAction *)">
2521 <modify-function signature="setDefaultAction(QAction *)">
2522 <modify-argument index="1">
2522 <modify-argument index="1">
2523 <reference-count action="set" variable-name="__rcDefaultAction"/>
2523 <reference-count action="set" variable-name="__rcDefaultAction"/>
2524 </modify-argument>
2524 </modify-argument>
2525 </modify-function>
2525 </modify-function>
2526 <modify-function signature="setMenu(QMenu *)">
2526 <modify-function signature="setMenu(QMenu *)">
2527 <modify-argument index="1">
2527 <modify-argument index="1">
2528 <reference-count action="set" variable-name="__rcMenu"/>
2528 <reference-count action="set" variable-name="__rcMenu"/>
2529 </modify-argument>
2529 </modify-argument>
2530 </modify-function>
2530 </modify-function>
2531 </object-type>
2531 </object-type>
2532 <object-type name="QToolTip"/>
2532 <object-type name="QToolTip"/>
2533 <object-type name="QTreeView">
2533 <object-type name="QTreeView">
2534
2534
2535 <modify-function signature="drawBranches(QPainter*,QRect,QModelIndex)const">
2535 <modify-function signature="drawBranches(QPainter*,QRect,QModelIndex)const">
2536 <modify-argument index="1" invalidate-after-use="yes"/>
2536 <modify-argument index="1" invalidate-after-use="yes"/>
2537 </modify-function>
2537 </modify-function>
2538 <modify-function signature="drawRow(QPainter*,QStyleOptionViewItem,QModelIndex)const">
2538 <modify-function signature="drawRow(QPainter*,QStyleOptionViewItem,QModelIndex)const">
2539 <modify-argument index="1" invalidate-after-use="yes"/>
2539 <modify-argument index="1" invalidate-after-use="yes"/>
2540 </modify-function>
2540 </modify-function>
2541
2541
2542 <modify-function signature="setHeader(QHeaderView*)">
2542 <modify-function signature="setHeader(QHeaderView*)">
2543 <modify-argument index="1">
2543 <modify-argument index="1">
2544 <reference-count action="ignore"/>
2544 <reference-count action="ignore"/>
2545 </modify-argument>
2545 </modify-argument>
2546 </modify-function>
2546 </modify-function>
2547 <modify-function signature="setModel(QAbstractItemModel*)">
2547 <modify-function signature="setModel(QAbstractItemModel*)">
2548 <modify-argument index="1">
2548 <modify-argument index="1">
2549 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2549 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2550 </modify-argument>
2550 </modify-argument>
2551 </modify-function>
2551 </modify-function>
2552 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2552 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2553 <modify-argument index="1">
2553 <modify-argument index="1">
2554 <no-null-pointer/>
2554 <no-null-pointer/>
2555 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2555 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2556 </modify-argument>
2556 </modify-argument>
2557 </modify-function>
2557 </modify-function>
2558
2558
2559 <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
2559 <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
2560 </object-type>
2560 </object-type>
2561 <object-type name="QUndoCommand">
2561 <object-type name="QUndoCommand">
2562 <modify-function signature="mergeWith(const QUndoCommand*)">
2562 <modify-function signature="mergeWith(const QUndoCommand*)">
2563 <modify-argument index="1" invalidate-after-use="yes"/>
2563 <modify-argument index="1" invalidate-after-use="yes"/>
2564 </modify-function>
2564 </modify-function>
2565 </object-type>
2565 </object-type>
2566 <object-type name="QUndoGroup">
2566 <object-type name="QUndoGroup">
2567 <modify-function signature="addStack(QUndoStack*)">
2567 <modify-function signature="addStack(QUndoStack*)">
2568 <modify-argument index="1">
2568 <modify-argument index="1">
2569 <reference-count action="add" variable-name="__rcStacks"/>
2569 <reference-count action="add" variable-name="__rcStacks"/>
2570 </modify-argument>
2570 </modify-argument>
2571 </modify-function>
2571 </modify-function>
2572 <modify-function signature="removeStack(QUndoStack*)">
2572 <modify-function signature="removeStack(QUndoStack*)">
2573 <modify-argument index="1">
2573 <modify-argument index="1">
2574 <reference-count action="remove" variable-name="__rcStacks"/>
2574 <reference-count action="remove" variable-name="__rcStacks"/>
2575 </modify-argument>
2575 </modify-argument>
2576 </modify-function>
2576 </modify-function>
2577 <modify-function signature="setActiveStack(QUndoStack*)">
2577 <modify-function signature="setActiveStack(QUndoStack*)">
2578 <modify-argument index="1">
2578 <modify-argument index="1">
2579 <reference-count action="ignore"/>
2579 <reference-count action="ignore"/>
2580 </modify-argument>
2580 </modify-argument>
2581 </modify-function>
2581 </modify-function>
2582 </object-type>
2582 </object-type>
2583
2583
2584 <object-type name="QUndoStack"/>
2584 <object-type name="QUndoStack"/>
2585
2585
2586 <object-type name="QUndoView">
2586 <object-type name="QUndoView">
2587 <modify-function signature="setGroup(QUndoGroup *)">
2587 <modify-function signature="setGroup(QUndoGroup *)">
2588 <modify-argument index="1">
2588 <modify-argument index="1">
2589 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2589 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2590 </modify-argument>
2590 </modify-argument>
2591 </modify-function>
2591 </modify-function>
2592 <modify-function signature="setStack(QUndoStack *)">
2592 <modify-function signature="setStack(QUndoStack *)">
2593 <modify-argument index="1">
2593 <modify-argument index="1">
2594 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2594 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2595 </modify-argument>
2595 </modify-argument>
2596 </modify-function>
2596 </modify-function>
2597 <modify-function signature="QUndoView(QUndoGroup *,QWidget *)">
2597 <modify-function signature="QUndoView(QUndoGroup *,QWidget *)">
2598 <modify-argument index="1">
2598 <modify-argument index="1">
2599 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2599 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2600 </modify-argument>
2600 </modify-argument>
2601 </modify-function>
2601 </modify-function>
2602 <modify-function signature="QUndoView(QUndoStack *,QWidget *)">
2602 <modify-function signature="QUndoView(QUndoStack *,QWidget *)">
2603 <modify-argument index="1">
2603 <modify-argument index="1">
2604 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2604 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2605 </modify-argument>
2605 </modify-argument>
2606 </modify-function>
2606 </modify-function>
2607 </object-type>
2607 </object-type>
2608 <object-type name="QVBoxLayout"/>
2608 <object-type name="QVBoxLayout"/>
2609 <object-type name="QValidator"/>
2609 <object-type name="QValidator"/>
2610 <object-type name="QWhatsThis"/>
2610 <object-type name="QWhatsThis"/>
2611 <object-type name="QWidgetAction">
2611 <object-type name="QWidgetAction">
2612 <modify-function signature="createWidget(QWidget*)">
2612 <modify-function signature="createWidget(QWidget*)">
2613 <modify-argument index="return">
2613 <modify-argument index="return">
2614 <define-ownership class="shell" owner="c++"/>
2614 <define-ownership class="shell" owner="c++"/>
2615 </modify-argument>
2615 </modify-argument>
2616 </modify-function>
2616 </modify-function>
2617 </object-type>
2617 </object-type>
2618 <object-type name="QWidgetItem"/>
2618 <object-type name="QWidgetItem"/>
2619 <object-type name="QWindowsStyle">
2619 <object-type name="QWindowsStyle">
2620 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2620 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2621 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2621 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2622 </object-type>
2622 </object-type>
2623 <object-type name="QWorkspace">
2623 <object-type name="QWorkspace">
2624 <modify-function signature="addWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
2624 <modify-function signature="addWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
2625 <modify-argument index="1">
2625 <modify-argument index="1">
2626 <reference-count action="ignore"/>
2626 <reference-count action="ignore"/>
2627 </modify-argument>
2627 </modify-argument>
2628 </modify-function>
2628 </modify-function>
2629 <modify-function signature="setActiveWindow(QWidget*)">
2629 <modify-function signature="setActiveWindow(QWidget*)">
2630 <modify-argument index="1">
2630 <modify-argument index="1">
2631 <reference-count action="ignore"/>
2631 <reference-count action="ignore"/>
2632 </modify-argument>
2632 </modify-argument>
2633 </modify-function>
2633 </modify-function>
2634 </object-type>
2634 </object-type>
2635
2635
2636 <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged"/>
2636 <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged"/>
2637 <object-type name="QClipboardEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Clipboard"/>
2637 <object-type name="QClipboardEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Clipboard"/>
2638 <object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
2638 <object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
2639 <object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu"/>
2639 <object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu"/>
2640 <object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
2640 <object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
2641 <object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
2641 <object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
2642 <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove">
2642 <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove">
2643 <modify-function signature="accept()" remove="all"/>
2643 <modify-function signature="accept()" remove="all"/>
2644 <modify-function signature="ignore()" remove="all"/>
2644 <modify-function signature="ignore()" remove="all"/>
2645 </object-type>
2645 </object-type>
2646 <object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
2646 <object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
2647 <modify-function signature="encodedData(const char*)const">
2647 <modify-function signature="encodedData(const char*)const">
2648 <remove/>
2648 <remove/>
2649 </modify-function>
2649 </modify-function>
2650
2650
2651 <modify-function signature="format(int)const">
2651 <modify-function signature="format(int)const">
2652 <remove/>
2652 <remove/>
2653 </modify-function>
2653 </modify-function>
2654
2654
2655 <modify-function signature="provides(const char*)const">
2655 <modify-function signature="provides(const char*)const">
2656 <remove/>
2656 <remove/>
2657 </modify-function>
2657 </modify-function>
2658
2658
2659
2659
2660 </object-type>
2660 </object-type>
2661 <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
2661 <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
2662 <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut">
2662 <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut">
2663 <modify-function signature="reason()const">
2663 <modify-function signature="reason()const">
2664 <remove/>
2664 <remove/>
2665 </modify-function>
2665 </modify-function>
2666 </object-type>
2666 </object-type>
2667
2667
2668 <object-type name="QGraphicsSceneContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneContextMenu"/>
2668 <object-type name="QGraphicsSceneContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneContextMenu"/>
2669 <object-type name="QGraphicsSceneDragDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneDragEnter || %1-&gt;type() == QEvent::GraphicsSceneDragLeave || %1-&gt;type() == QEvent::GraphicsSceneDragMove || %1-&gt;type() == QEvent::GraphicsSceneDrop">
2669 <object-type name="QGraphicsSceneDragDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneDragEnter || %1-&gt;type() == QEvent::GraphicsSceneDragLeave || %1-&gt;type() == QEvent::GraphicsSceneDragMove || %1-&gt;type() == QEvent::GraphicsSceneDrop">
2670 <modify-function signature="setMimeData(const QMimeData *)">
2670 <modify-function signature="setMimeData(const QMimeData *)">
2671 <remove/>
2671 <remove/>
2672 </modify-function>
2672 </modify-function>
2673 <modify-function signature="setSource(QWidget *)">
2673 <modify-function signature="setSource(QWidget *)">
2674 <remove/>
2674 <remove/>
2675 </modify-function>
2675 </modify-function>
2676 </object-type>
2676 </object-type>
2677 <object-type name="QGraphicsSceneEvent">
2677 <object-type name="QGraphicsSceneEvent">
2678 <modify-function signature="setWidget(QWidget *)">
2678 <modify-function signature="setWidget(QWidget *)">
2679 <remove/>
2679 <remove/>
2680 </modify-function>
2680 </modify-function>
2681 </object-type>
2681 </object-type>
2682 <object-type name="QGraphicsSceneMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove"/>
2682 <object-type name="QGraphicsSceneMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove"/>
2683 <object-type name="QGraphicsSceneResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize"/>
2683 <object-type name="QGraphicsSceneResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize"/>
2684 <object-type name="QGraphicsSceneHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp"/>
2684 <object-type name="QGraphicsSceneHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp"/>
2685 <object-type name="QGraphicsSceneHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove"/>
2685 <object-type name="QGraphicsSceneHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove"/>
2686 <object-type name="QGraphicsSceneMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMouseDoubleClick || %1-&gt;type() == QEvent::GraphicsSceneMouseMove || %1-&gt;type() == QEvent::GraphicsSceneMousePress || %1-&gt;type() == QEvent::GraphicsSceneMouseRelease"/>
2686 <object-type name="QGraphicsSceneMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMouseDoubleClick || %1-&gt;type() == QEvent::GraphicsSceneMouseMove || %1-&gt;type() == QEvent::GraphicsSceneMousePress || %1-&gt;type() == QEvent::GraphicsSceneMouseRelease"/>
2687 <object-type name="QGraphicsSceneWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneWheel"/>
2687 <object-type name="QGraphicsSceneWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneWheel"/>
2688 <object-type name="QHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
2688 <object-type name="QHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
2689 <object-type name="QHideEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
2689 <object-type name="QHideEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
2690 <object-type name="QHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
2690 <object-type name="QHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
2691 <object-type name="QIconDragEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::IconDrag"/>
2691 <object-type name="QIconDragEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::IconDrag"/>
2692 <object-type name="QInputMethodEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethod"/>
2692 <object-type name="QInputMethodEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethod"/>
2693 <object-type name="QMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Move"/>
2693 <object-type name="QMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Move"/>
2694 <object-type name="QResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
2694 <object-type name="QResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
2695 <object-type name="QShortcutEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
2695 <object-type name="QShortcutEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
2696 <!-- All these have const overloads that are used instead -->
2696 <!-- All these have const overloads that are used instead -->
2697 <modify-function signature="isAmbiguous()">
2697 <modify-function signature="isAmbiguous()">
2698 <remove/>
2698 <remove/>
2699 </modify-function>
2699 </modify-function>
2700 <modify-function signature="shortcutId()">
2700 <modify-function signature="shortcutId()">
2701 <remove/>
2701 <remove/>
2702 </modify-function>
2702 </modify-function>
2703 <modify-function signature="key()">
2703 <modify-function signature="key()">
2704 <remove/>
2704 <remove/>
2705 </modify-function>
2705 </modify-function>
2706 </object-type>
2706 </object-type>
2707 <object-type name="QShowEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Show"/>
2707 <object-type name="QShowEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Show"/>
2708 <object-type name="QStatusTipEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::StatusTip"/>
2708 <object-type name="QStatusTipEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::StatusTip"/>
2709 <object-type name="QTabletEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease"/>
2709 <object-type name="QTabletEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease"/>
2710 <object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolBarChange"/>
2710 <object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolBarChange"/>
2711 <object-type name="QWhatsThisClickedEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
2711 <object-type name="QWhatsThisClickedEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
2712 <object-type name="QWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
2712 <object-type name="QWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
2713 <object-type name="QWindowStateChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
2713 <object-type name="QWindowStateChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
2714 <object-type name="QDragResponseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragResponse"/>
2714 <object-type name="QDragResponseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragResponse"/>
2715 <object-type name="QInputEvent">
2715 <object-type name="QInputEvent">
2716 <modify-function signature="modifiers()const" access="non-final"/>
2716 <modify-function signature="modifiers()const" access="non-final"/>
2717 </object-type>
2717 </object-type>
2718 <object-type name="QGestureEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Gesture || %1-&gt;type() == QEvent::GestureOverride"/>
2718 <object-type name="QGestureEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Gesture || %1-&gt;type() == QEvent::GestureOverride"/>
2719 <object-type name="QKeyEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease"/>
2719 <object-type name="QKeyEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease"/>
2720 <object-type name="QMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove"/>
2720 <object-type name="QMouseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::MouseButtonDblClick || %1-&gt;type() == QEvent::MouseButtonPress || %1-&gt;type() == QEvent::MouseButtonRelease || %1-&gt;type() == QEvent::MouseMove"/>
2721 <object-type name="QPaintEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Paint"/>
2721 <object-type name="QPaintEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Paint"/>
2722 <object-type name="QAccessibleEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::AccessibilityDescription || %1-&gt;type() == QEvent::AccessibilityHelp"/>
2722 <object-type name="QAccessibleEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::AccessibilityDescription || %1-&gt;type() == QEvent::AccessibilityHelp"/>
2723
2723
2724 <object-type name="QAbstractButton"/>
2724 <object-type name="QAbstractButton"/>
2725
2725
2726 <object-type name="QStyle">
2726 <object-type name="QStyle">
2727 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2727 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2728 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
2728 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
2729
2729
2730 <modify-function signature="drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const">
2730 <modify-function signature="drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const">
2731 <modify-argument index="3" invalidate-after-use="yes"/>
2731 <modify-argument index="3" invalidate-after-use="yes"/>
2732 </modify-function>
2732 </modify-function>
2733 <modify-function signature="drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const">
2733 <modify-function signature="drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const">
2734 <modify-argument index="3" invalidate-after-use="yes"/>
2734 <modify-argument index="3" invalidate-after-use="yes"/>
2735 </modify-function>
2735 </modify-function>
2736 <modify-function signature="drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const">
2736 <modify-function signature="drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const">
2737 <modify-argument index="3" invalidate-after-use="yes"/>
2737 <modify-argument index="3" invalidate-after-use="yes"/>
2738 </modify-function>
2738 </modify-function>
2739 <modify-function signature="styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const">
2739 <modify-function signature="styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const">
2740 <modify-argument index="4" invalidate-after-use="yes"/>
2740 <modify-argument index="4" invalidate-after-use="yes"/>
2741 </modify-function>
2741 </modify-function>
2742 <modify-function signature="drawItemPixmap(QPainter*,QRect,int,QPixmap)const">
2742 <modify-function signature="drawItemPixmap(QPainter*,QRect,int,QPixmap)const">
2743 <modify-argument index="1" invalidate-after-use="yes"/>
2743 <modify-argument index="1" invalidate-after-use="yes"/>
2744 </modify-function>
2744 </modify-function>
2745 <modify-function signature="drawItemText(QPainter*,QRect,int,QPalette,bool,QString,QPalette::ColorRole)const">
2745 <modify-function signature="drawItemText(QPainter*,QRect,int,QPalette,bool,QString,QPalette::ColorRole)const">
2746 <modify-argument index="1" invalidate-after-use="yes"/>
2746 <modify-argument index="1" invalidate-after-use="yes"/>
2747 </modify-function>
2747 </modify-function>
2748
2748
2749
2749
2750 <modify-function signature="itemTextRect(QFontMetrics,QRect,int,bool,QString)const" remove="all"/>
2750 <modify-function signature="itemTextRect(QFontMetrics,QRect,int,bool,QString)const" remove="all"/>
2751 </object-type>
2751 </object-type>
2752
2752
2753 <object-type name="QColorDialog">
2753 <object-type name="QColorDialog">
2754
2754
2755 <modify-function signature="getColor(const QColor &amp;, QWidget *)">
2755 <modify-function signature="getColor(const QColor &amp;, QWidget *)">
2756 <modify-argument index="1">
2756 <modify-argument index="1">
2757 <replace-default-expression with="QColor.white"/>
2757 <replace-default-expression with="QColor.white"/>
2758 </modify-argument>
2758 </modify-argument>
2759 </modify-function>
2759 </modify-function>
2760 <modify-function signature="getRgba(uint,bool*,QWidget*)">
2760 <modify-function signature="getRgba(uint,bool*,QWidget*)">
2761 <rename to="getRgba_internal"/>
2761 <rename to="getRgba_internal"/>
2762 <access modifier="private"/>
2762 <access modifier="private"/>
2763 <modify-argument index="1">
2763 <modify-argument index="1">
2764 <remove-default-expression/>
2764 <remove-default-expression/>
2765 </modify-argument>
2765 </modify-argument>
2766 <modify-argument index="2">
2766 <modify-argument index="2">
2767 <remove-default-expression/>
2767 <remove-default-expression/>
2768 </modify-argument>
2768 </modify-argument>
2769 <modify-argument index="3">
2769 <modify-argument index="3">
2770 <remove-default-expression/>
2770 <remove-default-expression/>
2771 </modify-argument>
2771 </modify-argument>
2772 </modify-function>
2772 </modify-function>
2773 </object-type>
2773 </object-type>
2774
2774
2775 <object-type name="QLayout">
2775 <object-type name="QLayout">
2776 <modify-function signature="addItem(QLayoutItem*)">
2776 <modify-function signature="addItem(QLayoutItem*)">
2777 <modify-argument index="1" invalidate-after-use="yes"/>
2777 <modify-argument index="1" invalidate-after-use="yes"/>
2778 </modify-function>
2778 </modify-function>
2779
2779
2780 <modify-function signature="setSpacing(int)" rename="setWidgetSpacing"/>
2780 <modify-function signature="setSpacing(int)" rename="setWidgetSpacing"/>
2781 <modify-function signature="spacing()const" rename="widgetSpacing"/>
2781 <modify-function signature="spacing()const" rename="widgetSpacing"/>
2782 <modify-function signature="addWidget(QWidget *)">
2782 <modify-function signature="addWidget(QWidget *)">
2783 <modify-argument index="1">
2783 <modify-argument index="1">
2784 <no-null-pointer/>
2784 <no-null-pointer/>
2785 <reference-count variable-name="__rcWidgets" action="add"/>
2785 <reference-count variable-name="__rcWidgets" action="add"/>
2786 </modify-argument>
2786 </modify-argument>
2787 </modify-function>
2787 </modify-function>
2788 <modify-function signature="addChildWidget(QWidget *)">
2788 <modify-function signature="addChildWidget(QWidget *)">
2789 <modify-argument index="1">
2789 <modify-argument index="1">
2790 <no-null-pointer/>
2790 <no-null-pointer/>
2791 <reference-count variable-name="__rcWidgets" action="add"/>
2791 <reference-count variable-name="__rcWidgets" action="add"/>
2792 </modify-argument>
2792 </modify-argument>
2793 </modify-function>
2793 </modify-function>
2794 <modify-function signature="removeWidget(QWidget *)">
2794 <modify-function signature="removeWidget(QWidget *)">
2795 <modify-argument index="1">
2795 <modify-argument index="1">
2796 <no-null-pointer/>
2796 <no-null-pointer/>
2797 <reference-count variable-name="__rcWidgets" action="remove"/>
2797 <reference-count variable-name="__rcWidgets" action="remove"/>
2798 </modify-argument>
2798 </modify-argument>
2799 </modify-function>
2799 </modify-function>
2800
2800
2801 <modify-function signature="setAlignment(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
2801 <modify-function signature="setAlignment(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
2802 <modify-argument index="1">
2802 <modify-argument index="1">
2803 <reference-count action="ignore"/>
2803 <reference-count action="ignore"/>
2804 </modify-argument>
2804 </modify-argument>
2805 </modify-function>
2805 </modify-function>
2806 <modify-function signature="setAlignment(QLayout*,QFlags&lt;Qt::AlignmentFlag&gt;)">
2806 <modify-function signature="setAlignment(QLayout*,QFlags&lt;Qt::AlignmentFlag&gt;)">
2807 <modify-argument index="1">
2807 <modify-argument index="1">
2808 <reference-count action="ignore"/>
2808 <reference-count action="ignore"/>
2809 </modify-argument>
2809 </modify-argument>
2810 </modify-function>
2810 </modify-function>
2811 <modify-function signature="setMenuBar(QWidget*)">
2811 <modify-function signature="setMenuBar(QWidget*)">
2812 <modify-argument index="1">
2812 <modify-argument index="1">
2813 <reference-count action="set" variable-name="__rcMenuBar"/>
2813 <reference-count action="set" variable-name="__rcMenuBar"/>
2814 </modify-argument>
2814 </modify-argument>
2815 </modify-function>
2815 </modify-function>
2816 <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
2816 <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
2817 <access modifier="private"/>
2817 <access modifier="private"/>
2818 </modify-function>
2818 </modify-function>
2819
2819
2820 <modify-function signature="margin()const" remove="all"/> <!--### Obsolete in 4.3-->
2820 <modify-function signature="margin()const" remove="all"/> <!--### Obsolete in 4.3-->
2821 <!-- <modify-function signature="setMargin(int)" remove="all"/> --> <!--### Obsolete in 4.3-->
2821 <!-- <modify-function signature="setMargin(int)" remove="all"/> --> <!--### Obsolete in 4.3-->
2822 </object-type>
2822 </object-type>
2823
2823
2824 <object-type name="QStackedLayout">
2824 <object-type name="QStackedLayout">
2825 <modify-function signature="addItem(QLayoutItem *)">
2825 <modify-function signature="addItem(QLayoutItem *)">
2826 <modify-argument index="1">
2826 <modify-argument index="1">
2827 <define-ownership class="java" owner="c++"/>
2827 <define-ownership class="java" owner="c++"/>
2828 </modify-argument>
2828 </modify-argument>
2829 </modify-function>
2829 </modify-function>
2830 <modify-function signature="itemAt(int) const">
2830 <modify-function signature="itemAt(int) const">
2831 <modify-argument index="return">
2831 <modify-argument index="return">
2832 <define-ownership class="java" owner="c++"/>
2832 <define-ownership class="java" owner="c++"/>
2833 </modify-argument>
2833 </modify-argument>
2834 </modify-function>
2834 </modify-function>
2835 <modify-function signature="addWidget(QWidget *)">
2835 <modify-function signature="addWidget(QWidget *)">
2836 <rename to="addStackedWidget"/>
2836 <rename to="addStackedWidget"/>
2837 <modify-argument index="1">
2837 <modify-argument index="1">
2838 <no-null-pointer/>
2838 <no-null-pointer/>
2839 <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
2839 <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
2840 </modify-argument>
2840 </modify-argument>
2841 </modify-function>
2841 </modify-function>
2842 <modify-function signature="insertWidget(int,QWidget*)">
2842 <modify-function signature="insertWidget(int,QWidget*)">
2843 <modify-argument index="2">
2843 <modify-argument index="2">
2844 <no-null-pointer/>
2844 <no-null-pointer/>
2845 <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
2845 <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
2846 </modify-argument>
2846 </modify-argument>
2847 </modify-function>
2847 </modify-function>
2848 <modify-function signature="setCurrentWidget(QWidget*)">
2848 <modify-function signature="setCurrentWidget(QWidget*)">
2849 <modify-argument index="1">
2849 <modify-argument index="1">
2850 <!-- Safe to ignore because current widget must have been added to layout already -->
2850 <!-- Safe to ignore because current widget must have been added to layout already -->
2851 <reference-count action="ignore"/>
2851 <reference-count action="ignore"/>
2852 </modify-argument>
2852 </modify-argument>
2853 </modify-function>
2853 </modify-function>
2854 </object-type>
2854 </object-type>
2855
2855
2856 <object-type name="QBoxLayout">
2856 <object-type name="QBoxLayout">
2857 <modify-function signature="addWidget(QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2857 <modify-function signature="addWidget(QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2858 <modify-argument index="1">
2858 <modify-argument index="1">
2859 <no-null-pointer/>
2859 <no-null-pointer/>
2860 </modify-argument>
2860 </modify-argument>
2861 </modify-function>
2861 </modify-function>
2862 <modify-function signature="addItem(QLayoutItem *)">
2862 <modify-function signature="addItem(QLayoutItem *)">
2863 <modify-argument index="1">
2863 <modify-argument index="1">
2864 <define-ownership class="java" owner="c++"/>
2864 <define-ownership class="java" owner="c++"/>
2865 </modify-argument>
2865 </modify-argument>
2866 </modify-function>
2866 </modify-function>
2867 <modify-function signature="insertLayout(int, QLayout *, int)">
2867 <modify-function signature="insertLayout(int, QLayout *, int)">
2868 <modify-argument index="2">
2868 <modify-argument index="2">
2869 <define-ownership class="java" owner="c++"/>
2869 <define-ownership class="java" owner="c++"/>
2870 </modify-argument>
2870 </modify-argument>
2871 </modify-function>
2871 </modify-function>
2872 <modify-function signature="insertItem(int, QLayoutItem *)">
2872 <modify-function signature="insertItem(int, QLayoutItem *)">
2873 <modify-argument index="2">
2873 <modify-argument index="2">
2874 <define-ownership class="java" owner="c++"/>
2874 <define-ownership class="java" owner="c++"/>
2875 </modify-argument>
2875 </modify-argument>
2876 </modify-function>
2876 </modify-function>
2877 <modify-function signature="addSpacerItem(QSpacerItem*)">
2877 <modify-function signature="addSpacerItem(QSpacerItem*)">
2878 <modify-argument index="1">
2878 <modify-argument index="1">
2879 <define-ownership class="java" owner="c++"/>
2879 <define-ownership class="java" owner="c++"/>
2880 </modify-argument>
2880 </modify-argument>
2881 </modify-function>
2881 </modify-function>
2882 <modify-function signature="insertSpacerItem(int,QSpacerItem*)">
2882 <modify-function signature="insertSpacerItem(int,QSpacerItem*)">
2883 <modify-argument index="2">
2883 <modify-argument index="2">
2884 <define-ownership class="java" owner="c++"/>
2884 <define-ownership class="java" owner="c++"/>
2885 </modify-argument>
2885 </modify-argument>
2886 </modify-function>
2886 </modify-function>
2887
2887
2888 <modify-function signature="addLayout(QLayout *, int)">
2888 <modify-function signature="addLayout(QLayout *, int)">
2889 <modify-argument index="1">
2889 <modify-argument index="1">
2890 <define-ownership class="java" owner="c++"/>
2890 <define-ownership class="java" owner="c++"/>
2891 </modify-argument>
2891 </modify-argument>
2892 </modify-function>
2892 </modify-function>
2893 <modify-function signature="addWidget(QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2893 <modify-function signature="addWidget(QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2894 <modify-argument index="1">
2894 <modify-argument index="1">
2895 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2895 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2896 </modify-argument>
2896 </modify-argument>
2897 </modify-function>
2897 </modify-function>
2898 <modify-function signature="insertWidget(int,QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2898 <modify-function signature="insertWidget(int,QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2899 <modify-argument index="2">
2899 <modify-argument index="2">
2900 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2900 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2901 </modify-argument>
2901 </modify-argument>
2902 </modify-function>
2902 </modify-function>
2903 <modify-function signature="setStretchFactor(QWidget*,int)">
2903 <modify-function signature="setStretchFactor(QWidget*,int)">
2904 <modify-argument index="1">
2904 <modify-argument index="1">
2905 <reference-count action="ignore"/>
2905 <reference-count action="ignore"/>
2906 </modify-argument>
2906 </modify-argument>
2907 </modify-function>
2907 </modify-function>
2908 <modify-function signature="setStretchFactor(QLayout*,int)">
2908 <modify-function signature="setStretchFactor(QLayout*,int)">
2909 <modify-argument index="1">
2909 <modify-argument index="1">
2910 <reference-count action="ignore"/>
2910 <reference-count action="ignore"/>
2911 </modify-argument>
2911 </modify-argument>
2912 </modify-function>
2912 </modify-function>
2913 </object-type>
2913 </object-type>
2914
2914
2915 <object-type name="QGridLayout">
2915 <object-type name="QGridLayout">
2916 <modify-function signature="addWidget(QWidget *)" remove="all"/>
2916 <modify-function signature="addWidget(QWidget *)" remove="all"/>
2917 <modify-function signature="addItem(QLayoutItem *)">
2917 <modify-function signature="addItem(QLayoutItem *)">
2918 <modify-argument index="1">
2918 <modify-argument index="1">
2919 <define-ownership class="java" owner="c++"/>
2919 <define-ownership class="java" owner="c++"/>
2920 </modify-argument>
2920 </modify-argument>
2921 </modify-function>
2921 </modify-function>
2922 <modify-function signature="addItem(QLayoutItem *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2922 <modify-function signature="addItem(QLayoutItem *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2923 <modify-argument index="1">
2923 <modify-argument index="1">
2924 <define-ownership class="java" owner="c++"/>
2924 <define-ownership class="java" owner="c++"/>
2925 </modify-argument>
2925 </modify-argument>
2926 </modify-function>
2926 </modify-function>
2927 <modify-function signature="addLayout(QLayout *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2927 <modify-function signature="addLayout(QLayout *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2928 <modify-argument index="1">
2928 <modify-argument index="1">
2929 <define-ownership class="java" owner="c++"/>
2929 <define-ownership class="java" owner="c++"/>
2930 </modify-argument>
2930 </modify-argument>
2931 </modify-function>
2931 </modify-function>
2932 <modify-function signature="addLayout(QLayout *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2932 <modify-function signature="addLayout(QLayout *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2933 <modify-argument index="1">
2933 <modify-argument index="1">
2934 <define-ownership class="java" owner="c++"/>
2934 <define-ownership class="java" owner="c++"/>
2935 </modify-argument>
2935 </modify-argument>
2936 </modify-function>
2936 </modify-function>
2937 <modify-function signature="addWidget(QWidget*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2937 <modify-function signature="addWidget(QWidget*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2938 <modify-argument index="1">
2938 <modify-argument index="1">
2939 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2939 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2940 </modify-argument>
2940 </modify-argument>
2941 </modify-function>
2941 </modify-function>
2942 <modify-function signature="addWidget(QWidget*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2942 <modify-function signature="addWidget(QWidget*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2943 <modify-argument index="1">
2943 <modify-argument index="1">
2944 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2944 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2945 </modify-argument>
2945 </modify-argument>
2946 </modify-function>
2946 </modify-function>
2947 <modify-function signature="addWidget(QWidget*)">
2947 <modify-function signature="addWidget(QWidget*)">
2948 <modify-argument index="1">
2948 <modify-argument index="1">
2949 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2949 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2950 </modify-argument>
2950 </modify-argument>
2951 </modify-function>
2951 </modify-function>
2952 <modify-function signature="getItemPosition(int,int*,int*,int*,int*)">
2952 <modify-function signature="getItemPosition(int,int*,int*,int*,int*)">
2953 <access modifier="private"/>
2953 <access modifier="private"/>
2954 </modify-function>
2954 </modify-function>
2955 </object-type>
2955 </object-type>
2956
2956
2957 <object-type name="QGraphicsView">
2957 <object-type name="QGraphicsView">
2958 <extra-includes>
2958 <extra-includes>
2959 <include file-name="QPainterPath" location="global"/>
2959 <include file-name="QPainterPath" location="global"/>
2960 <include file-name="QVarLengthArray" location="global"/>
2960 <include file-name="QVarLengthArray" location="global"/>
2961 </extra-includes>
2961 </extra-includes>
2962 <modify-function signature="fitInView(const QGraphicsItem *, Qt::AspectRatioMode)">
2962 <modify-function signature="fitInView(const QGraphicsItem *, Qt::AspectRatioMode)">
2963 <modify-argument index="1">
2963 <modify-argument index="1">
2964 <no-null-pointer/>
2964 <no-null-pointer/>
2965 </modify-argument>
2965 </modify-argument>
2966 </modify-function>
2966 </modify-function>
2967 <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
2967 <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
2968 <modify-function signature="setScene(QGraphicsScene*)">
2968 <modify-function signature="setScene(QGraphicsScene*)">
2969 <modify-argument index="1">
2969 <modify-argument index="1">
2970 <reference-count action="set" variable-name="__rcScene"/>
2970 <reference-count action="set" variable-name="__rcScene"/>
2971 </modify-argument>
2971 </modify-argument>
2972 </modify-function>
2972 </modify-function>
2973 <modify-function signature="setupViewport(QWidget*)">
2973 <modify-function signature="setupViewport(QWidget*)">
2974 <modify-argument index="1">
2974 <modify-argument index="1">
2975 <reference-count action="ignore"/>
2975 <reference-count action="ignore"/>
2976 </modify-argument>
2976 </modify-argument>
2977 </modify-function>
2977 </modify-function>
2978
2978
2979 <modify-function signature="drawBackground(QPainter*,QRectF)">
2979 <modify-function signature="drawBackground(QPainter*,QRectF)">
2980 <modify-argument index="1" invalidate-after-use="yes"/>
2980 <modify-argument index="1" invalidate-after-use="yes"/>
2981 </modify-function>
2981 </modify-function>
2982 <modify-function signature="drawForeground(QPainter*,QRectF)">
2982 <modify-function signature="drawForeground(QPainter*,QRectF)">
2983 <modify-argument index="1" invalidate-after-use="yes"/>
2983 <modify-argument index="1" invalidate-after-use="yes"/>
2984 </modify-function>
2984 </modify-function>
2985 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
2985 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
2986 <modify-argument index="1" invalidate-after-use="yes"/>
2986 <modify-argument index="1" invalidate-after-use="yes"/>
2987 </modify-function>
2987 </modify-function>
2988
2988
2989 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
2989 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
2990 <modify-argument index="2">
2990 <modify-argument index="2">
2991 <remove-argument/>
2991 <remove-argument/>
2992 <conversion-rule class="shell">
2992 <conversion-rule class="shell">
2993 // nothing
2993 // nothing
2994 </conversion-rule>
2994 </conversion-rule>
2995 <conversion-rule class="native">
2995 <conversion-rule class="native">
2996 <insert-template name="core.get_array_length">
2996 <insert-template name="core.get_array_length">
2997 <replace from="%ARRAY" to="%3"/>
2997 <replace from="%ARRAY" to="%3"/>
2998 </insert-template>
2998 </insert-template>
2999 int __length = %out;
2999 int __length = %out;
3000 </conversion-rule>
3000 </conversion-rule>
3001 </modify-argument>
3001 </modify-argument>
3002
3002
3003 <modify-argument index="3">
3003 <modify-argument index="3">
3004 <replace-type modified-type="com.trolltech.qt.gui.QGraphicsItemInterface[]"/>
3004 <replace-type modified-type="com.trolltech.qt.gui.QGraphicsItemInterface[]"/>
3005 <conversion-rule class="shell">
3005 <conversion-rule class="shell">
3006 <insert-template name="gui.convert_graphicsitem_array_to_java">
3006 <insert-template name="gui.convert_graphicsitem_array_to_java">
3007 <replace from="%LENGTH" to="%2"/>
3007 <replace from="%LENGTH" to="%2"/>
3008 </insert-template>
3008 </insert-template>
3009 jobjectArray graphicsItemArrayHolder = %out;
3009 jobjectArray graphicsItemArrayHolder = %out;
3010 </conversion-rule>
3010 </conversion-rule>
3011 <conversion-rule class="native">
3011 <conversion-rule class="native">
3012 <insert-template name="gui.convert_graphicsitem_array_from_java"/>
3012 <insert-template name="gui.convert_graphicsitem_array_from_java"/>
3013 </conversion-rule>
3013 </conversion-rule>
3014 </modify-argument>
3014 </modify-argument>
3015
3015
3016 <modify-argument index="4">
3016 <modify-argument index="4">
3017 <replace-type modified-type="com.trolltech.qt.gui.QStyleOptionGraphicsItem[]"/>
3017 <replace-type modified-type="com.trolltech.qt.gui.QStyleOptionGraphicsItem[]"/>
3018 <conversion-rule class="shell">
3018 <conversion-rule class="shell">
3019 <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
3019 <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
3020 <replace from="%LENGTH" to="%2"/>
3020 <replace from="%LENGTH" to="%2"/>
3021 </insert-template>
3021 </insert-template>
3022 jobjectArray styleOptionArrayHolder = %out;
3022 jobjectArray styleOptionArrayHolder = %out;
3023 </conversion-rule>
3023 </conversion-rule>
3024 <conversion-rule class="native">
3024 <conversion-rule class="native">
3025 <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
3025 <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
3026 </conversion-rule>
3026 </conversion-rule>
3027 </modify-argument>
3027 </modify-argument>
3028
3028
3029 <modify-argument index="return">
3029 <modify-argument index="return">
3030 <conversion-rule class="shell">
3030 <conversion-rule class="shell">
3031 qtjambi_invalidate_array(__jni_env, styleOptionArrayHolder);
3031 qtjambi_invalidate_array(__jni_env, styleOptionArrayHolder);
3032 qtjambi_invalidate_array(__jni_env, graphicsItemArrayHolder);
3032 qtjambi_invalidate_array(__jni_env, graphicsItemArrayHolder);
3033 </conversion-rule>
3033 </conversion-rule>
3034 </modify-argument>
3034 </modify-argument>
3035
3035
3036 </modify-function>
3036 </modify-function>
3037 </object-type>
3037 </object-type>
3038
3038
3039 <object-type name="QInputDialog">
3039 <object-type name="QInputDialog">
3040
3040
3041 <modify-function signature="getInt(QWidget*,QString,QString,int,int,int,int,bool*,QFlags&lt;Qt::WindowType&gt;)">
3041 <modify-function signature="getInt(QWidget*,QString,QString,int,int,int,int,bool*,QFlags&lt;Qt::WindowType&gt;)">
3042 <rename to="getInt_private"/>
3042 <rename to="getInt_private"/>
3043 <access modifier="private"/>
3043 <access modifier="private"/>
3044 <modify-argument index="4">
3044 <modify-argument index="4">
3045 <remove-default-expression/>
3045 <remove-default-expression/>
3046 </modify-argument>
3046 </modify-argument>
3047 <modify-argument index="5">
3047 <modify-argument index="5">
3048 <remove-default-expression/>
3048 <remove-default-expression/>
3049 </modify-argument>
3049 </modify-argument>
3050 <modify-argument index="6">
3050 <modify-argument index="6">
3051 <remove-default-expression/>
3051 <remove-default-expression/>
3052 </modify-argument>
3052 </modify-argument>
3053 <modify-argument index="7">
3053 <modify-argument index="7">
3054 <remove-default-expression/>
3054 <remove-default-expression/>
3055 </modify-argument>
3055 </modify-argument>
3056 <modify-argument index="8">
3056 <modify-argument index="8">
3057 <remove-default-expression/>
3057 <remove-default-expression/>
3058 </modify-argument>
3058 </modify-argument>
3059 <modify-argument index="9">
3059 <modify-argument index="9">
3060 <remove-default-expression/>
3060 <remove-default-expression/>
3061 </modify-argument>
3061 </modify-argument>
3062 </modify-function>
3062 </modify-function>
3063
3063
3064 <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3064 <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3065 <rename to="getDouble_internal"/>
3065 <rename to="getDouble_internal"/>
3066 <access modifier="private"/>
3066 <access modifier="private"/>
3067 <modify-argument index="4">
3067 <modify-argument index="4">
3068 <remove-default-expression/>
3068 <remove-default-expression/>
3069 </modify-argument>
3069 </modify-argument>
3070 <modify-argument index="5">
3070 <modify-argument index="5">
3071 <remove-default-expression/>
3071 <remove-default-expression/>
3072 </modify-argument>
3072 </modify-argument>
3073 <modify-argument index="6">
3073 <modify-argument index="6">
3074 <remove-default-expression/>
3074 <remove-default-expression/>
3075 </modify-argument>
3075 </modify-argument>
3076 <modify-argument index="7">
3076 <modify-argument index="7">
3077 <remove-default-expression/>
3077 <remove-default-expression/>
3078 </modify-argument>
3078 </modify-argument>
3079 <modify-argument index="8">
3079 <modify-argument index="8">
3080 <remove-default-expression/>
3080 <remove-default-expression/>
3081 </modify-argument>
3081 </modify-argument>
3082 <modify-argument index="9">
3082 <modify-argument index="9">
3083 <remove-default-expression/>
3083 <remove-default-expression/>
3084 </modify-argument>
3084 </modify-argument>
3085 </modify-function>
3085 </modify-function>
3086
3086
3087 <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3087 <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3088 <rename to="getInteger_internal"/>
3088 <rename to="getInteger_internal"/>
3089 <access modifier="private"/>
3089 <access modifier="private"/>
3090 <modify-argument index="4">
3090 <modify-argument index="4">
3091 <remove-default-expression/>
3091 <remove-default-expression/>
3092 </modify-argument>
3092 </modify-argument>
3093 <modify-argument index="5">
3093 <modify-argument index="5">
3094 <remove-default-expression/>
3094 <remove-default-expression/>
3095 </modify-argument>
3095 </modify-argument>
3096 <modify-argument index="6">
3096 <modify-argument index="6">
3097 <remove-default-expression/>
3097 <remove-default-expression/>
3098 </modify-argument>
3098 </modify-argument>
3099 <modify-argument index="7">
3099 <modify-argument index="7">
3100 <remove-default-expression/>
3100 <remove-default-expression/>
3101 </modify-argument>
3101 </modify-argument>
3102 <modify-argument index="8">
3102 <modify-argument index="8">
3103 <remove-default-expression/>
3103 <remove-default-expression/>
3104 </modify-argument>
3104 </modify-argument>
3105 <modify-argument index="9">
3105 <modify-argument index="9">
3106 <remove-default-expression/>
3106 <remove-default-expression/>
3107 </modify-argument>
3107 </modify-argument>
3108 </modify-function>
3108 </modify-function>
3109
3109
3110 <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
3110 <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
3111 <rename to="getItem_internal"/>
3111 <rename to="getItem_internal"/>
3112 <access modifier="private"/>
3112 <access modifier="private"/>
3113 <modify-argument index="4">
3113 <modify-argument index="4">
3114 <remove-default-expression/>
3114 <remove-default-expression/>
3115 </modify-argument>
3115 </modify-argument>
3116 <modify-argument index="5">
3116 <modify-argument index="5">
3117 <remove-default-expression/>
3117 <remove-default-expression/>
3118 </modify-argument>
3118 </modify-argument>
3119 <modify-argument index="6">
3119 <modify-argument index="6">
3120 <remove-default-expression/>
3120 <remove-default-expression/>
3121 </modify-argument>
3121 </modify-argument>
3122 <modify-argument index="7">
3122 <modify-argument index="7">
3123 <remove-default-expression/>
3123 <remove-default-expression/>
3124 </modify-argument>
3124 </modify-argument>
3125 <modify-argument index="8">
3125 <modify-argument index="8">
3126 <remove-default-expression/>
3126 <remove-default-expression/>
3127 </modify-argument>
3127 </modify-argument>
3128 </modify-function>
3128 </modify-function>
3129
3129
3130 <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
3130 <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
3131 <rename to="getText_internal"/>
3131 <rename to="getText_internal"/>
3132 <access modifier="private"/>
3132 <access modifier="private"/>
3133 <modify-argument index="4">
3133 <modify-argument index="4">
3134 <remove-default-expression/>
3134 <remove-default-expression/>
3135 </modify-argument>
3135 </modify-argument>
3136 <modify-argument index="5">
3136 <modify-argument index="5">
3137 <remove-default-expression/>
3137 <remove-default-expression/>
3138 </modify-argument>
3138 </modify-argument>
3139 <modify-argument index="6">
3139 <modify-argument index="6">
3140 <remove-default-expression/>
3140 <remove-default-expression/>
3141 </modify-argument>
3141 </modify-argument>
3142 <modify-argument index="7">
3142 <modify-argument index="7">
3143 <remove-default-expression/>
3143 <remove-default-expression/>
3144 </modify-argument>
3144 </modify-argument>
3145 </modify-function>
3145 </modify-function>
3146
3146
3147 <inject-code class="native" position="beginning">
3147 <inject-code class="native" position="beginning">
3148 Q_DECLARE_METATYPE(QScriptValue)
3148 Q_DECLARE_METATYPE(QScriptValue)
3149 </inject-code>
3149 </inject-code>
3150 <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3150 <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3151 <modify-argument index="8">
3151 <modify-argument index="8">
3152 <remove-argument/>
3152 <remove-argument/>
3153 <conversion-rule class="native">
3153 <conversion-rule class="native">
3154 <insert-template name="core.prepare_removed_bool*_argument"/>
3154 <insert-template name="core.prepare_removed_bool*_argument"/>
3155 </conversion-rule>
3155 </conversion-rule>
3156 </modify-argument>
3156 </modify-argument>
3157 <modify-argument index="return">
3157 <modify-argument index="return">
3158 <conversion-rule class="native">
3158 <conversion-rule class="native">
3159 <insert-template name="core.convert_to_null_or_primitive"/>
3159 <insert-template name="core.convert_to_null_or_primitive"/>
3160 </conversion-rule>
3160 </conversion-rule>
3161 </modify-argument>
3161 </modify-argument>
3162 </modify-function>
3162 </modify-function>
3163
3163
3164 <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3164 <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3165 <modify-argument index="8">
3165 <modify-argument index="8">
3166 <remove-argument/>
3166 <remove-argument/>
3167 <conversion-rule class="native">
3167 <conversion-rule class="native">
3168 <insert-template name="core.prepare_removed_bool*_argument"/>
3168 <insert-template name="core.prepare_removed_bool*_argument"/>
3169 </conversion-rule>
3169 </conversion-rule>
3170 </modify-argument>
3170 </modify-argument>
3171 <modify-argument index="return">
3171 <modify-argument index="return">
3172 <conversion-rule class="native">
3172 <conversion-rule class="native">
3173 <insert-template name="core.convert_to_null_or_primitive"/>
3173 <insert-template name="core.convert_to_null_or_primitive"/>
3174 </conversion-rule>
3174 </conversion-rule>
3175 </modify-argument>
3175 </modify-argument>
3176 </modify-function>
3176 </modify-function>
3177
3177
3178 <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
3178 <modify-function signature="getItem(QWidget *, const QString &amp;, const QString &amp;, const QStringList&lt;QString&gt; &amp;, int, bool, bool *, QFlags&lt;Qt::WindowType&gt;)">
3179 <modify-argument index="7">
3179 <modify-argument index="7">
3180 <remove-argument/>
3180 <remove-argument/>
3181 <conversion-rule class="native">
3181 <conversion-rule class="native">
3182 <insert-template name="core.prepare_removed_bool*_argument"/>
3182 <insert-template name="core.prepare_removed_bool*_argument"/>
3183 </conversion-rule>
3183 </conversion-rule>
3184 </modify-argument>
3184 </modify-argument>
3185 <modify-argument index="return">
3185 <modify-argument index="return">
3186 <conversion-rule class="native">
3186 <conversion-rule class="native">
3187 <insert-template name="core.convert_to_null_or_primitive"/>
3187 <insert-template name="core.convert_to_null_or_primitive"/>
3188 </conversion-rule>
3188 </conversion-rule>
3189 </modify-argument>
3189 </modify-argument>
3190 </modify-function>
3190 </modify-function>
3191
3191
3192 <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
3192 <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
3193 <modify-argument index="6">
3193 <modify-argument index="6">
3194 <remove-argument/>
3194 <remove-argument/>
3195 <conversion-rule class="native">
3195 <conversion-rule class="native">
3196 <insert-template name="core.prepare_removed_bool*_argument"/>
3196 <insert-template name="core.prepare_removed_bool*_argument"/>
3197 </conversion-rule>
3197 </conversion-rule>
3198 </modify-argument>
3198 </modify-argument>
3199 <modify-argument index="return">
3199 <modify-argument index="return">
3200 <conversion-rule class="native">
3200 <conversion-rule class="native">
3201 <insert-template name="core.convert_to_null_or_primitive"/>
3201 <insert-template name="core.convert_to_null_or_primitive"/>
3202 </conversion-rule>
3202 </conversion-rule>
3203 </modify-argument>
3203 </modify-argument>
3204 </modify-function>
3204 </modify-function>
3205 </object-type>
3205 </object-type>
3206
3206
3207
3207
3208 <object-type name="QGraphicsScene">
3208 <object-type name="QGraphicsScene">
3209 <extra-includes>
3209 <extra-includes>
3210 <include file-name="QVarLengthArray" location="global"/>
3210 <include file-name="QVarLengthArray" location="global"/>
3211 </extra-includes>
3211 </extra-includes>
3212
3212
3213 <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
3213 <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
3214 <modify-argument index="1" invalidate-after-use="yes"/>
3214 <modify-argument index="1" invalidate-after-use="yes"/>
3215 </modify-function>
3215 </modify-function>
3216 <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
3216 <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
3217 <modify-argument index="1" invalidate-after-use="yes"/>
3217 <modify-argument index="1" invalidate-after-use="yes"/>
3218 </modify-function>
3218 </modify-function>
3219 <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
3219 <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
3220 <modify-argument index="1" invalidate-after-use="yes"/>
3220 <modify-argument index="1" invalidate-after-use="yes"/>
3221 </modify-function>
3221 </modify-function>
3222 <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
3222 <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
3223 <modify-argument index="1" invalidate-after-use="yes"/>
3223 <modify-argument index="1" invalidate-after-use="yes"/>
3224 </modify-function>
3224 </modify-function>
3225 <modify-function signature="drawBackground(QPainter*,QRectF)">
3225 <modify-function signature="drawBackground(QPainter*,QRectF)">
3226 <modify-argument index="1" invalidate-after-use="yes"/>
3226 <modify-argument index="1" invalidate-after-use="yes"/>
3227 </modify-function>
3227 </modify-function>
3228 <modify-function signature="drawForeground(QPainter*,QRectF)">
3228 <modify-function signature="drawForeground(QPainter*,QRectF)">
3229 <modify-argument index="1" invalidate-after-use="yes"/>
3229 <modify-argument index="1" invalidate-after-use="yes"/>
3230 </modify-function>
3230 </modify-function>
3231 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
3231 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
3232 <modify-argument index="1" invalidate-after-use="yes"/>
3232 <modify-argument index="1" invalidate-after-use="yes"/>
3233 </modify-function>
3233 </modify-function>
3234 <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
3234 <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
3235 <modify-argument index="1" invalidate-after-use="yes"/>
3235 <modify-argument index="1" invalidate-after-use="yes"/>
3236 </modify-function>
3236 </modify-function>
3237 <modify-function signature="focusInEvent(QFocusEvent*)">
3237 <modify-function signature="focusInEvent(QFocusEvent*)">
3238 <modify-argument index="1" invalidate-after-use="yes"/>
3238 <modify-argument index="1" invalidate-after-use="yes"/>
3239 </modify-function>
3239 </modify-function>
3240 <modify-function signature="focusOutEvent(QFocusEvent*)">
3240 <modify-function signature="focusOutEvent(QFocusEvent*)">
3241 <modify-argument index="1" invalidate-after-use="yes"/>
3241 <modify-argument index="1" invalidate-after-use="yes"/>
3242 </modify-function>
3242 </modify-function>
3243 <modify-function signature="helpEvent(QGraphicsSceneHelpEvent*)">
3243 <modify-function signature="helpEvent(QGraphicsSceneHelpEvent*)">
3244 <modify-argument index="1" invalidate-after-use="yes"/>
3244 <modify-argument index="1" invalidate-after-use="yes"/>
3245 </modify-function>
3245 </modify-function>
3246 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
3246 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
3247 <modify-argument index="1" invalidate-after-use="yes"/>
3247 <modify-argument index="1" invalidate-after-use="yes"/>
3248 </modify-function>
3248 </modify-function>
3249 <modify-function signature="keyPressEvent(QKeyEvent*)">
3249 <modify-function signature="keyPressEvent(QKeyEvent*)">
3250 <modify-argument index="1" invalidate-after-use="yes"/>
3250 <modify-argument index="1" invalidate-after-use="yes"/>
3251 </modify-function>
3251 </modify-function>
3252 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
3252 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
3253 <modify-argument index="1" invalidate-after-use="yes"/>
3253 <modify-argument index="1" invalidate-after-use="yes"/>
3254 </modify-function>
3254 </modify-function>
3255 <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
3255 <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
3256 <modify-argument index="1" invalidate-after-use="yes"/>
3256 <modify-argument index="1" invalidate-after-use="yes"/>
3257 </modify-function>
3257 </modify-function>
3258 <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
3258 <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
3259 <modify-argument index="1" invalidate-after-use="yes"/>
3259 <modify-argument index="1" invalidate-after-use="yes"/>
3260 </modify-function>
3260 </modify-function>
3261 <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
3261 <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
3262 <modify-argument index="1" invalidate-after-use="yes"/>
3262 <modify-argument index="1" invalidate-after-use="yes"/>
3263 </modify-function>
3263 </modify-function>
3264 <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
3264 <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
3265 <modify-argument index="1" invalidate-after-use="yes"/>
3265 <modify-argument index="1" invalidate-after-use="yes"/>
3266 </modify-function>
3266 </modify-function>
3267 <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
3267 <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
3268 <modify-argument index="1" invalidate-after-use="yes"/>
3268 <modify-argument index="1" invalidate-after-use="yes"/>
3269 </modify-function>
3269 </modify-function>
3270
3270
3271 <modify-function signature="setActiveWindow(QGraphicsWidget*)">
3271 <modify-function signature="setActiveWindow(QGraphicsWidget*)">
3272 <modify-argument index="1">
3272 <modify-argument index="1">
3273 <reference-count action="ignore"/>
3273 <reference-count action="ignore"/>
3274 </modify-argument>
3274 </modify-argument>
3275 </modify-function>
3275 </modify-function>
3276 <modify-function signature="setStyle(QStyle*)">
3276 <modify-function signature="setStyle(QStyle*)">
3277 <modify-argument index="1">
3277 <modify-argument index="1">
3278 <reference-count action="ignore"/>
3278 <reference-count action="ignore"/>
3279 </modify-argument>
3279 </modify-argument>
3280 </modify-function>
3280 </modify-function>
3281
3281
3282 <modify-function signature="addItem(QGraphicsItem *)">
3282 <modify-function signature="addItem(QGraphicsItem *)">
3283 <modify-argument index="1">
3283 <modify-argument index="1">
3284 <define-ownership class="java" owner="c++"/>
3284 <define-ownership class="java" owner="c++"/>
3285 </modify-argument>
3285 </modify-argument>
3286 </modify-function>
3286 </modify-function>
3287 <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
3287 <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
3288 <modify-argument index="return">
3288 <modify-argument index="return">
3289 <define-ownership class="java" owner="c++"/>
3289 <define-ownership class="java" owner="c++"/>
3290 </modify-argument>
3290 </modify-argument>
3291 </modify-function>
3291 </modify-function>
3292 <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)">
3292 <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)">
3293 <modify-argument index="return">
3293 <modify-argument index="return">
3294 <define-ownership class="java" owner="c++"/>
3294 <define-ownership class="java" owner="c++"/>
3295 </modify-argument>
3295 </modify-argument>
3296 </modify-function>
3296 </modify-function>
3297 <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)">
3297 <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)">
3298 <modify-argument index="return">
3298 <modify-argument index="return">
3299 <define-ownership class="java" owner="c++"/>
3299 <define-ownership class="java" owner="c++"/>
3300 </modify-argument>
3300 </modify-argument>
3301 </modify-function>
3301 </modify-function>
3302 <modify-function signature="addPixmap(const QPixmap &amp;)">
3302 <modify-function signature="addPixmap(const QPixmap &amp;)">
3303 <modify-argument index="return">
3303 <modify-argument index="return">
3304 <define-ownership class="java" owner="c++"/>
3304 <define-ownership class="java" owner="c++"/>
3305 </modify-argument>
3305 </modify-argument>
3306 </modify-function>
3306 </modify-function>
3307 <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)">
3307 <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)">
3308 <modify-argument index="return">
3308 <modify-argument index="return">
3309 <define-ownership class="java" owner="c++"/>
3309 <define-ownership class="java" owner="c++"/>
3310 </modify-argument>
3310 </modify-argument>
3311 </modify-function>
3311 </modify-function>
3312 <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
3312 <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
3313 <modify-argument index="return">
3313 <modify-argument index="return">
3314 <define-ownership class="java" owner="c++"/>
3314 <define-ownership class="java" owner="c++"/>
3315 </modify-argument>
3315 </modify-argument>
3316 </modify-function>
3316 </modify-function>
3317 <modify-function signature="addText(const QString &amp;, const QFont &amp;)">
3317 <modify-function signature="addText(const QString &amp;, const QFont &amp;)">
3318 <modify-argument index="return">
3318 <modify-argument index="return">
3319 <define-ownership class="java" owner="c++"/>
3319 <define-ownership class="java" owner="c++"/>
3320 </modify-argument>
3320 </modify-argument>
3321 </modify-function>
3321 </modify-function>
3322 <modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3322 <modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3323 <modify-argument index="return">
3323 <modify-argument index="return">
3324 <define-ownership class="java" owner="c++"/>
3324 <define-ownership class="java" owner="c++"/>
3325 </modify-argument>
3325 </modify-argument>
3326 <modify-argument index="1">
3326 <modify-argument index="1">
3327 <define-ownership class="java" owner="c++"/>
3327 <define-ownership class="java" owner="c++"/>
3328 </modify-argument>
3328 </modify-argument>
3329 </modify-function>
3329 </modify-function>
3330 <modify-function signature="removeItem(QGraphicsItem*)">
3330 <modify-function signature="removeItem(QGraphicsItem*)">
3331 <modify-argument index="1">
3331 <modify-argument index="1">
3332 <define-ownership class="java" owner="default"/>
3332 <define-ownership class="java" owner="default"/>
3333 </modify-argument>
3333 </modify-argument>
3334 </modify-function>
3334 </modify-function>
3335 <modify-function signature="setFocusItem(QGraphicsItem*,Qt::FocusReason)">
3335 <modify-function signature="setFocusItem(QGraphicsItem*,Qt::FocusReason)">
3336 <modify-argument index="1">
3336 <modify-argument index="1">
3337 <reference-count action="set" variable-name="__rcFocusItem"/>
3337 <reference-count action="set" variable-name="__rcFocusItem"/>
3338 </modify-argument>
3338 </modify-argument>
3339 </modify-function>
3339 </modify-function>
3340 </object-type>
3340 </object-type>
3341
3341
3342
3342
3343 <object-type name="QCalendarWidget">
3343 <object-type name="QCalendarWidget">
3344 <extra-includes>
3344 <extra-includes>
3345 <include file-name="QTextCharFormat" location="global"/>
3345 <include file-name="QTextCharFormat" location="global"/>
3346 </extra-includes>
3346 </extra-includes>
3347
3347
3348 <modify-function signature="isHeaderVisible()const" remove="all"/> <!--### Obsolete in 4.3-->
3348 <modify-function signature="isHeaderVisible()const" remove="all"/> <!--### Obsolete in 4.3-->
3349 <modify-function signature="setHeaderVisible(bool)" remove="all"/> <!--### Obsolete in 4.3-->
3349 <modify-function signature="setHeaderVisible(bool)" remove="all"/> <!--### Obsolete in 4.3-->
3350
3350
3351 <modify-function signature="paintCell(QPainter*,QRect,QDate)const">
3351 <modify-function signature="paintCell(QPainter*,QRect,QDate)const">
3352 <modify-argument invalidate-after-use="yes" index="1"/>
3352 <modify-argument invalidate-after-use="yes" index="1"/>
3353 </modify-function>
3353 </modify-function>
3354
3354
3355 <modify-function signature="sizeHint()const" rename="getSizeHint"/>
3355 <modify-function signature="sizeHint()const" rename="getSizeHint"/>
3356 <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
3356 <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
3357 </object-type>
3357 </object-type>
3358
3358
3359 <object-type name="QTreeWidget">
3359 <object-type name="QTreeWidget">
3360 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
3360 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
3361 <modify-argument index="1">
3361 <modify-argument index="1">
3362 <no-null-pointer/>
3362 <no-null-pointer/>
3363 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
3363 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
3364 </modify-argument>
3364 </modify-argument>
3365 </modify-function>
3365 </modify-function>
3366 <modify-function signature="removeItemWidget(QTreeWidgetItem*,int)">
3366 <modify-function signature="removeItemWidget(QTreeWidgetItem*,int)">
3367 <modify-argument index="1">
3367 <modify-argument index="1">
3368 <reference-count action="ignore"/>
3368 <reference-count action="ignore"/>
3369 </modify-argument>
3369 </modify-argument>
3370 </modify-function>
3370 </modify-function>
3371 <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const">
3371 <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const">
3372 <modify-argument index="1" invalidate-after-use="yes"/>
3372 <modify-argument index="1" invalidate-after-use="yes"/>
3373 </modify-function>
3373 </modify-function>
3374 <modify-function signature="dropMimeData(QTreeWidgetItem*,int,const QMimeData*,Qt::DropAction)">
3374 <modify-function signature="dropMimeData(QTreeWidgetItem*,int,const QMimeData*,Qt::DropAction)">
3375 <modify-argument index="1" invalidate-after-use="yes"/>
3375 <modify-argument index="1" invalidate-after-use="yes"/>
3376 </modify-function>
3376 </modify-function>
3377 <modify-function signature="isSortingEnabled()const" remove="all"/>
3377 <modify-function signature="isSortingEnabled()const" remove="all"/>
3378 <modify-function signature="setSortingEnabled(bool)" remove="all"/>
3378 <modify-function signature="setSortingEnabled(bool)" remove="all"/>
3379 <modify-function signature="indexOfTopLevelItem(QTreeWidgetItem *)">
3379 <modify-function signature="indexOfTopLevelItem(QTreeWidgetItem *)">
3380 <remove/>
3380 <remove/>
3381 </modify-function>
3381 </modify-function>
3382 <modify-function signature="addTopLevelItem(QTreeWidgetItem *)">
3382 <modify-function signature="addTopLevelItem(QTreeWidgetItem *)">
3383 <modify-argument index="1">
3383 <modify-argument index="1">
3384 <define-ownership class="java" owner="c++"/>
3384 <define-ownership class="java" owner="c++"/>
3385 </modify-argument>
3385 </modify-argument>
3386 </modify-function>
3386 </modify-function>
3387 <modify-function signature="takeTopLevelItem(int)">
3387 <modify-function signature="takeTopLevelItem(int)">
3388 <modify-argument index="return">
3388 <modify-argument index="return">
3389 <define-ownership class="java" owner="default"/>
3389 <define-ownership class="java" owner="default"/>
3390 </modify-argument>
3390 </modify-argument>
3391 </modify-function>
3391 </modify-function>
3392 <modify-function signature="addTopLevelItems(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3392 <modify-function signature="addTopLevelItems(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3393 <modify-argument index="1">
3393 <modify-argument index="1">
3394 <define-ownership class="java" owner="c++"/>
3394 <define-ownership class="java" owner="c++"/>
3395 </modify-argument>
3395 </modify-argument>
3396 </modify-function>
3396 </modify-function>
3397 <modify-function signature="insertTopLevelItem(int, QTreeWidgetItem *)">
3397 <modify-function signature="insertTopLevelItem(int, QTreeWidgetItem *)">
3398 <modify-argument index="2">
3398 <modify-argument index="2">
3399 <define-ownership class="java" owner="c++"/>
3399 <define-ownership class="java" owner="c++"/>
3400 </modify-argument>
3400 </modify-argument>
3401 </modify-function>
3401 </modify-function>
3402 <modify-function signature="insertTopLevelItems(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3402 <modify-function signature="insertTopLevelItems(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3403 <modify-argument index="2">
3403 <modify-argument index="2">
3404 <define-ownership class="java" owner="c++"/>
3404 <define-ownership class="java" owner="c++"/>
3405 </modify-argument>
3405 </modify-argument>
3406 </modify-function>
3406 </modify-function>
3407 <modify-function signature="setHeaderItem(QTreeWidgetItem *)">
3407 <modify-function signature="setHeaderItem(QTreeWidgetItem *)">
3408 <modify-argument index="1">
3408 <modify-argument index="1">
3409 <define-ownership class="java" owner="c++"/>
3409 <define-ownership class="java" owner="c++"/>
3410 </modify-argument>
3410 </modify-argument>
3411 </modify-function>
3411 </modify-function>
3412 <modify-function signature="takeTopLevelItem(int)">
3412 <modify-function signature="takeTopLevelItem(int)">
3413 <modify-argument index="return">
3413 <modify-argument index="return">
3414 <define-ownership class="java" owner="default"/>
3414 <define-ownership class="java" owner="default"/>
3415 </modify-argument>
3415 </modify-argument>
3416 </modify-function>
3416 </modify-function>
3417 <modify-function signature="setCurrentItem(QTreeWidgetItem*,int,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
3417 <modify-function signature="setCurrentItem(QTreeWidgetItem*,int,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
3418 <modify-argument index="1">
3418 <modify-argument index="1">
3419 <reference-count action="ignore"/>
3419 <reference-count action="ignore"/>
3420 </modify-argument>
3420 </modify-argument>
3421 </modify-function>
3421 </modify-function>
3422 <modify-function signature="setFirstItemColumnSpanned(const QTreeWidgetItem*,bool)">
3422 <modify-function signature="setFirstItemColumnSpanned(const QTreeWidgetItem*,bool)">
3423 <modify-argument index="1">
3423 <modify-argument index="1">
3424 <reference-count action="ignore"/>
3424 <reference-count action="ignore"/>
3425 </modify-argument>
3425 </modify-argument>
3426 </modify-function>
3426 </modify-function>
3427 <modify-function signature="setCurrentItem(QTreeWidgetItem*)">
3427 <modify-function signature="setCurrentItem(QTreeWidgetItem*)">
3428 <modify-argument index="1">
3428 <modify-argument index="1">
3429 <reference-count action="ignore"/>
3429 <reference-count action="ignore"/>
3430 </modify-argument>
3430 </modify-argument>
3431 </modify-function>
3431 </modify-function>
3432 <modify-function signature="setCurrentItem(QTreeWidgetItem*,int)">
3432 <modify-function signature="setCurrentItem(QTreeWidgetItem*,int)">
3433 <modify-argument index="1">
3433 <modify-argument index="1">
3434 <reference-count action="ignore"/>
3434 <reference-count action="ignore"/>
3435 </modify-argument>
3435 </modify-argument>
3436 </modify-function>
3436 </modify-function>
3437 <modify-function signature="setItemExpanded(const QTreeWidgetItem*,bool)">
3437 <modify-function signature="setItemExpanded(const QTreeWidgetItem*,bool)">
3438 <remove/>
3438 <remove/>
3439 </modify-function>
3439 </modify-function>
3440 <modify-function signature="isItemExpanded(const QTreeWidgetItem*)const">
3440 <modify-function signature="isItemExpanded(const QTreeWidgetItem*)const">
3441 <remove/>
3441 <remove/>
3442 </modify-function>
3442 </modify-function>
3443 <modify-function signature="setItemHidden(const QTreeWidgetItem*,bool)">
3443 <modify-function signature="setItemHidden(const QTreeWidgetItem*,bool)">
3444 <remove/>
3444 <remove/>
3445 </modify-function>
3445 </modify-function>
3446 <modify-function signature="isItemHidden(const QTreeWidgetItem*)const">
3446 <modify-function signature="isItemHidden(const QTreeWidgetItem*)const">
3447 <remove/>
3447 <remove/>
3448 </modify-function>
3448 </modify-function>
3449 <modify-function signature="isItemSelected(const QTreeWidgetItem*)const">
3449 <modify-function signature="isItemSelected(const QTreeWidgetItem*)const">
3450 <remove/>
3450 <remove/>
3451 </modify-function>
3451 </modify-function>
3452 <modify-function signature="setItemSelected(const QTreeWidgetItem*,bool)">
3452 <modify-function signature="setItemSelected(const QTreeWidgetItem*,bool)">
3453 <remove/>
3453 <remove/>
3454 </modify-function>
3454 </modify-function>
3455 <modify-function signature="setItemWidget(QTreeWidgetItem*,int,QWidget*)">
3455 <modify-function signature="setItemWidget(QTreeWidgetItem*,int,QWidget*)">
3456 <modify-argument index="1">
3456 <modify-argument index="1">
3457 <reference-count action="ignore"/>
3457 <reference-count action="ignore"/>
3458 </modify-argument>
3458 </modify-argument>
3459 <modify-argument index="3">
3459 <modify-argument index="3">
3460 <reference-count action="ignore"/>
3460 <reference-count action="ignore"/>
3461 </modify-argument>
3461 </modify-argument>
3462 </modify-function>
3462 </modify-function>
3463 <modify-function signature="setModel(QAbstractItemModel*)">
3463 <modify-function signature="setModel(QAbstractItemModel*)">
3464 <modify-argument index="1">
3464 <modify-argument index="1">
3465 <reference-count action="ignore"/>
3465 <reference-count action="ignore"/>
3466 </modify-argument>
3466 </modify-argument>
3467 </modify-function>
3467 </modify-function>
3468
3468
3469 <modify-function signature="items(const QMimeData*)const" remove="all"/> <!--### Obsolete in 4.3-->
3469 <modify-function signature="items(const QMimeData*)const" remove="all"/> <!--### Obsolete in 4.3-->
3470
3470
3471 <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const" remove="all"/>
3471 <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const" remove="all"/>
3472 </object-type>
3472 </object-type>
3473
3473
3474 <object-type name="QAbstractItemDelegate">
3474 <object-type name="QAbstractItemDelegate">
3475 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
3475 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
3476 <modify-argument index="1">
3476 <modify-argument index="1">
3477 <!-- Safe to ignore because this implementation is documented to do nothing -->
3477 <!-- Safe to ignore because this implementation is documented to do nothing -->
3478 <reference-count action="ignore"/>
3478 <reference-count action="ignore"/>
3479 </modify-argument>
3479 </modify-argument>
3480 </modify-function>
3480 </modify-function>
3481 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
3481 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
3482 <modify-argument index="1">
3482 <modify-argument index="1">
3483 <reference-count action="ignore"/>
3483 <reference-count action="ignore"/>
3484 </modify-argument>
3484 </modify-argument>
3485 <modify-argument index="2">
3485 <modify-argument index="2">
3486 <reference-count action="ignore"/>
3486 <reference-count action="ignore"/>
3487 </modify-argument>
3487 </modify-argument>
3488 </modify-function>
3488 </modify-function>
3489
3489
3490 <modify-function signature="paint(QPainter*,QStyleOptionViewItem,QModelIndex)const">
3490 <modify-function signature="paint(QPainter*,QStyleOptionViewItem,QModelIndex)const">
3491 <modify-argument index="1" invalidate-after-use="yes"/>
3491 <modify-argument index="1" invalidate-after-use="yes"/>
3492 </modify-function>
3492 </modify-function>
3493 <modify-function signature="editorEvent(QEvent*,QAbstractItemModel*,QStyleOptionViewItem,QModelIndex)">
3493 <modify-function signature="editorEvent(QEvent*,QAbstractItemModel*,QStyleOptionViewItem,QModelIndex)">
3494 <modify-argument index="1" invalidate-after-use="yes"/>
3494 <modify-argument index="1" invalidate-after-use="yes"/>
3495 </modify-function>
3495 </modify-function>
3496
3496
3497 <modify-function signature="elidedText(QFontMetrics, int, Qt::TextElideMode, QString)" remove="all"/> <!--### Obsolete in 4.3-->
3497 <modify-function signature="elidedText(QFontMetrics, int, Qt::TextElideMode, QString)" remove="all"/> <!--### Obsolete in 4.3-->
3498 </object-type>
3498 </object-type>
3499
3499
3500 <object-type name="QTableWidgetItem" delete-in-main-thread="yes">
3500 <object-type name="QTableWidgetItem" delete-in-main-thread="yes">
3501 <modify-function signature="operator=(const QTableWidgetItem&amp;)" remove="all"/>
3501 <modify-function signature="operator=(const QTableWidgetItem&amp;)" remove="all"/>
3502 <modify-function signature="clone() const">
3502 <modify-function signature="clone() const">
3503 <modify-argument index="return">
3503 <modify-argument index="return">
3504 <define-ownership class="shell" owner="c++"/>
3504 <define-ownership class="shell" owner="c++"/>
3505 </modify-argument>
3505 </modify-argument>
3506 </modify-function>
3506 </modify-function>
3507
3507
3508 <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3508 <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3509 <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3509 <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3510 <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3510 <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3511 <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3511 <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3512
3512
3513 <modify-function signature="operator&lt;(QTableWidgetItem)const">
3513 <modify-function signature="operator&lt;(QTableWidgetItem)const">
3514 <modify-argument index="1" invalidate-after-use="yes"/>
3514 <modify-argument index="1" invalidate-after-use="yes"/>
3515 </modify-function>
3515 </modify-function>
3516 <modify-function signature="read(QDataStream&amp;)">
3516 <modify-function signature="read(QDataStream&amp;)">
3517 <modify-argument index="1" invalidate-after-use="yes"/>
3517 <modify-argument index="1" invalidate-after-use="yes"/>
3518 </modify-function>
3518 </modify-function>
3519 <modify-function signature="write(QDataStream&amp;)const">
3519 <modify-function signature="write(QDataStream&amp;)const">
3520 <modify-argument index="1" invalidate-after-use="yes"/>
3520 <modify-argument index="1" invalidate-after-use="yes"/>
3521 </modify-function>
3521 </modify-function>
3522
3522
3523
3523
3524 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3524 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3525 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3525 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3526 <modify-function signature="QTableWidgetItem(QTableWidgetItem)" remove="all"/>
3526 <modify-function signature="QTableWidgetItem(QTableWidgetItem)" remove="all"/>
3527 <modify-function signature="operator=(QTableWidgetItem)" remove="all"/>
3527 <modify-function signature="operator=(QTableWidgetItem)" remove="all"/>
3528 <modify-function signature="operator&lt;(QTableWidgetItem)const" remove="all"/>
3528 <modify-function signature="operator&lt;(QTableWidgetItem)const" remove="all"/>
3529 </object-type>
3529 </object-type>
3530
3530
3531 <object-type name="QListWidgetItem" delete-in-main-thread="yes">
3531 <object-type name="QListWidgetItem" delete-in-main-thread="yes">
3532
3532
3533 <modify-function signature="operator&lt;(QListWidgetItem)const">
3533 <modify-function signature="operator&lt;(QListWidgetItem)const">
3534 <modify-argument index="1" invalidate-after-use="yes"/>
3534 <modify-argument index="1" invalidate-after-use="yes"/>
3535 </modify-function>
3535 </modify-function>
3536 <modify-function signature="read(QDataStream&amp;)">
3536 <modify-function signature="read(QDataStream&amp;)">
3537 <modify-argument index="1" invalidate-after-use="yes"/>
3537 <modify-argument index="1" invalidate-after-use="yes"/>
3538 </modify-function>
3538 </modify-function>
3539 <modify-function signature="write(QDataStream&amp;)const">
3539 <modify-function signature="write(QDataStream&amp;)const">
3540 <modify-argument index="1" invalidate-after-use="yes"/>
3540 <modify-argument index="1" invalidate-after-use="yes"/>
3541 </modify-function>
3541 </modify-function>
3542
3542
3543
3543
3544 <modify-function signature="operator=(const QListWidgetItem&amp;)" remove="all"/>
3544 <modify-function signature="operator=(const QListWidgetItem&amp;)" remove="all"/>
3545 <modify-function signature="QListWidgetItem(QListWidget *, int)">
3545 <modify-function signature="QListWidgetItem(QListWidget *, int)">
3546 <modify-argument index="this">
3546 <modify-argument index="this">
3547 <define-ownership class="java" owner="c++"/>
3547 <define-ownership class="java" owner="c++"/>
3548 </modify-argument>
3548 </modify-argument>
3549 </modify-function>
3549 </modify-function>
3550 <modify-function signature="QListWidgetItem(const QString &amp;, QListWidget *, int)">
3550 <modify-function signature="QListWidgetItem(const QString &amp;, QListWidget *, int)">
3551 <modify-argument index="this">
3551 <modify-argument index="this">
3552 <define-ownership class="java" owner="c++"/>
3552 <define-ownership class="java" owner="c++"/>
3553 </modify-argument>
3553 </modify-argument>
3554 </modify-function>
3554 </modify-function>
3555 <modify-function signature="QListWidgetItem(const QIcon &amp;, const QString &amp;, QListWidget *, int)">
3555 <modify-function signature="QListWidgetItem(const QIcon &amp;, const QString &amp;, QListWidget *, int)">
3556 <modify-argument index="this">
3556 <modify-argument index="this">
3557 <define-ownership class="java" owner="c++"/>
3557 <define-ownership class="java" owner="c++"/>
3558 </modify-argument>
3558 </modify-argument>
3559 </modify-function>
3559 </modify-function>
3560 <modify-function signature="clone() const">
3560 <modify-function signature="clone() const">
3561 <modify-argument index="return">
3561 <modify-argument index="return">
3562 <define-ownership class="shell" owner="c++"/>
3562 <define-ownership class="shell" owner="c++"/>
3563 </modify-argument>
3563 </modify-argument>
3564 </modify-function>
3564 </modify-function>
3565
3565
3566 <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3566 <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3567 <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3567 <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3568 <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3568 <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3569 <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3569 <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3570
3570
3571 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3571 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3572 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3572 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3573 <modify-function signature="QListWidgetItem(QListWidgetItem)" remove="all"/>
3573 <modify-function signature="QListWidgetItem(QListWidgetItem)" remove="all"/>
3574 <modify-function signature="operator=(QListWidgetItem)" remove="all"/>
3574 <modify-function signature="operator=(QListWidgetItem)" remove="all"/>
3575 <modify-function signature="operator&lt;(QListWidgetItem)const" remove="all"/>
3575 <modify-function signature="operator&lt;(QListWidgetItem)const" remove="all"/>
3576 </object-type>
3576 </object-type>
3577
3577
3578 <object-type name="QGraphicsTextItem" polymorphic-id-expression="%1-&gt;type() == QGraphicsTextItem::Type"> <!-- a QObject so main-thread delete redundant -->
3578 <object-type name="QGraphicsTextItem" polymorphic-id-expression="%1-&gt;type() == QGraphicsTextItem::Type"> <!-- a QObject so main-thread delete redundant -->
3579 <extra-includes>
3579 <extra-includes>
3580 <include file-name="QTextCursor" location="global"/>
3580 <include file-name="QTextCursor" location="global"/>
3581 </extra-includes>
3581 </extra-includes>
3582 <modify-function signature="QGraphicsTextItem(QGraphicsItem*,QGraphicsScene*)">
3582 <modify-function signature="QGraphicsTextItem(QGraphicsItem*,QGraphicsScene*)">
3583 <inject-code position="end">
3583 <inject-code position="end">
3584 <argument-map index="1" meta-name="%1"/>
3584 <argument-map index="1" meta-name="%1"/>
3585 if (%1 != null) disableGarbageCollection();
3585 if (%1 != null) disableGarbageCollection();
3586 </inject-code>
3586 </inject-code>
3587 </modify-function>
3587 </modify-function>
3588 <modify-function signature="QGraphicsTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
3588 <modify-function signature="QGraphicsTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
3589 <inject-code position="end">
3589 <inject-code position="end">
3590 <argument-map index="2" meta-name="%2"/>
3590 <argument-map index="2" meta-name="%2"/>
3591 if (%2 != null) disableGarbageCollection();
3591 if (%2 != null) disableGarbageCollection();
3592 </inject-code>
3592 </inject-code>
3593 </modify-function>
3593 </modify-function>
3594 <modify-function signature="setDocument(QTextDocument*)">
3594 <modify-function signature="setDocument(QTextDocument*)">
3595 <modify-argument index="1">
3595 <modify-argument index="1">
3596 <reference-count action="set" variable-name="__rcDocument"/>
3596 <reference-count action="set" variable-name="__rcDocument"/>
3597 </modify-argument>
3597 </modify-argument>
3598 </modify-function>
3598 </modify-function>
3599
3599
3600 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
3600 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
3601 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
3601 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
3602 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
3602 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
3603 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
3603 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
3604 </object-type>
3604 </object-type>
3605
3605
3606 <object-type name="QCompleter">
3606 <object-type name="QCompleter">
3607 <modify-function signature="activated(const QModelIndex &amp;)">
3607 <modify-function signature="activated(const QModelIndex &amp;)">
3608 <rename to="activatedIndex"/>
3608 <rename to="activatedIndex"/>
3609 </modify-function>
3609 </modify-function>
3610 <modify-function signature="highlighted(const QModelIndex &amp;)">
3610 <modify-function signature="highlighted(const QModelIndex &amp;)">
3611 <rename to="highlightedIndex"/>
3611 <rename to="highlightedIndex"/>
3612 </modify-function>
3612 </modify-function>
3613 <modify-function signature="setModel(QAbstractItemModel *)">
3613 <modify-function signature="setModel(QAbstractItemModel *)">
3614 <modify-argument index="1">
3614 <modify-argument index="1">
3615 <reference-count action="set" variable-name="__rcModel"/>
3615 <reference-count action="set" variable-name="__rcModel"/>
3616 </modify-argument>
3616 </modify-argument>
3617 </modify-function>
3617 </modify-function>
3618 <modify-function signature="setPopup(QAbstractItemView *)">
3618 <modify-function signature="setPopup(QAbstractItemView *)">
3619 <modify-argument index="1">
3619 <modify-argument index="1">
3620 <no-null-pointer/>
3620 <no-null-pointer/>
3621 <define-ownership class="java" owner="c++"/>
3621 <define-ownership class="java" owner="c++"/>
3622 </modify-argument>
3622 </modify-argument>
3623 </modify-function>
3623 </modify-function>
3624 <modify-function signature="setWidget(QWidget *)">
3624 <modify-function signature="setWidget(QWidget *)">
3625 <modify-argument index="1">
3625 <modify-argument index="1">
3626 <reference-count action="set" variable-name="__rcWidget"/>
3626 <reference-count action="set" variable-name="__rcWidget"/>
3627 </modify-argument>
3627 </modify-argument>
3628 </modify-function>
3628 </modify-function>
3629 </object-type>
3629 </object-type>
3630
3630
3631
3631
3632 <object-type name="QTreeWidgetItem" delete-in-main-thread="yes">
3632 <object-type name="QTreeWidgetItem" delete-in-main-thread="yes">
3633
3633
3634 <modify-function signature="operator&lt;(QTreeWidgetItem)const">
3634 <modify-function signature="operator&lt;(QTreeWidgetItem)const">
3635 <modify-argument index="1" invalidate-after-use="yes"/>
3635 <modify-argument index="1" invalidate-after-use="yes"/>
3636 </modify-function>
3636 </modify-function>
3637 <modify-function signature="read(QDataStream&amp;)">
3637 <modify-function signature="read(QDataStream&amp;)">
3638 <modify-argument index="1" invalidate-after-use="yes"/>
3638 <modify-argument index="1" invalidate-after-use="yes"/>
3639 </modify-function>
3639 </modify-function>
3640 <modify-function signature="write(QDataStream&amp;)const">
3640 <modify-function signature="write(QDataStream&amp;)const">
3641 <modify-argument index="1" invalidate-after-use="yes"/>
3641 <modify-argument index="1" invalidate-after-use="yes"/>
3642 </modify-function>
3642 </modify-function>
3643
3643
3644 <modify-function signature="QTreeWidgetItem(const QTreeWidgetItem &amp;)" remove="all"/>
3644 <modify-function signature="QTreeWidgetItem(const QTreeWidgetItem &amp;)" remove="all"/>
3645 <modify-function signature="operator=(const QTreeWidgetItem&amp;)" remove="all"/>
3645 <modify-function signature="operator=(const QTreeWidgetItem&amp;)" remove="all"/>
3646
3646
3647 <modify-function signature="QTreeWidgetItem(QTreeWidget *,int)">
3647 <modify-function signature="QTreeWidgetItem(QTreeWidget *,int)">
3648 <modify-argument index="this">
3648 <modify-argument index="this">
3649 <define-ownership class="java" owner="c++"/>
3649 <define-ownership class="java" owner="c++"/>
3650 </modify-argument>
3650 </modify-argument>
3651 </modify-function>
3651 </modify-function>
3652 <modify-function signature="QTreeWidgetItem(QTreeWidget *,const QStringList&lt;QString&gt; &amp;,int)">
3652 <modify-function signature="QTreeWidgetItem(QTreeWidget *,const QStringList&lt;QString&gt; &amp;,int)">
3653 <modify-argument index="this">
3653 <modify-argument index="this">
3654 <define-ownership class="java" owner="c++"/>
3654 <define-ownership class="java" owner="c++"/>
3655 </modify-argument>
3655 </modify-argument>
3656 </modify-function>
3656 </modify-function>
3657 <modify-function signature="QTreeWidgetItem(QTreeWidget *,QTreeWidgetItem *,int)">
3657 <modify-function signature="QTreeWidgetItem(QTreeWidget *,QTreeWidgetItem *,int)">
3658 <modify-argument index="this">
3658 <modify-argument index="this">
3659 <define-ownership class="java" owner="c++"/>
3659 <define-ownership class="java" owner="c++"/>
3660 </modify-argument>
3660 </modify-argument>
3661 </modify-function>
3661 </modify-function>
3662 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,int)">
3662 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,int)">
3663 <modify-argument index="this">
3663 <modify-argument index="this">
3664 <define-ownership class="java" owner="c++"/>
3664 <define-ownership class="java" owner="c++"/>
3665 </modify-argument>
3665 </modify-argument>
3666 </modify-function>
3666 </modify-function>
3667 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,const QStringList&lt;QString&gt; &amp;,int)">
3667 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,const QStringList&lt;QString&gt; &amp;,int)">
3668 <modify-argument index="this">
3668 <modify-argument index="this">
3669 <define-ownership class="java" owner="c++"/>
3669 <define-ownership class="java" owner="c++"/>
3670 </modify-argument>
3670 </modify-argument>
3671 </modify-function>
3671 </modify-function>
3672 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,QTreeWidgetItem *,int)">
3672 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,QTreeWidgetItem *,int)">
3673 <modify-argument index="this">
3673 <modify-argument index="this">
3674 <define-ownership class="java" owner="c++"/>
3674 <define-ownership class="java" owner="c++"/>
3675 </modify-argument>
3675 </modify-argument>
3676 </modify-function>
3676 </modify-function>
3677 <modify-function signature="clone() const">
3677 <modify-function signature="clone() const">
3678 <modify-argument index="return">
3678 <modify-argument index="return">
3679 <define-ownership class="shell" owner="c++"/>
3679 <define-ownership class="shell" owner="c++"/>
3680 </modify-argument>
3680 </modify-argument>
3681 </modify-function>
3681 </modify-function>
3682 <modify-function signature="addChild(QTreeWidgetItem *)">
3682 <modify-function signature="addChild(QTreeWidgetItem *)">
3683 <modify-argument index="1">
3683 <modify-argument index="1">
3684 <define-ownership class="java" owner="c++"/>
3684 <define-ownership class="java" owner="c++"/>
3685 </modify-argument>
3685 </modify-argument>
3686 </modify-function>
3686 </modify-function>
3687 <modify-function signature="addChildren(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3687 <modify-function signature="addChildren(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3688 <modify-argument index="1">
3688 <modify-argument index="1">
3689 <define-ownership class="java" owner="c++"/>
3689 <define-ownership class="java" owner="c++"/>
3690 </modify-argument>
3690 </modify-argument>
3691 </modify-function>
3691 </modify-function>
3692 <modify-function signature="insertChild(int, QTreeWidgetItem *)">
3692 <modify-function signature="insertChild(int, QTreeWidgetItem *)">
3693 <modify-argument index="2">
3693 <modify-argument index="2">
3694 <define-ownership class="java" owner="c++"/>
3694 <define-ownership class="java" owner="c++"/>
3695 </modify-argument>
3695 </modify-argument>
3696 </modify-function>
3696 </modify-function>
3697 <modify-function signature="insertChildren(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3697 <modify-function signature="insertChildren(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3698 <modify-argument index="2">
3698 <modify-argument index="2">
3699 <define-ownership class="java" owner="c++"/>
3699 <define-ownership class="java" owner="c++"/>
3700 </modify-argument>
3700 </modify-argument>
3701 </modify-function>
3701 </modify-function>
3702 <modify-function signature="removeChild(QTreeWidgetItem*)">
3702 <modify-function signature="removeChild(QTreeWidgetItem*)">
3703 <modify-argument index="1">
3703 <modify-argument index="1">
3704 <define-ownership class="java" owner="default"/>
3704 <define-ownership class="java" owner="default"/>
3705 </modify-argument>
3705 </modify-argument>
3706 </modify-function>
3706 </modify-function>
3707 <modify-function signature="takeChild(int)">
3707 <modify-function signature="takeChild(int)">
3708 <modify-argument index="return">
3708 <modify-argument index="return">
3709 <define-ownership class="java" owner="default"/>
3709 <define-ownership class="java" owner="default"/>
3710 </modify-argument>
3710 </modify-argument>
3711 </modify-function>
3711 </modify-function>
3712 <modify-function signature="takeChildren()">
3712 <modify-function signature="takeChildren()">
3713 <modify-argument index="return">
3713 <modify-argument index="return">
3714 <define-ownership class="java" owner="default"/>
3714 <define-ownership class="java" owner="default"/>
3715 </modify-argument>
3715 </modify-argument>
3716 </modify-function>
3716 </modify-function>
3717
3717
3718 <modify-function signature="backgroundColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3718 <modify-function signature="backgroundColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3719 <modify-function signature="setBackgroundColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3719 <modify-function signature="setBackgroundColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3720 <modify-function signature="setTextColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3720 <modify-function signature="setTextColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3721 <modify-function signature="textColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3721 <modify-function signature="textColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3722
3722
3723 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3723 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3724 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3724 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3725 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem)" remove="all"/>
3725 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem)" remove="all"/>
3726 <modify-function signature="operator=(QTreeWidgetItem)" remove="all"/>
3726 <modify-function signature="operator=(QTreeWidgetItem)" remove="all"/>
3727 <modify-function signature="operator&lt;(QTreeWidgetItem)const" remove="all"/>
3727 <modify-function signature="operator&lt;(QTreeWidgetItem)const" remove="all"/>
3728 </object-type>
3728 </object-type>
3729
3729
3730 <object-type name="QListWidget">
3730 <object-type name="QListWidget">
3731 <modify-function signature="mimeData(const QList&lt;QListWidgetItem *&gt;)const">
3731 <modify-function signature="mimeData(const QList&lt;QListWidgetItem *&gt;)const">
3732 <modify-argument index="1" invalidate-after-use="yes"/>
3732 <modify-argument index="1" invalidate-after-use="yes"/>
3733 </modify-function>
3733 </modify-function>
3734 <modify-function signature="addItem(QListWidgetItem *)">
3734 <modify-function signature="addItem(QListWidgetItem *)">
3735 <modify-argument index="1">
3735 <modify-argument index="1">
3736 <define-ownership class="java" owner="c++"/>
3736 <define-ownership class="java" owner="c++"/>
3737 </modify-argument>
3737 </modify-argument>
3738 </modify-function>
3738 </modify-function>
3739 <modify-function signature="insertItem(int, QListWidgetItem *)">
3739 <modify-function signature="insertItem(int, QListWidgetItem *)">
3740 <modify-argument index="2">
3740 <modify-argument index="2">
3741 <define-ownership class="java" owner="c++"/>
3741 <define-ownership class="java" owner="c++"/>
3742 </modify-argument>
3742 </modify-argument>
3743 </modify-function>
3743 </modify-function>
3744 <modify-function signature="setCurrentItem(QListWidgetItem*)">
3744 <modify-function signature="setCurrentItem(QListWidgetItem*)">
3745 <modify-argument index="1">
3745 <modify-argument index="1">
3746 <reference-count action="ignore"/>
3746 <reference-count action="ignore"/>
3747 </modify-argument>
3747 </modify-argument>
3748 </modify-function>
3748 </modify-function>
3749 <modify-function signature="setCurrentItem(QListWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
3749 <modify-function signature="setCurrentItem(QListWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
3750 <modify-argument index="1">
3750 <modify-argument index="1">
3751 <reference-count action="ignore"/>
3751 <reference-count action="ignore"/>
3752 </modify-argument>
3752 </modify-argument>
3753 </modify-function>
3753 </modify-function>
3754 <modify-function signature="setItemHidden(const QListWidgetItem*,bool)">
3754 <modify-function signature="setItemHidden(const QListWidgetItem*,bool)">
3755 <remove/>
3755 <remove/>
3756 </modify-function>
3756 </modify-function>
3757 <modify-function signature="isItemHidden(const QListWidgetItem*)const">
3757 <modify-function signature="isItemHidden(const QListWidgetItem*)const">
3758 <remove/>
3758 <remove/>
3759 </modify-function>
3759 </modify-function>
3760 <modify-function signature="setItemSelected(const QListWidgetItem*,bool)">
3760 <modify-function signature="setItemSelected(const QListWidgetItem*,bool)">
3761 <remove/>
3761 <remove/>
3762 </modify-function>
3762 </modify-function>
3763 <modify-function signature="isItemSelected(const QListWidgetItem*)const">
3763 <modify-function signature="isItemSelected(const QListWidgetItem*)const">
3764 <remove/>
3764 <remove/>
3765 </modify-function>
3765 </modify-function>
3766 <modify-function signature="takeItem(int)">
3766 <modify-function signature="takeItem(int)">
3767 <modify-argument index="return">
3767 <modify-argument index="return">
3768 <define-ownership class="java" owner="default"/>
3768 <define-ownership class="java" owner="default"/>
3769 </modify-argument>
3769 </modify-argument>
3770 </modify-function>
3770 </modify-function>
3771 <modify-function signature="setItemWidget(QListWidgetItem*,QWidget*)">
3771 <modify-function signature="setItemWidget(QListWidgetItem*,QWidget*)">
3772 <modify-argument index="1">
3772 <modify-argument index="1">
3773 <reference-count action="ignore"/>
3773 <reference-count action="ignore"/>
3774 </modify-argument>
3774 </modify-argument>
3775 <modify-argument index="2">
3775 <modify-argument index="2">
3776 <reference-count action="ignore"/>
3776 <reference-count action="ignore"/>
3777 </modify-argument>
3777 </modify-argument>
3778 </modify-function>
3778 </modify-function>
3779 <modify-function signature="removeItemWidget(QListWidgetItem*)">
3779 <modify-function signature="removeItemWidget(QListWidgetItem*)">
3780 <modify-argument index="1">
3780 <modify-argument index="1">
3781 <reference-count action="ignore"/>
3781 <reference-count action="ignore"/>
3782 </modify-argument>
3782 </modify-argument>
3783 </modify-function>
3783 </modify-function>
3784 <modify-function signature="setModel(QAbstractItemModel*)">
3784 <modify-function signature="setModel(QAbstractItemModel*)">
3785 <modify-argument index="1">
3785 <modify-argument index="1">
3786 <reference-count action="ignore"/>
3786 <reference-count action="ignore"/>
3787 </modify-argument>
3787 </modify-argument>
3788 </modify-function>
3788 </modify-function>
3789
3789
3790
3790
3791 <modify-function signature="mimeData(const QList&lt;QListWidgetItem*&gt;)const" remove="all"/>
3791 <modify-function signature="mimeData(const QList&lt;QListWidgetItem*&gt;)const" remove="all"/>
3792 </object-type>
3792 </object-type>
3793
3793
3794 <object-type name="QWidget">
3794 <object-type name="QWidget">
3795 <extra-includes>
3795 <extra-includes>
3796 <include file-name="QIcon" location="global"/>
3796 <include file-name="QIcon" location="global"/>
3797 <include file-name="QMessageBox" location="global"/>
3797 <include file-name="QMessageBox" location="global"/>
3798 </extra-includes>
3798 </extra-includes>
3799
3799
3800 <modify-function signature="actionEvent(QActionEvent*)">
3800 <modify-function signature="actionEvent(QActionEvent*)">
3801 <modify-argument index="1" invalidate-after-use="yes"/>
3801 <modify-argument index="1" invalidate-after-use="yes"/>
3802 </modify-function>
3802 </modify-function>
3803 <modify-function signature="changeEvent(QEvent*)">
3803 <modify-function signature="changeEvent(QEvent*)">
3804 <modify-argument index="1" invalidate-after-use="yes"/>
3804 <modify-argument index="1" invalidate-after-use="yes"/>
3805 </modify-function>
3805 </modify-function>
3806 <modify-function signature="closeEvent(QCloseEvent*)">
3806 <modify-function signature="closeEvent(QCloseEvent*)">
3807 <modify-argument index="1" invalidate-after-use="yes"/>
3807 <modify-argument index="1" invalidate-after-use="yes"/>
3808 </modify-function>
3808 </modify-function>
3809 <modify-function signature="contextMenuEvent(QContextMenuEvent*)">
3809 <modify-function signature="contextMenuEvent(QContextMenuEvent*)">
3810 <modify-argument index="1" invalidate-after-use="yes"/>
3810 <modify-argument index="1" invalidate-after-use="yes"/>
3811 </modify-function>
3811 </modify-function>
3812 <modify-function signature="dragEnterEvent(QDragEnterEvent*)">
3812 <modify-function signature="dragEnterEvent(QDragEnterEvent*)">
3813 <modify-argument index="1" invalidate-after-use="yes"/>
3813 <modify-argument index="1" invalidate-after-use="yes"/>
3814 </modify-function>
3814 </modify-function>
3815 <modify-function signature="dragLeaveEvent(QDragLeaveEvent*)">
3815 <modify-function signature="dragLeaveEvent(QDragLeaveEvent*)">
3816 <modify-argument index="1" invalidate-after-use="yes"/>
3816 <modify-argument index="1" invalidate-after-use="yes"/>
3817 </modify-function>
3817 </modify-function>
3818 <modify-function signature="dragMoveEvent(QDragMoveEvent*)">
3818 <modify-function signature="dragMoveEvent(QDragMoveEvent*)">
3819 <modify-argument index="1" invalidate-after-use="yes"/>
3819 <modify-argument index="1" invalidate-after-use="yes"/>
3820 </modify-function>
3820 </modify-function>
3821 <modify-function signature="dropEvent(QDropEvent*)">
3821 <modify-function signature="dropEvent(QDropEvent*)">
3822 <modify-argument index="1" invalidate-after-use="yes"/>
3822 <modify-argument index="1" invalidate-after-use="yes"/>
3823 </modify-function>
3823 </modify-function>
3824 <modify-function signature="enterEvent(QEvent*)">
3824 <modify-function signature="enterEvent(QEvent*)">
3825 <modify-argument index="1" invalidate-after-use="yes"/>
3825 <modify-argument index="1" invalidate-after-use="yes"/>
3826 </modify-function>
3826 </modify-function>
3827 <modify-function signature="focusInEvent(QFocusEvent*)">
3827 <modify-function signature="focusInEvent(QFocusEvent*)">
3828 <modify-argument index="1" invalidate-after-use="yes"/>
3828 <modify-argument index="1" invalidate-after-use="yes"/>
3829 </modify-function>
3829 </modify-function>
3830 <modify-function signature="focusOutEvent(QFocusEvent*)">
3830 <modify-function signature="focusOutEvent(QFocusEvent*)">
3831 <modify-argument index="1" invalidate-after-use="yes"/>
3831 <modify-argument index="1" invalidate-after-use="yes"/>
3832 </modify-function>
3832 </modify-function>
3833 <modify-function signature="hideEvent(QHideEvent*)">
3833 <modify-function signature="hideEvent(QHideEvent*)">
3834 <modify-argument index="1" invalidate-after-use="yes"/>
3834 <modify-argument index="1" invalidate-after-use="yes"/>
3835 </modify-function>
3835 </modify-function>
3836 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
3836 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
3837 <modify-argument index="1" invalidate-after-use="yes"/>
3837 <modify-argument index="1" invalidate-after-use="yes"/>
3838 </modify-function>
3838 </modify-function>
3839 <modify-function signature="keyPressEvent(QKeyEvent*)">
3839 <modify-function signature="keyPressEvent(QKeyEvent*)">
3840 <modify-argument index="1" invalidate-after-use="yes"/>
3840 <modify-argument index="1" invalidate-after-use="yes"/>
3841 </modify-function>
3841 </modify-function>
3842 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
3842 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
3843 <modify-argument index="1" invalidate-after-use="yes"/>
3843 <modify-argument index="1" invalidate-after-use="yes"/>
3844 </modify-function>
3844 </modify-function>
3845 <modify-function signature="leaveEvent(QEvent*)">
3845 <modify-function signature="leaveEvent(QEvent*)">
3846 <modify-argument index="1" invalidate-after-use="yes"/>
3846 <modify-argument index="1" invalidate-after-use="yes"/>
3847 </modify-function>
3847 </modify-function>
3848 <modify-function signature="mouseDoubleClickEvent(QMouseEvent*)">
3848 <modify-function signature="mouseDoubleClickEvent(QMouseEvent*)">
3849 <modify-argument index="1" invalidate-after-use="yes"/>
3849 <modify-argument index="1" invalidate-after-use="yes"/>
3850 </modify-function>
3850 </modify-function>
3851 <modify-function signature="mouseMoveEvent(QMouseEvent*)">
3851 <modify-function signature="mouseMoveEvent(QMouseEvent*)">
3852 <modify-argument index="1" invalidate-after-use="yes"/>
3852 <modify-argument index="1" invalidate-after-use="yes"/>
3853 </modify-function>
3853 </modify-function>
3854 <modify-function signature="mousePressEvent(QMouseEvent*)">
3854 <modify-function signature="mousePressEvent(QMouseEvent*)">
3855 <modify-argument index="1" invalidate-after-use="yes"/>
3855 <modify-argument index="1" invalidate-after-use="yes"/>
3856 </modify-function>
3856 </modify-function>
3857 <modify-function signature="mouseReleaseEvent(QMouseEvent*)">
3857 <modify-function signature="mouseReleaseEvent(QMouseEvent*)">
3858 <modify-argument index="1" invalidate-after-use="yes"/>
3858 <modify-argument index="1" invalidate-after-use="yes"/>
3859 </modify-function>
3859 </modify-function>
3860 <modify-function signature="moveEvent(QMoveEvent*)">
3860 <modify-function signature="moveEvent(QMoveEvent*)">
3861 <modify-argument index="1" invalidate-after-use="yes"/>
3861 <modify-argument index="1" invalidate-after-use="yes"/>
3862 </modify-function>
3862 </modify-function>
3863 <modify-function signature="paintEvent(QPaintEvent*)">
3863 <modify-function signature="paintEvent(QPaintEvent*)">
3864 <modify-argument index="1" invalidate-after-use="yes"/>
3864 <modify-argument index="1" invalidate-after-use="yes"/>
3865 </modify-function>
3865 </modify-function>
3866 <modify-function signature="resizeEvent(QResizeEvent*)">
3866 <modify-function signature="resizeEvent(QResizeEvent*)">
3867 <modify-argument index="1" invalidate-after-use="yes"/>
3867 <modify-argument index="1" invalidate-after-use="yes"/>
3868 </modify-function>
3868 </modify-function>
3869 <modify-function signature="showEvent(QShowEvent*)">
3869 <modify-function signature="showEvent(QShowEvent*)">
3870 <modify-argument index="1" invalidate-after-use="yes"/>
3870 <modify-argument index="1" invalidate-after-use="yes"/>
3871 </modify-function>
3871 </modify-function>
3872 <modify-function signature="tabletEvent(QTabletEvent*)">
3872 <modify-function signature="tabletEvent(QTabletEvent*)">
3873 <modify-argument index="1" invalidate-after-use="yes"/>
3873 <modify-argument index="1" invalidate-after-use="yes"/>
3874 </modify-function>
3874 </modify-function>
3875 <modify-function signature="wheelEvent(QWheelEvent*)">
3875 <modify-function signature="wheelEvent(QWheelEvent*)">
3876 <modify-argument index="1" invalidate-after-use="yes"/>
3876 <modify-argument index="1" invalidate-after-use="yes"/>
3877 </modify-function>
3877 </modify-function>
3878
3878
3879 <modify-function signature="render(QPainter*,QPoint,QRegion,QFlags&lt;QWidget::RenderFlag&gt;)">
3879 <modify-function signature="render(QPainter*,QPoint,QRegion,QFlags&lt;QWidget::RenderFlag&gt;)">
3880 <modify-argument index="2">
3880 <modify-argument index="2">
3881 <!-- Removed because the render(QPainter*) overload conflicts with the identical function in QGraphicsView -->
3881 <!-- Removed because the render(QPainter*) overload conflicts with the identical function in QGraphicsView -->
3882 <remove-default-expression/>
3882 <remove-default-expression/>
3883 </modify-argument>
3883 </modify-argument>
3884 </modify-function>
3884 </modify-function>
3885
3885
3886 <inject-code class="native">
3886 <inject-code class="native">
3887 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowTitle)
3887 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowTitle)
3888 (JNIEnv *__jni_env,
3888 (JNIEnv *__jni_env,
3889 jclass,
3889 jclass,
3890 jlong __this_nativeId,
3890 jlong __this_nativeId,
3891 jobject title0)
3891 jobject title0)
3892 {
3892 {
3893 QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowTitle(const QString &amp; title)");
3893 QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowTitle(const QString &amp; title)");
3894 QString __qt_title0 = qtjambi_to_qstring(__jni_env, (jstring) title0);
3894 QString __qt_title0 = qtjambi_to_qstring(__jni_env, (jstring) title0);
3895 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3895 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3896 QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
3896 QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
3897 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3897 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3898 Q_ASSERT(__qt_this);
3898 Q_ASSERT(__qt_this);
3899 __qt_this-&gt;setWindowTitle((const QString&amp; )__qt_title0);
3899 __qt_this-&gt;setWindowTitle((const QString&amp; )__qt_title0);
3900 QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowTitle(const QString &amp; title)");
3900 QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowTitle(const QString &amp; title)");
3901 }
3901 }
3902 </inject-code>
3902 </inject-code>
3903
3903
3904 <inject-code class="native">
3904 <inject-code class="native">
3905 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowModality)
3905 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowModality)
3906 (JNIEnv *__jni_env,
3906 (JNIEnv *__jni_env,
3907 jclass,
3907 jclass,
3908 jlong __this_nativeId,
3908 jlong __this_nativeId,
3909 jint windowModality0)
3909 jint windowModality0)
3910 {
3910 {
3911 Q_UNUSED(__jni_env);
3911 Q_UNUSED(__jni_env);
3912 QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowModality(Qt::WindowModality modality)");
3912 QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowModality(Qt::WindowModality modality)");
3913 Qt::WindowModality __qt_windowModality0 = (Qt::WindowModality) windowModality0;
3913 Qt::WindowModality __qt_windowModality0 = (Qt::WindowModality) windowModality0;
3914 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3914 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3915 QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
3915 QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
3916 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3916 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3917 Q_ASSERT(__qt_this);
3917 Q_ASSERT(__qt_this);
3918 __qt_this-&gt;setWindowModality((Qt::WindowModality )__qt_windowModality0);
3918 __qt_this-&gt;setWindowModality((Qt::WindowModality )__qt_windowModality0);
3919 QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowModality(Qt::WindowModality modality)");
3919 QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowModality(Qt::WindowModality modality)");
3920 }
3920 }
3921 </inject-code>
3921 </inject-code>
3922
3922
3923 <modify-function signature="render(QPaintDevice *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
3923 <modify-function signature="render(QPaintDevice *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
3924 <modify-argument index="4">
3924 <modify-argument index="4">
3925 <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
3925 <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
3926 </modify-argument>
3926 </modify-argument>
3927 </modify-function>
3927 </modify-function>
3928 <modify-function signature="render(QPainter *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
3928 <modify-function signature="render(QPainter *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
3929 <modify-argument index="4">
3929 <modify-argument index="4">
3930 <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
3930 <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
3931 </modify-argument>
3931 </modify-argument>
3932 </modify-function>
3932 </modify-function>
3933 <modify-function signature="setFocusProxy(QWidget*)">
3933 <modify-function signature="setFocusProxy(QWidget*)">
3934 <modify-argument index="1">
3934 <modify-argument index="1">
3935 <reference-count action="set" variable-name="__rcFocusProxy"/>
3935 <reference-count action="set" variable-name="__rcFocusProxy"/>
3936 </modify-argument>
3936 </modify-argument>
3937 </modify-function>
3937 </modify-function>
3938 <modify-function signature="setInputContext(QInputContext*)">
3938 <modify-function signature="setInputContext(QInputContext*)">
3939 <modify-argument index="1">
3939 <modify-argument index="1">
3940 <define-ownership class="java" owner="c++"/>
3940 <define-ownership class="java" owner="c++"/>
3941 </modify-argument>
3941 </modify-argument>
3942 </modify-function>
3942 </modify-function>
3943 <modify-function signature="setLayout(QLayout*)">
3943 <modify-function signature="setLayout(QLayout*)">
3944 <modify-argument index="1">
3944 <modify-argument index="1">
3945 <no-null-pointer/>
3945 <no-null-pointer/>
3946 <reference-count action="ignore"/>
3946 <reference-count action="ignore"/>
3947 </modify-argument>
3947 </modify-argument>
3948 </modify-function>
3948 </modify-function>
3949 <modify-function signature="setParent(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3949 <modify-function signature="setParent(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3950 <modify-argument index="1">
3950 <modify-argument index="1">
3951 <reference-count action="ignore"/>
3951 <reference-count action="ignore"/>
3952 </modify-argument>
3952 </modify-argument>
3953 </modify-function>
3953 </modify-function>
3954 <modify-function signature="setParent(QWidget*)">
3954 <modify-function signature="setParent(QWidget*)">
3955 <modify-argument index="1">
3955 <modify-argument index="1">
3956 <reference-count action="ignore"/>
3956 <reference-count action="ignore"/>
3957 </modify-argument>
3957 </modify-argument>
3958 </modify-function>
3958 </modify-function>
3959 <modify-function signature="setStyle(QStyle*)">
3959 <modify-function signature="setStyle(QStyle*)">
3960 <modify-argument index="1">
3960 <modify-argument index="1">
3961 <reference-count action="set" variable-name="__rcStyle"/>
3961 <reference-count action="set" variable-name="__rcStyle"/>
3962 </modify-argument>
3962 </modify-argument>
3963 </modify-function>
3963 </modify-function>
3964 <modify-function signature="setTabOrder(QWidget*,QWidget*)">
3964 <modify-function signature="setTabOrder(QWidget*,QWidget*)">
3965 <modify-argument index="1">
3965 <modify-argument index="1">
3966 <reference-count action="ignore"/>
3966 <reference-count action="ignore"/>
3967 </modify-argument>
3967 </modify-argument>
3968 <modify-argument index="2">
3968 <modify-argument index="2">
3969 <reference-count action="ignore"/>
3969 <reference-count action="ignore"/>
3970 </modify-argument>
3970 </modify-argument>
3971 </modify-function>
3971 </modify-function>
3972 <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
3972 <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
3973 <access modifier="private"/>
3973 <access modifier="private"/>
3974 </modify-function>
3974 </modify-function>
3975
3975
3976 <modify-function signature="addAction(QAction *)">
3976 <modify-function signature="addAction(QAction *)">
3977 <modify-argument index="1">
3977 <modify-argument index="1">
3978 <reference-count action="add" variable-name="__rcActions"/>
3978 <reference-count action="add" variable-name="__rcActions"/>
3979 </modify-argument>
3979 </modify-argument>
3980 </modify-function>
3980 </modify-function>
3981
3981
3982 <modify-function signature="insertAction(QAction *, QAction *)">
3982 <modify-function signature="insertAction(QAction *, QAction *)">
3983 <modify-argument index="2">
3983 <modify-argument index="2">
3984 <reference-count action="add" variable-name="__rcActions"/>
3984 <reference-count action="add" variable-name="__rcActions"/>
3985 </modify-argument>
3985 </modify-argument>
3986 </modify-function>
3986 </modify-function>
3987
3987
3988 <modify-function signature="addActions(const QList&lt;QAction *&gt; &amp;)">
3988 <modify-function signature="addActions(const QList&lt;QAction *&gt; &amp;)">
3989 <modify-argument index="1">
3989 <modify-argument index="1">
3990 <reference-count action="add-all" variable-name="__rcActions"/>
3990 <reference-count action="add-all" variable-name="__rcActions"/>
3991 </modify-argument>
3991 </modify-argument>
3992 </modify-function>
3992 </modify-function>
3993
3993
3994 <modify-function signature="insertActions(QAction *, const QList&lt;QAction *&gt; &amp;)">
3994 <modify-function signature="insertActions(QAction *, const QList&lt;QAction *&gt; &amp;)">
3995 <modify-argument index="2">
3995 <modify-argument index="2">
3996 <reference-count action="add-all" variable-name="__rcActions"/>
3996 <reference-count action="add-all" variable-name="__rcActions"/>
3997 </modify-argument>
3997 </modify-argument>
3998 </modify-function>
3998 </modify-function>
3999
3999
4000 <modify-function signature="removeAction(QAction *)">
4000 <modify-function signature="removeAction(QAction *)">
4001 <modify-argument index="1">
4001 <modify-argument index="1">
4002 <reference-count action="remove" variable-name="__rcActions"/>
4002 <reference-count action="remove" variable-name="__rcActions"/>
4003 </modify-argument>
4003 </modify-argument>
4004 </modify-function>
4004 </modify-function>
4005 <modify-function signature="enabledChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4005 <modify-function signature="enabledChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4006 <modify-function signature="fontChange(QFont)" remove="all"/> <!--### Obsolete in 4.3-->
4006 <modify-function signature="fontChange(QFont)" remove="all"/> <!--### Obsolete in 4.3-->
4007 <modify-function signature="isEnabledToTLW()const" remove="all"/> <!--### Obsolete in 4.3-->
4007 <modify-function signature="isEnabledToTLW()const" remove="all"/> <!--### Obsolete in 4.3-->
4008 <modify-function signature="isTopLevel()const" remove="all"/> <!--### Obsolete in 4.3-->
4008 <modify-function signature="isTopLevel()const" remove="all"/> <!--### Obsolete in 4.3-->
4009 <modify-function signature="paletteChange(QPalette)" remove="all"/> <!--### Obsolete in 4.3-->
4009 <modify-function signature="paletteChange(QPalette)" remove="all"/> <!--### Obsolete in 4.3-->
4010 <modify-function signature="setShown(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4010 <modify-function signature="setShown(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4011 <modify-function signature="topLevelWidget()const" remove="all"/> <!--### Obsolete in 4.3-->
4011 <modify-function signature="topLevelWidget()const" remove="all"/> <!--### Obsolete in 4.3-->
4012 <modify-function signature="windowActivationChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4012 <modify-function signature="windowActivationChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4013
4013
4014 <modify-function signature="fontInfo()const" remove="all"/>
4014 <modify-function signature="fontInfo()const" remove="all"/>
4015 <modify-function signature="fontMetrics()const" remove="all"/>
4015 <modify-function signature="fontMetrics()const" remove="all"/>
4016 <modify-function signature="sizeHint()const" rename="getSizeHint"/>
4016 <modify-function signature="sizeHint()const" rename="getSizeHint"/>
4017 <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
4017 <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
4018 <modify-function signature="setVisible(bool)" remove="all"/>
4018 <modify-function signature="setVisible(bool)" remove="all"/>
4019 </object-type>
4019 </object-type>
4020
4020
4021 <object-type name="QMessageBox">
4021 <object-type name="QMessageBox">
4022
4022
4023
4023
4024 <modify-function signature="setWindowTitle(const QString &amp;)" remove="all"/>
4024 <modify-function signature="setWindowTitle(const QString &amp;)" remove="all"/>
4025 <modify-function signature="setWindowModality(Qt::WindowModality)" remove="all"/>
4025 <modify-function signature="setWindowModality(Qt::WindowModality)" remove="all"/>
4026 <extra-includes>
4026 <extra-includes>
4027 <include file-name="QPixmap" location="global"/>
4027 <include file-name="QPixmap" location="global"/>
4028 </extra-includes>
4028 </extra-includes>
4029 <modify-function signature="addButton(QAbstractButton*,QMessageBox::ButtonRole)">
4029 <modify-function signature="addButton(QAbstractButton*,QMessageBox::ButtonRole)">
4030 <modify-argument index="1">
4030 <modify-argument index="1">
4031 <reference-count action="ignore"/>
4031 <reference-count action="ignore"/>
4032 </modify-argument>
4032 </modify-argument>
4033 </modify-function>
4033 </modify-function>
4034 <modify-function signature="removeButton(QAbstractButton*)">
4034 <modify-function signature="removeButton(QAbstractButton*)">
4035 <modify-argument index="1">
4035 <modify-argument index="1">
4036 <reference-count action="ignore"/>
4036 <reference-count action="ignore"/>
4037 </modify-argument>
4037 </modify-argument>
4038 </modify-function>
4038 </modify-function>
4039 <modify-function signature="setDefaultButton(QPushButton*)">
4039 <modify-function signature="setDefaultButton(QPushButton*)">
4040 <modify-argument index="1">
4040 <modify-argument index="1">
4041 <reference-count action="ignore"/>
4041 <reference-count action="ignore"/>
4042 </modify-argument>
4042 </modify-argument>
4043 </modify-function>
4043 </modify-function>
4044 <modify-function signature="setEscapeButton(QAbstractButton*)">
4044 <modify-function signature="setEscapeButton(QAbstractButton*)">
4045 <modify-argument index="1">
4045 <modify-argument index="1">
4046 <reference-count action="ignore"/>
4046 <reference-count action="ignore"/>
4047 </modify-argument>
4047 </modify-argument>
4048 </modify-function>
4048 </modify-function>
4049
4049
4050 <modify-function signature="QMessageBox(QString,QString,QMessageBox::Icon,int,int,int,QWidget*,QFlags&lt;Qt::WindowType&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
4050 <modify-function signature="QMessageBox(QString,QString,QMessageBox::Icon,int,int,int,QWidget*,QFlags&lt;Qt::WindowType&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
4051 <modify-function signature="buttonText(int)const" remove="all"/> <!--### Obsolete in 4.3-->
4051 <modify-function signature="buttonText(int)const" remove="all"/> <!--### Obsolete in 4.3-->
4052 <modify-function signature="setButtonText(int, QString)" remove="all"/> <!--### Obsolete in 4.3-->
4052 <modify-function signature="setButtonText(int, QString)" remove="all"/> <!--### Obsolete in 4.3-->
4053 <modify-function signature="standardIcon(QMessageBox::Icon)" remove="all"/> <!--### Obsolete in 4.3-->
4053 <modify-function signature="standardIcon(QMessageBox::Icon)" remove="all"/> <!--### Obsolete in 4.3-->
4054
4054
4055 <modify-function signature="critical(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4055 <modify-function signature="critical(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4056 <modify-function signature="critical(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4056 <modify-function signature="critical(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4057 <modify-function signature="information(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4057 <modify-function signature="information(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4058 <modify-function signature="information(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4058 <modify-function signature="information(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4059 <modify-function signature="question(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4059 <modify-function signature="question(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4060 <modify-function signature="question(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4060 <modify-function signature="question(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4061 <modify-function signature="warning(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4061 <modify-function signature="warning(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4062 <modify-function signature="warning(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4062 <modify-function signature="warning(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4063 </object-type>
4063 </object-type>
4064
4064
4065 <object-type name="QAbstractSpinBox">
4065 <object-type name="QAbstractSpinBox">
4066 <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const">
4066 <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const">
4067 <access modifier="private"/>
4067 <access modifier="private"/>
4068 </modify-function>
4068 </modify-function>
4069 <modify-function signature="setLineEdit(QLineEdit*)">
4069 <modify-function signature="setLineEdit(QLineEdit*)">
4070 <modify-argument index="1">
4070 <modify-argument index="1">
4071 <!-- Safe to ignore because the spinbox reparents the line edit -->
4071 <!-- Safe to ignore because the spinbox reparents the line edit -->
4072 <reference-count action="ignore"/>
4072 <reference-count action="ignore"/>
4073 <no-null-pointer/>
4073 <no-null-pointer/>
4074 </modify-argument>
4074 </modify-argument>
4075 </modify-function>
4075 </modify-function>
4076 </object-type>
4076 </object-type>
4077
4077
4078 <object-type name="QTextFrame" delete-in-main-thread="yes">
4078 <object-type name="QTextFrame" delete-in-main-thread="yes">
4079 <extra-includes>
4079 <extra-includes>
4080 <include file-name="QTextCursor" location="global"/>
4080 <include file-name="QTextCursor" location="global"/>
4081 </extra-includes>
4081 </extra-includes>
4082 </object-type>
4082 </object-type>
4083
4083
4084 <object-type name="QImageIOHandler">
4084 <object-type name="QImageIOHandler">
4085 <extra-includes>
4085 <extra-includes>
4086 <include file-name="QRect" location="global"/>
4086 <include file-name="QRect" location="global"/>
4087 </extra-includes>
4087 </extra-includes>
4088 <modify-function signature="setFormat(const QByteArray &amp;)const">
4088 <modify-function signature="setFormat(const QByteArray &amp;)const">
4089 <remove/>
4089 <remove/>
4090 </modify-function>
4090 </modify-function>
4091 <modify-function signature="setDevice(QIODevice*)">
4091 <modify-function signature="setDevice(QIODevice*)">
4092 <modify-argument index="1">
4092 <modify-argument index="1">
4093 <reference-count action="set" variable-name="__rcDevice"/>
4093 <reference-count action="set" variable-name="__rcDevice"/>
4094 </modify-argument>
4094 </modify-argument>
4095 </modify-function>
4095 </modify-function>
4096 <modify-function signature="read(QImage*)">
4096 <modify-function signature="read(QImage*)">
4097 <modify-argument index="1">
4097 <modify-argument index="1">
4098 <replace-type modified-type="com.trolltech.qt.gui.QImage"/>
4098 <replace-type modified-type="com.trolltech.qt.gui.QImage"/>
4099 <conversion-rule class="shell">
4099 <conversion-rule class="shell">
4100 jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false);
4100 jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false);
4101
4101
4102 QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0;
4102 QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0;
4103 </conversion-rule>
4103 </conversion-rule>
4104 <conversion-rule class="native">
4104 <conversion-rule class="native">
4105 QImage *%out = (QImage *) qtjambi_to_object(__jni_env, %in);
4105 QImage *%out = (QImage *) qtjambi_to_object(__jni_env, %in);
4106 </conversion-rule>
4106 </conversion-rule>
4107 </modify-argument>
4107 </modify-argument>
4108 <modify-argument index="0">
4108 <modify-argument index="0">
4109 <conversion-rule class="shell">
4109 <conversion-rule class="shell">
4110 // Invalidate object
4110 // Invalidate object
4111 if (__link != 0) __link-&gt;resetObject(__jni_env);
4111 if (__link != 0) __link-&gt;resetObject(__jni_env);
4112 bool %out = (bool) %in;
4112 bool %out = (bool) %in;
4113 </conversion-rule>
4113 </conversion-rule>
4114 </modify-argument>
4114 </modify-argument>
4115 </modify-function>
4115 </modify-function>
4116
4116
4117 <modify-function signature="name()const" remove="all"/> <!--### Obsolete in 4.3-->
4117 <modify-function signature="name()const" remove="all"/> <!--### Obsolete in 4.3-->
4118 </object-type>
4118 </object-type>
4119
4119
4120 <object-type name="QProxyModel">
4120 <object-type name="QProxyModel">
4121 <modify-function signature="parent()const" remove="all"/>
4121 <modify-function signature="parent()const" remove="all"/>
4122 <extra-includes>
4122 <extra-includes>
4123 <include file-name="QPixmap" location="global"/>
4123 <include file-name="QPixmap" location="global"/>
4124 <include file-name="QStringList" location="global"/>
4124 <include file-name="QStringList" location="global"/>
4125 <include file-name="QSize" location="global"/>
4125 <include file-name="QSize" location="global"/>
4126 </extra-includes>
4126 </extra-includes>
4127 <modify-function signature="setModel(QAbstractItemModel*)">
4127 <modify-function signature="setModel(QAbstractItemModel*)">
4128 <modify-argument index="1">
4128 <modify-argument index="1">
4129 <reference-count action="set" variable-name="__rcModel"/>
4129 <reference-count action="set" variable-name="__rcModel"/>
4130 </modify-argument>
4130 </modify-argument>
4131 </modify-function>
4131 </modify-function>
4132 </object-type>
4132 </object-type>
4133
4133
4134 <object-type name="QImageReader">
4134 <object-type name="QImageReader">
4135 <extra-includes>
4135 <extra-includes>
4136 <include file-name="QColor" location="global"/>
4136 <include file-name="QColor" location="global"/>
4137 <include file-name="QRect" location="global"/>
4137 <include file-name="QRect" location="global"/>
4138 <include file-name="QSize" location="global"/>
4138 <include file-name="QSize" location="global"/>
4139 <include file-name="QStringList" location="global"/>
4139 <include file-name="QStringList" location="global"/>
4140 <include file-name="QImage" location="global"/>
4140 <include file-name="QImage" location="global"/>
4141 </extra-includes>
4141 </extra-includes>
4142 <modify-function signature="read(QImage*) ">
4142 <modify-function signature="read(QImage*) ">
4143 <remove/>
4143 <remove/>
4144 </modify-function>
4144 </modify-function>
4145 <modify-function signature="setDevice(QIODevice*)">
4145 <modify-function signature="setDevice(QIODevice*)">
4146 <modify-argument index="1">
4146 <modify-argument index="1">
4147 <reference-count action="set" variable-name="__rcDevice"/>
4147 <reference-count action="set" variable-name="__rcDevice"/>
4148 </modify-argument>
4148 </modify-argument>
4149 </modify-function>
4149 </modify-function>
4150 </object-type>
4150 </object-type>
4151
4151
4152 <object-type name="QMovie">
4152 <object-type name="QMovie">
4153 <extra-includes>
4153 <extra-includes>
4154 <include file-name="QColor" location="global"/>
4154 <include file-name="QColor" location="global"/>
4155 <include file-name="QImage" location="global"/>
4155 <include file-name="QImage" location="global"/>
4156 <include file-name="QPixmap" location="global"/>
4156 <include file-name="QPixmap" location="global"/>
4157 <include file-name="QRect" location="global"/>
4157 <include file-name="QRect" location="global"/>
4158 <include file-name="QSize" location="global"/>
4158 <include file-name="QSize" location="global"/>
4159 </extra-includes>
4159 </extra-includes>
4160 <modify-function signature="cacheMode()">
4160 <modify-function signature="cacheMode()">
4161 <remove/>
4161 <remove/>
4162 </modify-function>
4162 </modify-function>
4163 <modify-function signature="setDevice(QIODevice*)">
4163 <modify-function signature="setDevice(QIODevice*)">
4164 <modify-argument index="1">
4164 <modify-argument index="1">
4165 <reference-count action="set" variable-name="__rcDevice"/>
4165 <reference-count action="set" variable-name="__rcDevice"/>
4166 </modify-argument>
4166 </modify-argument>
4167 </modify-function>
4167 </modify-function>
4168 </object-type>
4168 </object-type>
4169
4169
4170 <object-type name="QPageSetupDialog"/>
4170 <object-type name="QPageSetupDialog"/>
4171
4171
4172 <object-type name="QTabWidget">
4172 <object-type name="QTabWidget">
4173 <modify-function signature="initStyleOption(QStyleOptionTabWidgetFrame*)const">
4173 <modify-function signature="initStyleOption(QStyleOptionTabWidgetFrame*)const">
4174 <access modifier="private"/>
4174 <access modifier="private"/>
4175 </modify-function>
4175 </modify-function>
4176 <inject-code>
4176 <inject-code>
4177 <insert-template name="gui.init_style_option">
4177 <insert-template name="gui.init_style_option">
4178 <replace from="%TYPE" to="QStyleOptionTabWidgetFrame"/>
4178 <replace from="%TYPE" to="QStyleOptionTabWidgetFrame"/>
4179 </insert-template>
4179 </insert-template>
4180 </inject-code>
4180 </inject-code>
4181 <modify-function signature="addTab(QWidget*,QIcon,QString)">
4181 <modify-function signature="addTab(QWidget*,QIcon,QString)">
4182 <modify-argument index="1">
4182 <modify-argument index="1">
4183 <reference-count action="ignore"/>
4183 <reference-count action="ignore"/>
4184 </modify-argument>
4184 </modify-argument>
4185 </modify-function>
4185 </modify-function>
4186 <modify-function signature="addTab(QWidget*,QString)">
4186 <modify-function signature="addTab(QWidget*,QString)">
4187 <modify-argument index="1">
4187 <modify-argument index="1">
4188 <reference-count action="ignore"/>
4188 <reference-count action="ignore"/>
4189 </modify-argument>
4189 </modify-argument>
4190 </modify-function>
4190 </modify-function>
4191 <modify-function signature="insertTab(int,QWidget*,QString)">
4191 <modify-function signature="insertTab(int,QWidget*,QString)">
4192 <modify-argument index="2">
4192 <modify-argument index="2">
4193 <reference-count action="ignore"/>
4193 <reference-count action="ignore"/>
4194 </modify-argument>
4194 </modify-argument>
4195 </modify-function>
4195 </modify-function>
4196 <modify-function signature="insertTab(int,QWidget*,QIcon,QString)">
4196 <modify-function signature="insertTab(int,QWidget*,QIcon,QString)">
4197 <modify-argument index="2">
4197 <modify-argument index="2">
4198 <reference-count action="ignore"/>
4198 <reference-count action="ignore"/>
4199 </modify-argument>
4199 </modify-argument>
4200 </modify-function>
4200 </modify-function>
4201 <modify-function signature="setCornerWidget(QWidget*,Qt::Corner)">
4201 <modify-function signature="setCornerWidget(QWidget*,Qt::Corner)">
4202 <modify-argument index="1">
4202 <modify-argument index="1">
4203 <reference-count action="ignore"/>
4203 <reference-count action="ignore"/>
4204 </modify-argument>
4204 </modify-argument>
4205 </modify-function>
4205 </modify-function>
4206 <modify-function signature="setCurrentWidget(QWidget*)">
4206 <modify-function signature="setCurrentWidget(QWidget*)">
4207 <modify-argument index="1">
4207 <modify-argument index="1">
4208 <reference-count action="ignore"/>
4208 <reference-count action="ignore"/>
4209 </modify-argument>
4209 </modify-argument>
4210 </modify-function>
4210 </modify-function>
4211 <modify-function signature="setTabBar(QTabBar*)">
4211 <modify-function signature="setTabBar(QTabBar*)">
4212 <modify-argument index="1">
4212 <modify-argument index="1">
4213 <reference-count action="ignore"/>
4213 <reference-count action="ignore"/>
4214 </modify-argument>
4214 </modify-argument>
4215 </modify-function>
4215 </modify-function>
4216 </object-type>
4216 </object-type>
4217 <object-type name="QDrag">
4217 <object-type name="QDrag">
4218 <extra-includes>
4218 <extra-includes>
4219 <include file-name="QPoint" location="global"/>
4219 <include file-name="QPoint" location="global"/>
4220 <include file-name="QPixmap" location="global"/>
4220 <include file-name="QPixmap" location="global"/>
4221 </extra-includes>
4221 </extra-includes>
4222 <modify-function signature="setMimeData(QMimeData*)">
4222 <modify-function signature="setMimeData(QMimeData*)">
4223 <modify-argument index="1">
4223 <modify-argument index="1">
4224 <define-ownership class="java" owner="c++"/>
4224 <define-ownership class="java" owner="c++"/>
4225 </modify-argument>
4225 </modify-argument>
4226 </modify-function>
4226 </modify-function>
4227
4227
4228 <modify-function signature="start(QFlags&lt;Qt::DropAction&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
4228 <modify-function signature="start(QFlags&lt;Qt::DropAction&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
4229 </object-type>
4229 </object-type>
4230
4230
4231 <object-type name="QDateTimeEdit">
4231 <object-type name="QDateTimeEdit">
4232 <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const" access="private" rename="initDateTimeEditStyleOption"/>
4232 <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const" access="private" rename="initDateTimeEditStyleOption"/>
4233 <modify-function signature="setCalendarWidget(QCalendarWidget*)">
4233 <modify-function signature="setCalendarWidget(QCalendarWidget*)">
4234 <modify-argument index="1">
4234 <modify-argument index="1">
4235 <!-- Safe to ignore because widget is reparented -->
4235 <!-- Safe to ignore because widget is reparented -->
4236 <reference-count action="ignore"/>
4236 <reference-count action="ignore"/>
4237 </modify-argument>
4237 </modify-argument>
4238 </modify-function>
4238 </modify-function>
4239
4239
4240 </object-type>
4240 </object-type>
4241
4241
4242 <object-type name="QSortFilterProxyModel">
4242 <object-type name="QSortFilterProxyModel">
4243 <modify-function signature="parent()const" remove="all"/>
4243 <modify-function signature="parent()const" remove="all"/>
4244 <extra-includes>
4244 <extra-includes>
4245 <include file-name="QItemSelection" location="global"/>
4245 <include file-name="QItemSelection" location="global"/>
4246 <include file-name="QStringList" location="global"/>
4246 <include file-name="QStringList" location="global"/>
4247 <include file-name="QSize" location="global"/>
4247 <include file-name="QSize" location="global"/>
4248 </extra-includes>
4248 </extra-includes>
4249
4249
4250 <modify-function signature="setSourceModel(QAbstractItemModel *)">
4250 <modify-function signature="setSourceModel(QAbstractItemModel *)">
4251 <modify-argument index="1">
4251 <modify-argument index="1">
4252 <reference-count action="set" variable-name="__rcSourceModel"/>
4252 <reference-count action="set" variable-name="__rcSourceModel"/>
4253 </modify-argument>
4253 </modify-argument>
4254 </modify-function>
4254 </modify-function>
4255
4255
4256 <modify-function signature="clear()" remove="all"/> <!--### Obsolete in 4.3-->
4256 <modify-function signature="clear()" remove="all"/> <!--### Obsolete in 4.3-->
4257 <modify-function signature="filterChanged()" remove="all"/> <!--### Obsolete in 4.3-->
4257 <modify-function signature="filterChanged()" remove="all"/> <!--### Obsolete in 4.3-->
4258 </object-type>
4258 </object-type>
4259
4259
4260 <object-type name="QSlider">
4260 <object-type name="QSlider">
4261 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4261 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4262 <access modifier="private"/>
4262 <access modifier="private"/>
4263 </modify-function>
4263 </modify-function>
4264 </object-type>
4264 </object-type>
4265
4265
4266 <object-type name="QInputContext">
4266 <object-type name="QInputContext">
4267 <extra-includes>
4267 <extra-includes>
4268 <include file-name="QTextFormat" location="global"/>
4268 <include file-name="QTextFormat" location="global"/>
4269 </extra-includes>
4269 </extra-includes>
4270 <modify-function signature="setFocusWidget(QWidget*)">
4270 <modify-function signature="setFocusWidget(QWidget*)">
4271 <remove/>
4271 <remove/>
4272 </modify-function>
4272 </modify-function>
4273 <modify-function signature="filterEvent(const QEvent*)">
4273 <modify-function signature="filterEvent(const QEvent*)">
4274 <modify-argument index="1" invalidate-after-use="yes"/>
4274 <modify-argument index="1" invalidate-after-use="yes"/>
4275 </modify-function>
4275 </modify-function>
4276 <modify-function signature="mouseHandler(int,QMouseEvent*)">
4276 <modify-function signature="mouseHandler(int,QMouseEvent*)">
4277 <modify-argument index="2" invalidate-after-use="yes"/>
4277 <modify-argument index="2" invalidate-after-use="yes"/>
4278 </modify-function>
4278 </modify-function>
4279
4279
4280 </object-type>
4280 </object-type>
4281
4281
4282 <object-type name="QProgressDialog">
4282 <object-type name="QProgressDialog">
4283
4283
4284 <modify-function signature="setBar(QProgressBar*)">
4284 <modify-function signature="setBar(QProgressBar*)">
4285 <modify-argument index="1">
4285 <modify-argument index="1">
4286 <define-ownership class="java" owner="c++"/>
4286 <define-ownership class="java" owner="c++"/>
4287 </modify-argument>
4287 </modify-argument>
4288 </modify-function>
4288 </modify-function>
4289 <modify-function signature="setCancelButton(QPushButton*)">
4289 <modify-function signature="setCancelButton(QPushButton*)">
4290 <modify-argument index="1">
4290 <modify-argument index="1">
4291 <!-- Safe to ignore because button is reparented -->
4291 <!-- Safe to ignore because button is reparented -->
4292 <reference-count action="ignore"/>
4292 <reference-count action="ignore"/>
4293 </modify-argument>
4293 </modify-argument>
4294 </modify-function>
4294 </modify-function>
4295 <modify-function signature="setLabel(QLabel*)">
4295 <modify-function signature="setLabel(QLabel*)">
4296 <modify-argument index="1">
4296 <modify-argument index="1">
4297 <!-- Safe to ignore because label is reparented -->
4297 <!-- Safe to ignore because label is reparented -->
4298 <reference-count action="ignore"/>
4298 <reference-count action="ignore"/>
4299 </modify-argument>
4299 </modify-argument>
4300 </modify-function>
4300 </modify-function>
4301
4301
4302 </object-type>
4302 </object-type>
4303
4303
4304 <object-type name="QLabel">
4304 <object-type name="QLabel">
4305 <modify-function signature="picture()const">
4305 <modify-function signature="picture()const">
4306 <access modifier="private"/>
4306 <access modifier="private"/>
4307 <rename to="picture_private"/>
4307 <rename to="picture_private"/>
4308 </modify-function>
4308 </modify-function>
4309
4309
4310 <modify-function signature="setBuddy(QWidget *)">
4310 <modify-function signature="setBuddy(QWidget *)">
4311 <modify-argument index="1">
4311 <modify-argument index="1">
4312 <reference-count action="set" variable-name="__rcBuddy"/>
4312 <reference-count action="set" variable-name="__rcBuddy"/>
4313 </modify-argument>
4313 </modify-argument>
4314 </modify-function>
4314 </modify-function>
4315 <modify-function signature="setMovie(QMovie *)">
4315 <modify-function signature="setMovie(QMovie *)">
4316 <modify-argument index="1">
4316 <modify-argument index="1">
4317 <reference-count action="set" variable-name="__rcMovie"/>
4317 <reference-count action="set" variable-name="__rcMovie"/>
4318 </modify-argument>
4318 </modify-argument>
4319 </modify-function>
4319 </modify-function>
4320 <modify-function signature="pixmap()const">
4320 <modify-function signature="pixmap()const">
4321 <access modifier="private"/>
4321 <access modifier="private"/>
4322 <rename to="pixmap_private"/>
4322 <rename to="pixmap_private"/>
4323 </modify-function>
4323 </modify-function>
4324 </object-type>
4324 </object-type>
4325
4325
4326 <object-type name="QFileDialog">
4326 <object-type name="QFileDialog">
4327 <extra-includes>
4327 <extra-includes>
4328 <include file-name="QUrl" location="global"/>
4328 <include file-name="QUrl" location="global"/>
4329 </extra-includes>
4329 </extra-includes>
4330
4330
4331 <modify-function signature="getOpenFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4331 <modify-function signature="getOpenFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4332 <access modifier="private"/>
4332 <access modifier="private"/>
4333 <modify-argument index="1">
4333 <modify-argument index="1">
4334 <remove-default-expression/>
4334 <remove-default-expression/>
4335 </modify-argument>
4335 </modify-argument>
4336 <modify-argument index="2">
4336 <modify-argument index="2">
4337 <remove-default-expression/>
4337 <remove-default-expression/>
4338 </modify-argument>
4338 </modify-argument>
4339 <modify-argument index="3">
4339 <modify-argument index="3">
4340 <remove-default-expression/>
4340 <remove-default-expression/>
4341 </modify-argument>
4341 </modify-argument>
4342 <modify-argument index="4">
4342 <modify-argument index="4">
4343 <remove-default-expression/>
4343 <remove-default-expression/>
4344 </modify-argument>
4344 </modify-argument>
4345 <modify-argument index="5">
4345 <modify-argument index="5">
4346 <remove-default-expression/>
4346 <remove-default-expression/>
4347 </modify-argument>
4347 </modify-argument>
4348 <modify-argument index="6">
4348 <modify-argument index="6">
4349 <remove-default-expression/>
4349 <remove-default-expression/>
4350 </modify-argument>
4350 </modify-argument>
4351 </modify-function>
4351 </modify-function>
4352
4352
4353 <modify-function signature="getOpenFileNames(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4353 <modify-function signature="getOpenFileNames(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4354 <access modifier="private"/>
4354 <access modifier="private"/>
4355 <modify-argument index="1">
4355 <modify-argument index="1">
4356 <remove-default-expression/>
4356 <remove-default-expression/>
4357 </modify-argument>
4357 </modify-argument>
4358 <modify-argument index="2">
4358 <modify-argument index="2">
4359 <remove-default-expression/>
4359 <remove-default-expression/>
4360 </modify-argument>
4360 </modify-argument>
4361 <modify-argument index="3">
4361 <modify-argument index="3">
4362 <remove-default-expression/>
4362 <remove-default-expression/>
4363 </modify-argument>
4363 </modify-argument>
4364 <modify-argument index="4">
4364 <modify-argument index="4">
4365 <remove-default-expression/>
4365 <remove-default-expression/>
4366 </modify-argument>
4366 </modify-argument>
4367 <modify-argument index="5">
4367 <modify-argument index="5">
4368 <remove-default-expression/>
4368 <remove-default-expression/>
4369 </modify-argument>
4369 </modify-argument>
4370 <modify-argument index="6">
4370 <modify-argument index="6">
4371 <remove-default-expression/>
4371 <remove-default-expression/>
4372 </modify-argument>
4372 </modify-argument>
4373 </modify-function>
4373 </modify-function>
4374
4374
4375 <modify-function signature="getSaveFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4375 <modify-function signature="getSaveFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4376 <access modifier="private"/>
4376 <access modifier="private"/>
4377 <modify-argument index="1">
4377 <modify-argument index="1">
4378 <remove-default-expression/>
4378 <remove-default-expression/>
4379 </modify-argument>
4379 </modify-argument>
4380 <modify-argument index="2">
4380 <modify-argument index="2">
4381 <remove-default-expression/>
4381 <remove-default-expression/>
4382 </modify-argument>
4382 </modify-argument>
4383 <modify-argument index="3">
4383 <modify-argument index="3">
4384 <remove-default-expression/>
4384 <remove-default-expression/>
4385 </modify-argument>
4385 </modify-argument>
4386 <modify-argument index="4">
4386 <modify-argument index="4">
4387 <remove-default-expression/>
4387 <remove-default-expression/>
4388 </modify-argument>
4388 </modify-argument>
4389 <modify-argument index="5">
4389 <modify-argument index="5">
4390 <remove-default-expression/>
4390 <remove-default-expression/>
4391 </modify-argument>
4391 </modify-argument>
4392 <modify-argument index="6">
4392 <modify-argument index="6">
4393 <remove-default-expression/>
4393 <remove-default-expression/>
4394 </modify-argument>
4394 </modify-argument>
4395 </modify-function>
4395 </modify-function>
4396
4396
4397 <modify-function signature="setIconProvider(QFileIconProvider*)">
4397 <modify-function signature="setIconProvider(QFileIconProvider*)">
4398 <modify-argument index="1">
4398 <modify-argument index="1">
4399 <reference-count action="set" variable-name="__rcIconProvider"/>
4399 <reference-count action="set" variable-name="__rcIconProvider"/>
4400 </modify-argument>
4400 </modify-argument>
4401 </modify-function>
4401 </modify-function>
4402
4402
4403 <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
4403 <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
4404 <modify-argument index="1">
4404 <modify-argument index="1">
4405 <reference-count action="set" variable-name="__rcItemDelegate"/>
4405 <reference-count action="set" variable-name="__rcItemDelegate"/>
4406 </modify-argument>
4406 </modify-argument>
4407 </modify-function>
4407 </modify-function>
4408
4408
4409 <modify-function signature="setProxyModel(QAbstractProxyModel*)">
4409 <modify-function signature="setProxyModel(QAbstractProxyModel*)">
4410 <modify-argument index="1">
4410 <modify-argument index="1">
4411 <!-- Reparented -->
4411 <!-- Reparented -->
4412 <reference-count action="ignore"/>
4412 <reference-count action="ignore"/>
4413 </modify-argument>
4413 </modify-argument>
4414 </modify-function>
4414 </modify-function>
4415
4415
4416 </object-type>
4416 </object-type>
4417
4417
4418 <object-type name="QErrorMessage"/>
4418 <object-type name="QErrorMessage"/>
4419
4419
4420 <object-type name="QTabBar">
4420 <object-type name="QTabBar">
4421 <extra-includes>
4421 <extra-includes>
4422 <include file-name="QIcon" location="global"/>
4422 <include file-name="QIcon" location="global"/>
4423 </extra-includes>
4423 </extra-includes>
4424 <modify-function signature="initStyleOption(QStyleOptionTab*,int)const">
4424 <modify-function signature="initStyleOption(QStyleOptionTab*,int)const">
4425 <access modifier="private"/>
4425 <access modifier="private"/>
4426 </modify-function>
4426 </modify-function>
4427 <modify-function signature="setTabButton(int,QTabBar::ButtonPosition,QWidget*)">
4427 <modify-function signature="setTabButton(int,QTabBar::ButtonPosition,QWidget*)">
4428 <modify-argument index="3">
4428 <modify-argument index="3">
4429 <reference-count action="ignore"/>
4429 <reference-count action="ignore"/>
4430 </modify-argument>
4430 </modify-argument>
4431 </modify-function>
4431 </modify-function>
4432 </object-type>
4432 </object-type>
4433
4433
4434 <object-type name="QStandardItemModel">
4434 <object-type name="QStandardItemModel">
4435 <modify-function signature="insertColumn(int,const QModelIndex &amp;)" remove="all"/>
4435 <modify-function signature="insertColumn(int,const QModelIndex &amp;)" remove="all"/>
4436 <modify-function signature="insertRow(int,const QModelIndex &amp;)" remove="all"/>
4436 <modify-function signature="insertRow(int,const QModelIndex &amp;)" remove="all"/>
4437 <modify-function signature="parent()const" remove="all"/>
4437 <modify-function signature="parent()const" remove="all"/>
4438 <extra-includes>
4438 <extra-includes>
4439 <include file-name="QStringList" location="global"/>
4439 <include file-name="QStringList" location="global"/>
4440 <include file-name="QSize" location="global"/>
4440 <include file-name="QSize" location="global"/>
4441 </extra-includes>
4441 </extra-includes>
4442
4442
4443 <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt;&amp;)">
4443 <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt;&amp;)">
4444 <modify-argument index="1">
4444 <modify-argument index="1">
4445 <define-ownership class="java" owner="c++"/>
4445 <define-ownership class="java" owner="c++"/>
4446 </modify-argument>
4446 </modify-argument>
4447 </modify-function>
4447 </modify-function>
4448 <modify-function signature="takeColumn(int)">
4448 <modify-function signature="takeColumn(int)">
4449 <modify-argument index="return">
4449 <modify-argument index="return">
4450 <define-ownership class="java" owner="default"/>
4450 <define-ownership class="java" owner="default"/>
4451 </modify-argument>
4451 </modify-argument>
4452 </modify-function>
4452 </modify-function>
4453 <modify-function signature="takeRow(int)">
4453 <modify-function signature="takeRow(int)">
4454 <modify-argument index="return">
4454 <modify-argument index="return">
4455 <define-ownership class="java" owner="default"/>
4455 <define-ownership class="java" owner="default"/>
4456 </modify-argument>
4456 </modify-argument>
4457 </modify-function>
4457 </modify-function>
4458 <modify-function signature="takeHorizontalHeaderItem(int)">
4458 <modify-function signature="takeHorizontalHeaderItem(int)">
4459 <modify-argument index="return">
4459 <modify-argument index="return">
4460 <define-ownership class="java" owner="default"/>
4460 <define-ownership class="java" owner="default"/>
4461 </modify-argument>
4461 </modify-argument>
4462 </modify-function>
4462 </modify-function>
4463 <modify-function signature="takeVerticalHeaderItem(int)">
4463 <modify-function signature="takeVerticalHeaderItem(int)">
4464 <modify-argument index="return">
4464 <modify-argument index="return">
4465 <define-ownership class="java" owner="default"/>
4465 <define-ownership class="java" owner="default"/>
4466 </modify-argument>
4466 </modify-argument>
4467 </modify-function>
4467 </modify-function>
4468 <modify-function signature="takeItem(int,int)">
4468 <modify-function signature="takeItem(int,int)">
4469 <modify-argument index="return">
4469 <modify-argument index="return">
4470 <define-ownership class="java" owner="default"/>
4470 <define-ownership class="java" owner="default"/>
4471 </modify-argument>
4471 </modify-argument>
4472 </modify-function>
4472 </modify-function>
4473 <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt;&amp;)">
4473 <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt;&amp;)">
4474 <modify-argument index="1">
4474 <modify-argument index="1">
4475 <define-ownership class="java" owner="c++"/>
4475 <define-ownership class="java" owner="c++"/>
4476 </modify-argument>
4476 </modify-argument>
4477 </modify-function>
4477 </modify-function>
4478 <modify-function signature="appendRow(QStandardItem *)">
4478 <modify-function signature="appendRow(QStandardItem *)">
4479 <modify-argument index="1">
4479 <modify-argument index="1">
4480 <define-ownership class="java" owner="c++"/>
4480 <define-ownership class="java" owner="c++"/>
4481 </modify-argument>
4481 </modify-argument>
4482 </modify-function>
4482 </modify-function>
4483 <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt;&amp;)">
4483 <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt;&amp;)">
4484 <modify-argument index="2">
4484 <modify-argument index="2">
4485 <define-ownership class="java" owner="c++"/>
4485 <define-ownership class="java" owner="c++"/>
4486 </modify-argument>
4486 </modify-argument>
4487 </modify-function>
4487 </modify-function>
4488 <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt;&amp;)">
4488 <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt;&amp;)">
4489 <modify-argument index="2">
4489 <modify-argument index="2">
4490 <define-ownership class="java" owner="c++"/>
4490 <define-ownership class="java" owner="c++"/>
4491 </modify-argument>
4491 </modify-argument>
4492 </modify-function>
4492 </modify-function>
4493 <modify-function signature="insertRow(int, QStandardItem *)">
4493 <modify-function signature="insertRow(int, QStandardItem *)">
4494 <modify-argument index="2">
4494 <modify-argument index="2">
4495 <define-ownership class="java" owner="c++"/>
4495 <define-ownership class="java" owner="c++"/>
4496 </modify-argument>
4496 </modify-argument>
4497 </modify-function>
4497 </modify-function>
4498 <modify-function signature="setHorizontalHeaderItem(int, QStandardItem *)">
4498 <modify-function signature="setHorizontalHeaderItem(int, QStandardItem *)">
4499 <modify-argument index="2">
4499 <modify-argument index="2">
4500 <define-ownership class="java" owner="c++"/>
4500 <define-ownership class="java" owner="c++"/>
4501 </modify-argument>
4501 </modify-argument>
4502 </modify-function>
4502 </modify-function>
4503 <modify-function signature="setItem(int, int, QStandardItem *)">
4503 <modify-function signature="setItem(int, int, QStandardItem *)">
4504 <modify-argument index="3">
4504 <modify-argument index="3">
4505 <define-ownership class="java" owner="c++"/>
4505 <define-ownership class="java" owner="c++"/>
4506 </modify-argument>
4506 </modify-argument>
4507 </modify-function>
4507 </modify-function>
4508 <modify-function signature="setItem(int, QStandardItem *)">
4508 <modify-function signature="setItem(int, QStandardItem *)">
4509 <modify-argument index="2">
4509 <modify-argument index="2">
4510 <define-ownership class="java" owner="c++"/>
4510 <define-ownership class="java" owner="c++"/>
4511 </modify-argument>
4511 </modify-argument>
4512 </modify-function>
4512 </modify-function>
4513 <modify-function signature="setItemPrototype(const QStandardItem *)">
4513 <modify-function signature="setItemPrototype(const QStandardItem *)">
4514 <modify-argument index="1">
4514 <modify-argument index="1">
4515 <define-ownership class="java" owner="c++"/>
4515 <define-ownership class="java" owner="c++"/>
4516 </modify-argument>
4516 </modify-argument>
4517 </modify-function>
4517 </modify-function>
4518 <modify-function signature="setVerticalHeaderItem(int, QStandardItem *)">
4518 <modify-function signature="setVerticalHeaderItem(int, QStandardItem *)">
4519 <modify-argument index="2">
4519 <modify-argument index="2">
4520 <define-ownership class="java" owner="c++"/>
4520 <define-ownership class="java" owner="c++"/>
4521 </modify-argument>
4521 </modify-argument>
4522 </modify-function>
4522 </modify-function>
4523 </object-type>
4523 </object-type>
4524
4524
4525 <object-type name="QRadioButton">
4525 <object-type name="QRadioButton">
4526 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
4526 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
4527 <access modifier="private"/>
4527 <access modifier="private"/>
4528 </modify-function>
4528 </modify-function>
4529 </object-type>
4529 </object-type>
4530
4530
4531 <object-type name="QScrollBar">
4531 <object-type name="QScrollBar">
4532 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4532 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4533 <access modifier="private"/>
4533 <access modifier="private"/>
4534 </modify-function>
4534 </modify-function>
4535 </object-type>
4535 </object-type>
4536
4536
4537 <object-type name="QClipboard">
4537 <object-type name="QClipboard">
4538 <extra-includes>
4538 <extra-includes>
4539 <include file-name="QImage" location="global"/>
4539 <include file-name="QImage" location="global"/>
4540 <include file-name="QPixmap" location="global"/>
4540 <include file-name="QPixmap" location="global"/>
4541 </extra-includes>
4541 </extra-includes>
4542 <modify-function signature="event(QEvent*)" remove="all"/>
4542 <modify-function signature="setMimeData(QMimeData *, QClipboard::Mode)">
4543 <modify-function signature="setMimeData(QMimeData *, QClipboard::Mode)">
4543 <modify-argument index="1">
4544 <modify-argument index="1">
4544 <define-ownership class="java" owner="c++"/>
4545 <define-ownership class="java" owner="c++"/>
4545 </modify-argument>
4546 </modify-argument>
4546 </modify-function>
4547 </modify-function>
4547 <modify-function signature="text(QString&amp;,QClipboard::Mode)const">
4548 <modify-function signature="text(QString&amp;,QClipboard::Mode)const">
4548 <access modifier="private"/>
4549 <access modifier="private"/>
4549 <modify-argument index="2">
4550 <modify-argument index="2">
4550 <remove-default-expression/>
4551 <remove-default-expression/>
4551 </modify-argument>
4552 </modify-argument>
4552 </modify-function>
4553 </modify-function>
4553
4554
4554 </object-type>
4555 </object-type>
4555
4556
4556 <object-type name="QAbstractScrollArea">
4557 <object-type name="QAbstractScrollArea">
4557 <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
4558 <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
4558 <modify-function signature="addScrollBarWidget(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
4559 <modify-function signature="addScrollBarWidget(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
4559 <modify-argument index="1">
4560 <modify-argument index="1">
4560 <reference-count action="ignore"/>
4561 <reference-count action="ignore"/>
4561 </modify-argument>
4562 </modify-argument>
4562 </modify-function>
4563 </modify-function>
4563 <modify-function signature="setCornerWidget(QWidget*)">
4564 <modify-function signature="setCornerWidget(QWidget*)">
4564 <modify-argument index="1">
4565 <modify-argument index="1">
4565 <reference-count action="ignore"/>
4566 <reference-count action="ignore"/>
4566 </modify-argument>
4567 </modify-argument>
4567 </modify-function>
4568 </modify-function>
4568 <modify-function signature="setHorizontalScrollBar(QScrollBar*)">
4569 <modify-function signature="setHorizontalScrollBar(QScrollBar*)">
4569 <modify-argument index="1">
4570 <modify-argument index="1">
4570 <reference-count action="ignore"/>
4571 <reference-count action="ignore"/>
4571 </modify-argument>
4572 </modify-argument>
4572 </modify-function>
4573 </modify-function>
4573
4574
4574 <modify-function signature="setVerticalScrollBar(QScrollBar*)">
4575 <modify-function signature="setVerticalScrollBar(QScrollBar*)">
4575 <modify-argument index="1">
4576 <modify-argument index="1">
4576 <reference-count action="ignore"/>
4577 <reference-count action="ignore"/>
4577 </modify-argument>
4578 </modify-argument>
4578 </modify-function>
4579 </modify-function>
4579
4580
4580 <modify-function signature="setViewport(QWidget*)">
4581 <modify-function signature="setViewport(QWidget*)">
4581 <modify-argument index="1">
4582 <modify-argument index="1">
4582 <reference-count action="ignore"/>
4583 <reference-count action="ignore"/>
4583 </modify-argument>
4584 </modify-argument>
4584 </modify-function>
4585 </modify-function>
4585
4586
4586 <modify-function signature="setupViewport(QWidget*)">
4587 <modify-function signature="setupViewport(QWidget*)">
4587 <modify-argument index="1">
4588 <modify-argument index="1">
4588 <reference-count action="ignore"/>
4589 <reference-count action="ignore"/>
4589 </modify-argument>
4590 </modify-argument>
4590 </modify-function>
4591 </modify-function>
4591
4592
4592 <modify-function signature="viewportEvent(QEvent*)">
4593 <modify-function signature="viewportEvent(QEvent*)">
4593 <modify-argument index="1" invalidate-after-use="yes"/>
4594 <modify-argument index="1" invalidate-after-use="yes"/>
4594 </modify-function>
4595 </modify-function>
4595
4596
4596 </object-type>
4597 </object-type>
4597
4598
4598 <object-type name="QPaintEngineState">
4599 <object-type name="QPaintEngineState">
4599 <extra-includes>
4600 <extra-includes>
4600 <include file-name="QPainterPath" location="global"/>
4601 <include file-name="QPainterPath" location="global"/>
4601 </extra-includes>
4602 </extra-includes>
4602 </object-type>
4603 </object-type>
4603
4604
4604 <object-type name="QRubberBand">
4605 <object-type name="QRubberBand">
4605 <modify-function signature="initStyleOption(QStyleOptionRubberBand*)const">
4606 <modify-function signature="initStyleOption(QStyleOptionRubberBand*)const">
4606 <access modifier="private"/>
4607 <access modifier="private"/>
4607 </modify-function>
4608 </modify-function>
4608 <modify-function signature="move(int,int)" rename="moveRubberBand"/>
4609 <modify-function signature="move(int,int)" rename="moveRubberBand"/>
4609 <modify-function signature="move(const QPoint &amp;)" rename="moveRubberBand"/>
4610 <modify-function signature="move(const QPoint &amp;)" rename="moveRubberBand"/>
4610 <modify-function signature="resize(int,int)" rename="resizeRubberBand"/>
4611 <modify-function signature="resize(int,int)" rename="resizeRubberBand"/>
4611 <modify-function signature="resize(const QSize &amp;)" rename="resizeRubberBand"/>
4612 <modify-function signature="resize(const QSize &amp;)" rename="resizeRubberBand"/>
4612 <modify-function signature="setGeometry(int,int,int,int)" rename="setRubberBandGeometry"/>
4613 <modify-function signature="setGeometry(int,int,int,int)" rename="setRubberBandGeometry"/>
4613 <modify-function signature="setGeometry(const QRect &amp;)" rename="setRubberBandGeometry"/>
4614 <modify-function signature="setGeometry(const QRect &amp;)" rename="setRubberBandGeometry"/>
4614 </object-type>
4615 </object-type>
4615
4616
4616 <object-type name="QTextLayout">
4617 <object-type name="QTextLayout">
4617 <extra-includes>
4618 <extra-includes>
4618 <include file-name="QTextOption" location="global"/>
4619 <include file-name="QTextOption" location="global"/>
4619 </extra-includes>
4620 </extra-includes>
4620 </object-type>
4621 </object-type>
4621
4622
4622 <object-type name="QTableWidget">
4623 <object-type name="QTableWidget">
4623 <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const">
4624 <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const">
4624 <modify-argument index="1" invalidate-after-use="yes"/>
4625 <modify-argument index="1" invalidate-after-use="yes"/>
4625 </modify-function>
4626 </modify-function>
4626 <modify-function signature="isSortingEnabled()const" remove="all"/>
4627 <modify-function signature="isSortingEnabled()const" remove="all"/>
4627 <modify-function signature="setSortingEnabled(bool)" remove="all"/>
4628 <modify-function signature="setSortingEnabled(bool)" remove="all"/>
4628 <modify-function signature="setHorizontalHeaderItem(int, QTableWidgetItem *)">
4629 <modify-function signature="setHorizontalHeaderItem(int, QTableWidgetItem *)">
4629 <modify-argument index="2">
4630 <modify-argument index="2">
4630 <define-ownership class="java" owner="c++"/>
4631 <define-ownership class="java" owner="c++"/>
4631 </modify-argument>
4632 </modify-argument>
4632 </modify-function>
4633 </modify-function>
4633 <modify-function signature="setItem(int, int, QTableWidgetItem *)">
4634 <modify-function signature="setItem(int, int, QTableWidgetItem *)">
4634 <modify-argument index="3">
4635 <modify-argument index="3">
4635 <define-ownership class="java" owner="c++"/>
4636 <define-ownership class="java" owner="c++"/>
4636 </modify-argument>
4637 </modify-argument>
4637 </modify-function>
4638 </modify-function>
4638 <modify-function signature="takeHorizontalHeaderItem(int)">
4639 <modify-function signature="takeHorizontalHeaderItem(int)">
4639 <modify-argument index="return">
4640 <modify-argument index="return">
4640 <define-ownership class="java" owner="default"/>
4641 <define-ownership class="java" owner="default"/>
4641 </modify-argument>
4642 </modify-argument>
4642 </modify-function>
4643 </modify-function>
4643 <modify-function signature="takeVerticalHeaderItem(int)">
4644 <modify-function signature="takeVerticalHeaderItem(int)">
4644 <modify-argument index="return">
4645 <modify-argument index="return">
4645 <define-ownership class="java" owner="default"/>
4646 <define-ownership class="java" owner="default"/>
4646 </modify-argument>
4647 </modify-argument>
4647 </modify-function>
4648 </modify-function>
4648 <modify-function signature="takeItem(int,int)">
4649 <modify-function signature="takeItem(int,int)">
4649 <modify-argument index="return">
4650 <modify-argument index="return">
4650 <define-ownership class="java" owner="default"/>
4651 <define-ownership class="java" owner="default"/>
4651 </modify-argument>
4652 </modify-argument>
4652 </modify-function>
4653 </modify-function>
4653 <modify-function signature="setItemPrototype(const QTableWidgetItem *)">
4654 <modify-function signature="setItemPrototype(const QTableWidgetItem *)">
4654 <modify-argument index="1">
4655 <modify-argument index="1">
4655 <define-ownership class="java" owner="c++"/>
4656 <define-ownership class="java" owner="c++"/>
4656 </modify-argument>
4657 </modify-argument>
4657 </modify-function>
4658 </modify-function>
4658 <modify-function signature="setVerticalHeaderItem(int, QTableWidgetItem *)">
4659 <modify-function signature="setVerticalHeaderItem(int, QTableWidgetItem *)">
4659 <modify-argument index="2">
4660 <modify-argument index="2">
4660 <define-ownership class="java" owner="c++"/>
4661 <define-ownership class="java" owner="c++"/>
4661 </modify-argument>
4662 </modify-argument>
4662 </modify-function>
4663 </modify-function>
4663 <modify-function signature="setCellWidget(int,int,QWidget*)">
4664 <modify-function signature="setCellWidget(int,int,QWidget*)">
4664 <modify-argument index="3">
4665 <modify-argument index="3">
4665 <reference-count action="ignore"/>
4666 <reference-count action="ignore"/>
4666 </modify-argument>
4667 </modify-argument>
4667 </modify-function>
4668 </modify-function>
4668 <modify-function signature="setCurrentItem(QTableWidgetItem*)">
4669 <modify-function signature="setCurrentItem(QTableWidgetItem*)">
4669 <modify-argument index="1">
4670 <modify-argument index="1">
4670 <reference-count action="ignore"/>
4671 <reference-count action="ignore"/>
4671 </modify-argument>
4672 </modify-argument>
4672 </modify-function>
4673 </modify-function>
4673 <modify-function signature="setCurrentItem(QTableWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
4674 <modify-function signature="setCurrentItem(QTableWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
4674 <modify-argument index="1">
4675 <modify-argument index="1">
4675 <reference-count action="ignore"/>
4676 <reference-count action="ignore"/>
4676 </modify-argument>
4677 </modify-argument>
4677 </modify-function>
4678 </modify-function>
4678 <modify-function signature="setItemSelected(const QTableWidgetItem*,bool)">
4679 <modify-function signature="setItemSelected(const QTableWidgetItem*,bool)">
4679 <remove/>
4680 <remove/>
4680 </modify-function>
4681 </modify-function>
4681 <modify-function signature="isItemSelected(const QTableWidgetItem*)const">
4682 <modify-function signature="isItemSelected(const QTableWidgetItem*)const">
4682 <remove/>
4683 <remove/>
4683 </modify-function>
4684 </modify-function>
4684 <modify-function signature="setModel(QAbstractItemModel*)">
4685 <modify-function signature="setModel(QAbstractItemModel*)">
4685 <modify-argument index="1">
4686 <modify-argument index="1">
4686 <reference-count action="ignore"/>
4687 <reference-count action="ignore"/>
4687 </modify-argument>
4688 </modify-argument>
4688 </modify-function>
4689 </modify-function>
4689
4690
4690 <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const" remove="all"/>
4691 <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const" remove="all"/>
4691 </object-type>
4692 </object-type>
4692 <object-type name="QTextDocument">
4693 <object-type name="QTextDocument">
4693 <extra-includes>
4694 <extra-includes>
4694 <include file-name="QTextBlock" location="global"/>
4695 <include file-name="QTextBlock" location="global"/>
4695 <include file-name="QTextFormat" location="global"/>
4696 <include file-name="QTextFormat" location="global"/>
4696 <include file-name="QTextCursor" location="global"/>
4697 <include file-name="QTextCursor" location="global"/>
4697 </extra-includes>
4698 </extra-includes>
4698 <modify-function signature="redo(QTextCursor*)">
4699 <modify-function signature="redo(QTextCursor*)">
4699 <access modifier="private"/>
4700 <access modifier="private"/>
4700 </modify-function>
4701 </modify-function>
4701 <modify-function signature="setDocumentLayout(QAbstractTextDocumentLayout*)">
4702 <modify-function signature="setDocumentLayout(QAbstractTextDocumentLayout*)">
4702 <modify-argument index="1">
4703 <modify-argument index="1">
4703 <define-ownership class="java" owner="c++"/>
4704 <define-ownership class="java" owner="c++"/>
4704 </modify-argument>
4705 </modify-argument>
4705 </modify-function>
4706 </modify-function>
4706
4707
4707 <modify-function signature="undo(QTextCursor*)">
4708 <modify-function signature="undo(QTextCursor*)">
4708 <access modifier="private"/>
4709 <access modifier="private"/>
4709 </modify-function>
4710 </modify-function>
4710 </object-type>
4711 </object-type>
4711
4712
4712 <object-type name="QTextDocumentWriter">
4713 <object-type name="QTextDocumentWriter">
4713 <modify-function signature="setCodec(QTextCodec*)">
4714 <modify-function signature="setCodec(QTextCodec*)">
4714 <modify-argument index="1">
4715 <modify-argument index="1">
4715 <reference-count action="set" variable-name="__rcCodec"/>
4716 <reference-count action="set" variable-name="__rcCodec"/>
4716 </modify-argument>
4717 </modify-argument>
4717 </modify-function>
4718 </modify-function>
4718 <modify-function signature="setDevice(QIODevice*)">
4719 <modify-function signature="setDevice(QIODevice*)">
4719 <modify-argument index="1">
4720 <modify-argument index="1">
4720 <reference-count action="set" variable-name="__rcDevice"/>
4721 <reference-count action="set" variable-name="__rcDevice"/>
4721 </modify-argument>
4722 </modify-argument>
4722 </modify-function>
4723 </modify-function>
4723 </object-type>
4724 </object-type>
4724
4725
4725 <object-type name="QSplitter">
4726 <object-type name="QSplitter">
4726
4727
4727 <modify-function signature="getRange(int,int*,int*)const">
4728 <modify-function signature="getRange(int,int*,int*)const">
4728 <access modifier="private"/>
4729 <access modifier="private"/>
4729 </modify-function>
4730 </modify-function>
4730 <modify-function signature="addWidget(QWidget *)">
4731 <modify-function signature="addWidget(QWidget *)">
4731 <modify-argument index="1">
4732 <modify-argument index="1">
4732 <reference-count action="ignore"/>
4733 <reference-count action="ignore"/>
4733 </modify-argument>
4734 </modify-argument>
4734 </modify-function>
4735 </modify-function>
4735 <modify-function signature="insertWidget(int, QWidget *)">
4736 <modify-function signature="insertWidget(int, QWidget *)">
4736 <modify-argument index="2">
4737 <modify-argument index="2">
4737 <reference-count action="ignore"/>
4738 <reference-count action="ignore"/>
4738 </modify-argument>
4739 </modify-argument>
4739 </modify-function>
4740 </modify-function>
4740 </object-type>
4741 </object-type>
4741
4742
4742 <object-type name="QGroupBox">
4743 <object-type name="QGroupBox">
4743 <modify-function signature="initStyleOption(QStyleOptionGroupBox*)const">
4744 <modify-function signature="initStyleOption(QStyleOptionGroupBox*)const">
4744 <access modifier="private"/>
4745 <access modifier="private"/>
4745 </modify-function>
4746 </modify-function>
4746 </object-type>
4747 </object-type>
4747
4748
4748 <object-type name="QStackedWidget">
4749 <object-type name="QStackedWidget">
4749 <modify-function signature="addWidget(QWidget*)">
4750 <modify-function signature="addWidget(QWidget*)">
4750 <modify-argument index="1">
4751 <modify-argument index="1">
4751 <reference-count action="ignore"/>
4752 <reference-count action="ignore"/>
4752 </modify-argument>
4753 </modify-argument>
4753 </modify-function>
4754 </modify-function>
4754 <modify-function signature="insertWidget(int,QWidget*)">
4755 <modify-function signature="insertWidget(int,QWidget*)">
4755 <modify-argument index="2">
4756 <modify-argument index="2">
4756 <reference-count action="ignore"/>
4757 <reference-count action="ignore"/>
4757 </modify-argument>
4758 </modify-argument>
4758 </modify-function>
4759 </modify-function>
4759 <modify-function signature="removeWidget(QWidget*)">
4760 <modify-function signature="removeWidget(QWidget*)">
4760 <modify-argument index="1">
4761 <modify-argument index="1">
4761 <reference-count action="ignore"/>
4762 <reference-count action="ignore"/>
4762 </modify-argument>
4763 </modify-argument>
4763 </modify-function>
4764 </modify-function>
4764 <modify-function signature="setCurrentWidget(QWidget*)">
4765 <modify-function signature="setCurrentWidget(QWidget*)">
4765 <modify-argument index="1">
4766 <modify-argument index="1">
4766 <reference-count action="ignore"/>
4767 <reference-count action="ignore"/>
4767 </modify-argument>
4768 </modify-argument>
4768 </modify-function>
4769 </modify-function>
4769 </object-type>
4770 </object-type>
4770
4771
4771 <object-type name="QSplitterHandle">
4772 <object-type name="QSplitterHandle">
4772 </object-type>
4773 </object-type>
4773
4774
4774 <object-type name="QDial">
4775 <object-type name="QDial">
4775 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4776 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4776 <access modifier="private"/>
4777 <access modifier="private"/>
4777 </modify-function>
4778 </modify-function>
4778 </object-type>
4779 </object-type>
4779
4780
4780 <object-type name="QLineEdit">
4781 <object-type name="QLineEdit">
4781 <modify-function signature="initStyleOption(QStyleOptionFrame*)const">
4782 <modify-function signature="initStyleOption(QStyleOptionFrame*)const">
4782 <access modifier="private"/>
4783 <access modifier="private"/>
4783 </modify-function>
4784 </modify-function>
4784 <modify-function signature="setCompleter(QCompleter *)">
4785 <modify-function signature="setCompleter(QCompleter *)">
4785 <modify-argument index="1">
4786 <modify-argument index="1">
4786 <reference-count action="set" variable-name="__rcCompleter"/>
4787 <reference-count action="set" variable-name="__rcCompleter"/>
4787 </modify-argument>
4788 </modify-argument>
4788 </modify-function>
4789 </modify-function>
4789 <modify-function signature="setValidator(const QValidator *)">
4790 <modify-function signature="setValidator(const QValidator *)">
4790 <modify-argument index="1">
4791 <modify-argument index="1">
4791 <reference-count action="set" variable-name="__rcValidator"/>
4792 <reference-count action="set" variable-name="__rcValidator"/>
4792 </modify-argument>
4793 </modify-argument>
4793 </modify-function>
4794 </modify-function>
4794 </object-type>
4795 </object-type>
4795
4796
4796 <object-type name="QLCDNumber"/>
4797 <object-type name="QLCDNumber"/>
4797
4798
4798 <object-type name="QSplashScreen">
4799 <object-type name="QSplashScreen">
4799 <modify-function signature="showMessage(const QString &amp;, int, const QColor &amp;)">
4800 <modify-function signature="showMessage(const QString &amp;, int, const QColor &amp;)">
4800 <modify-argument index="3">
4801 <modify-argument index="3">
4801 <replace-default-expression with="QColor.black"/>
4802 <replace-default-expression with="QColor.black"/>
4802 </modify-argument>
4803 </modify-argument>
4803 </modify-function>
4804 </modify-function>
4804 <modify-function signature="repaint()" remove="all"/>
4805 <modify-function signature="repaint()" remove="all"/>
4805 <modify-function signature="drawContents(QPainter*)">
4806 <modify-function signature="drawContents(QPainter*)">
4806 <modify-argument index="1" invalidate-after-use="yes"/>
4807 <modify-argument index="1" invalidate-after-use="yes"/>
4807 </modify-function>
4808 </modify-function>
4808 </object-type>
4809 </object-type>
4809
4810
4810 <object-type name="QDockWidget">
4811 <object-type name="QDockWidget">
4811 <modify-function signature="initStyleOption(QStyleOptionDockWidget*)const">
4812 <modify-function signature="initStyleOption(QStyleOptionDockWidget*)const">
4812 <access modifier="private"/>
4813 <access modifier="private"/>
4813 </modify-function>
4814 </modify-function>
4814 <inject-code>
4815 <inject-code>
4815 <insert-template name="gui.init_style_option">
4816 <insert-template name="gui.init_style_option">
4816 <replace from="%TYPE" to="QStyleOptionDockWidget"/>
4817 <replace from="%TYPE" to="QStyleOptionDockWidget"/>
4817 </insert-template>
4818 </insert-template>
4818 </inject-code>
4819 </inject-code>
4819 <modify-function signature="setTitleBarWidget(QWidget*)">
4820 <modify-function signature="setTitleBarWidget(QWidget*)">
4820 <modify-argument index="1">
4821 <modify-argument index="1">
4821 <reference-count action="ignore"/>
4822 <reference-count action="ignore"/>
4822 </modify-argument>
4823 </modify-argument>
4823 </modify-function>
4824 </modify-function>
4824 <modify-function signature="setWidget(QWidget*)">
4825 <modify-function signature="setWidget(QWidget*)">
4825 <modify-argument index="1">
4826 <modify-argument index="1">
4826 <reference-count action="ignore"/>
4827 <reference-count action="ignore"/>
4827 </modify-argument>
4828 </modify-argument>
4828 </modify-function>
4829 </modify-function>
4829 </object-type>
4830 </object-type>
4830
4831
4831 <object-type name="QAbstractProxyModel">
4832 <object-type name="QAbstractProxyModel">
4832 <extra-includes>
4833 <extra-includes>
4833 <include file-name="QItemSelection" location="global"/>
4834 <include file-name="QItemSelection" location="global"/>
4834 <include file-name="QStringList" location="global"/>
4835 <include file-name="QStringList" location="global"/>
4835 <include file-name="QSize" location="global"/>
4836 <include file-name="QSize" location="global"/>
4836 </extra-includes>
4837 </extra-includes>
4837
4838
4838 <modify-function signature="setSourceModel(QAbstractItemModel *)">
4839 <modify-function signature="setSourceModel(QAbstractItemModel *)">
4839 <modify-argument index="1">
4840 <modify-argument index="1">
4840 <reference-count action="set" variable-name="__rcSourceModel"/>
4841 <reference-count action="set" variable-name="__rcSourceModel"/>
4841 </modify-argument>
4842 </modify-argument>
4842 </modify-function>
4843 </modify-function>
4843
4844
4844 </object-type>
4845 </object-type>
4845
4846
4846 <object-type name="QDesktopWidget">
4847 <object-type name="QDesktopWidget">
4847 </object-type>
4848 </object-type>
4848
4849
4849 <object-type name="QFrame">
4850 <object-type name="QFrame">
4850 </object-type>
4851 </object-type>
4851
4852
4852 <object-type name="QTextTable">
4853 <object-type name="QTextTable">
4853 <modify-function signature="format() const">
4854 <modify-function signature="format() const">
4854 <rename to="tableFormat"/>
4855 <rename to="tableFormat"/>
4855 </modify-function>
4856 </modify-function>
4856 <extra-includes>
4857 <extra-includes>
4857 <include file-name="QTextCursor" location="global"/>
4858 <include file-name="QTextCursor" location="global"/>
4858 </extra-includes>
4859 </extra-includes>
4859 </object-type>
4860 </object-type>
4860
4861
4861 <object-type name="QSpinBox">
4862 <object-type name="QSpinBox">
4862 <modify-function signature="valueChanged(const QString &amp;)">
4863 <modify-function signature="valueChanged(const QString &amp;)">
4863 <rename to="valueStringChanged"/>
4864 <rename to="valueStringChanged"/>
4864 </modify-function>
4865 </modify-function>
4865 </object-type>
4866 </object-type>
4866
4867
4867 <object-type name="QTextBrowser">
4868 <object-type name="QTextBrowser">
4868 <modify-function signature="highlighted(const QString &amp;)">
4869 <modify-function signature="highlighted(const QString &amp;)">
4869 <rename to="highlightedString"/>
4870 <rename to="highlightedString"/>
4870 </modify-function>
4871 </modify-function>
4871 </object-type>
4872 </object-type>
4872
4873
4873 <object-type name="QDoubleSpinBox">
4874 <object-type name="QDoubleSpinBox">
4874 <modify-function signature="valueChanged(const QString &amp;)">
4875 <modify-function signature="valueChanged(const QString &amp;)">
4875 <rename to="valueStringChanged"/>
4876 <rename to="valueStringChanged"/>
4876 </modify-function>
4877 </modify-function>
4877 </object-type>
4878 </object-type>
4878
4879
4879 <object-type name="QButtonGroup">
4880 <object-type name="QButtonGroup">
4880 <modify-function signature="buttonClicked(int)">
4881 <modify-function signature="buttonClicked(int)">
4881 <rename to="buttonIdClicked"/>
4882 <rename to="buttonIdClicked"/>
4882 </modify-function>
4883 </modify-function>
4883 <modify-function signature="buttonPressed(int)">
4884 <modify-function signature="buttonPressed(int)">
4884 <rename to="buttonIdPressed"/>
4885 <rename to="buttonIdPressed"/>
4885 </modify-function>
4886 </modify-function>
4886 <modify-function signature="buttonReleased(int)">
4887 <modify-function signature="buttonReleased(int)">
4887 <rename to="buttonIdReleased"/>
4888 <rename to="buttonIdReleased"/>
4888 </modify-function>
4889 </modify-function>
4889 <modify-function signature="addButton(QAbstractButton *)">
4890 <modify-function signature="addButton(QAbstractButton *)">
4890 <modify-argument index="1">
4891 <modify-argument index="1">
4891 <reference-count action="add" variable-name="__rcButtons"/>
4892 <reference-count action="add" variable-name="__rcButtons"/>
4892 <no-null-pointer/>
4893 <no-null-pointer/>
4893 </modify-argument>
4894 </modify-argument>
4894 </modify-function>
4895 </modify-function>
4895 <modify-function signature="addButton(QAbstractButton *, int)">
4896 <modify-function signature="addButton(QAbstractButton *, int)">
4896 <modify-argument index="1">
4897 <modify-argument index="1">
4897 <reference-count action="add" variable-name="__rcButtons"/>
4898 <reference-count action="add" variable-name="__rcButtons"/>
4898 <no-null-pointer/>
4899 <no-null-pointer/>
4899 </modify-argument>
4900 </modify-argument>
4900 </modify-function>
4901 </modify-function>
4901 <modify-function signature="removeButton(QAbstractButton *)">
4902 <modify-function signature="removeButton(QAbstractButton *)">
4902 <modify-argument index="1">
4903 <modify-argument index="1">
4903 <reference-count action="remove" variable-name="__rcButtons"/>
4904 <reference-count action="remove" variable-name="__rcButtons"/>
4904 <no-null-pointer/>
4905 <no-null-pointer/>
4905 </modify-argument>
4906 </modify-argument>
4906 </modify-function>
4907 </modify-function>
4907 <modify-function signature="setId(QAbstractButton *,int)">
4908 <modify-function signature="setId(QAbstractButton *,int)">
4908 <modify-argument index="1">
4909 <modify-argument index="1">
4909 <reference-count action="ignore"/>
4910 <reference-count action="ignore"/>
4910 </modify-argument>
4911 </modify-argument>
4911 </modify-function>
4912 </modify-function>
4912 </object-type>
4913 </object-type>
4913
4914
4914 <object-type name="QToolBar">
4915 <object-type name="QToolBar">
4915 <modify-function signature="addWidget(QWidget*)">
4916 <modify-function signature="addWidget(QWidget*)">
4916 <modify-argument index="1">
4917 <modify-argument index="1">
4917 <define-ownership class="java" owner="c++"/>
4918 <define-ownership class="java" owner="c++"/>
4918 </modify-argument>
4919 </modify-argument>
4919 </modify-function>
4920 </modify-function>
4920 <modify-function signature="insertWidget(QAction*,QWidget*)">
4921 <modify-function signature="insertWidget(QAction*,QWidget*)">
4921 <modify-argument index="1">
4922 <modify-argument index="1">
4922 <reference-count action="ignore"/>
4923 <reference-count action="ignore"/>
4923 </modify-argument>
4924 </modify-argument>
4924 <modify-argument index="2">
4925 <modify-argument index="2">
4925 <define-ownership class="java" owner="c++"/>
4926 <define-ownership class="java" owner="c++"/>
4926 </modify-argument>
4927 </modify-argument>
4927 </modify-function>
4928 </modify-function>
4928 <modify-function signature="insertSeparator(QAction*)">
4929 <modify-function signature="insertSeparator(QAction*)">
4929 <modify-argument index="1">
4930 <modify-argument index="1">
4930 <reference-count action="ignore"/>
4931 <reference-count action="ignore"/>
4931 </modify-argument>
4932 </modify-argument>
4932 </modify-function>
4933 </modify-function>
4933
4934
4934 <inject-code class="pywrap-h">
4935 <inject-code class="pywrap-h">
4935 QAction* addAction (QToolBar* menu, const QString &amp; text, PyObject* callable)
4936 QAction* addAction (QToolBar* menu, const QString &amp; text, PyObject* callable)
4936 {
4937 {
4937 QAction* a = menu-&gt;addAction(text);
4938 QAction* a = menu-&gt;addAction(text);
4938 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4939 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4939 return a;
4940 return a;
4940 }
4941 }
4941
4942
4942 QAction* addAction (QToolBar* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable)
4943 QAction* addAction (QToolBar* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable)
4943 {
4944 {
4944 QAction* a = menu-&gt;addAction(text);
4945 QAction* a = menu-&gt;addAction(text);
4945 a-&gt;setIcon(icon);
4946 a-&gt;setIcon(icon);
4946 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4947 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4947 return a;
4948 return a;
4948 }
4949 }
4949 </inject-code>
4950 </inject-code>
4950 </object-type>
4951 </object-type>
4951
4952
4952 <object-type name="QPaintEngine">
4953 <object-type name="QPaintEngine">
4953
4954
4954 <modify-function signature="begin(QPaintDevice*)">
4955 <modify-function signature="begin(QPaintDevice*)">
4955 <modify-argument index="1" invalidate-after-use="yes"/>
4956 <modify-argument index="1" invalidate-after-use="yes"/>
4956 </modify-function>
4957 </modify-function>
4957 <modify-function signature="updateState(QPaintEngineState)">
4958 <modify-function signature="updateState(QPaintEngineState)">
4958 <modify-argument index="1" invalidate-after-use="yes"/>
4959 <modify-argument index="1" invalidate-after-use="yes"/>
4959 </modify-function>
4960 </modify-function>
4960 <modify-function signature="drawTextItem(QPointF,QTextItem)">
4961 <modify-function signature="drawTextItem(QPointF,QTextItem)">
4961 <modify-argument index="2" invalidate-after-use="yes"/>
4962 <modify-argument index="2" invalidate-after-use="yes"/>
4962 </modify-function>
4963 </modify-function>
4963
4964
4964 <extra-includes>
4965 <extra-includes>
4965 <include file-name="QVarLengthArray" location="global"/>
4966 <include file-name="QVarLengthArray" location="global"/>
4966 </extra-includes>
4967 </extra-includes>
4967 <modify-function signature="setPaintDevice(QPaintDevice*)">
4968 <modify-function signature="setPaintDevice(QPaintDevice*)">
4968 <remove/>
4969 <remove/>
4969 </modify-function>
4970 </modify-function>
4970 <modify-field name="state" read="false" write="false"/>
4971 <modify-field name="state" read="false" write="false"/>
4971 </object-type>
4972 </object-type>
4972
4973
4973 <object-type name="QAbstractTableModel">
4974 <object-type name="QAbstractTableModel">
4974 <extra-includes>
4975 <extra-includes>
4975 <include file-name="QStringList" location="global"/>
4976 <include file-name="QStringList" location="global"/>
4976 <include file-name="QSize" location="global"/>
4977 <include file-name="QSize" location="global"/>
4977 </extra-includes>
4978 </extra-includes>
4978 </object-type>
4979 </object-type>
4979
4980
4980 <object-type name="QGuiSignalMapper"/>
4981 <object-type name="QGuiSignalMapper"/>
4981
4982
4982 <object-type name="QComboBox">
4983 <object-type name="QComboBox">
4983 <modify-function signature="initStyleOption(QStyleOptionComboBox*)const">
4984 <modify-function signature="initStyleOption(QStyleOptionComboBox*)const">
4984 <access modifier="private"/>
4985 <access modifier="private"/>
4985 </modify-function>
4986 </modify-function>
4986 <modify-function signature="setCompleter(QCompleter*)">
4987 <modify-function signature="setCompleter(QCompleter*)">
4987 <modify-argument index="1">
4988 <modify-argument index="1">
4988 <reference-count variable-name="__rcCompleter" action="set"/>
4989 <reference-count variable-name="__rcCompleter" action="set"/>
4989 </modify-argument>
4990 </modify-argument>
4990 </modify-function>
4991 </modify-function>
4991 <modify-function signature="setValidator(const QValidator*)">
4992 <modify-function signature="setValidator(const QValidator*)">
4992 <modify-argument index="1">
4993 <modify-argument index="1">
4993 <reference-count variable-name="__rcValidator" action="set"/>
4994 <reference-count variable-name="__rcValidator" action="set"/>
4994 </modify-argument>
4995 </modify-argument>
4995 </modify-function>
4996 </modify-function>
4996 <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
4997 <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
4997 <modify-argument index="1">
4998 <modify-argument index="1">
4998 <define-ownership class="java" owner="c++"/>
4999 <define-ownership class="java" owner="c++"/>
4999 <no-null-pointer/>
5000 <no-null-pointer/>
5000 </modify-argument>
5001 </modify-argument>
5001 </modify-function>
5002 </modify-function>
5002 <modify-function signature="setView(QAbstractItemView *)">
5003 <modify-function signature="setView(QAbstractItemView *)">
5003 <modify-argument index="1">
5004 <modify-argument index="1">
5004 <no-null-pointer/>
5005 <no-null-pointer/>
5005 <!-- Safe to ignore because combo box reparents view -->
5006 <!-- Safe to ignore because combo box reparents view -->
5006 <reference-count action="ignore"/>
5007 <reference-count action="ignore"/>
5007 </modify-argument>
5008 </modify-argument>
5008 </modify-function>
5009 </modify-function>
5009 <modify-function signature="setLineEdit(QLineEdit *)">
5010 <modify-function signature="setLineEdit(QLineEdit *)">
5010 <modify-argument index="1">
5011 <modify-argument index="1">
5011 <no-null-pointer/>
5012 <no-null-pointer/>
5012 <!-- Safe to ignore because combo box reparents line edit -->
5013 <!-- Safe to ignore because combo box reparents line edit -->
5013 <reference-count action="ignore"/>
5014 <reference-count action="ignore"/>
5014 </modify-argument>
5015 </modify-argument>
5015 </modify-function>
5016 </modify-function>
5016 <modify-function signature="setModel(QAbstractItemModel *)">
5017 <modify-function signature="setModel(QAbstractItemModel *)">
5017 <modify-argument index="1">
5018 <modify-argument index="1">
5018 <no-null-pointer/>
5019 <no-null-pointer/>
5019 <reference-count action="set" variable-name="__rcModel"/>
5020 <reference-count action="set" variable-name="__rcModel"/>
5020 </modify-argument>
5021 </modify-argument>
5021 </modify-function>
5022 </modify-function>
5022 <inject-code>
5023 <inject-code>
5023 <insert-template name="gui.init_style_option">
5024 <insert-template name="gui.init_style_option">
5024 <replace from="%TYPE" to="QStyleOptionComboBox"/>
5025 <replace from="%TYPE" to="QStyleOptionComboBox"/>
5025 </insert-template>
5026 </insert-template>
5026 </inject-code>
5027 </inject-code>
5027 <modify-function signature="activated(int)">&gt;
5028 <modify-function signature="activated(int)">&gt;
5028 <rename to="activatedIndex"/>
5029 <rename to="activatedIndex"/>
5029 </modify-function>
5030 </modify-function>
5030 <modify-function signature="currentIndexChanged(const QString &amp;)">
5031 <modify-function signature="currentIndexChanged(const QString &amp;)">
5031 <rename to="currentStringChanged"/>
5032 <rename to="currentStringChanged"/>
5032 </modify-function>
5033 </modify-function>
5033 <modify-function signature="highlighted(int)">
5034 <modify-function signature="highlighted(int)">
5034 <rename to="highlightedIndex"/>
5035 <rename to="highlightedIndex"/>
5035 </modify-function>
5036 </modify-function>
5036
5037
5037 <modify-function signature="autoCompletion()const" remove="all"/> <!--### Obsolete in 4.3-->
5038 <modify-function signature="autoCompletion()const" remove="all"/> <!--### Obsolete in 4.3-->
5038 <modify-function signature="autoCompletionCaseSensitivity()const" remove="all"/> <!--### Obsolete in 4.3-->
5039 <modify-function signature="autoCompletionCaseSensitivity()const" remove="all"/> <!--### Obsolete in 4.3-->
5039 <modify-function signature="setAutoCompletion(bool)" remove="all"/> <!--### Obsolete in 4.3-->
5040 <modify-function signature="setAutoCompletion(bool)" remove="all"/> <!--### Obsolete in 4.3-->
5040 <modify-function signature="setAutoCompletionCaseSensitivity(Qt::CaseSensitivity)" remove="all"/> <!--### Obsolete in 4.3-->
5041 <modify-function signature="setAutoCompletionCaseSensitivity(Qt::CaseSensitivity)" remove="all"/> <!--### Obsolete in 4.3-->
5041 </object-type>
5042 </object-type>
5042
5043
5043 <object-type name="QTextEdit">
5044 <object-type name="QTextEdit">
5044 <extra-includes>
5045 <extra-includes>
5045 <include file-name="QTextCursor" location="global"/>
5046 <include file-name="QTextCursor" location="global"/>
5046 </extra-includes>
5047 </extra-includes>
5047 <modify-function signature="setDocument(QTextDocument*)">
5048 <modify-function signature="setDocument(QTextDocument*)">
5048 <modify-argument index="1">
5049 <modify-argument index="1">
5049 <reference-count action="set" variable-name="__rcDocument"/>
5050 <reference-count action="set" variable-name="__rcDocument"/>
5050 </modify-argument>
5051 </modify-argument>
5051 </modify-function>
5052 </modify-function>
5052 <modify-function signature="insertFromMimeData(const QMimeData*) ">
5053 <modify-function signature="insertFromMimeData(const QMimeData*) ">
5053 <modify-argument index="1">
5054 <modify-argument index="1">
5054 <reference-count action="ignore"/>
5055 <reference-count action="ignore"/>
5055 </modify-argument>
5056 </modify-argument>
5056 </modify-function>
5057 </modify-function>
5057 </object-type>
5058 </object-type>
5058
5059
5059 <object-type name="QPrinter" delete-in-main-thread="yes">
5060 <object-type name="QPrinter" delete-in-main-thread="yes">
5060 <modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
5061 <modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
5061 <modify-argument index="1">
5062 <modify-argument index="1">
5062 <reference-count action="set" variable-name="__rcPrintEngine"/>
5063 <reference-count action="set" variable-name="__rcPrintEngine"/>
5063 </modify-argument>
5064 </modify-argument>
5064 <modify-argument index="2">
5065 <modify-argument index="2">
5065 <reference-count action="set" variable-name="__rcPaintEngine"/>
5066 <reference-count action="set" variable-name="__rcPaintEngine"/>
5066 </modify-argument>
5067 </modify-argument>
5067 </modify-function>
5068 </modify-function>
5068
5069
5069 <extra-includes>
5070 <extra-includes>
5070 <include file-name="QPrinterInfo" location="global"/>
5071 <include file-name="QPrinterInfo" location="global"/>
5071 </extra-includes>
5072 </extra-includes>
5072 </object-type>
5073 </object-type>
5073
5074
5074 <object-type name="QAction">
5075 <object-type name="QAction">
5075 <modify-function signature="setMenu(QMenu*)">
5076 <modify-function signature="setMenu(QMenu*)">
5076 <modify-argument index="1">
5077 <modify-argument index="1">
5077 <reference-count action="set" variable-name="__rcMenu"/>
5078 <reference-count action="set" variable-name="__rcMenu"/>
5078 </modify-argument>
5079 </modify-argument>
5079 </modify-function>
5080 </modify-function>
5080
5081
5081 </object-type>
5082 </object-type>
5082
5083
5083 <object-type name="QPainter">
5084 <object-type name="QPainter">
5084 <extra-includes>
5085 <extra-includes>
5085 <include file-name="QWidget" location="global"/>
5086 <include file-name="QWidget" location="global"/>
5086 <include file-name="QPainterPath" location="global"/>
5087 <include file-name="QPainterPath" location="global"/>
5087 <include file-name="QPixmap" location="global"/>
5088 <include file-name="QPixmap" location="global"/>
5088 </extra-includes>
5089 </extra-includes>
5089
5090
5090 <modify-function signature="drawText(const QPointF &amp;, const QString &amp;, int, int)" remove="all"/>
5091 <modify-function signature="drawText(const QPointF &amp;, const QString &amp;, int, int)" remove="all"/>
5091
5092
5092 <modify-function signature="drawConvexPolygon(const QPoint *, int)">
5093 <modify-function signature="drawConvexPolygon(const QPoint *, int)">
5093 <remove/>
5094 <remove/>
5094 </modify-function>
5095 </modify-function>
5095 <modify-function signature="drawConvexPolygon(const QPointF *, int)">
5096 <modify-function signature="drawConvexPolygon(const QPointF *, int)">
5096 <remove/>
5097 <remove/>
5097 </modify-function>
5098 </modify-function>
5098 <modify-function signature="drawLines(const QLine *, int)">
5099 <modify-function signature="drawLines(const QLine *, int)">
5099 <remove/>
5100 <remove/>
5100 </modify-function>
5101 </modify-function>
5101 <modify-function signature="drawLines(const QLineF *, int)">
5102 <modify-function signature="drawLines(const QLineF *, int)">
5102 <remove/>
5103 <remove/>
5103 </modify-function>
5104 </modify-function>
5104 <modify-function signature="drawLines(const QPoint *, int)">
5105 <modify-function signature="drawLines(const QPoint *, int)">
5105 <remove/>
5106 <remove/>
5106 </modify-function>
5107 </modify-function>
5107 <modify-function signature="drawLines(const QPointF *, int)">
5108 <modify-function signature="drawLines(const QPointF *, int)">
5108 <remove/>
5109 <remove/>
5109 </modify-function>
5110 </modify-function>
5110 <modify-function signature="drawPoints(const QPoint *, int)">
5111 <modify-function signature="drawPoints(const QPoint *, int)">
5111 <remove/>
5112 <remove/>
5112 </modify-function>
5113 </modify-function>
5113 <modify-function signature="drawPoints(const QPointF *, int)">
5114 <modify-function signature="drawPoints(const QPointF *, int)">
5114 <remove/>
5115 <remove/>
5115 </modify-function>
5116 </modify-function>
5116 <modify-function signature="drawPolygon(const QPoint *, int, Qt::FillRule)">
5117 <modify-function signature="drawPolygon(const QPoint *, int, Qt::FillRule)">
5117 <remove/>
5118 <remove/>
5118 </modify-function>
5119 </modify-function>
5119 <modify-function signature="drawPolygon(const QPointF *, int, Qt::FillRule)">
5120 <modify-function signature="drawPolygon(const QPointF *, int, Qt::FillRule)">
5120 <remove/>
5121 <remove/>
5121 </modify-function>
5122 </modify-function>
5122 <modify-function signature="drawPolyline(const QPoint *, int)">
5123 <modify-function signature="drawPolyline(const QPoint *, int)">
5123 <remove/>
5124 <remove/>
5124 </modify-function>
5125 </modify-function>
5125 <modify-function signature="drawPolyline(const QPointF *, int)">
5126 <modify-function signature="drawPolyline(const QPointF *, int)">
5126 <remove/>
5127 <remove/>
5127 </modify-function>
5128 </modify-function>
5128 <modify-function signature="drawRects(const QRect *, int)">
5129 <modify-function signature="drawRects(const QRect *, int)">
5129 <remove/>
5130 <remove/>
5130 </modify-function>
5131 </modify-function>
5131 <modify-function signature="drawRects(const QRectF *, int)">
5132 <modify-function signature="drawRects(const QRectF *, int)">
5132 <remove/>
5133 <remove/>
5133 </modify-function>
5134 </modify-function>
5134 <modify-function signature="drawLines(const QVector&lt;QPoint&gt; &amp;)">
5135 <modify-function signature="drawLines(const QVector&lt;QPoint&gt; &amp;)">
5135 <rename to="drawLinesFromPoints"/>
5136 <rename to="drawLinesFromPoints"/>
5136 </modify-function>
5137 </modify-function>
5137 <modify-function signature="drawLines(const QVector&lt;QPointF&gt; &amp;)">
5138 <modify-function signature="drawLines(const QVector&lt;QPointF&gt; &amp;)">
5138 <rename to="drawLinesFromPointsF"/>
5139 <rename to="drawLinesFromPointsF"/>
5139 </modify-function>
5140 </modify-function>
5140 <modify-function signature="drawLines(const QVector&lt;QLineF&gt; &amp;)">
5141 <modify-function signature="drawLines(const QVector&lt;QLineF&gt; &amp;)">
5141 <rename to="drawLinesF"/>
5142 <rename to="drawLinesF"/>
5142 </modify-function>
5143 </modify-function>
5143 <modify-function signature="drawRects(const QVector&lt;QRectF&gt; &amp;)">
5144 <modify-function signature="drawRects(const QVector&lt;QRectF&gt; &amp;)">
5144 <rename to="drawRectsF"/>
5145 <rename to="drawRectsF"/>
5145 </modify-function>
5146 </modify-function>
5146
5147
5147 <modify-function signature="QPainter(QPaintDevice *)">
5148 <modify-function signature="QPainter(QPaintDevice *)">
5148 <modify-argument index="1">
5149 <modify-argument index="1">
5149 <no-null-pointer/>
5150 <no-null-pointer/>
5150 </modify-argument>
5151 </modify-argument>
5151 </modify-function>
5152 </modify-function>
5152 <modify-function signature="begin(QPaintDevice *)">
5153 <modify-function signature="begin(QPaintDevice *)">
5153 <modify-argument index="1">
5154 <modify-argument index="1">
5154 <no-null-pointer/>
5155 <no-null-pointer/>
5155 </modify-argument>
5156 </modify-argument>
5156 </modify-function>
5157 </modify-function>
5157 <modify-function signature="initFrom(const QWidget *)">
5158 <modify-function signature="initFrom(const QWidget *)">
5158 <modify-argument index="1">
5159 <modify-argument index="1">
5159 <no-null-pointer/>
5160 <no-null-pointer/>
5160 </modify-argument>
5161 </modify-argument>
5161 </modify-function>
5162 </modify-function>
5162 <modify-function signature="setRedirected(const QPaintDevice *, QPaintDevice *, const QPoint &amp;)">
5163 <modify-function signature="setRedirected(const QPaintDevice *, QPaintDevice *, const QPoint &amp;)">
5163 <modify-argument index="1">
5164 <modify-argument index="1">
5164 <no-null-pointer/>
5165 <no-null-pointer/>
5165 </modify-argument>
5166 </modify-argument>
5166 </modify-function>
5167 </modify-function>
5167 <modify-function signature="restoreRedirected(const QPaintDevice *)">
5168 <modify-function signature="restoreRedirected(const QPaintDevice *)">
5168 <modify-argument index="1">
5169 <modify-argument index="1">
5169 <no-null-pointer/>
5170 <no-null-pointer/>
5170 </modify-argument>
5171 </modify-argument>
5171 </modify-function>
5172 </modify-function>
5172
5173
5173 <modify-function signature="drawText(QRect,int,QString,QRect*)">
5174 <modify-function signature="drawText(QRect,int,QString,QRect*)">
5174 <access modifier="private"/>
5175 <access modifier="private"/>
5175 <modify-argument index="4">
5176 <modify-argument index="4">
5176 <remove-default-expression/>
5177 <remove-default-expression/>
5177 </modify-argument>
5178 </modify-argument>
5178 </modify-function>
5179 </modify-function>
5179
5180
5180 <modify-function signature="drawText(QRectF,int,QString,QRectF*)">
5181 <modify-function signature="drawText(QRectF,int,QString,QRectF*)">
5181 <access modifier="private"/>
5182 <access modifier="private"/>
5182 <modify-argument index="4">
5183 <modify-argument index="4">
5183 <remove-default-expression/>
5184 <remove-default-expression/>
5184 </modify-argument>
5185 </modify-argument>
5185 </modify-function>
5186 </modify-function>
5186
5187
5187 <modify-function signature="drawText(int,int,int,int,int,QString,QRect*)">
5188 <modify-function signature="drawText(int,int,int,int,int,QString,QRect*)">
5188 <access modifier="private"/>
5189 <access modifier="private"/>
5189 <modify-argument index="7">
5190 <modify-argument index="7">
5190 <remove-default-expression/>
5191 <remove-default-expression/>
5191 </modify-argument>
5192 </modify-argument>
5192 </modify-function>
5193 </modify-function>
5193
5194
5194 <modify-function signature="redirected(const QPaintDevice*,QPoint*)">
5195 <modify-function signature="redirected(const QPaintDevice*,QPoint*)">
5195 <access modifier="private"/>
5196 <access modifier="private"/>
5196 <modify-argument index="2">
5197 <modify-argument index="2">
5197 <remove-default-expression/>
5198 <remove-default-expression/>
5198 </modify-argument>
5199 </modify-argument>
5199 </modify-function>
5200 </modify-function>
5200 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
5201 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
5201 <modify-function signature="matrixEnabled()const" remove="all"/> <!--### Obsolete in 4.3-->
5202 <modify-function signature="matrixEnabled()const" remove="all"/> <!--### Obsolete in 4.3-->
5202 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
5203 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
5203 <modify-function signature="setMatrixEnabled(bool)" remove="all"/> <!--### Obsolete in 4.3-->
5204 <modify-function signature="setMatrixEnabled(bool)" remove="all"/> <!--### Obsolete in 4.3-->
5204
5205
5205 <modify-function signature="setBrush(Qt::BrushStyle)" remove="all"/> <!--### Problematic in PythonQt -->
5206 <modify-function signature="setBrush(Qt::BrushStyle)" remove="all"/> <!--### Problematic in PythonQt -->
5206
5207
5207 <modify-function signature="begin(QPaintDevice*)">
5208 <modify-function signature="begin(QPaintDevice*)">
5208 <modify-argument index="1">
5209 <modify-argument index="1">
5209 <conversion-rule class="native">
5210 <conversion-rule class="native">
5210 <insert-template name="core.convert_pointer_arg_and_check_null">
5211 <insert-template name="core.convert_pointer_arg_and_check_null">
5211 <replace from="%TYPE%" to="QPaintDevice*"/>
5212 <replace from="%TYPE%" to="QPaintDevice*"/>
5212 <replace from="%CLASS_NAME%" to="QPainter"/>
5213 <replace from="%CLASS_NAME%" to="QPainter"/>
5213 <replace from="%FUNCTION_NAME%" to="begin"/>
5214 <replace from="%FUNCTION_NAME%" to="begin"/>
5214 </insert-template>
5215 </insert-template>
5215 </conversion-rule>
5216 </conversion-rule>
5216 </modify-argument>
5217 </modify-argument>
5217 </modify-function>
5218 </modify-function>
5218 </object-type>
5219 </object-type>
5219
5220
5220 <object-type name="QApplication">
5221 <object-type name="QApplication">
5221 <extra-includes>
5222 <extra-includes>
5222 <include file-name="QBasicTimer" location="global"/>
5223 <include file-name="QBasicTimer" location="global"/>
5223 <include file-name="QFont" location="global"/>
5224 <include file-name="QFont" location="global"/>
5224 <include file-name="QFontMetrics" location="global"/>
5225 <include file-name="QFontMetrics" location="global"/>
5225 <include file-name="QPalette" location="global"/>
5226 <include file-name="QPalette" location="global"/>
5226 <include file-name="QIcon" location="global"/>
5227 <include file-name="QIcon" location="global"/>
5227 <include file-name="QLocale" location="global"/>
5228 <include file-name="QLocale" location="global"/>
5228 </extra-includes>
5229 </extra-includes>
5229
5230
5230 <modify-function signature="QApplication(int &amp;, char **, int)">
5231 <modify-function signature="QApplication(int &amp;, char **, int)">
5231 <access modifier="private"/>
5232 <access modifier="private"/>
5232 </modify-function>
5233 </modify-function>
5233 <modify-function signature="QApplication(int &amp;, char **, QApplication::Type, int)">
5234 <modify-function signature="QApplication(int &amp;, char **, QApplication::Type, int)">
5234 <remove/>
5235 <remove/>
5235 </modify-function>
5236 </modify-function>
5236 <modify-function signature="QApplication(int &amp;, char **, bool, int)">
5237 <modify-function signature="QApplication(int &amp;, char **, bool, int)">
5237 <remove/>
5238 <remove/>
5238 </modify-function>
5239 </modify-function>
5239
5240
5240 <modify-function signature="font(const char*)">
5241 <modify-function signature="font(const char*)">
5241 <remove/>
5242 <remove/>
5242 </modify-function>
5243 </modify-function>
5243 <modify-function signature="setFont(QFont,const char*)">
5244 <modify-function signature="setFont(QFont,const char*)">
5244 <access modifier="private"/>
5245 <access modifier="private"/>
5245 <modify-argument index="2">
5246 <modify-argument index="2">
5246 <remove-default-expression/>
5247 <remove-default-expression/>
5247 </modify-argument>
5248 </modify-argument>
5248 </modify-function>
5249 </modify-function>
5249
5250
5250 <modify-function signature="palette(const char*)">
5251 <modify-function signature="palette(const char*)">
5251 <remove/>
5252 <remove/>
5252 </modify-function>
5253 </modify-function>
5253 <modify-function signature="setPalette(QPalette,const char*)">
5254 <modify-function signature="setPalette(QPalette,const char*)">
5254 <access modifier="private"/>
5255 <access modifier="private"/>
5255 <modify-argument index="2">
5256 <modify-argument index="2">
5256 <remove-default-expression/>
5257 <remove-default-expression/>
5257 </modify-argument>
5258 </modify-argument>
5258 </modify-function>
5259 </modify-function>
5259
5260
5260 <modify-function signature="overrideCursor()">
5261 <modify-function signature="overrideCursor()">
5261 <access modifier="private"/>
5262 <access modifier="private"/>
5262 <rename to="overrideCursor_private"/>
5263 <rename to="overrideCursor_private"/>
5263 </modify-function>
5264 </modify-function>
5264
5265
5265 <modify-function signature="setInputContext(QInputContext*)">
5266 <modify-function signature="setInputContext(QInputContext*)">
5266 <modify-argument index="1">
5267 <modify-argument index="1">
5267 <define-ownership class="java" owner="c++"/>
5268 <define-ownership class="java" owner="c++"/>
5268 </modify-argument>
5269 </modify-argument>
5269 </modify-function>
5270 </modify-function>
5270 <modify-function signature="setActiveWindow(QWidget*)">
5271 <modify-function signature="setActiveWindow(QWidget*)">
5271 <modify-argument index="1">
5272 <modify-argument index="1">
5272 <reference-count action="ignore"/>
5273 <reference-count action="ignore"/>
5273 </modify-argument>
5274 </modify-argument>
5274 </modify-function>
5275 </modify-function>
5275 <modify-function signature="setStyle(QStyle*)">
5276 <modify-function signature="setStyle(QStyle*)">
5276 <modify-argument index="1">
5277 <modify-argument index="1">
5277 <reference-count action="ignore"/>
5278 <reference-count action="ignore"/>
5278 </modify-argument>
5279 </modify-argument>
5279 </modify-function>
5280 </modify-function>
5280
5281
5281 <modify-function signature="QApplication(int&amp;,char**,QApplication::Type,int)" remove="all"/>
5282 <modify-function signature="QApplication(int&amp;,char**,QApplication::Type,int)" remove="all"/>
5282 <modify-function signature="QApplication(int&amp;,char**,bool,int)" remove="all"/>
5283 <modify-function signature="QApplication(int&amp;,char**,bool,int)" remove="all"/>
5283 <modify-function signature="QApplication(int&amp;,char**,int)" remove="all"/>
5284 <modify-function signature="QApplication(int&amp;,char**,int)" remove="all"/>
5284 <modify-function signature="commitData(QSessionManager&amp;)" remove="all"/>
5285 <modify-function signature="commitData(QSessionManager&amp;)" remove="all"/>
5285 <modify-function signature="saveState(QSessionManager&amp;)" remove="all"/>
5286 <modify-function signature="saveState(QSessionManager&amp;)" remove="all"/>
5286 <modify-function signature="fontMetrics()" remove="all"/>
5287 <modify-function signature="fontMetrics()" remove="all"/>
5287 <modify-function signature="setFont(QFont,const char*)">
5288 <modify-function signature="setFont(QFont,const char*)">
5288 <modify-argument index="2">
5289 <modify-argument index="2">
5289 <replace-type modified-type="QString"/>
5290 <replace-type modified-type="QString"/>
5290 <conversion-rule class="native">
5291 <conversion-rule class="native">
5291 <insert-template name="core.convert_string_arg_to_char*"/>
5292 <insert-template name="core.convert_string_arg_to_char*"/>
5292 </conversion-rule>
5293 </conversion-rule>
5293 </modify-argument>
5294 </modify-argument>
5294 </modify-function>
5295 </modify-function>
5295 <modify-function signature="setPalette(QPalette,const char*)">
5296 <modify-function signature="setPalette(QPalette,const char*)">
5296 <modify-argument index="2">
5297 <modify-argument index="2">
5297 <replace-type modified-type="QString"/>
5298 <replace-type modified-type="QString"/>
5298 <conversion-rule class="native">
5299 <conversion-rule class="native">
5299 <insert-template name="core.convert_string_arg_to_char*"/>
5300 <insert-template name="core.convert_string_arg_to_char*"/>
5300 </conversion-rule>
5301 </conversion-rule>
5301 </modify-argument>
5302 </modify-argument>
5302 </modify-function>
5303 </modify-function>
5303 </object-type>
5304 </object-type>
5304
5305
5305 <object-type name="QMouseEventTransition"/>
5306 <object-type name="QMouseEventTransition"/>
5306 <object-type name="QKeyEventTransition"/>
5307 <object-type name="QKeyEventTransition"/>
5307 <value-type name="QQuaternion"/>
5308 <value-type name="QQuaternion"/>
5308
5309
5309 <object-type name="QCommandLinkButton"/>
5310 <object-type name="QCommandLinkButton"/>
5310 <object-type name="QFileSystemModel">
5311 <object-type name="QFileSystemModel">
5311 <modify-function signature="setIconProvider(QFileIconProvider*)">
5312 <modify-function signature="setIconProvider(QFileIconProvider*)">
5312 <modify-argument index="1">
5313 <modify-argument index="1">
5313 <reference-count action="set" variable-name="__rcIconProvider"/>
5314 <reference-count action="set" variable-name="__rcIconProvider"/>
5314 </modify-argument>
5315 </modify-argument>
5315 </modify-function>
5316 </modify-function>
5316 </object-type>
5317 </object-type>
5317 <object-type name="QFormLayout">
5318 <object-type name="QFormLayout">
5318 <modify-function signature="addRow(QWidget*,QWidget*)">
5319 <modify-function signature="addRow(QWidget*,QWidget*)">
5319 <modify-argument index="1">
5320 <modify-argument index="1">
5320 <reference-count action="ignore"/>
5321 <reference-count action="ignore"/>
5321 </modify-argument>
5322 </modify-argument>
5322 <modify-argument index="2">
5323 <modify-argument index="2">
5323 <reference-count action="ignore"/>
5324 <reference-count action="ignore"/>
5324 </modify-argument>
5325 </modify-argument>
5325 </modify-function>
5326 </modify-function>
5326 <modify-function signature="addRow(QLayout*)">
5327 <modify-function signature="addRow(QLayout*)">
5327 <modify-argument index="1">
5328 <modify-argument index="1">
5328 <reference-count action="ignore"/>
5329 <reference-count action="ignore"/>
5329 </modify-argument>
5330 </modify-argument>
5330 </modify-function>
5331 </modify-function>
5331 <modify-function signature="addRow(QWidget*,QLayout*)">
5332 <modify-function signature="addRow(QWidget*,QLayout*)">
5332 <modify-argument index="1">
5333 <modify-argument index="1">
5333 <reference-count action="ignore"/>
5334 <reference-count action="ignore"/>
5334 </modify-argument>
5335 </modify-argument>
5335 <modify-argument index="2">
5336 <modify-argument index="2">
5336 <reference-count action="ignore"/>
5337 <reference-count action="ignore"/>
5337 </modify-argument>
5338 </modify-argument>
5338 </modify-function>
5339 </modify-function>
5339
5340
5340 <modify-function signature="addRow(QWidget*)">
5341 <modify-function signature="addRow(QWidget*)">
5341 <modify-argument index="1">
5342 <modify-argument index="1">
5342 <reference-count action="ignore"/>
5343 <reference-count action="ignore"/>
5343 </modify-argument>
5344 </modify-argument>
5344 </modify-function>
5345 </modify-function>
5345 <modify-function signature="addRow(QString,QLayout*)">
5346 <modify-function signature="addRow(QString,QLayout*)">
5346 <modify-argument index="2">
5347 <modify-argument index="2">
5347 <reference-count action="ignore"/>
5348 <reference-count action="ignore"/>
5348 </modify-argument>
5349 </modify-argument>
5349 </modify-function>
5350 </modify-function>
5350 <modify-function signature="addRow(QString,QWidget*)">
5351 <modify-function signature="addRow(QString,QWidget*)">
5351 <modify-argument index="2">
5352 <modify-argument index="2">
5352 <reference-count action="ignore"/>
5353 <reference-count action="ignore"/>
5353 </modify-argument>
5354 </modify-argument>
5354 </modify-function>
5355 </modify-function>
5355 <modify-function signature="insertRow(int,QLayout*)">
5356 <modify-function signature="insertRow(int,QLayout*)">
5356 <modify-argument index="2">
5357 <modify-argument index="2">
5357 <reference-count action="ignore"/>
5358 <reference-count action="ignore"/>
5358 </modify-argument>
5359 </modify-argument>
5359 </modify-function>
5360 </modify-function>
5360 <modify-function signature="insertRow(int,QWidget*,QLayout*)">
5361 <modify-function signature="insertRow(int,QWidget*,QLayout*)">
5361 <modify-argument index="2">
5362 <modify-argument index="2">
5362 <reference-count action="ignore"/>
5363 <reference-count action="ignore"/>
5363 </modify-argument>
5364 </modify-argument>
5364 <modify-argument index="3">
5365 <modify-argument index="3">
5365 <reference-count action="ignore"/>
5366 <reference-count action="ignore"/>
5366 </modify-argument>
5367 </modify-argument>
5367 </modify-function>
5368 </modify-function>
5368 <modify-function signature="insertRow(int,QWidget*,QWidget*)">
5369 <modify-function signature="insertRow(int,QWidget*,QWidget*)">
5369 <modify-argument index="2">
5370 <modify-argument index="2">
5370 <reference-count action="ignore"/>
5371 <reference-count action="ignore"/>
5371 </modify-argument>
5372 </modify-argument>
5372 <modify-argument index="3">
5373 <modify-argument index="3">
5373 <reference-count action="ignore"/>
5374 <reference-count action="ignore"/>
5374 </modify-argument>
5375 </modify-argument>
5375 </modify-function>
5376 </modify-function>
5376 <modify-function signature="insertRow(int,QWidget*)">
5377 <modify-function signature="insertRow(int,QWidget*)">
5377 <modify-argument index="2">
5378 <modify-argument index="2">
5378 <reference-count action="ignore"/>
5379 <reference-count action="ignore"/>
5379 </modify-argument>
5380 </modify-argument>
5380 </modify-function>
5381 </modify-function>
5381 <modify-function signature="insertRow(int,QString,QLayout*)">
5382 <modify-function signature="insertRow(int,QString,QLayout*)">
5382 <modify-argument index="3">
5383 <modify-argument index="3">
5383 <reference-count action="ignore"/>
5384 <reference-count action="ignore"/>
5384 </modify-argument>
5385 </modify-argument>
5385 </modify-function>
5386 </modify-function>
5386 <modify-function signature="insertRow(int,QString,QWidget*)">
5387 <modify-function signature="insertRow(int,QString,QWidget*)">
5387 <modify-argument index="3">
5388 <modify-argument index="3">
5388 <reference-count action="ignore"/>
5389 <reference-count action="ignore"/>
5389 </modify-argument>
5390 </modify-argument>
5390 </modify-function>
5391 </modify-function>
5391 <modify-function signature="setLayout(int,QFormLayout::ItemRole,QLayout*)">
5392 <modify-function signature="setLayout(int,QFormLayout::ItemRole,QLayout*)">
5392 <modify-argument index="3">
5393 <modify-argument index="3">
5393 <reference-count action="ignore"/>
5394 <reference-count action="ignore"/>
5394 </modify-argument>
5395 </modify-argument>
5395 </modify-function>
5396 </modify-function>
5396 <modify-function signature="setWidget(int,QFormLayout::ItemRole,QWidget*)">
5397 <modify-function signature="setWidget(int,QFormLayout::ItemRole,QWidget*)">
5397 <modify-argument index="3">
5398 <modify-argument index="3">
5398 <reference-count action="ignore"/>
5399 <reference-count action="ignore"/>
5399 </modify-argument>
5400 </modify-argument>
5400 </modify-function>
5401 </modify-function>
5401 <modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)" access="private" rename="setItem_private">
5402 <modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)" access="private" rename="setItem_private">
5402 <modify-argument index="3">
5403 <modify-argument index="3">
5403 <define-ownership class="java" owner="c++"/>
5404 <define-ownership class="java" owner="c++"/>
5404 </modify-argument>
5405 </modify-argument>
5405 </modify-function>
5406 </modify-function>
5406 <modify-function signature="addItem(QLayoutItem*)">
5407 <modify-function signature="addItem(QLayoutItem*)">
5407 <modify-argument index="1">
5408 <modify-argument index="1">
5408 <define-ownership class="java" owner="c++"/>
5409 <define-ownership class="java" owner="c++"/>
5409 </modify-argument>
5410 </modify-argument>
5410 </modify-function>
5411 </modify-function>
5411 </object-type>
5412 </object-type>
5412 <object-type name="QGraphicsGridLayout" delete-in-main-thread="yes">
5413 <object-type name="QGraphicsGridLayout" delete-in-main-thread="yes">
5413 <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
5414 <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
5414 <modify-argument index="1">
5415 <modify-argument index="1">
5415 <reference-count action="add" variable-name="__rcItems"/>
5416 <reference-count action="add" variable-name="__rcItems"/>
5416 </modify-argument>
5417 </modify-argument>
5417 </modify-function>
5418 </modify-function>
5418 <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
5419 <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
5419 <modify-argument index="1">
5420 <modify-argument index="1">
5420 <reference-count action="add" variable-name="__rcItems"/>
5421 <reference-count action="add" variable-name="__rcItems"/>
5421 </modify-argument>
5422 </modify-argument>
5422 </modify-function>
5423 </modify-function>
5423 <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
5424 <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
5424 <modify-argument index="1">
5425 <modify-argument index="1">
5425 <reference-count action="ignore"/>
5426 <reference-count action="ignore"/>
5426 </modify-argument>
5427 </modify-argument>
5427 </modify-function>
5428 </modify-function>
5428 </object-type>
5429 </object-type>
5429 <object-type name="QGraphicsLayout" delete-in-main-thread="yes">
5430 <object-type name="QGraphicsLayout" delete-in-main-thread="yes">
5430
5431
5431 <modify-function signature="widgetEvent(QEvent*)">
5432 <modify-function signature="widgetEvent(QEvent*)">
5432 <modify-argument index="1" invalidate-after-use="yes"/>
5433 <modify-argument index="1" invalidate-after-use="yes"/>
5433 </modify-function>
5434 </modify-function>
5434 <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
5435 <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
5435 <modify-argument index="1">
5436 <modify-argument index="1">
5436 <reference-count action="set" variable-name="__rcParentLayoutItem"/>
5437 <reference-count action="set" variable-name="__rcParentLayoutItem"/>
5437 </modify-argument>
5438 </modify-argument>
5438 </modify-function>
5439 </modify-function>
5439 <modify-function signature="setGraphicsItem(QGraphicsItem*)">
5440 <modify-function signature="setGraphicsItem(QGraphicsItem*)">
5440 <modify-argument index="1">
5441 <modify-argument index="1">
5441 <reference-count action="set" variable-name="__rcItem"/>
5442 <reference-count action="set" variable-name="__rcItem"/>
5442 </modify-argument>
5443 </modify-argument>
5443 </modify-function>
5444 </modify-function>
5444 </object-type>
5445 </object-type>
5445 <interface-type name="QGraphicsLayoutItem" delete-in-main-thread="yes">
5446 <interface-type name="QGraphicsLayoutItem" delete-in-main-thread="yes">
5446 <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
5447 <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
5447 <modify-argument index="1">
5448 <modify-argument index="1">
5448 <reference-count action="set" variable-name="__rcParentLayoutItem"/>
5449 <reference-count action="set" variable-name="__rcParentLayoutItem"/>
5449 </modify-argument>
5450 </modify-argument>
5450 </modify-function>
5451 </modify-function>
5451 <modify-function signature="setGraphicsItem(QGraphicsItem*)">
5452 <modify-function signature="setGraphicsItem(QGraphicsItem*)">
5452 <modify-argument index="1">
5453 <modify-argument index="1">
5453 <reference-count action="set" variable-name="__rcItem"/>
5454 <reference-count action="set" variable-name="__rcItem"/>
5454 </modify-argument>
5455 </modify-argument>
5455 </modify-function>
5456 </modify-function>
5456 </interface-type>
5457 </interface-type>
5457 <object-type name="QGraphicsLinearLayout" delete-in-main-thread="yes">
5458 <object-type name="QGraphicsLinearLayout" delete-in-main-thread="yes">
5458 <modify-function signature="addItem(QGraphicsLayoutItem*)">
5459 <modify-function signature="addItem(QGraphicsLayoutItem*)">
5459 <modify-argument index="1">
5460 <modify-argument index="1">
5460 <reference-count action="add" variable-name="__rcItems"/>
5461 <reference-count action="add" variable-name="__rcItems"/>
5461 </modify-argument>
5462 </modify-argument>
5462 </modify-function>
5463 </modify-function>
5463 <modify-function signature="insertItem(int,QGraphicsLayoutItem*)">
5464 <modify-function signature="insertItem(int,QGraphicsLayoutItem*)">
5464 <modify-argument index="2">
5465 <modify-argument index="2">
5465 <reference-count action="add" variable-name="__rcItems"/>
5466 <reference-count action="add" variable-name="__rcItems"/>
5466 </modify-argument>
5467 </modify-argument>
5467 </modify-function>
5468 </modify-function>
5468 <modify-function signature="removeItem(QGraphicsLayoutItem*)">
5469 <modify-function signature="removeItem(QGraphicsLayoutItem*)">
5469 <modify-argument index="1">
5470 <modify-argument index="1">
5470 <reference-count action="remove" variable-name="__rcItems"/>
5471 <reference-count action="remove" variable-name="__rcItems"/>
5471 </modify-argument>
5472 </modify-argument>
5472 </modify-function>
5473 </modify-function>
5473 <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
5474 <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
5474 <modify-argument index="1">
5475 <modify-argument index="1">
5475 <reference-count action="ignore"/>
5476 <reference-count action="ignore"/>
5476 </modify-argument>
5477 </modify-argument>
5477 </modify-function>
5478 </modify-function>
5478 <modify-function signature="setStretchFactor(QGraphicsLayoutItem*,int)">
5479 <modify-function signature="setStretchFactor(QGraphicsLayoutItem*,int)">
5479 <modify-argument index="1">
5480 <modify-argument index="1">
5480 <reference-count action="ignore"/>
5481 <reference-count action="ignore"/>
5481 </modify-argument>
5482 </modify-argument>
5482 </modify-function>
5483 </modify-function>
5483 </object-type>
5484 </object-type>
5484 <object-type name="QGraphicsProxyWidget"/> <!-- a QObject so main-thread delete redundant -->
5485 <object-type name="QGraphicsProxyWidget"/> <!-- a QObject so main-thread delete redundant -->
5485 <object-type name="QGraphicsWidget"
5486 <object-type name="QGraphicsWidget"
5486 polymorphic-id-expression="%1-&gt;isWidget()">
5487 polymorphic-id-expression="%1-&gt;isWidget()">
5487 <!-- a QObject so main-thread delete redundant -->
5488 <!-- a QObject so main-thread delete redundant -->
5488 <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
5489 <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
5489 <modify-function signature="children()const" remove="all"/>
5490 <modify-function signature="children()const" remove="all"/>
5490 <modify-function signature="setLayout(QGraphicsLayout*)">
5491 <modify-function signature="setLayout(QGraphicsLayout*)">
5491 <modify-argument index="1">
5492 <modify-argument index="1">
5492 <reference-count action="set" variable-name="__rcLayout"/>
5493 <reference-count action="set" variable-name="__rcLayout"/>
5493 </modify-argument>
5494 </modify-argument>
5494 </modify-function>
5495 </modify-function>
5495
5496
5496 <modify-function signature="addAction(QAction*)">
5497 <modify-function signature="addAction(QAction*)">
5497 <modify-argument index="1">
5498 <modify-argument index="1">
5498 <reference-count action="add" variable-name="__rcActions"/>
5499 <reference-count action="add" variable-name="__rcActions"/>
5499 </modify-argument>
5500 </modify-argument>
5500 </modify-function>
5501 </modify-function>
5501 <modify-function signature="insertAction(QAction*,QAction*)">
5502 <modify-function signature="insertAction(QAction*,QAction*)">
5502 <modify-argument index="2">
5503 <modify-argument index="2">
5503 <reference-count action="add" variable-name="__rcActions"/>
5504 <reference-count action="add" variable-name="__rcActions"/>
5504 </modify-argument>
5505 </modify-argument>
5505 </modify-function>
5506 </modify-function>
5506 <modify-function signature="insertActions(QAction*,QList&lt;QAction*&gt;)">
5507 <modify-function signature="insertActions(QAction*,QList&lt;QAction*&gt;)">
5507 <modify-argument index="2">
5508 <modify-argument index="2">
5508 <reference-count action="add" variable-name="__rcActions"/>
5509 <reference-count action="add" variable-name="__rcActions"/>
5509 </modify-argument>
5510 </modify-argument>
5510 </modify-function>
5511 </modify-function>
5511 <modify-function signature="removeAction(QAction*)">
5512 <modify-function signature="removeAction(QAction*)">
5512 <modify-argument index="1">
5513 <modify-argument index="1">
5513 <reference-count action="remove" variable-name="__rcActions"/>
5514 <reference-count action="remove" variable-name="__rcActions"/>
5514 </modify-argument>
5515 </modify-argument>
5515 </modify-function>
5516 </modify-function>
5516
5517
5517
5518
5518 <modify-function signature="changeEvent(QEvent*)">
5519 <modify-function signature="changeEvent(QEvent*)">
5519 <modify-argument index="1" invalidate-after-use="yes"/>
5520 <modify-argument index="1" invalidate-after-use="yes"/>
5520 </modify-function>
5521 </modify-function>
5521 <modify-function signature="closeEvent(QCloseEvent*)">
5522 <modify-function signature="closeEvent(QCloseEvent*)">
5522 <modify-argument index="1" invalidate-after-use="yes"/>
5523 <modify-argument index="1" invalidate-after-use="yes"/>
5523 </modify-function>
5524 </modify-function>
5524 <modify-function signature="grabKeyboardEvent(QEvent*)">
5525 <modify-function signature="grabKeyboardEvent(QEvent*)">
5525 <modify-argument index="1" invalidate-after-use="yes"/>
5526 <modify-argument index="1" invalidate-after-use="yes"/>
5526 </modify-function>
5527 </modify-function>
5527 <modify-function signature="grabMouseEvent(QEvent*)">
5528 <modify-function signature="grabMouseEvent(QEvent*)">
5528 <modify-argument index="1" invalidate-after-use="yes"/>
5529 <modify-argument index="1" invalidate-after-use="yes"/>
5529 </modify-function>
5530 </modify-function>
5530 <modify-function signature="hideEvent(QHideEvent*)">
5531 <modify-function signature="hideEvent(QHideEvent*)">
5531 <modify-argument index="1" invalidate-after-use="yes"/>
5532 <modify-argument index="1" invalidate-after-use="yes"/>
5532 </modify-function>
5533 </modify-function>
5533 <modify-function signature="moveEvent(QGraphicsSceneMoveEvent*)">
5534 <modify-function signature="moveEvent(QGraphicsSceneMoveEvent*)">
5534 <modify-argument index="1" invalidate-after-use="yes"/>
5535 <modify-argument index="1" invalidate-after-use="yes"/>
5535 </modify-function>
5536 </modify-function>
5536 <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
5537 <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
5537 <modify-argument index="1" invalidate-after-use="yes"/>
5538 <modify-argument index="1" invalidate-after-use="yes"/>
5538 </modify-function>
5539 </modify-function>
5539 <modify-function signature="resizeEvent(QGraphicsSceneResizeEvent*)">
5540 <modify-function signature="resizeEvent(QGraphicsSceneResizeEvent*)">
5540 <modify-argument index="1" invalidate-after-use="yes"/>
5541 <modify-argument index="1" invalidate-after-use="yes"/>
5541 </modify-function>
5542 </modify-function>
5542 <modify-function signature="showEvent(QShowEvent*)">
5543 <modify-function signature="showEvent(QShowEvent*)">
5543 <modify-argument index="1" invalidate-after-use="yes"/>
5544 <modify-argument index="1" invalidate-after-use="yes"/>
5544 </modify-function>
5545 </modify-function>
5545 <modify-function signature="ungrabKeyboardEvent(QEvent*)">
5546 <modify-function signature="ungrabKeyboardEvent(QEvent*)">
5546 <modify-argument index="1" invalidate-after-use="yes"/>
5547 <modify-argument index="1" invalidate-after-use="yes"/>
5547 </modify-function>
5548 </modify-function>
5548 <modify-function signature="ungrabMouseEvent(QEvent*)">
5549 <modify-function signature="ungrabMouseEvent(QEvent*)">
5549 <modify-argument index="1" invalidate-after-use="yes"/>
5550 <modify-argument index="1" invalidate-after-use="yes"/>
5550 </modify-function>
5551 </modify-function>
5551 <modify-function signature="windowFrameEvent(QEvent*)">
5552 <modify-function signature="windowFrameEvent(QEvent*)">
5552 <modify-argument index="1" invalidate-after-use="yes"/>
5553 <modify-argument index="1" invalidate-after-use="yes"/>
5553 </modify-function>
5554 </modify-function>
5554
5555
5555 <modify-function signature="setStyle(QStyle*)">
5556 <modify-function signature="setStyle(QStyle*)">
5556 <modify-argument index="1">
5557 <modify-argument index="1">
5557 <reference-count action="set" variable-name="__rcStyle"/>
5558 <reference-count action="set" variable-name="__rcStyle"/>
5558 </modify-argument>
5559 </modify-argument>
5559 </modify-function>
5560 </modify-function>
5560 <modify-function signature="setTabOrder(QGraphicsWidget*,QGraphicsWidget*)">
5561 <modify-function signature="setTabOrder(QGraphicsWidget*,QGraphicsWidget*)">
5561 <modify-argument index="1">
5562 <modify-argument index="1">
5562 <reference-count action="ignore"/>
5563 <reference-count action="ignore"/>
5563 </modify-argument>
5564 </modify-argument>
5564 <modify-argument index="2">
5565 <modify-argument index="2">
5565 <reference-count action="ignore"/>
5566 <reference-count action="ignore"/>
5566 </modify-argument>
5567 </modify-argument>
5567 </modify-function>
5568 </modify-function>
5568 </object-type>
5569 </object-type>
5569 <object-type name="QPlainTextDocumentLayout"/>
5570 <object-type name="QPlainTextDocumentLayout"/>
5570 <object-type name="QPlainTextEdit">
5571 <object-type name="QPlainTextEdit">
5571 <modify-function signature="setDocument(QTextDocument*)">
5572 <modify-function signature="setDocument(QTextDocument*)">
5572 <modify-argument index="1">
5573 <modify-argument index="1">
5573 <reference-count action="set" variable-name="__rcDocument"/>
5574 <reference-count action="set" variable-name="__rcDocument"/>
5574 </modify-argument>
5575 </modify-argument>
5575 </modify-function>
5576 </modify-function>
5576 <modify-function signature="insertFromMimeData(const QMimeData*)">
5577 <modify-function signature="insertFromMimeData(const QMimeData*)">
5577 <modify-argument index="1">
5578 <modify-argument index="1">
5578 <reference-count action="ignore"/>
5579 <reference-count action="ignore"/>
5579 </modify-argument>
5580 </modify-argument>
5580 </modify-function>
5581 </modify-function>
5581 </object-type>
5582 </object-type>
5582 <object-type name="QPrintPreviewDialog">
5583 <object-type name="QPrintPreviewDialog">
5583 </object-type>
5584 </object-type>
5584 <object-type name="QPrintPreviewWidget"/>
5585 <object-type name="QPrintPreviewWidget"/>
5585 <object-type name="QStyledItemDelegate">
5586 <object-type name="QStyledItemDelegate">
5586 <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
5587 <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
5587 <modify-argument index="1">
5588 <modify-argument index="1">
5588 <reference-count action="set" variable-name="__rcItemEditorFactory"/>
5589 <reference-count action="set" variable-name="__rcItemEditorFactory"/>
5589 </modify-argument>
5590 </modify-argument>
5590 </modify-function>
5591 </modify-function>
5591 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
5592 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
5592 <modify-argument index="1">
5593 <modify-argument index="1">
5593 <reference-count action="ignore"/>
5594 <reference-count action="ignore"/>
5594 </modify-argument>
5595 </modify-argument>
5595 </modify-function>
5596 </modify-function>
5596 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
5597 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
5597 <modify-argument index="1">
5598 <modify-argument index="1">
5598 <reference-count action="ignore"/>
5599 <reference-count action="ignore"/>
5599 </modify-argument>
5600 </modify-argument>
5600 </modify-function>
5601 </modify-function>
5601 </object-type>
5602 </object-type>
5602
5603
5603 <interface-type name="QAccessibleFactoryInterface" java-name="QAbstractAccessibleFactory"/>
5604 <interface-type name="QAccessibleFactoryInterface" java-name="QAbstractAccessibleFactory"/>
5604 <interface-type name="QIconEngineFactoryInterfaceV2" java-name="QAbstractIconEngineFactoryV2"/>
5605 <interface-type name="QIconEngineFactoryInterfaceV2" java-name="QAbstractIconEngineFactoryV2"/>
5605 <interface-type name="QImageIOHandlerFactoryInterface" java-name="QAbstractImageIOHandlerFactory"/>
5606 <interface-type name="QImageIOHandlerFactoryInterface" java-name="QAbstractImageIOHandlerFactory"/>
5606 <interface-type name="QInputContextFactoryInterface" java-name="QAbstractInputContextFactory"/>
5607 <interface-type name="QInputContextFactoryInterface" java-name="QAbstractInputContextFactory"/>
5607 <interface-type name="QStyleFactoryInterface" java-name="QAbstractStyleFactory"/>
5608 <interface-type name="QStyleFactoryInterface" java-name="QAbstractStyleFactory"/>
5608 <interface-type name="QTextCodecFactoryInterface" java-name="QAbstractTextCodecFactory"/>
5609 <interface-type name="QTextCodecFactoryInterface" java-name="QAbstractTextCodecFactory"/>
5609 <interface-type name="QPictureFormatInterface" java-name="QAbstractPictureFormat"/>
5610 <interface-type name="QPictureFormatInterface" java-name="QAbstractPictureFormat"/>
5610
5611
5611 <object-type name="QIconEnginePluginV2"/>
5612 <object-type name="QIconEnginePluginV2"/>
5612 <object-type name="QAccessiblePlugin"/>
5613 <object-type name="QAccessiblePlugin"/>
5613 <object-type name="QImageIOPlugin"/>
5614 <object-type name="QImageIOPlugin"/>
5614 <object-type name="QInputContextPlugin"/>
5615 <object-type name="QInputContextPlugin"/>
5615 <object-type name="QPictureFormatPlugin"/>
5616 <object-type name="QPictureFormatPlugin"/>
5616 <object-type name="QStylePlugin"/>
5617 <object-type name="QStylePlugin"/>
5617 <object-type name="QTextCodecPlugin"/>
5618 <object-type name="QTextCodecPlugin"/>
5618 <object-type name="QGesture"/>
5619 <object-type name="QGesture"/>
5619 <object-type name="QTapGesture"/>
5620 <object-type name="QTapGesture"/>
5620 <object-type name="QTapAndHoldGesture"/>
5621 <object-type name="QTapAndHoldGesture"/>
5621 <object-type name="QGraphicsAnchorLayout"/>
5622 <object-type name="QGraphicsAnchorLayout"/>
5622 <object-type name="QGraphicsAnchor"/>
5623 <object-type name="QGraphicsAnchor"/>
5623 <object-type name="QGraphicsEffect"/>
5624 <object-type name="QGraphicsEffect"/>
5624 <object-type name="QStaticText"/>
5625 <object-type name="QStaticText"/>
5625 <object-type name="QGraphicsObject">
5626 <object-type name="QGraphicsObject">
5626 <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
5627 <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
5627 <modify-function signature="children()const" remove="all"/>
5628 <modify-function signature="children()const" remove="all"/>
5628 </object-type>
5629 </object-type>
5629 <object-type name="QGraphicsBlurEffect"/>
5630 <object-type name="QGraphicsBlurEffect"/>
5630 <object-type name="QGraphicsColorizeEffect"/>
5631 <object-type name="QGraphicsColorizeEffect"/>
5631 <object-type name="QGraphicsDropShadowEffect"/>
5632 <object-type name="QGraphicsDropShadowEffect"/>
5632 <object-type name="QGraphicsOpacityEffect"/>
5633 <object-type name="QGraphicsOpacityEffect"/>
5633 <object-type name="QGraphicsPixelizeEffect"/>
5634 <object-type name="QGraphicsPixelizeEffect"/>
5634 <object-type name="QGraphicsRotation"/>
5635 <object-type name="QGraphicsRotation"/>
5635 <object-type name="QGraphicsScale"/>
5636 <object-type name="QGraphicsScale"/>
5636 <object-type name="QGraphicsTransform"/>
5637 <object-type name="QGraphicsTransform"/>
5637 <object-type name="QPanGesture"/>
5638 <object-type name="QPanGesture"/>
5638 <object-type name="QPinchGesture"/>
5639 <object-type name="QPinchGesture"/>
5639 <object-type name="QProxyStyle"/>
5640 <object-type name="QProxyStyle"/>
5640 <object-type name="QSwipeGesture"/>
5641 <object-type name="QSwipeGesture"/>
5641 <object-type name="QTouchEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TouchBegin || %1-&gt;type() == QEvent::TouchUpdate || %1-&gt;type() == QEvent::TouchEnd"/>
5642 <object-type name="QTouchEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TouchBegin || %1-&gt;type() == QEvent::TouchUpdate || %1-&gt;type() == QEvent::TouchEnd"/>
5642
5643
5643 <!-- Inefficient hash codes -->
5644 <!-- Inefficient hash codes -->
5644 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFrame_iterator' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5645 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFrame_iterator' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5645 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextTableCell' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5646 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextTableCell' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5646 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextOption_Tab' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5647 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextOption_Tab' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5647 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextLength' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5648 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextLength' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5648 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock_iterator' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5649 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock_iterator' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5649 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5650 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5650 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextCursor' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5651 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextCursor' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5651 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath_Element' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5652 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath_Element' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5652 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5653 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5653 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QItemSelection' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5654 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QItemSelection' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5654 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QKeySequence' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5655 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QKeySequence' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5655 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSizePolicy' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5656 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSizePolicy' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5656 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFragment' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5657 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFragment' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5657 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetrics' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5658 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetrics' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5658 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGradient' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5659 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGradient' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5659 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetricsF' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5660 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetricsF' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5660 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5661 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5661 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QEasingCurve' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5662 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QEasingCurve' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5662 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGenericMatrix' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5663 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGenericMatrix' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5663 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMatrix4x4' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5664 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMatrix4x4' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5664 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMargins' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5665 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMargins' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5665 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPixmapCache_Key' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5666 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPixmapCache_Key' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5666 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector4D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5667 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector4D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5667 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QQuaternion' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5668 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QQuaternion' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5668 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector2D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5669 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector2D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5669 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector3D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5670 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector3D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5670
5671
5671 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QPanGesture'"/>
5672 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QPanGesture'"/>
5672 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'event(QEvent * event)' in 'QPanGesture'"/>
5673 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'event(QEvent * event)' in 'QPanGesture'"/>
5673 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QSwipeGesture'"/>
5674 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QSwipeGesture'"/>
5674 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QPinchGesture'"/>
5675 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QPinchGesture'"/>
5675 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'event(QEvent * event)' in 'QPinchGesture'"/>
5676 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'event(QEvent * event)' in 'QPinchGesture'"/>
5676
5677
5677 <!-- Intentional omissions. See explanation for QtJambiTextObjectInterface class in typesystem and headers. -->
5678 <!-- Intentional omissions. See explanation for QtJambiTextObjectInterface class in typesystem and headers. -->
5678 <suppress-warning text="WARNING(MetaJavaBuilder) :: class 'QTextObjectInterface' inherits from unknown base class 'QTextObjectInterface'"/>
5679 <suppress-warning text="WARNING(MetaJavaBuilder) :: class 'QTextObjectInterface' inherits from unknown base class 'QTextObjectInterface'"/>
5679 <suppress-warning text="WARNING(MetaJavaBuilder) :: unknown interface for 'QTextObjectInterface': 'QTextObjectInterfaceInterface'"/>
5680 <suppress-warning text="WARNING(MetaJavaBuilder) :: unknown interface for 'QTextObjectInterface': 'QTextObjectInterfaceInterface'"/>
5680
5681
5681 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QPixmapFilter' inherits from polymorphic class 'QPixmapFilter', but has no polymorphic id set"/>
5682 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QPixmapFilter' inherits from polymorphic class 'QPixmapFilter', but has no polymorphic id set"/>
5682 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::QPixmap', unmatched parameter type 'QPixmapData*'"/>
5683 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::QPixmap', unmatched parameter type 'QPixmapData*'"/>
5683 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
5684 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
5684 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
5685 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
5685 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private const\*'"/>
5686 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private const\*'"/>
5686 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextEngine\*'"/>
5687 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextEngine\*'"/>
5687 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QFontEngine\*'"/>
5688 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QFontEngine\*'"/>
5688 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPixmap::Type'"/>
5689 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPixmap::Type'"/>
5689 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QInputDialog::Type'"/>
5690 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QInputDialog::Type'"/>
5690 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextFrameLayoutData\*'"/>
5691 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextFrameLayoutData\*'"/>
5691 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractUndoItem\*'"/>
5692 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractUndoItem\*'"/>
5692 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*QImageTextKeyLang*'"/>
5693 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*QImageTextKeyLang*'"/>
5693 <suppress-warning text="WARNING(MetaJavaBuilder) :: non-public function '*' in interface '*'"/>
5694 <suppress-warning text="WARNING(MetaJavaBuilder) :: non-public function '*' in interface '*'"/>
5694 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
5695 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
5695 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
5696 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
5696 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVector&lt;FormatRange&gt;()' of argument in function '*', class '*'"/>
5697 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVector&lt;FormatRange&gt;()' of argument in function '*', class '*'"/>
5697 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVariantList()' of argument in function '*', class '*'"/>
5698 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVariantList()' of argument in function '*', class '*'"/>
5698 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
5699 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
5699 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QTextLayout::QTextLayout', unmatched parameter type 'QTextEngine*'"/>
5700 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QTextLayout::QTextLayout', unmatched parameter type 'QTextEngine*'"/>
5700 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value of argument in function 'doAction', class 'QAccessibleInterface'"/>
5701 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value of argument in function 'doAction', class 'QAccessibleInterface'"/>
5701 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFileDialog::QFileDialog', unmatched parameter type 'QFileDialogArgs const&amp;'"/>
5702 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFileDialog::QFileDialog', unmatched parameter type 'QFileDialogArgs const&amp;'"/>
5702 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '0., 0., 1000000000., 1000000000.' of argument in function 'update', class 'QAbstractTextDocumentLayout'"/>
5703 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '0., 0., 1000000000., 1000000000.' of argument in function 'update', class 'QAbstractTextDocumentLayout'"/>
5703 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::windowSurface', unmatched return type 'QWindowSurface*'"/>
5704 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::windowSurface', unmatched return type 'QWindowSurface*'"/>
5704 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::setWindowSurface', unmatched parameter type 'QWindowSurface*'"/>
5705 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::setWindowSurface', unmatched parameter type 'QWindowSurface*'"/>
5705 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QStyleOption::StyleOptionType' does not have a type entry or is not an enum"/>
5706 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QStyleOption::StyleOptionType' does not have a type entry or is not an enum"/>
5706 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~FlagMask in QMessageBox::StandardButton"/>
5707 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~FlagMask in QMessageBox::StandardButton"/>
5707 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~FlagMask"/>
5708 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~FlagMask"/>
5708 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QGraphicsSceneEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
5709 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QGraphicsSceneEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
5709 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QInputEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
5710 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QInputEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
5710 <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'com.trolltech.qt.gui.QMenu' but not both"/>
5711 <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'com.trolltech.qt.gui.QMenu' but not both"/>
5711 <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'com.trolltech.qt.gui.QMenuBar' but not both"/>
5712 <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcMenus' in 'com.trolltech.qt.gui.QMenuBar' but not both"/>
5712
5713
5713 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::pixmapData', unmatched return type 'QPixmapData*'"/>
5714 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::pixmapData', unmatched return type 'QPixmapData*'"/>
5714 <suppress-warning text="WARNING(MetaJavaBuilder) :: object type 'QAccessible' extended by interface type 'QAbstractAccessibleFactory'. The resulting API will be less expressive than the original."/>
5715 <suppress-warning text="WARNING(MetaJavaBuilder) :: object type 'QAccessible' extended by interface type 'QAbstractAccessibleFactory'. The resulting API will be less expressive than the original."/>
5715
5716
5716 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles"/>
5717 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles"/>
5717
5718
5718 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'QtSharedPointer' does not have a type entry"/>
5719 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'QtSharedPointer' does not have a type entry"/>
5719
5720
5720 </typesystem>
5721 </typesystem>
@@ -1,173 +1,174
1 <?xml version="1.0"?>
1 <?xml version="1.0"?>
2 <typesystem package="com.trolltech.qt.webkit">
2 <typesystem package="com.trolltech.qt.webkit">
3 <rejection class="WebCore"/>
3 <rejection class="WebCore"/>
4 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping field 'QWebPluginFactory_Plugin::mimeTypes' with unmatched type 'QList&lt;MimeType&gt;'"/>
4 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping field 'QWebPluginFactory_Plugin::mimeTypes' with unmatched type 'QList&lt;MimeType&gt;'"/>
5 <namespace-type name="WebCore"/>
5 <namespace-type name="WebCore"/>
6
6
7 <enum-type name="QWebSettings::FontFamily"/>
7 <enum-type name="QWebSettings::FontFamily"/>
8 <enum-type name="QWebSettings::FontSize"/>
8 <enum-type name="QWebSettings::FontSize"/>
9 <enum-type name="QWebSettings::WebGraphic"/>
9 <enum-type name="QWebSettings::WebGraphic"/>
10 <enum-type name="QWebSettings::WebAttribute">
10 <enum-type name="QWebSettings::WebAttribute">
11 <reject-enum-value name="LocalStorageEnabled"/>
11 <reject-enum-value name="LocalStorageEnabled"/>
12 </enum-type>
12 </enum-type>
13
13
14 <enum-type name="QWebFrame::RenderLayer"/>
14 <enum-type name="QWebFrame::RenderLayer"/>
15
15
16 <enum-type name="QWebPage::Feature"/>
16 <enum-type name="QWebPage::Feature"/>
17 <enum-type name="QWebPage::PermissionPolicy"/>
17 <enum-type name="QWebPage::PermissionPolicy"/>
18 <enum-type name="QWebPage::Extension"/>
18 <enum-type name="QWebPage::Extension"/>
19 <enum-type name="QWebPage::NavigationType"/>
19 <enum-type name="QWebPage::NavigationType"/>
20 <enum-type name="QWebPage::WebAction"/>
20 <enum-type name="QWebPage::WebAction"/>
21 <enum-type name="QWebPage::WebWindowType"/>
21 <enum-type name="QWebPage::WebWindowType"/>
22 <enum-type name="QWebPage::FindFlag" flags="QWebPage::FindFlags"/>
22 <enum-type name="QWebPage::FindFlag" flags="QWebPage::FindFlags"/>
23 <enum-type name="QWebPage::LinkDelegationPolicy"/>
23 <enum-type name="QWebPage::LinkDelegationPolicy"/>
24 <enum-type name="QWebPluginFactory::Extension"/>
24 <enum-type name="QWebPluginFactory::Extension"/>
25 <enum-type name="QWebElement::StyleResolveStrategy"/>
25 <enum-type name="QWebElement::StyleResolveStrategy"/>
26 <enum-type name="QWebHistory::HistoryStateVersion">
26 <enum-type name="QWebHistory::HistoryStateVersion">
27 <reject-enum-value name="DefaultHistoryVersion"/>
27 <reject-enum-value name="DefaultHistoryVersion"/>
28 </enum-type>
28 </enum-type>
29 <enum-type name="QWebPage::ErrorDomain"/>
29 <enum-type name="QWebPage::ErrorDomain"/>
30
30
31 <object-type name="QWebHistory"/>
31 <object-type name="QWebHistory"/>
32 <object-type name="QWebHistoryItem"/>
32 <object-type name="QWebHistoryItem"/>
33 <value-type name="QWebElementCollection"/>
33 <value-type name="QWebElementCollection"/>
34
34
35 <object-type name="QGraphicsWebView"/>
35 <object-type name="QGraphicsWebView"/>
36 <object-type name="QWebView">
36 <object-type name="QWebView">
37 <modify-function signature="setPage(QWebPage*)">
37 <modify-function signature="setPage(QWebPage*)">
38 <modify-argument index="1">
38 <modify-argument index="1">
39 <define-ownership class="java" owner="c++"/>
39 <define-ownership class="java" owner="c++"/>
40 </modify-argument>
40 </modify-argument>
41 </modify-function>
41 </modify-function>
42 </object-type>
42 </object-type>
43 <object-type name="QWebFrame">
43 <object-type name="QWebFrame">
44 <modify-function signature="addToJavaScriptWindowObject(QString,QObject*)">
44 <modify-function signature="addToJavaScriptWindowObject(QString,QObject*)">
45 <modify-argument index="2">
45 <modify-argument index="2">
46 <reference-count action="ignore"/>
46 <reference-count action="ignore"/>
47 </modify-argument>
47 </modify-argument>
48 </modify-function>
48 </modify-function>
49 <modify-function signature="event(QEvent*)" remove="all"/>
49 </object-type>
50 </object-type>
50 <object-type name="QWebPage::ExtensionOption"/>
51 <object-type name="QWebPage::ExtensionOption"/>
51 <object-type name="QWebPage::ChooseMultipleFilesExtensionOption"/>
52 <object-type name="QWebPage::ChooseMultipleFilesExtensionOption"/>
52 <object-type name="QWebPage::ExtensionReturn"/>
53 <object-type name="QWebPage::ExtensionReturn"/>
53 <object-type name="QWebPage::ChooseMultipleFilesExtensionReturn"/>
54 <object-type name="QWebPage::ChooseMultipleFilesExtensionReturn"/>
54 <object-type name="QWebHistory">
55 <object-type name="QWebHistory">
55 <modify-function signature="saveState(QWebHistory::HistoryStateVersion)const">
56 <modify-function signature="saveState(QWebHistory::HistoryStateVersion)const">
56 <modify-argument index="1"><remove-default-expression/></modify-argument>
57 <modify-argument index="1"><remove-default-expression/></modify-argument>
57 </modify-function>
58 </modify-function>
58 </object-type>
59 </object-type>
59 <object-type name="QWebSettings"/>
60 <object-type name="QWebSettings"/>
60 <object-type name="QWebPage">
61 <object-type name="QWebPage">
61 <modify-function signature="javaScriptPrompt(QWebFrame*,QString,QString,QString*)">
62 <modify-function signature="javaScriptPrompt(QWebFrame*,QString,QString,QString*)">
62 <access modifier="private"/>
63 <access modifier="private"/>
63 </modify-function>
64 </modify-function>
64 <modify-function signature="setView(QWidget*)">
65 <modify-function signature="setView(QWidget*)">
65 <modify-argument index="1">
66 <modify-argument index="1">
66 <reference-count action="set" variable-name="__rcView"/>
67 <reference-count action="set" variable-name="__rcView"/>
67 </modify-argument>
68 </modify-argument>
68 </modify-function>
69 </modify-function>
69 <modify-function signature="setNetworkAccessManager(QNetworkAccessManager*)">
70 <modify-function signature="setNetworkAccessManager(QNetworkAccessManager*)">
70 <modify-argument index="1">
71 <modify-argument index="1">
71 <define-ownership class="java" owner="c++"/>
72 <define-ownership class="java" owner="c++"/>
72 </modify-argument>
73 </modify-argument>
73 </modify-function>
74 </modify-function>
74 </object-type>
75 </object-type>
75
76
76 <value-type name="QWebHitTestResult">
77 <value-type name="QWebHitTestResult">
77 <modify-function signature="operator=(QWebHitTestResult)" remove="all"/>
78 <modify-function signature="operator=(QWebHitTestResult)" remove="all"/>
78 </value-type>
79 </value-type>
79
80
80 <value-type name="QWebHistoryItem">
81 <value-type name="QWebHistoryItem">
81 <custom-constructor>
82 <custom-constructor>
82 return new QWebHistoryItem(*copy);
83 return new QWebHistoryItem(*copy);
83 </custom-constructor>
84 </custom-constructor>
84 <custom-destructor>
85 <custom-destructor>
85 delete copy;
86 delete copy;
86 </custom-destructor>
87 </custom-destructor>
87 <modify-function signature="operator=(QWebHistoryItem)" remove="all"/>
88 <modify-function signature="operator=(QWebHistoryItem)" remove="all"/>
88 </value-type>
89 </value-type>
89
90
90 <object-type name="QWebHistoryInterface">
91 <object-type name="QWebHistoryInterface">
91 <modify-function signature="setDefaultInterface(QWebHistoryInterface*)">
92 <modify-function signature="setDefaultInterface(QWebHistoryInterface*)">
92 <modify-argument index="1">
93 <modify-argument index="1">
93 <reference-count action="set" variable-name="__rcInterface"/>
94 <reference-count action="set" variable-name="__rcInterface"/>
94 </modify-argument>
95 </modify-argument>
95 </modify-function>
96 </modify-function>
96 </object-type>
97 </object-type>
97
98
98 <object-type name="QWebPluginFactory"/>
99 <object-type name="QWebPluginFactory"/>
99 <object-type name="QWebPluginDatabase"/>
100 <object-type name="QWebPluginDatabase"/>
100 <object-type name="QWebInspector"/>
101 <object-type name="QWebInspector"/>
101
102
102 <value-type name="QWebPluginInfo"/>
103 <value-type name="QWebPluginInfo"/>
103 <value-type name="QWebElement"/>
104 <value-type name="QWebElement"/>
104 <value-type name="QWebPluginFactory::Plugin"/>
105 <value-type name="QWebPluginFactory::Plugin"/>
105 <value-type name="QWebPluginFactory::MimeType"/>
106 <value-type name="QWebPluginFactory::MimeType"/>
106 <value-type name="QWebSecurityOrigin">
107 <value-type name="QWebSecurityOrigin">
107 <custom-constructor>
108 <custom-constructor>
108 return new QWebSecurityOrigin(*copy);
109 return new QWebSecurityOrigin(*copy);
109 </custom-constructor>
110 </custom-constructor>
110 <custom-destructor>
111 <custom-destructor>
111 delete copy;
112 delete copy;
112 </custom-destructor>
113 </custom-destructor>
113 </value-type>
114 </value-type>
114 <value-type name="QWebDatabase">
115 <value-type name="QWebDatabase">
115 <custom-constructor>
116 <custom-constructor>
116 return new QWebDatabase(*copy);
117 return new QWebDatabase(*copy);
117 </custom-constructor>
118 </custom-constructor>
118 <custom-destructor>
119 <custom-destructor>
119 delete copy;
120 delete copy;
120 </custom-destructor>
121 </custom-destructor>
121 </value-type>
122 </value-type>
122 <object-type name="QWebPluginFactory::ExtensionOption"/>
123 <object-type name="QWebPluginFactory::ExtensionOption"/>
123 <object-type name="QWebPluginFactory::ExtensionReturn"/>
124 <object-type name="QWebPluginFactory::ExtensionReturn"/>
124 <object-type name="QWebPage::ErrorPageExtensionOption"/>
125 <object-type name="QWebPage::ErrorPageExtensionOption"/>
125 <object-type name="QWebPage::ErrorPageExtensionReturn"/>
126 <object-type name="QWebPage::ErrorPageExtensionReturn"/>
126
127
127 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebFrame::QWebFrame', unmatched parameter type 'QWebFrameData*'"/>
128 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebFrame::QWebFrame', unmatched parameter type 'QWebFrameData*'"/>
128 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebSettings::QWebSettings', unmatched parameter type 'WebCore::Settings*'"/>
129 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebSettings::QWebSettings', unmatched parameter type 'WebCore::Settings*'"/>
129 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebPluginInfo::QWebPluginInfo', unmatched parameter type 'WebCore::PluginPackage*'"/>
130 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebPluginInfo::QWebPluginInfo', unmatched parameter type 'WebCore::PluginPackage*'"/>
130 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::enclosingElement', unmatched parameter type 'WebCore::Node*'"/>
131 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::enclosingElement', unmatched parameter type 'WebCore::Node*'"/>
131 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::QWebElement', unmatched parameter type 'WebCore::Node*'"/>
132 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::QWebElement', unmatched parameter type 'WebCore::Node*'"/>
132 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::QWebElement', unmatched parameter type 'WebCore::Element*'"/>
133 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::QWebElement', unmatched parameter type 'WebCore::Element*'"/>
133 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping field 'QWebPluginFactory_Plugin::mimeTypes' with unmatched type 'QList&lt;MimeType&gt;'"/>
134 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping field 'QWebPluginFactory_Plugin::mimeTypes' with unmatched type 'QList&lt;MimeType&gt;'"/>
134 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QWebPluginInfo' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
135 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QWebPluginInfo' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
135 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QWebPluginFactory_MimeType' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
136 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QWebPluginFactory_MimeType' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
136 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QWebElement' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
137 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QWebElement' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
137
138
138 <!-- Needed to avoid warnings on compilers that don't support webkit -->
139 <!-- Needed to avoid warnings on compilers that don't support webkit -->
139 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::Plugin' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
140 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::Plugin' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
140 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::ExtensionReturn' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
141 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::ExtensionReturn' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
141 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::MimeType' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
142 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::MimeType' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
142 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'Extension' is not declared"/>
143 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'Extension' is not declared"/>
143 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::ExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
144 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::ExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
144 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPluginFactory' for enum 'Extension' is not declared"/>
145 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPluginFactory' for enum 'Extension' is not declared"/>
145 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
146 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
146 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'NavigationRequestResponse' is not declared"/>
147 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'NavigationRequestResponse' is not declared"/>
147 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'WebAttribute' is not declared"/>
148 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'WebAttribute' is not declared"/>
148 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebSettings' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
149 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebSettings' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
149 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryItem' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
150 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryItem' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
150 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
151 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
151 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'WebAction' is not declared"/>
152 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'WebAction' is not declared"/>
152 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontSize' is not declared"/>
153 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontSize' is not declared"/>
153 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'WebGraphic' is not declared"/>
154 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'WebGraphic' is not declared"/>
154 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'NavigationType' is not declared"/>
155 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'NavigationType' is not declared"/>
155 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontType' is not declared"/>
156 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontType' is not declared"/>
156 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebFrame' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
157 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebFrame' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
157 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistory' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
158 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistory' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
158 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebView' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
159 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebView' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
159 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
160 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
160 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHitTestResult' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
161 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHitTestResult' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
161 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'FindFlag' is not declared"/>
162 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'FindFlag' is not declared"/>
162 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'LinkDelegationPolicy' is not declared"/>
163 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'LinkDelegationPolicy' is not declared"/>
163 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontFamily' is not declared"/>
164 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontFamily' is not declared"/>
164 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'WebWindowType' is not declared"/>
165 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'WebWindowType' is not declared"/>
165 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebFrame::addToJavaScriptWindowObject', unmatched parameter type 'QScriptEngine::ValueOwnership'"/>
166 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebFrame::addToJavaScriptWindowObject', unmatched parameter type 'QScriptEngine::ValueOwnership'"/>
166 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebDatabase' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
167 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebDatabase' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
167 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ExtensionReturn' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
168 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ExtensionReturn' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
168 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
169 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
169 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ChooseMultipleFilesExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
170 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ChooseMultipleFilesExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
170 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebSecurityOrigin' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
171 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebSecurityOrigin' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
171 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ChooseMultipleFilesExtensionReturn' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
172 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ChooseMultipleFilesExtensionReturn' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
172
173
173 </typesystem>
174 </typesystem>
1 NO CONTENT: modified file chmod 100644 => 100755
NO CONTENT: modified file chmod 100644 => 100755
@@ -1,1604 +1,1604
1 <?xml version="1.0"?>
1 <?xml version="1.0"?>
2 <typesystem package="com.trolltech.qt.core">
2 <typesystem package="com.trolltech.qt.core">
3
3
4 <template name="core.prepare_removed_bool*_argument">
4 <template name="core.prepare_removed_bool*_argument">
5 bool __ok;
5 bool __ok;
6 bool *%out% = &amp;__ok;
6 bool *%out% = &amp;__ok;
7 </template>
7 </template>
8
8
9 <template name="core.convert_to_null_or_wrap">
9 <template name="core.convert_to_null_or_wrap">
10 QScriptValue %out%;
10 QScriptValue %out%;
11 if (!__ok)
11 if (!__ok)
12 %out% = context->engine()->nullValue();
12 %out% = context->engine()->nullValue();
13 else
13 else
14 %out% = qScriptValueFromValue(context->engine(), %in%);
14 %out% = qScriptValueFromValue(context->engine(), %in%);
15 </template>
15 </template>
16
16
17 <template name="core.convert_to_null_or_primitive">
17 <template name="core.convert_to_null_or_primitive">
18 QScriptValue %out%;
18 QScriptValue %out%;
19 if (!__ok)
19 if (!__ok)
20 %out% = context->engine()->nullValue();
20 %out% = context->engine()->nullValue();
21 else
21 else
22 %out% = QScriptValue(context->engine(), %in%);
22 %out% = QScriptValue(context->engine(), %in%);
23 </template>
23 </template>
24
24
25 <template name="core.convert_string_arg_to_latin1">
25 <template name="core.convert_string_arg_to_latin1">
26 QByteArray %out% = %in%.toString().toLatin1();
26 QByteArray %out% = %in%.toString().toLatin1();
27 </template>
27 </template>
28
28
29 <template name="core.convert_string_arg_to_char*">
29 <template name="core.convert_string_arg_to_char*">
30 QByteArray tmp_%out% = %in%.toString().toLatin1();
30 QByteArray tmp_%out% = %in%.toString().toLatin1();
31 const char * %out% = tmp_%out%.constData();
31 const char * %out% = tmp_%out%.constData();
32 </template>
32 </template>
33
33
34 <template name="core.convert_int_arg_and_check_range">
34 <template name="core.convert_int_arg_and_check_range">
35 int %out% = %in%.toInt32();
35 int %out% = %in%.toInt32();
36 if ((%out% &lt; 0) || (%this%-&gt;size() &lt; %out%)) {
36 if ((%out% &lt; 0) || (%this%-&gt;size() &lt; %out%)) {
37 return context->throwError(QScriptContext::RangeError,
37 return context->throwError(QScriptContext::RangeError,
38 QString::fromLatin1("%CLASS_NAME%::%FUNCTION_NAME%(): index out of range"));
38 QString::fromLatin1("%CLASS_NAME%::%FUNCTION_NAME%(): index out of range"));
39 }
39 }
40 </template>
40 </template>
41
41
42 <template name="core.convert_pointer_arg_and_check_null">
42 <template name="core.convert_pointer_arg_and_check_null">
43 %TYPE% %out% = qscriptvalue_cast&lt;%TYPE%&gt;(%in%);
43 %TYPE% %out% = qscriptvalue_cast&lt;%TYPE%&gt;(%in%);
44 if (!%out%) {
44 if (!%out%) {
45 return context->throwError(QScriptContext::TypeError,
45 return context->throwError(QScriptContext::TypeError,
46 QString::fromLatin1("%CLASS_NAME%::%FUNCTION_NAME%(): failed to convert argument to %TYPE%"));
46 QString::fromLatin1("%CLASS_NAME%::%FUNCTION_NAME%(): failed to convert argument to %TYPE%"));
47 }
47 }
48 </template>
48 </template>
49
49
50 <template name="core.convert_stringref_to_string">
50 <template name="core.convert_stringref_to_string">
51 QString %out% = %in%.toString();
51 QString %out% = %in%.toString();
52 </template>
52 </template>
53
53
54 <namespace-type name="Qt">
54 <namespace-type name="Qt">
55 <extra-includes>
55 <extra-includes>
56 <include file-name="QTextDocument" location="global"/>
56 <include file-name="QTextDocument" location="global"/>
57 </extra-includes>
57 </extra-includes>
58 </namespace-type>
58 </namespace-type>
59
59
60 <!-- classes that aren't deemed relevant to scripts -->
60 <!-- classes that aren't deemed relevant to scripts -->
61 <rejection class="QTextCodec::ConverterState"/>
61 <rejection class="QTextCodec::ConverterState"/>
62 <rejection class="QTextCodecFactoryInterface"/>
62 <rejection class="QTextCodecFactoryInterface"/>
63 <rejection class="QAbstractEventDispatcher"/>
63 <rejection class="QAbstractEventDispatcher"/>
64 <rejection class="QAbstractFileEngine"/>
64 <rejection class="QAbstractFileEngine"/>
65 <rejection class="QAbstractFileEngineHandler"/>
65 <rejection class="QAbstractFileEngineHandler"/>
66 <rejection class="QAbstractFileEngineIterator"/>
66 <rejection class="QAbstractFileEngineIterator"/>
67 <rejection class="QFSFileEngine"/>
67 <rejection class="QFSFileEngine"/>
68 <rejection class="QSystemLocale"/>
68 <rejection class="QSystemLocale"/>
69 <rejection class="QThread"/>
69 <rejection class="QThread"/>
70
70
71 <rejection class="QFutureWatcherBase"/>
71 <rejection class="QFutureWatcherBase"/>
72 <rejection class="QFutureSynchronizer"/> <!-- ### problem with shell class -->
72 <rejection class="QFutureSynchronizer"/> <!-- ### problem with shell class -->
73
73
74 <namespace-type name="QtConcurrent">
74 <namespace-type name="QtConcurrent">
75 <extra-includes>
75 <extra-includes>
76 <include file-name="qtconcurrentreducekernel.h" location="global"/>
76 <include file-name="qtconcurrentreducekernel.h" location="global"/>
77 <include file-name="qtconcurrentthreadengine.h" location="global"/>
77 <include file-name="qtconcurrentthreadengine.h" location="global"/>
78 </extra-includes>
78 </extra-includes>
79 </namespace-type>
79 </namespace-type>
80
80
81 <rejection class="QByteArray" function-name="contains"/>
81 <rejection class="QByteArray" function-name="contains"/>
82
82
83 <value-type name="QFileInfo">
83 <value-type name="QFileInfo">
84 <modify-function signature="QFileInfo(QFile)">
84 <modify-function signature="QFileInfo(QFile)">
85 <modify-argument index="1">
85 <modify-argument index="1">
86 <replace-type modified-type="QFile*"/>
86 <replace-type modified-type="QFile*"/>
87 <conversion-rule class="native">
87 <conversion-rule class="native">
88 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
88 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
89 </conversion-rule>
89 </conversion-rule>
90 </modify-argument>
90 </modify-argument>
91 </modify-function>
91 </modify-function>
92 <modify-function signature="setFile(QFile)">
92 <modify-function signature="setFile(QFile)">
93 <modify-argument index="1">
93 <modify-argument index="1">
94 <replace-type modified-type="QFile*"/>
94 <replace-type modified-type="QFile*"/>
95 <conversion-rule class="native">
95 <conversion-rule class="native">
96 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
96 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
97 </conversion-rule>
97 </conversion-rule>
98 </modify-argument>
98 </modify-argument>
99 </modify-function>
99 </modify-function>
100 </value-type>
100 </value-type>
101 <object-type name="QTemporaryFile">
101 <object-type name="QTemporaryFile">
102 <modify-function signature="createLocalFile(QFile&amp;)">
102 <modify-function signature="createLocalFile(QFile&amp;)">
103 <modify-argument index="1">
103 <modify-argument index="1">
104 <replace-type modified-type="QFile*"/>
104 <replace-type modified-type="QFile*"/>
105 <conversion-rule class="native">
105 <conversion-rule class="native">
106 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
106 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
107 </conversion-rule>
107 </conversion-rule>
108 </modify-argument>
108 </modify-argument>
109 </modify-function>
109 </modify-function>
110 </object-type>
110 </object-type>
111
111
112 <value-type name="QLocale">
112 <value-type name="QLocale">
113 <extra-includes>
113 <extra-includes>
114 <include file-name="QDate" location="global"/>
114 <include file-name="QDate" location="global"/>
115 </extra-includes>
115 </extra-includes>
116
116
117 <inject-code class="native" position="beginning">
117 <inject-code class="native" position="beginning">
118 Q_DECLARE_METATYPE(QScriptValue)
118 Q_DECLARE_METATYPE(QScriptValue)
119 </inject-code>
119 </inject-code>
120
120
121 <modify-function signature="toDouble(QString,bool*)const">
121 <modify-function signature="toDouble(QString,bool*)const">
122 <modify-argument index="2">
122 <modify-argument index="2">
123 <remove-default-expression/>
123 <remove-default-expression/>
124 <remove-argument/>
124 <remove-argument/>
125 <conversion-rule class="native">
125 <conversion-rule class="native">
126 <insert-template name="core.prepare_removed_bool*_argument"/>
126 <insert-template name="core.prepare_removed_bool*_argument"/>
127 </conversion-rule>
127 </conversion-rule>
128 </modify-argument>
128 </modify-argument>
129 <modify-argument index="return">
129 <modify-argument index="return">
130 <conversion-rule class="native">
130 <conversion-rule class="native">
131 <insert-template name="core.convert_to_null_or_primitive"/>
131 <insert-template name="core.convert_to_null_or_primitive"/>
132 </conversion-rule>
132 </conversion-rule>
133 </modify-argument>
133 </modify-argument>
134 </modify-function>
134 </modify-function>
135
135
136 <modify-function signature="toFloat(QString,bool*)const">
136 <modify-function signature="toFloat(QString,bool*)const">
137 <modify-argument index="2">
137 <modify-argument index="2">
138 <remove-default-expression/>
138 <remove-default-expression/>
139 <remove-argument/>
139 <remove-argument/>
140 <conversion-rule class="native">
140 <conversion-rule class="native">
141 <insert-template name="core.prepare_removed_bool*_argument"/>
141 <insert-template name="core.prepare_removed_bool*_argument"/>
142 </conversion-rule>
142 </conversion-rule>
143 </modify-argument>
143 </modify-argument>
144 <modify-argument index="return">
144 <modify-argument index="return">
145 <conversion-rule class="native">
145 <conversion-rule class="native">
146 <insert-template name="core.convert_to_null_or_primitive"/>
146 <insert-template name="core.convert_to_null_or_primitive"/>
147 </conversion-rule>
147 </conversion-rule>
148 </modify-argument>
148 </modify-argument>
149 </modify-function>
149 </modify-function>
150
150
151 <modify-function signature="toInt(QString,bool*,int)const">
151 <modify-function signature="toInt(QString,bool*,int)const">
152 <modify-argument index="2">
152 <modify-argument index="2">
153 <remove-default-expression/>
153 <remove-default-expression/>
154 <remove-argument/>
154 <remove-argument/>
155 <conversion-rule class="native">
155 <conversion-rule class="native">
156 <insert-template name="core.prepare_removed_bool*_argument"/>
156 <insert-template name="core.prepare_removed_bool*_argument"/>
157 </conversion-rule>
157 </conversion-rule>
158 </modify-argument>
158 </modify-argument>
159 <modify-argument index="return">
159 <modify-argument index="return">
160 <conversion-rule class="native">
160 <conversion-rule class="native">
161 <insert-template name="core.convert_to_null_or_primitive"/>
161 <insert-template name="core.convert_to_null_or_primitive"/>
162 </conversion-rule>
162 </conversion-rule>
163 </modify-argument>
163 </modify-argument>
164 </modify-function>
164 </modify-function>
165
165
166 <modify-function signature="toLongLong(QString,bool*,int)const">
166 <modify-function signature="toLongLong(QString,bool*,int)const">
167 <modify-argument index="2">
167 <modify-argument index="2">
168 <remove-default-expression/>
168 <remove-default-expression/>
169 <remove-argument/>
169 <remove-argument/>
170 <conversion-rule class="native">
170 <conversion-rule class="native">
171 <insert-template name="core.prepare_removed_bool*_argument"/>
171 <insert-template name="core.prepare_removed_bool*_argument"/>
172 </conversion-rule>
172 </conversion-rule>
173 </modify-argument>
173 </modify-argument>
174 <modify-argument index="return">
174 <modify-argument index="return">
175 <conversion-rule class="native">
175 <conversion-rule class="native">
176 QScriptValue %out%;
176 QScriptValue %out%;
177 if (!__ok)
177 if (!__ok)
178 %out% = context->engine()->nullValue();
178 %out% = context->engine()->nullValue();
179 else
179 else
180 %out% = QScriptValue(context->engine(), double(%in%)).toObject();
180 %out% = QScriptValue(context->engine(), double(%in%)).toObject();
181 </conversion-rule>
181 </conversion-rule>
182 </modify-argument>
182 </modify-argument>
183 </modify-function>
183 </modify-function>
184
184
185 <modify-function signature="toShort(QString,bool*,int)const">
185 <modify-function signature="toShort(QString,bool*,int)const">
186 <modify-argument index="2">
186 <modify-argument index="2">
187 <remove-default-expression/>
187 <remove-default-expression/>
188 <remove-argument/>
188 <remove-argument/>
189 <conversion-rule class="native">
189 <conversion-rule class="native">
190 <insert-template name="core.prepare_removed_bool*_argument"/>
190 <insert-template name="core.prepare_removed_bool*_argument"/>
191 </conversion-rule>
191 </conversion-rule>
192 </modify-argument>
192 </modify-argument>
193 <modify-argument index="return">
193 <modify-argument index="return">
194 <conversion-rule class="native">
194 <conversion-rule class="native">
195 <insert-template name="core.convert_to_null_or_primitive"/>
195 <insert-template name="core.convert_to_null_or_primitive"/>
196 </conversion-rule>
196 </conversion-rule>
197 </modify-argument>
197 </modify-argument>
198 </modify-function>
198 </modify-function>
199
199
200 <modify-function signature="toUShort(QString,bool*,int)const">
200 <modify-function signature="toUShort(QString,bool*,int)const">
201 <modify-argument index="2">
201 <modify-argument index="2">
202 <remove-default-expression/>
202 <remove-default-expression/>
203 <remove-argument/>
203 <remove-argument/>
204 <conversion-rule class="native">
204 <conversion-rule class="native">
205 <insert-template name="core.prepare_removed_bool*_argument"/>
205 <insert-template name="core.prepare_removed_bool*_argument"/>
206 </conversion-rule>
206 </conversion-rule>
207 </modify-argument>
207 </modify-argument>
208 <modify-argument index="return">
208 <modify-argument index="return">
209 <conversion-rule class="native">
209 <conversion-rule class="native">
210 <insert-template name="core.convert_to_null_or_primitive"/>
210 <insert-template name="core.convert_to_null_or_primitive"/>
211 </conversion-rule>
211 </conversion-rule>
212 </modify-argument>
212 </modify-argument>
213 </modify-function>
213 </modify-function>
214 </value-type>
214 </value-type>
215
215
216 <!-- object-type name="QAbstractEventDispatcher">
216 <!-- object-type name="QAbstractEventDispatcher">
217 <extra-includes>
217 <extra-includes>
218 <include file-name="QPair" location="global"/>
218 <include file-name="QPair" location="global"/>
219 </extra-includes>
219 </extra-includes>
220 </object-type -->
220 </object-type -->
221
221
222 <value-type name="QBitArray">
222 <value-type name="QBitArray">
223 <modify-function signature="at(int)const">
223 <modify-function signature="at(int)const">
224 <modify-argument index="1">
224 <modify-argument index="1">
225 <conversion-rule class="native">
225 <conversion-rule class="native">
226 <insert-template name="core.convert_int_arg_and_check_range">
226 <insert-template name="core.convert_int_arg_and_check_range">
227 <replace from="%CLASS_NAME%" to="QBitArray"/>
227 <replace from="%CLASS_NAME%" to="QBitArray"/>
228 <replace from="%FUNCTION_NAME%" to="at"/>
228 <replace from="%FUNCTION_NAME%" to="at"/>
229 </insert-template>
229 </insert-template>
230 </conversion-rule>
230 </conversion-rule>
231 </modify-argument>
231 </modify-argument>
232 </modify-function>
232 </modify-function>
233
233
234 <modify-function signature="clearBit(int)">
234 <modify-function signature="clearBit(int)">
235 <modify-argument index="1">
235 <modify-argument index="1">
236 <conversion-rule class="native">
236 <conversion-rule class="native">
237 <insert-template name="core.convert_int_arg_and_check_range">
237 <insert-template name="core.convert_int_arg_and_check_range">
238 <replace from="%CLASS_NAME%" to="QBitArray"/>
238 <replace from="%CLASS_NAME%" to="QBitArray"/>
239 <replace from="%FUNCTION_NAME%" to="clearBit"/>
239 <replace from="%FUNCTION_NAME%" to="clearBit"/>
240 </insert-template>
240 </insert-template>
241 </conversion-rule>
241 </conversion-rule>
242 </modify-argument>
242 </modify-argument>
243 </modify-function>
243 </modify-function>
244
244
245 <modify-function signature="setBit(int)">
245 <modify-function signature="setBit(int)">
246 <modify-argument index="1">
246 <modify-argument index="1">
247 <conversion-rule class="native">
247 <conversion-rule class="native">
248 <insert-template name="core.convert_int_arg_and_check_range">
248 <insert-template name="core.convert_int_arg_and_check_range">
249 <replace from="%CLASS_NAME%" to="QBitArray"/>
249 <replace from="%CLASS_NAME%" to="QBitArray"/>
250 <replace from="%FUNCTION_NAME%" to="setBit"/>
250 <replace from="%FUNCTION_NAME%" to="setBit"/>
251 </insert-template>
251 </insert-template>
252 </conversion-rule>
252 </conversion-rule>
253 </modify-argument>
253 </modify-argument>
254 </modify-function>
254 </modify-function>
255
255
256 <modify-function signature="setBit(int,bool)">
256 <modify-function signature="setBit(int,bool)">
257 <modify-argument index="1">
257 <modify-argument index="1">
258 <conversion-rule class="native">
258 <conversion-rule class="native">
259 <insert-template name="core.convert_int_arg_and_check_range">
259 <insert-template name="core.convert_int_arg_and_check_range">
260 <replace from="%CLASS_NAME%" to="QBitArray"/>
260 <replace from="%CLASS_NAME%" to="QBitArray"/>
261 <replace from="%FUNCTION_NAME%" to="setBit"/>
261 <replace from="%FUNCTION_NAME%" to="setBit"/>
262 </insert-template>
262 </insert-template>
263 </conversion-rule>
263 </conversion-rule>
264 </modify-argument>
264 </modify-argument>
265 </modify-function>
265 </modify-function>
266
266
267 <modify-function signature="testBit(int)const">
267 <modify-function signature="testBit(int)const">
268 <modify-argument index="1">
268 <modify-argument index="1">
269 <conversion-rule class="native">
269 <conversion-rule class="native">
270 <insert-template name="core.convert_int_arg_and_check_range">
270 <insert-template name="core.convert_int_arg_and_check_range">
271 <replace from="%CLASS_NAME%" to="QBitArray"/>
271 <replace from="%CLASS_NAME%" to="QBitArray"/>
272 <replace from="%FUNCTION_NAME%" to="testBit"/>
272 <replace from="%FUNCTION_NAME%" to="testBit"/>
273 </insert-template>
273 </insert-template>
274 </conversion-rule>
274 </conversion-rule>
275 </modify-argument>
275 </modify-argument>
276 </modify-function>
276 </modify-function>
277
277
278 <modify-function signature="toggleBit(int)">
278 <modify-function signature="toggleBit(int)">
279 <modify-argument index="1">
279 <modify-argument index="1">
280 <conversion-rule class="native">
280 <conversion-rule class="native">
281 <insert-template name="core.convert_int_arg_and_check_range">
281 <insert-template name="core.convert_int_arg_and_check_range">
282 <replace from="%CLASS_NAME%" to="QBitArray"/>
282 <replace from="%CLASS_NAME%" to="QBitArray"/>
283 <replace from="%FUNCTION_NAME%" to="toggleBit"/>
283 <replace from="%FUNCTION_NAME%" to="toggleBit"/>
284 </insert-template>
284 </insert-template>
285 </conversion-rule>
285 </conversion-rule>
286 </modify-argument>
286 </modify-argument>
287 </modify-function>
287 </modify-function>
288
288
289 <modify-function signature="operator&amp;=(QBitArray)">
289 <modify-function signature="operator&amp;=(QBitArray)">
290 <modify-argument index="0" replace-value="this"/>
290 <modify-argument index="0" replace-value="this"/>
291 </modify-function>
291 </modify-function>
292 <modify-function signature="operator=(QBitArray)">
292 <modify-function signature="operator=(QBitArray)">
293 <modify-argument index="0" replace-value="this"/>
293 <modify-argument index="0" replace-value="this"/>
294 </modify-function>
294 </modify-function>
295 <modify-function signature="operator^=(QBitArray)">
295 <modify-function signature="operator^=(QBitArray)">
296 <modify-argument index="0" replace-value="this"/>
296 <modify-argument index="0" replace-value="this"/>
297 </modify-function>
297 </modify-function>
298 <modify-function signature="operator|=(QBitArray)">
298 <modify-function signature="operator|=(QBitArray)">
299 <modify-argument index="0" replace-value="this"/>
299 <modify-argument index="0" replace-value="this"/>
300 </modify-function>
300 </modify-function>
301 </value-type>
301 </value-type>
302
302
303 <object-type name="QBuffer">
303 <object-type name="QBuffer">
304 <!-- ### modify to return value by pointer? -->
304 <!-- ### modify to return value by pointer? -->
305 <modify-function signature="buffer()const" remove="all"/>
305 <modify-function signature="buffer()const" remove="all"/>
306 <modify-function signature="data()const" remove="all"/>
306 <modify-function signature="data()const" remove="all"/>
307
307
308 <modify-function signature="setData(const char*,int)" remove="all"/>
308 <modify-function signature="setData(const char*,int)" remove="all"/>
309 </object-type>
309 </object-type>
310
310
311 <object-type name="QCoreApplication">
311 <object-type name="QCoreApplication">
312 <modify-function signature="QCoreApplication(int &amp;, char **)" remove="all"/>
312 <modify-function signature="QCoreApplication(int &amp;, char **)" remove="all"/>
313 <!-- ### arguments() causes a warning: "QScriptValue::setProperty(arguments): cannot change flags of a native property" -->
313 <!-- ### arguments() causes a warning: "QScriptValue::setProperty(arguments): cannot change flags of a native property" -->
314 <modify-function signature="arguments()" remove="all"/>
314 <modify-function signature="arguments()" remove="all"/>
315 <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding,int)">
315 <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding,int)">
316 <modify-argument index="1">
316 <modify-argument index="1">
317 <replace-type modified-type="QString"/>
317 <replace-type modified-type="QString"/>
318 <conversion-rule class="native">
318 <conversion-rule class="native">
319 <insert-template name="core.convert_string_arg_to_char*"/>
319 <insert-template name="core.convert_string_arg_to_char*"/>
320 </conversion-rule>
320 </conversion-rule>
321 </modify-argument>
321 </modify-argument>
322 <modify-argument index="2">
322 <modify-argument index="2">
323 <replace-type modified-type="QString"/>
323 <replace-type modified-type="QString"/>
324 <conversion-rule class="native">
324 <conversion-rule class="native">
325 <insert-template name="core.convert_string_arg_to_char*"/>
325 <insert-template name="core.convert_string_arg_to_char*"/>
326 </conversion-rule>
326 </conversion-rule>
327 </modify-argument>
327 </modify-argument>
328 <modify-argument index="3">
328 <modify-argument index="3">
329 <replace-type modified-type="QString"/>
329 <replace-type modified-type="QString"/>
330 <conversion-rule class="native">
330 <conversion-rule class="native">
331 <insert-template name="core.convert_string_arg_to_char*"/>
331 <insert-template name="core.convert_string_arg_to_char*"/>
332 </conversion-rule>
332 </conversion-rule>
333 </modify-argument>
333 </modify-argument>
334 </modify-function>
334 </modify-function>
335 <modify-function signature="translate(const char *,const char *,const char *,QCoreApplication::Encoding)">
335 <modify-function signature="translate(const char *,const char *,const char *,QCoreApplication::Encoding)">
336 <modify-argument index="1">
336 <modify-argument index="1">
337 <replace-type modified-type="QString"/>
337 <replace-type modified-type="QString"/>
338 <conversion-rule class="native">
338 <conversion-rule class="native">
339 <insert-template name="core.convert_string_arg_to_char*"/>
339 <insert-template name="core.convert_string_arg_to_char*"/>
340 </conversion-rule>
340 </conversion-rule>
341 </modify-argument>
341 </modify-argument>
342 <modify-argument index="2">
342 <modify-argument index="2">
343 <replace-type modified-type="QString"/>
343 <replace-type modified-type="QString"/>
344 <conversion-rule class="native">
344 <conversion-rule class="native">
345 <insert-template name="core.convert_string_arg_to_char*"/>
345 <insert-template name="core.convert_string_arg_to_char*"/>
346 </conversion-rule>
346 </conversion-rule>
347 </modify-argument>
347 </modify-argument>
348 <modify-argument index="3">
348 <modify-argument index="3">
349 <replace-type modified-type="QString"/>
349 <replace-type modified-type="QString"/>
350 <conversion-rule class="native">
350 <conversion-rule class="native">
351 <insert-template name="core.convert_string_arg_to_char*"/>
351 <insert-template name="core.convert_string_arg_to_char*"/>
352 </conversion-rule>
352 </conversion-rule>
353 </modify-argument>
353 </modify-argument>
354 </modify-function>
354 </modify-function>
355
355
356 </object-type>
356 </object-type>
357
357
358 <value-type name="QByteArray">
358 <value-type name="QByteArray">
359 <inject-code class="pywrap-h">
359 <inject-code class="pywrap-h">
360 PyObject* data(QByteArray* b) {
360 PyObject* data(QByteArray* b) {
361 if (b->data()) {
361 if (b->data()) {
362 #ifdef PY3K
362 #ifdef PY3K
363 return PyUnicode_FromStringAndSize(b-&gt;data(), b-&gt;size());
363 return PyUnicode_FromStringAndSize(b-&gt;data(), b-&gt;size());
364 #else
364 #else
365 return PyString_FromStringAndSize(b-&gt;data(), b-&gt;size());
365 return PyString_FromStringAndSize(b-&gt;data(), b-&gt;size());
366 #endif
366 #endif
367 } else {
367 } else {
368 Py_INCREF(Py_None);
368 Py_INCREF(Py_None);
369 return Py_None;
369 return Py_None;
370 }
370 }
371 }
371 }
372 </inject-code>
372 </inject-code>
373
373
374 <inject-code class="native" position="beginning">
374 <inject-code class="native" position="beginning">
375 Q_DECLARE_METATYPE(QScriptValue)
375 Q_DECLARE_METATYPE(QScriptValue)
376 </inject-code>
376 </inject-code>
377
377
378
378
379 <modify-function signature="QByteArray(const char*,int)" remove="all"/>
379 <modify-function signature="QByteArray(const char*,int)" remove="all"/>
380 <modify-function signature="QByteArray(const char*)" remove="all"/>
380 <modify-function signature="QByteArray(const char*)" remove="all"/>
381
381
382 <modify-function signature="at(int)const">
382 <modify-function signature="at(int)const">
383 <modify-argument index="1">
383 <modify-argument index="1">
384 <conversion-rule class="native">
384 <conversion-rule class="native">
385 <insert-template name="core.convert_int_arg_and_check_range">
385 <insert-template name="core.convert_int_arg_and_check_range">
386 <replace from="%CLASS_NAME%" to="QByteArray"/>
386 <replace from="%CLASS_NAME%" to="QByteArray"/>
387 <replace from="%FUNCTION_NAME%" to="at"/>
387 <replace from="%FUNCTION_NAME%" to="at"/>
388 </insert-template>
388 </insert-template>
389 </conversion-rule>
389 </conversion-rule>
390 </modify-argument>
390 </modify-argument>
391 </modify-function>
391 </modify-function>
392
392
393 <modify-function signature="append(const char *)" remove="all"/>
393 <modify-function signature="append(const char *)" remove="all"/>
394 <modify-function signature="append(QByteArray)">
394 <modify-function signature="append(QByteArray)">
395 <modify-argument index="0" replace-value="this"/>
395 <modify-argument index="0" replace-value="this"/>
396 </modify-function>
396 </modify-function>
397 <modify-function signature="append(QString)">
397 <modify-function signature="append(QString)">
398 <modify-argument index="0" replace-value="this"/>
398 <modify-argument index="0" replace-value="this"/>
399 </modify-function>
399 </modify-function>
400 <modify-function signature="append(const char *)" remove="all">
400 <modify-function signature="append(const char *)" remove="all">
401 <modify-argument index="0" replace-value="this"/>
401 <modify-argument index="0" replace-value="this"/>
402 </modify-function>
402 </modify-function>
403 <modify-function signature="append(char)">
403 <modify-function signature="append(char)">
404 <modify-argument index="0" replace-value="this"/>
404 <modify-argument index="0" replace-value="this"/>
405 <rename to="appendByte"/>
405 <rename to="appendByte"/>
406 </modify-function>
406 </modify-function>
407
407
408 <modify-function signature="count(const char *)const" remove="all"/>
408 <modify-function signature="count(const char *)const" remove="all"/>
409
409
410 <modify-function signature="data()" remove="all"/>
410 <modify-function signature="data()" remove="all"/>
411
411
412 <modify-function signature="endsWith(const char *)const" remove="all"/>
412 <modify-function signature="endsWith(const char *)const" remove="all"/>
413
413
414 <modify-function signature="fill(char,int)">
414 <modify-function signature="fill(char,int)">
415 <modify-argument index="0" replace-value="this"/>
415 <modify-argument index="0" replace-value="this"/>
416 </modify-function>
416 </modify-function>
417
417
418 <modify-function signature="indexOf(const char*,int)const" remove="all"/>
418 <modify-function signature="indexOf(const char*,int)const" remove="all"/>
419 <modify-function signature="indexOf(char,int)const">
419 <modify-function signature="indexOf(char,int)const">
420 <rename to="indexOfByte"/>
420 <rename to="indexOfByte"/>
421 </modify-function>
421 </modify-function>
422
422
423 <modify-function signature="insert(int,QByteArray)">
423 <modify-function signature="insert(int,QByteArray)">
424 <modify-argument index="0" replace-value="this"/>
424 <modify-argument index="0" replace-value="this"/>
425 </modify-function>
425 </modify-function>
426 <modify-function signature="insert(int,QString)">
426 <modify-function signature="insert(int,QString)">
427 <modify-argument index="0" replace-value="this"/>
427 <modify-argument index="0" replace-value="this"/>
428 </modify-function>
428 </modify-function>
429 <modify-function signature="insert(int,const char *)" remove="all"/>
429 <modify-function signature="insert(int,const char *)" remove="all"/>
430 <modify-function signature="insert(int,char)">
430 <modify-function signature="insert(int,char)">
431 <modify-argument index="0" replace-value="this"/>
431 <modify-argument index="0" replace-value="this"/>
432 <rename to="insertByte"/>
432 <rename to="insertByte"/>
433 </modify-function>
433 </modify-function>
434
434
435 <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/>
435 <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/>
436 <modify-function signature="lastIndexOf(char,int)const">
436 <modify-function signature="lastIndexOf(char,int)const">
437 <rename to="lastIndexOfByte"/>
437 <rename to="lastIndexOfByte"/>
438 </modify-function>
438 </modify-function>
439
439
440 <modify-function signature="prepend(QByteArray)">
440 <modify-function signature="prepend(QByteArray)">
441 <modify-argument index="0" replace-value="this"/>
441 <modify-argument index="0" replace-value="this"/>
442 </modify-function>
442 </modify-function>
443 <modify-function signature="prepend(const char *)" remove="all"/>
443 <modify-function signature="prepend(const char *)" remove="all"/>
444 <modify-function signature="prepend(char)">
444 <modify-function signature="prepend(char)">
445 <modify-argument index="0" replace-value="this"/>
445 <modify-argument index="0" replace-value="this"/>
446 <rename to="prependByte"/>
446 <rename to="prependByte"/>
447 </modify-function>
447 </modify-function>
448
448
449 <modify-function signature="remove(int,int)">
449 <modify-function signature="remove(int,int)">
450 <modify-argument index="0" replace-value="this"/>
450 <modify-argument index="0" replace-value="this"/>
451 </modify-function>
451 </modify-function>
452
452
453 <modify-function signature="replace(int,int,QByteArray)">
453 <modify-function signature="replace(int,int,QByteArray)">
454 <modify-argument index="0" replace-value="this"/>
454 <modify-argument index="0" replace-value="this"/>
455 </modify-function>
455 </modify-function>
456 <modify-function signature="replace(int,int,const char *)" remove="all"/>
456 <modify-function signature="replace(int,int,const char *)" remove="all"/>
457 <modify-function signature="replace(QByteArray,QByteArray)">
457 <modify-function signature="replace(QByteArray,QByteArray)">
458 <modify-argument index="0" replace-value="this"/>
458 <modify-argument index="0" replace-value="this"/>
459 </modify-function>
459 </modify-function>
460 <modify-function signature="replace(const char*,QByteArray)" remove="all"/>
460 <modify-function signature="replace(const char*,QByteArray)" remove="all"/>
461 <modify-function signature="replace(QByteArray,const char *)" remove="all"/>
461 <modify-function signature="replace(QByteArray,const char *)" remove="all"/>
462 <modify-function signature="replace(QString,QByteArray)">
462 <modify-function signature="replace(QString,QByteArray)">
463 <modify-argument index="0" replace-value="this"/>
463 <modify-argument index="0" replace-value="this"/>
464 </modify-function>
464 </modify-function>
465 <modify-function signature="replace(QString,const char *)" remove="all"/>
465 <modify-function signature="replace(QString,const char *)" remove="all"/>
466 <modify-function signature="replace(const char *,const char *)" remove="all"/>
466 <modify-function signature="replace(const char *,const char *)" remove="all"/>
467 <modify-function signature="replace(char,QByteArray)">
467 <modify-function signature="replace(char,QByteArray)">
468 <modify-argument index="0" replace-value="this"/>
468 <modify-argument index="0" replace-value="this"/>
469 </modify-function>
469 </modify-function>
470 <modify-function signature="replace(char,QString)">
470 <modify-function signature="replace(char,QString)">
471 <modify-argument index="0" replace-value="this"/>
471 <modify-argument index="0" replace-value="this"/>
472 </modify-function>
472 </modify-function>
473 <modify-function signature="replace(char,const char *)" remove="all"/>
473 <modify-function signature="replace(char,const char *)" remove="all"/>
474 <modify-function signature="replace(char,char)">
474 <modify-function signature="replace(char,char)">
475 <modify-argument index="0" replace-value="this"/>
475 <modify-argument index="0" replace-value="this"/>
476 </modify-function>
476 </modify-function>
477
477
478 <modify-function signature="startsWith(const char *)const" remove="all"/>
478 <modify-function signature="startsWith(const char *)const" remove="all"/>
479
479
480 <modify-function signature="fromRawData(const char*,int)" remove="all"/>
480 <modify-function signature="fromRawData(const char*,int)" remove="all"/>
481
481
482 <modify-function signature="number(int,int)">
482 <modify-function signature="number(int,int)">
483 <rename to="fromInt"/>
483 <rename to="fromInt"/>
484 </modify-function>
484 </modify-function>
485 <modify-function signature="number(uint,int)">
485 <modify-function signature="number(uint,int)">
486 <rename to="fromUInt"/>
486 <rename to="fromUInt"/>
487 </modify-function>
487 </modify-function>
488 <modify-function signature="number(qlonglong,int)">
488 <modify-function signature="number(qlonglong,int)">
489 <rename to="fromLongLong"/>
489 <rename to="fromLongLong"/>
490 </modify-function>
490 </modify-function>
491 <modify-function signature="number(qulonglong,int)">
491 <modify-function signature="number(qulonglong,int)">
492 <rename to="fromULongLong"/>
492 <rename to="fromULongLong"/>
493 </modify-function>
493 </modify-function>
494
494
495 <modify-function signature="setNum(int,int)">
495 <modify-function signature="setNum(int,int)">
496 <modify-argument index="0" replace-value="this"/>
496 <modify-argument index="0" replace-value="this"/>
497 <rename to="setInt"/>
497 <rename to="setInt"/>
498 </modify-function>
498 </modify-function>
499 <modify-function signature="setNum(uint,int)">
499 <modify-function signature="setNum(uint,int)">
500 <modify-argument index="0" replace-value="this"/>
500 <modify-argument index="0" replace-value="this"/>
501 <rename to="setUInt"/>
501 <rename to="setUInt"/>
502 </modify-function>
502 </modify-function>
503 <modify-function signature="setNum(short,int)">
503 <modify-function signature="setNum(short,int)">
504 <modify-argument index="0" replace-value="this"/>
504 <modify-argument index="0" replace-value="this"/>
505 <rename to="setShort"/>
505 <rename to="setShort"/>
506 </modify-function>
506 </modify-function>
507 <modify-function signature="setNum(ushort,int)">
507 <modify-function signature="setNum(ushort,int)">
508 <modify-argument index="0" replace-value="this"/>
508 <modify-argument index="0" replace-value="this"/>
509 <rename to="setUShort"/>
509 <rename to="setUShort"/>
510 </modify-function>
510 </modify-function>
511 <modify-function signature="setNum(qlonglong,int)">
511 <modify-function signature="setNum(qlonglong,int)">
512 <modify-argument index="0" replace-value="this"/>
512 <modify-argument index="0" replace-value="this"/>
513 <rename to="setLongLong"/>
513 <rename to="setLongLong"/>
514 </modify-function>
514 </modify-function>
515 <modify-function signature="setNum(qulonglong,int)">
515 <modify-function signature="setNum(qulonglong,int)">
516 <modify-argument index="0" replace-value="this"/>
516 <modify-argument index="0" replace-value="this"/>
517 <rename to="setULongLong"/>
517 <rename to="setULongLong"/>
518 </modify-function>
518 </modify-function>
519 <modify-function signature="setNum(double,char,int)">
519 <modify-function signature="setNum(double,char,int)">
520 <modify-argument index="0" replace-value="this"/>
520 <modify-argument index="0" replace-value="this"/>
521 <rename to="setDouble"/>
521 <rename to="setDouble"/>
522 </modify-function>
522 </modify-function>
523 <modify-function signature="setNum(float,char,int)">
523 <modify-function signature="setNum(float,char,int)">
524 <modify-argument index="0" replace-value="this"/>
524 <modify-argument index="0" replace-value="this"/>
525 <rename to="setFloat"/>
525 <rename to="setFloat"/>
526 </modify-function>
526 </modify-function>
527
527
528 <modify-function signature="toDouble(bool*)const">
528 <modify-function signature="toDouble(bool*)const">
529 <modify-argument index="1">
529 <modify-argument index="1">
530 <remove-default-expression/>
530 <remove-default-expression/>
531 <remove-argument/>
531 <remove-argument/>
532 <conversion-rule class="native">
532 <conversion-rule class="native">
533 <insert-template name="core.prepare_removed_bool*_argument"/>
533 <insert-template name="core.prepare_removed_bool*_argument"/>
534 </conversion-rule>
534 </conversion-rule>
535 </modify-argument>
535 </modify-argument>
536 <modify-argument index="return">
536 <modify-argument index="return">
537 <conversion-rule class="native">
537 <conversion-rule class="native">
538 <insert-template name="core.convert_to_null_or_primitive"/>
538 <insert-template name="core.convert_to_null_or_primitive"/>
539 </conversion-rule>
539 </conversion-rule>
540 </modify-argument>
540 </modify-argument>
541 </modify-function>
541 </modify-function>
542
542
543 <modify-function signature="toFloat(bool*)const">
543 <modify-function signature="toFloat(bool*)const">
544 <modify-argument index="1">
544 <modify-argument index="1">
545 <remove-default-expression/>
545 <remove-default-expression/>
546 <remove-argument/>
546 <remove-argument/>
547 <conversion-rule class="native">
547 <conversion-rule class="native">
548 <insert-template name="core.prepare_removed_bool*_argument"/>
548 <insert-template name="core.prepare_removed_bool*_argument"/>
549 </conversion-rule>
549 </conversion-rule>
550 </modify-argument>
550 </modify-argument>
551 <modify-argument index="return">
551 <modify-argument index="return">
552 <conversion-rule class="native">
552 <conversion-rule class="native">
553 <insert-template name="core.convert_to_null_or_primitive"/>
553 <insert-template name="core.convert_to_null_or_primitive"/>
554 </conversion-rule>
554 </conversion-rule>
555 </modify-argument>
555 </modify-argument>
556 </modify-function>
556 </modify-function>
557
557
558 <modify-function signature="toInt(bool*,int)const">
558 <modify-function signature="toInt(bool*,int)const">
559 <modify-argument index="1">
559 <modify-argument index="1">
560 <remove-default-expression/>
560 <remove-default-expression/>
561 <remove-argument/>
561 <remove-argument/>
562 <conversion-rule class="native">
562 <conversion-rule class="native">
563 <insert-template name="core.prepare_removed_bool*_argument"/>
563 <insert-template name="core.prepare_removed_bool*_argument"/>
564 </conversion-rule>
564 </conversion-rule>
565 </modify-argument>
565 </modify-argument>
566 <modify-argument index="return">
566 <modify-argument index="return">
567 <conversion-rule class="native">
567 <conversion-rule class="native">
568 <insert-template name="core.convert_to_null_or_primitive"/>
568 <insert-template name="core.convert_to_null_or_primitive"/>
569 </conversion-rule>
569 </conversion-rule>
570 </modify-argument>
570 </modify-argument>
571 </modify-function>
571 </modify-function>
572
572
573 <modify-function signature="toUShort(bool*,int)const">
573 <modify-function signature="toUShort(bool*,int)const">
574 <modify-argument index="1">
574 <modify-argument index="1">
575 <remove-default-expression/>
575 <remove-default-expression/>
576 <remove-argument/>
576 <remove-argument/>
577 <conversion-rule class="native">
577 <conversion-rule class="native">
578 <insert-template name="core.prepare_removed_bool*_argument"/>
578 <insert-template name="core.prepare_removed_bool*_argument"/>
579 </conversion-rule>
579 </conversion-rule>
580 </modify-argument>
580 </modify-argument>
581 <modify-argument index="return">
581 <modify-argument index="return">
582 <conversion-rule class="native">
582 <conversion-rule class="native">
583 <insert-template name="core.convert_to_null_or_primitive"/>
583 <insert-template name="core.convert_to_null_or_primitive"/>
584 </conversion-rule>
584 </conversion-rule>
585 </modify-argument>
585 </modify-argument>
586 </modify-function>
586 </modify-function>
587 </value-type>
587 </value-type>
588
588
589 <object-type name="QIODevice">
589 <object-type name="QIODevice">
590 <modify-function signature="peek(char *,qint64)" remove="all"/>
590 <modify-function signature="peek(char *,qint64)" remove="all"/>
591 <modify-function signature="read(char *,qint64)" remove="all"/>
591 <modify-function signature="read(char *,qint64)" remove="all"/>
592 <modify-function signature="readLine(char *,qint64)" remove="all"/>
592 <modify-function signature="readLine(char *,qint64)" remove="all"/>
593 <modify-function signature="write(const char *,qint64)" remove="all"/>
593 <modify-function signature="write(const char *,qint64)" remove="all"/>
594 </object-type>
594 </object-type>
595
595
596 <object-type name="QFile">
596 <object-type name="QFile">
597 <modify-function signature="open(int,QFlags&lt;QIODevice::OpenModeFlag&gt;)" remove="all"/>
597 <modify-function signature="open(int,QFlags&lt;QIODevice::OpenModeFlag&gt;)" remove="all"/>
598 <modify-function signature="decodeName(const char*)" remove="all"/>
598 <modify-function signature="decodeName(const char*)" remove="all"/>
599 <modify-function signature="map(qint64,qint64,QFile::MemoryMapFlags)" remove="all"/>
599 <modify-function signature="map(qint64,qint64,QFile::MemoryMapFlags)" remove="all"/>
600 <modify-function signature="unmap(uchar*)" remove="all"/>
600 <modify-function signature="unmap(uchar*)" remove="all"/>
601 </object-type>
601 </object-type>
602
602
603 <object-type name="QSignalMapper">
603 <object-type name="QSignalMapper">
604 <!-- ### overloads -->
604 <!-- ### overloads -->
605 <modify-function signature="mapping(int)const">
605 <modify-function signature="mapping(int)const">
606 <rename to="mappingById"/>
606 <rename to="mappingById"/>
607 </modify-function>
607 </modify-function>
608 <modify-function signature="mapping(QString)const">
608 <modify-function signature="mapping(QString)const">
609 <rename to="mappingByString"/>
609 <rename to="mappingByString"/>
610 </modify-function>
610 </modify-function>
611 <modify-function signature="mapping(QObject*)const">
611 <modify-function signature="mapping(QObject*)const">
612 <rename to="mappingByObject"/>
612 <rename to="mappingByObject"/>
613 </modify-function>
613 </modify-function>
614 <modify-function signature="setMapping(QObject*,int)">
614 <modify-function signature="setMapping(QObject*,int)">
615 <rename to="setMappingById"/>
615 <rename to="setMappingById"/>
616 </modify-function>
616 </modify-function>
617 <modify-function signature="setMapping(QObject*,QString)">
617 <modify-function signature="setMapping(QObject*,QString)">
618 <rename to="setMappingByString"/>
618 <rename to="setMappingByString"/>
619 </modify-function>
619 </modify-function>
620 <modify-function signature="setMapping(QObject*,QObject*)">
620 <modify-function signature="setMapping(QObject*,QObject*)">
621 <rename to="setMappingByObject"/>
621 <rename to="setMappingByObject"/>
622 </modify-function>
622 </modify-function>
623 </object-type>
623 </object-type>
624
624
625 <object-type name="QDataStream">
625 <object-type name="QDataStream">
626 <modify-function signature="operator&gt;&gt;(signed char&amp;)" remove="all"/>
626 <modify-function signature="operator&gt;&gt;(signed char&amp;)" remove="all"/>
627 <modify-function signature="operator&lt;&lt;(signed char)" remove="all"/>
627 <modify-function signature="operator&lt;&lt;(signed char)" remove="all"/>
628
628
629 <modify-function signature="operator&lt;&lt;(bool)">
629 <modify-function signature="operator&lt;&lt;(bool)">
630 <rename to="writeBoolean"/>
630 <rename to="writeBoolean"/>
631 <modify-argument index="0" replace-value="this"/>
631 <modify-argument index="0" replace-value="this"/>
632 </modify-function>
632 </modify-function>
633 <modify-function signature="operator&lt;&lt;(unsigned char)">
633 <modify-function signature="operator&lt;&lt;(unsigned char)">
634 <modify-argument index="0" replace-value="this"/>
634 <modify-argument index="0" replace-value="this"/>
635 <rename to="writeByte"/>
635 <rename to="writeByte"/>
636 </modify-function>
636 </modify-function>
637 <modify-function signature="operator&lt;&lt;(int)">
637 <modify-function signature="operator&lt;&lt;(int)">
638 <rename to="writeInt"/>
638 <rename to="writeInt"/>
639 <modify-argument index="0" replace-value="this"/>
639 <modify-argument index="0" replace-value="this"/>
640 </modify-function>
640 </modify-function>
641 <modify-function signature="operator&lt;&lt;(qint64)">
641 <modify-function signature="operator&lt;&lt;(qint64)">
642 <rename to="writeLongLong"/>
642 <rename to="writeLongLong"/>
643 <modify-argument index="0" replace-value="this"/>
643 <modify-argument index="0" replace-value="this"/>
644 </modify-function>
644 </modify-function>
645 <modify-function signature="operator&lt;&lt;(float)">
645 <modify-function signature="operator&lt;&lt;(float)">
646 <rename to="writeFloat"/>
646 <rename to="writeFloat"/>
647 <modify-argument index="0" replace-value="this"/>
647 <modify-argument index="0" replace-value="this"/>
648 </modify-function>
648 </modify-function>
649 <modify-function signature="operator&lt;&lt;(double)">
649 <modify-function signature="operator&lt;&lt;(double)">
650 <rename to="writeDouble"/>
650 <rename to="writeDouble"/>
651 <modify-argument index="0" replace-value="this"/>
651 <modify-argument index="0" replace-value="this"/>
652 </modify-function>
652 </modify-function>
653 <modify-function signature="operator&lt;&lt;(short)">
653 <modify-function signature="operator&lt;&lt;(short)">
654 <rename to="writeShort"/>
654 <rename to="writeShort"/>
655 <modify-argument index="0" replace-value="this"/>
655 <modify-argument index="0" replace-value="this"/>
656 </modify-function>
656 </modify-function>
657
657
658 <modify-function signature="operator&gt;&gt;(bool &amp;)">
658 <modify-function signature="operator&gt;&gt;(bool &amp;)">
659 <rename to="readBoolean"/>
659 <rename to="readBoolean"/>
660 <modify-argument index="1">
660 <modify-argument index="1">
661 <remove-argument/>
661 <remove-argument/>
662 <conversion-rule class="native">
662 <conversion-rule class="native">
663 bool __result;
663 bool __result;
664 bool &amp; %out% = __result;
664 bool &amp; %out% = __result;
665 </conversion-rule>
665 </conversion-rule>
666 </modify-argument>
666 </modify-argument>
667 <modify-argument index="0" replace-value="void">
667 <modify-argument index="0" replace-value="void">
668 <conversion-rule class="native">
668 <conversion-rule class="native">
669 bool %out% = __result;
669 bool %out% = __result;
670 </conversion-rule>
670 </conversion-rule>
671 </modify-argument>
671 </modify-argument>
672 </modify-function>
672 </modify-function>
673 <modify-function signature="operator&gt;&gt;(unsigned char &amp;)">
673 <modify-function signature="operator&gt;&gt;(unsigned char &amp;)">
674 <rename to="readByte"/>
674 <rename to="readByte"/>
675 <modify-argument index="1">
675 <modify-argument index="1">
676 <remove-argument/>
676 <remove-argument/>
677 <conversion-rule class="native">
677 <conversion-rule class="native">
678 unsigned char __result;
678 unsigned char __result;
679 unsigned char &amp; %out% = __result;
679 unsigned char &amp; %out% = __result;
680 </conversion-rule>
680 </conversion-rule>
681 </modify-argument>
681 </modify-argument>
682 <modify-argument index="0" replace-value="void">
682 <modify-argument index="0" replace-value="void">
683 <conversion-rule class="native">
683 <conversion-rule class="native">
684 int %out% = __result;
684 int %out% = __result;
685 </conversion-rule>
685 </conversion-rule>
686 </modify-argument>
686 </modify-argument>
687 </modify-function>
687 </modify-function>
688 <modify-function signature="operator&gt;&gt;(int &amp;)">
688 <modify-function signature="operator&gt;&gt;(int &amp;)">
689 <rename to="readInt"/>
689 <rename to="readInt"/>
690 <modify-argument index="1">
690 <modify-argument index="1">
691 <remove-argument/>
691 <remove-argument/>
692 <conversion-rule class="native">
692 <conversion-rule class="native">
693 int __result;
693 int __result;
694 int &amp; %out% = __result;
694 int &amp; %out% = __result;
695 </conversion-rule>
695 </conversion-rule>
696 </modify-argument>
696 </modify-argument>
697 <modify-argument index="0" replace-value="void">
697 <modify-argument index="0" replace-value="void">
698 <conversion-rule class="native">
698 <conversion-rule class="native">
699 int %out% = __result;
699 int %out% = __result;
700 </conversion-rule>
700 </conversion-rule>
701 </modify-argument>
701 </modify-argument>
702 </modify-function>
702 </modify-function>
703 <modify-function signature="operator&gt;&gt;(uint &amp;)">
703 <modify-function signature="operator&gt;&gt;(uint &amp;)">
704 <rename to="readUInt"/>
704 <rename to="readUInt"/>
705 <modify-argument index="1">
705 <modify-argument index="1">
706 <remove-argument/>
706 <remove-argument/>
707 <conversion-rule class="native">
707 <conversion-rule class="native">
708 uint __result;
708 uint __result;
709 uint &amp; %out% = __result;
709 uint &amp; %out% = __result;
710 </conversion-rule>
710 </conversion-rule>
711 </modify-argument>
711 </modify-argument>
712 <modify-argument index="0" replace-value="void">
712 <modify-argument index="0" replace-value="void">
713 <conversion-rule class="native">
713 <conversion-rule class="native">
714 uint %out% = __result;
714 uint %out% = __result;
715 </conversion-rule>
715 </conversion-rule>
716 </modify-argument>
716 </modify-argument>
717 </modify-function>
717 </modify-function>
718 <modify-function signature="operator&gt;&gt;(qint64 &amp;)">
718 <modify-function signature="operator&gt;&gt;(qint64 &amp;)">
719 <rename to="readLongLong"/>
719 <rename to="readLongLong"/>
720 <modify-argument index="1">
720 <modify-argument index="1">
721 <remove-argument/>
721 <remove-argument/>
722 <conversion-rule class="native">
722 <conversion-rule class="native">
723 qint64 __result;
723 qint64 __result;
724 qint64 &amp; %out% = __result;
724 qint64 &amp; %out% = __result;
725 </conversion-rule>
725 </conversion-rule>
726 </modify-argument>
726 </modify-argument>
727 <modify-argument index="0" replace-value="void">
727 <modify-argument index="0" replace-value="void">
728 <conversion-rule class="native">
728 <conversion-rule class="native">
729 qint64 %out% = __result;
729 qint64 %out% = __result;
730 </conversion-rule>
730 </conversion-rule>
731 </modify-argument>
731 </modify-argument>
732 </modify-function>
732 </modify-function>
733 <modify-function signature="operator&gt;&gt;(unsigned long long &amp;)">
733 <modify-function signature="operator&gt;&gt;(unsigned long long &amp;)">
734 <rename to="readULongLong"/>
734 <rename to="readULongLong"/>
735 <modify-argument index="1">
735 <modify-argument index="1">
736 <remove-argument/>
736 <remove-argument/>
737 <conversion-rule class="native">
737 <conversion-rule class="native">
738 unsigned long long __result;
738 unsigned long long __result;
739 unsigned long long &amp; %out% = __result;
739 unsigned long long &amp; %out% = __result;
740 </conversion-rule>
740 </conversion-rule>
741 </modify-argument>
741 </modify-argument>
742 <modify-argument index="0" replace-value="void">
742 <modify-argument index="0" replace-value="void">
743 <conversion-rule class="native">
743 <conversion-rule class="native">
744 unsigned long long %out% = __result;
744 unsigned long long %out% = __result;
745 </conversion-rule>
745 </conversion-rule>
746 </modify-argument>
746 </modify-argument>
747 </modify-function>
747 </modify-function>
748 <modify-function signature="operator&gt;&gt;(float &amp;)">
748 <modify-function signature="operator&gt;&gt;(float &amp;)">
749 <rename to="readFloat"/>
749 <rename to="readFloat"/>
750 <modify-argument index="1">
750 <modify-argument index="1">
751 <remove-argument/>
751 <remove-argument/>
752 <conversion-rule class="native">
752 <conversion-rule class="native">
753 float __result;
753 float __result;
754 float &amp; %out% = __result;
754 float &amp; %out% = __result;
755 </conversion-rule>
755 </conversion-rule>
756 </modify-argument>
756 </modify-argument>
757 <modify-argument index="0" replace-value="void">
757 <modify-argument index="0" replace-value="void">
758 <conversion-rule class="native">
758 <conversion-rule class="native">
759 float %out% = __result;
759 float %out% = __result;
760 </conversion-rule>
760 </conversion-rule>
761 </modify-argument>
761 </modify-argument>
762 </modify-function>
762 </modify-function>
763 <modify-function signature="operator&gt;&gt;(double &amp;)">
763 <modify-function signature="operator&gt;&gt;(double &amp;)">
764 <rename to="readDouble"/>
764 <rename to="readDouble"/>
765 <modify-argument index="1">
765 <modify-argument index="1">
766 <remove-argument/>
766 <remove-argument/>
767 <conversion-rule class="native">
767 <conversion-rule class="native">
768 double __result;
768 double __result;
769 double &amp; %out% = __result;
769 double &amp; %out% = __result;
770 </conversion-rule>
770 </conversion-rule>
771 </modify-argument>
771 </modify-argument>
772 <modify-argument index="0" replace-value="void">
772 <modify-argument index="0" replace-value="void">
773 <conversion-rule class="native">
773 <conversion-rule class="native">
774 double %out% = __result;
774 double %out% = __result;
775 </conversion-rule>
775 </conversion-rule>
776 </modify-argument>
776 </modify-argument>
777 </modify-function>
777 </modify-function>
778 <modify-function signature="operator&gt;&gt;(short &amp;)">
778 <modify-function signature="operator&gt;&gt;(short &amp;)">
779 <rename to="readShort"/>
779 <rename to="readShort"/>
780 <modify-argument index="1">
780 <modify-argument index="1">
781 <remove-argument/>
781 <remove-argument/>
782 <conversion-rule class="native">
782 <conversion-rule class="native">
783 short __result;
783 short __result;
784 short &amp; %out% = __result;
784 short &amp; %out% = __result;
785 </conversion-rule>
785 </conversion-rule>
786 </modify-argument>
786 </modify-argument>
787 <modify-argument index="0" replace-value="void">
787 <modify-argument index="0" replace-value="void">
788 <conversion-rule class="native">
788 <conversion-rule class="native">
789 short %out% = __result;
789 short %out% = __result;
790 </conversion-rule>
790 </conversion-rule>
791 </modify-argument>
791 </modify-argument>
792 </modify-function>
792 </modify-function>
793 <modify-function signature="operator&gt;&gt;(unsigned short &amp;)">
793 <modify-function signature="operator&gt;&gt;(unsigned short &amp;)">
794 <rename to="readUShort"/>
794 <rename to="readUShort"/>
795 <modify-argument index="1">
795 <modify-argument index="1">
796 <remove-argument/>
796 <remove-argument/>
797 <conversion-rule class="native">
797 <conversion-rule class="native">
798 unsigned short __result;
798 unsigned short __result;
799 unsigned short &amp; %out% = __result;
799 unsigned short &amp; %out% = __result;
800 </conversion-rule>
800 </conversion-rule>
801 </modify-argument>
801 </modify-argument>
802 <modify-argument index="0" replace-value="void">
802 <modify-argument index="0" replace-value="void">
803 <conversion-rule class="native">
803 <conversion-rule class="native">
804 unsigned short %out% = __result;
804 unsigned short %out% = __result;
805 </conversion-rule>
805 </conversion-rule>
806 </modify-argument>
806 </modify-argument>
807 </modify-function>
807 </modify-function>
808 </object-type>
808 </object-type>
809
809
810 <object-type name="QTextStream">
810 <object-type name="QTextStream">
811 <modify-function signature="setCodec(const char *)">
811 <modify-function signature="setCodec(const char *)">
812 <modify-argument index="1">
812 <modify-argument index="1">
813 <replace-type modified-type="QString"/>
813 <replace-type modified-type="QString"/>
814 <conversion-rule class="native">
814 <conversion-rule class="native">
815 <insert-template name="core.convert_string_arg_to_char*"/>
815 <insert-template name="core.convert_string_arg_to_char*"/>
816 </conversion-rule>
816 </conversion-rule>
817 </modify-argument>
817 </modify-argument>
818 </modify-function>
818 </modify-function>
819
819
820 <modify-function signature="operator&lt;&lt;(QBool)">
820 <modify-function signature="operator&lt;&lt;(QBool)">
821 <rename to="writeBoolean"/>
821 <rename to="writeBoolean"/>
822 <modify-argument index="0" replace-value="this"/>
822 <modify-argument index="0" replace-value="this"/>
823 </modify-function>
823 </modify-function>
824 <modify-function signature="operator&lt;&lt;(char)">
824 <modify-function signature="operator&lt;&lt;(char)">
825 <modify-argument index="0" replace-value="this"/>
825 <modify-argument index="0" replace-value="this"/>
826 <rename to="writeByte"/>
826 <rename to="writeByte"/>
827 </modify-function>
827 </modify-function>
828 <modify-function signature="operator&lt;&lt;(signed int)">
828 <modify-function signature="operator&lt;&lt;(signed int)">
829 <rename to="writeInt"/>
829 <rename to="writeInt"/>
830 <modify-argument index="0" replace-value="this"/>
830 <modify-argument index="0" replace-value="this"/>
831 </modify-function>
831 </modify-function>
832 <modify-function signature="operator&lt;&lt;(qlonglong)">
832 <modify-function signature="operator&lt;&lt;(qlonglong)">
833 <rename to="writeLongLong"/>
833 <rename to="writeLongLong"/>
834 <modify-argument index="0" replace-value="this"/>
834 <modify-argument index="0" replace-value="this"/>
835 </modify-function>
835 </modify-function>
836 <modify-function signature="operator&lt;&lt;(float)">
836 <modify-function signature="operator&lt;&lt;(float)">
837 <rename to="writeFloat"/>
837 <rename to="writeFloat"/>
838 <modify-argument index="0" replace-value="this"/>
838 <modify-argument index="0" replace-value="this"/>
839 </modify-function>
839 </modify-function>
840 <modify-function signature="operator&lt;&lt;(double)">
840 <modify-function signature="operator&lt;&lt;(double)">
841 <rename to="writeDouble"/>
841 <rename to="writeDouble"/>
842 <modify-argument index="0" replace-value="this"/>
842 <modify-argument index="0" replace-value="this"/>
843 </modify-function>
843 </modify-function>
844 <modify-function signature="operator&lt;&lt;(signed short)">
844 <modify-function signature="operator&lt;&lt;(signed short)">
845 <rename to="writeShort"/>
845 <rename to="writeShort"/>
846 <modify-argument index="0" replace-value="this"/>
846 <modify-argument index="0" replace-value="this"/>
847 </modify-function>
847 </modify-function>
848 <modify-function signature="operator&lt;&lt;(const QByteArray&amp;)">
848 <modify-function signature="operator&lt;&lt;(const QByteArray&amp;)">
849 <rename to="writeByteArray"/>
849 <rename to="writeByteArray"/>
850 <modify-argument index="0" replace-value="this"/>
850 <modify-argument index="0" replace-value="this"/>
851 </modify-function>
851 </modify-function>
852 <modify-function signature="operator&lt;&lt;(const QString&amp;)">
852 <modify-function signature="operator&lt;&lt;(const QString&amp;)">
853 <rename to="writeString"/>
853 <rename to="writeString"/>
854 <modify-argument index="0" replace-value="this"/>
854 <modify-argument index="0" replace-value="this"/>
855 </modify-function>
855 </modify-function>
856
856
857 <modify-function signature="operator&gt;&gt;(char&amp;)">
857 <modify-function signature="operator&gt;&gt;(char&amp;)">
858 <rename to="readByte"/>
858 <rename to="readByte"/>
859 <modify-argument index="1">
859 <modify-argument index="1">
860 <remove-argument/>
860 <remove-argument/>
861 <conversion-rule class="native">
861 <conversion-rule class="native">
862 char __result;
862 char __result;
863 char &amp; %out% = __result;
863 char &amp; %out% = __result;
864 </conversion-rule>
864 </conversion-rule>
865 </modify-argument>
865 </modify-argument>
866 <modify-argument index="0" replace-value="void">
866 <modify-argument index="0" replace-value="void">
867 <conversion-rule class="native">
867 <conversion-rule class="native">
868 int %out% = __result;
868 int %out% = __result;
869 </conversion-rule>
869 </conversion-rule>
870 </modify-argument>
870 </modify-argument>
871 </modify-function>
871 </modify-function>
872 <modify-function signature="operator&gt;&gt;(signed short&amp;)">
872 <modify-function signature="operator&gt;&gt;(signed short&amp;)">
873 <rename to="readShort"/>
873 <rename to="readShort"/>
874 <modify-argument index="1">
874 <modify-argument index="1">
875 <remove-argument/>
875 <remove-argument/>
876 <conversion-rule class="native">
876 <conversion-rule class="native">
877 short __result;
877 short __result;
878 short &amp; %out% = __result;
878 short &amp; %out% = __result;
879 </conversion-rule>
879 </conversion-rule>
880 </modify-argument>
880 </modify-argument>
881 <modify-argument index="0" replace-value="void">
881 <modify-argument index="0" replace-value="void">
882 <conversion-rule class="native">
882 <conversion-rule class="native">
883 short %out% = __result;
883 short %out% = __result;
884 </conversion-rule>
884 </conversion-rule>
885 </modify-argument>
885 </modify-argument>
886 </modify-function>
886 </modify-function>
887 <modify-function signature="operator&gt;&gt;(signed int&amp;)">
887 <modify-function signature="operator&gt;&gt;(signed int&amp;)">
888 <rename to="readInt"/>
888 <rename to="readInt"/>
889 <modify-argument index="1">
889 <modify-argument index="1">
890 <remove-argument/>
890 <remove-argument/>
891 <conversion-rule class="native">
891 <conversion-rule class="native">
892 int __result;
892 int __result;
893 int &amp; %out% = __result;
893 int &amp; %out% = __result;
894 </conversion-rule>
894 </conversion-rule>
895 </modify-argument>
895 </modify-argument>
896 <modify-argument index="0" replace-value="void">
896 <modify-argument index="0" replace-value="void">
897 <conversion-rule class="native">
897 <conversion-rule class="native">
898 int %out% = __result;
898 int %out% = __result;
899 </conversion-rule>
899 </conversion-rule>
900 </modify-argument>
900 </modify-argument>
901 </modify-function>
901 </modify-function>
902 <modify-function signature="operator&gt;&gt;(unsigned short&amp;)">
902 <modify-function signature="operator&gt;&gt;(unsigned short&amp;)">
903 <rename to="readUShort"/>
903 <rename to="readUShort"/>
904 <modify-argument index="1">
904 <modify-argument index="1">
905 <remove-argument/>
905 <remove-argument/>
906 <conversion-rule class="native">
906 <conversion-rule class="native">
907 unsigned short __result;
907 unsigned short __result;
908 unsigned short &amp; %out% = __result;
908 unsigned short &amp; %out% = __result;
909 </conversion-rule>
909 </conversion-rule>
910 </modify-argument>
910 </modify-argument>
911 <modify-argument index="0" replace-value="void">
911 <modify-argument index="0" replace-value="void">
912 <conversion-rule class="native">
912 <conversion-rule class="native">
913 unsigned short %out% = __result;
913 unsigned short %out% = __result;
914 </conversion-rule>
914 </conversion-rule>
915 </modify-argument>
915 </modify-argument>
916 </modify-function>
916 </modify-function>
917 <modify-function signature="operator&gt;&gt;(unsigned int&amp;)">
917 <modify-function signature="operator&gt;&gt;(unsigned int&amp;)">
918 <rename to="readUInt"/>
918 <rename to="readUInt"/>
919 <modify-argument index="1">
919 <modify-argument index="1">
920 <remove-argument/>
920 <remove-argument/>
921 <conversion-rule class="native">
921 <conversion-rule class="native">
922 unsigned int __result;
922 unsigned int __result;
923 unsigned int &amp; %out% = __result;
923 unsigned int &amp; %out% = __result;
924 </conversion-rule>
924 </conversion-rule>
925 </modify-argument>
925 </modify-argument>
926 <modify-argument index="0" replace-value="void">
926 <modify-argument index="0" replace-value="void">
927 <conversion-rule class="native">
927 <conversion-rule class="native">
928 unsigned int %out% = __result;
928 unsigned int %out% = __result;
929 </conversion-rule>
929 </conversion-rule>
930 </modify-argument>
930 </modify-argument>
931 </modify-function>
931 </modify-function>
932 <modify-function signature="operator&gt;&gt;(qlonglong&amp;)">
932 <modify-function signature="operator&gt;&gt;(qlonglong&amp;)">
933 <rename to="readLongLong"/>
933 <rename to="readLongLong"/>
934 <modify-argument index="1">
934 <modify-argument index="1">
935 <remove-argument/>
935 <remove-argument/>
936 <conversion-rule class="native">
936 <conversion-rule class="native">
937 qlonglong __result;
937 qlonglong __result;
938 qlonglong &amp; %out% = __result;
938 qlonglong &amp; %out% = __result;
939 </conversion-rule>
939 </conversion-rule>
940 </modify-argument>
940 </modify-argument>
941 <modify-argument index="0" replace-value="void">
941 <modify-argument index="0" replace-value="void">
942 <conversion-rule class="native">
942 <conversion-rule class="native">
943 qlonglong %out% = __result;
943 qlonglong %out% = __result;
944 </conversion-rule>
944 </conversion-rule>
945 </modify-argument>
945 </modify-argument>
946 </modify-function>
946 </modify-function>
947 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)">
947 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)">
948 <rename to="readULongLong"/>
948 <rename to="readULongLong"/>
949 <modify-argument index="1">
949 <modify-argument index="1">
950 <remove-argument/>
950 <remove-argument/>
951 <conversion-rule class="native">
951 <conversion-rule class="native">
952 qulonglong __result;
952 qulonglong __result;
953 qulonglong &amp; %out% = __result;
953 qulonglong &amp; %out% = __result;
954 </conversion-rule>
954 </conversion-rule>
955 </modify-argument>
955 </modify-argument>
956 <modify-argument index="0" replace-value="void">
956 <modify-argument index="0" replace-value="void">
957 <conversion-rule class="native">
957 <conversion-rule class="native">
958 qulonglong %out% = __result;
958 qulonglong %out% = __result;
959 </conversion-rule>
959 </conversion-rule>
960 </modify-argument>
960 </modify-argument>
961 </modify-function>
961 </modify-function>
962 <modify-function signature="operator&gt;&gt;(float&amp;)">
962 <modify-function signature="operator&gt;&gt;(float&amp;)">
963 <rename to="readFloat"/>
963 <rename to="readFloat"/>
964 <modify-argument index="1">
964 <modify-argument index="1">
965 <remove-argument/>
965 <remove-argument/>
966 <conversion-rule class="native">
966 <conversion-rule class="native">
967 float __result;
967 float __result;
968 float &amp; %out% = __result;
968 float &amp; %out% = __result;
969 </conversion-rule>
969 </conversion-rule>
970 </modify-argument>
970 </modify-argument>
971 <modify-argument index="0" replace-value="void">
971 <modify-argument index="0" replace-value="void">
972 <conversion-rule class="native">
972 <conversion-rule class="native">
973 float %out% = __result;
973 float %out% = __result;
974 </conversion-rule>
974 </conversion-rule>
975 </modify-argument>
975 </modify-argument>
976 </modify-function>
976 </modify-function>
977 <modify-function signature="operator&gt;&gt;(double&amp;)">
977 <modify-function signature="operator&gt;&gt;(double&amp;)">
978 <rename to="readDouble"/>
978 <rename to="readDouble"/>
979 <modify-argument index="1">
979 <modify-argument index="1">
980 <remove-argument/>
980 <remove-argument/>
981 <conversion-rule class="native">
981 <conversion-rule class="native">
982 double __result;
982 double __result;
983 double &amp; %out% = __result;
983 double &amp; %out% = __result;
984 </conversion-rule>
984 </conversion-rule>
985 </modify-argument>
985 </modify-argument>
986 <modify-argument index="0" replace-value="void">
986 <modify-argument index="0" replace-value="void">
987 <conversion-rule class="native">
987 <conversion-rule class="native">
988 double %out% = __result;
988 double %out% = __result;
989 </conversion-rule>
989 </conversion-rule>
990 </modify-argument>
990 </modify-argument>
991 </modify-function>
991 </modify-function>
992
992
993 <modify-function signature="operator&lt;&lt;(qulonglong)" remove="all"/>
993 <modify-function signature="operator&lt;&lt;(qulonglong)" remove="all"/>
994 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)" remove="all"/>
994 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)" remove="all"/>
995 </object-type>
995 </object-type>
996
996
997 <value-type name="QPointF">
997 <value-type name="QPointF">
998 <modify-function signature="rx()" remove="all"/>
998 <modify-function signature="rx()" remove="all"/>
999 <modify-function signature="ry()" remove="all"/>
999 <modify-function signature="ry()" remove="all"/>
1000 </value-type>
1000 </value-type>
1001
1001
1002 <value-type name="QPoint">
1002 <value-type name="QPoint">
1003 <modify-function signature="rx()" remove="all"/>
1003 <modify-function signature="rx()" remove="all"/>
1004 <modify-function signature="ry()" remove="all"/>
1004 <modify-function signature="ry()" remove="all"/>
1005 </value-type>
1005 </value-type>
1006
1006
1007 <value-type name="QPixmap">
1007 <value-type name="QPixmap">
1008 <modify-function signature="save(QIODevice*, const char*, int)" remove="all"/>
1008 <modify-function signature="save(QIODevice*, const char*, int)" remove="all"/>
1009 </value-type>
1009 </value-type>
1010
1010
1011 <object-type name="QObject">
1011 <object-type name="QObject">
1012 <modify-function signature="property(const char*)const">
1012 <modify-function signature="property(const char*)const">
1013 <modify-argument index="1">
1013 <modify-argument index="1">
1014 <replace-type modified-type="QString"/>
1014 <replace-type modified-type="QString"/>
1015 <conversion-rule class="native">
1015 <conversion-rule class="native">
1016 <insert-template name="core.convert_string_arg_to_char*"/>
1016 <insert-template name="core.convert_string_arg_to_char*"/>
1017 </conversion-rule>
1017 </conversion-rule>
1018 </modify-argument>
1018 </modify-argument>
1019 </modify-function>
1019 </modify-function>
1020
1020
1021 <modify-function signature="setProperty(const char*,QVariant)">
1021 <modify-function signature="setProperty(const char*,QVariant)">
1022 <modify-argument index="1">
1022 <modify-argument index="1">
1023 <replace-type modified-type="QString"/>
1023 <replace-type modified-type="QString"/>
1024 <conversion-rule class="native">
1024 <conversion-rule class="native">
1025 <insert-template name="core.convert_string_arg_to_char*"/>
1025 <insert-template name="core.convert_string_arg_to_char*"/>
1026 </conversion-rule>
1026 </conversion-rule>
1027 </modify-argument>
1027 </modify-argument>
1028 </modify-function>
1028 </modify-function>
1029
1029
1030 <modify-function signature="inherits(const char*)const">
1030 <modify-function signature="inherits(const char*)const">
1031 <modify-argument index="1">
1031 <modify-argument index="1">
1032 <replace-type modified-type="QString"/>
1032 <replace-type modified-type="QString"/>
1033 <conversion-rule class="native">
1033 <conversion-rule class="native">
1034 <insert-template name="core.convert_string_arg_to_char*"/>
1034 <insert-template name="core.convert_string_arg_to_char*"/>
1035 </conversion-rule>
1035 </conversion-rule>
1036 </modify-argument>
1036 </modify-argument>
1037 </modify-function>
1037 </modify-function>
1038 </object-type>
1038 </object-type>
1039
1039
1040 <object-type name="QCryptographicHash">
1040 <object-type name="QCryptographicHash">
1041 <modify-function signature="addData(const char*,int)" remove="all"/>
1041 <modify-function signature="addData(const char*,int)" remove="all"/>
1042 </object-type>
1042 </object-type>
1043
1043
1044
1044
1045 <value-type name="QtScriptFuture">
1045 <value-type name="QtScriptFuture">
1046 <modify-function signature="operator==(const QFuture &amp;)const">
1046 <modify-function signature="operator==(const QFuture &amp;)const">
1047 <modify-argument index="1">
1047 <modify-argument index="1">
1048 <replace-type modified-type="QtScriptFuture*"/>
1048 <replace-type modified-type="QtScriptFuture*"/>
1049 <conversion-rule class="native">
1049 <conversion-rule class="native">
1050 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1050 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1051 </conversion-rule>
1051 </conversion-rule>
1052 </modify-argument>
1052 </modify-argument>
1053 </modify-function>
1053 </modify-function>
1054 <modify-function signature="QFuture(const QFuture &amp;)">
1054 <modify-function signature="QFuture(const QFuture &amp;)">
1055 <modify-argument index="1">
1055 <modify-argument index="1">
1056 <replace-type modified-type="QtScriptFuture" />
1056 <replace-type modified-type="QtScriptFuture" />
1057 <conversion-rule class="native">
1057 <conversion-rule class="native">
1058 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1058 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1059 </conversion-rule>
1059 </conversion-rule>
1060 </modify-argument>
1060 </modify-argument>
1061 </modify-function>
1061 </modify-function>
1062 <inject-code class="native">
1062 <inject-code class="native">
1063 </inject-code>
1063 </inject-code>
1064 </value-type>
1064 </value-type>
1065
1065
1066 <value-type name="QtScriptVoidFuture">
1066 <value-type name="QtScriptVoidFuture">
1067 <modify-function signature="operator==(const QFuture &amp;)const">
1067 <modify-function signature="operator==(const QFuture &amp;)const">
1068 <modify-argument index="1">
1068 <modify-argument index="1">
1069 <replace-type modified-type="QtScriptVoidFuture*"/>
1069 <replace-type modified-type="QtScriptVoidFuture*"/>
1070 <conversion-rule class="native">
1070 <conversion-rule class="native">
1071 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1071 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1072 </conversion-rule>
1072 </conversion-rule>
1073 </modify-argument>
1073 </modify-argument>
1074 </modify-function>
1074 </modify-function>
1075 <modify-function signature="QFuture(const QFuture &amp;)">
1075 <modify-function signature="QFuture(const QFuture &amp;)">
1076 <modify-argument index="1">
1076 <modify-argument index="1">
1077 <replace-type modified-type="QtScriptVoidFuture*"/>
1077 <replace-type modified-type="QtScriptVoidFuture*"/>
1078 <conversion-rule class="native">
1078 <conversion-rule class="native">
1079 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1079 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1080 </conversion-rule>
1080 </conversion-rule>
1081 </modify-argument>
1081 </modify-argument>
1082 </modify-function>
1082 </modify-function>
1083 </value-type>
1083 </value-type>
1084
1084
1085 <object-type name="QtScriptFutureWatcher">
1085 <object-type name="QtScriptFutureWatcher">
1086 <modify-function signature="setFuture(const QFuture &amp;)">
1086 <modify-function signature="setFuture(const QFuture &amp;)">
1087 <modify-argument index="1">
1087 <modify-argument index="1">
1088 <replace-type modified-type="QtScriptFuture*" />
1088 <replace-type modified-type="QtScriptFuture*" />
1089 <conversion-rule class="native">
1089 <conversion-rule class="native">
1090 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1090 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1091 </conversion-rule>
1091 </conversion-rule>
1092 </modify-argument>
1092 </modify-argument>
1093 </modify-function>
1093 </modify-function>
1094 </object-type>
1094 </object-type>
1095
1095
1096 <object-type name="QtScriptVoidFutureWatcher">
1096 <object-type name="QtScriptVoidFutureWatcher">
1097 <modify-function signature="setFuture(const QFuture &amp;)">
1097 <modify-function signature="setFuture(const QFuture &amp;)">
1098 <modify-argument index="1">
1098 <modify-argument index="1">
1099 <replace-type modified-type="QtScriptVoidFuture*" />
1099 <replace-type modified-type="QtScriptVoidFuture*" />
1100 <conversion-rule class="native">
1100 <conversion-rule class="native">
1101 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1101 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1102 </conversion-rule>
1102 </conversion-rule>
1103 </modify-argument>
1103 </modify-argument>
1104 </modify-function>
1104 </modify-function>
1105 </object-type>
1105 </object-type>
1106
1106
1107 <object-type name="QtScriptFutureSynchronizer">
1107 <object-type name="QtScriptFutureSynchronizer">
1108 <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
1108 <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
1109 <modify-argument index="1">
1109 <modify-argument index="1">
1110 <replace-type modified-type="QtScriptFuture*" />
1110 <replace-type modified-type="QtScriptFuture*" />
1111 <conversion-rule class="native">
1111 <conversion-rule class="native">
1112 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1112 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1113 </conversion-rule>
1113 </conversion-rule>
1114 </modify-argument>
1114 </modify-argument>
1115 </modify-function>
1115 </modify-function>
1116 <modify-function signature="addFuture(const QFuture &amp;)">
1116 <modify-function signature="addFuture(const QFuture &amp;)">
1117 <modify-argument index="1">
1117 <modify-argument index="1">
1118 <replace-type modified-type="QtScriptFuture*" />
1118 <replace-type modified-type="QtScriptFuture*" />
1119 <conversion-rule class="native">
1119 <conversion-rule class="native">
1120 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1120 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1121 </conversion-rule>
1121 </conversion-rule>
1122 </modify-argument>
1122 </modify-argument>
1123 </modify-function>
1123 </modify-function>
1124 <modify-function signature="setFuture(const QFuture &amp;)">
1124 <modify-function signature="setFuture(const QFuture &amp;)">
1125 <modify-argument index="1">
1125 <modify-argument index="1">
1126 <replace-type modified-type="QtScriptFuture*" />
1126 <replace-type modified-type="QtScriptFuture*" />
1127 <conversion-rule class="native">
1127 <conversion-rule class="native">
1128 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1128 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1129 </conversion-rule>
1129 </conversion-rule>
1130 </modify-argument>
1130 </modify-argument>
1131 </modify-function>
1131 </modify-function>
1132 <modify-function signature="futures()const" remove="all" />
1132 <modify-function signature="futures()const" remove="all" />
1133 </object-type>
1133 </object-type>
1134 <object-type name="QtScriptVoidFutureSynchronizer">
1134 <object-type name="QtScriptVoidFutureSynchronizer">
1135 <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
1135 <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
1136 <modify-argument index="1">
1136 <modify-argument index="1">
1137 <replace-type modified-type="QtScriptVoidFuture*" />
1137 <replace-type modified-type="QtScriptVoidFuture*" />
1138 <conversion-rule class="native">
1138 <conversion-rule class="native">
1139 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1139 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1140 </conversion-rule>
1140 </conversion-rule>
1141 </modify-argument>
1141 </modify-argument>
1142 </modify-function>
1142 </modify-function>
1143 <modify-function signature="addFuture(const QFuture &amp;)">
1143 <modify-function signature="addFuture(const QFuture &amp;)">
1144 <modify-argument index="1">
1144 <modify-argument index="1">
1145 <replace-type modified-type="QtScriptVoidFuture*" />
1145 <replace-type modified-type="QtScriptVoidFuture*" />
1146 <conversion-rule class="native">
1146 <conversion-rule class="native">
1147 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1147 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1148 </conversion-rule>
1148 </conversion-rule>
1149 </modify-argument>
1149 </modify-argument>
1150 </modify-function>
1150 </modify-function>
1151 <modify-function signature="setFuture(const QFuture &amp;)">
1151 <modify-function signature="setFuture(const QFuture &amp;)">
1152 <modify-argument index="1">
1152 <modify-argument index="1">
1153 <replace-type modified-type="QtScriptVoidFuture*" />
1153 <replace-type modified-type="QtScriptVoidFuture*" />
1154 <conversion-rule class="native">
1154 <conversion-rule class="native">
1155 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1155 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1156 </conversion-rule>
1156 </conversion-rule>
1157 </modify-argument>
1157 </modify-argument>
1158 </modify-function>
1158 </modify-function>
1159 <modify-function signature="futures()const" remove="all" />
1159 <modify-function signature="futures()const" remove="all" />
1160 </object-type>
1160 </object-type>
1161
1161
1162 <object-type name="QtScriptFutureIterator">
1162 <object-type name="QtScriptFutureIterator">
1163 <modify-function signature="QFutureIterator(const QFuture &amp;)">
1163 <modify-function signature="QFutureIterator(const QFuture &amp;)">
1164 <modify-argument index="1">
1164 <modify-argument index="1">
1165 <replace-type modified-type="QtScriptFuture*" />
1165 <replace-type modified-type="QtScriptFuture*" />
1166 <conversion-rule class="native">
1166 <conversion-rule class="native">
1167 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1167 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1168 </conversion-rule>
1168 </conversion-rule>
1169 </modify-argument>
1169 </modify-argument>
1170 </modify-function>
1170 </modify-function>
1171 </object-type>
1171 </object-type>
1172
1172
1173
1173
1174 <!-- QXMLStream stream stuff. This was moved from QtXml to QtCore in 4.4 -->
1174 <!-- QXMLStream stream stuff. This was moved from QtXml to QtCore in 4.4 -->
1175
1175
1176 <enum-type name="QXmlStreamReader::Error" />
1176 <enum-type name="QXmlStreamReader::Error" />
1177 <enum-type name="QXmlStreamReader::TokenType" />
1177 <enum-type name="QXmlStreamReader::TokenType" />
1178
1178
1179 <value-type name="QXmlStreamAttribute">
1179 <value-type name="QXmlStreamAttribute">
1180 <modify-function signature="operator=(QXmlStreamAttribute)" remove="all"/>
1180 <modify-function signature="operator=(QXmlStreamAttribute)" remove="all"/>
1181
1181
1182 <modify-function signature="name()const">
1182 <modify-function signature="name()const">
1183 <modify-argument index="return">
1183 <modify-argument index="return">
1184 <conversion-rule class="native">
1184 <conversion-rule class="native">
1185 <insert-template name="core.convert_stringref_to_string"/>
1185 <insert-template name="core.convert_stringref_to_string"/>
1186 </conversion-rule>
1186 </conversion-rule>
1187 </modify-argument>
1187 </modify-argument>
1188 </modify-function>
1188 </modify-function>
1189
1189
1190 <modify-function signature="namespaceUri()const">
1190 <modify-function signature="namespaceUri()const">
1191 <modify-argument index="return">
1191 <modify-argument index="return">
1192 <conversion-rule class="native">
1192 <conversion-rule class="native">
1193 <insert-template name="core.convert_stringref_to_string"/>
1193 <insert-template name="core.convert_stringref_to_string"/>
1194 </conversion-rule>
1194 </conversion-rule>
1195 </modify-argument>
1195 </modify-argument>
1196 </modify-function>
1196 </modify-function>
1197
1197
1198 <modify-function signature="prefix()const">
1198 <modify-function signature="prefix()const">
1199 <modify-argument index="return">
1199 <modify-argument index="return">
1200 <conversion-rule class="native">
1200 <conversion-rule class="native">
1201 <insert-template name="core.convert_stringref_to_string"/>
1201 <insert-template name="core.convert_stringref_to_string"/>
1202 </conversion-rule>
1202 </conversion-rule>
1203 </modify-argument>
1203 </modify-argument>
1204 </modify-function>
1204 </modify-function>
1205
1205
1206 <modify-function signature="qualifiedName()const">
1206 <modify-function signature="qualifiedName()const">
1207 <modify-argument index="return">
1207 <modify-argument index="return">
1208 <conversion-rule class="native">
1208 <conversion-rule class="native">
1209 <insert-template name="core.convert_stringref_to_string"/>
1209 <insert-template name="core.convert_stringref_to_string"/>
1210 </conversion-rule>
1210 </conversion-rule>
1211 </modify-argument>
1211 </modify-argument>
1212 </modify-function>
1212 </modify-function>
1213
1213
1214 <modify-function signature="value()const">
1214 <modify-function signature="value()const">
1215 <modify-argument index="return">
1215 <modify-argument index="return">
1216 <conversion-rule class="native">
1216 <conversion-rule class="native">
1217 <insert-template name="core.convert_stringref_to_string"/>
1217 <insert-template name="core.convert_stringref_to_string"/>
1218 </conversion-rule>
1218 </conversion-rule>
1219 </modify-argument>
1219 </modify-argument>
1220 </modify-function>
1220 </modify-function>
1221
1221
1222 </value-type>
1222 </value-type>
1223
1223
1224 <value-type name="QXmlStreamAttributes">
1224 <value-type name="QXmlStreamAttributes">
1225 <modify-function signature="operator+(QVector&lt;QXmlStreamAttribute>)const" remove="all"/>
1225 <modify-function signature="operator+(QVector&lt;QXmlStreamAttribute>)const" remove="all"/>
1226 <modify-function signature="operator&lt;&lt;(QVector&lt;QXmlStreamAttribute>)" remove="all"/>
1226 <modify-function signature="operator&lt;&lt;(QVector&lt;QXmlStreamAttribute>)" remove="all"/>
1227 <modify-function signature="operator&lt;&lt;(QXmlStreamAttribute)" remove="all"/>
1227 <modify-function signature="operator&lt;&lt;(QXmlStreamAttribute)" remove="all"/>
1228 <modify-function signature="push_back(QXmlStreamAttribute)" remove="all"/>
1228 <modify-function signature="push_back(QXmlStreamAttribute)" remove="all"/>
1229 <modify-function signature="pop_back()" remove="all"/>
1229 <modify-function signature="pop_back()" remove="all"/>
1230 <modify-function signature="push_front(QXmlStreamAttribute)" remove="all"/>
1230 <modify-function signature="push_front(QXmlStreamAttribute)" remove="all"/>
1231 <modify-function signature="pop_front()" remove="all"/>
1231 <modify-function signature="pop_front()" remove="all"/>
1232
1232
1233 <modify-function signature="value(const QString &amp;, const QLatin1String &amp;)const">
1233 <modify-function signature="value(const QString &amp;, const QLatin1String &amp;)const">
1234 <remove />
1234 <remove />
1235 </modify-function>
1235 </modify-function>
1236 <modify-function signature="value(const QLatin1String &amp;, const QLatin1String &amp;)const">
1236 <modify-function signature="value(const QLatin1String &amp;, const QLatin1String &amp;)const">
1237 <remove />
1237 <remove />
1238 </modify-function>
1238 </modify-function>
1239 <modify-function signature="value(const QLatin1String &amp;)const">
1239 <modify-function signature="value(const QLatin1String &amp;)const">
1240 <remove />
1240 <remove />
1241 </modify-function>
1241 </modify-function>
1242 <modify-function signature="hasAttribute(const QLatin1String &amp;)const">
1242 <modify-function signature="hasAttribute(const QLatin1String &amp;)const">
1243 <remove />
1243 <remove />
1244 </modify-function>
1244 </modify-function>
1245
1245
1246
1246
1247 <modify-function signature="value(QString,QString)const">
1247 <modify-function signature="value(QString,QString)const">
1248 <modify-argument index="return">
1248 <modify-argument index="return">
1249 <conversion-rule class="native">
1249 <conversion-rule class="native">
1250 <insert-template name="core.convert_stringref_to_string"/>
1250 <insert-template name="core.convert_stringref_to_string"/>
1251 </conversion-rule>
1251 </conversion-rule>
1252 </modify-argument>
1252 </modify-argument>
1253 </modify-function>
1253 </modify-function>
1254
1254
1255 <modify-function signature="value(QString)const">
1255 <modify-function signature="value(QString)const">
1256 <modify-argument index="return">
1256 <modify-argument index="return">
1257 <conversion-rule class="native">
1257 <conversion-rule class="native">
1258 <insert-template name="core.convert_stringref_to_string"/>
1258 <insert-template name="core.convert_stringref_to_string"/>
1259 </conversion-rule>
1259 </conversion-rule>
1260 </modify-argument>
1260 </modify-argument>
1261 </modify-function>
1261 </modify-function>
1262
1262
1263 </value-type>
1263 </value-type>
1264
1264
1265 <value-type name="QXmlStreamNamespaceDeclaration">
1265 <value-type name="QXmlStreamNamespaceDeclaration">
1266 <modify-function signature="operator=(QXmlStreamNamespaceDeclaration)" remove="all"/>
1266 <modify-function signature="operator=(QXmlStreamNamespaceDeclaration)" remove="all"/>
1267
1267
1268 <modify-function signature="namespaceUri()const">
1268 <modify-function signature="namespaceUri()const">
1269 <modify-argument index="return">
1269 <modify-argument index="return">
1270 <conversion-rule class="native">
1270 <conversion-rule class="native">
1271 <insert-template name="core.convert_stringref_to_string"/>
1271 <insert-template name="core.convert_stringref_to_string"/>
1272 </conversion-rule>
1272 </conversion-rule>
1273 </modify-argument>
1273 </modify-argument>
1274 </modify-function>
1274 </modify-function>
1275
1275
1276 <modify-function signature="prefix()const">
1276 <modify-function signature="prefix()const">
1277 <modify-argument index="return">
1277 <modify-argument index="return">
1278 <conversion-rule class="native">
1278 <conversion-rule class="native">
1279 <insert-template name="core.convert_stringref_to_string"/>
1279 <insert-template name="core.convert_stringref_to_string"/>
1280 </conversion-rule>
1280 </conversion-rule>
1281 </modify-argument>
1281 </modify-argument>
1282 </modify-function>
1282 </modify-function>
1283
1283
1284 </value-type>
1284 </value-type>
1285
1285
1286 <value-type name="QXmlStreamNotationDeclaration">
1286 <value-type name="QXmlStreamNotationDeclaration">
1287 <modify-function signature="operator=(QXmlStreamNotationDeclaration)" remove="all"/>
1287 <modify-function signature="operator=(QXmlStreamNotationDeclaration)" remove="all"/>
1288
1288
1289 <modify-function signature="name()const">
1289 <modify-function signature="name()const">
1290 <modify-argument index="return">
1290 <modify-argument index="return">
1291 <conversion-rule class="native">
1291 <conversion-rule class="native">
1292 <insert-template name="core.convert_stringref_to_string"/>
1292 <insert-template name="core.convert_stringref_to_string"/>
1293 </conversion-rule>
1293 </conversion-rule>
1294 </modify-argument>
1294 </modify-argument>
1295 </modify-function>
1295 </modify-function>
1296
1296
1297 <modify-function signature="publicId()const">
1297 <modify-function signature="publicId()const">
1298 <modify-argument index="return">
1298 <modify-argument index="return">
1299 <conversion-rule class="native">
1299 <conversion-rule class="native">
1300 <insert-template name="core.convert_stringref_to_string"/>
1300 <insert-template name="core.convert_stringref_to_string"/>
1301 </conversion-rule>
1301 </conversion-rule>
1302 </modify-argument>
1302 </modify-argument>
1303 </modify-function>
1303 </modify-function>
1304
1304
1305 <modify-function signature="systemId()const">
1305 <modify-function signature="systemId()const">
1306 <modify-argument index="return">
1306 <modify-argument index="return">
1307 <conversion-rule class="native">
1307 <conversion-rule class="native">
1308 <insert-template name="core.convert_stringref_to_string"/>
1308 <insert-template name="core.convert_stringref_to_string"/>
1309 </conversion-rule>
1309 </conversion-rule>
1310 </modify-argument>
1310 </modify-argument>
1311 </modify-function>
1311 </modify-function>
1312
1312
1313 </value-type>
1313 </value-type>
1314
1314
1315 <value-type name="QXmlStreamEntityDeclaration">
1315 <value-type name="QXmlStreamEntityDeclaration">
1316 <modify-function signature="operator=(QXmlStreamEntityDeclaration)" remove="all"/>
1316 <modify-function signature="operator=(QXmlStreamEntityDeclaration)" remove="all"/>
1317
1317
1318 <modify-function signature="name()const">
1318 <modify-function signature="name()const">
1319 <modify-argument index="return">
1319 <modify-argument index="return">
1320 <conversion-rule class="native">
1320 <conversion-rule class="native">
1321 <insert-template name="core.convert_stringref_to_string"/>
1321 <insert-template name="core.convert_stringref_to_string"/>
1322 </conversion-rule>
1322 </conversion-rule>
1323 </modify-argument>
1323 </modify-argument>
1324 </modify-function>
1324 </modify-function>
1325
1325
1326 <modify-function signature="notationName()const">
1326 <modify-function signature="notationName()const">
1327 <modify-argument index="return">
1327 <modify-argument index="return">
1328 <conversion-rule class="native">
1328 <conversion-rule class="native">
1329 <insert-template name="core.convert_stringref_to_string"/>
1329 <insert-template name="core.convert_stringref_to_string"/>
1330 </conversion-rule>
1330 </conversion-rule>
1331 </modify-argument>
1331 </modify-argument>
1332 </modify-function>
1332 </modify-function>
1333
1333
1334 <modify-function signature="publicId()const">
1334 <modify-function signature="publicId()const">
1335 <modify-argument index="return">
1335 <modify-argument index="return">
1336 <conversion-rule class="native">
1336 <conversion-rule class="native">
1337 <insert-template name="core.convert_stringref_to_string"/>
1337 <insert-template name="core.convert_stringref_to_string"/>
1338 </conversion-rule>
1338 </conversion-rule>
1339 </modify-argument>
1339 </modify-argument>
1340 </modify-function>
1340 </modify-function>
1341
1341
1342 <modify-function signature="systemId()const">
1342 <modify-function signature="systemId()const">
1343 <modify-argument index="return">
1343 <modify-argument index="return">
1344 <conversion-rule class="native">
1344 <conversion-rule class="native">
1345 <insert-template name="core.convert_stringref_to_string"/>
1345 <insert-template name="core.convert_stringref_to_string"/>
1346 </conversion-rule>
1346 </conversion-rule>
1347 </modify-argument>
1347 </modify-argument>
1348 </modify-function>
1348 </modify-function>
1349
1349
1350 <modify-function signature="value()const">
1350 <modify-function signature="value()const">
1351 <modify-argument index="return">
1351 <modify-argument index="return">
1352 <conversion-rule class="native">
1352 <conversion-rule class="native">
1353 <insert-template name="core.convert_stringref_to_string"/>
1353 <insert-template name="core.convert_stringref_to_string"/>
1354 </conversion-rule>
1354 </conversion-rule>
1355 </modify-argument>
1355 </modify-argument>
1356 </modify-function>
1356 </modify-function>
1357
1357
1358 </value-type>
1358 </value-type>
1359
1359
1360 <object-type name="QXmlStreamReader">
1360 <object-type name="QXmlStreamReader">
1361 <modify-function signature="QXmlStreamReader(const char*)" remove="all" />
1361 <modify-function signature="QXmlStreamReader(const char*)" remove="all" />
1362 <modify-function signature="addData(const char*)" remove="all" />
1362 <modify-function signature="addData(const char*)" remove="all" />
1363 <modify-function signature="setEntityResolver(QXmlStreamEntityResolver*)">
1363 <modify-function signature="setEntityResolver(QXmlStreamEntityResolver*)">
1364 <modify-argument index="1">
1364 <modify-argument index="1">
1365 <reference-count action="set" variable-name="__rcEntityResolver" />
1365 <reference-count action="set" variable-name="__rcEntityResolver" />
1366 </modify-argument>
1366 </modify-argument>
1367 </modify-function>
1367 </modify-function>
1368
1368
1369 <modify-function signature="name()const">
1369 <modify-function signature="name()const">
1370 <modify-argument index="return">
1370 <modify-argument index="return">
1371 <conversion-rule class="native">
1371 <conversion-rule class="native">
1372 <insert-template name="core.convert_stringref_to_string"/>
1372 <insert-template name="core.convert_stringref_to_string"/>
1373 </conversion-rule>
1373 </conversion-rule>
1374 </modify-argument>
1374 </modify-argument>
1375 </modify-function>
1375 </modify-function>
1376
1376
1377 <modify-function signature="documentEncoding()const">
1377 <modify-function signature="documentEncoding()const">
1378 <modify-argument index="return">
1378 <modify-argument index="return">
1379 <conversion-rule class="native">
1379 <conversion-rule class="native">
1380 <insert-template name="core.convert_stringref_to_string"/>
1380 <insert-template name="core.convert_stringref_to_string"/>
1381 </conversion-rule>
1381 </conversion-rule>
1382 </modify-argument>
1382 </modify-argument>
1383 </modify-function>
1383 </modify-function>
1384
1384
1385 <modify-function signature="documentVersion()const">
1385 <modify-function signature="documentVersion()const">
1386 <modify-argument index="return">
1386 <modify-argument index="return">
1387 <conversion-rule class="native">
1387 <conversion-rule class="native">
1388 <insert-template name="core.convert_stringref_to_string"/>
1388 <insert-template name="core.convert_stringref_to_string"/>
1389 </conversion-rule>
1389 </conversion-rule>
1390 </modify-argument>
1390 </modify-argument>
1391 </modify-function>
1391 </modify-function>
1392
1392
1393 <modify-function signature="dtdName()const">
1393 <modify-function signature="dtdName()const">
1394 <modify-argument index="return">
1394 <modify-argument index="return">
1395 <conversion-rule class="native">
1395 <conversion-rule class="native">
1396 <insert-template name="core.convert_stringref_to_string"/>
1396 <insert-template name="core.convert_stringref_to_string"/>
1397 </conversion-rule>
1397 </conversion-rule>
1398 </modify-argument>
1398 </modify-argument>
1399 </modify-function>
1399 </modify-function>
1400
1400
1401 <modify-function signature="dtdPublicId()const">
1401 <modify-function signature="dtdPublicId()const">
1402 <modify-argument index="return">
1402 <modify-argument index="return">
1403 <conversion-rule class="native">
1403 <conversion-rule class="native">
1404 <insert-template name="core.convert_stringref_to_string"/>
1404 <insert-template name="core.convert_stringref_to_string"/>
1405 </conversion-rule>
1405 </conversion-rule>
1406 </modify-argument>
1406 </modify-argument>
1407 </modify-function>
1407 </modify-function>
1408
1408
1409 <modify-function signature="dtdSystemId()const">
1409 <modify-function signature="dtdSystemId()const">
1410 <modify-argument index="return">
1410 <modify-argument index="return">
1411 <conversion-rule class="native">
1411 <conversion-rule class="native">
1412 <insert-template name="core.convert_stringref_to_string"/>
1412 <insert-template name="core.convert_stringref_to_string"/>
1413 </conversion-rule>
1413 </conversion-rule>
1414 </modify-argument>
1414 </modify-argument>
1415 </modify-function>
1415 </modify-function>
1416
1416
1417 <modify-function signature="namespaceUri()const">
1417 <modify-function signature="namespaceUri()const">
1418 <modify-argument index="return">
1418 <modify-argument index="return">
1419 <conversion-rule class="native">
1419 <conversion-rule class="native">
1420 <insert-template name="core.convert_stringref_to_string"/>
1420 <insert-template name="core.convert_stringref_to_string"/>
1421 </conversion-rule>
1421 </conversion-rule>
1422 </modify-argument>
1422 </modify-argument>
1423 </modify-function>
1423 </modify-function>
1424
1424
1425 <modify-function signature="prefix()const">
1425 <modify-function signature="prefix()const">
1426 <modify-argument index="return">
1426 <modify-argument index="return">
1427 <conversion-rule class="native">
1427 <conversion-rule class="native">
1428 <insert-template name="core.convert_stringref_to_string"/>
1428 <insert-template name="core.convert_stringref_to_string"/>
1429 </conversion-rule>
1429 </conversion-rule>
1430 </modify-argument>
1430 </modify-argument>
1431 </modify-function>
1431 </modify-function>
1432
1432
1433 <modify-function signature="processingInstructionData()const">
1433 <modify-function signature="processingInstructionData()const">
1434 <modify-argument index="return">
1434 <modify-argument index="return">
1435 <conversion-rule class="native">
1435 <conversion-rule class="native">
1436 <insert-template name="core.convert_stringref_to_string"/>
1436 <insert-template name="core.convert_stringref_to_string"/>
1437 </conversion-rule>
1437 </conversion-rule>
1438 </modify-argument>
1438 </modify-argument>
1439 </modify-function>
1439 </modify-function>
1440
1440
1441 <modify-function signature="processingInstructionTarget()const">
1441 <modify-function signature="processingInstructionTarget()const">
1442 <modify-argument index="return">
1442 <modify-argument index="return">
1443 <conversion-rule class="native">
1443 <conversion-rule class="native">
1444 <insert-template name="core.convert_stringref_to_string"/>
1444 <insert-template name="core.convert_stringref_to_string"/>
1445 </conversion-rule>
1445 </conversion-rule>
1446 </modify-argument>
1446 </modify-argument>
1447 </modify-function>
1447 </modify-function>
1448
1448
1449 <modify-function signature="qualifiedName()const">
1449 <modify-function signature="qualifiedName()const">
1450 <modify-argument index="return">
1450 <modify-argument index="return">
1451 <conversion-rule class="native">
1451 <conversion-rule class="native">
1452 <insert-template name="core.convert_stringref_to_string"/>
1452 <insert-template name="core.convert_stringref_to_string"/>
1453 </conversion-rule>
1453 </conversion-rule>
1454 </modify-argument>
1454 </modify-argument>
1455 </modify-function>
1455 </modify-function>
1456
1456
1457 <modify-function signature="text()const">
1457 <modify-function signature="text()const">
1458 <modify-argument index="return">
1458 <modify-argument index="return">
1459 <conversion-rule class="native">
1459 <conversion-rule class="native">
1460 <insert-template name="core.convert_stringref_to_string"/>
1460 <insert-template name="core.convert_stringref_to_string"/>
1461 </conversion-rule>
1461 </conversion-rule>
1462 </modify-argument>
1462 </modify-argument>
1463 </modify-function>
1463 </modify-function>
1464 </object-type>
1464 </object-type>
1465
1465
1466 <object-type name="QXmlStreamWriter">
1466 <object-type name="QXmlStreamWriter">
1467 <modify-function signature="QXmlStreamWriter(QString *)">
1467 <modify-function signature="QXmlStreamWriter(QString *)">
1468 <remove />
1468 <remove />
1469 </modify-function>
1469 </modify-function>
1470
1470
1471 <modify-function signature="setCodec(const char*)">
1471 <modify-function signature="setCodec(const char*)">
1472 <modify-argument index="1">
1472 <modify-argument index="1">
1473 <replace-type modified-type="QString"/>
1473 <replace-type modified-type="QString"/>
1474 <conversion-rule class="native">
1474 <conversion-rule class="native">
1475 <insert-template name="core.convert_string_arg_to_char*"/>
1475 <insert-template name="core.convert_string_arg_to_char*"/>
1476 </conversion-rule>
1476 </conversion-rule>
1477 </modify-argument>
1477 </modify-argument>
1478 </modify-function>
1478 </modify-function>
1479
1479
1480 <modify-function signature="writeCurrentToken(QXmlStreamReader)">
1480 <modify-function signature="writeCurrentToken(QXmlStreamReader)">
1481 <modify-argument index="1">
1481 <modify-argument index="1">
1482 <replace-type modified-type="QXmlStreamReader*"/>
1482 <replace-type modified-type="QXmlStreamReader*"/>
1483 <conversion-rule class="native">
1483 <conversion-rule class="native">
1484 QXmlStreamReader &amp; %out% = *qscriptvalue_cast&lt;QXmlStreamReader*&gt;(%in%);
1484 QXmlStreamReader &amp; %out% = *qscriptvalue_cast&lt;QXmlStreamReader*&gt;(%in%);
1485 </conversion-rule>
1485 </conversion-rule>
1486 </modify-argument>
1486 </modify-argument>
1487 </modify-function>
1487 </modify-function>
1488
1488
1489 </object-type>
1489 </object-type>
1490
1490
1491 <value-type name="QEasingCurve">
1491 <value-type name="QEasingCurve">
1492 <modify-function signature="QEasingCurve(QEasingCurve)" remove="all" />
1492 <modify-function signature="QEasingCurve(QEasingCurve)" remove="all" />
1493 <modify-function signature="operator=(QEasingCurve)" remove="all"/>
1493 <modify-function signature="operator=(QEasingCurve)" remove="all"/>
1494 <modify-function signature="operator==(const QEasingCurve &amp;)const" remove="all"/>
1494 <modify-function signature="operator==(const QEasingCurve &amp;)const" remove="all"/>
1495 <modify-function signature="operator!=(const QEasingCurve &amp;)const" remove="all"/>
1495 <modify-function signature="operator!=(const QEasingCurve &amp;)const" remove="all"/>
1496 <modify-function signature="setCustomType(double)" remove="all"/>
1496 <modify-function signature="setCustomType(double)" remove="all"/>
1497 <modify-function signature="customType()const" remove="all"/>
1497 <modify-function signature="customType()const" remove="all"/>
1498 </value-type>
1498 </value-type>
1499
1499
1500 <object-type name="QPropertyAnimation">
1500 <object-type name="QPropertyAnimation">
1501 <modify-function signature="QPropertyAnimation(QObject*,QByteArray,QObject*)">
1501 <modify-function signature="QPropertyAnimation(QObject*,QByteArray,QObject*)">
1502 <modify-argument index="2">
1502 <modify-argument index="2">
1503 <replace-type modified-type="QString"/>
1503 <replace-type modified-type="QString"/>
1504 <conversion-rule class="native">
1504 <conversion-rule class="native">
1505 <insert-template name="core.convert_string_arg_to_latin1"/>
1505 <insert-template name="core.convert_string_arg_to_latin1"/>
1506 </conversion-rule>
1506 </conversion-rule>
1507 </modify-argument>
1507 </modify-argument>
1508 </modify-function>
1508 </modify-function>
1509 </object-type>
1509 </object-type>
1510
1510
1511 <object-type name="QState">
1511 <object-type name="QState">
1512 <modify-function signature="addTransition(QObject*,const char*,QAbstractState*)">
1512 <modify-function signature="addTransition(QObject*,const char*,QAbstractState*)">
1513 <modify-argument index="2">
1513 <modify-argument index="2">
1514 <replace-type modified-type="QString"/>
1514 <replace-type modified-type="QString"/>
1515 <conversion-rule class="native">
1515 <conversion-rule class="native">
1516 <insert-template name="core.convert_string_arg_to_char*"/>
1516 <insert-template name="core.convert_string_arg_to_char*"/>
1517 </conversion-rule>
1517 </conversion-rule>
1518 </modify-argument>
1518 </modify-argument>
1519 </modify-function>
1519 </modify-function>
1520 <modify-function signature="assignProperty(QObject*,const char*,QVariant)">
1520 <modify-function signature="assignProperty(QObject*,const char*,QVariant)">
1521 <modify-argument index="2">
1521 <modify-argument index="2">
1522 <replace-type modified-type="QString"/>
1522 <replace-type modified-type="QString"/>
1523 <conversion-rule class="native">
1523 <conversion-rule class="native">
1524 <insert-template name="core.convert_string_arg_to_char*"/>
1524 <insert-template name="core.convert_string_arg_to_char*"/>
1525 </conversion-rule>
1525 </conversion-rule>
1526 </modify-argument>
1526 </modify-argument>
1527 </modify-function>
1527 </modify-function>
1528 </object-type>
1528 </object-type>
1529
1529
1530 <value-type name="QRegExp">
1530 <value-type name="QRegExp">
1531 <modify-function signature="cap(int)" remove="all"/>
1531 <modify-function signature="cap(int)" remove="all"/>
1532 <modify-function signature="capturedTexts()" remove="all"/>
1532 <modify-function signature="capturedTexts()" remove="all"/>
1533 <modify-function signature="pos(int)" remove="all"/>
1533 <modify-function signature="pos(int)" remove="all"/>
1534 <modify-function signature="errorString()" remove="all"/>
1534 <modify-function signature="errorString()" remove="all"/>
1535 </value-type>
1535 </value-type>
1536
1536
1537 <primitive-type name="bool"/>
1537 <primitive-type name="bool"/>
1538 <primitive-type name="double"/>
1538 <primitive-type name="double"/>
1539 <primitive-type name="qreal"/>
1539 <primitive-type name="qreal"/>
1540 <primitive-type name="float"/>
1540 <primitive-type name="float"/>
1541 <primitive-type name="qint64"/>
1541 <primitive-type name="qint64"/>
1542 <primitive-type name="__int64"/>
1542 <primitive-type name="__int64"/>
1543 <primitive-type name="unsigned __int64"/>
1543 <primitive-type name="unsigned __int64"/>
1544 <primitive-type name="unsigned long long"/>
1544 <primitive-type name="unsigned long long"/>
1545 <primitive-type name="long long"/>
1545 <primitive-type name="long long"/>
1546 <primitive-type name="qlonglong"/>
1546 <primitive-type name="qlonglong"/>
1547 <primitive-type name="qulonglong"/>
1547 <primitive-type name="qulonglong"/>
1548 <primitive-type name="short"/>
1548 <primitive-type name="short"/>
1549 <primitive-type name="short"/>
1549 <primitive-type name="short"/>
1550 <primitive-type name="signed short"/>
1550 <primitive-type name="signed short"/>
1551 <primitive-type name="ushort"/>
1551 <primitive-type name="ushort"/>
1552 <primitive-type name="unsigned short"/>
1552 <primitive-type name="unsigned short"/>
1553 <primitive-type name="char"/>
1553 <primitive-type name="char"/>
1554 <primitive-type name="signed char"/>
1554 <primitive-type name="signed char"/>
1555 <primitive-type name="uchar"/>
1555 <primitive-type name="uchar"/>
1556 <primitive-type name="unsigned char"/>
1556 <primitive-type name="unsigned char"/>
1557 <primitive-type name="int"/>
1557 <primitive-type name="int"/>
1558 <primitive-type name="signed int"/>
1558 <primitive-type name="signed int"/>
1559 <primitive-type name="uint"/>
1559 <primitive-type name="uint"/>
1560 <primitive-type name="ulong"/>
1560 <primitive-type name="ulong"/>
1561 <primitive-type name="unsigned int"/>
1561 <primitive-type name="unsigned int"/>
1562 <primitive-type name="signed long"/>
1562 <primitive-type name="signed long"/>
1563 <primitive-type name="long"/>
1563 <primitive-type name="long"/>
1564 <primitive-type name="unsigned long"/>
1564 <primitive-type name="unsigned long"/>
1565 <primitive-type name="WId"/>
1565 <primitive-type name="WId"/>
1566 <primitive-type name="Qt::HANDLE"/>
1566 <primitive-type name="Qt::HANDLE"/>
1567 <primitive-type name="QVariant::Type"/>
1567 <primitive-type name="QVariant::Type"/>
1568 <primitive-type name="QByteRef"/>
1568 <primitive-type name="QByteRef"/>
1569 <primitive-type name="QBitRef"/>
1569 <primitive-type name="QBitRef"/>
1570 <primitive-type name="QBool"/>
1570 <primitive-type name="QBool"/>
1571 <primitive-type name="jobject"/>
1571 <primitive-type name="jobject"/>
1572 <primitive-type name="quintptr"/>
1572 <primitive-type name="quintptr"/>
1573
1573
1574 <suppress-warning text="WARNING(MetaJavaBuilder) :: signal 'finished' in class 'QProcess' is overloaded." />
1574 <suppress-warning text="WARNING(MetaJavaBuilder) :: signal 'finished' in class 'QProcess' is overloaded." />
1575 <suppress-warning text="WARNING(MetaJavaBuilder) :: missing required class for enums: QRegExp" />
1575 <suppress-warning text="WARNING(MetaJavaBuilder) :: missing required class for enums: QRegExp" />
1576 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QtValidLicenseForScriptToolsModule' does not have a type entry or is not an enum" />
1576 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QtValidLicenseForScriptToolsModule' does not have a type entry or is not an enum" />
1577 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QDataStream::Qt_4_5" />
1577 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QDataStream::Qt_4_5" />
1578 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::MatchFlags(Qt::MatchStartsWith in Qt::MatchFlag" />
1578 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::MatchFlags(Qt::MatchStartsWith in Qt::MatchFlag" />
1579 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::MatchWrap) in Qt::MatchFlag" />
1579 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::MatchWrap) in Qt::MatchFlag" />
1580 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap) when parsing default value of 'match' in class 'QAbstractItemModel'" />
1580 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap) when parsing default value of 'match' in class 'QAbstractItemModel'" />
1581
1581
1582 <suppress-warning text="WARNING(MetaJavaBuilder) :: Unable to decide type of property: 'Qt::GestureState' in class 'QGesture'" />
1582 <suppress-warning text="WARNING(MetaJavaBuilder) :: Unable to decide type of property: 'Qt::GestureState' in class 'QGesture'" />
1583 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'Qt::GestureState' does not have a type entry or is not an enum" />
1583 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'Qt::GestureState' does not have a type entry or is not an enum" />
1584 <suppress-warning text="WARNING(MetaJavaBuilder) :: template baseclass 'QGenericMatrix&lt;qreal&gt;' of 'QMatrix3x3' is not known" />
1584 <suppress-warning text="WARNING(MetaJavaBuilder) :: template baseclass 'QGenericMatrix&lt;qreal&gt;' of 'QMatrix3x3' is not known" />
1585 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~0u in Qt::GestureType" />
1585 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~0u in Qt::GestureType" />
1586 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~0u" />
1586 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~0u" />
1587 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::GestureFlags() in Qt::GestureFlag" />
1587 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::GestureFlags() in Qt::GestureFlag" />
1588 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::GestureFlags() when parsing default value of 'grabGesture' in class 'QWidget'" />
1588 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::GestureFlags() when parsing default value of 'grabGesture' in class 'QWidget'" />
1589 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::GestureFlags() when parsing default value of 'grabGesture' in class 'QGraphicsObject'" />
1589 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::GestureFlags() when parsing default value of 'grabGesture' in class 'QGraphicsObject'" />
1590
1590
1591 <!-- some catch-all warning suppressions -->
1591 <!-- some catch-all warning suppressions -->
1592 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QLatin1String(defaultConnection)' of argument in function '*', class '*'"/>
1592 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QLatin1String(defaultConnection)' of argument in function '*', class '*'"/>
1593 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class '*' has equals operators but no qHash() function" />
1593 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class '*' has equals operators but no qHash() function" />
1594 <suppress-warning text="WARNING(MetaJavaBuilder) :: type '*' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
1594 <suppress-warning text="WARNING(MetaJavaBuilder) :: type '*' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
1595 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace '*' for enum '*' is not declared" />
1595 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace '*' for enum '*' is not declared" />
1596 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function '*', unmatched parameter type '*'" />
1596 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function '*', unmatched parameter type '*'" />
1597 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function '*', unmatched return type '*'" />
1597 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function '*', unmatched return type '*'" />
1598 <suppress-warning text="WARNING(MetaJavaBuilder) :: signature '*' for function modification in '*' not found. Possible candidates: " />
1598 <suppress-warning text="WARNING(MetaJavaBuilder) :: signature '*' for function modification in '*' not found. Possible candidates: " />
1599 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace '*' does not have a type entry" />
1599 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace '*' does not have a type entry" />
1600 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '*' of argument in function '*', class '*'" />
1600 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '*' of argument in function '*', class '*'" />
1601 <suppress-warning text="WARNING(MetaJavaBuilder) :: Shadowing: * and *; Java code will not compile" />
1601 <suppress-warning text="WARNING(MetaJavaBuilder) :: Shadowing: * and *; Java code will not compile" />
1602 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum '*' is specified in typesystem, but not declared" />
1602 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum '*' is specified in typesystem, but not declared" />
1603
1603
1604 </typesystem>
1604 </typesystem>
@@ -1,99 +1,106
1 <?xml version="1.0"?>
1 <?xml version="1.0"?>
2 <typesystem package="com.trolltech.qt.opengl"><rejection class="QGL"/><rejection class="QGLFormat"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function"/>
2 <typesystem package="com.trolltech.qt.opengl"><rejection class="QGL"/><rejection class="QGLFormat"/><suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function"/>
3 <rejection class="QGLColormap::QGLColormapData"/>
3 <rejection class="QGLColormap::QGLColormapData"/>
4 <rejection class="QGLWidget" function-name="setMouseTracking"/>
4 <rejection class="QGLWidget" function-name="setMouseTracking"/>
5
5
6 <enum-type name="QGL::FormatOption" flags="QGL::FormatOptions"/>
6 <enum-type name="QGL::FormatOption" flags="QGL::FormatOptions"/>
7 <enum-type name="QGLFormat::OpenGLVersionFlag" flags="QGLFormat::OpenGLVersionFlags"/>
7 <enum-type name="QGLFormat::OpenGLVersionFlag" flags="QGLFormat::OpenGLVersionFlags"/>
8 <enum-type name="QGLFramebufferObject::Attachment"/>
8 <enum-type name="QGLFramebufferObject::Attachment"/>
9 <enum-type name="QGLContext::BindOption" flags="QGLContext::BindOptions"/>
9 <enum-type name="QGLContext::BindOption" flags="QGLContext::BindOptions"/>
10 <enum-type name="QGLShader::ShaderTypeBit" flags="QGLShader::ShaderType"/>
10 <enum-type name="QGLShader::ShaderTypeBit" flags="QGLShader::ShaderType"/>
11
11
12 <enum-type name="QGLBuffer::Access"/>
13 <enum-type name="QGLBuffer::Type"/>
14 <enum-type name="QGLBuffer::UsagePattern"/>
15 <enum-type name="QGLFunctions::OpenGLFeature"/>
16 <enum-type name="QGLFormat::OpenGLContextProfile"/>
12
17
13 <namespace-type name="QGL">
18 <namespace-type name="QGL">
14 <include file-name="qgl.h" location="global"/>
19 <include file-name="qgl.h" location="global"/>
15 </namespace-type>
20 </namespace-type>
16
21
17 <value-type name="QGLColormap">
22 <value-type name="QGLColormap">
18 <modify-function signature="operator=(QGLColormap)" remove="all"/>
23 <modify-function signature="operator=(QGLColormap)" remove="all"/>
19
24
20 <modify-function signature="setEntries(int,const unsigned int*,int)">
25 <modify-function signature="setEntries(int,const unsigned int*,int)">
21 <access modifier="private"/>
26 <access modifier="private"/>
22 </modify-function>
27 </modify-function>
23 </value-type>
28 </value-type>
24
29
25 <value-type name="QGLFormat">
30 <value-type name="QGLFormat">
26 <modify-function signature="operator=(QGLFormat)" remove="all"/>
31 <modify-function signature="operator=(QGLFormat)" remove="all"/>
27 </value-type>
32 </value-type>
28
33
29 <value-type name="QGLFramebufferObjectFormat"/>
34 <value-type name="QGLFramebufferObjectFormat"/>
35 <object-type name="QGLFunctions"/>
36 <object-type name="QGLBuffer"/>
30 <object-type name="QGLShader"/>
37 <object-type name="QGLShader"/>
31 <object-type name="QGLShaderProgram">
38 <object-type name="QGLShaderProgram">
32 <!-- Should be disambiguated later by fixing the native pointer API -->
39 <!-- Should be disambiguated later by fixing the native pointer API -->
33 <modify-function signature="setAttributeArray(int, const QVector2D *, int)" rename="setAttributeArray_QVector2D"/>
40 <modify-function signature="setAttributeArray(int, const QVector2D *, int)" rename="setAttributeArray_QVector2D"/>
34 <modify-function signature="setAttributeArray(int, const QVector3D *, int)" rename="setAttributeArray_QVector3D"/>
41 <modify-function signature="setAttributeArray(int, const QVector3D *, int)" rename="setAttributeArray_QVector3D"/>
35 <modify-function signature="setAttributeArray(int, const QVector4D *, int)" rename="setAttributeArray_QVector4D"/>
42 <modify-function signature="setAttributeArray(int, const QVector4D *, int)" rename="setAttributeArray_QVector4D"/>
36 <modify-function signature="setAttributeArray(const char *, const QVector2D *, int)" rename="setAttributeArray_QVector2D"/>
43 <modify-function signature="setAttributeArray(const char *, const QVector2D *, int)" rename="setAttributeArray_QVector2D"/>
37 <modify-function signature="setAttributeArray(const char *, const QVector3D *, int)" rename="setAttributeArray_QVector3D"/>
44 <modify-function signature="setAttributeArray(const char *, const QVector3D *, int)" rename="setAttributeArray_QVector3D"/>
38 <modify-function signature="setAttributeArray(const char *, const QVector4D *, int)" rename="setAttributeArray_QVector4D"/>
45 <modify-function signature="setAttributeArray(const char *, const QVector4D *, int)" rename="setAttributeArray_QVector4D"/>
39 <modify-function signature="setUniformValueArray(int, const GLint *, int)" rename="setUniformValueArray_int"/>
46 <modify-function signature="setUniformValueArray(int, const GLint *, int)" rename="setUniformValueArray_int"/>
40 <modify-function signature="setUniformValueArray(int, const GLuint *, int)" rename="setUniformValueArray_uint"/>
47 <modify-function signature="setUniformValueArray(int, const GLuint *, int)" rename="setUniformValueArray_uint"/>
41 <modify-function signature="setUniformValueArray(int, const QVector2D *, int)" rename="setUniformValueArray_QVector2D"/>
48 <modify-function signature="setUniformValueArray(int, const QVector2D *, int)" rename="setUniformValueArray_QVector2D"/>
42 <modify-function signature="setUniformValueArray(int, const QVector3D *, int)" rename="setUniformValueArray_QVector3D"/>
49 <modify-function signature="setUniformValueArray(int, const QVector3D *, int)" rename="setUniformValueArray_QVector3D"/>
43 <modify-function signature="setUniformValueArray(int, const QVector4D *, int)" rename="setUniformValueArray_QVector4D"/>
50 <modify-function signature="setUniformValueArray(int, const QVector4D *, int)" rename="setUniformValueArray_QVector4D"/>
44
51
45 <modify-function signature="setUniformValueArray(const char*, const GLint *, int)" rename="setUniformValueArray_int"/>
52 <modify-function signature="setUniformValueArray(const char*, const GLint *, int)" rename="setUniformValueArray_int"/>
46 <modify-function signature="setUniformValueArray(const char*, const GLuint *, int)" remove="all"/>
53 <modify-function signature="setUniformValueArray(const char*, const GLuint *, int)" remove="all"/>
47 <modify-function signature="setUniformValueArray(const char*, const QVector2D *, int)" rename="setUniformValueArray_QVector2D"/>
54 <modify-function signature="setUniformValueArray(const char*, const QVector2D *, int)" rename="setUniformValueArray_QVector2D"/>
48 <modify-function signature="setUniformValueArray(const char*, const QVector3D *, int)" rename="setUniformValueArray_QVector3D"/>
55 <modify-function signature="setUniformValueArray(const char*, const QVector3D *, int)" rename="setUniformValueArray_QVector3D"/>
49 <modify-function signature="setUniformValueArray(const char*, const QVector4D *, int)" rename="setUniformValueArray_QVector4D"/>
56 <modify-function signature="setUniformValueArray(const char*, const QVector4D *, int)" rename="setUniformValueArray_QVector4D"/>
50 <modify-function signature="setUniformValue(int, GLuint)" remove="all"/>
57 <modify-function signature="setUniformValue(int, GLuint)" remove="all"/>
51 <modify-function signature="setUniformValue(const char*, GLuint)" remove="all"/>
58 <modify-function signature="setUniformValue(const char*, GLuint)" remove="all"/>
52 <modify-function signature="setUniformValue(int, Array)" remove="all"/>
59 <modify-function signature="setUniformValue(int, Array)" remove="all"/>
53 <modify-function signature="setUniformValue(const char*, Array)" remove="all"/>
60 <modify-function signature="setUniformValue(const char*, Array)" remove="all"/>
54 </object-type>
61 </object-type>
55 <object-type name="QGLContext">
62 <object-type name="QGLContext">
56
63
57 <modify-function signature="chooseContext(const QGLContext*)">
64 <modify-function signature="chooseContext(const QGLContext*)">
58 <modify-argument index="1" invalidate-after-use="yes"/>
65 <modify-argument index="1" invalidate-after-use="yes"/>
59 </modify-function>
66 </modify-function>
60 <modify-function signature="create(const QGLContext*)">
67 <modify-function signature="create(const QGLContext*)">
61 <modify-argument index="1" invalidate-after-use="yes"/>
68 <modify-argument index="1" invalidate-after-use="yes"/>
62 </modify-function>
69 </modify-function>
63
70
64 <modify-function signature="getProcAddress(QString)const">
71 <modify-function signature="getProcAddress(QString)const">
65 <remove/>
72 <remove/>
66 </modify-function>
73 </modify-function>
67 <modify-field name="currentCtx" read="false" write="false"/>
74 <modify-field name="currentCtx" read="false" write="false"/>
68 <modify-function signature="setDevice(QPaintDevice*)">
75 <modify-function signature="setDevice(QPaintDevice*)">
69 <remove/>
76 <remove/>
70 </modify-function>
77 </modify-function>
71 <modify-function signature="generateFontDisplayLists(QFont, int)" remove="all"/>
78 <modify-function signature="generateFontDisplayLists(QFont, int)" remove="all"/>
72 </object-type>
79 </object-type>
73 <object-type name="QGLFramebufferObject"/>
80 <object-type name="QGLFramebufferObject"/>
74 <object-type name="QGLPixelBuffer">
81 <object-type name="QGLPixelBuffer">
75 <extra-includes>
82 <extra-includes>
76 <include file-name="QImage" location="global"/>
83 <include file-name="QImage" location="global"/>
77 </extra-includes>
84 </extra-includes>
78 </object-type>
85 </object-type>
79 <object-type name="QGLWidget">
86 <object-type name="QGLWidget">
80 <extra-includes>
87 <extra-includes>
81 <include file-name="QImage" location="global"/>
88 <include file-name="QImage" location="global"/>
82 <include file-name="QPixmap" location="global"/>
89 <include file-name="QPixmap" location="global"/>
83 </extra-includes>
90 </extra-includes>
84 <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)">
91 <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)">
85 <remove/> <!--- Obsolete -->
92 <remove/> <!--- Obsolete -->
86 </modify-function>
93 </modify-function>
87 <modify-function signature="fontDisplayListBase(QFont, int)" remove="all"/>
94 <modify-function signature="fontDisplayListBase(QFont, int)" remove="all"/>
88 <modify-function signature="setFormat(QGLFormat)" remove="all"/>
95 <modify-function signature="setFormat(QGLFormat)" remove="all"/>
89 </object-type>
96 </object-type>
90
97
91 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
98 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
92 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFramebufferObjectFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
99 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFramebufferObjectFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
93
100
94 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QGLColormap::QGLColormapData\*'"/>
101 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QGLColormap::QGLColormapData\*'"/>
95 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
102 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
96 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
103 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
97 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
104 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
98
105
99 </typesystem>
106 </typesystem>
@@ -1,2067 +1,2094
1 /*
1 /*
2 *
2 *
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 *
4 *
5 * This library is free software; you can redistribute it and/or
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
8 * version 2.1 of the License, or (at your option) any later version.
9 *
9 *
10 * This library is distributed in the hope that it will be useful,
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
13 * Lesser General Public License for more details.
14 *
14 *
15 * Further, this software is distributed without any warranty that it is
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
20 * other software, or any other product whatsoever.
21 *
21 *
22 * You should have received a copy of the GNU Lesser General Public
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
25 *
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 * 28359 Bremen, Germany or:
27 * 28359 Bremen, Germany or:
28 *
28 *
29 * http://www.mevis.de
29 * http://www.mevis.de
30 *
30 *
31 */
31 */
32
32
33 //----------------------------------------------------------------------------------
33 //----------------------------------------------------------------------------------
34 /*!
34 /*!
35 // \file PythonQt.cpp
35 // \file PythonQt.cpp
36 // \author Florian Link
36 // \author Florian Link
37 // \author Last changed by $Author: florian $
37 // \author Last changed by $Author: florian $
38 // \date 2006-05
38 // \date 2006-05
39 */
39 */
40 //----------------------------------------------------------------------------------
40 //----------------------------------------------------------------------------------
41
41
42 #include "PythonQt.h"
42 #include "PythonQt.h"
43 #include "PythonQtImporter.h"
43 #include "PythonQtImporter.h"
44 #include "PythonQtClassInfo.h"
44 #include "PythonQtClassInfo.h"
45 #include "PythonQtMethodInfo.h"
45 #include "PythonQtMethodInfo.h"
46 #include "PythonQtSignal.h"
46 #include "PythonQtSignal.h"
47 #include "PythonQtSignalReceiver.h"
47 #include "PythonQtSignalReceiver.h"
48 #include "PythonQtConversion.h"
48 #include "PythonQtConversion.h"
49 #include "PythonQtStdIn.h"
49 #include "PythonQtStdIn.h"
50 #include "PythonQtStdOut.h"
50 #include "PythonQtStdOut.h"
51 #include "PythonQtCppWrapperFactory.h"
51 #include "PythonQtCppWrapperFactory.h"
52 #include "PythonQtVariants.h"
52 #include "PythonQtVariants.h"
53 #include "PythonQtStdDecorators.h"
53 #include "PythonQtStdDecorators.h"
54 #include "PythonQtQFileImporter.h"
54 #include "PythonQtQFileImporter.h"
55 #include <pydebug.h>
55 #include <pydebug.h>
56 #include <vector>
56 #include <vector>
57
57
58 PythonQt* PythonQt::_self = NULL;
58 PythonQt* PythonQt::_self = NULL;
59 int PythonQt::_uniqueModuleCount = 0;
59 int PythonQt::_uniqueModuleCount = 0;
60
60
61 void PythonQt_init_QtGuiBuiltin(PyObject*);
61 void PythonQt_init_QtGuiBuiltin(PyObject*);
62 void PythonQt_init_QtCoreBuiltin(PyObject*);
62 void PythonQt_init_QtCoreBuiltin(PyObject*);
63
63
64
64
65 PyObject* PythonQtConvertFromStringRef(const void* inObject, int /*metaTypeId*/)
65 PyObject* PythonQtConvertFromStringRef(const void* inObject, int /*metaTypeId*/)
66 {
66 {
67 return PythonQtConv::QStringToPyObject(((QStringRef*)inObject)->toString());
67 return PythonQtConv::QStringToPyObject(((QStringRef*)inObject)->toString());
68 }
68 }
69
69
70 void PythonQt::init(int flags, const QByteArray& pythonQtModuleName)
70 void PythonQt::init(int flags, const QByteArray& pythonQtModuleName)
71 {
71 {
72 if (!_self) {
72 if (!_self) {
73 _self = new PythonQt(flags, pythonQtModuleName);
73 _self = new PythonQt(flags, pythonQtModuleName);
74
74
75 PythonQt::priv()->setupSharedLibrarySuffixes();
75 PythonQt::priv()->setupSharedLibrarySuffixes();
76
76
77 PythonQtMethodInfo::addParameterTypeAlias("QObjectList", "QList<QObject*>");
77 PythonQtMethodInfo::addParameterTypeAlias("QObjectList", "QList<QObject*>");
78 qRegisterMetaType<QList<QObject*> >("QList<void*>");
78 qRegisterMetaType<QList<QObject*> >("QList<void*>");
79
79
80 int stringRefId = qRegisterMetaType<QStringRef>("QStringRef");
80 int stringRefId = qRegisterMetaType<QStringRef>("QStringRef");
81 PythonQtConv::registerMetaTypeToPythonConverter(stringRefId, PythonQtConvertFromStringRef);
81 PythonQtConv::registerMetaTypeToPythonConverter(stringRefId, PythonQtConvertFromStringRef);
82
82
83 PythonQtRegisterToolClassesTemplateConverter(int);
83 PythonQtRegisterToolClassesTemplateConverter(int);
84 PythonQtRegisterToolClassesTemplateConverter(float);
84 PythonQtRegisterToolClassesTemplateConverter(float);
85 PythonQtRegisterToolClassesTemplateConverter(double);
85 PythonQtRegisterToolClassesTemplateConverter(double);
86 PythonQtRegisterToolClassesTemplateConverter(qint32);
86 PythonQtRegisterToolClassesTemplateConverter(qint32);
87 PythonQtRegisterToolClassesTemplateConverter(quint32);
87 PythonQtRegisterToolClassesTemplateConverter(quint32);
88 PythonQtRegisterToolClassesTemplateConverter(qint64);
88 PythonQtRegisterToolClassesTemplateConverter(qint64);
89 PythonQtRegisterToolClassesTemplateConverter(quint64);
89 PythonQtRegisterToolClassesTemplateConverter(quint64);
90 // TODO: which other POD types should be available for QList etc.
90 // TODO: which other POD types should be available for QList etc.
91
91
92 PythonQt_init_QtCoreBuiltin(NULL);
92 PythonQt_init_QtCoreBuiltin(NULL);
93 PythonQt_init_QtGuiBuiltin(NULL);
93 PythonQt_init_QtGuiBuiltin(NULL);
94
94
95 PythonQt::self()->addDecorators(new PythonQtStdDecorators());
95 PythonQt::self()->addDecorators(new PythonQtStdDecorators());
96 PythonQt::self()->registerCPPClass("QMetaObject",0, "QtCore", PythonQtCreateObject<PythonQtWrapper_QMetaObject>);
96 PythonQt::self()->registerCPPClass("QMetaObject",0, "QtCore", PythonQtCreateObject<PythonQtWrapper_QMetaObject>);
97
97
98 PythonQtRegisterToolClassesTemplateConverter(QByteArray);
98 PythonQtRegisterToolClassesTemplateConverter(QByteArray);
99 PythonQtRegisterToolClassesTemplateConverter(QDate);
99 PythonQtRegisterToolClassesTemplateConverter(QDate);
100 PythonQtRegisterToolClassesTemplateConverter(QTime);
100 PythonQtRegisterToolClassesTemplateConverter(QTime);
101 PythonQtRegisterToolClassesTemplateConverter(QDateTime);
101 PythonQtRegisterToolClassesTemplateConverter(QDateTime);
102 PythonQtRegisterToolClassesTemplateConverter(QUrl);
102 PythonQtRegisterToolClassesTemplateConverter(QUrl);
103 PythonQtRegisterToolClassesTemplateConverter(QLocale);
103 PythonQtRegisterToolClassesTemplateConverter(QLocale);
104 PythonQtRegisterToolClassesTemplateConverter(QRect);
104 PythonQtRegisterToolClassesTemplateConverter(QRect);
105 PythonQtRegisterToolClassesTemplateConverter(QRectF);
105 PythonQtRegisterToolClassesTemplateConverter(QRectF);
106 PythonQtRegisterToolClassesTemplateConverter(QSize);
106 PythonQtRegisterToolClassesTemplateConverter(QSize);
107 PythonQtRegisterToolClassesTemplateConverter(QSizeF);
107 PythonQtRegisterToolClassesTemplateConverter(QSizeF);
108 PythonQtRegisterToolClassesTemplateConverter(QLine);
108 PythonQtRegisterToolClassesTemplateConverter(QLine);
109 PythonQtRegisterToolClassesTemplateConverter(QLineF);
109 PythonQtRegisterToolClassesTemplateConverter(QLineF);
110 PythonQtRegisterToolClassesTemplateConverter(QPoint);
110 PythonQtRegisterToolClassesTemplateConverter(QPoint);
111 PythonQtRegisterToolClassesTemplateConverter(QPointF);
111 PythonQtRegisterToolClassesTemplateConverter(QPointF);
112 PythonQtRegisterToolClassesTemplateConverter(QRegExp);
112 PythonQtRegisterToolClassesTemplateConverter(QRegExp);
113
113
114 PythonQtRegisterToolClassesTemplateConverter(QFont);
114 PythonQtRegisterToolClassesTemplateConverter(QFont);
115 PythonQtRegisterToolClassesTemplateConverter(QPixmap);
115 PythonQtRegisterToolClassesTemplateConverter(QPixmap);
116 PythonQtRegisterToolClassesTemplateConverter(QBrush);
116 PythonQtRegisterToolClassesTemplateConverter(QBrush);
117 PythonQtRegisterToolClassesTemplateConverter(QColor);
117 PythonQtRegisterToolClassesTemplateConverter(QColor);
118 PythonQtRegisterToolClassesTemplateConverter(QPalette);
118 PythonQtRegisterToolClassesTemplateConverter(QPalette);
119 PythonQtRegisterToolClassesTemplateConverter(QIcon);
119 PythonQtRegisterToolClassesTemplateConverter(QIcon);
120 PythonQtRegisterToolClassesTemplateConverter(QImage);
120 PythonQtRegisterToolClassesTemplateConverter(QImage);
121 PythonQtRegisterToolClassesTemplateConverter(QPolygon);
121 PythonQtRegisterToolClassesTemplateConverter(QPolygon);
122 PythonQtRegisterToolClassesTemplateConverter(QRegion);
122 PythonQtRegisterToolClassesTemplateConverter(QRegion);
123 PythonQtRegisterToolClassesTemplateConverter(QBitmap);
123 PythonQtRegisterToolClassesTemplateConverter(QBitmap);
124 PythonQtRegisterToolClassesTemplateConverter(QCursor);
124 PythonQtRegisterToolClassesTemplateConverter(QCursor);
125 PythonQtRegisterToolClassesTemplateConverter(QSizePolicy);
125 PythonQtRegisterToolClassesTemplateConverter(QSizePolicy);
126 PythonQtRegisterToolClassesTemplateConverter(QKeySequence);
126 PythonQtRegisterToolClassesTemplateConverter(QKeySequence);
127 PythonQtRegisterToolClassesTemplateConverter(QPen);
127 PythonQtRegisterToolClassesTemplateConverter(QPen);
128 PythonQtRegisterToolClassesTemplateConverter(QTextLength);
128 PythonQtRegisterToolClassesTemplateConverter(QTextLength);
129 PythonQtRegisterToolClassesTemplateConverter(QTextFormat);
129 PythonQtRegisterToolClassesTemplateConverter(QTextFormat);
130 PythonQtRegisterToolClassesTemplateConverter(QMatrix);
130 PythonQtRegisterToolClassesTemplateConverter(QMatrix);
131
131
132
132
133 PyObject* pack = PythonQt::priv()->packageByName("QtCore");
133 PyObject* pack = PythonQt::priv()->packageByName("QtCore");
134 PyObject* pack2 = PythonQt::priv()->packageByName("Qt");
134 PyObject* pack2 = PythonQt::priv()->packageByName("Qt");
135 PyObject* qtNamespace = PythonQt::priv()->getClassInfo("Qt")->pythonQtClassWrapper();
135 PyObject* qtNamespace = PythonQt::priv()->getClassInfo("Qt")->pythonQtClassWrapper();
136 const char* names[16] = {"SIGNAL", "SLOT", "qAbs", "qBound","qDebug","qWarning","qCritical","qFatal"
136 const char* names[16] = {"SIGNAL", "SLOT", "qAbs", "qBound","qDebug","qWarning","qCritical","qFatal"
137 ,"qFuzzyCompare", "qMax","qMin","qRound","qRound64","qVersion","qrand","qsrand"};
137 ,"qFuzzyCompare", "qMax","qMin","qRound","qRound64","qVersion","qrand","qsrand"};
138 for (unsigned int i = 0;i<16; i++) {
138 for (unsigned int i = 0;i<16; i++) {
139 PyObject* obj = PyObject_GetAttrString(qtNamespace, names[i]);
139 PyObject* obj = PyObject_GetAttrString(qtNamespace, names[i]);
140 if (obj) {
140 if (obj) {
141 PyModule_AddObject(pack, names[i], obj);
141 PyModule_AddObject(pack, names[i], obj);
142 Py_INCREF(obj);
142 Py_INCREF(obj);
143 PyModule_AddObject(pack2, names[i], obj);
143 PyModule_AddObject(pack2, names[i], obj);
144 } else {
144 } else {
145 std::cerr << "method not found " << names[i] << std::endl;
145 std::cerr << "method not found " << names[i] << std::endl;
146 }
146 }
147 }
147 }
148 }
148 }
149 }
149 }
150
150
151 void PythonQt::cleanup()
151 void PythonQt::cleanup()
152 {
152 {
153 if (_self) {
153 if (_self) {
154 delete _self;
154 delete _self;
155 _self = NULL;
155 _self = NULL;
156 }
156 }
157 }
157 }
158
158
159 PythonQt* PythonQt::self() { return _self; }
159 PythonQt* PythonQt::self() { return _self; }
160
160
161 PythonQt::PythonQt(int flags, const QByteArray& pythonQtModuleName)
161 PythonQt::PythonQt(int flags, const QByteArray& pythonQtModuleName)
162 {
162 {
163 _p = new PythonQtPrivate;
163 _p = new PythonQtPrivate;
164 _p->_initFlags = flags;
164 _p->_initFlags = flags;
165
165
166 _p->_PythonQtObjectPtr_metaId = qRegisterMetaType<PythonQtObjectPtr>("PythonQtObjectPtr");
166 _p->_PythonQtObjectPtr_metaId = qRegisterMetaType<PythonQtObjectPtr>("PythonQtObjectPtr");
167
167
168 if ((flags & PythonAlreadyInitialized) == 0) {
168 if ((flags & PythonAlreadyInitialized) == 0) {
169 #ifdef PY3K
169 #ifdef PY3K
170 Py_SetProgramName(const_cast<wchar_t*>(L"PythonQt"));
170 Py_SetProgramName(const_cast<wchar_t*>(L"PythonQt"));
171 #else
171 #else
172 Py_SetProgramName(const_cast<char*>("PythonQt"));
172 Py_SetProgramName(const_cast<char*>("PythonQt"));
173 #endif
173 #endif
174 if (flags & IgnoreSiteModule) {
174 if (flags & IgnoreSiteModule) {
175 // this prevents the automatic importing of Python site files
175 // this prevents the automatic importing of Python site files
176 Py_NoSiteFlag = 1;
176 Py_NoSiteFlag = 1;
177 }
177 }
178 Py_Initialize();
178 Py_Initialize();
179 }
179 }
180
180
181 // add our own python object types for qt object slots
181 // add our own python object types for qt object slots
182 if (PyType_Ready(&PythonQtSlotFunction_Type) < 0) {
182 if (PyType_Ready(&PythonQtSlotFunction_Type) < 0) {
183 std::cerr << "could not initialize PythonQtSlotFunction_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
183 std::cerr << "could not initialize PythonQtSlotFunction_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
184 }
184 }
185 Py_INCREF(&PythonQtSlotFunction_Type);
185 Py_INCREF(&PythonQtSlotFunction_Type);
186
186
187 if (PyType_Ready(&PythonQtSignalFunction_Type) < 0) {
187 if (PyType_Ready(&PythonQtSignalFunction_Type) < 0) {
188 std::cerr << "could not initialize PythonQtSignalFunction_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
188 std::cerr << "could not initialize PythonQtSignalFunction_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
189 }
189 }
190 Py_INCREF(&PythonQtSignalFunction_Type);
190 Py_INCREF(&PythonQtSignalFunction_Type);
191
191
192 // according to Python docs, set the type late here, since it can not safely be stored in the struct when declaring it
192 // according to Python docs, set the type late here, since it can not safely be stored in the struct when declaring it
193 PythonQtClassWrapper_Type.tp_base = &PyType_Type;
193 PythonQtClassWrapper_Type.tp_base = &PyType_Type;
194 // add our own python object types for classes
194 // add our own python object types for classes
195 if (PyType_Ready(&PythonQtClassWrapper_Type) < 0) {
195 if (PyType_Ready(&PythonQtClassWrapper_Type) < 0) {
196 std::cerr << "could not initialize PythonQtClassWrapper_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
196 std::cerr << "could not initialize PythonQtClassWrapper_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
197 }
197 }
198 Py_INCREF(&PythonQtClassWrapper_Type);
198 Py_INCREF(&PythonQtClassWrapper_Type);
199
199
200 // add our own python object types for CPP instances
200 // add our own python object types for CPP instances
201 if (PyType_Ready(&PythonQtInstanceWrapper_Type) < 0) {
201 if (PyType_Ready(&PythonQtInstanceWrapper_Type) < 0) {
202 PythonQt::handleError();
202 PythonQt::handleError();
203 std::cerr << "could not initialize PythonQtInstanceWrapper_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
203 std::cerr << "could not initialize PythonQtInstanceWrapper_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
204 }
204 }
205 Py_INCREF(&PythonQtInstanceWrapper_Type);
205 Py_INCREF(&PythonQtInstanceWrapper_Type);
206
206
207 // add our own python object types for redirection of stdout
207 // add our own python object types for redirection of stdout
208 if (PyType_Ready(&PythonQtStdOutRedirectType) < 0) {
208 if (PyType_Ready(&PythonQtStdOutRedirectType) < 0) {
209 std::cerr << "could not initialize PythonQtStdOutRedirectType" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
209 std::cerr << "could not initialize PythonQtStdOutRedirectType" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
210 }
210 }
211 Py_INCREF(&PythonQtStdOutRedirectType);
211 Py_INCREF(&PythonQtStdOutRedirectType);
212
212
213 // add our own python object types for redirection of stdin
213 // add our own python object types for redirection of stdin
214 if (PyType_Ready(&PythonQtStdInRedirectType) < 0) {
214 if (PyType_Ready(&PythonQtStdInRedirectType) < 0) {
215 std::cerr << "could not initialize PythonQtStdInRedirectType" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
215 std::cerr << "could not initialize PythonQtStdInRedirectType" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
216 }
216 }
217 Py_INCREF(&PythonQtStdInRedirectType);
217 Py_INCREF(&PythonQtStdInRedirectType);
218
218
219 initPythonQtModule(flags & RedirectStdOut, pythonQtModuleName);
219 initPythonQtModule(flags & RedirectStdOut, pythonQtModuleName);
220
220
221 }
221 }
222
222
223 PythonQt::~PythonQt() {
223 PythonQt::~PythonQt() {
224 delete _p;
224 delete _p;
225 _p = NULL;
225 _p = NULL;
226 }
226 }
227
227
228 PythonQtPrivate::~PythonQtPrivate() {
228 PythonQtPrivate::~PythonQtPrivate() {
229 delete _defaultImporter;
229 delete _defaultImporter;
230 _defaultImporter = NULL;
230 _defaultImporter = NULL;
231
231
232 {
232 {
233 QHashIterator<QByteArray, PythonQtClassInfo *> i(_knownClassInfos);
233 QHashIterator<QByteArray, PythonQtClassInfo *> i(_knownClassInfos);
234 while (i.hasNext()) {
234 while (i.hasNext()) {
235 delete i.next().value();
235 delete i.next().value();
236 }
236 }
237 }
237 }
238 PythonQtConv::global_valueStorage.clear();
238 PythonQtConv::global_valueStorage.clear();
239 PythonQtConv::global_ptrStorage.clear();
239 PythonQtConv::global_ptrStorage.clear();
240 PythonQtConv::global_variantStorage.clear();
240 PythonQtConv::global_variantStorage.clear();
241
241
242 PythonQtMethodInfo::cleanupCachedMethodInfos();
242 PythonQtMethodInfo::cleanupCachedMethodInfos();
243 }
243 }
244
244
245 void PythonQt::setRedirectStdInCallback(PythonQtInputChangedCB* callback, void * callbackData)
245 void PythonQt::setRedirectStdInCallback(PythonQtInputChangedCB* callback, void * callbackData)
246 {
246 {
247 if (!callback)
247 if (!callback)
248 {
248 {
249 std::cerr << "PythonQt::setRedirectStdInCallback - callback parameter is NULL !" << std::endl;
249 std::cerr << "PythonQt::setRedirectStdInCallback - callback parameter is NULL !" << std::endl;
250 return;
250 return;
251 }
251 }
252
252
253 PythonQtObjectPtr sys;
253 PythonQtObjectPtr sys;
254 PythonQtObjectPtr in;
254 PythonQtObjectPtr in;
255 sys.setNewRef(PyImport_ImportModule("sys"));
255 sys.setNewRef(PyImport_ImportModule("sys"));
256
256
257 // Backup original 'sys.stdin' if not yet done
257 // Backup original 'sys.stdin' if not yet done
258 if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") )
258 if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") )
259 PyObject_SetAttrString(sys.object(), "pythonqt_original_stdin", PyObject_GetAttrString(sys.object(), "stdin"));
259 PyObject_SetAttrString(sys.object(), "pythonqt_original_stdin", PyObject_GetAttrString(sys.object(), "stdin"));
260
260
261 in = PythonQtStdInRedirectType.tp_new(&PythonQtStdInRedirectType, NULL, NULL);
261 in = PythonQtStdInRedirectType.tp_new(&PythonQtStdInRedirectType, NULL, NULL);
262 ((PythonQtStdInRedirect*)in.object())->_cb = callback;
262 ((PythonQtStdInRedirect*)in.object())->_cb = callback;
263 ((PythonQtStdInRedirect*)in.object())->_callData = callbackData;
263 ((PythonQtStdInRedirect*)in.object())->_callData = callbackData;
264 // replace the built in file objects with our own objects
264 // replace the built in file objects with our own objects
265 PyModule_AddObject(sys.object(), "stdin", in);
265 PyModule_AddObject(sys.object(), "stdin", in);
266
266
267 // Backup custom 'stdin' into 'pythonqt_stdin'
267 // Backup custom 'stdin' into 'pythonqt_stdin'
268 Py_IncRef(in);
268 Py_IncRef(in);
269 PyModule_AddObject(sys.object(), "pythonqt_stdin", in);
269 PyModule_AddObject(sys.object(), "pythonqt_stdin", in);
270 }
270 }
271
271
272 void PythonQt::setRedirectStdInCallbackEnabled(bool enabled)
272 void PythonQt::setRedirectStdInCallbackEnabled(bool enabled)
273 {
273 {
274 PythonQtObjectPtr sys;
274 PythonQtObjectPtr sys;
275 sys.setNewRef(PyImport_ImportModule("sys"));
275 sys.setNewRef(PyImport_ImportModule("sys"));
276
276
277 if (enabled)
277 if (enabled)
278 {
278 {
279 if( !PyObject_HasAttrString(sys.object(), "pythonqt_stdin") )
279 if( !PyObject_HasAttrString(sys.object(), "pythonqt_stdin") )
280 PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_stdin"));
280 PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_stdin"));
281 }
281 }
282 else
282 else
283 {
283 {
284 if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") )
284 if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") )
285 PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_original_stdin"));
285 PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_original_stdin"));
286 }
286 }
287 }
287 }
288
288
289 PythonQtImportFileInterface* PythonQt::importInterface()
289 PythonQtImportFileInterface* PythonQt::importInterface()
290 {
290 {
291 return _self->_p->_importInterface?_self->_p->_importInterface:_self->_p->_defaultImporter;
291 return _self->_p->_importInterface?_self->_p->_importInterface:_self->_p->_defaultImporter;
292 }
292 }
293
293
294 void PythonQt::qObjectNoLongerWrappedCB(QObject* o)
294 void PythonQt::qObjectNoLongerWrappedCB(QObject* o)
295 {
295 {
296 if (_self->_p->_noLongerWrappedCB) {
296 if (_self->_p->_noLongerWrappedCB) {
297 (*_self->_p->_noLongerWrappedCB)(o);
297 (*_self->_p->_noLongerWrappedCB)(o);
298 };
298 };
299 }
299 }
300
300
301 void PythonQt::registerClass(const QMetaObject* metaobject, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell)
301 void PythonQt::registerClass(const QMetaObject* metaobject, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell)
302 {
302 {
303 _p->registerClass(metaobject, package, wrapperCreator, shell);
303 _p->registerClass(metaobject, package, wrapperCreator, shell);
304 }
304 }
305
305
306 void PythonQtPrivate::registerClass(const QMetaObject* metaobject, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell, PyObject* module, int typeSlots)
306 void PythonQtPrivate::registerClass(const QMetaObject* metaobject, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell, PyObject* module, int typeSlots)
307 {
307 {
308 // we register all classes in the hierarchy
308 // we register all classes in the hierarchy
309 const QMetaObject* m = metaobject;
309 const QMetaObject* m = metaobject;
310 bool first = true;
310 bool first = true;
311 while (m) {
311 while (m) {
312 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(m->className());
312 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(m->className());
313 if (!info->pythonQtClassWrapper()) {
313 if (!info->pythonQtClassWrapper()) {
314 info->setTypeSlots(typeSlots);
314 info->setTypeSlots(typeSlots);
315 info->setupQObject(m);
315 info->setupQObject(m);
316 createPythonQtClassWrapper(info, package, module);
316 createPythonQtClassWrapper(info, package, module);
317 if (m->superClass()) {
317 if (m->superClass()) {
318 PythonQtClassInfo* parentInfo = lookupClassInfoAndCreateIfNotPresent(m->superClass()->className());
318 PythonQtClassInfo* parentInfo = lookupClassInfoAndCreateIfNotPresent(m->superClass()->className());
319 info->addParentClass(PythonQtClassInfo::ParentClassInfo(parentInfo));
319 info->addParentClass(PythonQtClassInfo::ParentClassInfo(parentInfo));
320 }
320 }
321 } else if (first && module) {
321 } else if (first && module) {
322 // There is a wrapper already, but if we got a module, we want to place the wrapper into that module as well,
322 // There is a wrapper already, but if we got a module, we want to place the wrapper into that module as well,
323 // since it might have been placed into "private" earlier on.
323 // since it might have been placed into "private" earlier on.
324 // If the wrapper was already added to module before, it is just readded, which does no harm.
324 // If the wrapper was already added to module before, it is just readded, which does no harm.
325 PyObject* classWrapper = info->pythonQtClassWrapper();
325 PyObject* classWrapper = info->pythonQtClassWrapper();
326 // AddObject steals a reference, so we need to INCREF
326 // AddObject steals a reference, so we need to INCREF
327 Py_INCREF(classWrapper);
327 Py_INCREF(classWrapper);
328 PyModule_AddObject(module, info->className(), classWrapper);
328 PyModule_AddObject(module, info->className(), classWrapper);
329 }
329 }
330 if (first) {
330 if (first) {
331 first = false;
331 first = false;
332 if (wrapperCreator) {
332 if (wrapperCreator) {
333 info->setDecoratorProvider(wrapperCreator);
333 info->setDecoratorProvider(wrapperCreator);
334 }
334 }
335 if (shell) {
335 if (shell) {
336 info->setShellSetInstanceWrapperCB(shell);
336 info->setShellSetInstanceWrapperCB(shell);
337 }
337 }
338 }
338 }
339 m = m->superClass();
339 m = m->superClass();
340 }
340 }
341 }
341 }
342
342
343 void PythonQtPrivate::createPythonQtClassWrapper(PythonQtClassInfo* info, const char* package, PyObject* module)
343 void PythonQtPrivate::createPythonQtClassWrapper(PythonQtClassInfo* info, const char* package, PyObject* module)
344 {
344 {
345 PyObject* pack = module?module:packageByName(package);
345 PyObject* pack = module?module:packageByName(package);
346 PyObject* pyobj = (PyObject*)createNewPythonQtClassWrapper(info, pack);
346 PyObject* pyobj = (PyObject*)createNewPythonQtClassWrapper(info, pack);
347 PyModule_AddObject(pack, info->className(), pyobj);
347 PyModule_AddObject(pack, info->className(), pyobj);
348 if (!module && package && strncmp(package,"Qt",2)==0) {
348 if (!module && package && strncmp(package,"Qt",2)==0) {
349 // since PyModule_AddObject steals the reference, we need a incref once more...
349 // since PyModule_AddObject steals the reference, we need a incref once more...
350 Py_INCREF(pyobj);
350 Py_INCREF(pyobj);
351 // put all qt objects into Qt as well
351 // put all qt objects into Qt as well
352 PyModule_AddObject(packageByName("Qt"), info->className(), pyobj);
352 PyModule_AddObject(packageByName("Qt"), info->className(), pyobj);
353 }
353 }
354 info->setPythonQtClassWrapper(pyobj);
354 info->setPythonQtClassWrapper(pyobj);
355 }
355 }
356
356
357 PyObject* PythonQtPrivate::wrapQObject(QObject* obj)
357 PyObject* PythonQtPrivate::wrapQObject(QObject* obj)
358 {
358 {
359 if (!obj) {
359 if (!obj) {
360 Py_INCREF(Py_None);
360 Py_INCREF(Py_None);
361 return Py_None;
361 return Py_None;
362 }
362 }
363 PythonQtInstanceWrapper* wrap = findWrapperAndRemoveUnused(obj);
363 PythonQtInstanceWrapper* wrap = findWrapperAndRemoveUnused(obj);
364 if (wrap && wrap->_wrappedPtr) {
364 if (wrap && wrap->_wrappedPtr) {
365 // uh oh, we want to wrap a QObject, but have a C++ wrapper at that
365 // uh oh, we want to wrap a QObject, but have a C++ wrapper at that
366 // address, so probably that C++ wrapper has been deleted earlier and
366 // address, so probably that C++ wrapper has been deleted earlier and
367 // now we see a QObject with the same address.
367 // now we see a QObject with the same address.
368 // Do not use the old wrapper anymore.
368 // Do not use the old wrapper anymore.
369 wrap = NULL;
369 wrap = NULL;
370 }
370 }
371 if (!wrap) {
371 if (!wrap) {
372 // smuggling it in...
372 // smuggling it in...
373 PythonQtClassInfo* classInfo = _knownClassInfos.value(obj->metaObject()->className());
373 PythonQtClassInfo* classInfo = _knownClassInfos.value(obj->metaObject()->className());
374 if (!classInfo || classInfo->pythonQtClassWrapper()==NULL) {
374 if (!classInfo || classInfo->pythonQtClassWrapper()==NULL) {
375 registerClass(obj->metaObject());
375 registerClass(obj->metaObject());
376 classInfo = _knownClassInfos.value(obj->metaObject()->className());
376 classInfo = _knownClassInfos.value(obj->metaObject()->className());
377 }
377 }
378 wrap = createNewPythonQtInstanceWrapper(obj, classInfo);
378 wrap = createNewPythonQtInstanceWrapper(obj, classInfo);
379 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
379 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
380 } else {
380 } else {
381 Py_INCREF(wrap);
381 Py_INCREF(wrap);
382 // mlabDebugConst("MLABPython","qobject wrapper reused " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
382 // mlabDebugConst("MLABPython","qobject wrapper reused " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
383 }
383 }
384 return (PyObject*)wrap;
384 return (PyObject*)wrap;
385 }
385 }
386
386
387 PyObject* PythonQtPrivate::wrapPtr(void* ptr, const QByteArray& name)
387 PyObject* PythonQtPrivate::wrapPtr(void* ptr, const QByteArray& name)
388 {
388 {
389 if (!ptr) {
389 if (!ptr) {
390 Py_INCREF(Py_None);
390 Py_INCREF(Py_None);
391 return Py_None;
391 return Py_None;
392 }
392 }
393
393
394 PythonQtInstanceWrapper* wrap = findWrapperAndRemoveUnused(ptr);
394 PythonQtInstanceWrapper* wrap = findWrapperAndRemoveUnused(ptr);
395 PythonQtInstanceWrapper* possibleStillAliveWrapper = NULL;
395 PythonQtInstanceWrapper* possibleStillAliveWrapper = NULL;
396 if (wrap && wrap->_wrappedPtr) {
396 if (wrap && wrap->_wrappedPtr) {
397 // we have a previous C++ wrapper... if the wrapper is for a C++ object,
397 // we have a previous C++ wrapper... if the wrapper is for a C++ object,
398 // we are not sure if it may have been deleted earlier and we just see the same C++
398 // we are not sure if it may have been deleted earlier and we just see the same C++
399 // pointer once again. To make sure that we do not reuse a wrapper of the wrong type,
399 // pointer once again. To make sure that we do not reuse a wrapper of the wrong type,
400 // we compare the classInfo() pointer and only reuse the wrapper if it has the same
400 // we compare the classInfo() pointer and only reuse the wrapper if it has the same
401 // info. This is only needed for non-QObjects, since we know it when a QObject gets deleted.
401 // info. This is only needed for non-QObjects, since we know it when a QObject gets deleted.
402 possibleStillAliveWrapper = wrap;
402 possibleStillAliveWrapper = wrap;
403 wrap = NULL;
403 wrap = NULL;
404 }
404 }
405 if (!wrap) {
405 if (!wrap) {
406 PythonQtClassInfo* info = _knownClassInfos.value(name);
406 PythonQtClassInfo* info = _knownClassInfos.value(name);
407 if (!info) {
407 if (!info) {
408 // maybe it is a PyObject, which we can return directly
408 // maybe it is a PyObject, which we can return directly
409 if (name == "PyObject") {
409 if (name == "PyObject") {
410 PyObject* p = (PyObject*)ptr;
410 PyObject* p = (PyObject*)ptr;
411 Py_INCREF(p);
411 Py_INCREF(p);
412 return p;
412 return p;
413 }
413 }
414
414
415 // we do not know the metaobject yet, but we might know it by its name:
415 // we do not know the metaobject yet, but we might know it by its name:
416 if (_knownQObjectClassNames.find(name)!=_knownQObjectClassNames.end()) {
416 if (_knownQObjectClassNames.find(name)!=_knownQObjectClassNames.end()) {
417 // yes, we know it, so we can convert to QObject
417 // yes, we know it, so we can convert to QObject
418 QObject* qptr = (QObject*)ptr;
418 QObject* qptr = (QObject*)ptr;
419 registerClass(qptr->metaObject());
419 registerClass(qptr->metaObject());
420 info = _knownClassInfos.value(qptr->metaObject()->className());
420 info = _knownClassInfos.value(qptr->metaObject()->className());
421 }
421 }
422 }
422 }
423 if (info && info->isQObject()) {
423 if (info && info->isQObject()) {
424 QObject* qptr = (QObject*)ptr;
424 QObject* qptr = (QObject*)ptr;
425 // if the object is a derived object, we want to switch the class info to the one of the derived class:
425 // if the object is a derived object, we want to switch the class info to the one of the derived class:
426 if (name!=(qptr->metaObject()->className())) {
426 if (name!=(qptr->metaObject()->className())) {
427 info = _knownClassInfos.value(qptr->metaObject()->className());
427 info = _knownClassInfos.value(qptr->metaObject()->className());
428 if (!info) {
428 if (!info) {
429 registerClass(qptr->metaObject());
429 registerClass(qptr->metaObject());
430 info = _knownClassInfos.value(qptr->metaObject()->className());
430 info = _knownClassInfos.value(qptr->metaObject()->className());
431 }
431 }
432 }
432 }
433 wrap = createNewPythonQtInstanceWrapper(qptr, info);
433 wrap = createNewPythonQtInstanceWrapper(qptr, info);
434 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
434 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
435 return (PyObject*)wrap;
435 return (PyObject*)wrap;
436 }
436 }
437
437
438 // not a known QObject, try to wrap via foreign wrapper factories
438 // not a known QObject, try to wrap via foreign wrapper factories
439 PyObject* foreignWrapper = NULL;
439 PyObject* foreignWrapper = NULL;
440 for (int i=0; i<_foreignWrapperFactories.size(); i++) {
440 for (int i=0; i<_foreignWrapperFactories.size(); i++) {
441 foreignWrapper = _foreignWrapperFactories.at(i)->wrap(name, ptr);
441 foreignWrapper = _foreignWrapperFactories.at(i)->wrap(name, ptr);
442 if (foreignWrapper) {
442 if (foreignWrapper) {
443 return foreignWrapper;
443 return foreignWrapper;
444 }
444 }
445 }
445 }
446
446
447 // not a known QObject, so try our wrapper factory:
447 // not a known QObject, so try our wrapper factory:
448 QObject* wrapper = NULL;
448 QObject* wrapper = NULL;
449 for (int i=0; i<_cppWrapperFactories.size(); i++) {
449 for (int i=0; i<_cppWrapperFactories.size(); i++) {
450 wrapper = _cppWrapperFactories.at(i)->create(name, ptr);
450 wrapper = _cppWrapperFactories.at(i)->create(name, ptr);
451 if (wrapper) {
451 if (wrapper) {
452 break;
452 break;
453 }
453 }
454 }
454 }
455
455
456 if (info) {
456 if (info) {
457 // try to downcast in the class hierarchy, which will modify info and ptr if it is successfull
457 // try to downcast in the class hierarchy, which will modify info and ptr if it is successfull
458 ptr = info->castDownIfPossible(ptr, &info);
458 ptr = info->castDownIfPossible(ptr, &info);
459
459
460 // if downcasting found out that the object is a QObject,
460 // if downcasting found out that the object is a QObject,
461 // handle it like one:
461 // handle it like one:
462 if (info && info->isQObject()) {
462 if (info && info->isQObject()) {
463 QObject* qptr = (QObject*)ptr;
463 QObject* qptr = (QObject*)ptr;
464 // if the object is a derived object, we want to switch the class info to the one of the derived class:
464 // if the object is a derived object, we want to switch the class info to the one of the derived class:
465 if (name!=(qptr->metaObject()->className())) {
465 if (name!=(qptr->metaObject()->className())) {
466 registerClass(qptr->metaObject());
466 registerClass(qptr->metaObject());
467 info = _knownClassInfos.value(qptr->metaObject()->className());
467 info = _knownClassInfos.value(qptr->metaObject()->className());
468 }
468 }
469 wrap = createNewPythonQtInstanceWrapper(qptr, info);
469 wrap = createNewPythonQtInstanceWrapper(qptr, info);
470 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
470 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
471 return (PyObject*)wrap;
471 return (PyObject*)wrap;
472 }
472 }
473 }
473 }
474
474
475 if (!info || info->pythonQtClassWrapper()==NULL) {
475 if (!info || info->pythonQtClassWrapper()==NULL) {
476 // still unknown, register as CPP class
476 // still unknown, register as CPP class
477 registerCPPClass(name.constData());
477 registerCPPClass(name.constData());
478 info = _knownClassInfos.value(name);
478 info = _knownClassInfos.value(name);
479 }
479 }
480 if (wrapper && (info->metaObject() != wrapper->metaObject())) {
480 if (wrapper && (info->metaObject() != wrapper->metaObject())) {
481 // if we a have a QObject wrapper and the metaobjects do not match, set the metaobject again!
481 // if we a have a QObject wrapper and the metaobjects do not match, set the metaobject again!
482 info->setMetaObject(wrapper->metaObject());
482 info->setMetaObject(wrapper->metaObject());
483 }
483 }
484
484
485 if (possibleStillAliveWrapper && possibleStillAliveWrapper->classInfo() == info) {
485 if (possibleStillAliveWrapper && possibleStillAliveWrapper->classInfo() == info) {
486 wrap = possibleStillAliveWrapper;
486 wrap = possibleStillAliveWrapper;
487 Py_INCREF(wrap);
487 Py_INCREF(wrap);
488 } else {
488 } else {
489 wrap = createNewPythonQtInstanceWrapper(wrapper, info, ptr);
489 wrap = createNewPythonQtInstanceWrapper(wrapper, info, ptr);
490 }
490 }
491 // mlabDebugConst("MLABPython","new c++ wrapper added " << wrap->_wrappedPtr << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
491 // mlabDebugConst("MLABPython","new c++ wrapper added " << wrap->_wrappedPtr << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
492 } else {
492 } else {
493 Py_INCREF(wrap);
493 Py_INCREF(wrap);
494 //mlabDebugConst("MLABPython","c++ wrapper reused " << wrap->_wrappedPtr << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
494 //mlabDebugConst("MLABPython","c++ wrapper reused " << wrap->_wrappedPtr << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
495 }
495 }
496 return (PyObject*)wrap;
496 return (PyObject*)wrap;
497 }
497 }
498
498
499 PyObject* PythonQtPrivate::dummyTuple() {
499 PyObject* PythonQtPrivate::dummyTuple() {
500 static PyObject* dummyTuple = NULL;
500 static PyObject* dummyTuple = NULL;
501 if (dummyTuple==NULL) {
501 if (dummyTuple==NULL) {
502 dummyTuple = PyTuple_New(1);
502 dummyTuple = PyTuple_New(1);
503 #ifdef PY3K
503 #ifdef PY3K
504 PyTuple_SET_ITEM(dummyTuple, 0, PyUnicode_FromString("dummy"));
504 PyTuple_SET_ITEM(dummyTuple, 0, PyUnicode_FromString("dummy"));
505 #else
505 #else
506 PyTuple_SET_ITEM(dummyTuple, 0 , PyString_FromString("dummy"));
506 PyTuple_SET_ITEM(dummyTuple, 0 , PyString_FromString("dummy"));
507 #endif
507 #endif
508 }
508 }
509 return dummyTuple;
509 return dummyTuple;
510 }
510 }
511
511
512
512
513 PythonQtInstanceWrapper* PythonQtPrivate::createNewPythonQtInstanceWrapper(QObject* obj, PythonQtClassInfo* info, void* wrappedPtr) {
513 PythonQtInstanceWrapper* PythonQtPrivate::createNewPythonQtInstanceWrapper(QObject* obj, PythonQtClassInfo* info, void* wrappedPtr) {
514 // call the associated class type to create a new instance...
514 // call the associated class type to create a new instance...
515 PythonQtInstanceWrapper* result = (PythonQtInstanceWrapper*)PyObject_Call(info->pythonQtClassWrapper(), dummyTuple(), NULL);
515 PythonQtInstanceWrapper* result = (PythonQtInstanceWrapper*)PyObject_Call(info->pythonQtClassWrapper(), dummyTuple(), NULL);
516
516
517 result->setQObject(obj);
517 result->setQObject(obj);
518 result->_wrappedPtr = wrappedPtr;
518 result->_wrappedPtr = wrappedPtr;
519 result->_ownedByPythonQt = false;
519 result->_ownedByPythonQt = false;
520 result->_useQMetaTypeDestroy = false;
520 result->_useQMetaTypeDestroy = false;
521
521
522 if (wrappedPtr) {
522 if (wrappedPtr) {
523 _wrappedObjects.insert(wrappedPtr, result);
523 _wrappedObjects.insert(wrappedPtr, result);
524 } else {
524 } else {
525 _wrappedObjects.insert(obj, result);
525 _wrappedObjects.insert(obj, result);
526 if (obj->parent()== NULL && _wrappedCB) {
526 if (obj->parent()== NULL && _wrappedCB) {
527 // tell someone who is interested that the qobject is wrapped the first time, if it has no parent
527 // tell someone who is interested that the qobject is wrapped the first time, if it has no parent
528 (*_wrappedCB)(obj);
528 (*_wrappedCB)(obj);
529 }
529 }
530 }
530 }
531 return result;
531 return result;
532 }
532 }
533
533
534 PythonQtClassWrapper* PythonQtPrivate::createNewPythonQtClassWrapper(PythonQtClassInfo* info, PyObject* parentModule) {
534 PythonQtClassWrapper* PythonQtPrivate::createNewPythonQtClassWrapper(PythonQtClassInfo* info, PyObject* parentModule) {
535 PythonQtClassWrapper* result;
535 PythonQtClassWrapper* result;
536
536
537 #ifdef PY3K
537 #ifdef PY3K
538 PyObject* className = PyUnicode_FromString(info->className());
538 PyObject* className = PyUnicode_FromString(info->className());
539 #else
539 #else
540 PyObject* className = PyString_FromString(info->className());
540 PyObject* className = PyString_FromString(info->className());
541 #endif
541 #endif
542
542
543 PyObject* baseClasses = PyTuple_New(1);
543 PyObject* baseClasses = PyTuple_New(1);
544 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PythonQtInstanceWrapper_Type);
544 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PythonQtInstanceWrapper_Type);
545
545
546 PyObject* typeDict = PyDict_New();
546 PyObject* typeDict = PyDict_New();
547 PyObject* moduleName = PyObject_GetAttrString(parentModule, "__name__");
547 PyObject* moduleName = PyObject_GetAttrString(parentModule, "__name__");
548 PyDict_SetItemString(typeDict, "__module__", moduleName);
548 PyDict_SetItemString(typeDict, "__module__", moduleName);
549 if (!info->doc().isNull()) {
550 PyObject* docStr = PythonQtConv::QStringToPyObject(info->doc());
551 PyDict_SetItemString(typeDict, "__doc__", docStr);
552 Py_DECREF(docStr);
553 }
549
554
550 PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict);
555 PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict);
551
556
552 // set the class info so that PythonQtClassWrapper_new can read it
557 // set the class info so that PythonQtClassWrapper_new can read it
553 _currentClassInfoForClassWrapperCreation = info;
558 _currentClassInfoForClassWrapperCreation = info;
554 // create the new type object by calling the type
559 // create the new type object by calling the type
555 result = (PythonQtClassWrapper *)PyObject_Call((PyObject *)&PythonQtClassWrapper_Type, args, NULL);
560 result = (PythonQtClassWrapper *)PyObject_Call((PyObject *)&PythonQtClassWrapper_Type, args, NULL);
556
561
557 Py_DECREF(baseClasses);
562 Py_DECREF(baseClasses);
558 Py_DECREF(typeDict);
563 Py_DECREF(typeDict);
559 Py_DECREF(args);
564 Py_DECREF(args);
560 Py_DECREF(className);
565 Py_DECREF(className);
561
566
562 return result;
567 return result;
563 }
568 }
564
569
565 PyObject* PythonQtPrivate::createEnumValueInstance(PyObject* enumType, unsigned int enumValue)
570 PyObject* PythonQtPrivate::createEnumValueInstance(PyObject* enumType, unsigned int enumValue)
566 {
571 {
567 PyObject* args = Py_BuildValue("(i)", enumValue);
572 PyObject* args = Py_BuildValue("(i)", enumValue);
568 PyObject* result = PyObject_Call(enumType, args, NULL);
573 PyObject* result = PyObject_Call(enumType, args, NULL);
569 Py_DECREF(args);
574 Py_DECREF(args);
570 return result;
575 return result;
571 }
576 }
572
577
573 PyObject* PythonQtPrivate::createNewPythonQtEnumWrapper(const char* enumName, PyObject* parentObject) {
578 PyObject* PythonQtPrivate::createNewPythonQtEnumWrapper(const char* enumName, PyObject* parentObject) {
574 PyObject* result;
579 PyObject* result;
575
580
576 #ifdef PY3K
581 #ifdef PY3K
577 PyObject* className = PyUnicode_FromString(enumName);
582 PyObject* className = PyUnicode_FromString(enumName);
578 #else
583 #else
579 PyObject* className = PyString_FromString(enumName);
584 PyObject* className = PyString_FromString(enumName);
580 #endif
585 #endif
581
586
582 PyObject* baseClasses = PyTuple_New(1);
587 PyObject* baseClasses = PyTuple_New(1);
583 #ifdef PY3K
588 #ifdef PY3K
584 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyLong_Type);
589 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyLong_Type);
585 #else
590 #else
586 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyInt_Type);
591 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyInt_Type);
587 #endif
592 #endif
588
593
589 PyObject* module = PyObject_GetAttrString(parentObject, "__module__");
594 PyObject* module = PyObject_GetAttrString(parentObject, "__module__");
590 PyObject* typeDict = PyDict_New();
595 PyObject* typeDict = PyDict_New();
591 PyDict_SetItemString(typeDict, "__module__", module);
596 PyDict_SetItemString(typeDict, "__module__", module);
592
597
593 PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict);
598 PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict);
594
599
595 // create the new int derived type object by calling the core type
600 // create the new int derived type object by calling the core type
596 result = PyObject_Call((PyObject *)&PyType_Type, args, NULL);
601 result = PyObject_Call((PyObject *)&PyType_Type, args, NULL);
597
602
598 Py_DECREF(baseClasses);
603 Py_DECREF(baseClasses);
599 Py_DECREF(typeDict);
604 Py_DECREF(typeDict);
600 Py_DECREF(args);
605 Py_DECREF(args);
601 Py_DECREF(className);
606 Py_DECREF(className);
602
607
603 return result;
608 return result;
604 }
609 }
605
610
606 PythonQtSignalReceiver* PythonQt::getSignalReceiver(QObject* obj)
611 PythonQtSignalReceiver* PythonQt::getSignalReceiver(QObject* obj)
607 {
612 {
608 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
613 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
609 if (!r) {
614 if (!r) {
610 r = new PythonQtSignalReceiver(obj);
615 r = new PythonQtSignalReceiver(obj);
611 _p->_signalReceivers.insert(obj, r);
616 _p->_signalReceivers.insert(obj, r);
612 }
617 }
613 return r;
618 return r;
614 }
619 }
615
620
616 bool PythonQt::addSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname)
621 bool PythonQt::addSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname)
617 {
622 {
618 bool flag = false;
623 bool flag = false;
619 PythonQtObjectPtr callable = lookupCallable(module, objectname);
624 PythonQtObjectPtr callable = lookupCallable(module, objectname);
620 if (callable) {
625 if (callable) {
621 PythonQtSignalReceiver* r = getSignalReceiver(obj);
626 PythonQtSignalReceiver* r = getSignalReceiver(obj);
622 flag = r->addSignalHandler(signal, callable);
627 flag = r->addSignalHandler(signal, callable);
623 if (!flag) {
628 if (!flag) {
624 // signal not found
629 // signal not found
625 }
630 }
626 } else {
631 } else {
627 // callable not found
632 // callable not found
628 }
633 }
629 return flag;
634 return flag;
630 }
635 }
631
636
632 bool PythonQt::addSignalHandler(QObject* obj, const char* signal, PyObject* receiver)
637 bool PythonQt::addSignalHandler(QObject* obj, const char* signal, PyObject* receiver)
633 {
638 {
634 bool flag = false;
639 bool flag = false;
635 PythonQtSignalReceiver* r = getSignalReceiver(obj);
640 PythonQtSignalReceiver* r = getSignalReceiver(obj);
636 if (r) {
641 if (r) {
637 flag = r->addSignalHandler(signal, receiver);
642 flag = r->addSignalHandler(signal, receiver);
638 }
643 }
639 return flag;
644 return flag;
640 }
645 }
641
646
642 bool PythonQt::removeSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname)
647 bool PythonQt::removeSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname)
643 {
648 {
644 bool flag = false;
649 bool flag = false;
645 PythonQtObjectPtr callable = lookupCallable(module, objectname);
650 PythonQtObjectPtr callable = lookupCallable(module, objectname);
646 if (callable) {
651 if (callable) {
647 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
652 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
648 if (r) {
653 if (r) {
649 flag = r->removeSignalHandler(signal, callable);
654 flag = r->removeSignalHandler(signal, callable);
650 }
655 }
651 } else {
656 } else {
652 // callable not found
657 // callable not found
653 }
658 }
654 return flag;
659 return flag;
655 }
660 }
656
661
657 bool PythonQt::removeSignalHandler(QObject* obj, const char* signal, PyObject* receiver)
662 bool PythonQt::removeSignalHandler(QObject* obj, const char* signal, PyObject* receiver)
658 {
663 {
659 bool flag = false;
664 bool flag = false;
660 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
665 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
661 if (r) {
666 if (r) {
662 flag = r->removeSignalHandler(signal, receiver);
667 flag = r->removeSignalHandler(signal, receiver);
663 }
668 }
664 return flag;
669 return flag;
665 }
670 }
666
671
667 PythonQtObjectPtr PythonQt::lookupCallable(PyObject* module, const QString& name)
672 PythonQtObjectPtr PythonQt::lookupCallable(PyObject* module, const QString& name)
668 {
673 {
669 PythonQtObjectPtr p = lookupObject(module, name);
674 PythonQtObjectPtr p = lookupObject(module, name);
670 if (p) {
675 if (p) {
671 if (PyCallable_Check(p)) {
676 if (PyCallable_Check(p)) {
672 return p;
677 return p;
673 }
678 }
674 }
679 }
675 PyErr_Clear();
680 PyErr_Clear();
676 return NULL;
681 return NULL;
677 }
682 }
678
683
679 PythonQtObjectPtr PythonQt::lookupObject(PyObject* module, const QString& name)
684 PythonQtObjectPtr PythonQt::lookupObject(PyObject* module, const QString& name)
680 {
685 {
681 QStringList l = name.split('.');
686 QStringList l = name.split('.');
682 PythonQtObjectPtr p = module;
687 PythonQtObjectPtr p = module;
683 PythonQtObjectPtr prev;
688 PythonQtObjectPtr prev;
684 QByteArray b;
689 QByteArray b;
685 for (QStringList::ConstIterator i = l.begin(); i!=l.end() && p; ++i) {
690 for (QStringList::ConstIterator i = l.begin(); i!=l.end() && p; ++i) {
686 prev = p;
691 prev = p;
687 b = (*i).toLatin1();
692 b = (*i).toLatin1();
688 if (PyDict_Check(p)) {
693 if (PyDict_Check(p)) {
689 p = PyDict_GetItemString(p, b.data());
694 p = PyDict_GetItemString(p, b.data());
690 } else {
695 } else {
691 p.setNewRef(PyObject_GetAttrString(p, b.data()));
696 p.setNewRef(PyObject_GetAttrString(p, b.data()));
692 }
697 }
693 }
698 }
694 PyErr_Clear();
699 PyErr_Clear();
695 return p;
700 return p;
696 }
701 }
697
702
698 PythonQtObjectPtr PythonQt::getMainModule() {
703 PythonQtObjectPtr PythonQt::getMainModule() {
699 //both borrowed
704 //both borrowed
700 PythonQtObjectPtr dict = PyImport_GetModuleDict();
705 PythonQtObjectPtr dict = PyImport_GetModuleDict();
701 return PyDict_GetItemString(dict, "__main__");
706 return PyDict_GetItemString(dict, "__main__");
702 }
707 }
703
708
704 PythonQtObjectPtr PythonQt::importModule(const QString& name)
709 PythonQtObjectPtr PythonQt::importModule(const QString& name)
705 {
710 {
706 PythonQtObjectPtr mod;
711 PythonQtObjectPtr mod;
707 mod.setNewRef(PyImport_ImportModule(name.toLatin1().constData()));
712 mod.setNewRef(PyImport_ImportModule(name.toLatin1().constData()));
708 return mod;
713 return mod;
709 }
714 }
710
715
711
716
712 QVariant PythonQt::evalCode(PyObject* object, PyObject* pycode) {
717 QVariant PythonQt::evalCode(PyObject* object, PyObject* pycode) {
713 QVariant result;
718 QVariant result;
714 clearError();
719 clearError();
715 if (pycode) {
720 if (pycode) {
716 PyObject* dict = NULL;
721 PyObject* dict = NULL;
717 PyObject* globals = NULL;
722 PyObject* globals = NULL;
718 if (PyModule_Check(object)) {
723 if (PyModule_Check(object)) {
719 dict = PyModule_GetDict(object);
724 dict = PyModule_GetDict(object);
720 globals = dict;
725 globals = dict;
721 } else if (PyDict_Check(object)) {
726 } else if (PyDict_Check(object)) {
722 dict = object;
727 dict = object;
723 globals = dict;
728 globals = dict;
724 } else {
729 } else {
725 dict = PyObject_GetAttrString(object, "__dict__");
730 dict = PyObject_GetAttrString(object, "__dict__");
726 globals = PyObject_GetAttrString(PyImport_ImportModule(
731 globals = PyObject_GetAttrString(PyImport_ImportModule(
727 #ifdef PY3K
732 #ifdef PY3K
728 PyUnicode_AsUTF8(
733 PyUnicode_AsUTF8(
729 #else
734 #else
730 PyString_AS_STRING(
735 PyString_AS_STRING(
731 #endif
736 #endif
732 PyObject_GetAttrString(object, "__module__"))),"__dict__");
737 PyObject_GetAttrString(object, "__module__"))),"__dict__");
733 }
738 }
734 PyObject* r = NULL;
739 PyObject* r = NULL;
735 if (dict) {
740 if (dict) {
736 #ifdef PY3K
741 #ifdef PY3K
737 r = PyEval_EvalCode(pycode, globals, dict);
742 r = PyEval_EvalCode(pycode, globals, dict);
738 #else
743 #else
739 r = PyEval_EvalCode((PyCodeObject*)pycode, globals , dict);
744 r = PyEval_EvalCode((PyCodeObject*)pycode, globals , dict);
740 #endif
745 #endif
741 }
746 }
742 if (r) {
747 if (r) {
743 result = PythonQtConv::PyObjToQVariant(r);
748 result = PythonQtConv::PyObjToQVariant(r);
744 Py_DECREF(r);
749 Py_DECREF(r);
745 } else {
750 } else {
746 handleError();
751 handleError();
747 }
752 }
748 } else {
753 } else {
749 handleError();
754 handleError();
750 }
755 }
751 return result;
756 return result;
752 }
757 }
753
758
754 QVariant PythonQt::evalScript(PyObject* object, const QString& script, int start)
759 QVariant PythonQt::evalScript(PyObject* object, const QString& script, int start)
755 {
760 {
756 QVariant result;
761 QVariant result;
757 PythonQtObjectPtr p;
762 PythonQtObjectPtr p;
758 PyObject* dict = NULL;
763 PyObject* dict = NULL;
759 clearError();
764 clearError();
760 if (PyModule_Check(object)) {
765 if (PyModule_Check(object)) {
761 dict = PyModule_GetDict(object);
766 dict = PyModule_GetDict(object);
762 } else if (PyDict_Check(object)) {
767 } else if (PyDict_Check(object)) {
763 dict = object;
768 dict = object;
764 }
769 }
765 if (dict) {
770 if (dict) {
766 p.setNewRef(PyRun_String(script.toLatin1().data(), start, dict, dict));
771 p.setNewRef(PyRun_String(script.toLatin1().data(), start, dict, dict));
767 }
772 }
768 if (p) {
773 if (p) {
769 result = PythonQtConv::PyObjToQVariant(p);
774 result = PythonQtConv::PyObjToQVariant(p);
770 } else {
775 } else {
771 handleError();
776 handleError();
772 }
777 }
773 return result;
778 return result;
774 }
779 }
775
780
776 void PythonQt::evalFile(PyObject* module, const QString& filename)
781 void PythonQt::evalFile(PyObject* module, const QString& filename)
777 {
782 {
778 PythonQtObjectPtr code = parseFile(filename);
783 PythonQtObjectPtr code = parseFile(filename);
779 clearError();
784 clearError();
780 if (code) {
785 if (code) {
781 evalCode(module, code);
786 evalCode(module, code);
782 } else {
787 } else {
783 handleError();
788 handleError();
784 }
789 }
785 }
790 }
786
791
787 PythonQtObjectPtr PythonQt::parseFile(const QString& filename)
792 PythonQtObjectPtr PythonQt::parseFile(const QString& filename)
788 {
793 {
789 PythonQtObjectPtr p;
794 PythonQtObjectPtr p;
790 p.setNewRef(PythonQtImport::getCodeFromPyc(filename));
795 p.setNewRef(PythonQtImport::getCodeFromPyc(filename));
791 clearError();
796 clearError();
792 if (!p) {
797 if (!p) {
793 handleError();
798 handleError();
794 }
799 }
795 return p;
800 return p;
796 }
801 }
797
802
798 PythonQtObjectPtr PythonQt::createModuleFromFile(const QString& name, const QString& filename)
803 PythonQtObjectPtr PythonQt::createModuleFromFile(const QString& name, const QString& filename)
799 {
804 {
800 PythonQtObjectPtr code = parseFile(filename);
805 PythonQtObjectPtr code = parseFile(filename);
801 PythonQtObjectPtr module = _p->createModule(name, code);
806 PythonQtObjectPtr module = _p->createModule(name, code);
802 return module;
807 return module;
803 }
808 }
804
809
805 PythonQtObjectPtr PythonQt::createModuleFromScript(const QString& name, const QString& script)
810 PythonQtObjectPtr PythonQt::createModuleFromScript(const QString& name, const QString& script)
806 {
811 {
807 PyErr_Clear();
812 PyErr_Clear();
808 QString scriptCode = script;
813 QString scriptCode = script;
809 if (scriptCode.isEmpty()) {
814 if (scriptCode.isEmpty()) {
810 // we always need at least a linefeed
815 // we always need at least a linefeed
811 scriptCode = "\n";
816 scriptCode = "\n";
812 }
817 }
813 PythonQtObjectPtr pycode;
818 PythonQtObjectPtr pycode;
814 pycode.setNewRef(Py_CompileString((char*)scriptCode.toLatin1().data(), "", Py_file_input));
819 pycode.setNewRef(Py_CompileString((char*)scriptCode.toLatin1().data(), "", Py_file_input));
815 PythonQtObjectPtr module = _p->createModule(name, pycode);
820 PythonQtObjectPtr module = _p->createModule(name, pycode);
816 return module;
821 return module;
817 }
822 }
818
823
819 PythonQtObjectPtr PythonQt::createUniqueModule()
824 PythonQtObjectPtr PythonQt::createUniqueModule()
820 {
825 {
821 static QString pyQtStr("PythonQt_module");
826 static QString pyQtStr("PythonQt_module");
822 QString moduleName = pyQtStr+QString::number(_uniqueModuleCount++);
827 QString moduleName = pyQtStr+QString::number(_uniqueModuleCount++);
823 return createModuleFromScript(moduleName);
828 return createModuleFromScript(moduleName);
824 }
829 }
825
830
826 void PythonQt::addObject(PyObject* object, const QString& name, QObject* qObject)
831 void PythonQt::addObject(PyObject* object, const QString& name, QObject* qObject)
827 {
832 {
828 if (PyModule_Check(object)) {
833 if (PyModule_Check(object)) {
829 PyModule_AddObject(object, name.toLatin1().data(), _p->wrapQObject(qObject));
834 PyModule_AddObject(object, name.toLatin1().data(), _p->wrapQObject(qObject));
830 } else if (PyDict_Check(object)) {
835 } else if (PyDict_Check(object)) {
831 PyDict_SetItemString(object, name.toLatin1().data(), _p->wrapQObject(qObject));
836 PyDict_SetItemString(object, name.toLatin1().data(), _p->wrapQObject(qObject));
832 } else {
837 } else {
833 PyObject_SetAttrString(object, name.toLatin1().data(), _p->wrapQObject(qObject));
838 PyObject_SetAttrString(object, name.toLatin1().data(), _p->wrapQObject(qObject));
834 }
839 }
835 }
840 }
836
841
837 void PythonQt::addVariable(PyObject* object, const QString& name, const QVariant& v)
842 void PythonQt::addVariable(PyObject* object, const QString& name, const QVariant& v)
838 {
843 {
839 if (PyModule_Check(object)) {
844 if (PyModule_Check(object)) {
840 PyModule_AddObject(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
845 PyModule_AddObject(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
841 } else if (PyDict_Check(object)) {
846 } else if (PyDict_Check(object)) {
842 PyDict_SetItemString(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
847 PyDict_SetItemString(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
843 } else {
848 } else {
844 PyObject_SetAttrString(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
849 PyObject_SetAttrString(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
845 }
850 }
846 }
851 }
847
852
848 void PythonQt::removeVariable(PyObject* object, const QString& name)
853 void PythonQt::removeVariable(PyObject* object, const QString& name)
849 {
854 {
850 if (PyDict_Check(object)) {
855 if (PyDict_Check(object)) {
851 PyDict_DelItemString(object, name.toLatin1().data());
856 PyDict_DelItemString(object, name.toLatin1().data());
852 } else {
857 } else {
853 PyObject_DelAttrString(object, name.toLatin1().data());
858 PyObject_DelAttrString(object, name.toLatin1().data());
854 }
859 }
855 }
860 }
856
861
857 QVariant PythonQt::getVariable(PyObject* object, const QString& objectname)
862 QVariant PythonQt::getVariable(PyObject* object, const QString& objectname)
858 {
863 {
859 QVariant result;
864 QVariant result;
860 PythonQtObjectPtr obj = lookupObject(object, objectname);
865 PythonQtObjectPtr obj = lookupObject(object, objectname);
861 if (obj) {
866 if (obj) {
862 result = PythonQtConv::PyObjToQVariant(obj);
867 result = PythonQtConv::PyObjToQVariant(obj);
863 }
868 }
864 return result;
869 return result;
865 }
870 }
866
871
867 QStringList PythonQt::introspection(PyObject* module, const QString& objectname, PythonQt::ObjectType type)
872 QStringList PythonQt::introspection(PyObject* module, const QString& objectname, PythonQt::ObjectType type)
868 {
873 {
869 QStringList results;
874 QStringList results;
870
875
871 PythonQtObjectPtr object;
876 PythonQtObjectPtr object;
872 if (objectname.isEmpty()) {
877 if (objectname.isEmpty()) {
873 object = module;
878 object = module;
874 } else {
879 } else {
875 object = lookupObject(module, objectname);
880 object = lookupObject(module, objectname);
876 if (!object && type == CallOverloads) {
881 if (!object && type == CallOverloads) {
877 PyObject* dict = lookupObject(module, "__builtins__");
882 PyObject* dict = lookupObject(module, "__builtins__");
878 if (dict) {
883 if (dict) {
879 object = PyDict_GetItemString(dict, objectname.toLatin1().constData());
884 object = PyDict_GetItemString(dict, objectname.toLatin1().constData());
880 }
885 }
881 }
886 }
882 }
887 }
883
888
884 if (object) {
889 if (object) {
885 results = introspectObject(object, type);
890 results = introspectObject(object, type);
886 }
891 }
887
892
888 return results;
893 return results;
889 }
894 }
890
895
891 QStringList PythonQt::introspectObject(PyObject* object, ObjectType type)
896 QStringList PythonQt::introspectObject(PyObject* object, ObjectType type)
892 {
897 {
893 QStringList results;
898 QStringList results;
894
899
895 if (type == CallOverloads) {
900 if (type == CallOverloads) {
896 if (PythonQtSlotFunction_Check(object)) {
901 if (PythonQtSlotFunction_Check(object)) {
897 PythonQtSlotFunctionObject* o = (PythonQtSlotFunctionObject*)object;
902 PythonQtSlotFunctionObject* o = (PythonQtSlotFunctionObject*)object;
898 PythonQtSlotInfo* info = o->m_ml;
903 PythonQtSlotInfo* info = o->m_ml;
899
904
900 while (info) {
905 while (info) {
901 results << info->fullSignature();
906 results << info->fullSignature();
902 info = info->nextInfo();
907 info = info->nextInfo();
903 }
908 }
904 } else if (PythonQtSignalFunction_Check(object)) {
909 } else if (PythonQtSignalFunction_Check(object)) {
905 PythonQtSignalFunctionObject* o = (PythonQtSignalFunctionObject*)object;
910 PythonQtSignalFunctionObject* o = (PythonQtSignalFunctionObject*)object;
906 PythonQtSlotInfo* info = o->m_ml;
911 PythonQtSlotInfo* info = o->m_ml;
907
912
908 while (info) {
913 while (info) {
909 results << info->fullSignature();
914 results << info->fullSignature();
910 info = info->nextInfo();
915 info = info->nextInfo();
911 }
916 }
912 } else if (object->ob_type == &PythonQtClassWrapper_Type) {
917 } else if (object->ob_type == &PythonQtClassWrapper_Type) {
913 PythonQtClassWrapper* o = (PythonQtClassWrapper*)object;
918 PythonQtClassWrapper* o = (PythonQtClassWrapper*)object;
914 PythonQtSlotInfo* info = o->classInfo()->constructors();
919 PythonQtSlotInfo* info = o->classInfo()->constructors();
915
920
916 while (info) {
921 while (info) {
917 results << info->fullSignature();
922 results << info->fullSignature();
918 info = info->nextInfo();
923 info = info->nextInfo();
919 }
924 }
920 } else {
925 } else {
921 QString signature = _p->getSignature(object);
926 QString signature = _p->getSignature(object);
922 if (!signature.isEmpty()) {
927 if (!signature.isEmpty()) {
923 results << signature;
928 results << signature;
924 } else {
929 } else {
925 PyObject* doc = PyObject_GetAttrString(object, "__doc__");
930 PyObject* doc = PyObject_GetAttrString(object, "__doc__");
926 if (doc) {
931 if (doc) {
927 #ifdef PY3K
932 #ifdef PY3K
928 results << PyUnicode_AsUTF8(doc);
933 results << PyUnicode_AsUTF8(doc);
929 #else
934 #else
930 results << PyString_AsString(doc);
935 results << PyString_AsString(doc);
931 #endif
936 #endif
932 Py_DECREF(doc);
937 Py_DECREF(doc);
933 }
938 }
934 }
939 }
935 }
940 }
936 } else {
941 } else {
937 PyObject* keys = NULL;
942 PyObject* keys = NULL;
938 bool isDict = false;
943 bool isDict = false;
939 if (PyDict_Check(object)) {
944 if (PyDict_Check(object)) {
940 keys = PyDict_Keys(object);
945 keys = PyDict_Keys(object);
941 isDict = true;
946 isDict = true;
942 } else {
947 } else {
943 keys = PyObject_Dir(object);
948 keys = PyObject_Dir(object);
944 }
949 }
945 if (keys) {
950 if (keys) {
946 int count = PyList_Size(keys);
951 int count = PyList_Size(keys);
947 PyObject* key;
952 PyObject* key;
948 PyObject* value;
953 PyObject* value;
949 QString keystr;
954 QString keystr;
950 for (int i = 0;i<count;i++) {
955 for (int i = 0;i<count;i++) {
951 key = PyList_GetItem(keys,i);
956 key = PyList_GetItem(keys,i);
952 if (isDict) {
957 if (isDict) {
953 value = PyDict_GetItem(object, key);
958 value = PyDict_GetItem(object, key);
954 Py_INCREF(value);
959 Py_INCREF(value);
955 } else {
960 } else {
956 value = PyObject_GetAttr(object, key);
961 value = PyObject_GetAttr(object, key);
957 }
962 }
958 if (!value) continue;
963 if (!value) continue;
959 #ifdef PY3K
964 #ifdef PY3K
960 keystr = PyUnicode_AsUTF8(key);
965 keystr = PyUnicode_AsUTF8(key);
961 #else
966 #else
962 keystr = PyString_AsString(key);
967 keystr = PyString_AsString(key);
963 #endif
968 #endif
964 static const QString underscoreStr("__tmp");
969 static const QString underscoreStr("__tmp");
965 if (!keystr.startsWith(underscoreStr)) {
970 if (!keystr.startsWith(underscoreStr)) {
966 switch (type) {
971 switch (type) {
967 case Anything:
972 case Anything:
968 results << keystr;
973 results << keystr;
969 break;
974 break;
970 case Class:
975 case Class:
971 #ifdef PY3K
976 #ifdef PY3K
972 if(PyType_Check(value)) {
977 if(PyType_Check(value)) {
973 #else
978 #else
974 if (value->ob_type == &PyClass_Type || value->ob_type == &PyType_Type) {
979 if (value->ob_type == &PyClass_Type || value->ob_type == &PyType_Type) {
975 #endif
980 #endif
976 results << keystr;
981 results << keystr;
977 }
982 }
978 break;
983 break;
979 case Variable:
984 case Variable:
980 if (
985 if (
981 #ifndef PY3K
986 #ifndef PY3K
982 value->ob_type != &PyClass_Type &&
987 value->ob_type != &PyClass_Type &&
983 #endif
988 #endif
984 value->ob_type != &PyCFunction_Type &&
989 value->ob_type != &PyCFunction_Type &&
985 value->ob_type != &PyFunction_Type &&
990 value->ob_type != &PyFunction_Type &&
986 value->ob_type != &PyMethod_Type &&
991 value->ob_type != &PyMethod_Type &&
987 value->ob_type != &PyModule_Type &&
992 value->ob_type != &PyModule_Type &&
988 value->ob_type != &PyType_Type &&
993 value->ob_type != &PyType_Type &&
989 value->ob_type != &PythonQtSlotFunction_Type
994 value->ob_type != &PythonQtSlotFunction_Type
990 ) {
995 ) {
991 results << keystr;
996 results << keystr;
992 }
997 }
993 break;
998 break;
994 case Function:
999 case Function:
995 if (value->ob_type == &PyCFunction_Type ||
1000 if (value->ob_type == &PyCFunction_Type ||
996 value->ob_type == &PyFunction_Type ||
1001 value->ob_type == &PyFunction_Type ||
997 value->ob_type == &PyMethod_Type ||
1002 value->ob_type == &PyMethod_Type ||
998 value->ob_type == &PythonQtSlotFunction_Type
1003 value->ob_type == &PythonQtSlotFunction_Type
999 ) {
1004 ) {
1000 results << keystr;
1005 results << keystr;
1001 }
1006 }
1002 break;
1007 break;
1003 case Module:
1008 case Module:
1004 if (value->ob_type == &PyModule_Type) {
1009 if (value->ob_type == &PyModule_Type) {
1005 results << keystr;
1010 results << keystr;
1006 }
1011 }
1007 break;
1012 break;
1008 default:
1013 default:
1009 std::cerr << "PythonQt: introspection: unknown case" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
1014 std::cerr << "PythonQt: introspection: unknown case" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
1010 }
1015 }
1011 }
1016 }
1012 Py_DECREF(value);
1017 Py_DECREF(value);
1013 }
1018 }
1014 Py_DECREF(keys);
1019 Py_DECREF(keys);
1015 }
1020 }
1016 if ((type == Anything) || (type == Variable)) {
1021 if ((type == Anything) || (type == Variable)) {
1017 if (object->ob_type == &PythonQtClassWrapper_Type) {
1022 if (object->ob_type == &PythonQtClassWrapper_Type) {
1018 PythonQtClassWrapper* o = (PythonQtClassWrapper*)object;
1023 PythonQtClassWrapper* o = (PythonQtClassWrapper*)object;
1019 PythonQtClassInfo* info = o->classInfo();
1024 PythonQtClassInfo* info = o->classInfo();
1020 results += info->propertyList();
1025 results += info->propertyList();
1021 }
1026 }
1022 }
1027 }
1023 }
1028 }
1024 return results;
1029 return results;
1025 }
1030 }
1026
1031
1027 PyObject* PythonQt::getObjectByType(const QString& typeName)
1032 PyObject* PythonQt::getObjectByType(const QString& typeName)
1028 {
1033 {
1029 PythonQtObjectPtr sys;
1034 PythonQtObjectPtr sys;
1030 sys.setNewRef(PyImport_ImportModule("sys"));
1035 sys.setNewRef(PyImport_ImportModule("sys"));
1031 PythonQtObjectPtr modules = lookupObject(sys, "modules");
1036 PythonQtObjectPtr modules = lookupObject(sys, "modules");
1032 Q_ASSERT(PyDict_Check(modules));
1037 Q_ASSERT(PyDict_Check(modules));
1033
1038
1034 QStringList tmp = typeName.split(".");
1039 QStringList tmp = typeName.split(".");
1035 QString simpleTypeName = tmp.takeLast();
1040 QString simpleTypeName = tmp.takeLast();
1036 QString moduleName = tmp.join(".");
1041 QString moduleName = tmp.join(".");
1037
1042
1038 PyObject* object = NULL;
1043 PyObject* object = NULL;
1039 PyObject* moduleObject = PyDict_GetItemString(modules, moduleName.toLatin1().constData());
1044 PyObject* moduleObject = PyDict_GetItemString(modules, moduleName.toLatin1().constData());
1040 if (moduleObject) {
1045 if (moduleObject) {
1041 object = PyObject_GetAttrString(moduleObject, simpleTypeName.toLatin1().constData());
1046 object = PyObject_GetAttrString(moduleObject, simpleTypeName.toLatin1().constData());
1042 }
1047 }
1043
1048
1044 if (!object) {
1049 if (!object) {
1045 moduleObject = PyDict_GetItemString(modules, "__builtin__");
1050 moduleObject = PyDict_GetItemString(modules, "__builtin__");
1046 if (moduleObject) {
1051 if (moduleObject) {
1047 object = PyObject_GetAttrString(moduleObject, simpleTypeName.toLatin1().constData());
1052 object = PyObject_GetAttrString(moduleObject, simpleTypeName.toLatin1().constData());
1048 }
1053 }
1049 }
1054 }
1050
1055
1051 return object;
1056 return object;
1052 }
1057 }
1053
1058
1054 QStringList PythonQt::introspectType(const QString& typeName, ObjectType type)
1059 QStringList PythonQt::introspectType(const QString& typeName, ObjectType type)
1055 {
1060 {
1056 QStringList results;
1061 QStringList results;
1057 PyObject* object = getObjectByType(typeName);
1062 PyObject* object = getObjectByType(typeName);
1058 if (!object) {
1063 if (!object) {
1059 // the last item may be a member, split it away and try again
1064 // the last item may be a member, split it away and try again
1060 QStringList tmp = typeName.split(".");
1065 QStringList tmp = typeName.split(".");
1061 QString memberName = tmp.takeLast();
1066 QString memberName = tmp.takeLast();
1062 QString typeName;
1067 QString typeName;
1063 if (tmp.isEmpty()) {
1068 if (tmp.isEmpty()) {
1064 typeName = memberName;
1069 typeName = memberName;
1065 memberName.clear();
1070 memberName.clear();
1066 } else {
1071 } else {
1067 typeName = tmp.takeLast();
1072 typeName = tmp.takeLast();
1068 }
1073 }
1069 PyObject* typeObject = getObjectByType(typeName);
1074 PyObject* typeObject = getObjectByType(typeName);
1070 if (typeObject) {
1075 if (typeObject) {
1071 object = PyObject_GetAttrString(typeObject, memberName.toLatin1().constData());
1076 object = PyObject_GetAttrString(typeObject, memberName.toLatin1().constData());
1072 }
1077 }
1073 }
1078 }
1074 if (object) {
1079 if (object) {
1075 results = introspectObject(object, type);
1080 results = introspectObject(object, type);
1076 Py_DECREF(object);
1081 Py_DECREF(object);
1077 }
1082 }
1078 return results;
1083 return results;
1079 }
1084 }
1080
1085
1081 QVariant PythonQt::call(PyObject* object, const QString& name, const QVariantList& args, const QVariantMap& kwargs)
1086 QVariant PythonQt::call(PyObject* object, const QString& name, const QVariantList& args, const QVariantMap& kwargs)
1082 {
1087 {
1083 PythonQtObjectPtr callable = lookupCallable(object, name);
1088 PythonQtObjectPtr callable = lookupCallable(object, name);
1084 if (callable) {
1089 if (callable) {
1085 return call(callable, args, kwargs);
1090 return call(callable, args, kwargs);
1086 } else {
1091 } else {
1087 return QVariant();
1092 return QVariant();
1088 }
1093 }
1089 }
1094 }
1090
1095
1091 QVariant PythonQt::call(PyObject* callable, const QVariantList& args, const QVariantMap& kwargs)
1096 QVariant PythonQt::call(PyObject* callable, const QVariantList& args, const QVariantMap& kwargs)
1092 {
1097 {
1093 QVariant r;
1098 QVariant r;
1094 PythonQtObjectPtr result;
1099 PythonQtObjectPtr result;
1095 result.setNewRef(callAndReturnPyObject(callable, args, kwargs));
1100 result.setNewRef(callAndReturnPyObject(callable, args, kwargs));
1096 clearError();
1101 clearError();
1097 if (result) {
1102 if (result) {
1098 r = PythonQtConv::PyObjToQVariant(result);
1103 r = PythonQtConv::PyObjToQVariant(result);
1099 } else {
1104 } else {
1100 PythonQt::self()->handleError();
1105 PythonQt::self()->handleError();
1101 }
1106 }
1102 return r;
1107 return r;
1103 }
1108 }
1104
1109
1105 PyObject* PythonQt::callAndReturnPyObject(PyObject* callable, const QVariantList& args, const QVariantMap& kwargs)
1110 PyObject* PythonQt::callAndReturnPyObject(PyObject* callable, const QVariantList& args, const QVariantMap& kwargs)
1106 {
1111 {
1107 PyObject* result = NULL;
1112 PyObject* result = NULL;
1108 if (callable) {
1113 if (callable) {
1109 bool err = false;
1114 bool err = false;
1110 PythonQtObjectPtr pargs;
1115 PythonQtObjectPtr pargs;
1111 int count = args.size();
1116 int count = args.size();
1112 if ((count > 0) || (kwargs.count() > 0)) { // create empty tuple if kwargs are given
1117 if ((count > 0) || (kwargs.count() > 0)) { // create empty tuple if kwargs are given
1113 pargs.setNewRef(PyTuple_New(count));
1118 pargs.setNewRef(PyTuple_New(count));
1114
1119
1115 // transform QVariant arguments to Python
1120 // transform QVariant arguments to Python
1116 for (int i = 0; i < count; i++) {
1121 for (int i = 0; i < count; i++) {
1117 PyObject* arg = PythonQtConv::QVariantToPyObject(args.at(i));
1122 PyObject* arg = PythonQtConv::QVariantToPyObject(args.at(i));
1118 if (arg) {
1123 if (arg) {
1119 // steals reference, no unref
1124 // steals reference, no unref
1120 PyTuple_SetItem(pargs, i,arg);
1125 PyTuple_SetItem(pargs, i,arg);
1121 } else {
1126 } else {
1122 err = true;
1127 err = true;
1123 break;
1128 break;
1124 }
1129 }
1125 }
1130 }
1126 }
1131 }
1127 if (!err) {
1132 if (!err) {
1128 if (kwargs.isEmpty()) {
1133 if (kwargs.isEmpty()) {
1129 // do a direct call if we have no keyword arguments
1134 // do a direct call if we have no keyword arguments
1130 PyErr_Clear();
1135 PyErr_Clear();
1131 result = PyObject_CallObject(callable, pargs);
1136 result = PyObject_CallObject(callable, pargs);
1132 } else {
1137 } else {
1133 // convert keyword arguments to Python
1138 // convert keyword arguments to Python
1134 PythonQtObjectPtr pkwargs;
1139 PythonQtObjectPtr pkwargs;
1135 pkwargs.setNewRef(PyDict_New());
1140 pkwargs.setNewRef(PyDict_New());
1136 QMapIterator<QString, QVariant> it(kwargs);
1141 QMapIterator<QString, QVariant> it(kwargs);
1137 while (it.hasNext()) {
1142 while (it.hasNext()) {
1138 it.next();
1143 it.next();
1139 PyObject* arg = PythonQtConv::QVariantToPyObject(it.value());
1144 PyObject* arg = PythonQtConv::QVariantToPyObject(it.value());
1140 if (arg) {
1145 if (arg) {
1141 PyDict_SetItemString(pkwargs, it.key().toLatin1().constData(), arg);
1146 PyDict_SetItemString(pkwargs, it.key().toLatin1().constData(), arg);
1142 } else {
1147 } else {
1143 err = true;
1148 err = true;
1144 break;
1149 break;
1145 }
1150 }
1146 }
1151 }
1147 if (!err) {
1152 if (!err) {
1148 // call with arguments and keyword arguments
1153 // call with arguments and keyword arguments
1149 PyErr_Clear();
1154 PyErr_Clear();
1150 result = PyObject_Call(callable, pargs, pkwargs);
1155 result = PyObject_Call(callable, pargs, pkwargs);
1151 }
1156 }
1152 }
1157 }
1153 }
1158 }
1154 }
1159 }
1155 return result;
1160 return result;
1156 }
1161 }
1157
1162
1158 void PythonQt::addInstanceDecorators(QObject* o)
1163 void PythonQt::addInstanceDecorators(QObject* o)
1159 {
1164 {
1160 _p->addDecorators(o, PythonQtPrivate::InstanceDecorator);
1165 _p->addDecorators(o, PythonQtPrivate::InstanceDecorator);
1161 }
1166 }
1162
1167
1163 void PythonQt::addClassDecorators(QObject* o)
1168 void PythonQt::addClassDecorators(QObject* o)
1164 {
1169 {
1165 _p->addDecorators(o, PythonQtPrivate::StaticDecorator | PythonQtPrivate::ConstructorDecorator | PythonQtPrivate::DestructorDecorator);
1170 _p->addDecorators(o, PythonQtPrivate::StaticDecorator | PythonQtPrivate::ConstructorDecorator | PythonQtPrivate::DestructorDecorator);
1166 }
1171 }
1167
1172
1168 void PythonQt::addDecorators(QObject* o)
1173 void PythonQt::addDecorators(QObject* o)
1169 {
1174 {
1170 _p->addDecorators(o, PythonQtPrivate::AllDecorators);
1175 _p->addDecorators(o, PythonQtPrivate::AllDecorators);
1171 }
1176 }
1172
1177
1173 void PythonQt::registerQObjectClassNames(const QStringList& names)
1178 void PythonQt::registerQObjectClassNames(const QStringList& names)
1174 {
1179 {
1175 _p->registerQObjectClassNames(names);
1180 _p->registerQObjectClassNames(names);
1176 }
1181 }
1177
1182
1178 void PythonQt::setImporter(PythonQtImportFileInterface* importInterface)
1183 void PythonQt::setImporter(PythonQtImportFileInterface* importInterface)
1179 {
1184 {
1180 _p->_importInterface = importInterface;
1185 _p->_importInterface = importInterface;
1181 PythonQtImport::init();
1186 PythonQtImport::init();
1182 }
1187 }
1183
1188
1184 void PythonQt::setImporterIgnorePaths(const QStringList& paths)
1189 void PythonQt::setImporterIgnorePaths(const QStringList& paths)
1185 {
1190 {
1186 _p->_importIgnorePaths = paths;
1191 _p->_importIgnorePaths = paths;
1187 }
1192 }
1188
1193
1189 const QStringList& PythonQt::getImporterIgnorePaths()
1194 const QStringList& PythonQt::getImporterIgnorePaths()
1190 {
1195 {
1191 return _p->_importIgnorePaths;
1196 return _p->_importIgnorePaths;
1192 }
1197 }
1193
1198
1194 void PythonQt::addWrapperFactory(PythonQtCppWrapperFactory* factory)
1199 void PythonQt::addWrapperFactory(PythonQtCppWrapperFactory* factory)
1195 {
1200 {
1196 _p->_cppWrapperFactories.append(factory);
1201 _p->_cppWrapperFactories.append(factory);
1197 }
1202 }
1198
1203
1199 void PythonQt::addWrapperFactory( PythonQtForeignWrapperFactory* factory )
1204 void PythonQt::addWrapperFactory( PythonQtForeignWrapperFactory* factory )
1200 {
1205 {
1201 _p->_foreignWrapperFactories.append(factory);
1206 _p->_foreignWrapperFactories.append(factory);
1202 }
1207 }
1203
1208
1204 //---------------------------------------------------------------------------------------------------
1209 //---------------------------------------------------------------------------------------------------
1205 PythonQtPrivate::PythonQtPrivate()
1210 PythonQtPrivate::PythonQtPrivate()
1206 {
1211 {
1207 _importInterface = NULL;
1212 _importInterface = NULL;
1208 _defaultImporter = new PythonQtQFileImporter;
1213 _defaultImporter = new PythonQtQFileImporter;
1209 _noLongerWrappedCB = NULL;
1214 _noLongerWrappedCB = NULL;
1210 _wrappedCB = NULL;
1215 _wrappedCB = NULL;
1211 _currentClassInfoForClassWrapperCreation = NULL;
1216 _currentClassInfoForClassWrapperCreation = NULL;
1212 _profilingCB = NULL;
1217 _profilingCB = NULL;
1213 _hadError = false;
1218 _hadError = false;
1214 _systemExitExceptionHandlerEnabled = false;
1219 _systemExitExceptionHandlerEnabled = false;
1215 }
1220 }
1216
1221
1217 void PythonQtPrivate::setupSharedLibrarySuffixes()
1222 void PythonQtPrivate::setupSharedLibrarySuffixes()
1218 {
1223 {
1219 _sharedLibrarySuffixes.clear();
1224 _sharedLibrarySuffixes.clear();
1220 PythonQtObjectPtr imp;
1225 PythonQtObjectPtr imp;
1221 imp.setNewRef(PyImport_ImportModule("imp"));
1226 imp.setNewRef(PyImport_ImportModule("imp"));
1222 int cExtensionCode = imp.getVariable("C_EXTENSION").toInt();
1227 int cExtensionCode = imp.getVariable("C_EXTENSION").toInt();
1223 QVariant result = imp.call("get_suffixes");
1228 QVariant result = imp.call("get_suffixes");
1224 #ifdef __linux
1229 #ifdef __linux
1225 #ifdef _DEBUG
1230 #ifdef _DEBUG
1226 // First look for shared libraries with the '_d' suffix in debug mode on Linux.
1231 // First look for shared libraries with the '_d' suffix in debug mode on Linux.
1227 // This is a workaround, because python does not append the '_d' suffix on Linux
1232 // This is a workaround, because python does not append the '_d' suffix on Linux
1228 // and would always load the release library otherwise.
1233 // and would always load the release library otherwise.
1229 _sharedLibrarySuffixes << "_d.so";
1234 _sharedLibrarySuffixes << "_d.so";
1230 #endif
1235 #endif
1231 #endif
1236 #endif
1232 Q_FOREACH (QVariant entry, result.toList()) {
1237 Q_FOREACH (QVariant entry, result.toList()) {
1233 QVariantList suffixEntry = entry.toList();
1238 QVariantList suffixEntry = entry.toList();
1234 if (suffixEntry.count()==3) {
1239 if (suffixEntry.count()==3) {
1235 int code = suffixEntry.at(2).toInt();
1240 int code = suffixEntry.at(2).toInt();
1236 if (code == cExtensionCode) {
1241 if (code == cExtensionCode) {
1237 _sharedLibrarySuffixes << suffixEntry.at(0).toString();
1242 _sharedLibrarySuffixes << suffixEntry.at(0).toString();
1238 }
1243 }
1239 }
1244 }
1240 }
1245 }
1241 }
1246 }
1242
1247
1243 PythonQtClassInfo* PythonQtPrivate::currentClassInfoForClassWrapperCreation()
1248 PythonQtClassInfo* PythonQtPrivate::currentClassInfoForClassWrapperCreation()
1244 {
1249 {
1245 PythonQtClassInfo* info = _currentClassInfoForClassWrapperCreation;
1250 PythonQtClassInfo* info = _currentClassInfoForClassWrapperCreation;
1246 _currentClassInfoForClassWrapperCreation = NULL;
1251 _currentClassInfoForClassWrapperCreation = NULL;
1247 return info;
1252 return info;
1248 }
1253 }
1249
1254
1250 void PythonQtPrivate::addDecorators(QObject* o, int decoTypes)
1255 void PythonQtPrivate::addDecorators(QObject* o, int decoTypes)
1251 {
1256 {
1252 o->setParent(this);
1257 o->setParent(this);
1253 int numMethods = o->metaObject()->methodCount();
1258 int numMethods = o->metaObject()->methodCount();
1254 for (int i = 0; i < numMethods; i++) {
1259 for (int i = 0; i < numMethods; i++) {
1255 QMetaMethod m = o->metaObject()->method(i);
1260 QMetaMethod m = o->metaObject()->method(i);
1256 if ((m.methodType() == QMetaMethod::Method ||
1261 if ((m.methodType() == QMetaMethod::Method ||
1257 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
1262 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
1258 // QMetaMethod::signature changed to QMetaMethod::methodSignature in QT5
1263 // QMetaMethod::signature changed to QMetaMethod::methodSignature in QT5
1259 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
1264 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
1260 QByteArray signature = m.methodSignature();
1265 QByteArray signature = m.methodSignature();
1261 #else
1266 #else
1262 QByteArray signature = m.signature();
1267 QByteArray signature = m.signature();
1263 #endif
1268 #endif
1264 if (signature.startsWith("new_")) {
1269 if (signature.startsWith("new_")) {
1265 if ((decoTypes & ConstructorDecorator) == 0) continue;
1270 if ((decoTypes & ConstructorDecorator) == 0) continue;
1266 const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL);
1271 const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL);
1267 if (info->parameters().at(0).pointerCount == 1) {
1272 if (info->parameters().at(0).pointerCount == 1) {
1268 QByteArray nameOfClass = signature.mid(4, signature.indexOf('(')-4);
1273 QByteArray nameOfClass = signature.mid(4, signature.indexOf('(')-4);
1269 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1274 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1270 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1275 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1271 classInfo->addConstructor(newSlot);
1276 classInfo->addConstructor(newSlot);
1272 }
1277 }
1273 } else if (signature.startsWith("delete_")) {
1278 } else if (signature.startsWith("delete_")) {
1274 if ((decoTypes & DestructorDecorator) == 0) continue;
1279 if ((decoTypes & DestructorDecorator) == 0) continue;
1275 QByteArray nameOfClass = signature.mid(7, signature.indexOf('(')-7);
1280 QByteArray nameOfClass = signature.mid(7, signature.indexOf('(')-7);
1276 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1281 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1277 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1282 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1278 classInfo->setDestructor(newSlot);
1283 classInfo->setDestructor(newSlot);
1279 } else if (signature.startsWith("static_")) {
1284 } else if (signature.startsWith("static_")) {
1280 if ((decoTypes & StaticDecorator) == 0) continue;
1285 if ((decoTypes & StaticDecorator) == 0) continue;
1281 QByteArray nameOfClass = signature.mid(7);
1286 QByteArray nameOfClass = signature.mid(7);
1282 nameOfClass = nameOfClass.mid(0, nameOfClass.indexOf('_'));
1287 nameOfClass = nameOfClass.mid(0, nameOfClass.indexOf('_'));
1283 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1288 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1284 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1289 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1285 classInfo->addDecoratorSlot(newSlot);
1290 classInfo->addDecoratorSlot(newSlot);
1291 } else if (signature.startsWith("doc_")) {
1292 if ((decoTypes & DocstringDecorator) == 0) continue;
1293 QByteArray nameOfClassAndMethod = signature.mid(4, signature.indexOf('(')-4);
1294 QList<QByteArray> nameOfClassAndMethodAsList = nameOfClassAndMethod.split('_');
1295 QByteArray nameOfClass = nameOfClassAndMethodAsList.at(0);
1296 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1297 // TODO: make shure that the function does not take arguments and returns a QString
1298 QString docString;
1299 void* argList[1] = {&docString};
1300 o->qt_metacall(QMetaObject::InvokeMetaMethod, i, argList);
1301 if( nameOfClassAndMethodAsList.size() == 1 ) {
1302 // __doc__ of class itself
1303 classInfo->setDoc(docString);
1304 } else {
1305 // __doc__ of class method (e.g. public slot)
1306 QByteArray nameOfMethod = nameOfClassAndMethodAsList.at(1);
1307 PythonQtMemberInfo member = classInfo->member(nameOfMethod);
1308 // check if we really found a slot
1309 if( member._type == PythonQtMemberInfo::Slot || member._type == PythonQtMemberInfo::Signal ) {
1310 member._slot->setDoc(docString);
1311 }
1312 }
1286 } else {
1313 } else {
1287 if ((decoTypes & InstanceDecorator) == 0) continue;
1314 if ((decoTypes & InstanceDecorator) == 0) continue;
1288 const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL);
1315 const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL);
1289 if (info->parameters().count()>1) {
1316 if (info->parameters().count()>1) {
1290 PythonQtMethodInfo::ParameterInfo p = info->parameters().at(1);
1317 PythonQtMethodInfo::ParameterInfo p = info->parameters().at(1);
1291 if (p.pointerCount==1) {
1318 if (p.pointerCount==1) {
1292 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(p.name);
1319 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(p.name);
1293 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::InstanceDecorator);
1320 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::InstanceDecorator);
1294 classInfo->addDecoratorSlot(newSlot);
1321 classInfo->addDecoratorSlot(newSlot);
1295 }
1322 }
1296 }
1323 }
1297 }
1324 }
1298 }
1325 }
1299 }
1326 }
1300 }
1327 }
1301
1328
1302 void PythonQtPrivate::registerQObjectClassNames(const QStringList& names)
1329 void PythonQtPrivate::registerQObjectClassNames(const QStringList& names)
1303 {
1330 {
1304 Q_FOREACH(QString name, names) {
1331 Q_FOREACH(QString name, names) {
1305 _knownQObjectClassNames.insert(name.toLatin1(), true);
1332 _knownQObjectClassNames.insert(name.toLatin1(), true);
1306 }
1333 }
1307 }
1334 }
1308
1335
1309 void PythonQtPrivate::removeSignalEmitter(QObject* obj)
1336 void PythonQtPrivate::removeSignalEmitter(QObject* obj)
1310 {
1337 {
1311 _signalReceivers.remove(obj);
1338 _signalReceivers.remove(obj);
1312 }
1339 }
1313
1340
1314 namespace
1341 namespace
1315 {
1342 {
1316 //! adapted from python source file "pythonrun.c", function "handle_system_exit"
1343 //! adapted from python source file "pythonrun.c", function "handle_system_exit"
1317 //! return the exitcode instead of calling "Py_Exit".
1344 //! return the exitcode instead of calling "Py_Exit".
1318 //! it gives the application an opportunity to properly terminate.
1345 //! it gives the application an opportunity to properly terminate.
1319 int custom_system_exit_exception_handler()
1346 int custom_system_exit_exception_handler()
1320 {
1347 {
1321 PyObject *exception, *value, *tb;
1348 PyObject *exception, *value, *tb;
1322 int exitcode = 0;
1349 int exitcode = 0;
1323
1350
1324 // if (Py_InspectFlag)
1351 // if (Py_InspectFlag)
1325 // /* Don't exit if -i flag was given. This flag is set to 0
1352 // /* Don't exit if -i flag was given. This flag is set to 0
1326 // * when entering interactive mode for inspecting. */
1353 // * when entering interactive mode for inspecting. */
1327 // return exitcode;
1354 // return exitcode;
1328
1355
1329 PyErr_Fetch(&exception, &value, &tb);
1356 PyErr_Fetch(&exception, &value, &tb);
1330 #ifdef PY3K
1357 #ifdef PY3K
1331 std::cout << std::endl;
1358 std::cout << std::endl;
1332 #else
1359 #else
1333 if (Py_FlushLine())
1360 if (Py_FlushLine())
1334 PyErr_Clear();
1361 PyErr_Clear();
1335 #endif
1362 #endif
1336 fflush(stdout);
1363 fflush(stdout);
1337 if (value == NULL || value == Py_None)
1364 if (value == NULL || value == Py_None)
1338 goto done;
1365 goto done;
1339 if (PyExceptionInstance_Check(value)) {
1366 if (PyExceptionInstance_Check(value)) {
1340 /* The error code should be in the `code' attribute. */
1367 /* The error code should be in the `code' attribute. */
1341 PyObject *code = PyObject_GetAttrString(value, "code");
1368 PyObject *code = PyObject_GetAttrString(value, "code");
1342 if (code) {
1369 if (code) {
1343 Py_DECREF(value);
1370 Py_DECREF(value);
1344 value = code;
1371 value = code;
1345 if (value == Py_None)
1372 if (value == Py_None)
1346 goto done;
1373 goto done;
1347 }
1374 }
1348 /* If we failed to dig out the 'code' attribute,
1375 /* If we failed to dig out the 'code' attribute,
1349 just let the else clause below print the error. */
1376 just let the else clause below print the error. */
1350 }
1377 }
1351 #ifdef PY3K
1378 #ifdef PY3K
1352 if (PyLong_Check(value))
1379 if (PyLong_Check(value))
1353 exitcode = (int)PyLong_AsLong(value);
1380 exitcode = (int)PyLong_AsLong(value);
1354 #else
1381 #else
1355 if (PyInt_Check(value))
1382 if (PyInt_Check(value))
1356 exitcode = (int)PyInt_AsLong(value);
1383 exitcode = (int)PyInt_AsLong(value);
1357 #endif
1384 #endif
1358 else {
1385 else {
1359 PyObject *sys_stderr = PySys_GetObject(const_cast<char*>("stderr"));
1386 PyObject *sys_stderr = PySys_GetObject(const_cast<char*>("stderr"));
1360 if (sys_stderr != NULL && sys_stderr != Py_None) {
1387 if (sys_stderr != NULL && sys_stderr != Py_None) {
1361 PyFile_WriteObject(value, sys_stderr, Py_PRINT_RAW);
1388 PyFile_WriteObject(value, sys_stderr, Py_PRINT_RAW);
1362 } else {
1389 } else {
1363 PyObject_Print(value, stderr, Py_PRINT_RAW);
1390 PyObject_Print(value, stderr, Py_PRINT_RAW);
1364 fflush(stderr);
1391 fflush(stderr);
1365 }
1392 }
1366 PySys_WriteStderr("\n");
1393 PySys_WriteStderr("\n");
1367 exitcode = 1;
1394 exitcode = 1;
1368 }
1395 }
1369 done:
1396 done:
1370 /* Restore and clear the exception info, in order to properly decref
1397 /* Restore and clear the exception info, in order to properly decref
1371 * the exception, value, and traceback. If we just exit instead,
1398 * the exception, value, and traceback. If we just exit instead,
1372 * these leak, which confuses PYTHONDUMPREFS output, and may prevent
1399 * these leak, which confuses PYTHONDUMPREFS output, and may prevent
1373 * some finalizers from running.
1400 * some finalizers from running.
1374 */
1401 */
1375 PyErr_Restore(exception, value, tb);
1402 PyErr_Restore(exception, value, tb);
1376 PyErr_Clear();
1403 PyErr_Clear();
1377 return exitcode;
1404 return exitcode;
1378 //Py_Exit(exitcode);
1405 //Py_Exit(exitcode);
1379 }
1406 }
1380 }
1407 }
1381
1408
1382 bool PythonQt::handleError()
1409 bool PythonQt::handleError()
1383 {
1410 {
1384 bool flag = false;
1411 bool flag = false;
1385 if (PyErr_Occurred()) {
1412 if (PyErr_Occurred()) {
1386
1413
1387 if (_p->_systemExitExceptionHandlerEnabled &&
1414 if (_p->_systemExitExceptionHandlerEnabled &&
1388 PyErr_ExceptionMatches(PyExc_SystemExit)) {
1415 PyErr_ExceptionMatches(PyExc_SystemExit)) {
1389 int exitcode = custom_system_exit_exception_handler();
1416 int exitcode = custom_system_exit_exception_handler();
1390 Q_EMIT PythonQt::self()->systemExitExceptionRaised(exitcode);
1417 Q_EMIT PythonQt::self()->systemExitExceptionRaised(exitcode);
1391 }
1418 }
1392 else
1419 else
1393 {
1420 {
1394 // currently we just print the error and the stderr handler parses the errors
1421 // currently we just print the error and the stderr handler parses the errors
1395 PyErr_Print();
1422 PyErr_Print();
1396
1423
1397 /*
1424 /*
1398 // EXTRA: the format of the ptype and ptraceback is not really documented, so I use PyErr_Print() above
1425 // EXTRA: the format of the ptype and ptraceback is not really documented, so I use PyErr_Print() above
1399 PyObject *ptype;
1426 PyObject *ptype;
1400 PyObject *pvalue;
1427 PyObject *pvalue;
1401 PyObject *ptraceback;
1428 PyObject *ptraceback;
1402 PyErr_Fetch( &ptype, &pvalue, &ptraceback);
1429 PyErr_Fetch( &ptype, &pvalue, &ptraceback);
1403
1430
1404 Py_XDECREF(ptype);
1431 Py_XDECREF(ptype);
1405 Py_XDECREF(pvalue);
1432 Py_XDECREF(pvalue);
1406 Py_XDECREF(ptraceback);
1433 Py_XDECREF(ptraceback);
1407 */
1434 */
1408 PyErr_Clear();
1435 PyErr_Clear();
1409 }
1436 }
1410 flag = true;
1437 flag = true;
1411 }
1438 }
1412 _p->_hadError = flag;
1439 _p->_hadError = flag;
1413 return flag;
1440 return flag;
1414 }
1441 }
1415
1442
1416 bool PythonQt::hadError()const
1443 bool PythonQt::hadError()const
1417 {
1444 {
1418 return _p->_hadError;
1445 return _p->_hadError;
1419 }
1446 }
1420
1447
1421 void PythonQt::clearError()
1448 void PythonQt::clearError()
1422 {
1449 {
1423 _p->_hadError = false;
1450 _p->_hadError = false;
1424 }
1451 }
1425
1452
1426 void PythonQt::setSystemExitExceptionHandlerEnabled(bool value)
1453 void PythonQt::setSystemExitExceptionHandlerEnabled(bool value)
1427 {
1454 {
1428 _p->_systemExitExceptionHandlerEnabled = value;
1455 _p->_systemExitExceptionHandlerEnabled = value;
1429 }
1456 }
1430
1457
1431 bool PythonQt::systemExitExceptionHandlerEnabled() const
1458 bool PythonQt::systemExitExceptionHandlerEnabled() const
1432 {
1459 {
1433 return _p->_systemExitExceptionHandlerEnabled;
1460 return _p->_systemExitExceptionHandlerEnabled;
1434 }
1461 }
1435
1462
1436 void PythonQt::addSysPath(const QString& path)
1463 void PythonQt::addSysPath(const QString& path)
1437 {
1464 {
1438 PythonQtObjectPtr sys;
1465 PythonQtObjectPtr sys;
1439 sys.setNewRef(PyImport_ImportModule("sys"));
1466 sys.setNewRef(PyImport_ImportModule("sys"));
1440 PythonQtObjectPtr obj = lookupObject(sys, "path");
1467 PythonQtObjectPtr obj = lookupObject(sys, "path");
1441 PyList_Insert(obj, 0, PythonQtConv::QStringToPyObject(path));
1468 PyList_Insert(obj, 0, PythonQtConv::QStringToPyObject(path));
1442 }
1469 }
1443
1470
1444 void PythonQt::overwriteSysPath(const QStringList& paths)
1471 void PythonQt::overwriteSysPath(const QStringList& paths)
1445 {
1472 {
1446 PythonQtObjectPtr sys;
1473 PythonQtObjectPtr sys;
1447 sys.setNewRef(PyImport_ImportModule("sys"));
1474 sys.setNewRef(PyImport_ImportModule("sys"));
1448 PyModule_AddObject(sys, "path", PythonQtConv::QStringListToPyList(paths));
1475 PyModule_AddObject(sys, "path", PythonQtConv::QStringListToPyList(paths));
1449 }
1476 }
1450
1477
1451 void PythonQt::setModuleImportPath(PyObject* module, const QStringList& paths)
1478 void PythonQt::setModuleImportPath(PyObject* module, const QStringList& paths)
1452 {
1479 {
1453 PyModule_AddObject(module, "__path__", PythonQtConv::QStringListToPyList(paths));
1480 PyModule_AddObject(module, "__path__", PythonQtConv::QStringListToPyList(paths));
1454 }
1481 }
1455
1482
1456 void PythonQt::stdOutRedirectCB(const QString& str)
1483 void PythonQt::stdOutRedirectCB(const QString& str)
1457 {
1484 {
1458 if (!PythonQt::self()) {
1485 if (!PythonQt::self()) {
1459 std::cout << str.toLatin1().data() << std::endl;
1486 std::cout << str.toLatin1().data() << std::endl;
1460 return;
1487 return;
1461 }
1488 }
1462 Q_EMIT PythonQt::self()->pythonStdOut(str);
1489 Q_EMIT PythonQt::self()->pythonStdOut(str);
1463 }
1490 }
1464
1491
1465 void PythonQt::stdErrRedirectCB(const QString& str)
1492 void PythonQt::stdErrRedirectCB(const QString& str)
1466 {
1493 {
1467 if (!PythonQt::self()) {
1494 if (!PythonQt::self()) {
1468 std::cerr << str.toLatin1().data() << std::endl;
1495 std::cerr << str.toLatin1().data() << std::endl;
1469 return;
1496 return;
1470 }
1497 }
1471 Q_EMIT PythonQt::self()->pythonStdErr(str);
1498 Q_EMIT PythonQt::self()->pythonStdErr(str);
1472 }
1499 }
1473
1500
1474 void PythonQt::setQObjectWrappedCallback(PythonQtQObjectWrappedCB* cb)
1501 void PythonQt::setQObjectWrappedCallback(PythonQtQObjectWrappedCB* cb)
1475 {
1502 {
1476 _p->_wrappedCB = cb;
1503 _p->_wrappedCB = cb;
1477 }
1504 }
1478
1505
1479 void PythonQt::setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB* cb)
1506 void PythonQt::setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB* cb)
1480 {
1507 {
1481 _p->_noLongerWrappedCB = cb;
1508 _p->_noLongerWrappedCB = cb;
1482 }
1509 }
1483
1510
1484 void PythonQt::setProfilingCallback(ProfilingCB* cb)
1511 void PythonQt::setProfilingCallback(ProfilingCB* cb)
1485 {
1512 {
1486 _p->_profilingCB = cb;
1513 _p->_profilingCB = cb;
1487 }
1514 }
1488
1515
1489
1516
1490 static PyMethodDef PythonQtMethods[] = {
1517 static PyMethodDef PythonQtMethods[] = {
1491 {NULL, NULL, 0, NULL}
1518 {NULL, NULL, 0, NULL}
1492 };
1519 };
1493
1520
1494 #ifdef PY3K
1521 #ifdef PY3K
1495 static PyModuleDef PythonQtModuleDef = {
1522 static PyModuleDef PythonQtModuleDef = {
1496 PyModuleDef_HEAD_INIT,
1523 PyModuleDef_HEAD_INIT,
1497 "",
1524 "",
1498 NULL,
1525 NULL,
1499 -1,
1526 -1,
1500 PythonQtMethods,
1527 PythonQtMethods,
1501 NULL,
1528 NULL,
1502 NULL,
1529 NULL,
1503 NULL,
1530 NULL,
1504 NULL
1531 NULL
1505 };
1532 };
1506 #endif
1533 #endif
1507
1534
1508 void PythonQt::initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName)
1535 void PythonQt::initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName)
1509 {
1536 {
1510 QByteArray name = "PythonQt";
1537 QByteArray name = "PythonQt";
1511 if (!pythonQtModuleName.isEmpty()) {
1538 if (!pythonQtModuleName.isEmpty()) {
1512 name = pythonQtModuleName;
1539 name = pythonQtModuleName;
1513 }
1540 }
1514 #ifdef PY3K
1541 #ifdef PY3K
1515 PythonQtModuleDef.m_name = name.constData();
1542 PythonQtModuleDef.m_name = name.constData();
1516 _p->_pythonQtModule = PyModule_Create(&PythonQtModuleDef);
1543 _p->_pythonQtModule = PyModule_Create(&PythonQtModuleDef);
1517 #else
1544 #else
1518 _p->_pythonQtModule = Py_InitModule(name.constData(), PythonQtMethods);
1545 _p->_pythonQtModule = Py_InitModule(name.constData(), PythonQtMethods);
1519 #endif
1546 #endif
1520 _p->_pythonQtModuleName = name;
1547 _p->_pythonQtModuleName = name;
1521
1548
1522 PythonQtObjectPtr sys;
1549 PythonQtObjectPtr sys;
1523 sys.setNewRef(PyImport_ImportModule("sys"));
1550 sys.setNewRef(PyImport_ImportModule("sys"));
1524
1551
1525 if (redirectStdOut) {
1552 if (redirectStdOut) {
1526 PythonQtObjectPtr out;
1553 PythonQtObjectPtr out;
1527 PythonQtObjectPtr err;
1554 PythonQtObjectPtr err;
1528 // create a redirection object for stdout and stderr
1555 // create a redirection object for stdout and stderr
1529 out = PythonQtStdOutRedirectType.tp_new(&PythonQtStdOutRedirectType,NULL, NULL);
1556 out = PythonQtStdOutRedirectType.tp_new(&PythonQtStdOutRedirectType,NULL, NULL);
1530 ((PythonQtStdOutRedirect*)out.object())->_cb = stdOutRedirectCB;
1557 ((PythonQtStdOutRedirect*)out.object())->_cb = stdOutRedirectCB;
1531 err = PythonQtStdOutRedirectType.tp_new(&PythonQtStdOutRedirectType,NULL, NULL);
1558 err = PythonQtStdOutRedirectType.tp_new(&PythonQtStdOutRedirectType,NULL, NULL);
1532 ((PythonQtStdOutRedirect*)err.object())->_cb = stdErrRedirectCB;
1559 ((PythonQtStdOutRedirect*)err.object())->_cb = stdErrRedirectCB;
1533 // replace the built in file objects with our own objects
1560 // replace the built in file objects with our own objects
1534 PyModule_AddObject(sys, "stdout", out);
1561 PyModule_AddObject(sys, "stdout", out);
1535 PyModule_AddObject(sys, "stderr", err);
1562 PyModule_AddObject(sys, "stderr", err);
1536 }
1563 }
1537
1564
1538 // add PythonQt to the list of builtin module names
1565 // add PythonQt to the list of builtin module names
1539 PyObject *old_module_names = PyObject_GetAttrString(sys.object(),"builtin_module_names");
1566 PyObject *old_module_names = PyObject_GetAttrString(sys.object(),"builtin_module_names");
1540 Py_ssize_t old_size = PyTuple_Size(old_module_names);
1567 Py_ssize_t old_size = PyTuple_Size(old_module_names);
1541 PyObject *module_names = PyTuple_New(old_size+1);
1568 PyObject *module_names = PyTuple_New(old_size+1);
1542 for(Py_ssize_t i = 0; i < old_size; i++)
1569 for(Py_ssize_t i = 0; i < old_size; i++)
1543 PyTuple_SetItem(module_names, i, PyTuple_GetItem(old_module_names, i));
1570 PyTuple_SetItem(module_names, i, PyTuple_GetItem(old_module_names, i));
1544 #ifdef PY3K
1571 #ifdef PY3K
1545 PyTuple_SetItem(module_names, old_size, PyUnicode_FromString(name.constData()));
1572 PyTuple_SetItem(module_names, old_size, PyUnicode_FromString(name.constData()));
1546 #else
1573 #else
1547 PyTuple_SetItem(module_names, old_size, PyString_FromString(name.constData()));
1574 PyTuple_SetItem(module_names, old_size, PyString_FromString(name.constData()));
1548 #endif
1575 #endif
1549 PyModule_AddObject(sys.object(),"builtin_module_names",module_names);
1576 PyModule_AddObject(sys.object(),"builtin_module_names",module_names);
1550 Py_DecRef(old_module_names);
1577 Py_DecRef(old_module_names);
1551
1578
1552 #ifdef PY3K
1579 #ifdef PY3K
1553 PyDict_SetItem(PyObject_GetAttrString(sys.object(), "modules"), PyUnicode_FromString(name.constData()), _p->_pythonQtModule.object());
1580 PyDict_SetItem(PyObject_GetAttrString(sys.object(), "modules"), PyUnicode_FromString(name.constData()), _p->_pythonQtModule.object());
1554 #endif
1581 #endif
1555 }
1582 }
1556
1583
1557 QString PythonQt::getReturnTypeOfWrappedMethod(PyObject* module, const QString& name)
1584 QString PythonQt::getReturnTypeOfWrappedMethod(PyObject* module, const QString& name)
1558 {
1585 {
1559 QStringList tmp = name.split(".");
1586 QStringList tmp = name.split(".");
1560 QString methodName = tmp.takeLast();
1587 QString methodName = tmp.takeLast();
1561 QString variableName = tmp.join(".");
1588 QString variableName = tmp.join(".");
1562 // TODO: the variableName may be a type name, this needs to be handled differently,
1589 // TODO: the variableName may be a type name, this needs to be handled differently,
1563 // because it is not necessarily known in the module context
1590 // because it is not necessarily known in the module context
1564 PythonQtObjectPtr variableObject = lookupObject(module, variableName);
1591 PythonQtObjectPtr variableObject = lookupObject(module, variableName);
1565 if (variableObject.isNull()) {
1592 if (variableObject.isNull()) {
1566 return "";
1593 return "";
1567 }
1594 }
1568
1595
1569 return getReturnTypeOfWrappedMethodHelper(variableObject, methodName, name);
1596 return getReturnTypeOfWrappedMethodHelper(variableObject, methodName, name);
1570 }
1597 }
1571
1598
1572 QString PythonQt::getReturnTypeOfWrappedMethod(const QString& typeName, const QString& methodName)
1599 QString PythonQt::getReturnTypeOfWrappedMethod(const QString& typeName, const QString& methodName)
1573 {
1600 {
1574 PythonQtObjectPtr typeObject = getObjectByType(typeName);
1601 PythonQtObjectPtr typeObject = getObjectByType(typeName);
1575 if (typeObject.isNull()) {
1602 if (typeObject.isNull()) {
1576 return "";
1603 return "";
1577 }
1604 }
1578 return getReturnTypeOfWrappedMethodHelper(typeObject, methodName, typeName + "." + methodName);
1605 return getReturnTypeOfWrappedMethodHelper(typeObject, methodName, typeName + "." + methodName);
1579 }
1606 }
1580
1607
1581 QString PythonQt::getReturnTypeOfWrappedMethodHelper(const PythonQtObjectPtr& variableObject, const QString& methodName, const QString& context)
1608 QString PythonQt::getReturnTypeOfWrappedMethodHelper(const PythonQtObjectPtr& variableObject, const QString& methodName, const QString& context)
1582 {
1609 {
1583 PythonQtObjectPtr methodObject;
1610 PythonQtObjectPtr methodObject;
1584 if (PyDict_Check(variableObject)) {
1611 if (PyDict_Check(variableObject)) {
1585 methodObject = PyDict_GetItemString(variableObject, methodName.toLatin1().constData());
1612 methodObject = PyDict_GetItemString(variableObject, methodName.toLatin1().constData());
1586 } else {
1613 } else {
1587 methodObject.setNewRef(PyObject_GetAttrString(variableObject, methodName.toLatin1().constData()));
1614 methodObject.setNewRef(PyObject_GetAttrString(variableObject, methodName.toLatin1().constData()));
1588 }
1615 }
1589 if (methodObject.isNull()) {
1616 if (methodObject.isNull()) {
1590 return "";
1617 return "";
1591 }
1618 }
1592
1619
1593 QString type;
1620 QString type;
1594
1621
1595 #ifdef PY3K
1622 #ifdef PY3K
1596 if (PyType_Check(methodObject)) {
1623 if (PyType_Check(methodObject)) {
1597 #else
1624 #else
1598 if (methodObject->ob_type == &PyClass_Type || methodObject->ob_type == &PyType_Type) {
1625 if (methodObject->ob_type == &PyClass_Type || methodObject->ob_type == &PyType_Type) {
1599 #endif
1626 #endif
1600 // the methodObject is not a method, but the name of a type/class. This means
1627 // the methodObject is not a method, but the name of a type/class. This means
1601 // a constructor is called. Return the context.
1628 // a constructor is called. Return the context.
1602 type = context;
1629 type = context;
1603 } else if (methodObject->ob_type == &PythonQtSlotFunction_Type) {
1630 } else if (methodObject->ob_type == &PythonQtSlotFunction_Type) {
1604 QString className;
1631 QString className;
1605
1632
1606 if (PyObject_TypeCheck(variableObject, &PythonQtInstanceWrapper_Type)) {
1633 if (PyObject_TypeCheck(variableObject, &PythonQtInstanceWrapper_Type)) {
1607 // the type name of wrapped instance is the class name
1634 // the type name of wrapped instance is the class name
1608 className = variableObject->ob_type->tp_name;
1635 className = variableObject->ob_type->tp_name;
1609 } else {
1636 } else {
1610 PyObject* classNameObject = PyObject_GetAttrString(variableObject, "__name__");
1637 PyObject* classNameObject = PyObject_GetAttrString(variableObject, "__name__");
1611 if (classNameObject) {
1638 if (classNameObject) {
1612 #ifdef PY3K
1639 #ifdef PY3K
1613 Q_ASSERT(PyUnicode_Check(classNameObject));
1640 Q_ASSERT(PyUnicode_Check(classNameObject));
1614 className = PyUnicode_AsUTF8(classNameObject);
1641 className = PyUnicode_AsUTF8(classNameObject);
1615 #else
1642 #else
1616 Q_ASSERT(PyString_Check(classNameObject));
1643 Q_ASSERT(PyString_Check(classNameObject));
1617 className = PyString_AsString(classNameObject);
1644 className = PyString_AsString(classNameObject);
1618 #endif
1645 #endif
1619 Py_DECREF(classNameObject);
1646 Py_DECREF(classNameObject);
1620 }
1647 }
1621 }
1648 }
1622
1649
1623 if (!className.isEmpty()) {
1650 if (!className.isEmpty()) {
1624 PythonQtClassInfo* info = _p->_knownClassInfos.value(className.toLatin1().constData());
1651 PythonQtClassInfo* info = _p->_knownClassInfos.value(className.toLatin1().constData());
1625 if (info) {
1652 if (info) {
1626 PythonQtSlotInfo* slotInfo = info->member(methodName.toLatin1().constData())._slot;
1653 PythonQtSlotInfo* slotInfo = info->member(methodName.toLatin1().constData())._slot;
1627 if (slotInfo) {
1654 if (slotInfo) {
1628 if (slotInfo->metaMethod()) {
1655 if (slotInfo->metaMethod()) {
1629 type = slotInfo->metaMethod()->typeName();
1656 type = slotInfo->metaMethod()->typeName();
1630 if (!type.isEmpty()) {
1657 if (!type.isEmpty()) {
1631 QChar c = type.at(type.length()-1);
1658 QChar c = type.at(type.length()-1);
1632 while (c == '*' || c == '&') {
1659 while (c == '*' || c == '&') {
1633 type.truncate(type.length()-1);
1660 type.truncate(type.length()-1);
1634 if (!type.isEmpty()) {
1661 if (!type.isEmpty()) {
1635 c = type.at(type.length()-1);
1662 c = type.at(type.length()-1);
1636 } else {
1663 } else {
1637 break;
1664 break;
1638 }
1665 }
1639 }
1666 }
1640 // split away template arguments
1667 // split away template arguments
1641 type = type.split("<").first();
1668 type = type.split("<").first();
1642 // split away const
1669 // split away const
1643 type = type.split(" ").last().trimmed();
1670 type = type.split(" ").last().trimmed();
1644
1671
1645 // if the type is a known class info, then create the full type name, i.e. include the
1672 // if the type is a known class info, then create the full type name, i.e. include the
1646 // module name. For example, the slot may return a QDate, then this looks up the
1673 // module name. For example, the slot may return a QDate, then this looks up the
1647 // name _PythonQt.QtCore.QDate.
1674 // name _PythonQt.QtCore.QDate.
1648 PythonQtClassInfo* typeInfo = _p->_knownClassInfos.value(type.toLatin1().constData());
1675 PythonQtClassInfo* typeInfo = _p->_knownClassInfos.value(type.toLatin1().constData());
1649 if (typeInfo && typeInfo->pythonQtClassWrapper()) {
1676 if (typeInfo && typeInfo->pythonQtClassWrapper()) {
1650 PyObject* s = PyObject_GetAttrString(typeInfo->pythonQtClassWrapper(), "__module__");
1677 PyObject* s = PyObject_GetAttrString(typeInfo->pythonQtClassWrapper(), "__module__");
1651 #ifdef PY3K
1678 #ifdef PY3K
1652 Q_ASSERT(PyUnicode_Check(s));
1679 Q_ASSERT(PyUnicode_Check(s));
1653 type = QString(PyUnicode_AsUTF8(s));
1680 type = QString(PyUnicode_AsUTF8(s));
1654 #else
1681 #else
1655 Q_ASSERT(PyString_Check(s));
1682 Q_ASSERT(PyString_Check(s));
1656 type = QString(PyString_AsString(s)) + "." + type;
1683 type = QString(PyString_AsString(s)) + "." + type;
1657 #endif
1684 #endif
1658 Py_DECREF(s);
1685 Py_DECREF(s);
1659 s = PyObject_GetAttrString(typeInfo->pythonQtClassWrapper(), "__name__");
1686 s = PyObject_GetAttrString(typeInfo->pythonQtClassWrapper(), "__name__");
1660 #ifdef PY3K
1687 #ifdef PY3K
1661 Q_ASSERT(PyUnicode_Check(s));
1688 Q_ASSERT(PyUnicode_Check(s));
1662 #else
1689 #else
1663 Q_ASSERT(PyString_Check(s));
1690 Q_ASSERT(PyString_Check(s));
1664 #endif
1691 #endif
1665 Py_DECREF(s);
1692 Py_DECREF(s);
1666 }
1693 }
1667 }
1694 }
1668 }
1695 }
1669 }
1696 }
1670 }
1697 }
1671 }
1698 }
1672 }
1699 }
1673 return type;
1700 return type;
1674 }
1701 }
1675
1702
1676 void PythonQt::registerCPPClass(const char* typeName, const char* parentTypeName, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell)
1703 void PythonQt::registerCPPClass(const char* typeName, const char* parentTypeName, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell)
1677 {
1704 {
1678 _p->registerCPPClass(typeName, parentTypeName, package, wrapperCreator, shell);
1705 _p->registerCPPClass(typeName, parentTypeName, package, wrapperCreator, shell);
1679 }
1706 }
1680
1707
1681
1708
1682 PythonQtClassInfo* PythonQtPrivate::lookupClassInfoAndCreateIfNotPresent(const char* typeName)
1709 PythonQtClassInfo* PythonQtPrivate::lookupClassInfoAndCreateIfNotPresent(const char* typeName)
1683 {
1710 {
1684 PythonQtClassInfo* info = _knownClassInfos.value(typeName);
1711 PythonQtClassInfo* info = _knownClassInfos.value(typeName);
1685 if (!info) {
1712 if (!info) {
1686 info = new PythonQtClassInfo();
1713 info = new PythonQtClassInfo();
1687 info->setupCPPObject(typeName);
1714 info->setupCPPObject(typeName);
1688 _knownClassInfos.insert(typeName, info);
1715 _knownClassInfos.insert(typeName, info);
1689 }
1716 }
1690 return info;
1717 return info;
1691 }
1718 }
1692
1719
1693 void PythonQt::addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb)
1720 void PythonQt::addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb)
1694 {
1721 {
1695 _p->addPolymorphicHandler(typeName, cb);
1722 _p->addPolymorphicHandler(typeName, cb);
1696 }
1723 }
1697
1724
1698 void PythonQtPrivate::addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb)
1725 void PythonQtPrivate::addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb)
1699 {
1726 {
1700 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(typeName);
1727 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(typeName);
1701 info->addPolymorphicHandler(cb);
1728 info->addPolymorphicHandler(cb);
1702 }
1729 }
1703
1730
1704 bool PythonQt::addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset)
1731 bool PythonQt::addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset)
1705 {
1732 {
1706 return _p->addParentClass(typeName, parentTypeName, upcastingOffset);
1733 return _p->addParentClass(typeName, parentTypeName, upcastingOffset);
1707 }
1734 }
1708
1735
1709 bool PythonQtPrivate::addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset)
1736 bool PythonQtPrivate::addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset)
1710 {
1737 {
1711 PythonQtClassInfo* info = _knownClassInfos.value(typeName);
1738 PythonQtClassInfo* info = _knownClassInfos.value(typeName);
1712 if (info) {
1739 if (info) {
1713 PythonQtClassInfo* parentInfo = lookupClassInfoAndCreateIfNotPresent(parentTypeName);
1740 PythonQtClassInfo* parentInfo = lookupClassInfoAndCreateIfNotPresent(parentTypeName);
1714 info->addParentClass(PythonQtClassInfo::ParentClassInfo(parentInfo, upcastingOffset));
1741 info->addParentClass(PythonQtClassInfo::ParentClassInfo(parentInfo, upcastingOffset));
1715 return true;
1742 return true;
1716 } else {
1743 } else {
1717 return false;
1744 return false;
1718 }
1745 }
1719 }
1746 }
1720
1747
1721 void PythonQtPrivate::registerCPPClass(const char* typeName, const char* parentTypeName, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell, PyObject* module, int typeSlots)
1748 void PythonQtPrivate::registerCPPClass(const char* typeName, const char* parentTypeName, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell, PyObject* module, int typeSlots)
1722 {
1749 {
1723 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(typeName);
1750 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(typeName);
1724 if (!info->pythonQtClassWrapper()) {
1751 if (!info->pythonQtClassWrapper()) {
1725 info->setTypeSlots(typeSlots);
1752 info->setTypeSlots(typeSlots);
1726 info->setupCPPObject(typeName);
1753 info->setupCPPObject(typeName);
1727 createPythonQtClassWrapper(info, package, module);
1754 createPythonQtClassWrapper(info, package, module);
1728 }
1755 }
1729 if (parentTypeName && strcmp(parentTypeName,"")!=0) {
1756 if (parentTypeName && strcmp(parentTypeName,"")!=0) {
1730 addParentClass(typeName, parentTypeName, 0);
1757 addParentClass(typeName, parentTypeName, 0);
1731 }
1758 }
1732 if (wrapperCreator) {
1759 if (wrapperCreator) {
1733 info->setDecoratorProvider(wrapperCreator);
1760 info->setDecoratorProvider(wrapperCreator);
1734 }
1761 }
1735 if (shell) {
1762 if (shell) {
1736 info->setShellSetInstanceWrapperCB(shell);
1763 info->setShellSetInstanceWrapperCB(shell);
1737 }
1764 }
1738 }
1765 }
1739
1766
1740 PyObject* PythonQtPrivate::packageByName(const char* name)
1767 PyObject* PythonQtPrivate::packageByName(const char* name)
1741 {
1768 {
1742 if (name==NULL || name[0]==0) {
1769 if (name==NULL || name[0]==0) {
1743 name = "private";
1770 name = "private";
1744 }
1771 }
1745 PyObject* v = _packages.value(name);
1772 PyObject* v = _packages.value(name);
1746 if (!v) {
1773 if (!v) {
1747 v = PyImport_AddModule((_pythonQtModuleName + "." + name).constData());
1774 v = PyImport_AddModule((_pythonQtModuleName + "." + name).constData());
1748 _packages.insert(name, v);
1775 _packages.insert(name, v);
1749 // AddObject steals the reference, so increment it!
1776 // AddObject steals the reference, so increment it!
1750 Py_INCREF(v);
1777 Py_INCREF(v);
1751 PyModule_AddObject(_pythonQtModule, name, v);
1778 PyModule_AddObject(_pythonQtModule, name, v);
1752 }
1779 }
1753 return v;
1780 return v;
1754 }
1781 }
1755
1782
1756 void PythonQtPrivate::handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result)
1783 void PythonQtPrivate::handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result)
1757 {
1784 {
1758 QString error = "Return value '" + PythonQtConv::PyObjGetString(result) + "' can not be converted to expected C++ type '" + methodInfo->parameters().at(0).name + "' as return value of virtual method " + signature;
1785 QString error = "Return value '" + PythonQtConv::PyObjGetString(result) + "' can not be converted to expected C++ type '" + methodInfo->parameters().at(0).name + "' as return value of virtual method " + signature;
1759 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
1786 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
1760 PythonQt::self()->handleError();
1787 PythonQt::self()->handleError();
1761 }
1788 }
1762
1789
1763 PyObject* PythonQt::helpCalled(PythonQtClassInfo* info)
1790 PyObject* PythonQt::helpCalled(PythonQtClassInfo* info)
1764 {
1791 {
1765 if (_p->_initFlags & ExternalHelp) {
1792 if (_p->_initFlags & ExternalHelp) {
1766 Q_EMIT pythonHelpRequest(QByteArray(info->className()));
1793 Q_EMIT pythonHelpRequest(QByteArray(info->className()));
1767 return Py_BuildValue("");
1794 return Py_BuildValue("");
1768 } else {
1795 } else {
1769 #ifdef PY3K
1796 #ifdef PY3K
1770 return PyUnicode_FromString(info->help().toLatin1().data());
1797 return PyUnicode_FromString(info->help().toLatin1().data());
1771 #else
1798 #else
1772 return PyString_FromString(info->help().toLatin1().data());
1799 return PyString_FromString(info->help().toLatin1().data());
1773 #endif
1800 #endif
1774 }
1801 }
1775 }
1802 }
1776
1803
1777 void PythonQt::clearNotFoundCachedMembers()
1804 void PythonQt::clearNotFoundCachedMembers()
1778 {
1805 {
1779 Q_FOREACH(PythonQtClassInfo* info, _p->_knownClassInfos) {
1806 Q_FOREACH(PythonQtClassInfo* info, _p->_knownClassInfos) {
1780 info->clearNotFoundCachedMembers();
1807 info->clearNotFoundCachedMembers();
1781 }
1808 }
1782 }
1809 }
1783
1810
1784 void PythonQt::removeWrapperFactory( PythonQtCppWrapperFactory* factory )
1811 void PythonQt::removeWrapperFactory( PythonQtCppWrapperFactory* factory )
1785 {
1812 {
1786 _p->_cppWrapperFactories.removeAll(factory);
1813 _p->_cppWrapperFactories.removeAll(factory);
1787 }
1814 }
1788
1815
1789 void PythonQt::removeWrapperFactory( PythonQtForeignWrapperFactory* factory )
1816 void PythonQt::removeWrapperFactory( PythonQtForeignWrapperFactory* factory )
1790 {
1817 {
1791 _p->_foreignWrapperFactories.removeAll(factory);
1818 _p->_foreignWrapperFactories.removeAll(factory);
1792 }
1819 }
1793
1820
1794 void PythonQtPrivate::removeWrapperPointer(void* obj)
1821 void PythonQtPrivate::removeWrapperPointer(void* obj)
1795 {
1822 {
1796 _wrappedObjects.remove(obj);
1823 _wrappedObjects.remove(obj);
1797 }
1824 }
1798
1825
1799 void PythonQtPrivate::addWrapperPointer(void* obj, PythonQtInstanceWrapper* wrapper)
1826 void PythonQtPrivate::addWrapperPointer(void* obj, PythonQtInstanceWrapper* wrapper)
1800 {
1827 {
1801 _wrappedObjects.insert(obj, wrapper);
1828 _wrappedObjects.insert(obj, wrapper);
1802 }
1829 }
1803
1830
1804 PythonQtInstanceWrapper* PythonQtPrivate::findWrapperAndRemoveUnused(void* obj)
1831 PythonQtInstanceWrapper* PythonQtPrivate::findWrapperAndRemoveUnused(void* obj)
1805 {
1832 {
1806 PythonQtInstanceWrapper* wrap = _wrappedObjects.value(obj);
1833 PythonQtInstanceWrapper* wrap = _wrappedObjects.value(obj);
1807 if (wrap && !wrap->_wrappedPtr && wrap->_obj == NULL) {
1834 if (wrap && !wrap->_wrappedPtr && wrap->_obj == NULL) {
1808 // this is a wrapper whose QObject was already removed due to destruction
1835 // this is a wrapper whose QObject was already removed due to destruction
1809 // so the obj pointer has to be a new QObject with the same address...
1836 // so the obj pointer has to be a new QObject with the same address...
1810 // we remove the old one and set the copy to NULL
1837 // we remove the old one and set the copy to NULL
1811 wrap->_objPointerCopy = NULL;
1838 wrap->_objPointerCopy = NULL;
1812 removeWrapperPointer(obj);
1839 removeWrapperPointer(obj);
1813 wrap = NULL;
1840 wrap = NULL;
1814 }
1841 }
1815 return wrap;
1842 return wrap;
1816 }
1843 }
1817
1844
1818 PythonQtObjectPtr PythonQtPrivate::createModule(const QString& name, PyObject* pycode)
1845 PythonQtObjectPtr PythonQtPrivate::createModule(const QString& name, PyObject* pycode)
1819 {
1846 {
1820 PythonQtObjectPtr result;
1847 PythonQtObjectPtr result;
1821 PythonQt::self()->clearError();
1848 PythonQt::self()->clearError();
1822 if (pycode) {
1849 if (pycode) {
1823 result.setNewRef(PyImport_ExecCodeModule((char*)name.toLatin1().data(), pycode));
1850 result.setNewRef(PyImport_ExecCodeModule((char*)name.toLatin1().data(), pycode));
1824 } else {
1851 } else {
1825 PythonQt::self()->handleError();
1852 PythonQt::self()->handleError();
1826 }
1853 }
1827 return result;
1854 return result;
1828 }
1855 }
1829
1856
1830 void* PythonQtPrivate::unwrapForeignWrapper( const QByteArray& classname, PyObject* obj )
1857 void* PythonQtPrivate::unwrapForeignWrapper( const QByteArray& classname, PyObject* obj )
1831 {
1858 {
1832 void* foreignObject = NULL;
1859 void* foreignObject = NULL;
1833 for (int i=0; i<_foreignWrapperFactories.size(); i++) {
1860 for (int i=0; i<_foreignWrapperFactories.size(); i++) {
1834 foreignObject = _foreignWrapperFactories.at(i)->unwrap(classname, obj);
1861 foreignObject = _foreignWrapperFactories.at(i)->unwrap(classname, obj);
1835 if (foreignObject) {
1862 if (foreignObject) {
1836 return foreignObject;
1863 return foreignObject;
1837 }
1864 }
1838 }
1865 }
1839 return NULL;
1866 return NULL;
1840 }
1867 }
1841
1868
1842 bool PythonQtPrivate::isMethodDescriptor(PyObject* object) const
1869 bool PythonQtPrivate::isMethodDescriptor(PyObject* object) const
1843 {
1870 {
1844 // This implementation is the same as in inspect.ismethoddescriptor(), inspect.py.
1871 // This implementation is the same as in inspect.ismethoddescriptor(), inspect.py.
1845 if (PyObject_HasAttrString(object, "__get__") &&
1872 if (PyObject_HasAttrString(object, "__get__") &&
1846 !PyObject_HasAttrString(object, "__set__") &&
1873 !PyObject_HasAttrString(object, "__set__") &&
1847 !PyMethod_Check(object) &&
1874 !PyMethod_Check(object) &&
1848 !PyFunction_Check(object)
1875 !PyFunction_Check(object)
1849 #ifndef PY3K
1876 #ifndef PY3K
1850 && !PyClass_Check(object)
1877 && !PyClass_Check(object)
1851 #endif
1878 #endif
1852 ) {
1879 ) {
1853 return true;
1880 return true;
1854 }
1881 }
1855 return false;
1882 return false;
1856 }
1883 }
1857
1884
1858 QString PythonQtPrivate::getSignature(PyObject* object)
1885 QString PythonQtPrivate::getSignature(PyObject* object)
1859 {
1886 {
1860 QString signature;
1887 QString signature;
1861
1888
1862 if (object) {
1889 if (object) {
1863 PyMethodObject* method = NULL;
1890 PyMethodObject* method = NULL;
1864 PyFunctionObject* func = NULL;
1891 PyFunctionObject* func = NULL;
1865
1892
1866 bool decrefMethod = false;
1893 bool decrefMethod = false;
1867
1894
1868 #ifdef PY3K
1895 #ifdef PY3K
1869 if (PyType_Check(object)) {
1896 if (PyType_Check(object)) {
1870 #else
1897 #else
1871 if (object->ob_type == &PyClass_Type || object->ob_type == &PyType_Type) {
1898 if (object->ob_type == &PyClass_Type || object->ob_type == &PyType_Type) {
1872 #endif
1899 #endif
1873 method = (PyMethodObject*)PyObject_GetAttrString(object, "__init__");
1900 method = (PyMethodObject*)PyObject_GetAttrString(object, "__init__");
1874 decrefMethod = true;
1901 decrefMethod = true;
1875 } else if (object->ob_type == &PyFunction_Type) {
1902 } else if (object->ob_type == &PyFunction_Type) {
1876 func = (PyFunctionObject*)object;
1903 func = (PyFunctionObject*)object;
1877 } else if (object->ob_type == &PyMethod_Type) {
1904 } else if (object->ob_type == &PyMethod_Type) {
1878 method = (PyMethodObject*)object;
1905 method = (PyMethodObject*)object;
1879 }
1906 }
1880 if (method) {
1907 if (method) {
1881 if (PyFunction_Check(method->im_func)) {
1908 if (PyFunction_Check(method->im_func)) {
1882 func = (PyFunctionObject*)method->im_func;
1909 func = (PyFunctionObject*)method->im_func;
1883 } else if (isMethodDescriptor((PyObject*)method)) {
1910 } else if (isMethodDescriptor((PyObject*)method)) {
1884 QString docstr;
1911 QString docstr;
1885 PyObject* doc = PyObject_GetAttrString(object, "__doc__");
1912 PyObject* doc = PyObject_GetAttrString(object, "__doc__");
1886 if (doc) {
1913 if (doc) {
1887 #ifdef PY3K
1914 #ifdef PY3K
1888 docstr = PyUnicode_AsUTF8(doc);
1915 docstr = PyUnicode_AsUTF8(doc);
1889 #else
1916 #else
1890 docstr = PyString_AsString(doc);
1917 docstr = PyString_AsString(doc);
1891 #endif
1918 #endif
1892 Py_DECREF(doc);
1919 Py_DECREF(doc);
1893 }
1920 }
1894
1921
1895 PyObject* s = PyObject_GetAttrString(object, "__name__");
1922 PyObject* s = PyObject_GetAttrString(object, "__name__");
1896 if (s) {
1923 if (s) {
1897 #ifdef PY3K
1924 #ifdef PY3K
1898 Q_ASSERT(PyUnicode_Check(s));
1925 Q_ASSERT(PyUnicode_Check(s));
1899 signature = PyUnicode_AsUTF8(s);
1926 signature = PyUnicode_AsUTF8(s);
1900 #else
1927 #else
1901 Q_ASSERT(PyString_Check(s));
1928 Q_ASSERT(PyString_Check(s));
1902 signature = PyString_AsString(s);
1929 signature = PyString_AsString(s);
1903 #endif
1930 #endif
1904 if (docstr.startsWith(signature + "(")) {
1931 if (docstr.startsWith(signature + "(")) {
1905 signature = docstr;
1932 signature = docstr;
1906 } else {
1933 } else {
1907 signature += "(...)";
1934 signature += "(...)";
1908 if (!docstr.isEmpty()) {
1935 if (!docstr.isEmpty()) {
1909 signature += "\n\n" + docstr;
1936 signature += "\n\n" + docstr;
1910 }
1937 }
1911 }
1938 }
1912 Py_DECREF(s);
1939 Py_DECREF(s);
1913 }
1940 }
1914 }
1941 }
1915 }
1942 }
1916
1943
1917 if (func) {
1944 if (func) {
1918 QString funcName;
1945 QString funcName;
1919 PyObject* s = PyObject_GetAttrString((PyObject*)func, "__name__");
1946 PyObject* s = PyObject_GetAttrString((PyObject*)func, "__name__");
1920 if (s) {
1947 if (s) {
1921 #ifdef PY3K
1948 #ifdef PY3K
1922 Q_ASSERT(PyUnicode_Check(s));
1949 Q_ASSERT(PyUnicode_Check(s));
1923 funcName = PyUnicode_AsUTF8(s);
1950 funcName = PyUnicode_AsUTF8(s);
1924 #else
1951 #else
1925 Q_ASSERT(PyString_Check(s));
1952 Q_ASSERT(PyString_Check(s));
1926 funcName = PyString_AsString(s);
1953 funcName = PyString_AsString(s);
1927 #endif
1954 #endif
1928 Py_DECREF(s);
1955 Py_DECREF(s);
1929 }
1956 }
1930 if (method && funcName == "__init__") {
1957 if (method && funcName == "__init__") {
1931 PyObject* s = PyObject_GetAttrString(object, "__name__");
1958 PyObject* s = PyObject_GetAttrString(object, "__name__");
1932 if (s) {
1959 if (s) {
1933 #ifdef PY3K
1960 #ifdef PY3K
1934 Q_ASSERT(PyUnicode_Check(s));
1961 Q_ASSERT(PyUnicode_Check(s));
1935 funcName = PyUnicode_AsUTF8(s);
1962 funcName = PyUnicode_AsUTF8(s);
1936 #else
1963 #else
1937 Q_ASSERT(PyString_Check(s));
1964 Q_ASSERT(PyString_Check(s));
1938 funcName = PyString_AsString(s);
1965 funcName = PyString_AsString(s);
1939 #endif
1966 #endif
1940 Py_DECREF(s);
1967 Py_DECREF(s);
1941 }
1968 }
1942 }
1969 }
1943
1970
1944 QStringList arguments;
1971 QStringList arguments;
1945 QStringList defaults;
1972 QStringList defaults;
1946 QString varargs;
1973 QString varargs;
1947 QString varkeywords;
1974 QString varkeywords;
1948 // NOTE: This implementation is based on function getargs() in inspect.py.
1975 // NOTE: This implementation is based on function getargs() in inspect.py.
1949 // inspect.getargs() can handle anonymous (tuple) arguments, while this code does not.
1976 // inspect.getargs() can handle anonymous (tuple) arguments, while this code does not.
1950 // It can be implemented, but it may be rarely needed and not necessary.
1977 // It can be implemented, but it may be rarely needed and not necessary.
1951 PyCodeObject* code = (PyCodeObject*)func->func_code;
1978 PyCodeObject* code = (PyCodeObject*)func->func_code;
1952 if (code->co_varnames) {
1979 if (code->co_varnames) {
1953 int nargs = code->co_argcount;
1980 int nargs = code->co_argcount;
1954 Q_ASSERT(PyTuple_Check(code->co_varnames));
1981 Q_ASSERT(PyTuple_Check(code->co_varnames));
1955 for (int i=0; i<nargs; i++) {
1982 for (int i=0; i<nargs; i++) {
1956 PyObject* name = PyTuple_GetItem(code->co_varnames, i);
1983 PyObject* name = PyTuple_GetItem(code->co_varnames, i);
1957 #ifdef PY3K
1984 #ifdef PY3K
1958 Q_ASSERT(PyUnicode_Check(name));
1985 Q_ASSERT(PyUnicode_Check(name));
1959 arguments << PyUnicode_AsUTF8(name);
1986 arguments << PyUnicode_AsUTF8(name);
1960 #else
1987 #else
1961 Q_ASSERT(PyString_Check(name));
1988 Q_ASSERT(PyString_Check(name));
1962 arguments << PyString_AsString(name);
1989 arguments << PyString_AsString(name);
1963 #endif
1990 #endif
1964 }
1991 }
1965 if (code->co_flags & CO_VARARGS) {
1992 if (code->co_flags & CO_VARARGS) {
1966 PyObject* s = PyTuple_GetItem(code->co_varnames, nargs);
1993 PyObject* s = PyTuple_GetItem(code->co_varnames, nargs);
1967 #ifdef PY3K
1994 #ifdef PY3K
1968 Q_ASSERT(PyUnicode_Check(s));
1995 Q_ASSERT(PyUnicode_Check(s));
1969 varargs = PyUnicode_AsUTF8(s);
1996 varargs = PyUnicode_AsUTF8(s);
1970 #else
1997 #else
1971 Q_ASSERT(PyString_Check(s));
1998 Q_ASSERT(PyString_Check(s));
1972 varargs = PyString_AsString(s);
1999 varargs = PyString_AsString(s);
1973 #endif
2000 #endif
1974 nargs += 1;
2001 nargs += 1;
1975 }
2002 }
1976 if (code->co_flags & CO_VARKEYWORDS) {
2003 if (code->co_flags & CO_VARKEYWORDS) {
1977 PyObject* s = PyTuple_GetItem(code->co_varnames, nargs);
2004 PyObject* s = PyTuple_GetItem(code->co_varnames, nargs);
1978 #ifdef PY3K
2005 #ifdef PY3K
1979 Q_ASSERT(PyUnicode_Check(s));
2006 Q_ASSERT(PyUnicode_Check(s));
1980 varkeywords = PyUnicode_AsUTF8(s);
2007 varkeywords = PyUnicode_AsUTF8(s);
1981 #else
2008 #else
1982 Q_ASSERT(PyString_Check(s));
2009 Q_ASSERT(PyString_Check(s));
1983 varkeywords = PyString_AsString(s);
2010 varkeywords = PyString_AsString(s);
1984 #endif
2011 #endif
1985 }
2012 }
1986 }
2013 }
1987
2014
1988 PyObject* defaultsTuple = func->func_defaults;
2015 PyObject* defaultsTuple = func->func_defaults;
1989 if (defaultsTuple) {
2016 if (defaultsTuple) {
1990 Q_ASSERT(PyTuple_Check(defaultsTuple));
2017 Q_ASSERT(PyTuple_Check(defaultsTuple));
1991 for (Py_ssize_t i=0; i<PyTuple_Size(defaultsTuple); i++) {
2018 for (Py_ssize_t i=0; i<PyTuple_Size(defaultsTuple); i++) {
1992 PyObject* d = PyTuple_GetItem(defaultsTuple, i);
2019 PyObject* d = PyTuple_GetItem(defaultsTuple, i);
1993 PyObject* s = PyObject_Repr(d);
2020 PyObject* s = PyObject_Repr(d);
1994 #ifdef PY3K
2021 #ifdef PY3K
1995 Q_ASSERT(PyUnicode_Check(s));
2022 Q_ASSERT(PyUnicode_Check(s));
1996 defaults << PyUnicode_AsUTF8(s);
2023 defaults << PyUnicode_AsUTF8(s);
1997 #else
2024 #else
1998 Q_ASSERT(PyString_Check(s));
2025 Q_ASSERT(PyString_Check(s));
1999 defaults << PyString_AsString(s);
2026 defaults << PyString_AsString(s);
2000 #endif
2027 #endif
2001 Py_DECREF(s);
2028 Py_DECREF(s);
2002 }
2029 }
2003 }
2030 }
2004
2031
2005 int firstdefault = arguments.size() - defaults.size();
2032 int firstdefault = arguments.size() - defaults.size();
2006 for (int i=0; i<arguments.size(); i++) {
2033 for (int i=0; i<arguments.size(); i++) {
2007 if (!signature.isEmpty()) { signature += ", "; }
2034 if (!signature.isEmpty()) { signature += ", "; }
2008 if (!method || i>0 || arguments[i] != "self") {
2035 if (!method || i>0 || arguments[i] != "self") {
2009 signature += arguments[i];
2036 signature += arguments[i];
2010 if (i >= firstdefault) {
2037 if (i >= firstdefault) {
2011 signature += "=" + defaults[i-firstdefault];
2038 signature += "=" + defaults[i-firstdefault];
2012 }
2039 }
2013 }
2040 }
2014 }
2041 }
2015 if (!varargs.isEmpty()) {
2042 if (!varargs.isEmpty()) {
2016 if (!signature.isEmpty()) { signature += ", "; }
2043 if (!signature.isEmpty()) { signature += ", "; }
2017 signature += "*" + varargs;
2044 signature += "*" + varargs;
2018 }
2045 }
2019 if (!varkeywords.isEmpty()) {
2046 if (!varkeywords.isEmpty()) {
2020 if (!signature.isEmpty()) { signature += ", "; }
2047 if (!signature.isEmpty()) { signature += ", "; }
2021 signature += "**" + varkeywords;
2048 signature += "**" + varkeywords;
2022 }
2049 }
2023 signature = funcName + "(" + signature + ")";
2050 signature = funcName + "(" + signature + ")";
2024 }
2051 }
2025
2052
2026 if (method && decrefMethod) {
2053 if (method && decrefMethod) {
2027 Py_DECREF(method);
2054 Py_DECREF(method);
2028 }
2055 }
2029 }
2056 }
2030
2057
2031 return signature;
2058 return signature;
2032 }
2059 }
2033
2060
2034 void PythonQtPrivate::shellClassDeleted( void* shellClass )
2061 void PythonQtPrivate::shellClassDeleted( void* shellClass )
2035 {
2062 {
2036 PythonQtInstanceWrapper* wrap = _wrappedObjects.value(shellClass);
2063 PythonQtInstanceWrapper* wrap = _wrappedObjects.value(shellClass);
2037 if (wrap && wrap->_wrappedPtr) {
2064 if (wrap && wrap->_wrappedPtr) {
2038 // this is a pure C++ wrapper and the shell has gone, so we need
2065 // this is a pure C++ wrapper and the shell has gone, so we need
2039 // to set the _wrappedPtr to NULL on the wrapper
2066 // to set the _wrappedPtr to NULL on the wrapper
2040 wrap->_wrappedPtr = NULL;
2067 wrap->_wrappedPtr = NULL;
2041 // and then we remove the wrapper, since the wrapped class is gone
2068 // and then we remove the wrapper, since the wrapped class is gone
2042 _wrappedObjects.remove(shellClass);
2069 _wrappedObjects.remove(shellClass);
2043 }
2070 }
2044 // if the wrapper is a QObject, we do not handle this here,
2071 // if the wrapper is a QObject, we do not handle this here,
2045 // it will be handled by the QPointer<> to the QObject, which becomes NULL
2072 // it will be handled by the QPointer<> to the QObject, which becomes NULL
2046 // via the QObject destructor.
2073 // via the QObject destructor.
2047 }
2074 }
2048
2075
2049 PyObject* PythonQtPrivate::wrapMemoryAsBuffer( const void* data, Py_ssize_t size )
2076 PyObject* PythonQtPrivate::wrapMemoryAsBuffer( const void* data, Py_ssize_t size )
2050 {
2077 {
2051 // P3K port needed later on! -- not anymore :D
2078 // P3K port needed later on! -- not anymore :D
2052 #ifdef PY3K
2079 #ifdef PY3K
2053 return PyMemoryView_FromMemory((char*)data, size, PyBUF_READ);
2080 return PyMemoryView_FromMemory((char*)data, size, PyBUF_READ);
2054 #else
2081 #else
2055 return PyBuffer_FromMemory((char*)data, size);
2082 return PyBuffer_FromMemory((char*)data, size);
2056 #endif
2083 #endif
2057 }
2084 }
2058
2085
2059 PyObject* PythonQtPrivate::wrapMemoryAsBuffer( void* data, Py_ssize_t size )
2086 PyObject* PythonQtPrivate::wrapMemoryAsBuffer( void* data, Py_ssize_t size )
2060 {
2087 {
2061 // P3K port needed later on! -- not anymore :D
2088 // P3K port needed later on! -- not anymore :D
2062 #ifdef PY3K
2089 #ifdef PY3K
2063 return PyMemoryView_FromMemory((char*)data, size, PyBUF_READ | PyBUF_WRITE);
2090 return PyMemoryView_FromMemory((char*)data, size, PyBUF_READ | PyBUF_WRITE);
2064 #else
2091 #else
2065 return PyBuffer_FromReadWriteMemory((char*)data, size);
2092 return PyBuffer_FromReadWriteMemory((char*)data, size);
2066 #endif
2093 #endif
2067 }
2094 }
@@ -1,743 +1,744
1 #ifndef _PYTHONQT_H
1 #ifndef _PYTHONQT_H
2 #define _PYTHONQT_H
2 #define _PYTHONQT_H
3
3
4 /*
4 /*
5 *
5 *
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 *
7 *
8 * This library is free software; you can redistribute it and/or
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
11 * version 2.1 of the License, or (at your option) any later version.
12 *
12 *
13 * This library is distributed in the hope that it will be useful,
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
16 * Lesser General Public License for more details.
17 *
17 *
18 * Further, this software is distributed without any warranty that it is
18 * Further, this software is distributed without any warranty that it is
19 * free of the rightful claim of any third person regarding infringement
19 * free of the rightful claim of any third person regarding infringement
20 * or the like. Any license provided herein, whether implied or
20 * or the like. Any license provided herein, whether implied or
21 * otherwise, applies only to this software file. Patent licenses, if
21 * otherwise, applies only to this software file. Patent licenses, if
22 * any, provided herein do not apply to combinations of this program with
22 * any, provided herein do not apply to combinations of this program with
23 * other software, or any other product whatsoever.
23 * other software, or any other product whatsoever.
24 *
24 *
25 * You should have received a copy of the GNU Lesser General Public
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 *
28 *
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 * 28359 Bremen, Germany or:
30 * 28359 Bremen, Germany or:
31 *
31 *
32 * http://www.mevis.de
32 * http://www.mevis.de
33 *
33 *
34 */
34 */
35
35
36 //----------------------------------------------------------------------------------
36 //----------------------------------------------------------------------------------
37 /*!
37 /*!
38 // \file PythonQt.h
38 // \file PythonQt.h
39 // \author Florian Link
39 // \author Florian Link
40 // \author Last changed by $Author: florian $
40 // \author Last changed by $Author: florian $
41 // \date 2006-05
41 // \date 2006-05
42 */
42 */
43 //----------------------------------------------------------------------------------
43 //----------------------------------------------------------------------------------
44
44
45 #include "PythonQtSystem.h"
45 #include "PythonQtSystem.h"
46 #include "PythonQtInstanceWrapper.h"
46 #include "PythonQtInstanceWrapper.h"
47 #include "PythonQtClassWrapper.h"
47 #include "PythonQtClassWrapper.h"
48 #include "PythonQtSlot.h"
48 #include "PythonQtSlot.h"
49 #include "PythonQtObjectPtr.h"
49 #include "PythonQtObjectPtr.h"
50 #include "PythonQtStdIn.h"
50 #include "PythonQtStdIn.h"
51 #include <QObject>
51 #include <QObject>
52 #include <QVariant>
52 #include <QVariant>
53 #include <QList>
53 #include <QList>
54 #include <QHash>
54 #include <QHash>
55 #include <QByteArray>
55 #include <QByteArray>
56 #include <QStringList>
56 #include <QStringList>
57 #include <QtDebug>
57 #include <QtDebug>
58 #include <iostream>
58 #include <iostream>
59
59
60
60
61 class PythonQtClassInfo;
61 class PythonQtClassInfo;
62 class PythonQtPrivate;
62 class PythonQtPrivate;
63 class PythonQtMethodInfo;
63 class PythonQtMethodInfo;
64 class PythonQtSignalReceiver;
64 class PythonQtSignalReceiver;
65 class PythonQtImportFileInterface;
65 class PythonQtImportFileInterface;
66 class PythonQtCppWrapperFactory;
66 class PythonQtCppWrapperFactory;
67 class PythonQtForeignWrapperFactory;
67 class PythonQtForeignWrapperFactory;
68 class PythonQtQFileImporter;
68 class PythonQtQFileImporter;
69
69
70 typedef void PythonQtQObjectWrappedCB(QObject* object);
70 typedef void PythonQtQObjectWrappedCB(QObject* object);
71 typedef void PythonQtQObjectNoLongerWrappedCB(QObject* object);
71 typedef void PythonQtQObjectNoLongerWrappedCB(QObject* object);
72 typedef void* PythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name);
72 typedef void* PythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name);
73
73
74 typedef void PythonQtShellSetInstanceWrapperCB(void* object, PythonQtInstanceWrapper* wrapper);
74 typedef void PythonQtShellSetInstanceWrapperCB(void* object, PythonQtInstanceWrapper* wrapper);
75
75
76 template<class T> void PythonQtSetInstanceWrapperOnShell(void* object, PythonQtInstanceWrapper* wrapper) {
76 template<class T> void PythonQtSetInstanceWrapperOnShell(void* object, PythonQtInstanceWrapper* wrapper) {
77 (reinterpret_cast<T*>(object))->_wrapper = wrapper;
77 (reinterpret_cast<T*>(object))->_wrapper = wrapper;
78 }
78 }
79
79
80 //! returns the offset that needs to be added to upcast an object of type T1 to T2
80 //! returns the offset that needs to be added to upcast an object of type T1 to T2
81 template<class T1, class T2> int PythonQtUpcastingOffset() {
81 template<class T1, class T2> int PythonQtUpcastingOffset() {
82 return ((reinterpret_cast<char*>(static_cast<T2*>(reinterpret_cast<T1*>(0x100))))
82 return ((reinterpret_cast<char*>(static_cast<T2*>(reinterpret_cast<T1*>(0x100))))
83 - (reinterpret_cast<char*>(reinterpret_cast<T1*>(0x100))));
83 - (reinterpret_cast<char*>(reinterpret_cast<T1*>(0x100))));
84 }
84 }
85
85
86 //! callback to create a QObject lazily
86 //! callback to create a QObject lazily
87 typedef QObject* PythonQtQObjectCreatorFunctionCB();
87 typedef QObject* PythonQtQObjectCreatorFunctionCB();
88
88
89 //! helper template to create a derived QObject class
89 //! helper template to create a derived QObject class
90 template<class T> QObject* PythonQtCreateObject() { return new T(); };
90 template<class T> QObject* PythonQtCreateObject() { return new T(); };
91
91
92 //! The main interface to the Python Qt binding, realized as a singleton
92 //! The main interface to the Python Qt binding, realized as a singleton
93 /*!
93 /*!
94 Use PythonQt::init() to initialize the singleton and PythonQt::self() to access it.
94 Use PythonQt::init() to initialize the singleton and PythonQt::self() to access it.
95 While there can be only one PythonQt instance, you can have any number of Python context to do scripting in.
95 While there can be only one PythonQt instance, you can have any number of Python context to do scripting in.
96 One possibility is to use createModuleFromFile(), createModuleFromScript() or createUniqueModule() to get a context
96 One possibility is to use createModuleFromFile(), createModuleFromScript() or createUniqueModule() to get a context
97 that is separated from the other contexts. Alternatively you can use Python dicts as contexts for script evaluation,
97 that is separated from the other contexts. Alternatively you can use Python dicts as contexts for script evaluation,
98 but you will need to populate the dict with the __builtins__ instance to have all Pythons available when running
98 but you will need to populate the dict with the __builtins__ instance to have all Pythons available when running
99 code in the scope of a dict.
99 code in the scope of a dict.
100 */
100 */
101 class PYTHONQT_EXPORT PythonQt : public QObject {
101 class PYTHONQT_EXPORT PythonQt : public QObject {
102
102
103 Q_OBJECT
103 Q_OBJECT
104
104
105 public:
105 public:
106
106
107 //! flags that can be passed to PythonQt::init()
107 //! flags that can be passed to PythonQt::init()
108 enum InitFlags {
108 enum InitFlags {
109 RedirectStdOut = 1, //!<< sets if the std out/err is redirected to pythonStdOut() and pythonStdErr() signals
109 RedirectStdOut = 1, //!<< sets if the std out/err is redirected to pythonStdOut() and pythonStdErr() signals
110 IgnoreSiteModule = 2, //!<< sets if Python should ignore the site module
110 IgnoreSiteModule = 2, //!<< sets if Python should ignore the site module
111 ExternalHelp = 4, //!<< sets if help() calls on PythonQt modules are forwarded to the pythonHelpRequest() signal
111 ExternalHelp = 4, //!<< sets if help() calls on PythonQt modules are forwarded to the pythonHelpRequest() signal
112 PythonAlreadyInitialized = 8 //!<< sets that PythonQt should not can PyInitialize, since it is already done
112 PythonAlreadyInitialized = 8 //!<< sets that PythonQt should not can PyInitialize, since it is already done
113 };
113 };
114
114
115 //! flags that tell PythonQt which operators to expect on the registered type
115 //! flags that tell PythonQt which operators to expect on the registered type
116 enum TypeSlots {
116 enum TypeSlots {
117 Type_Add = 1,
117 Type_Add = 1,
118 Type_Subtract = 1 << 1,
118 Type_Subtract = 1 << 1,
119 Type_Multiply = 1 << 2,
119 Type_Multiply = 1 << 2,
120 Type_Divide = 1 << 3,
120 Type_Divide = 1 << 3,
121 Type_Mod = 1 << 4,
121 Type_Mod = 1 << 4,
122 Type_And = 1 << 5,
122 Type_And = 1 << 5,
123 Type_Or = 1 << 6,
123 Type_Or = 1 << 6,
124 Type_Xor = 1 << 7,
124 Type_Xor = 1 << 7,
125 Type_LShift = 1 << 8,
125 Type_LShift = 1 << 8,
126 Type_RShift = 1 << 9,
126 Type_RShift = 1 << 9,
127
127
128 Type_InplaceAdd = 1 << 10,
128 Type_InplaceAdd = 1 << 10,
129 Type_InplaceSubtract = 1 << 11,
129 Type_InplaceSubtract = 1 << 11,
130 Type_InplaceMultiply = 1 << 12,
130 Type_InplaceMultiply = 1 << 12,
131 Type_InplaceDivide = 1 << 13,
131 Type_InplaceDivide = 1 << 13,
132 Type_InplaceMod = 1 << 14,
132 Type_InplaceMod = 1 << 14,
133 Type_InplaceAnd = 1 << 15,
133 Type_InplaceAnd = 1 << 15,
134 Type_InplaceOr = 1 << 16,
134 Type_InplaceOr = 1 << 16,
135 Type_InplaceXor = 1 << 17,
135 Type_InplaceXor = 1 << 17,
136 Type_InplaceLShift = 1 << 18,
136 Type_InplaceLShift = 1 << 18,
137 Type_InplaceRShift = 1 << 19,
137 Type_InplaceRShift = 1 << 19,
138
138
139 // Not yet needed/nicely mappable/generated...
139 // Not yet needed/nicely mappable/generated...
140 //Type_Positive = 1 << 29,
140 //Type_Positive = 1 << 29,
141 //Type_Negative = 1 << 29,
141 //Type_Negative = 1 << 29,
142 //Type_Abs = 1 << 29,
142 //Type_Abs = 1 << 29,
143 //Type_Hash = 1 << 29,
143 //Type_Hash = 1 << 29,
144
144
145 Type_Invert = 1 << 29,
145 Type_Invert = 1 << 29,
146 Type_RichCompare = 1 << 30,
146 Type_RichCompare = 1 << 30,
147 Type_NonZero = 1 << 31,
147 Type_NonZero = 1 << 31,
148
148
149 };
149 };
150
150
151 //! enum for profiling callback
151 //! enum for profiling callback
152 enum ProfilingCallbackState {
152 enum ProfilingCallbackState {
153 Enter = 1,
153 Enter = 1,
154 Leave = 2
154 Leave = 2
155 };
155 };
156
156
157 //! callback for profiling. className and methodName are only passed when state == Enter, otherwise
157 //! callback for profiling. className and methodName are only passed when state == Enter, otherwise
158 //! they are NULL.
158 //! they are NULL.
159 typedef void ProfilingCB(ProfilingCallbackState state, const char* className, const char* methodName);
159 typedef void ProfilingCB(ProfilingCallbackState state, const char* className, const char* methodName);
160
160
161 //---------------------------------------------------------------------------
161 //---------------------------------------------------------------------------
162 //! \name Singleton Initialization
162 //! \name Singleton Initialization
163 //@{
163 //@{
164
164
165 //! initialize the python qt binding (flags are a or combination of PythonQt::InitFlags), if \c pythonQtModuleName is given
165 //! initialize the python qt binding (flags are a or combination of PythonQt::InitFlags), if \c pythonQtModuleName is given
166 //! it defines the name of the python module that PythonQt will add, otherwise "PythonQt" is used.
166 //! it defines the name of the python module that PythonQt will add, otherwise "PythonQt" is used.
167 //! This can be used to e.g. pass in PySide or PyQt4 to make it more compatible.
167 //! This can be used to e.g. pass in PySide or PyQt4 to make it more compatible.
168 static void init(int flags = IgnoreSiteModule | RedirectStdOut, const QByteArray& pythonQtModuleName = QByteArray());
168 static void init(int flags = IgnoreSiteModule | RedirectStdOut, const QByteArray& pythonQtModuleName = QByteArray());
169
169
170 //! cleanup of the singleton
170 //! cleanup of the singleton
171 static void cleanup();
171 static void cleanup();
172
172
173 //! get the singleton instance
173 //! get the singleton instance
174 static PythonQt* self();
174 static PythonQt* self();
175
175
176 //@}
176 //@}
177
177
178 //! defines the object types for introspection
178 //! defines the object types for introspection
179 enum ObjectType {
179 enum ObjectType {
180 Class,
180 Class,
181 Function,
181 Function,
182 Variable,
182 Variable,
183 Module,
183 Module,
184 Anything,
184 Anything,
185 CallOverloads
185 CallOverloads
186 };
186 };
187
187
188
188
189 //---------------------------------------------------------------------------
189 //---------------------------------------------------------------------------
190 //! \name Standard input handling
190 //! \name Standard input handling
191 //@{
191 //@{
192
192
193 //! Overwrite default handling of stdin using a custom callback. It internally backup
193 //! Overwrite default handling of stdin using a custom callback. It internally backup
194 //! the original 'sys.stdin' into 'sys.pythonqt_original_stdin'
194 //! the original 'sys.stdin' into 'sys.pythonqt_original_stdin'
195 void setRedirectStdInCallback(PythonQtInputChangedCB* callback, void * callbackData = 0);
195 void setRedirectStdInCallback(PythonQtInputChangedCB* callback, void * callbackData = 0);
196
196
197 //! Enable or disable stdin custom callback. It resets 'sys.stdin' using either 'sys.pythonqt_stdin'
197 //! Enable or disable stdin custom callback. It resets 'sys.stdin' using either 'sys.pythonqt_stdin'
198 //! or 'sys.pythonqt_original_stdin'
198 //! or 'sys.pythonqt_original_stdin'
199 void setRedirectStdInCallbackEnabled(bool enabled);
199 void setRedirectStdInCallbackEnabled(bool enabled);
200
200
201 //@}
201 //@}
202
202
203 //---------------------------------------------------------------------------
203 //---------------------------------------------------------------------------
204 //! \name Modules
204 //! \name Modules
205 //@{
205 //@{
206
206
207 //! get the __main__ module of python
207 //! get the __main__ module of python
208 PythonQtObjectPtr getMainModule();
208 PythonQtObjectPtr getMainModule();
209
209
210 //! import the given module and return a reference to it (useful to import e.g. "sys" and call something on it)
210 //! import the given module and return a reference to it (useful to import e.g. "sys" and call something on it)
211 //! If a module is already imported, this returns the already imported module.
211 //! If a module is already imported, this returns the already imported module.
212 PythonQtObjectPtr importModule(const QString& name);
212 PythonQtObjectPtr importModule(const QString& name);
213
213
214 //! creates the new module \c name and evaluates the given file in the context of that module
214 //! creates the new module \c name and evaluates the given file in the context of that module
215 //! If the \c script is empty, the module contains no initial code. You can use evalScript/evalCode to add code
215 //! If the \c script is empty, the module contains no initial code. You can use evalScript/evalCode to add code
216 //! to a module later on.
216 //! to a module later on.
217 //! The user needs to make sure that the \c name is unique in the python module dictionary.
217 //! The user needs to make sure that the \c name is unique in the python module dictionary.
218 PythonQtObjectPtr createModuleFromFile(const QString& name, const QString& filename);
218 PythonQtObjectPtr createModuleFromFile(const QString& name, const QString& filename);
219
219
220 //! creates the new module \c name and evaluates the given script in the context of that module.
220 //! creates the new module \c name and evaluates the given script in the context of that module.
221 //! If the \c script is empty, the module contains no initial code. You can use evalScript/evalCode to add code
221 //! If the \c script is empty, the module contains no initial code. You can use evalScript/evalCode to add code
222 //! to a module later on.
222 //! to a module later on.
223 //! The user needs to make sure that the \c name is unique in the python module dictionary.
223 //! The user needs to make sure that the \c name is unique in the python module dictionary.
224 PythonQtObjectPtr createModuleFromScript(const QString& name, const QString& script = QString());
224 PythonQtObjectPtr createModuleFromScript(const QString& name, const QString& script = QString());
225
225
226 //! create a uniquely named module, you can use evalFile or evalScript to populate the module with
226 //! create a uniquely named module, you can use evalFile or evalScript to populate the module with
227 //! script code
227 //! script code
228 PythonQtObjectPtr createUniqueModule();
228 PythonQtObjectPtr createUniqueModule();
229
229
230 //@}
230 //@}
231
231
232 //---------------------------------------------------------------------------
232 //---------------------------------------------------------------------------
233 //! \name Importing/Paths
233 //! \name Importing/Paths
234 //@{
234 //@{
235
235
236 //! overwrite the python sys path (call this directly after PythonQt::init() if you want to change the std python sys path)
236 //! overwrite the python sys path (call this directly after PythonQt::init() if you want to change the std python sys path)
237 void overwriteSysPath(const QStringList& paths);
237 void overwriteSysPath(const QStringList& paths);
238
238
239 //! prepend a path to sys.path to allow importing from it
239 //! prepend a path to sys.path to allow importing from it
240 void addSysPath(const QString& path);
240 void addSysPath(const QString& path);
241
241
242 //! sets the __path__ list of a module to the given list (important for local imports)
242 //! sets the __path__ list of a module to the given list (important for local imports)
243 void setModuleImportPath(PyObject* module, const QStringList& paths);
243 void setModuleImportPath(PyObject* module, const QStringList& paths);
244
244
245 //@}
245 //@}
246
246
247 //---------------------------------------------------------------------------
247 //---------------------------------------------------------------------------
248 //! \name Registering Classes
248 //! \name Registering Classes
249 //@{
249 //@{
250
250
251 //! registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
251 //! registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
252 /* Since Qt4 does not offer a way to detect if a given classname is derived from QObject and thus has a QMetaObject,
252 /* Since Qt4 does not offer a way to detect if a given classname is derived from QObject and thus has a QMetaObject,
253 you MUST register all your QObject derived classes here when you want them to be detected in signal and slot calls */
253 you MUST register all your QObject derived classes here when you want them to be detected in signal and slot calls */
254 void registerClass(const QMetaObject* metaobject, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL);
254 void registerClass(const QMetaObject* metaobject, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL);
255
255
256 //! add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants
256 //! add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants
257 //! (ownership of wrapper is passed to PythonQt)
257 //! (ownership of wrapper is passed to PythonQt)
258 /*! Make sure that you have done a qRegisterMetaType first, if typeName is a user type!
258 /*! Make sure that you have done a qRegisterMetaType first, if typeName is a user type!
259
259
260 This will add a wrapper object that is used to make calls to the given classname \c typeName.
260 This will add a wrapper object that is used to make calls to the given classname \c typeName.
261 All slots that take a pointer to typeName as the first argument will be callable from Python on
261 All slots that take a pointer to typeName as the first argument will be callable from Python on
262 a variant object that contains such a type.
262 a variant object that contains such a type.
263 */
263 */
264 void registerCPPClass(const char* typeName, const char* parentTypeName = NULL, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL);
264 void registerCPPClass(const char* typeName, const char* parentTypeName = NULL, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL);
265
265
266 //! as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes
266 //! as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes
267 //! and it will register the classes when it first sees a pointer to such a derived class
267 //! and it will register the classes when it first sees a pointer to such a derived class
268 void registerQObjectClassNames(const QStringList& names);
268 void registerQObjectClassNames(const QStringList& names);
269
269
270 //! add a parent class relation to the \c given typeName, the upcastingOffset is needed for multiple inheritance
270 //! add a parent class relation to the \c given typeName, the upcastingOffset is needed for multiple inheritance
271 //! and can be calculated using PythonQtUpcastingOffset<type,parentType>(), which also verifies that
271 //! and can be calculated using PythonQtUpcastingOffset<type,parentType>(), which also verifies that
272 //! type is really derived from parentType.
272 //! type is really derived from parentType.
273 //! Returns false if the typeName was not yet registered.
273 //! Returns false if the typeName was not yet registered.
274 bool addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset=0);
274 bool addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset=0);
275
275
276 //! add a handler for polymorphic downcasting
276 //! add a handler for polymorphic downcasting
277 void addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb);
277 void addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb);
278
278
279 //@}
279 //@}
280
280
281 //---------------------------------------------------------------------------
281 //---------------------------------------------------------------------------
282 //! \name Script Parsing and Evaluation
282 //! \name Script Parsing and Evaluation
283 //@{
283 //@{
284
284
285 //! parses the given file and returns the python code object, this can then be used to call evalCode()
285 //! parses the given file and returns the python code object, this can then be used to call evalCode()
286 PythonQtObjectPtr parseFile(const QString& filename);
286 PythonQtObjectPtr parseFile(const QString& filename);
287
287
288 //! evaluates the given code and returns the result value (use Py_Compile etc. to create pycode from string)
288 //! evaluates the given code and returns the result value (use Py_Compile etc. to create pycode from string)
289 //! If pycode is NULL, a python error is printed.
289 //! If pycode is NULL, a python error is printed.
290 QVariant evalCode(PyObject* object, PyObject* pycode);
290 QVariant evalCode(PyObject* object, PyObject* pycode);
291
291
292 //! evaluates the given script code and returns the result value
292 //! evaluates the given script code and returns the result value
293 QVariant evalScript(PyObject* object, const QString& script, int start = Py_file_input);
293 QVariant evalScript(PyObject* object, const QString& script, int start = Py_file_input);
294
294
295 //! evaluates the given script code from file
295 //! evaluates the given script code from file
296 void evalFile(PyObject* object, const QString& filename);
296 void evalFile(PyObject* object, const QString& filename);
297
297
298 //@}
298 //@}
299
299
300 //---------------------------------------------------------------------------
300 //---------------------------------------------------------------------------
301 //! \name Signal Handlers
301 //! \name Signal Handlers
302 //@{
302 //@{
303
303
304 //! add a signal handler to the given \c signal of \c obj and connect it to a callable \c objectname in module
304 //! add a signal handler to the given \c signal of \c obj and connect it to a callable \c objectname in module
305 bool addSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname);
305 bool addSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname);
306
306
307 //! remove a signal handler from the given \c signal of \c obj
307 //! remove a signal handler from the given \c signal of \c obj
308 bool removeSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname);
308 bool removeSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname);
309
309
310 //! add a signal handler to the given \c signal of \c obj and connect it to a callable \c receiver
310 //! add a signal handler to the given \c signal of \c obj and connect it to a callable \c receiver
311 bool addSignalHandler(QObject* obj, const char* signal, PyObject* receiver);
311 bool addSignalHandler(QObject* obj, const char* signal, PyObject* receiver);
312
312
313 //! remove a signal handler from the given \c signal of \c obj
313 //! remove a signal handler from the given \c signal of \c obj
314 bool removeSignalHandler(QObject* obj, const char* signal, PyObject* receiver);
314 bool removeSignalHandler(QObject* obj, const char* signal, PyObject* receiver);
315
315
316 //@}
316 //@}
317
317
318 //---------------------------------------------------------------------------
318 //---------------------------------------------------------------------------
319 //! \name Variable access
319 //! \name Variable access
320 //@{
320 //@{
321
321
322 //! add the given \c qObject to the python \c object as a variable with \c name (it can be removed via clearVariable)
322 //! add the given \c qObject to the python \c object as a variable with \c name (it can be removed via clearVariable)
323 void addObject(PyObject* object, const QString& name, QObject* qObject);
323 void addObject(PyObject* object, const QString& name, QObject* qObject);
324
324
325 //! add the given variable to the object
325 //! add the given variable to the object
326 void addVariable(PyObject* object, const QString& name, const QVariant& v);
326 void addVariable(PyObject* object, const QString& name, const QVariant& v);
327
327
328 //! remove the given variable
328 //! remove the given variable
329 void removeVariable(PyObject* module, const QString& name);
329 void removeVariable(PyObject* module, const QString& name);
330
330
331 //! get the variable with the \c name of the \c object, returns an invalid QVariant on error
331 //! get the variable with the \c name of the \c object, returns an invalid QVariant on error
332 QVariant getVariable(PyObject* object, const QString& name);
332 QVariant getVariable(PyObject* object, const QString& name);
333
333
334 //! read vars etc. in scope of an \c object, optional looking inside of an object \c objectname
334 //! read vars etc. in scope of an \c object, optional looking inside of an object \c objectname
335 QStringList introspection(PyObject* object, const QString& objectname, ObjectType type);
335 QStringList introspection(PyObject* object, const QString& objectname, ObjectType type);
336 //! read vars etc. in scope of the given \c object
336 //! read vars etc. in scope of the given \c object
337 QStringList introspectObject(PyObject* object, ObjectType type);
337 QStringList introspectObject(PyObject* object, ObjectType type);
338 //! read vars etc. in scope of the type object called \c typename. First the typename
338 //! read vars etc. in scope of the type object called \c typename. First the typename
339 //! of the form module.type is split into module and type. Then the module is looked up
339 //! of the form module.type is split into module and type. Then the module is looked up
340 //! in sys.modules. If the module or type is not found there, then the type is looked up in
340 //! in sys.modules. If the module or type is not found there, then the type is looked up in
341 //! the __builtin__ module.
341 //! the __builtin__ module.
342 QStringList introspectType(const QString& typeName, ObjectType type);
342 QStringList introspectType(const QString& typeName, ObjectType type);
343
343
344 //! returns the found callable object or NULL
344 //! returns the found callable object or NULL
345 //! @return new reference
345 //! @return new reference
346 PythonQtObjectPtr lookupCallable(PyObject* object, const QString& name);
346 PythonQtObjectPtr lookupCallable(PyObject* object, const QString& name);
347
347
348 //! returns the return type of the method of a wrapped c++ object referenced by \c objectname
348 //! returns the return type of the method of a wrapped c++ object referenced by \c objectname
349 QString getReturnTypeOfWrappedMethod(PyObject* module, const QString& objectname);
349 QString getReturnTypeOfWrappedMethod(PyObject* module, const QString& objectname);
350 //! returns the return type of the method \c methodName of a wrapped c++ type referenced by \c typeName
350 //! returns the return type of the method \c methodName of a wrapped c++ type referenced by \c typeName
351 QString getReturnTypeOfWrappedMethod(const QString& typeName, const QString& methodName);
351 QString getReturnTypeOfWrappedMethod(const QString& typeName, const QString& methodName);
352 //@}
352 //@}
353
353
354 //---------------------------------------------------------------------------
354 //---------------------------------------------------------------------------
355 //! \name Calling Python Objects
355 //! \name Calling Python Objects
356 //@{
356 //@{
357
357
358 //! call the given python \c callable in the scope of object, returns the result converted to a QVariant
358 //! call the given python \c callable in the scope of object, returns the result converted to a QVariant
359 QVariant call(PyObject* object, const QString& callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
359 QVariant call(PyObject* object, const QString& callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
360
360
361 //! call the given python object, returns the result converted to a QVariant
361 //! call the given python object, returns the result converted to a QVariant
362 QVariant call(PyObject* callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
362 QVariant call(PyObject* callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
363
363
364 //! call the given python object, returns the result as new PyObject
364 //! call the given python object, returns the result as new PyObject
365 PyObject* callAndReturnPyObject(PyObject* callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
365 PyObject* callAndReturnPyObject(PyObject* callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
366
366
367 //@}
367 //@}
368
368
369 //---------------------------------------------------------------------------
369 //---------------------------------------------------------------------------
370 //! \name Decorations, Constructors, Wrappers...
370 //! \name Decorations, Constructors, Wrappers...
371 //@{
371 //@{
372
372
373 //! add an object whose slots will be used as decorator slots for
373 //! add an object whose slots will be used as decorator slots for
374 //! other QObjects or CPP classes. The slots need to follow the
374 //! other QObjects or CPP classes. The slots need to follow the
375 //! convention that the first argument is a pointer to the wrapped object.
375 //! convention that the first argument is a pointer to the wrapped object.
376 //! (ownership is passed to PythonQt)
376 //! (ownership is passed to PythonQt)
377 /*!
377 /*!
378 Example:
378 Example:
379
379
380 A slot with the signature
380 A slot with the signature
381
381
382 \code
382 \code
383 bool doSomething(QWidget* w, int a)
383 bool doSomething(QWidget* w, int a)
384 \endcode
384 \endcode
385
385
386 will extend QWidget instances (and derived classes) with a "bool doSomething(int a)" slot
386 will extend QWidget instances (and derived classes) with a "bool doSomething(int a)" slot
387 that will be called with the concrete instance as first argument.
387 that will be called with the concrete instance as first argument.
388 So in Python you can now e.g. call
388 So in Python you can now e.g. call
389
389
390 \code
390 \code
391 someWidget.doSomething(12)
391 someWidget.doSomething(12)
392 \endcode
392 \endcode
393
393
394 without QWidget really having this method. This allows to easily make normal methods
394 without QWidget really having this method. This allows to easily make normal methods
395 of Qt classes callable by forwarding them with such decorator slots
395 of Qt classes callable by forwarding them with such decorator slots
396 or to make CPP classes (which are not derived from QObject) callable from Python.
396 or to make CPP classes (which are not derived from QObject) callable from Python.
397 */
397 */
398 void addInstanceDecorators(QObject* o);
398 void addInstanceDecorators(QObject* o);
399
399
400 //! add an object whose slots will be used as decorator slots for
400 //! add an object whose slots will be used as decorator slots for
401 //! class objects (ownership is passed to PythonQt)
401 //! class objects (ownership is passed to PythonQt)
402 /*!
402 /*!
403 The slots need to follow the following convention:
403 The slots need to follow the following convention:
404 - SomeClass* new_SomeClass(...)
404 - SomeClass* new_SomeClass(...)
405 - QVariant new_SomeClass(...)
405 - QVariant new_SomeClass(...)
406 - void delete_SomeClass(SomeClass*)
406 - void delete_SomeClass(SomeClass*)
407 - ... static_SomeClass_someName(...)
407 - ... static_SomeClass_someName(...)
408
408
409 This will add:
409 This will add:
410 - a constructor
410 - a constructor
411 - a constructor which generates a QVariant
411 - a constructor which generates a QVariant
412 - a destructor (only useful for CPP objects)
412 - a destructor (only useful for CPP objects)
413 - a static decorator slot which will be available on the MetaObject (visible in PythonQt module)
413 - a static decorator slot which will be available on the MetaObject (visible in PythonQt module)
414
414
415 */
415 */
416 void addClassDecorators(QObject* o);
416 void addClassDecorators(QObject* o);
417
417
418 //! this will add the object both as class and instance decorator (ownership is passed to PythonQt)
418 //! this will add the object both as class and instance decorator (ownership is passed to PythonQt)
419 void addDecorators(QObject* o);
419 void addDecorators(QObject* o);
420
420
421 //! add the given factory to PythonQt (ownership stays with caller)
421 //! add the given factory to PythonQt (ownership stays with caller)
422 void addWrapperFactory(PythonQtCppWrapperFactory* factory);
422 void addWrapperFactory(PythonQtCppWrapperFactory* factory);
423
423
424 //! add the given factory to PythonQt (ownership stays with caller)
424 //! add the given factory to PythonQt (ownership stays with caller)
425 void addWrapperFactory(PythonQtForeignWrapperFactory* factory);
425 void addWrapperFactory(PythonQtForeignWrapperFactory* factory);
426
426
427 //! remove the wrapper factory
427 //! remove the wrapper factory
428 void removeWrapperFactory(PythonQtCppWrapperFactory* factory);
428 void removeWrapperFactory(PythonQtCppWrapperFactory* factory);
429
429
430 //! remove the wrapper factory
430 //! remove the wrapper factory
431 void removeWrapperFactory(PythonQtForeignWrapperFactory* factory);
431 void removeWrapperFactory(PythonQtForeignWrapperFactory* factory);
432
432
433 //@}
433 //@}
434
434
435 //---------------------------------------------------------------------------
435 //---------------------------------------------------------------------------
436 //! \name Custom Importer
436 //! \name Custom Importer
437 //@{
437 //@{
438
438
439 //! replace the internal import implementation and use the supplied interface to load files (both py and pyc files)
439 //! replace the internal import implementation and use the supplied interface to load files (both py and pyc files)
440 //! (this method should be called directly after initialization of init() and before calling overwriteSysPath().
440 //! (this method should be called directly after initialization of init() and before calling overwriteSysPath().
441 //! On the first call to this method, it will install a generic PythonQt importer in Pythons "path_hooks".
441 //! On the first call to this method, it will install a generic PythonQt importer in Pythons "path_hooks".
442 //! This is not reversible, so even setting setImporter(NULL) afterwards will
442 //! This is not reversible, so even setting setImporter(NULL) afterwards will
443 //! keep the custom PythonQt importer with a QFile default import interface.
443 //! keep the custom PythonQt importer with a QFile default import interface.
444 //! Subsequent python import calls will make use of the passed importInterface
444 //! Subsequent python import calls will make use of the passed importInterface
445 //! which forwards all import calls to the given \c importInterface.
445 //! which forwards all import calls to the given \c importInterface.
446 //! Passing NULL will install a default QFile importer.
446 //! Passing NULL will install a default QFile importer.
447 //! (\c importInterface ownership stays with caller)
447 //! (\c importInterface ownership stays with caller)
448 void setImporter(PythonQtImportFileInterface* importInterface);
448 void setImporter(PythonQtImportFileInterface* importInterface);
449
449
450 //! this installs the default QFile importer (which effectively does a setImporter(NULL))
450 //! this installs the default QFile importer (which effectively does a setImporter(NULL))
451 //! (without calling setImporter or installDefaultImporter at least once, the default python import
451 //! (without calling setImporter or installDefaultImporter at least once, the default python import
452 //! mechanism is in place)
452 //! mechanism is in place)
453 //! the default importer allows to import files from anywhere QFile can read from,
453 //! the default importer allows to import files from anywhere QFile can read from,
454 //! including the Qt resource system using ":". Keep in mind that you need to extend
454 //! including the Qt resource system using ":". Keep in mind that you need to extend
455 //! "sys.path" with ":" to be able to import from the Qt resources.
455 //! "sys.path" with ":" to be able to import from the Qt resources.
456 void installDefaultImporter() { setImporter(NULL); }
456 void installDefaultImporter() { setImporter(NULL); }
457
457
458 //! set paths that the importer should ignore
458 //! set paths that the importer should ignore
459 void setImporterIgnorePaths(const QStringList& paths);
459 void setImporterIgnorePaths(const QStringList& paths);
460
460
461 //! get paths that the importer should ignore
461 //! get paths that the importer should ignore
462 const QStringList& getImporterIgnorePaths();
462 const QStringList& getImporterIgnorePaths();
463
463
464 //! get access to the file importer (if set)
464 //! get access to the file importer (if set)
465 static PythonQtImportFileInterface* importInterface();
465 static PythonQtImportFileInterface* importInterface();
466
466
467 //@}
467 //@}
468
468
469 //---------------------------------------------------------------------------
469 //---------------------------------------------------------------------------
470 //! \name Other Stuff
470 //! \name Other Stuff
471 //@{
471 //@{
472
472
473 //! get access to internal data (should not be used on the public API, but is used by some C functions)
473 //! get access to internal data (should not be used on the public API, but is used by some C functions)
474 static PythonQtPrivate* priv() { return _self->_p; }
474 static PythonQtPrivate* priv() { return _self->_p; }
475
475
476 //! clear all NotFound entries on all class infos, to ensure that
476 //! clear all NotFound entries on all class infos, to ensure that
477 //! newly loaded wrappers can add methods even when the object was wrapped by PythonQt before the wrapper was loaded
477 //! newly loaded wrappers can add methods even when the object was wrapped by PythonQt before the wrapper was loaded
478 void clearNotFoundCachedMembers();
478 void clearNotFoundCachedMembers();
479
479
480 //! handle a python error, call this when a python function fails. If no error occurred, it returns false.
480 //! handle a python error, call this when a python function fails. If no error occurred, it returns false.
481 //! The error is currently just output to the python stderr, future version might implement better trace printing
481 //! The error is currently just output to the python stderr, future version might implement better trace printing
482 bool handleError();
482 bool handleError();
483
483
484 //! return \a true if \a handleError() has been called and an error occured.
484 //! return \a true if \a handleError() has been called and an error occured.
485 bool hadError()const;
485 bool hadError()const;
486
486
487 //! reset error flag. After calling this, hadError() will return false.
487 //! reset error flag. After calling this, hadError() will return false.
488 //! \sa hadError()
488 //! \sa hadError()
489 void clearError();
489 void clearError();
490
490
491 //! if set to true, the systemExitExceptionRaised signal will be emitted if exception SystemExit is caught
491 //! if set to true, the systemExitExceptionRaised signal will be emitted if exception SystemExit is caught
492 //! \sa handleError()
492 //! \sa handleError()
493 void setSystemExitExceptionHandlerEnabled(bool value);
493 void setSystemExitExceptionHandlerEnabled(bool value);
494
494
495 //! return \a true if SystemExit exception is handled by PythonQt
495 //! return \a true if SystemExit exception is handled by PythonQt
496 //! \sa setSystemExitExceptionHandlerEnabled()
496 //! \sa setSystemExitExceptionHandlerEnabled()
497 bool systemExitExceptionHandlerEnabled() const;
497 bool systemExitExceptionHandlerEnabled() const;
498
498
499 //! set a callback that is called when a QObject with parent == NULL is wrapped by PythonQt
499 //! set a callback that is called when a QObject with parent == NULL is wrapped by PythonQt
500 void setQObjectWrappedCallback(PythonQtQObjectWrappedCB* cb);
500 void setQObjectWrappedCallback(PythonQtQObjectWrappedCB* cb);
501 //! set a callback that is called when a QObject with parent == NULL is no longer wrapped by PythonQt
501 //! set a callback that is called when a QObject with parent == NULL is no longer wrapped by PythonQt
502 void setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB* cb);
502 void setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB* cb);
503
503
504 //! call the callback if it is set
504 //! call the callback if it is set
505 static void qObjectNoLongerWrappedCB(QObject* o);
505 static void qObjectNoLongerWrappedCB(QObject* o);
506
506
507 //! called by internal help methods
507 //! called by internal help methods
508 PyObject* helpCalled(PythonQtClassInfo* info);
508 PyObject* helpCalled(PythonQtClassInfo* info);
509
509
510 //! returns the found object or NULL
510 //! returns the found object or NULL
511 //! @return new reference
511 //! @return new reference
512 PythonQtObjectPtr lookupObject(PyObject* module, const QString& name);
512 PythonQtObjectPtr lookupObject(PyObject* module, const QString& name);
513
513
514 //! sets a callback that is called before and after function calls for profiling
514 //! sets a callback that is called before and after function calls for profiling
515 void setProfilingCallback(ProfilingCB* cb);
515 void setProfilingCallback(ProfilingCB* cb);
516
516
517 //@}
517 //@}
518
518
519 Q_SIGNALS:
519 Q_SIGNALS:
520 //! emitted when python outputs something to stdout (and redirection is turned on)
520 //! emitted when python outputs something to stdout (and redirection is turned on)
521 void pythonStdOut(const QString& str);
521 void pythonStdOut(const QString& str);
522 //! emitted when python outputs something to stderr (and redirection is turned on)
522 //! emitted when python outputs something to stderr (and redirection is turned on)
523 void pythonStdErr(const QString& str);
523 void pythonStdErr(const QString& str);
524
524
525 //! emitted when help() is called on a PythonQt object and \c ExternalHelp is enabled
525 //! emitted when help() is called on a PythonQt object and \c ExternalHelp is enabled
526 void pythonHelpRequest(const QByteArray& cppClassName);
526 void pythonHelpRequest(const QByteArray& cppClassName);
527
527
528 //! emitted when both custom SystemExit exception handler is enabled and a SystemExit
528 //! emitted when both custom SystemExit exception handler is enabled and a SystemExit
529 //! exception is raised.
529 //! exception is raised.
530 //! \sa setSystemExitExceptionHandlerEnabled(bool)
530 //! \sa setSystemExitExceptionHandlerEnabled(bool)
531 void systemExitExceptionRaised(int exitCode);
531 void systemExitExceptionRaised(int exitCode);
532
532
533 private:
533 private:
534 void initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName);
534 void initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName);
535
535
536 QString getReturnTypeOfWrappedMethodHelper(const PythonQtObjectPtr& variableObject, const QString& methodName, const QString& context);
536 QString getReturnTypeOfWrappedMethodHelper(const PythonQtObjectPtr& variableObject, const QString& methodName, const QString& context);
537
537
538 PyObject* getObjectByType(const QString& typeName);
538 PyObject* getObjectByType(const QString& typeName);
539
539
540 //! callback for stdout redirection, emits pythonStdOut signal
540 //! callback for stdout redirection, emits pythonStdOut signal
541 static void stdOutRedirectCB(const QString& str);
541 static void stdOutRedirectCB(const QString& str);
542 //! callback for stderr redirection, emits pythonStdErr signal
542 //! callback for stderr redirection, emits pythonStdErr signal
543 static void stdErrRedirectCB(const QString& str);
543 static void stdErrRedirectCB(const QString& str);
544
544
545 //! get (and create if not available) the signal receiver of that QObject, signal receiver is made child of the passed \c obj
545 //! get (and create if not available) the signal receiver of that QObject, signal receiver is made child of the passed \c obj
546 PythonQtSignalReceiver* getSignalReceiver(QObject* obj);
546 PythonQtSignalReceiver* getSignalReceiver(QObject* obj);
547
547
548 PythonQt(int flags, const QByteArray& pythonQtModuleName);
548 PythonQt(int flags, const QByteArray& pythonQtModuleName);
549 ~PythonQt();
549 ~PythonQt();
550
550
551 static PythonQt* _self;
551 static PythonQt* _self;
552 static int _uniqueModuleCount;
552 static int _uniqueModuleCount;
553
553
554 PythonQtPrivate* _p;
554 PythonQtPrivate* _p;
555
555
556 };
556 };
557
557
558 //! internal PythonQt details
558 //! internal PythonQt details
559 class PYTHONQT_EXPORT PythonQtPrivate : public QObject {
559 class PYTHONQT_EXPORT PythonQtPrivate : public QObject {
560
560
561 Q_OBJECT
561 Q_OBJECT
562
562
563 public:
563 public:
564 PythonQtPrivate();
564 PythonQtPrivate();
565 ~PythonQtPrivate();
565 ~PythonQtPrivate();
566
566
567 enum DecoratorTypes {
567 enum DecoratorTypes {
568 StaticDecorator = 1,
568 StaticDecorator = 1,
569 ConstructorDecorator = 2,
569 ConstructorDecorator = 2,
570 DestructorDecorator = 4,
570 DestructorDecorator = 4,
571 InstanceDecorator = 8,
571 InstanceDecorator = 8,
572 DocstringDecorator = 16,
572 AllDecorators = 0xffff
573 AllDecorators = 0xffff
573 };
574 };
574
575
575 //! get the suffixes that are used for shared libraries
576 //! get the suffixes that are used for shared libraries
576 const QStringList& sharedLibrarySuffixes() { return _sharedLibrarySuffixes; }
577 const QStringList& sharedLibrarySuffixes() { return _sharedLibrarySuffixes; }
577
578
578 //! returns if the id is the id for PythonQtObjectPtr
579 //! returns if the id is the id for PythonQtObjectPtr
579 bool isPythonQtObjectPtrMetaId(int id) { return _PythonQtObjectPtr_metaId == id; }
580 bool isPythonQtObjectPtrMetaId(int id) { return _PythonQtObjectPtr_metaId == id; }
580
581
581 //! add the wrapper pointer (for reuse if the same obj appears while wrapper still exists)
582 //! add the wrapper pointer (for reuse if the same obj appears while wrapper still exists)
582 void addWrapperPointer(void* obj, PythonQtInstanceWrapper* wrapper);
583 void addWrapperPointer(void* obj, PythonQtInstanceWrapper* wrapper);
583 //! remove the wrapper ptr again
584 //! remove the wrapper ptr again
584 void removeWrapperPointer(void* obj);
585 void removeWrapperPointer(void* obj);
585
586
586 //! called by destructor of shells to allow invalidation of the Python wrapper
587 //! called by destructor of shells to allow invalidation of the Python wrapper
587 void shellClassDeleted(void* shellClass);
588 void shellClassDeleted(void* shellClass);
588
589
589 //! try to unwrap the given object to a C++ pointer using the foreign wrapper factories
590 //! try to unwrap the given object to a C++ pointer using the foreign wrapper factories
590 void* unwrapForeignWrapper(const QByteArray& classname, PyObject* obj);
591 void* unwrapForeignWrapper(const QByteArray& classname, PyObject* obj);
591
592
592 //! add parent class relation
593 //! add parent class relation
593 bool addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset);
594 bool addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset);
594
595
595 //! add a handler for polymorphic downcasting
596 //! add a handler for polymorphic downcasting
596 void addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb);
597 void addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb);
597
598
598 //! lookup existing classinfo and return new if not yet present
599 //! lookup existing classinfo and return new if not yet present
599 PythonQtClassInfo* lookupClassInfoAndCreateIfNotPresent(const char* typeName);
600 PythonQtClassInfo* lookupClassInfoAndCreateIfNotPresent(const char* typeName);
600
601
601 //! called when a signal emitting QObject is destroyed to remove the signal handler from the hash map
602 //! called when a signal emitting QObject is destroyed to remove the signal handler from the hash map
602 void removeSignalEmitter(QObject* obj);
603 void removeSignalEmitter(QObject* obj);
603
604
604 //! wrap the given QObject into a Python object (or return existing wrapper!)
605 //! wrap the given QObject into a Python object (or return existing wrapper!)
605 PyObject* wrapQObject(QObject* obj);
606 PyObject* wrapQObject(QObject* obj);
606
607
607 //! wrap the given ptr into a Python object (or return existing wrapper!) if there is a known QObject of that name or a known wrapper in the factory
608 //! wrap the given ptr into a Python object (or return existing wrapper!) if there is a known QObject of that name or a known wrapper in the factory
608 PyObject* wrapPtr(void* ptr, const QByteArray& name);
609 PyObject* wrapPtr(void* ptr, const QByteArray& name);
609
610
610 //! create a read-only buffer object from the given memory
611 //! create a read-only buffer object from the given memory
611 static PyObject* wrapMemoryAsBuffer(const void* data, Py_ssize_t size);
612 static PyObject* wrapMemoryAsBuffer(const void* data, Py_ssize_t size);
612
613
613 //! create a read-write buffer object from the given memory
614 //! create a read-write buffer object from the given memory
614 static PyObject* wrapMemoryAsBuffer(void* data, Py_ssize_t size);
615 static PyObject* wrapMemoryAsBuffer(void* data, Py_ssize_t size);
615
616
616 //! registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
617 //! registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
617 /* Since Qt4 does not offer a way to detect if a given classname is derived from QObject and thus has a QMetaObject,
618 /* Since Qt4 does not offer a way to detect if a given classname is derived from QObject and thus has a QMetaObject,
618 you MUST register all your QObject derived classes here when you want them to be detected in signal and slot calls */
619 you MUST register all your QObject derived classes here when you want them to be detected in signal and slot calls */
619 void registerClass(const QMetaObject* metaobject, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL, PyObject* module = NULL, int typeSlots = 0);
620 void registerClass(const QMetaObject* metaobject, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL, PyObject* module = NULL, int typeSlots = 0);
620
621
621 //! add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants
622 //! add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants
622 //! (ownership of wrapper is passed to PythonQt)
623 //! (ownership of wrapper is passed to PythonQt)
623 /*! Make sure that you have done a qRegisterMetaType first, if typeName is a user type!
624 /*! Make sure that you have done a qRegisterMetaType first, if typeName is a user type!
624
625
625 This will add a wrapper object that is used to make calls to the given classname \c typeName.
626 This will add a wrapper object that is used to make calls to the given classname \c typeName.
626 All slots that take a pointer to typeName as the first argument will be callable from Python on
627 All slots that take a pointer to typeName as the first argument will be callable from Python on
627 a variant object that contains such a type.
628 a variant object that contains such a type.
628 */
629 */
629 void registerCPPClass(const char* typeName, const char* parentTypeName = NULL, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL, PyObject* module = NULL, int typeSlots = 0);
630 void registerCPPClass(const char* typeName, const char* parentTypeName = NULL, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL, PyObject* module = NULL, int typeSlots = 0);
630
631
631 //! as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes
632 //! as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes
632 //! and it will register the classes when it first sees a pointer to such a derived class
633 //! and it will register the classes when it first sees a pointer to such a derived class
633 void registerQObjectClassNames(const QStringList& names);
634 void registerQObjectClassNames(const QStringList& names);
634
635
635 //! add a decorator object
636 //! add a decorator object
636 void addDecorators(QObject* o, int decoTypes);
637 void addDecorators(QObject* o, int decoTypes);
637
638
638 //! helper method that creates a PythonQtClassWrapper object (returns a new reference)
639 //! helper method that creates a PythonQtClassWrapper object (returns a new reference)
639 PythonQtClassWrapper* createNewPythonQtClassWrapper(PythonQtClassInfo* info, PyObject* module);
640 PythonQtClassWrapper* createNewPythonQtClassWrapper(PythonQtClassInfo* info, PyObject* module);
640
641
641 //! create a new instance of the given enum type with given value (returns a new reference)
642 //! create a new instance of the given enum type with given value (returns a new reference)
642 static PyObject* createEnumValueInstance(PyObject* enumType, unsigned int enumValue);
643 static PyObject* createEnumValueInstance(PyObject* enumType, unsigned int enumValue);
643
644
644 //! helper that creates a new int derived class that represents the enum of the given name (returns a new reference)
645 //! helper that creates a new int derived class that represents the enum of the given name (returns a new reference)
645 static PyObject* createNewPythonQtEnumWrapper(const char* enumName, PyObject* parentObject);
646 static PyObject* createNewPythonQtEnumWrapper(const char* enumName, PyObject* parentObject);
646
647
647 //! helper method that creates a PythonQtInstanceWrapper object and registers it in the object map
648 //! helper method that creates a PythonQtInstanceWrapper object and registers it in the object map
648 PythonQtInstanceWrapper* createNewPythonQtInstanceWrapper(QObject* obj, PythonQtClassInfo* info, void* wrappedPtr = NULL);
649 PythonQtInstanceWrapper* createNewPythonQtInstanceWrapper(QObject* obj, PythonQtClassInfo* info, void* wrappedPtr = NULL);
649
650
650 //! get the class info for a meta object (if available)
651 //! get the class info for a meta object (if available)
651 PythonQtClassInfo* getClassInfo(const QMetaObject* meta) { return _knownClassInfos.value(meta->className()); }
652 PythonQtClassInfo* getClassInfo(const QMetaObject* meta) { return _knownClassInfos.value(meta->className()); }
652
653
653 //! get the class info for a meta object (if available)
654 //! get the class info for a meta object (if available)
654 PythonQtClassInfo* getClassInfo(const QByteArray& className) { return _knownClassInfos.value(className); }
655 PythonQtClassInfo* getClassInfo(const QByteArray& className) { return _knownClassInfos.value(className); }
655
656
656 //! creates the new module from the given pycode
657 //! creates the new module from the given pycode
657 PythonQtObjectPtr createModule(const QString& name, PyObject* pycode);
658 PythonQtObjectPtr createModule(const QString& name, PyObject* pycode);
658
659
659 //! get the current class info (for the next PythonQtClassWrapper that is created) and reset it to NULL again
660 //! get the current class info (for the next PythonQtClassWrapper that is created) and reset it to NULL again
660 PythonQtClassInfo* currentClassInfoForClassWrapperCreation();
661 PythonQtClassInfo* currentClassInfoForClassWrapperCreation();
661
662
662 //! the dummy tuple (which is empty and may be used to detected that a wrapper is called from internal wrapper creation
663 //! the dummy tuple (which is empty and may be used to detected that a wrapper is called from internal wrapper creation
663 static PyObject* dummyTuple();
664 static PyObject* dummyTuple();
664
665
665 //! called by virtual overloads when a python return value can not be converted to the required Qt type
666 //! called by virtual overloads when a python return value can not be converted to the required Qt type
666 void handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result);
667 void handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result);
667
668
668 //! get access to the PythonQt module
669 //! get access to the PythonQt module
669 PythonQtObjectPtr pythonQtModule() const { return _pythonQtModule; }
670 PythonQtObjectPtr pythonQtModule() const { return _pythonQtModule; }
670
671
671 //! returns the profiling callback, which may be NULL
672 //! returns the profiling callback, which may be NULL
672 PythonQt::ProfilingCB* profilingCB() const { return _profilingCB; }
673 PythonQt::ProfilingCB* profilingCB() const { return _profilingCB; }
673
674
674 //! determines the signature of the given callable object (similar as pydoc)
675 //! determines the signature of the given callable object (similar as pydoc)
675 QString getSignature(PyObject* object);
676 QString getSignature(PyObject* object);
676
677
677 //! returns true if the object is a method descriptor (same as inspect.ismethoddescriptor() in inspect.py)
678 //! returns true if the object is a method descriptor (same as inspect.ismethoddescriptor() in inspect.py)
678 bool isMethodDescriptor(PyObject* object) const;
679 bool isMethodDescriptor(PyObject* object) const;
679
680
680 private:
681 private:
681 //! Setup the shared library suffixes by getting them from the "imp" module.
682 //! Setup the shared library suffixes by getting them from the "imp" module.
682 void setupSharedLibrarySuffixes();
683 void setupSharedLibrarySuffixes();
683
684
684 //! create a new pythonqt class wrapper and place it in the pythonqt module
685 //! create a new pythonqt class wrapper and place it in the pythonqt module
685 void createPythonQtClassWrapper(PythonQtClassInfo* info, const char* package, PyObject* module = NULL);
686 void createPythonQtClassWrapper(PythonQtClassInfo* info, const char* package, PyObject* module = NULL);
686
687
687 //! get/create new package module (the returned object is a borrowed reference)
688 //! get/create new package module (the returned object is a borrowed reference)
688 PyObject* packageByName(const char* name);
689 PyObject* packageByName(const char* name);
689
690
690 //! get the wrapper for a given pointer (and remove a wrapper of an already destroyed qobject)
691 //! get the wrapper for a given pointer (and remove a wrapper of an already destroyed qobject)
691 PythonQtInstanceWrapper* findWrapperAndRemoveUnused(void* obj);
692 PythonQtInstanceWrapper* findWrapperAndRemoveUnused(void* obj);
692
693
693 //! stores pointer to PyObject mapping of wrapped QObjects AND C++ objects
694 //! stores pointer to PyObject mapping of wrapped QObjects AND C++ objects
694 QHash<void* , PythonQtInstanceWrapper *> _wrappedObjects;
695 QHash<void* , PythonQtInstanceWrapper *> _wrappedObjects;
695
696
696 //! stores the meta info of known Qt classes
697 //! stores the meta info of known Qt classes
697 QHash<QByteArray, PythonQtClassInfo *> _knownClassInfos;
698 QHash<QByteArray, PythonQtClassInfo *> _knownClassInfos;
698
699
699 //! names of qobject derived classes that can be casted to qobject savely
700 //! names of qobject derived classes that can be casted to qobject savely
700 QHash<QByteArray, bool> _knownQObjectClassNames;
701 QHash<QByteArray, bool> _knownQObjectClassNames;
701
702
702 //! stores signal receivers for QObjects
703 //! stores signal receivers for QObjects
703 QHash<QObject* , PythonQtSignalReceiver *> _signalReceivers;
704 QHash<QObject* , PythonQtSignalReceiver *> _signalReceivers;
704
705
705 //! the PythonQt python module
706 //! the PythonQt python module
706 PythonQtObjectPtr _pythonQtModule;
707 PythonQtObjectPtr _pythonQtModule;
707
708
708 //! the name of the PythonQt python module
709 //! the name of the PythonQt python module
709 QByteArray _pythonQtModuleName;
710 QByteArray _pythonQtModuleName;
710
711
711 //! the importer interface (if set)
712 //! the importer interface (if set)
712 PythonQtImportFileInterface* _importInterface;
713 PythonQtImportFileInterface* _importInterface;
713
714
714 //! the default importer
715 //! the default importer
715 PythonQtQFileImporter* _defaultImporter;
716 PythonQtQFileImporter* _defaultImporter;
716
717
717 PythonQtQObjectNoLongerWrappedCB* _noLongerWrappedCB;
718 PythonQtQObjectNoLongerWrappedCB* _noLongerWrappedCB;
718 PythonQtQObjectWrappedCB* _wrappedCB;
719 PythonQtQObjectWrappedCB* _wrappedCB;
719
720
720 QStringList _importIgnorePaths;
721 QStringList _importIgnorePaths;
721 QStringList _sharedLibrarySuffixes;
722 QStringList _sharedLibrarySuffixes;
722
723
723 //! the cpp object wrapper factories
724 //! the cpp object wrapper factories
724 QList<PythonQtCppWrapperFactory*> _cppWrapperFactories;
725 QList<PythonQtCppWrapperFactory*> _cppWrapperFactories;
725
726
726 QList<PythonQtForeignWrapperFactory*> _foreignWrapperFactories;
727 QList<PythonQtForeignWrapperFactory*> _foreignWrapperFactories;
727
728
728 QHash<QByteArray, PyObject*> _packages;
729 QHash<QByteArray, PyObject*> _packages;
729
730
730 PythonQtClassInfo* _currentClassInfoForClassWrapperCreation;
731 PythonQtClassInfo* _currentClassInfoForClassWrapperCreation;
731
732
732 PythonQt::ProfilingCB* _profilingCB;
733 PythonQt::ProfilingCB* _profilingCB;
733
734
734 int _initFlags;
735 int _initFlags;
735 int _PythonQtObjectPtr_metaId;
736 int _PythonQtObjectPtr_metaId;
736
737
737 bool _hadError;
738 bool _hadError;
738 bool _systemExitExceptionHandlerEnabled;
739 bool _systemExitExceptionHandlerEnabled;
739
740
740 friend class PythonQt;
741 friend class PythonQt;
741 };
742 };
742
743
743 #endif
744 #endif
@@ -1,910 +1,913
1 /*
1 /*
2 *
2 *
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 *
4 *
5 * This library is free software; you can redistribute it and/or
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
8 * version 2.1 of the License, or (at your option) any later version.
9 *
9 *
10 * This library is distributed in the hope that it will be useful,
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
13 * Lesser General Public License for more details.
14 *
14 *
15 * Further, this software is distributed without any warranty that it is
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
20 * other software, or any other product whatsoever.
21 *
21 *
22 * You should have received a copy of the GNU Lesser General Public
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
25 *
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 * 28359 Bremen, Germany or:
27 * 28359 Bremen, Germany or:
28 *
28 *
29 * http://www.mevis.de
29 * http://www.mevis.de
30 *
30 *
31 */
31 */
32
32
33 //----------------------------------------------------------------------------------
33 //----------------------------------------------------------------------------------
34 /*!
34 /*!
35 // \file PythonQt.cpp
35 // \file PythonQt.cpp
36 // \author Florian Link
36 // \author Florian Link
37 // \author Last changed by $Author: florian $
37 // \author Last changed by $Author: florian $
38 // \date 2006-05
38 // \date 2006-05
39 */
39 */
40 //----------------------------------------------------------------------------------
40 //----------------------------------------------------------------------------------
41
41
42 #include "PythonQtClassInfo.h"
42 #include "PythonQtClassInfo.h"
43 #include "PythonQtMethodInfo.h"
43 #include "PythonQtMethodInfo.h"
44 #include "PythonQt.h"
44 #include "PythonQt.h"
45 #include <QMetaMethod>
45 #include <QMetaMethod>
46 #include <QMetaObject>
46 #include <QMetaObject>
47 #include <QMetaEnum>
47 #include <QMetaEnum>
48
48
49 QHash<QByteArray, int> PythonQtMethodInfo::_parameterTypeDict;
49 QHash<QByteArray, int> PythonQtMethodInfo::_parameterTypeDict;
50
50
51 PythonQtClassInfo::PythonQtClassInfo() {
51 PythonQtClassInfo::PythonQtClassInfo() {
52 _meta = NULL;
52 _meta = NULL;
53 _constructors = NULL;
53 _constructors = NULL;
54 _destructor = NULL;
54 _destructor = NULL;
55 _decoratorProvider = NULL;
55 _decoratorProvider = NULL;
56 _decoratorProviderCB = NULL;
56 _decoratorProviderCB = NULL;
57 _pythonQtClassWrapper = NULL;
57 _pythonQtClassWrapper = NULL;
58 _shellSetInstanceWrapperCB = NULL;
58 _shellSetInstanceWrapperCB = NULL;
59 _metaTypeId = -1;
59 _metaTypeId = -1;
60 _typeSlots = 0;
60 _typeSlots = 0;
61 _isQObject = false;
61 _isQObject = false;
62 _enumsCreated = false;
62 _enumsCreated = false;
63 }
63 }
64
64
65 PythonQtClassInfo::~PythonQtClassInfo()
65 PythonQtClassInfo::~PythonQtClassInfo()
66 {
66 {
67 clearCachedMembers();
67 clearCachedMembers();
68
68
69 if (_constructors) {
69 if (_constructors) {
70 _constructors->deleteOverloadsAndThis();
70 _constructors->deleteOverloadsAndThis();
71 }
71 }
72 if (_destructor) {
72 if (_destructor) {
73 _destructor->deleteOverloadsAndThis();
73 _destructor->deleteOverloadsAndThis();
74 }
74 }
75 Q_FOREACH(PythonQtSlotInfo* info, _decoratorSlots) {
75 Q_FOREACH(PythonQtSlotInfo* info, _decoratorSlots) {
76 info->deleteOverloadsAndThis();
76 info->deleteOverloadsAndThis();
77 }
77 }
78 }
78 }
79
79
80 void PythonQtClassInfo::setupQObject(const QMetaObject* meta)
80 void PythonQtClassInfo::setupQObject(const QMetaObject* meta)
81 {
81 {
82 // _wrappedClassName is already set earlier in the class setup
82 // _wrappedClassName is already set earlier in the class setup
83 _isQObject = true;
83 _isQObject = true;
84 _meta = meta;
84 _meta = meta;
85 }
85 }
86
86
87 void PythonQtClassInfo::setupCPPObject(const QByteArray& classname)
87 void PythonQtClassInfo::setupCPPObject(const QByteArray& classname)
88 {
88 {
89 _isQObject = false;
89 _isQObject = false;
90 _wrappedClassName = classname;
90 _wrappedClassName = classname;
91 _metaTypeId = QMetaType::type(classname);
91 _metaTypeId = QMetaType::type(classname);
92 }
92 }
93
93
94 void PythonQtClassInfo::clearCachedMembers()
94 void PythonQtClassInfo::clearCachedMembers()
95 {
95 {
96 QHashIterator<QByteArray, PythonQtMemberInfo> i(_cachedMembers);
96 QHashIterator<QByteArray, PythonQtMemberInfo> i(_cachedMembers);
97 while (i.hasNext()) {
97 while (i.hasNext()) {
98 PythonQtMemberInfo member = i.next().value();
98 PythonQtMemberInfo member = i.next().value();
99 if (member._type== PythonQtMemberInfo::Slot || member._type== PythonQtMemberInfo::Signal) {
99 if (member._type== PythonQtMemberInfo::Slot || member._type== PythonQtMemberInfo::Signal) {
100 PythonQtSlotInfo* info = member._slot;
100 PythonQtSlotInfo* info = member._slot;
101 while (info) {
101 while (info) {
102 PythonQtSlotInfo* next = info->nextInfo();
102 PythonQtSlotInfo* next = info->nextInfo();
103 delete info;
103 delete info;
104 info = next;
104 info = next;
105 }
105 }
106 }
106 }
107 }
107 }
108 }
108 }
109
109
110 int PythonQtClassInfo::findCharOffset(const char* sigStart, char someChar)
110 int PythonQtClassInfo::findCharOffset(const char* sigStart, char someChar)
111 {
111 {
112 const char* sigEnd = sigStart;
112 const char* sigEnd = sigStart;
113 char c;
113 char c;
114 do {
114 do {
115 c = *sigEnd++;
115 c = *sigEnd++;
116 } while (c!=someChar && c!=0);
116 } while (c!=someChar && c!=0);
117 return sigEnd-sigStart-1;
117 return sigEnd-sigStart-1;
118 }
118 }
119
119
120 bool PythonQtClassInfo::lookForPropertyAndCache(const char* memberName)
120 bool PythonQtClassInfo::lookForPropertyAndCache(const char* memberName)
121 {
121 {
122 if (!_meta) return false;
122 if (!_meta) return false;
123
123
124 bool found = false;
124 bool found = false;
125 bool nameMapped = false;
125 bool nameMapped = false;
126 const char* attributeName = memberName;
126 const char* attributeName = memberName;
127 // look for properties
127 // look for properties
128 int i = _meta->indexOfProperty(attributeName);
128 int i = _meta->indexOfProperty(attributeName);
129 if (i==-1) {
129 if (i==-1) {
130 // try to map name to objectName
130 // try to map name to objectName
131 if (qstrcmp(attributeName, "name")==0) {
131 if (qstrcmp(attributeName, "name")==0) {
132 attributeName = "objectName";
132 attributeName = "objectName";
133 nameMapped = true;
133 nameMapped = true;
134 i = _meta->indexOfProperty(attributeName);
134 i = _meta->indexOfProperty(attributeName);
135 }
135 }
136 }
136 }
137 if (i!=-1) {
137 if (i!=-1) {
138 PythonQtMemberInfo newInfo(_meta->property(i));
138 PythonQtMemberInfo newInfo(_meta->property(i));
139 _cachedMembers.insert(attributeName, newInfo);
139 _cachedMembers.insert(attributeName, newInfo);
140 if (nameMapped) {
140 if (nameMapped) {
141 _cachedMembers.insert(memberName, newInfo);
141 _cachedMembers.insert(memberName, newInfo);
142 }
142 }
143 #ifdef PYTHONQT_DEBUG
143 #ifdef PYTHONQT_DEBUG
144 std::cout << "caching property " << memberName << " on " << _meta->className() << std::endl;
144 std::cout << "caching property " << memberName << " on " << _meta->className() << std::endl;
145 #endif
145 #endif
146 found = true;
146 found = true;
147 }
147 }
148 return found;
148 return found;
149 }
149 }
150
150
151 PythonQtSlotInfo* PythonQtClassInfo::recursiveFindDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset)
151 PythonQtSlotInfo* PythonQtClassInfo::recursiveFindDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset)
152 {
152 {
153 inputInfo = findDecoratorSlotsFromDecoratorProvider(memberName, inputInfo, found, memberCache, upcastingOffset);
153 inputInfo = findDecoratorSlotsFromDecoratorProvider(memberName, inputInfo, found, memberCache, upcastingOffset);
154 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
154 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
155 inputInfo = info._parent->recursiveFindDecoratorSlotsFromDecoratorProvider(memberName, inputInfo, found, memberCache, upcastingOffset+info._upcastingOffset);
155 inputInfo = info._parent->recursiveFindDecoratorSlotsFromDecoratorProvider(memberName, inputInfo, found, memberCache, upcastingOffset+info._upcastingOffset);
156 }
156 }
157 return inputInfo;
157 return inputInfo;
158 }
158 }
159
159
160 PythonQtSlotInfo* PythonQtClassInfo::findDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset) {
160 PythonQtSlotInfo* PythonQtClassInfo::findDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset) {
161 QObject* decoratorProvider = decorator();
161 QObject* decoratorProvider = decorator();
162 int memberNameLen = static_cast<int>(strlen(memberName));
162 int memberNameLen = static_cast<int>(strlen(memberName));
163 if (decoratorProvider) {
163 if (decoratorProvider) {
164 //qDebug()<< "looking " << decoratorProvider->metaObject()->className() << " " << memberName << " " << upcastingOffset;
164 //qDebug()<< "looking " << decoratorProvider->metaObject()->className() << " " << memberName << " " << upcastingOffset;
165 const QMetaObject* meta = decoratorProvider->metaObject();
165 const QMetaObject* meta = decoratorProvider->metaObject();
166 int numMethods = meta->methodCount();
166 int numMethods = meta->methodCount();
167 int startFrom = QObject::staticMetaObject.methodCount();
167 int startFrom = QObject::staticMetaObject.methodCount();
168 for (int i = startFrom; i < numMethods; i++) {
168 for (int i = startFrom; i < numMethods; i++) {
169 QMetaMethod m = meta->method(i);
169 QMetaMethod m = meta->method(i);
170 if ((m.methodType() == QMetaMethod::Method ||
170 if ((m.methodType() == QMetaMethod::Method ||
171 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
171 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
172
172
173 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
173 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
174 QByteArray sigStart = m.methodSignature();
174 QByteArray sigStart = m.methodSignature();
175 #else
175 #else
176 QByteArray sigStart = m.signature();
176 QByteArray sigStart = m.signature();
177 #endif
177 #endif
178 bool isClassDeco = false;
178 bool isClassDeco = false;
179 if (sigStart.startsWith("static_")) {
179 if (sigStart.startsWith("static_")) {
180 // skip the static_classname_ part of the string
180 // skip the static_classname_ part of the string
181 sigStart.remove(0,7+strlen(className())+1);
181 sigStart.remove(0,7+strlen(className())+1);
182 isClassDeco = true;
182 isClassDeco = true;
183 } else if (sigStart.startsWith("new_")) {
183 } else if (sigStart.startsWith("new_")) {
184 isClassDeco = true;
184 isClassDeco = true;
185 } else if (sigStart.startsWith("delete_")) {
185 } else if (sigStart.startsWith("delete_")) {
186 isClassDeco = true;
186 isClassDeco = true;
187 }
187 }
188 // find the first '('
188 // find the first '('
189 int offset = findCharOffset(sigStart, '(');
189 int offset = findCharOffset(sigStart, '(');
190
190
191 // XXX no checking is currently done if the slots have correct first argument or not...
191 // XXX no checking is currently done if the slots have correct first argument or not...
192
192
193 // check if same length and same name
193 // check if same length and same name
194 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
194 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
195 found = true;
195 found = true;
196 PythonQtSlotInfo* info = new PythonQtSlotInfo(this, m, i, decoratorProvider, isClassDeco?PythonQtSlotInfo::ClassDecorator:PythonQtSlotInfo::InstanceDecorator);
196 PythonQtSlotInfo* info = new PythonQtSlotInfo(this, m, i, decoratorProvider, isClassDeco?PythonQtSlotInfo::ClassDecorator:PythonQtSlotInfo::InstanceDecorator);
197 info->setUpcastingOffset(upcastingOffset);
197 info->setUpcastingOffset(upcastingOffset);
198 //qDebug()<< "adding " << decoratorProvider->metaObject()->className() << " " << memberName << " " << upcastingOffset;
198 //qDebug()<< "adding " << decoratorProvider->metaObject()->className() << " " << memberName << " " << upcastingOffset;
199 if (tail) {
199 if (tail) {
200 tail->setNextInfo(info);
200 tail->setNextInfo(info);
201 } else {
201 } else {
202 PythonQtMemberInfo newInfo(info);
202 PythonQtMemberInfo newInfo(info);
203 memberCache.insert(memberName, newInfo);
203 memberCache.insert(memberName, newInfo);
204 }
204 }
205 tail = info;
205 tail = info;
206 }
206 }
207 }
207 }
208 }
208 }
209 }
209 }
210
210
211 tail = findDecoratorSlots(memberName, memberNameLen, tail, found, memberCache, upcastingOffset);
211 tail = findDecoratorSlots(memberName, memberNameLen, tail, found, memberCache, upcastingOffset);
212
212
213 // now look for slots/signals/methods on this level of the meta object
213 // now look for slots/signals/methods on this level of the meta object
214 if (_meta) {
214 if (_meta) {
215 int numMethods = _meta->methodCount();
215 int numMethods = _meta->methodCount();
216 // start from methodOffset, to only add slots which are located in this class,
216 // start from methodOffset, to only add slots which are located in this class,
217 // and not in the parent class, which is traversed recursively later on.
217 // and not in the parent class, which is traversed recursively later on.
218 // (if the class in not a QObject, we are working with a script wrapper QObject
218 // (if the class in not a QObject, we are working with a script wrapper QObject
219 // and need to read all slots/signals starting from 0).
219 // and need to read all slots/signals starting from 0).
220 int methodOffset = _isQObject?_meta->methodOffset():0;
220 int methodOffset = _isQObject?_meta->methodOffset():0;
221 for (int i = methodOffset; i < numMethods; i++) {
221 for (int i = methodOffset; i < numMethods; i++) {
222 QMetaMethod m = _meta->method(i);
222 QMetaMethod m = _meta->method(i);
223 if (((m.methodType() == QMetaMethod::Method ||
223 if (((m.methodType() == QMetaMethod::Method ||
224 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public)
224 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public)
225 || m.methodType()==QMetaMethod::Signal) {
225 || m.methodType()==QMetaMethod::Signal) {
226
226
227 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
227 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
228 QByteArray sigStart = m.methodSignature();
228 QByteArray sigStart = m.methodSignature();
229 #else
229 #else
230 QByteArray sigStart = m.signature();
230 QByteArray sigStart = m.signature();
231 #endif
231 #endif
232 // find the first '('
232 // find the first '('
233 int offset = findCharOffset(sigStart, '(');
233 int offset = findCharOffset(sigStart, '(');
234
234
235 // check if same length and same name
235 // check if same length and same name
236 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
236 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
237 found = true;
237 found = true;
238 PythonQtSlotInfo* info = new PythonQtSlotInfo(this, m, i);
238 PythonQtSlotInfo* info = new PythonQtSlotInfo(this, m, i);
239 if (tail) {
239 if (tail) {
240 tail->setNextInfo(info);
240 tail->setNextInfo(info);
241 } else {
241 } else {
242 PythonQtMemberInfo newInfo(info);
242 PythonQtMemberInfo newInfo(info);
243 memberCache.insert(memberName, newInfo);
243 memberCache.insert(memberName, newInfo);
244 }
244 }
245 tail = info;
245 tail = info;
246 }
246 }
247 }
247 }
248 }
248 }
249 }
249 }
250 return tail;
250 return tail;
251 }
251 }
252
252
253 bool PythonQtClassInfo::lookForMethodAndCache(const char* memberName)
253 bool PythonQtClassInfo::lookForMethodAndCache(const char* memberName)
254 {
254 {
255 bool found = false;
255 bool found = false;
256 PythonQtSlotInfo* tail = NULL;
256 PythonQtSlotInfo* tail = NULL;
257
257
258 // look for dynamic decorators in this class and in derived classes
258 // look for dynamic decorators in this class and in derived classes
259 // (do this first to allow overloading of existing slots with generated wrappers,
259 // (do this first to allow overloading of existing slots with generated wrappers,
260 // e.g. QDialog::accept is overloaded with PythonQtWrapper_QDialog::accept decorator)
260 // e.g. QDialog::accept is overloaded with PythonQtWrapper_QDialog::accept decorator)
261 tail = recursiveFindDecoratorSlotsFromDecoratorProvider(memberName, tail, found, _cachedMembers, 0);
261 tail = recursiveFindDecoratorSlotsFromDecoratorProvider(memberName, tail, found, _cachedMembers, 0);
262
262
263 return found;
263 return found;
264 }
264 }
265
265
266 bool PythonQtClassInfo::lookForEnumAndCache(const QMetaObject* meta, const char* memberName)
266 bool PythonQtClassInfo::lookForEnumAndCache(const QMetaObject* meta, const char* memberName)
267 {
267 {
268 bool found = false;
268 bool found = false;
269 // look for enum values
269 // look for enum values
270 int enumCount = meta->enumeratorCount();
270 int enumCount = meta->enumeratorCount();
271 for (int i=0;i<enumCount; i++) {
271 for (int i=0;i<enumCount; i++) {
272 QMetaEnum e = meta->enumerator(i);
272 QMetaEnum e = meta->enumerator(i);
273 // we do not want flags, they will cause our values to appear two times
273 // we do not want flags, they will cause our values to appear two times
274 if (e.isFlag()) continue;
274 if (e.isFlag()) continue;
275
275
276 for (int j=0; j < e.keyCount(); j++) {
276 for (int j=0; j < e.keyCount(); j++) {
277 if (qstrcmp(e.key(j), memberName)==0) {
277 if (qstrcmp(e.key(j), memberName)==0) {
278 PyObject* enumType = findEnumWrapper(e.name());
278 PyObject* enumType = findEnumWrapper(e.name());
279 if (enumType) {
279 if (enumType) {
280 PythonQtObjectPtr enumValuePtr;
280 PythonQtObjectPtr enumValuePtr;
281 enumValuePtr.setNewRef(PythonQtPrivate::createEnumValueInstance(enumType, e.value(j)));
281 enumValuePtr.setNewRef(PythonQtPrivate::createEnumValueInstance(enumType, e.value(j)));
282 PythonQtMemberInfo newInfo(enumValuePtr);
282 PythonQtMemberInfo newInfo(enumValuePtr);
283 _cachedMembers.insert(memberName, newInfo);
283 _cachedMembers.insert(memberName, newInfo);
284 #ifdef PYTHONQT_DEBUG
284 #ifdef PYTHONQT_DEBUG
285 std::cout << "caching enum " << memberName << " on " << meta->className() << std::endl;
285 std::cout << "caching enum " << memberName << " on " << meta->className() << std::endl;
286 #endif
286 #endif
287 found = true;
287 found = true;
288 break;
288 break;
289 } else {
289 } else {
290 std::cout << "enum " << e.name() << " not found on " << className() << std::endl;
290 std::cout << "enum " << e.name() << " not found on " << className() << std::endl;
291 }
291 }
292 }
292 }
293 }
293 }
294 }
294 }
295 return found;
295 return found;
296 }
296 }
297
297
298 PythonQtMemberInfo PythonQtClassInfo::member(const char* memberName)
298 PythonQtMemberInfo PythonQtClassInfo::member(const char* memberName)
299 {
299 {
300 PythonQtMemberInfo info = _cachedMembers.value(memberName);
300 PythonQtMemberInfo info = _cachedMembers.value(memberName);
301 if (info._type != PythonQtMemberInfo::Invalid) {
301 if (info._type != PythonQtMemberInfo::Invalid) {
302 return info;
302 return info;
303 } else {
303 } else {
304 bool found = false;
304 bool found = false;
305
305
306 found = lookForPropertyAndCache(memberName);
306 found = lookForPropertyAndCache(memberName);
307 if (!found) {
307 if (!found) {
308 found = lookForMethodAndCache(memberName);
308 found = lookForMethodAndCache(memberName);
309 }
309 }
310 if (!found) {
310 if (!found) {
311 if (_meta) {
311 if (_meta) {
312 // check enums in our meta object directly
312 // check enums in our meta object directly
313 found = lookForEnumAndCache(_meta, memberName);
313 found = lookForEnumAndCache(_meta, memberName);
314 }
314 }
315 if (!found) {
315 if (!found) {
316 // check enums in the class hierachy of CPP classes
316 // check enums in the class hierachy of CPP classes
317 // look for dynamic decorators in this class and in derived classes
317 // look for dynamic decorators in this class and in derived classes
318 QList<QObject*> decoObjects;
318 QList<QObject*> decoObjects;
319 recursiveCollectDecoratorObjects(decoObjects);
319 recursiveCollectDecoratorObjects(decoObjects);
320 Q_FOREACH(QObject* deco, decoObjects) {
320 Q_FOREACH(QObject* deco, decoObjects) {
321 // call on ourself for caching, but with different metaObject():
321 // call on ourself for caching, but with different metaObject():
322 found = lookForEnumAndCache(deco->metaObject(), memberName);
322 found = lookForEnumAndCache(deco->metaObject(), memberName);
323 if (found) {
323 if (found) {
324 break;
324 break;
325 }
325 }
326 }
326 }
327 }
327 }
328 }
328 }
329 if (!found) {
329 if (!found) {
330 // maybe it is an enum wrapper?
330 // maybe it is an enum wrapper?
331 PyObject* p = findEnumWrapper(memberName);
331 PyObject* p = findEnumWrapper(memberName);
332 if (p) {
332 if (p) {
333 info._type = PythonQtMemberInfo::EnumWrapper;
333 info._type = PythonQtMemberInfo::EnumWrapper;
334 info._enumWrapper = p;
334 info._enumWrapper = p;
335 _cachedMembers.insert(memberName, info);
335 _cachedMembers.insert(memberName, info);
336 found = true;
336 found = true;
337 }
337 }
338 }
338 }
339 if (!found) {
339 if (!found) {
340 // since python keywords can not be looked up, we check if the name contains a single trailing _
340 // since python keywords can not be looked up, we check if the name contains a single trailing _
341 // and remove that and look again, so that we e.g. find exec on an exec_ lookup
341 // and remove that and look again, so that we e.g. find exec on an exec_ lookup
342 QByteArray mbrName(memberName);
342 QByteArray mbrName(memberName);
343 if ((mbrName.length()>2) &&
343 if ((mbrName.length()>2) &&
344 (mbrName.at(mbrName.length()-1) == '_') &&
344 (mbrName.at(mbrName.length()-1) == '_') &&
345 (mbrName.at(mbrName.length()-2) != '_')) {
345 (mbrName.at(mbrName.length()-2) != '_')) {
346 mbrName = mbrName.mid(0,mbrName.length()-1);
346 mbrName = mbrName.mid(0,mbrName.length()-1);
347 found = lookForMethodAndCache(mbrName.constData());
347 found = lookForMethodAndCache(mbrName.constData());
348 if (found) {
348 if (found) {
349 return _cachedMembers.value(mbrName);
349 return _cachedMembers.value(mbrName);
350 }
350 }
351 }
351 }
352 }
352 }
353 if (!found) {
353 if (!found) {
354 // we store a NotFound member, so that we get a quick result for non existing members (e.g. operator_equal lookup)
354 // we store a NotFound member, so that we get a quick result for non existing members (e.g. operator_equal lookup)
355 info._type = PythonQtMemberInfo::NotFound;
355 info._type = PythonQtMemberInfo::NotFound;
356 _cachedMembers.insert(memberName, info);
356 _cachedMembers.insert(memberName, info);
357 }
357 }
358 }
358 }
359
359
360 return _cachedMembers.value(memberName);
360 return _cachedMembers.value(memberName);
361 }
361 }
362
362
363 void PythonQtClassInfo::recursiveCollectDecoratorObjects(QList<QObject*>& decoratorObjects) {
363 void PythonQtClassInfo::recursiveCollectDecoratorObjects(QList<QObject*>& decoratorObjects) {
364 QObject* deco = decorator();
364 QObject* deco = decorator();
365 if (deco) {
365 if (deco) {
366 decoratorObjects.append(deco);
366 decoratorObjects.append(deco);
367 }
367 }
368 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
368 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
369 info._parent->recursiveCollectDecoratorObjects(decoratorObjects);
369 info._parent->recursiveCollectDecoratorObjects(decoratorObjects);
370 }
370 }
371 }
371 }
372
372
373 void PythonQtClassInfo::recursiveCollectClassInfos(QList<PythonQtClassInfo*>& classInfoObjects) {
373 void PythonQtClassInfo::recursiveCollectClassInfos(QList<PythonQtClassInfo*>& classInfoObjects) {
374 classInfoObjects.append(this);
374 classInfoObjects.append(this);
375 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
375 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
376 info._parent->recursiveCollectClassInfos(classInfoObjects);
376 info._parent->recursiveCollectClassInfos(classInfoObjects);
377 }
377 }
378 }
378 }
379
379
380 PythonQtSlotInfo* PythonQtClassInfo::findDecoratorSlots(const char* memberName, int memberNameLen, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset)
380 PythonQtSlotInfo* PythonQtClassInfo::findDecoratorSlots(const char* memberName, int memberNameLen, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset)
381 {
381 {
382 QListIterator<PythonQtSlotInfo*> it(_decoratorSlots);
382 QListIterator<PythonQtSlotInfo*> it(_decoratorSlots);
383 while (it.hasNext()) {
383 while (it.hasNext()) {
384
384
385 PythonQtSlotInfo* infoOrig = it.next();
385 PythonQtSlotInfo* infoOrig = it.next();
386
386
387 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
387 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
388 QByteArray sigStart = infoOrig->metaMethod()->methodSignature();
388 QByteArray sigStart = infoOrig->metaMethod()->methodSignature();
389 #else
389 #else
390 QByteArray sigStart = infoOrig->metaMethod()->signature();
390 QByteArray sigStart = infoOrig->metaMethod()->signature();
391 #endif
391 #endif
392 if (sigStart.startsWith("static_")) {
392 if (sigStart.startsWith("static_")) {
393 sigStart.remove(0,7);
393 sigStart.remove(0,7);
394 int offset = findCharOffset(sigStart, '_');
394 int offset = findCharOffset(sigStart, '_');
395 sigStart.remove(0,offset+1);
395 sigStart.remove(0,offset+1);
396 }
396 }
397 int offset = findCharOffset(sigStart, '(');
397 int offset = findCharOffset(sigStart, '(');
398 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
398 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
399 //make a copy, otherwise we will have trouble on overloads!
399 //make a copy, otherwise we will have trouble on overloads!
400 PythonQtSlotInfo* info = new PythonQtSlotInfo(*infoOrig);
400 PythonQtSlotInfo* info = new PythonQtSlotInfo(*infoOrig);
401 info->setUpcastingOffset(upcastingOffset);
401 info->setUpcastingOffset(upcastingOffset);
402 found = true;
402 found = true;
403 if (tail) {
403 if (tail) {
404 tail->setNextInfo(info);
404 tail->setNextInfo(info);
405 } else {
405 } else {
406 PythonQtMemberInfo newInfo(info);
406 PythonQtMemberInfo newInfo(info);
407 memberCache.insert(memberName, newInfo);
407 memberCache.insert(memberName, newInfo);
408 }
408 }
409 tail = info;
409 tail = info;
410 }
410 }
411 }
411 }
412 return tail;
412 return tail;
413 }
413 }
414
414
415 void PythonQtClassInfo::listDecoratorSlotsFromDecoratorProvider(QStringList& list, bool metaOnly) {
415 void PythonQtClassInfo::listDecoratorSlotsFromDecoratorProvider(QStringList& list, bool metaOnly) {
416 QObject* decoratorProvider = decorator();
416 QObject* decoratorProvider = decorator();
417 if (decoratorProvider) {
417 if (decoratorProvider) {
418 const QMetaObject* meta = decoratorProvider->metaObject();
418 const QMetaObject* meta = decoratorProvider->metaObject();
419 int numMethods = meta->methodCount();
419 int numMethods = meta->methodCount();
420 int startFrom = QObject::staticMetaObject.methodCount();
420 int startFrom = QObject::staticMetaObject.methodCount();
421 for (int i = startFrom; i < numMethods; i++) {
421 for (int i = startFrom; i < numMethods; i++) {
422 QMetaMethod m = meta->method(i);
422 QMetaMethod m = meta->method(i);
423 if ((m.methodType() == QMetaMethod::Method ||
423 if ((m.methodType() == QMetaMethod::Method ||
424 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
424 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
425
425
426 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
426 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
427 QByteArray sigStart = m.methodSignature();
427 QByteArray sigStart = m.methodSignature();
428 #else
428 #else
429 QByteArray sigStart = m.signature();
429 QByteArray sigStart = m.signature();
430 #endif
430 #endif
431 bool isClassDeco = false;
431 bool isClassDeco = false;
432 if (sigStart.startsWith("static_")) {
432 if (sigStart.startsWith("static_")) {
433 // skip the static_classname_ part of the string
433 // skip the static_classname_ part of the string
434 sigStart.remove(0,7+strlen(className())+1);
434 sigStart.remove(0,7+strlen(className())+1);
435 isClassDeco = true;
435 isClassDeco = true;
436 } else if (sigStart.startsWith("new_")) {
436 } else if (sigStart.startsWith("new_")) {
437 continue;
437 continue;
438 } else if (sigStart.startsWith("delete_")) {
438 } else if (sigStart.startsWith("delete_")) {
439 continue;
439 continue;
440 } else if (sigStart.startsWith("py_")) {
440 } else if (sigStart.startsWith("py_")) {
441 // hide everything that starts with py_
441 // hide everything that starts with py_
442 continue;
442 continue;
443 }
443 }
444 // find the first '('
444 // find the first '('
445 int offset = findCharOffset(sigStart, '(');
445 int offset = findCharOffset(sigStart, '(');
446
446
447 // XXX no checking is currently done if the slots have correct first argument or not...
447 // XXX no checking is currently done if the slots have correct first argument or not...
448 if (!metaOnly || isClassDeco) {
448 if (!metaOnly || isClassDeco) {
449 list << QString::fromLatin1(sigStart, offset);
449 list << QString::fromLatin1(sigStart, offset);
450 }
450 }
451 }
451 }
452 }
452 }
453 }
453 }
454
454
455 // look for global decorator slots
455 // look for global decorator slots
456 QListIterator<PythonQtSlotInfo*> it(_decoratorSlots);
456 QListIterator<PythonQtSlotInfo*> it(_decoratorSlots);
457 while (it.hasNext()) {
457 while (it.hasNext()) {
458 PythonQtSlotInfo* slot = it.next();
458 PythonQtSlotInfo* slot = it.next();
459 if (metaOnly) {
459 if (metaOnly) {
460 if (slot->isClassDecorator()) {
460 if (slot->isClassDecorator()) {
461 QByteArray first = slot->slotName();
461 QByteArray first = slot->slotName();
462 if (first.startsWith("static_")) {
462 if (first.startsWith("static_")) {
463 int idx = first.indexOf('_');
463 int idx = first.indexOf('_');
464 idx = first.indexOf('_', idx+1);
464 idx = first.indexOf('_', idx+1);
465 first = first.mid(idx+1);
465 first = first.mid(idx+1);
466 }
466 }
467 list << first;
467 list << first;
468 }
468 }
469 } else {
469 } else {
470 list << slot->slotName();
470 list << slot->slotName();
471 }
471 }
472 }
472 }
473 }
473 }
474
474
475 QStringList PythonQtClassInfo::propertyList()
475 QStringList PythonQtClassInfo::propertyList()
476 {
476 {
477 QStringList l;
477 QStringList l;
478 if (_isQObject && _meta) {
478 if (_isQObject && _meta) {
479 int i;
479 int i;
480 int numProperties = _meta->propertyCount();
480 int numProperties = _meta->propertyCount();
481 for (i = 0; i < numProperties; i++) {
481 for (i = 0; i < numProperties; i++) {
482 QMetaProperty p = _meta->property(i);
482 QMetaProperty p = _meta->property(i);
483 l << QString(p.name());
483 l << QString(p.name());
484 }
484 }
485 }
485 }
486 return l;
486 return l;
487 }
487 }
488
488
489 QStringList PythonQtClassInfo::memberList()
489 QStringList PythonQtClassInfo::memberList()
490 {
490 {
491 decorator();
491 decorator();
492
492
493 QStringList l;
493 QStringList l;
494 QString h;
494 QString h;
495 // normal slots of QObject (or wrapper QObject)
495 // normal slots of QObject (or wrapper QObject)
496 if (_meta) {
496 if (_meta) {
497 int numMethods = _meta->methodCount();
497 int numMethods = _meta->methodCount();
498 bool skipQObj = !_isQObject;
498 bool skipQObj = !_isQObject;
499 for (int i = skipQObj?QObject::staticMetaObject.methodCount():0; i < numMethods; i++) {
499 for (int i = skipQObj?QObject::staticMetaObject.methodCount():0; i < numMethods; i++) {
500 QMetaMethod m = _meta->method(i);
500 QMetaMethod m = _meta->method(i);
501 if (((m.methodType() == QMetaMethod::Method ||
501 if (((m.methodType() == QMetaMethod::Method ||
502 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public)
502 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public)
503 || m.methodType()==QMetaMethod::Signal) {
503 || m.methodType()==QMetaMethod::Signal) {
504 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
504 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
505 QByteArray signa(m.methodSignature());
505 QByteArray signa(m.methodSignature());
506 #else
506 #else
507 QByteArray signa(m.signature());
507 QByteArray signa(m.signature());
508 #endif
508 #endif
509 signa = signa.left(signa.indexOf('('));
509 signa = signa.left(signa.indexOf('('));
510 l << signa;
510 l << signa;
511 }
511 }
512 }
512 }
513 }
513 }
514
514
515 {
515 {
516 // look for dynamic decorators in this class and in derived classes
516 // look for dynamic decorators in this class and in derived classes
517 QList<PythonQtClassInfo*> infos;
517 QList<PythonQtClassInfo*> infos;
518 recursiveCollectClassInfos(infos);
518 recursiveCollectClassInfos(infos);
519 Q_FOREACH(PythonQtClassInfo* info, infos) {
519 Q_FOREACH(PythonQtClassInfo* info, infos) {
520 info->listDecoratorSlotsFromDecoratorProvider(l, false);
520 info->listDecoratorSlotsFromDecoratorProvider(l, false);
521 }
521 }
522 }
522 }
523
523
524 // List enumerator keys...
524 // List enumerator keys...
525 QList<const QMetaObject*> enumMetaObjects;
525 QList<const QMetaObject*> enumMetaObjects;
526 if (_meta) {
526 if (_meta) {
527 enumMetaObjects << _meta;
527 enumMetaObjects << _meta;
528 }
528 }
529 // check enums in the class hierachy of CPP classes
529 // check enums in the class hierachy of CPP classes
530 QList<QObject*> decoObjects;
530 QList<QObject*> decoObjects;
531 recursiveCollectDecoratorObjects(decoObjects);
531 recursiveCollectDecoratorObjects(decoObjects);
532 Q_FOREACH(QObject* deco, decoObjects) {
532 Q_FOREACH(QObject* deco, decoObjects) {
533 enumMetaObjects << deco->metaObject();
533 enumMetaObjects << deco->metaObject();
534 }
534 }
535
535
536 Q_FOREACH(const QMetaObject* meta, enumMetaObjects) {
536 Q_FOREACH(const QMetaObject* meta, enumMetaObjects) {
537 for (int i = 0; i<meta->enumeratorCount(); i++) {
537 for (int i = 0; i<meta->enumeratorCount(); i++) {
538 QMetaEnum e = meta->enumerator(i);
538 QMetaEnum e = meta->enumerator(i);
539 l << e.name();
539 l << e.name();
540 // we do not want flags, they will cause our values to appear two times
540 // we do not want flags, they will cause our values to appear two times
541 if (e.isFlag()) continue;
541 if (e.isFlag()) continue;
542
542
543 for (int j=0; j < e.keyCount(); j++) {
543 for (int j=0; j < e.keyCount(); j++) {
544 l << QString(e.key(j));
544 l << QString(e.key(j));
545 }
545 }
546 }
546 }
547 }
547 }
548
548
549 return QSet<QString>::fromList(l).toList();
549 return QSet<QString>::fromList(l).toList();
550 }
550 }
551
551
552 const char* PythonQtClassInfo::className()
552 const char* PythonQtClassInfo::className()
553 {
553 {
554 return _wrappedClassName.constData();
554 return _wrappedClassName.constData();
555 }
555 }
556
556
557 void* PythonQtClassInfo::castTo(void* ptr, const char* classname)
557 void* PythonQtClassInfo::castTo(void* ptr, const char* classname)
558 {
558 {
559 if (ptr==NULL) {
559 if (ptr==NULL) {
560 return NULL;
560 return NULL;
561 }
561 }
562 if (_wrappedClassName == classname) {
562 if (_wrappedClassName == classname) {
563 return ptr;
563 return ptr;
564 }
564 }
565 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
565 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
566 void* result = info._parent->castTo((char*)ptr + info._upcastingOffset, classname);
566 void* result = info._parent->castTo((char*)ptr + info._upcastingOffset, classname);
567 if (result) {
567 if (result) {
568 return result;
568 return result;
569 }
569 }
570 }
570 }
571 return NULL;
571 return NULL;
572 }
572 }
573
573
574 bool PythonQtClassInfo::inherits(const char* name)
574 bool PythonQtClassInfo::inherits(const char* name)
575 {
575 {
576 if (_wrappedClassName == name) {
576 if (_wrappedClassName == name) {
577 return true;
577 return true;
578 }
578 }
579 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
579 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
580 if (info._parent->inherits(name)) {
580 if (info._parent->inherits(name)) {
581 return true;
581 return true;
582 }
582 }
583 }
583 }
584 return false;
584 return false;
585 }
585 }
586
586
587 bool PythonQtClassInfo::inherits(PythonQtClassInfo* classInfo)
587 bool PythonQtClassInfo::inherits(PythonQtClassInfo* classInfo)
588 {
588 {
589 if (classInfo == this) {
589 if (classInfo == this) {
590 return true;
590 return true;
591 }
591 }
592 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
592 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
593 if (info._parent->inherits(classInfo)) {
593 if (info._parent->inherits(classInfo)) {
594 return true;
594 return true;
595 }
595 }
596 }
596 }
597 return false;
597 return false;
598 }
598 }
599
599
600 QString PythonQtClassInfo::help()
600 QString PythonQtClassInfo::help()
601 {
601 {
602 decorator();
602 decorator();
603 QString h;
603 QString h;
604 h += QString("--- ") + QString(className()) + QString(" ---\n");
604 h += QString("--- ") + QString(className()) + QString(" ---\n");
605
606 if (!_doc.isNull())
607 h += "Description:\n" + _doc + "\n";
605
608
606 if (_isQObject) {
609 if (_isQObject) {
607 h += "Properties:\n";
610 h += "Properties:\n";
608
611
609 int i;
612 int i;
610 int numProperties = _meta->propertyCount();
613 int numProperties = _meta->propertyCount();
611 for (i = 0; i < numProperties; i++) {
614 for (i = 0; i < numProperties; i++) {
612 QMetaProperty p = _meta->property(i);
615 QMetaProperty p = _meta->property(i);
613 h += QString(p.name()) + " (" + QString(p.typeName()) + " )\n";
616 h += QString(p.name()) + " (" + QString(p.typeName()) + " )\n";
614 }
617 }
615 }
618 }
616
619
617 if (constructors()) {
620 if (constructors()) {
618 h += "Constructors:\n";
621 h += "Constructors:\n";
619 PythonQtSlotInfo* constr = constructors();
622 PythonQtSlotInfo* constr = constructors();
620 while (constr) {
623 while (constr) {
621 h += constr->fullSignature() + "\n";
624 h += constr->fullSignature() + "\n";
622 constr = constr->nextInfo();
625 constr = constr->nextInfo();
623 }
626 }
624 }
627 }
625
628
626 h += "Slots:\n";
629 h += "Slots:\n";
627 h += "QString help()\n";
630 h += "QString help()\n";
628 h += "QString className()\n";
631 h += "QString className()\n";
629
632
630 if (_meta) {
633 if (_meta) {
631 int numMethods = _meta->methodCount();
634 int numMethods = _meta->methodCount();
632 for (int i = 0; i < numMethods; i++) {
635 for (int i = 0; i < numMethods; i++) {
633 QMetaMethod m = _meta->method(i);
636 QMetaMethod m = _meta->method(i);
634 if ((m.methodType() == QMetaMethod::Method ||
637 if ((m.methodType() == QMetaMethod::Method ||
635 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
638 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
636 PythonQtSlotInfo slot(this, m, i);
639 PythonQtSlotInfo slot(this, m, i);
637 h += slot.fullSignature()+ "\n";
640 h += slot.fullSignature()+ "\n";
638 }
641 }
639 }
642 }
640 }
643 }
641
644
642 // TODO xxx : decorators and enums from decorator() are missing...
645 // TODO xxx : decorators and enums from decorator() are missing...
643 // maybe we can reuse memberlist()?
646 // maybe we can reuse memberlist()?
644
647
645 if (_meta && _meta->enumeratorCount()) {
648 if (_meta && _meta->enumeratorCount()) {
646 h += "Enums:\n";
649 h += "Enums:\n";
647 for (int i = 0; i<_meta->enumeratorCount(); i++) {
650 for (int i = 0; i<_meta->enumeratorCount(); i++) {
648 QMetaEnum e = _meta->enumerator(i);
651 QMetaEnum e = _meta->enumerator(i);
649 h += QString(e.name()) + " {";
652 h += QString(e.name()) + " {";
650 for (int j=0; j < e.keyCount(); j++) {
653 for (int j=0; j < e.keyCount(); j++) {
651 if (j) { h+= ", "; }
654 if (j) { h+= ", "; }
652 h += e.key(j);
655 h += e.key(j);
653 }
656 }
654 h += " }\n";
657 h += " }\n";
655 }
658 }
656 }
659 }
657
660
658 if (_isQObject && _meta) {
661 if (_isQObject && _meta) {
659 int numMethods = _meta->methodCount();
662 int numMethods = _meta->methodCount();
660 if (numMethods>0) {
663 if (numMethods>0) {
661 h += "Signals:\n";
664 h += "Signals:\n";
662 for (int i = 0; i < numMethods; i++) {
665 for (int i = 0; i < numMethods; i++) {
663 QMetaMethod m = _meta->method(i);
666 QMetaMethod m = _meta->method(i);
664 if (m.methodType() == QMetaMethod::Signal) {
667 if (m.methodType() == QMetaMethod::Signal) {
665 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
668 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
666 h += QString(m.methodSignature()) + "\n";
669 h += QString(m.methodSignature()) + "\n";
667 #else
670 #else
668 h += QString(m.signature()) + "\n";
671 h += QString(m.signature()) + "\n";
669 #endif
672 #endif
670 }
673 }
671 }
674 }
672 }
675 }
673 }
676 }
674 return h;
677 return h;
675 }
678 }
676
679
677 PythonQtSlotInfo* PythonQtClassInfo::constructors()
680 PythonQtSlotInfo* PythonQtClassInfo::constructors()
678 {
681 {
679 if (!_constructors) {
682 if (!_constructors) {
680 // force creation of lazy decorator, which will register the decorators
683 // force creation of lazy decorator, which will register the decorators
681 decorator();
684 decorator();
682 }
685 }
683 return _constructors;
686 return _constructors;
684 }
687 }
685
688
686 PythonQtSlotInfo* PythonQtClassInfo::destructor()
689 PythonQtSlotInfo* PythonQtClassInfo::destructor()
687 {
690 {
688 if (!_destructor) {
691 if (!_destructor) {
689 // force creation of lazy decorator, which will register the decorators
692 // force creation of lazy decorator, which will register the decorators
690 decorator();
693 decorator();
691 }
694 }
692 return _destructor;
695 return _destructor;
693 }
696 }
694
697
695 void PythonQtClassInfo::addConstructor(PythonQtSlotInfo* info)
698 void PythonQtClassInfo::addConstructor(PythonQtSlotInfo* info)
696 {
699 {
697 PythonQtSlotInfo* prev = constructors();
700 PythonQtSlotInfo* prev = constructors();
698 if (prev) {
701 if (prev) {
699 info->setNextInfo(prev->nextInfo());
702 info->setNextInfo(prev->nextInfo());
700 prev->setNextInfo(info);
703 prev->setNextInfo(info);
701 } else {
704 } else {
702 _constructors = info;
705 _constructors = info;
703 }
706 }
704 }
707 }
705
708
706 void PythonQtClassInfo::addDecoratorSlot(PythonQtSlotInfo* info)
709 void PythonQtClassInfo::addDecoratorSlot(PythonQtSlotInfo* info)
707 {
710 {
708 _decoratorSlots.append(info);
711 _decoratorSlots.append(info);
709 }
712 }
710
713
711 void PythonQtClassInfo::setDestructor(PythonQtSlotInfo* info)
714 void PythonQtClassInfo::setDestructor(PythonQtSlotInfo* info)
712 {
715 {
713 if (_destructor) {
716 if (_destructor) {
714 _destructor->deleteOverloadsAndThis();
717 _destructor->deleteOverloadsAndThis();
715 }
718 }
716 _destructor = info;
719 _destructor = info;
717 }
720 }
718
721
719 void PythonQtClassInfo::setMetaObject(const QMetaObject* meta)
722 void PythonQtClassInfo::setMetaObject(const QMetaObject* meta)
720 {
723 {
721 _meta = meta;
724 _meta = meta;
722 clearCachedMembers();
725 clearCachedMembers();
723 }
726 }
724
727
725 QObject* PythonQtClassInfo::decorator()
728 QObject* PythonQtClassInfo::decorator()
726 {
729 {
727 if (!_decoratorProvider && _decoratorProviderCB) {
730 if (!_decoratorProvider && _decoratorProviderCB) {
728 _decoratorProvider = (*_decoratorProviderCB)();
731 _decoratorProvider = (*_decoratorProviderCB)();
729 if (_decoratorProvider) {
732 if (_decoratorProvider) {
730 _decoratorProvider->setParent(PythonQt::priv());
733 _decoratorProvider->setParent(PythonQt::priv());
731 // setup enums early, since they might be needed by the constructor decorators:
734 // setup enums early, since they might be needed by the constructor decorators:
732 if (!_enumsCreated) {
735 if (!_enumsCreated) {
733 createEnumWrappers();
736 createEnumWrappers();
734 }
737 }
735 PythonQt::priv()->addDecorators(_decoratorProvider, PythonQtPrivate::ConstructorDecorator | PythonQtPrivate::DestructorDecorator);
738 PythonQt::priv()->addDecorators(_decoratorProvider, PythonQtPrivate::ConstructorDecorator | PythonQtPrivate::DestructorDecorator);
736 }
739 }
737 }
740 }
738 // check if enums need to be created and create them if they are not yet created
741 // check if enums need to be created and create them if they are not yet created
739 if (!_enumsCreated) {
742 if (!_enumsCreated) {
740 createEnumWrappers();
743 createEnumWrappers();
741 }
744 }
742 return _decoratorProvider;
745 return _decoratorProvider;
743 }
746 }
744
747
745 void* PythonQtClassInfo::recursiveCastDownIfPossible(void* ptr, const char** resultClassName)
748 void* PythonQtClassInfo::recursiveCastDownIfPossible(void* ptr, const char** resultClassName)
746 {
749 {
747 if (!_polymorphicHandlers.isEmpty()) {
750 if (!_polymorphicHandlers.isEmpty()) {
748 Q_FOREACH(PythonQtPolymorphicHandlerCB* cb, _polymorphicHandlers) {
751 Q_FOREACH(PythonQtPolymorphicHandlerCB* cb, _polymorphicHandlers) {
749 void* resultPtr = (*cb)(ptr, resultClassName);
752 void* resultPtr = (*cb)(ptr, resultClassName);
750 if (resultPtr) {
753 if (resultPtr) {
751 return resultPtr;
754 return resultPtr;
752 }
755 }
753 }
756 }
754 }
757 }
755 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
758 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
756 if (!info._parent->isQObject()) {
759 if (!info._parent->isQObject()) {
757 void* resultPtr = info._parent->recursiveCastDownIfPossible((char*)ptr + info._upcastingOffset, resultClassName);
760 void* resultPtr = info._parent->recursiveCastDownIfPossible((char*)ptr + info._upcastingOffset, resultClassName);
758 if (resultPtr) {
761 if (resultPtr) {
759 return resultPtr;
762 return resultPtr;
760 }
763 }
761 }
764 }
762 }
765 }
763 return NULL;
766 return NULL;
764 }
767 }
765
768
766 void* PythonQtClassInfo::castDownIfPossible(void* ptr, PythonQtClassInfo** resultClassInfo)
769 void* PythonQtClassInfo::castDownIfPossible(void* ptr, PythonQtClassInfo** resultClassInfo)
767 {
770 {
768 const char* className;
771 const char* className;
769 // this would do downcasting recursively...
772 // this would do downcasting recursively...
770 // void* resultPtr = recursiveCastDownIfPossible(ptr, &className);
773 // void* resultPtr = recursiveCastDownIfPossible(ptr, &className);
771
774
772 // we only do downcasting on the base object, not on the whole inheritance tree...
775 // we only do downcasting on the base object, not on the whole inheritance tree...
773 void* resultPtr = NULL;
776 void* resultPtr = NULL;
774 if (!_polymorphicHandlers.isEmpty()) {
777 if (!_polymorphicHandlers.isEmpty()) {
775 Q_FOREACH(PythonQtPolymorphicHandlerCB* cb, _polymorphicHandlers) {
778 Q_FOREACH(PythonQtPolymorphicHandlerCB* cb, _polymorphicHandlers) {
776 resultPtr = (*cb)(ptr, &className);
779 resultPtr = (*cb)(ptr, &className);
777 if (resultPtr) {
780 if (resultPtr) {
778 break;
781 break;
779 }
782 }
780 }
783 }
781 }
784 }
782 if (resultPtr) {
785 if (resultPtr) {
783 *resultClassInfo = PythonQt::priv()->getClassInfo(className);
786 *resultClassInfo = PythonQt::priv()->getClassInfo(className);
784 } else {
787 } else {
785 *resultClassInfo = this;
788 *resultClassInfo = this;
786 resultPtr = ptr;
789 resultPtr = ptr;
787 }
790 }
788 return resultPtr;
791 return resultPtr;
789 }
792 }
790
793
791 PyObject* PythonQtClassInfo::findEnumWrapper(const QByteArray& name, PythonQtClassInfo* localScope, bool* isLocalEnum)
794 PyObject* PythonQtClassInfo::findEnumWrapper(const QByteArray& name, PythonQtClassInfo* localScope, bool* isLocalEnum)
792 {
795 {
793 if (isLocalEnum) {
796 if (isLocalEnum) {
794 *isLocalEnum = true;
797 *isLocalEnum = true;
795 }
798 }
796 int scopePos = name.lastIndexOf("::");
799 int scopePos = name.lastIndexOf("::");
797 if (scopePos != -1) {
800 if (scopePos != -1) {
798 if (isLocalEnum) {
801 if (isLocalEnum) {
799 *isLocalEnum = false;
802 *isLocalEnum = false;
800 }
803 }
801 // split into scope and enum name
804 // split into scope and enum name
802 QByteArray enumScope = name.mid(0,scopePos);
805 QByteArray enumScope = name.mid(0,scopePos);
803 QByteArray enumName = name.mid(scopePos+2);
806 QByteArray enumName = name.mid(scopePos+2);
804 PythonQtClassInfo* info = PythonQt::priv()->getClassInfo(enumScope);
807 PythonQtClassInfo* info = PythonQt::priv()->getClassInfo(enumScope);
805 if (info) {
808 if (info) {
806 return info->findEnumWrapper(enumName);
809 return info->findEnumWrapper(enumName);
807 } else{
810 } else{
808 return NULL;
811 return NULL;
809 }
812 }
810 }
813 }
811 if (localScope) {
814 if (localScope) {
812 return localScope->findEnumWrapper(name);
815 return localScope->findEnumWrapper(name);
813 } else {
816 } else {
814 return NULL;
817 return NULL;
815 }
818 }
816 }
819 }
817
820
818 void PythonQtClassInfo::createEnumWrappers(const QMetaObject* meta)
821 void PythonQtClassInfo::createEnumWrappers(const QMetaObject* meta)
819 {
822 {
820 for (int i = meta->enumeratorOffset();i<meta->enumeratorCount();i++) {
823 for (int i = meta->enumeratorOffset();i<meta->enumeratorCount();i++) {
821 QMetaEnum e = meta->enumerator(i);
824 QMetaEnum e = meta->enumerator(i);
822 PythonQtObjectPtr p;
825 PythonQtObjectPtr p;
823 p.setNewRef(PythonQtPrivate::createNewPythonQtEnumWrapper(e.name(), _pythonQtClassWrapper));
826 p.setNewRef(PythonQtPrivate::createNewPythonQtEnumWrapper(e.name(), _pythonQtClassWrapper));
824 _enumWrappers.append(p);
827 _enumWrappers.append(p);
825 }
828 }
826 }
829 }
827
830
828 void PythonQtClassInfo::createEnumWrappers()
831 void PythonQtClassInfo::createEnumWrappers()
829 {
832 {
830 if (!_enumsCreated) {
833 if (!_enumsCreated) {
831 _enumsCreated = true;
834 _enumsCreated = true;
832 if (_meta) {
835 if (_meta) {
833 createEnumWrappers(_meta);
836 createEnumWrappers(_meta);
834 }
837 }
835 if (decorator()) {
838 if (decorator()) {
836 createEnumWrappers(decorator()->metaObject());
839 createEnumWrappers(decorator()->metaObject());
837 }
840 }
838 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
841 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
839 info._parent->createEnumWrappers();
842 info._parent->createEnumWrappers();
840 }
843 }
841 }
844 }
842 }
845 }
843
846
844 PyObject* PythonQtClassInfo::findEnumWrapper(const char* name) {
847 PyObject* PythonQtClassInfo::findEnumWrapper(const char* name) {
845 // force enum creation
848 // force enum creation
846 if (!_enumsCreated) {
849 if (!_enumsCreated) {
847 createEnumWrappers();
850 createEnumWrappers();
848 }
851 }
849 Q_FOREACH(const PythonQtObjectPtr& p, _enumWrappers) {
852 Q_FOREACH(const PythonQtObjectPtr& p, _enumWrappers) {
850 const char* className = ((PyTypeObject*)p.object())->tp_name;
853 const char* className = ((PyTypeObject*)p.object())->tp_name;
851 if (qstrcmp(className, name)==0) {
854 if (qstrcmp(className, name)==0) {
852 return p.object();
855 return p.object();
853 }
856 }
854 }
857 }
855 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
858 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
856 PyObject* p = info._parent->findEnumWrapper(name);
859 PyObject* p = info._parent->findEnumWrapper(name);
857 if (p) return p;
860 if (p) return p;
858 }
861 }
859 return NULL;
862 return NULL;
860 }
863 }
861
864
862 void PythonQtClassInfo::setDecoratorProvider( PythonQtQObjectCreatorFunctionCB* cb )
865 void PythonQtClassInfo::setDecoratorProvider( PythonQtQObjectCreatorFunctionCB* cb )
863 {
866 {
864 _decoratorProviderCB = cb;
867 _decoratorProviderCB = cb;
865 _decoratorProvider = NULL;
868 _decoratorProvider = NULL;
866 _enumsCreated = false;
869 _enumsCreated = false;
867 }
870 }
868
871
869 void PythonQtClassInfo::clearNotFoundCachedMembers()
872 void PythonQtClassInfo::clearNotFoundCachedMembers()
870 {
873 {
871 // remove all not found entries, since a new decorator means new slots,
874 // remove all not found entries, since a new decorator means new slots,
872 // which might have been cached as "NotFound" already.
875 // which might have been cached as "NotFound" already.
873 QMutableHashIterator<QByteArray, PythonQtMemberInfo> it(_cachedMembers);
876 QMutableHashIterator<QByteArray, PythonQtMemberInfo> it(_cachedMembers);
874 while (it.hasNext()) {
877 while (it.hasNext()) {
875 it.next();
878 it.next();
876 if (it.value()._type == PythonQtMemberInfo::NotFound) {
879 if (it.value()._type == PythonQtMemberInfo::NotFound) {
877 it.remove();
880 it.remove();
878 }
881 }
879 }
882 }
880 }
883 }
881
884
882 //-------------------------------------------------------------------------
885 //-------------------------------------------------------------------------
883
886
884 PythonQtMemberInfo::PythonQtMemberInfo( PythonQtSlotInfo* info )
887 PythonQtMemberInfo::PythonQtMemberInfo( PythonQtSlotInfo* info )
885 {
888 {
886 if (info->metaMethod()->methodType() == QMetaMethod::Signal) {
889 if (info->metaMethod()->methodType() == QMetaMethod::Signal) {
887 _type = Signal;
890 _type = Signal;
888 } else {
891 } else {
889 _type = Slot;
892 _type = Slot;
890 }
893 }
891 _slot = info;
894 _slot = info;
892 _enumValue = NULL;
895 _enumValue = NULL;
893 }
896 }
894
897
895 PythonQtMemberInfo::PythonQtMemberInfo( const PythonQtObjectPtr& enumValue )
898 PythonQtMemberInfo::PythonQtMemberInfo( const PythonQtObjectPtr& enumValue )
896 {
899 {
897 _type = EnumValue;
900 _type = EnumValue;
898 _slot = NULL;
901 _slot = NULL;
899 _enumValue = enumValue;
902 _enumValue = enumValue;
900 _enumWrapper = NULL;
903 _enumWrapper = NULL;
901 }
904 }
902
905
903 PythonQtMemberInfo::PythonQtMemberInfo( const QMetaProperty& prop )
906 PythonQtMemberInfo::PythonQtMemberInfo( const QMetaProperty& prop )
904 {
907 {
905 _type = Property;
908 _type = Property;
906 _slot = NULL;
909 _slot = NULL;
907 _enumValue = NULL;
910 _enumValue = NULL;
908 _property = prop;
911 _property = prop;
909 _enumWrapper = NULL;
912 _enumWrapper = NULL;
910 }
913 }
@@ -1,247 +1,255
1 #ifndef _PYTHONQTCLASSINFO_H
1 #ifndef _PYTHONQTCLASSINFO_H
2 #define _PYTHONQTCLASSINFO_H
2 #define _PYTHONQTCLASSINFO_H
3
3
4 /*
4 /*
5 *
5 *
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 *
7 *
8 * This library is free software; you can redistribute it and/or
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
11 * version 2.1 of the License, or (at your option) any later version.
12 *
12 *
13 * This library is distributed in the hope that it will be useful,
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
16 * Lesser General Public License for more details.
17 *
17 *
18 * Further, this software is distributed without any warranty that it is
18 * Further, this software is distributed without any warranty that it is
19 * free of the rightful claim of any third person regarding infringement
19 * free of the rightful claim of any third person regarding infringement
20 * or the like. Any license provided herein, whether implied or
20 * or the like. Any license provided herein, whether implied or
21 * otherwise, applies only to this software file. Patent licenses, if
21 * otherwise, applies only to this software file. Patent licenses, if
22 * any, provided herein do not apply to combinations of this program with
22 * any, provided herein do not apply to combinations of this program with
23 * other software, or any other product whatsoever.
23 * other software, or any other product whatsoever.
24 *
24 *
25 * You should have received a copy of the GNU Lesser General Public
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 *
28 *
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 * 28359 Bremen, Germany or:
30 * 28359 Bremen, Germany or:
31 *
31 *
32 * http://www.mevis.de
32 * http://www.mevis.de
33 *
33 *
34 */
34 */
35
35
36 #include <QMetaObject>
36 #include <QMetaObject>
37 #include <QMetaMethod>
37 #include <QMetaMethod>
38 #include <QHash>
38 #include <QHash>
39 #include <QByteArray>
39 #include <QByteArray>
40 #include <QList>
40 #include <QList>
41 #include "PythonQt.h"
41 #include "PythonQt.h"
42
42
43 class PythonQtSlotInfo;
43 class PythonQtSlotInfo;
44
44
45 struct PythonQtMemberInfo {
45 struct PythonQtMemberInfo {
46 enum Type {
46 enum Type {
47 Invalid, Slot, Signal, EnumValue, EnumWrapper, Property, NotFound
47 Invalid, Slot, Signal, EnumValue, EnumWrapper, Property, NotFound
48 };
48 };
49
49
50 PythonQtMemberInfo():_type(Invalid),_slot(NULL),_enumWrapper(NULL),_enumValue(0) { }
50 PythonQtMemberInfo():_type(Invalid),_slot(NULL),_enumWrapper(NULL),_enumValue(0) { }
51
51
52 PythonQtMemberInfo(PythonQtSlotInfo* info);
52 PythonQtMemberInfo(PythonQtSlotInfo* info);
53
53
54 PythonQtMemberInfo(const PythonQtObjectPtr& enumValue);
54 PythonQtMemberInfo(const PythonQtObjectPtr& enumValue);
55
55
56 PythonQtMemberInfo(const QMetaProperty& prop);
56 PythonQtMemberInfo(const QMetaProperty& prop);
57
57
58 Type _type;
58 Type _type;
59
59
60 // TODO: this could be a union...
60 // TODO: this could be a union...
61 PythonQtSlotInfo* _slot;
61 PythonQtSlotInfo* _slot;
62 PyObject* _enumWrapper;
62 PyObject* _enumWrapper;
63 PythonQtObjectPtr _enumValue;
63 PythonQtObjectPtr _enumValue;
64 QMetaProperty _property;
64 QMetaProperty _property;
65 };
65 };
66
66
67 //! a class that stores all required information about a Qt object (and an optional associated C++ class name)
67 //! a class that stores all required information about a Qt object (and an optional associated C++ class name)
68 /*! for fast lookup of slots when calling the object from Python
68 /*! for fast lookup of slots when calling the object from Python
69 */
69 */
70 class PYTHONQT_EXPORT PythonQtClassInfo {
70 class PYTHONQT_EXPORT PythonQtClassInfo {
71
71
72 public:
72 public:
73 PythonQtClassInfo();
73 PythonQtClassInfo();
74 ~PythonQtClassInfo();
74 ~PythonQtClassInfo();
75
75
76 //! store information about parent classes
76 //! store information about parent classes
77 struct ParentClassInfo {
77 struct ParentClassInfo {
78 ParentClassInfo(PythonQtClassInfo* parent, int upcastingOffset=0):_parent(parent),_upcastingOffset(upcastingOffset)
78 ParentClassInfo(PythonQtClassInfo* parent, int upcastingOffset=0):_parent(parent),_upcastingOffset(upcastingOffset)
79 {};
79 {};
80
80
81 PythonQtClassInfo* _parent;
81 PythonQtClassInfo* _parent;
82 int _upcastingOffset;
82 int _upcastingOffset;
83 };
83 };
84
84
85
85
86 //! setup as a QObject, taking the meta object as meta information about the QObject
86 //! setup as a QObject, taking the meta object as meta information about the QObject
87 void setupQObject(const QMetaObject* meta);
87 void setupQObject(const QMetaObject* meta);
88
88
89 //! setup as a CPP (non-QObject), taking the classname
89 //! setup as a CPP (non-QObject), taking the classname
90 void setupCPPObject(const QByteArray& classname);
90 void setupCPPObject(const QByteArray& classname);
91
91
92 //! set the type capabilities
92 //! set the type capabilities
93 void setTypeSlots(int typeSlots) { _typeSlots = typeSlots; }
93 void setTypeSlots(int typeSlots) { _typeSlots = typeSlots; }
94 //! get the type capabilities
94 //! get the type capabilities
95 int typeSlots() const { return _typeSlots; }
95 int typeSlots() const { return _typeSlots; }
96
96
97 //! get the Python method definition for a given slot name (without return type and signature)
97 //! get the Python method definition for a given slot name (without return type and signature)
98 PythonQtMemberInfo member(const char* member);
98 PythonQtMemberInfo member(const char* member);
99
99
100 //! get access to the constructor slot (which may be overloaded if there are multiple constructors)
100 //! get access to the constructor slot (which may be overloaded if there are multiple constructors)
101 PythonQtSlotInfo* constructors();
101 PythonQtSlotInfo* constructors();
102
102
103 //! get access to the destructor slot
103 //! get access to the destructor slot
104 PythonQtSlotInfo* destructor();
104 PythonQtSlotInfo* destructor();
105
105
106 //! add a constructor, ownership is passed to classinfo
106 //! add a constructor, ownership is passed to classinfo
107 void addConstructor(PythonQtSlotInfo* info);
107 void addConstructor(PythonQtSlotInfo* info);
108
108
109 //! set a destructor, ownership is passed to classinfo
109 //! set a destructor, ownership is passed to classinfo
110 void setDestructor(PythonQtSlotInfo* info);
110 void setDestructor(PythonQtSlotInfo* info);
111
111
112 //! add a decorator slot, ownership is passed to classinfo
112 //! add a decorator slot, ownership is passed to classinfo
113 void addDecoratorSlot(PythonQtSlotInfo* info);
113 void addDecoratorSlot(PythonQtSlotInfo* info);
114
114
115 //! get the classname (either of the QObject or of the wrapped CPP object)
115 //! get the classname (either of the QObject or of the wrapped CPP object)
116 const char* className();
116 const char* className();
117
117
118 //! returns if the QObject
118 //! returns if the QObject
119 bool isQObject() { return _isQObject; }
119 bool isQObject() { return _isQObject; }
120
120
121 //! returns if the class is a CPP wrapper
121 //! returns if the class is a CPP wrapper
122 bool isCPPWrapper() { return !_isQObject; }
122 bool isCPPWrapper() { return !_isQObject; }
123
123
124 //! get the meta object
124 //! get the meta object
125 const QMetaObject* metaObject() { return _meta; }
125 const QMetaObject* metaObject() { return _meta; }
126
126
127 //! set the meta object, this will reset the caching
127 //! set the meta object, this will reset the caching
128 void setMetaObject(const QMetaObject* meta);
128 void setMetaObject(const QMetaObject* meta);
129
129
130 //! returns if this class inherits from the given classname
130 //! returns if this class inherits from the given classname
131 bool inherits(const char* classname);
131 bool inherits(const char* classname);
132
132
133 //! returns if this class inherits from the given classinfo
133 //! returns if this class inherits from the given classinfo
134 bool inherits(PythonQtClassInfo* info);
134 bool inherits(PythonQtClassInfo* info);
135
135
136 //! casts the given \c ptr to an object of type \c classname, returns the new pointer
136 //! casts the given \c ptr to an object of type \c classname, returns the new pointer
137 //! which might be different to \c ptr due to C++ multiple inheritance
137 //! which might be different to \c ptr due to C++ multiple inheritance
138 //! (if the cast is not possible or if ptr is NULL, NULL is returned)
138 //! (if the cast is not possible or if ptr is NULL, NULL is returned)
139 void* castTo(void* ptr, const char* classname);
139 void* castTo(void* ptr, const char* classname);
140
140
141 //! get help string for the metaobject
141 //! get help string for the metaobject
142 QString help();
142 QString help();
143
143
144 //! get list of all properties (on QObjects only, otherwise the list is empty)
144 //! get list of all properties (on QObjects only, otherwise the list is empty)
145 QStringList propertyList();
145 QStringList propertyList();
146
146
147 //! get list of all members (excluding properties, which can be listed with propertyList())
147 //! get list of all members (excluding properties, which can be listed with propertyList())
148 QStringList memberList();
148 QStringList memberList();
149
149
150 //! get the meta type id of this class (only valid for isCPPWrapper() == true)
150 //! get the meta type id of this class (only valid for isCPPWrapper() == true)
151 int metaTypeId() { return _metaTypeId; }
151 int metaTypeId() { return _metaTypeId; }
152
152
153 //! set an additional decorator provider that offers additional decorator slots for this class
153 //! set an additional decorator provider that offers additional decorator slots for this class
154 void setDecoratorProvider(PythonQtQObjectCreatorFunctionCB* cb);
154 void setDecoratorProvider(PythonQtQObjectCreatorFunctionCB* cb);
155
155
156 //! get the decorator qobject instance
156 //! get the decorator qobject instance
157 QObject* decorator();
157 QObject* decorator();
158
158
159 //! add the parent class info of a CPP object
159 //! add the parent class info of a CPP object
160 void addParentClass(const ParentClassInfo& info) { _parentClasses.append(info); }
160 void addParentClass(const ParentClassInfo& info) { _parentClasses.append(info); }
161
161
162 //! set the associated PythonQtClassWrapper (which handles instance creation of this type)
162 //! set the associated PythonQtClassWrapper (which handles instance creation of this type)
163 void setPythonQtClassWrapper(PyObject* obj) { _pythonQtClassWrapper = obj; }
163 void setPythonQtClassWrapper(PyObject* obj) { _pythonQtClassWrapper = obj; }
164
164
165 //! get the associated PythonQtClassWrapper (which handles instance creation of this type)
165 //! get the associated PythonQtClassWrapper (which handles instance creation of this type)
166 PyObject* pythonQtClassWrapper() { return _pythonQtClassWrapper; }
166 PyObject* pythonQtClassWrapper() { return _pythonQtClassWrapper; }
167
167
168 //! set the shell set instance wrapper cb
168 //! set the shell set instance wrapper cb
169 void setShellSetInstanceWrapperCB(PythonQtShellSetInstanceWrapperCB* cb) {
169 void setShellSetInstanceWrapperCB(PythonQtShellSetInstanceWrapperCB* cb) {
170 _shellSetInstanceWrapperCB = cb;
170 _shellSetInstanceWrapperCB = cb;
171 }
171 }
172
172
173 //! get the shell set instance wrapper cb
173 //! get the shell set instance wrapper cb
174 PythonQtShellSetInstanceWrapperCB* shellSetInstanceWrapperCB() {
174 PythonQtShellSetInstanceWrapperCB* shellSetInstanceWrapperCB() {
175 return _shellSetInstanceWrapperCB;
175 return _shellSetInstanceWrapperCB;
176 }
176 }
177
177
178 //! add a handler for polymorphic downcasting
178 //! add a handler for polymorphic downcasting
179 void addPolymorphicHandler(PythonQtPolymorphicHandlerCB* cb) { _polymorphicHandlers.append(cb); }
179 void addPolymorphicHandler(PythonQtPolymorphicHandlerCB* cb) { _polymorphicHandlers.append(cb); }
180
180
181 //! cast the pointer down in the class hierarchy if a polymorphic handler allows to do that
181 //! cast the pointer down in the class hierarchy if a polymorphic handler allows to do that
182 void* castDownIfPossible(void* ptr, PythonQtClassInfo** resultClassInfo);
182 void* castDownIfPossible(void* ptr, PythonQtClassInfo** resultClassInfo);
183
183
184 //! returns if the localScope has an enum of that type name or if the enum contains a :: scope, if that class contails the enum
184 //! returns if the localScope has an enum of that type name or if the enum contains a :: scope, if that class contails the enum
185 static PyObject* findEnumWrapper(const QByteArray& name, PythonQtClassInfo* localScope, bool* isLocalEnum = NULL);
185 static PyObject* findEnumWrapper(const QByteArray& name, PythonQtClassInfo* localScope, bool* isLocalEnum = NULL);
186
186
187 //! clear all members that where cached as "NotFound"
187 //! clear all members that where cached as "NotFound"
188 void clearNotFoundCachedMembers();
188 void clearNotFoundCachedMembers();
189
189
190 //! set the python docstring (__doc__) for this class
191 void setDoc(const QString& str) {_doc=str;}
192
193 //! get the python docstring (__doc__) for this class
194 const QString& doc() const {return _doc;}
195
190 private:
196 private:
191 void createEnumWrappers();
197 void createEnumWrappers();
192 void createEnumWrappers(const QMetaObject* meta);
198 void createEnumWrappers(const QMetaObject* meta);
193 PyObject* findEnumWrapper(const char* name);
199 PyObject* findEnumWrapper(const char* name);
194
200
195 //! clear all cached members
201 //! clear all cached members
196 void clearCachedMembers();
202 void clearCachedMembers();
197
203
198 void* recursiveCastDownIfPossible(void* ptr, const char** resultClassName);
204 void* recursiveCastDownIfPossible(void* ptr, const char** resultClassName);
199
205
200 PythonQtSlotInfo* findDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
206 PythonQtSlotInfo* findDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
201 void listDecoratorSlotsFromDecoratorProvider(QStringList& list, bool metaOnly);
207 void listDecoratorSlotsFromDecoratorProvider(QStringList& list, bool metaOnly);
202 PythonQtSlotInfo* recursiveFindDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
208 PythonQtSlotInfo* recursiveFindDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
203
209
204 void recursiveCollectClassInfos(QList<PythonQtClassInfo*>& classInfoObjects);
210 void recursiveCollectClassInfos(QList<PythonQtClassInfo*>& classInfoObjects);
205 void recursiveCollectDecoratorObjects(QList<QObject*>& decoratorObjects);
211 void recursiveCollectDecoratorObjects(QList<QObject*>& decoratorObjects);
206
212
207 bool lookForPropertyAndCache(const char* memberName);
213 bool lookForPropertyAndCache(const char* memberName);
208 bool lookForMethodAndCache(const char* memberName);
214 bool lookForMethodAndCache(const char* memberName);
209 bool lookForEnumAndCache(const QMetaObject* m, const char* memberName);
215 bool lookForEnumAndCache(const QMetaObject* m, const char* memberName);
210
216
211 PythonQtSlotInfo* findDecoratorSlots(const char* memberName, int memberNameLen, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
217 PythonQtSlotInfo* findDecoratorSlots(const char* memberName, int memberNameLen, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
212 int findCharOffset(const char* sigStart, char someChar);
218 int findCharOffset(const char* sigStart, char someChar);
213
219
214 QHash<QByteArray, PythonQtMemberInfo> _cachedMembers;
220 QHash<QByteArray, PythonQtMemberInfo> _cachedMembers;
215
221
216 PythonQtSlotInfo* _constructors;
222 PythonQtSlotInfo* _constructors;
217 PythonQtSlotInfo* _destructor;
223 PythonQtSlotInfo* _destructor;
218 QList<PythonQtSlotInfo*> _decoratorSlots;
224 QList<PythonQtSlotInfo*> _decoratorSlots;
219
225
220 QList<PythonQtObjectPtr> _enumWrappers;
226 QList<PythonQtObjectPtr> _enumWrappers;
221
227
222 const QMetaObject* _meta;
228 const QMetaObject* _meta;
223
229
224 QByteArray _wrappedClassName;
230 QByteArray _wrappedClassName;
225 QList<ParentClassInfo> _parentClasses;
231 QList<ParentClassInfo> _parentClasses;
226
232
227 QList<PythonQtPolymorphicHandlerCB*> _polymorphicHandlers;
233 QList<PythonQtPolymorphicHandlerCB*> _polymorphicHandlers;
228
234
229 QObject* _decoratorProvider;
235 QObject* _decoratorProvider;
230 PythonQtQObjectCreatorFunctionCB* _decoratorProviderCB;
236 PythonQtQObjectCreatorFunctionCB* _decoratorProviderCB;
231
237
232 PyObject* _pythonQtClassWrapper;
238 PyObject* _pythonQtClassWrapper;
233
239
234 PythonQtShellSetInstanceWrapperCB* _shellSetInstanceWrapperCB;
240 PythonQtShellSetInstanceWrapperCB* _shellSetInstanceWrapperCB;
235
241
236 int _metaTypeId;
242 int _metaTypeId;
237 int _typeSlots;
243 int _typeSlots;
238
244
239 bool _isQObject;
245 bool _isQObject;
240 bool _enumsCreated;
246 bool _enumsCreated;
247
248 QString _doc;
241
249
242 };
250 };
243
251
244 //---------------------------------------------------------------
252 //---------------------------------------------------------------
245
253
246
254
247 #endif
255 #endif
@@ -1,504 +1,504
1 /*
1 /*
2 *
2 *
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 *
4 *
5 * This library is free software; you can redistribute it and/or
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
8 * version 2.1 of the License, or (at your option) any later version.
9 *
9 *
10 * This library is distributed in the hope that it will be useful,
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
13 * Lesser General Public License for more details.
14 *
14 *
15 * Further, this software is distributed without any warranty that it is
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
20 * other software, or any other product whatsoever.
21 *
21 *
22 * You should have received a copy of the GNU Lesser General Public
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
25 *
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 * 28359 Bremen, Germany or:
27 * 28359 Bremen, Germany or:
28 *
28 *
29 * http://www.mevis.de
29 * http://www.mevis.de
30 *
30 *
31 */
31 */
32
32
33 //----------------------------------------------------------------------------------
33 //----------------------------------------------------------------------------------
34 /*!
34 /*!
35 // \file PythonQtClassWrapper.cpp
35 // \file PythonQtClassWrapper.cpp
36 // \author Florian Link
36 // \author Florian Link
37 // \author Last changed by $Author: florian $
37 // \author Last changed by $Author: florian $
38 // \date 2006-05
38 // \date 2006-05
39 */
39 */
40 //----------------------------------------------------------------------------------
40 //----------------------------------------------------------------------------------
41
41
42 #include "PythonQtClassWrapper.h"
42 #include "PythonQtClassWrapper.h"
43 #include <QObject>
43 #include <QObject>
44
44
45 #include "PythonQt.h"
45 #include "PythonQt.h"
46 #include "PythonQtSlot.h"
46 #include "PythonQtSlot.h"
47 #include "PythonQtSignal.h"
47 #include "PythonQtSignal.h"
48 #include "PythonQtClassInfo.h"
48 #include "PythonQtClassInfo.h"
49 #include "PythonQtConversion.h"
49 #include "PythonQtConversion.h"
50 #include "PythonQtInstanceWrapper.h"
50 #include "PythonQtInstanceWrapper.h"
51
51
52 static PyObject* PythonQtInstanceWrapper_invert(PythonQtInstanceWrapper* wrapper)
52 static PyObject* PythonQtInstanceWrapper_invert(PythonQtInstanceWrapper* wrapper)
53 {
53 {
54 PyObject* result = NULL;
54 PyObject* result = NULL;
55 static QByteArray memberName = "__invert__";
55 static QByteArray memberName = "__invert__";
56 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
56 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
57 if (opSlot._type == PythonQtMemberInfo::Slot) {
57 if (opSlot._type == PythonQtMemberInfo::Slot) {
58 result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, NULL, NULL, wrapper->_wrappedPtr);
58 result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, NULL, NULL, wrapper->_wrappedPtr);
59 }
59 }
60 return result;
60 return result;
61 }
61 }
62
62
63 static int PythonQtInstanceWrapper_nonzero(PythonQtInstanceWrapper* wrapper)
63 static int PythonQtInstanceWrapper_nonzero(PythonQtInstanceWrapper* wrapper)
64 {
64 {
65 int result = (wrapper->_wrappedPtr == NULL && wrapper->_obj == NULL)?0:1;
65 int result = (wrapper->_wrappedPtr == NULL && wrapper->_obj == NULL)?0:1;
66 if (result) {
66 if (result) {
67 static QByteArray memberName = "__nonzero__";
67 static QByteArray memberName = "__nonzero__";
68 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
68 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
69 if (opSlot._type == PythonQtMemberInfo::Slot) {
69 if (opSlot._type == PythonQtMemberInfo::Slot) {
70 PyObject* resultObj = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, NULL, NULL, wrapper->_wrappedPtr);
70 PyObject* resultObj = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, NULL, NULL, wrapper->_wrappedPtr);
71 if (resultObj == Py_False) {
71 if (resultObj == Py_False) {
72 result = 0;
72 result = 0;
73 }
73 }
74 Py_XDECREF(resultObj);
74 Py_XDECREF(resultObj);
75 }
75 }
76 }
76 }
77 return result;
77 return result;
78 }
78 }
79
79
80
80
81 static PyObject* PythonQtInstanceWrapper_binaryfunc(PyObject* self, PyObject* other, const QByteArray& opName, const QByteArray& fallbackOpName = QByteArray())
81 static PyObject* PythonQtInstanceWrapper_binaryfunc(PyObject* self, PyObject* other, const QByteArray& opName, const QByteArray& fallbackOpName = QByteArray())
82 {
82 {
83 // since we disabled type checking, we can receive any object as self, but we currently only support
83 // since we disabled type checking, we can receive any object as self, but we currently only support
84 // different objects on the right. Otherwise we would need to generate __radd__ etc. methods.
84 // different objects on the right. Otherwise we would need to generate __radd__ etc. methods.
85 if (!PyObject_TypeCheck(self, &PythonQtInstanceWrapper_Type)) {
85 if (!PyObject_TypeCheck(self, &PythonQtInstanceWrapper_Type)) {
86 QString error = "Unsupported operation " + opName + "(" + self->ob_type->tp_name + ", " + other->ob_type->tp_name + ")";
86 QString error = "Unsupported operation " + opName + "(" + self->ob_type->tp_name + ", " + other->ob_type->tp_name + ")";
87 PyErr_SetString(PyExc_ArithmeticError, error.toLatin1().data());
87 PyErr_SetString(PyExc_ArithmeticError, error.toLatin1().data());
88 return NULL;
88 return NULL;
89 }
89 }
90 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)self;
90 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)self;
91 PyObject* result = NULL;
91 PyObject* result = NULL;
92 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(opName);
92 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(opName);
93 if (opSlot._type == PythonQtMemberInfo::Slot) {
93 if (opSlot._type == PythonQtMemberInfo::Slot) {
94 // TODO get rid of tuple
94 // TODO get rid of tuple
95 PyObject* args = PyTuple_New(1);
95 PyObject* args = PyTuple_New(1);
96 Py_INCREF(other);
96 Py_INCREF(other);
97 PyTuple_SET_ITEM(args, 0, other);
97 PyTuple_SET_ITEM(args, 0, other);
98 result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, args, NULL, wrapper->_wrappedPtr);
98 result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, args, NULL, wrapper->_wrappedPtr);
99 Py_DECREF(args);
99 Py_DECREF(args);
100 if (!result && !fallbackOpName.isEmpty()) {
100 if (!result && !fallbackOpName.isEmpty()) {
101 // try fallback if we did not get a result
101 // try fallback if we did not get a result
102 result = PythonQtInstanceWrapper_binaryfunc(self, other, fallbackOpName);
102 result = PythonQtInstanceWrapper_binaryfunc(self, other, fallbackOpName);
103 }
103 }
104 }
104 }
105 return result;
105 return result;
106 }
106 }
107
107
108 #define BINARY_OP(NAME) \
108 #define BINARY_OP(NAME) \
109 static PyObject* PythonQtInstanceWrapper_ ## NAME(PyObject* self, PyObject* other) \
109 static PyObject* PythonQtInstanceWrapper_ ## NAME(PyObject* self, PyObject* other) \
110 { \
110 { \
111 static const QByteArray opName("__" #NAME "__"); \
111 static const QByteArray opName("__" #NAME "__"); \
112 return PythonQtInstanceWrapper_binaryfunc(self, other, opName); \
112 return PythonQtInstanceWrapper_binaryfunc(self, other, opName); \
113 }
113 }
114
114
115 #define BINARY_OP_INPLACE(NAME) \
115 #define BINARY_OP_INPLACE(NAME) \
116 static PyObject* PythonQtInstanceWrapper_i ## NAME(PyObject* self, PyObject* other) \
116 static PyObject* PythonQtInstanceWrapper_i ## NAME(PyObject* self, PyObject* other) \
117 { \
117 { \
118 static const QByteArray opName("__i" #NAME "__"); \
118 static const QByteArray opName("__i" #NAME "__"); \
119 static const QByteArray fallbackName("__" #NAME "__"); \
119 static const QByteArray fallbackName("__" #NAME "__"); \
120 return PythonQtInstanceWrapper_binaryfunc(self, other, opName, fallbackName); \
120 return PythonQtInstanceWrapper_binaryfunc(self, other, opName, fallbackName); \
121 }
121 }
122
122
123 BINARY_OP(add)
123 BINARY_OP(add)
124 BINARY_OP(sub)
124 BINARY_OP(sub)
125 BINARY_OP(mul)
125 BINARY_OP(mul)
126 BINARY_OP(div)
126 BINARY_OP(div)
127 BINARY_OP(and)
127 BINARY_OP(and)
128 BINARY_OP(or)
128 BINARY_OP(or)
129 BINARY_OP(xor)
129 BINARY_OP(xor)
130 BINARY_OP(mod)
130 BINARY_OP(mod)
131 BINARY_OP(lshift)
131 BINARY_OP(lshift)
132 BINARY_OP(rshift)
132 BINARY_OP(rshift)
133
133
134 BINARY_OP_INPLACE(add)
134 BINARY_OP_INPLACE(add)
135 BINARY_OP_INPLACE(sub)
135 BINARY_OP_INPLACE(sub)
136 BINARY_OP_INPLACE(mul)
136 BINARY_OP_INPLACE(mul)
137 BINARY_OP_INPLACE(div)
137 BINARY_OP_INPLACE(div)
138 BINARY_OP_INPLACE(and)
138 BINARY_OP_INPLACE(and)
139 BINARY_OP_INPLACE(or)
139 BINARY_OP_INPLACE(or)
140 BINARY_OP_INPLACE(xor)
140 BINARY_OP_INPLACE(xor)
141 BINARY_OP_INPLACE(mod)
141 BINARY_OP_INPLACE(mod)
142 BINARY_OP_INPLACE(lshift)
142 BINARY_OP_INPLACE(lshift)
143 BINARY_OP_INPLACE(rshift)
143 BINARY_OP_INPLACE(rshift)
144
144
145 static void initializeSlots(PythonQtClassWrapper* wrap)
145 static void initializeSlots(PythonQtClassWrapper* wrap)
146 {
146 {
147 int typeSlots = wrap->classInfo()->typeSlots();
147 int typeSlots = wrap->classInfo()->typeSlots();
148 if (typeSlots) {
148 if (typeSlots) {
149 if (typeSlots & PythonQt::Type_Add) {
149 if (typeSlots & PythonQt::Type_Add) {
150 wrap->_base.as_number.nb_add = (binaryfunc)PythonQtInstanceWrapper_add;
150 wrap->_base.as_number.nb_add = (binaryfunc)PythonQtInstanceWrapper_add;
151 }
151 }
152 if (typeSlots & PythonQt::Type_Subtract) {
152 if (typeSlots & PythonQt::Type_Subtract) {
153 wrap->_base.as_number.nb_subtract = (binaryfunc)PythonQtInstanceWrapper_sub;
153 wrap->_base.as_number.nb_subtract = (binaryfunc)PythonQtInstanceWrapper_sub;
154 }
154 }
155 if (typeSlots & PythonQt::Type_Multiply) {
155 if (typeSlots & PythonQt::Type_Multiply) {
156 wrap->_base.as_number.nb_multiply = (binaryfunc)PythonQtInstanceWrapper_mul;
156 wrap->_base.as_number.nb_multiply = (binaryfunc)PythonQtInstanceWrapper_mul;
157 }
157 }
158 if (typeSlots & PythonQt::Type_Divide) {
158 if (typeSlots & PythonQt::Type_Divide) {
159 #ifndef PY3K
159 #ifndef PY3K
160 wrap->_base.as_number.nb_divide = (binaryfunc)PythonQtInstanceWrapper_div;
160 wrap->_base.as_number.nb_divide = (binaryfunc)PythonQtInstanceWrapper_div;
161 #endif
161 #endif
162 wrap->_base.as_number.nb_true_divide = (binaryfunc)PythonQtInstanceWrapper_div;
162 wrap->_base.as_number.nb_true_divide = (binaryfunc)PythonQtInstanceWrapper_div;
163 }
163 }
164 if (typeSlots & PythonQt::Type_And) {
164 if (typeSlots & PythonQt::Type_And) {
165 wrap->_base.as_number.nb_and = (binaryfunc)PythonQtInstanceWrapper_and;
165 wrap->_base.as_number.nb_and = (binaryfunc)PythonQtInstanceWrapper_and;
166 }
166 }
167 if (typeSlots & PythonQt::Type_Or) {
167 if (typeSlots & PythonQt::Type_Or) {
168 wrap->_base.as_number.nb_or = (binaryfunc)PythonQtInstanceWrapper_or;
168 wrap->_base.as_number.nb_or = (binaryfunc)PythonQtInstanceWrapper_or;
169 }
169 }
170 if (typeSlots & PythonQt::Type_Xor) {
170 if (typeSlots & PythonQt::Type_Xor) {
171 wrap->_base.as_number.nb_xor = (binaryfunc)PythonQtInstanceWrapper_xor;
171 wrap->_base.as_number.nb_xor = (binaryfunc)PythonQtInstanceWrapper_xor;
172 }
172 }
173 if (typeSlots & PythonQt::Type_Mod) {
173 if (typeSlots & PythonQt::Type_Mod) {
174 wrap->_base.as_number.nb_remainder = (binaryfunc)PythonQtInstanceWrapper_mod;
174 wrap->_base.as_number.nb_remainder = (binaryfunc)PythonQtInstanceWrapper_mod;
175 }
175 }
176 if (typeSlots & PythonQt::Type_LShift) {
176 if (typeSlots & PythonQt::Type_LShift) {
177 wrap->_base.as_number.nb_lshift = (binaryfunc)PythonQtInstanceWrapper_lshift;
177 wrap->_base.as_number.nb_lshift = (binaryfunc)PythonQtInstanceWrapper_lshift;
178 }
178 }
179 if (typeSlots & PythonQt::Type_RShift) {
179 if (typeSlots & PythonQt::Type_RShift) {
180 wrap->_base.as_number.nb_rshift = (binaryfunc)PythonQtInstanceWrapper_rshift;
180 wrap->_base.as_number.nb_rshift = (binaryfunc)PythonQtInstanceWrapper_rshift;
181 }
181 }
182
182
183 if (typeSlots & PythonQt::Type_InplaceAdd) {
183 if (typeSlots & PythonQt::Type_InplaceAdd) {
184 wrap->_base.as_number.nb_add = (binaryfunc)PythonQtInstanceWrapper_iadd;
184 wrap->_base.as_number.nb_inplace_add = (binaryfunc)PythonQtInstanceWrapper_iadd;
185 }
185 }
186 if (typeSlots & PythonQt::Type_InplaceSubtract) {
186 if (typeSlots & PythonQt::Type_InplaceSubtract) {
187 wrap->_base.as_number.nb_subtract = (binaryfunc)PythonQtInstanceWrapper_isub;
187 wrap->_base.as_number.nb_inplace_subtract = (binaryfunc)PythonQtInstanceWrapper_isub;
188 }
188 }
189 if (typeSlots & PythonQt::Type_InplaceMultiply) {
189 if (typeSlots & PythonQt::Type_InplaceMultiply) {
190 wrap->_base.as_number.nb_multiply = (binaryfunc)PythonQtInstanceWrapper_imul;
190 wrap->_base.as_number.nb_inplace_multiply = (binaryfunc)PythonQtInstanceWrapper_imul;
191 }
191 }
192 if (typeSlots & PythonQt::Type_InplaceDivide) {
192 if (typeSlots & PythonQt::Type_InplaceDivide) {
193 #ifndef PY3K
193 #ifndef PY3K
194 wrap->_base.as_number.nb_inplace_divide = (binaryfunc)PythonQtInstanceWrapper_idiv;
194 wrap->_base.as_number.nb_inplace_divide = (binaryfunc)PythonQtInstanceWrapper_idiv;
195 #endif
195 #endif
196 wrap->_base.as_number.nb_inplace_true_divide = (binaryfunc)PythonQtInstanceWrapper_idiv;
196 wrap->_base.as_number.nb_inplace_true_divide = (binaryfunc)PythonQtInstanceWrapper_idiv;
197 }
197 }
198 if (typeSlots & PythonQt::Type_InplaceAnd) {
198 if (typeSlots & PythonQt::Type_InplaceAnd) {
199 wrap->_base.as_number.nb_inplace_and = (binaryfunc)PythonQtInstanceWrapper_iand;
199 wrap->_base.as_number.nb_inplace_and = (binaryfunc)PythonQtInstanceWrapper_iand;
200 }
200 }
201 if (typeSlots & PythonQt::Type_InplaceOr) {
201 if (typeSlots & PythonQt::Type_InplaceOr) {
202 wrap->_base.as_number.nb_inplace_or = (binaryfunc)PythonQtInstanceWrapper_ior;
202 wrap->_base.as_number.nb_inplace_or = (binaryfunc)PythonQtInstanceWrapper_ior;
203 }
203 }
204 if (typeSlots & PythonQt::Type_InplaceXor) {
204 if (typeSlots & PythonQt::Type_InplaceXor) {
205 wrap->_base.as_number.nb_inplace_xor = (binaryfunc)PythonQtInstanceWrapper_ixor;
205 wrap->_base.as_number.nb_inplace_xor = (binaryfunc)PythonQtInstanceWrapper_ixor;
206 }
206 }
207 if (typeSlots & PythonQt::Type_InplaceMod) {
207 if (typeSlots & PythonQt::Type_InplaceMod) {
208 wrap->_base.as_number.nb_inplace_remainder = (binaryfunc)PythonQtInstanceWrapper_imod;
208 wrap->_base.as_number.nb_inplace_remainder = (binaryfunc)PythonQtInstanceWrapper_imod;
209 }
209 }
210 if (typeSlots & PythonQt::Type_InplaceLShift) {
210 if (typeSlots & PythonQt::Type_InplaceLShift) {
211 wrap->_base.as_number.nb_inplace_lshift = (binaryfunc)PythonQtInstanceWrapper_ilshift;
211 wrap->_base.as_number.nb_inplace_lshift = (binaryfunc)PythonQtInstanceWrapper_ilshift;
212 }
212 }
213 if (typeSlots & PythonQt::Type_InplaceRShift) {
213 if (typeSlots & PythonQt::Type_InplaceRShift) {
214 wrap->_base.as_number.nb_inplace_rshift = (binaryfunc)PythonQtInstanceWrapper_irshift;
214 wrap->_base.as_number.nb_inplace_rshift = (binaryfunc)PythonQtInstanceWrapper_irshift;
215 }
215 }
216 if (typeSlots & PythonQt::Type_Invert) {
216 if (typeSlots & PythonQt::Type_Invert) {
217 wrap->_base.as_number.nb_invert = (unaryfunc)PythonQtInstanceWrapper_invert;
217 wrap->_base.as_number.nb_invert = (unaryfunc)PythonQtInstanceWrapper_invert;
218 }
218 }
219 if (typeSlots & PythonQt::Type_NonZero) {
219 if (typeSlots & PythonQt::Type_NonZero) {
220 #ifdef PY3K
220 #ifdef PY3K
221 wrap->_base.as_number.nb_bool = (inquiry)PythonQtInstanceWrapper_nonzero;
221 wrap->_base.as_number.nb_bool = (inquiry)PythonQtInstanceWrapper_nonzero;
222 #else
222 #else
223 wrap->_base.as_number.nb_nonzero = (inquiry)PythonQtInstanceWrapper_nonzero;
223 wrap->_base.as_number.nb_nonzero = (inquiry)PythonQtInstanceWrapper_nonzero;
224 #endif
224 #endif
225 }
225 }
226 }
226 }
227 }
227 }
228
228
229 static PyObject* PythonQtClassWrapper_alloc(PyTypeObject *self, Py_ssize_t nitems)
229 static PyObject* PythonQtClassWrapper_alloc(PyTypeObject *self, Py_ssize_t nitems)
230 {
230 {
231 // call the default type alloc
231 // call the default type alloc
232 PyObject* obj = PyType_Type.tp_alloc(self, nitems);
232 PyObject* obj = PyType_Type.tp_alloc(self, nitems);
233
233
234 // take current class type, if we are called via newPythonQtClassWrapper()
234 // take current class type, if we are called via newPythonQtClassWrapper()
235 PythonQtClassWrapper* wrap = (PythonQtClassWrapper*)obj;
235 PythonQtClassWrapper* wrap = (PythonQtClassWrapper*)obj;
236 wrap->_classInfo = PythonQt::priv()->currentClassInfoForClassWrapperCreation();
236 wrap->_classInfo = PythonQt::priv()->currentClassInfoForClassWrapperCreation();
237 if (wrap->_classInfo) {
237 if (wrap->_classInfo) {
238 initializeSlots(wrap);
238 initializeSlots(wrap);
239 }
239 }
240
240
241 return obj;
241 return obj;
242 }
242 }
243
243
244
244
245 static int PythonQtClassWrapper_init(PythonQtClassWrapper* self, PyObject* args, PyObject* kwds)
245 static int PythonQtClassWrapper_init(PythonQtClassWrapper* self, PyObject* args, PyObject* kwds)
246 {
246 {
247 // call the default type init
247 // call the default type init
248 if (PyType_Type.tp_init((PyObject *)self, args, kwds) < 0) {
248 if (PyType_Type.tp_init((PyObject *)self, args, kwds) < 0) {
249 return -1;
249 return -1;
250 }
250 }
251
251
252 // if we have no CPP class information, try our base class
252 // if we have no CPP class information, try our base class
253 if (!self->classInfo()) {
253 if (!self->classInfo()) {
254 PyTypeObject* superType = ((PyTypeObject *)self)->tp_base;
254 PyTypeObject* superType = ((PyTypeObject *)self)->tp_base;
255
255
256 // recursively search for PythonQtClassWrapper superclass,
256 // recursively search for PythonQtClassWrapper superclass,
257 // this is needed for multiple levels of inheritance in python,
257 // this is needed for multiple levels of inheritance in python,
258 // e.g.
258 // e.g.
259 // class MyWidgetBase(QWidget):
259 // class MyWidgetBase(QWidget):
260 // ...
260 // ...
261 // class MyWidget(MyWidgetBase):
261 // class MyWidget(MyWidgetBase):
262 // ...
262 // ...
263 while( superType && Py_TYPE(superType) != &PythonQtClassWrapper_Type )
263 while( superType && Py_TYPE(superType) != &PythonQtClassWrapper_Type )
264 superType = superType->tp_base;
264 superType = superType->tp_base;
265
265
266 if (!superType || (Py_TYPE(superType) != &PythonQtClassWrapper_Type)) {
266 if (!superType || (Py_TYPE(superType) != &PythonQtClassWrapper_Type)) {
267 PyErr_Format(PyExc_TypeError, "type %s is not derived from PythonQtClassWrapper", ((PyTypeObject*)self)->tp_name);
267 PyErr_Format(PyExc_TypeError, "type %s is not derived from PythonQtClassWrapper", ((PyTypeObject*)self)->tp_name);
268 return -1;
268 return -1;
269 }
269 }
270
270
271 // take the class info from the superType
271 // take the class info from the superType
272 self->_classInfo = ((PythonQtClassWrapper*)superType)->classInfo();
272 self->_classInfo = ((PythonQtClassWrapper*)superType)->classInfo();
273 }
273 }
274
274
275 return 0;
275 return 0;
276 }
276 }
277
277
278 static PyObject *PythonQtClassWrapper_classname(PythonQtClassWrapper* type)
278 static PyObject *PythonQtClassWrapper_classname(PythonQtClassWrapper* type)
279 {
279 {
280 #ifdef PY3K
280 #ifdef PY3K
281 return PyUnicode_FromString((QString("Class_") + type->classInfo()->className()).toLatin1().data());
281 return PyUnicode_FromString((QString("Class_") + type->classInfo()->className()).toLatin1().data());
282 #else
282 #else
283 return PyString_FromString((QString("Class_") + type->classInfo()->className()).toLatin1().data());
283 return PyString_FromString((QString("Class_") + type->classInfo()->className()).toLatin1().data());
284 #endif
284 #endif
285 }
285 }
286
286
287 static PyObject *PythonQtClassWrapper_help(PythonQtClassWrapper* type)
287 static PyObject *PythonQtClassWrapper_help(PythonQtClassWrapper* type)
288 {
288 {
289 return PythonQt::self()->helpCalled(type->classInfo());
289 return PythonQt::self()->helpCalled(type->classInfo());
290 }
290 }
291
291
292 PyObject *PythonQtClassWrapper_delete(PythonQtClassWrapper *type, PyObject *args)
292 PyObject *PythonQtClassWrapper_delete(PythonQtClassWrapper *type, PyObject *args)
293 {
293 {
294 Q_UNUSED(type);
294 Q_UNUSED(type);
295
295
296 Py_ssize_t argc = PyTuple_Size(args);
296 Py_ssize_t argc = PyTuple_Size(args);
297 if (argc>0) {
297 if (argc>0) {
298 PyObject* self = PyTuple_GET_ITEM(args, 0);
298 PyObject* self = PyTuple_GET_ITEM(args, 0);
299 if (PyObject_TypeCheck(self, &PythonQtInstanceWrapper_Type)) {
299 if (PyObject_TypeCheck(self, &PythonQtInstanceWrapper_Type)) {
300 return PythonQtInstanceWrapper_delete((PythonQtInstanceWrapper*)self);
300 return PythonQtInstanceWrapper_delete((PythonQtInstanceWrapper*)self);
301 }
301 }
302 }
302 }
303 return NULL;
303 return NULL;
304 }
304 }
305
305
306 PyObject *PythonQtClassWrapper_inherits(PythonQtClassWrapper *type, PyObject *args)
306 PyObject *PythonQtClassWrapper_inherits(PythonQtClassWrapper *type, PyObject *args)
307 {
307 {
308 Q_UNUSED(type);
308 Q_UNUSED(type);
309 PythonQtInstanceWrapper* wrapper = NULL;
309 PythonQtInstanceWrapper* wrapper = NULL;
310 char *name = NULL;
310 char *name = NULL;
311 if (!PyArg_ParseTuple(args, "O!s:PythonQtClassWrapper.inherits",&PythonQtInstanceWrapper_Type, &wrapper, &name)) {
311 if (!PyArg_ParseTuple(args, "O!s:PythonQtClassWrapper.inherits",&PythonQtInstanceWrapper_Type, &wrapper, &name)) {
312 return NULL;
312 return NULL;
313 }
313 }
314 return PythonQtConv::GetPyBool(wrapper->classInfo()->inherits(name));
314 return PythonQtConv::GetPyBool(wrapper->classInfo()->inherits(name));
315 }
315 }
316
316
317
317
318 static PyMethodDef PythonQtClassWrapper_methods[] = {
318 static PyMethodDef PythonQtClassWrapper_methods[] = {
319 {"className", (PyCFunction)PythonQtClassWrapper_classname, METH_NOARGS,
319 {"className", (PyCFunction)PythonQtClassWrapper_classname, METH_NOARGS,
320 "Return the classname of the object"
320 "Return the classname of the object"
321 },
321 },
322 {"inherits", (PyCFunction)PythonQtClassWrapper_inherits, METH_VARARGS,
322 {"inherits", (PyCFunction)PythonQtClassWrapper_inherits, METH_VARARGS,
323 "Returns if the class inherits or is of given type name"
323 "Returns if the class inherits or is of given type name"
324 },
324 },
325 {"help", (PyCFunction)PythonQtClassWrapper_help, METH_NOARGS,
325 {"help", (PyCFunction)PythonQtClassWrapper_help, METH_NOARGS,
326 "Shows the help of available methods for this class"
326 "Shows the help of available methods for this class"
327 },
327 },
328 {"delete", (PyCFunction)PythonQtClassWrapper_delete, METH_VARARGS,
328 {"delete", (PyCFunction)PythonQtClassWrapper_delete, METH_VARARGS,
329 "Deletes the given C++ object"
329 "Deletes the given C++ object"
330 },
330 },
331 {NULL, NULL, 0 , NULL} /* Sentinel */
331 {NULL, NULL, 0 , NULL} /* Sentinel */
332 };
332 };
333
333
334
334
335 static PyObject *PythonQtClassWrapper_getattro(PyObject *obj, PyObject *name)
335 static PyObject *PythonQtClassWrapper_getattro(PyObject *obj, PyObject *name)
336 {
336 {
337 const char *attributeName;
337 const char *attributeName;
338 PythonQtClassWrapper *wrapper = (PythonQtClassWrapper *)obj;
338 PythonQtClassWrapper *wrapper = (PythonQtClassWrapper *)obj;
339
339
340 #ifdef PY3K
340 #ifdef PY3K
341 if ((attributeName = PyUnicode_AsUTF8(name)) == NULL) {
341 if ((attributeName = PyUnicode_AsUTF8(name)) == NULL) {
342 #else
342 #else
343 if ((attributeName = PyString_AsString(name)) == NULL) {
343 if ((attributeName = PyString_AsString(name)) == NULL) {
344 #endif
344 #endif
345 return NULL;
345 return NULL;
346 }
346 }
347 if (obj == (PyObject*)&PythonQtInstanceWrapper_Type) {
347 if (obj == (PyObject*)&PythonQtInstanceWrapper_Type) {
348 return NULL;
348 return NULL;
349 }
349 }
350
350
351 if (qstrcmp(attributeName, "__dict__")==0) {
351 if (qstrcmp(attributeName, "__dict__")==0) {
352 PyObject* objectDict = ((PyTypeObject *)wrapper)->tp_dict;
352 PyObject* objectDict = ((PyTypeObject *)wrapper)->tp_dict;
353 if (!wrapper->classInfo()) {
353 if (!wrapper->classInfo()) {
354 Py_INCREF(objectDict);
354 Py_INCREF(objectDict);
355 return objectDict;
355 return objectDict;
356 }
356 }
357 PyObject* dict = PyDict_New();
357 PyObject* dict = PyDict_New();
358
358
359 QStringList l = wrapper->classInfo()->memberList();
359 QStringList l = wrapper->classInfo()->memberList();
360 Q_FOREACH (QString name, l) {
360 Q_FOREACH (QString name, l) {
361 PyObject* o = PyObject_GetAttrString(obj, name.toLatin1().data());
361 PyObject* o = PyObject_GetAttrString(obj, name.toLatin1().data());
362 if (o) {
362 if (o) {
363 PyDict_SetItemString(dict, name.toLatin1().data(), o);
363 PyDict_SetItemString(dict, name.toLatin1().data(), o);
364 Py_DECREF(o);
364 Py_DECREF(o);
365 } else {
365 } else {
366 // it must have been a property or child, which we do not know as a class object...
366 // it must have been a property or child, which we do not know as a class object...
367 PyErr_Clear();
367 PyErr_Clear();
368 }
368 }
369 }
369 }
370 if (wrapper->classInfo()->constructors()) {
370 if (wrapper->classInfo()->constructors()) {
371 #ifdef PY3K
371 #ifdef PY3K
372 PyObject* initName = PyUnicode_FromString("__init__");
372 PyObject* initName = PyUnicode_FromString("__init__");
373 #else
373 #else
374 PyObject* initName = PyString_FromString("__init__");
374 PyObject* initName = PyString_FromString("__init__");
375 #endif
375 #endif
376 PyObject* func = PyType_Type.tp_getattro(obj, initName);
376 PyObject* func = PyType_Type.tp_getattro(obj, initName);
377 Py_DECREF(initName);
377 Py_DECREF(initName);
378 PyDict_SetItemString(dict, "__init__", func);
378 PyDict_SetItemString(dict, "__init__", func);
379 Py_DECREF(func);
379 Py_DECREF(func);
380 }
380 }
381 for (int i = 0; PythonQtClassWrapper_methods[i].ml_name != NULL; i++) {
381 for (int i = 0; PythonQtClassWrapper_methods[i].ml_name != NULL; i++) {
382 PyObject* func = PyCFunction_New(&PythonQtClassWrapper_methods[i], obj);
382 PyObject* func = PyCFunction_New(&PythonQtClassWrapper_methods[i], obj);
383 PyDict_SetItemString(dict, PythonQtClassWrapper_methods[i].ml_name, func);
383 PyDict_SetItemString(dict, PythonQtClassWrapper_methods[i].ml_name, func);
384 Py_DECREF(func);
384 Py_DECREF(func);
385 }
385 }
386
386
387 PyDict_Update(dict, objectDict);
387 PyDict_Update(dict, objectDict);
388 return dict;
388 return dict;
389 }
389 }
390
390
391 // look in Python to support derived Python classes
391 // look in Python to support derived Python classes
392 PyObject* superAttr = PyType_Type.tp_getattro(obj, name);
392 PyObject* superAttr = PyType_Type.tp_getattro(obj, name);
393 if (superAttr) {
393 if (superAttr) {
394 return superAttr;
394 return superAttr;
395 }
395 }
396 PyErr_Clear();
396 PyErr_Clear();
397
397
398 if (wrapper->classInfo()) {
398 if (wrapper->classInfo()) {
399 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
399 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
400 if (member._type == PythonQtMemberInfo::EnumValue) {
400 if (member._type == PythonQtMemberInfo::EnumValue) {
401 PyObject* enumValue = member._enumValue;
401 PyObject* enumValue = member._enumValue;
402 Py_INCREF(enumValue);
402 Py_INCREF(enumValue);
403 return enumValue;
403 return enumValue;
404 } else if (member._type == PythonQtMemberInfo::EnumWrapper) {
404 } else if (member._type == PythonQtMemberInfo::EnumWrapper) {
405 PyObject* enumWrapper = member._enumWrapper;
405 PyObject* enumWrapper = member._enumWrapper;
406 Py_INCREF(enumWrapper);
406 Py_INCREF(enumWrapper);
407 return enumWrapper;
407 return enumWrapper;
408 } else if (member._type == PythonQtMemberInfo::Slot) {
408 } else if (member._type == PythonQtMemberInfo::Slot) {
409 // we return all slots, even the instance slots, since they are callable as unbound slots with self argument
409 // we return all slots, even the instance slots, since they are callable as unbound slots with self argument
410 return PythonQtSlotFunction_New(member._slot, obj, NULL);
410 return PythonQtSlotFunction_New(member._slot, obj, NULL);
411 } else if (member._type == PythonQtMemberInfo::Signal) {
411 } else if (member._type == PythonQtMemberInfo::Signal) {
412 // we return all signals, even the instance signals, since they are callable as unbound signals with self argument
412 // we return all signals, even the instance signals, since they are callable as unbound signals with self argument
413 return PythonQtSignalFunction_New(member._slot, obj, NULL);
413 return PythonQtSignalFunction_New(member._slot, obj, NULL);
414 }
414 }
415 }
415 }
416
416
417 // look for the internal methods (className(), help())
417 // look for the internal methods (className(), help())
418 #ifdef PY3K
418 #ifdef PY3K
419 PyObject* internalMethod = PyObject_GenericGetAttr(obj, name);
419 PyObject* internalMethod = PyObject_GenericGetAttr(obj, name);
420 #else
420 #else
421 PyObject* internalMethod = Py_FindMethod( PythonQtClassWrapper_methods, obj, (char*)attributeName);
421 PyObject* internalMethod = Py_FindMethod( PythonQtClassWrapper_methods, obj, (char*)attributeName);
422 #endif
422 #endif
423 if (internalMethod) {
423 if (internalMethod) {
424 return internalMethod;
424 return internalMethod;
425 }
425 }
426
426
427 QString error = QString(wrapper->classInfo()->className()) + " has no attribute named '" + QString(attributeName) + "'";
427 QString error = QString(wrapper->classInfo()->className()) + " has no attribute named '" + QString(attributeName) + "'";
428 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
428 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
429 return NULL;
429 return NULL;
430 }
430 }
431
431
432 static int PythonQtClassWrapper_setattro(PyObject *obj,PyObject *name,PyObject *value)
432 static int PythonQtClassWrapper_setattro(PyObject *obj,PyObject *name,PyObject *value)
433 {
433 {
434 return PyType_Type.tp_setattro(obj,name,value);
434 return PyType_Type.tp_setattro(obj,name,value);
435 }
435 }
436
436
437 /*
437 /*
438 static PyObject * PythonQtClassWrapper_repr(PyObject * obj)
438 static PyObject * PythonQtClassWrapper_repr(PyObject * obj)
439 {
439 {
440 PythonQtClassWrapper* wrapper = (PythonQtClassWrapper*)obj;
440 PythonQtClassWrapper* wrapper = (PythonQtClassWrapper*)obj;
441 if (wrapper->classInfo()->isCPPWrapper()) {
441 if (wrapper->classInfo()->isCPPWrapper()) {
442 const QMetaObject* meta = wrapper->classInfo()->metaObject();
442 const QMetaObject* meta = wrapper->classInfo()->metaObject();
443 if (!meta) {
443 if (!meta) {
444 QObject* decorator = wrapper->classInfo()->decorator();
444 QObject* decorator = wrapper->classInfo()->decorator();
445 if (decorator) {
445 if (decorator) {
446 meta = decorator->metaObject();
446 meta = decorator->metaObject();
447 }
447 }
448 }
448 }
449 if (meta) {
449 if (meta) {
450 return PyString_FromFormat("%s Class (C++ wrapped by %s)", wrapper->classInfo()->className(), meta->className());
450 return PyString_FromFormat("%s Class (C++ wrapped by %s)", wrapper->classInfo()->className(), meta->className());
451 } else {
451 } else {
452 return PyString_FromFormat("%s Class (C++ unwrapped)", wrapper->classInfo()->className());
452 return PyString_FromFormat("%s Class (C++ unwrapped)", wrapper->classInfo()->className());
453 }
453 }
454 } else {
454 } else {
455 return PyString_FromFormat("%s Class", wrapper->classInfo()->className());
455 return PyString_FromFormat("%s Class", wrapper->classInfo()->className());
456 }
456 }
457 }
457 }
458
458
459 */
459 */
460
460
461 PyTypeObject PythonQtClassWrapper_Type = {
461 PyTypeObject PythonQtClassWrapper_Type = {
462 PyVarObject_HEAD_INIT(NULL, 0)
462 PyVarObject_HEAD_INIT(NULL, 0)
463 "PythonQt.PythonQtClassWrapper", /*tp_name*/
463 "PythonQt.PythonQtClassWrapper", /*tp_name*/
464 sizeof(PythonQtClassWrapper), /*tp_basicsize*/
464 sizeof(PythonQtClassWrapper), /*tp_basicsize*/
465 0, /*tp_itemsize*/
465 0, /*tp_itemsize*/
466 0, /*tp_dealloc*/
466 0, /*tp_dealloc*/
467 0, /*tp_print*/
467 0, /*tp_print*/
468 0, /*tp_getattr*/
468 0, /*tp_getattr*/
469 0, /*tp_setattr*/
469 0, /*tp_setattr*/
470 0, /*tp_compare*/
470 0, /*tp_compare*/
471 0, //PythonQtClassWrapper_repr, /*tp_repr*/
471 0, //PythonQtClassWrapper_repr, /*tp_repr*/
472 0, /*tp_as_number*/
472 0, /*tp_as_number*/
473 0, /*tp_as_sequence*/
473 0, /*tp_as_sequence*/
474 0, /*tp_as_mapping*/
474 0, /*tp_as_mapping*/
475 0, /*tp_hash */
475 0, /*tp_hash */
476 0, /*tp_call*/
476 0, /*tp_call*/
477 0, /*tp_str*/
477 0, /*tp_str*/
478 PythonQtClassWrapper_getattro, /*tp_getattro*/
478 PythonQtClassWrapper_getattro, /*tp_getattro*/
479 PythonQtClassWrapper_setattro, /*tp_setattro*/
479 PythonQtClassWrapper_setattro, /*tp_setattro*/
480 0, /*tp_as_buffer*/
480 0, /*tp_as_buffer*/
481 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
481 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
482 0, /* tp_doc */
482 0, /* tp_doc */
483 0, /* tp_traverse */
483 0, /* tp_traverse */
484 0, /* tp_clear */
484 0, /* tp_clear */
485 0, /* tp_richcompare */
485 0, /* tp_richcompare */
486 0, /* tp_weaklistoffset */
486 0, /* tp_weaklistoffset */
487 0, /* tp_iter */
487 0, /* tp_iter */
488 0, /* tp_iternext */
488 0, /* tp_iternext */
489 PythonQtClassWrapper_methods, /* tp_methods */
489 PythonQtClassWrapper_methods, /* tp_methods */
490 0, /* tp_members */
490 0, /* tp_members */
491 0, /* tp_getset */
491 0, /* tp_getset */
492 0, /* tp_base */
492 0, /* tp_base */
493 0, /* tp_dict */
493 0, /* tp_dict */
494 0, /* tp_descr_get */
494 0, /* tp_descr_get */
495 0, /* tp_descr_set */
495 0, /* tp_descr_set */
496 0, /* tp_dictoffset */
496 0, /* tp_dictoffset */
497 (initproc)PythonQtClassWrapper_init, /* tp_init */
497 (initproc)PythonQtClassWrapper_init, /* tp_init */
498 PythonQtClassWrapper_alloc, /* tp_alloc */
498 PythonQtClassWrapper_alloc, /* tp_alloc */
499 0, /* tp_new */
499 0, /* tp_new */
500 0, /* tp_free */
500 0, /* tp_free */
501 };
501 };
502
502
503 //-------------------------------------------------------
503 //-------------------------------------------------------
504
504
@@ -1,190 +1,199
1 #ifndef _PYTHONQTMETHODINFO_H
1 #ifndef _PYTHONQTMETHODINFO_H
2 #define _PYTHONQTMETHODINFO_H
2 #define _PYTHONQTMETHODINFO_H
3
3
4 /*
4 /*
5 *
5 *
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 *
7 *
8 * This library is free software; you can redistribute it and/or
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
11 * version 2.1 of the License, or (at your option) any later version.
12 *
12 *
13 * This library is distributed in the hope that it will be useful,
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
16 * Lesser General Public License for more details.
17 *
17 *
18 * Further, this software is distributed without any warranty that it is
18 * Further, this software is distributed without any warranty that it is
19 * free of the rightful claim of any third person regarding infringement
19 * free of the rightful claim of any third person regarding infringement
20 * or the like. Any license provided herein, whether implied or
20 * or the like. Any license provided herein, whether implied or
21 * otherwise, applies only to this software file. Patent licenses, if
21 * otherwise, applies only to this software file. Patent licenses, if
22 * any, provided herein do not apply to combinations of this program with
22 * any, provided herein do not apply to combinations of this program with
23 * other software, or any other product whatsoever.
23 * other software, or any other product whatsoever.
24 *
24 *
25 * You should have received a copy of the GNU Lesser General Public
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 *
28 *
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 * 28359 Bremen, Germany or:
30 * 28359 Bremen, Germany or:
31 *
31 *
32 * http://www.mevis.de
32 * http://www.mevis.de
33 *
33 *
34 */
34 */
35
35
36 //----------------------------------------------------------------------------------
36 //----------------------------------------------------------------------------------
37 /*!
37 /*!
38 // \file PythonQtMethodInfo.h
38 // \file PythonQtMethodInfo.h
39 // \author Florian Link
39 // \author Florian Link
40 // \author Last changed by $Author: florian $
40 // \author Last changed by $Author: florian $
41 // \date 2006-05
41 // \date 2006-05
42 */
42 */
43 //----------------------------------------------------------------------------------
43 //----------------------------------------------------------------------------------
44
44
45 #include "PythonQtSystem.h"
45 #include "PythonQtSystem.h"
46
46
47 #include <QByteArray>
47 #include <QByteArray>
48 #include <QHash>
48 #include <QHash>
49 #include <QList>
49 #include <QList>
50 #include <QMetaMethod>
50 #include <QMetaMethod>
51
51
52 class PythonQtClassInfo;
52 class PythonQtClassInfo;
53 struct _object;
53 struct _object;
54 typedef struct _object PyObject;
54 typedef struct _object PyObject;
55
55
56 //! stores information about a specific signal/slot/method
56 //! stores information about a specific signal/slot/method
57 class PYTHONQT_EXPORT PythonQtMethodInfo
57 class PYTHONQT_EXPORT PythonQtMethodInfo
58 {
58 {
59 public:
59 public:
60 enum ParameterType {
60 enum ParameterType {
61 Unknown = -1,
61 Unknown = -1,
62 Variant = -2
62 Variant = -2
63 };
63 };
64
64
65 //! stores the QVariant id (if available) and the name of the type
65 //! stores the QVariant id (if available) and the name of the type
66 struct ParameterInfo {
66 struct ParameterInfo {
67 QByteArray name;
67 QByteArray name;
68 PyObject* enumWrapper; // if it is an enum, a pointer to the enum wrapper
68 PyObject* enumWrapper; // if it is an enum, a pointer to the enum wrapper
69 int typeId; // a mixture from QMetaType and ParameterType
69 int typeId; // a mixture from QMetaType and ParameterType
70 char pointerCount; // the number of pointers indirections
70 char pointerCount; // the number of pointers indirections
71 bool isConst;
71 bool isConst;
72 };
72 };
73
73
74 PythonQtMethodInfo() {};
74 PythonQtMethodInfo() {};
75 ~PythonQtMethodInfo() {};
75 ~PythonQtMethodInfo() {};
76 PythonQtMethodInfo(const QMetaMethod& meta, PythonQtClassInfo* classInfo);
76 PythonQtMethodInfo(const QMetaMethod& meta, PythonQtClassInfo* classInfo);
77 PythonQtMethodInfo(const QByteArray& typeName, const QList<QByteArray>& args);
77 PythonQtMethodInfo(const QByteArray& typeName, const QList<QByteArray>& args);
78 PythonQtMethodInfo(const PythonQtMethodInfo& other) {
78 PythonQtMethodInfo(const PythonQtMethodInfo& other) {
79 _parameters = other._parameters;
79 _parameters = other._parameters;
80 }
80 }
81
81
82 //! returns the method info of the signature, uses a cache internally to speed up
82 //! returns the method info of the signature, uses a cache internally to speed up
83 //! multiple requests for the same method, classInfo is passed to allow local enum resolution (if NULL is passed, no local enums are recognized)
83 //! multiple requests for the same method, classInfo is passed to allow local enum resolution (if NULL is passed, no local enums are recognized)
84 static const PythonQtMethodInfo* getCachedMethodInfo(const QMetaMethod& method, PythonQtClassInfo* classInfo);
84 static const PythonQtMethodInfo* getCachedMethodInfo(const QMetaMethod& method, PythonQtClassInfo* classInfo);
85
85
86 //! get the cached method info using the passed in list of return value and arguments, return value needs to be passed as first arg
86 //! get the cached method info using the passed in list of return value and arguments, return value needs to be passed as first arg
87 static const PythonQtMethodInfo* getCachedMethodInfoFromArgumentList(int numArgs, const char** args);
87 static const PythonQtMethodInfo* getCachedMethodInfoFromArgumentList(int numArgs, const char** args);
88
88
89 //! cleanup the cache
89 //! cleanup the cache
90 static void cleanupCachedMethodInfos();
90 static void cleanupCachedMethodInfos();
91
91
92 //! returns the number of parameters including the return value
92 //! returns the number of parameters including the return value
93 int parameterCount() const { return _parameters.size(); };
93 int parameterCount() const { return _parameters.size(); };
94
94
95 //! returns the id for the given type (using an internal dictionary)
95 //! returns the id for the given type (using an internal dictionary)
96 static int nameToType(const char* name);
96 static int nameToType(const char* name);
97
97
98 //! get the parameter infos
98 //! get the parameter infos
99 const QList<ParameterInfo>& parameters() const { return _parameters; }
99 const QList<ParameterInfo>& parameters() const { return _parameters; }
100
100
101 //! add an alias for a typename, e.g. QObjectList and QList<QObject*>.
101 //! add an alias for a typename, e.g. QObjectList and QList<QObject*>.
102 static void addParameterTypeAlias(const QByteArray& alias, const QByteArray& name);
102 static void addParameterTypeAlias(const QByteArray& alias, const QByteArray& name);
103
103
104 //! set the docstirng
105 void setDoc(const QString& str) {_doc = str;}
106
107 //! get the docstring
108 const QString& doc() const {return _doc; }
109
104 protected:
110 protected:
105 static void fillParameterInfo(ParameterInfo& type, const QByteArray& name, PythonQtClassInfo* classInfo);
111 static void fillParameterInfo(ParameterInfo& type, const QByteArray& name, PythonQtClassInfo* classInfo);
106
112
107 static QHash<QByteArray, int> _parameterTypeDict;
113 static QHash<QByteArray, int> _parameterTypeDict;
108 static QHash<QByteArray, QByteArray> _parameterNameAliases;
114 static QHash<QByteArray, QByteArray> _parameterNameAliases;
109
115
110 //! stores the cached signatures of methods to speedup mapping from Qt to Python types
116 //! stores the cached signatures of methods to speedup mapping from Qt to Python types
111 static QHash<QByteArray, PythonQtMethodInfo*> _cachedSignatures;
117 static QHash<QByteArray, PythonQtMethodInfo*> _cachedSignatures;
112
118
113 QList<ParameterInfo> _parameters;
119 QList<ParameterInfo> _parameters;
120
121 //! stores the docstring
122 QString _doc;
114 };
123 };
115
124
116 //! stores information about a slot, including a next pointer to overloaded slots
125 //! stores information about a slot, including a next pointer to overloaded slots
117 class PythonQtSlotInfo : public PythonQtMethodInfo
126 class PythonQtSlotInfo : public PythonQtMethodInfo
118 {
127 {
119 public:
128 public:
120 enum Type {
129 enum Type {
121 MemberSlot, InstanceDecorator, ClassDecorator
130 MemberSlot, InstanceDecorator, ClassDecorator
122 };
131 };
123
132
124 PythonQtSlotInfo(const PythonQtSlotInfo& info):PythonQtMethodInfo() {
133 PythonQtSlotInfo(const PythonQtSlotInfo& info):PythonQtMethodInfo() {
125 _meta = info._meta;
134 _meta = info._meta;
126 _parameters = info._parameters;
135 _parameters = info._parameters;
127 _slotIndex = info._slotIndex;
136 _slotIndex = info._slotIndex;
128 _next = NULL;
137 _next = NULL;
129 _decorator = info._decorator;
138 _decorator = info._decorator;
130 _type = info._type;
139 _type = info._type;
131 _upcastingOffset = 0;
140 _upcastingOffset = 0;
132 }
141 }
133
142
134 PythonQtSlotInfo(PythonQtClassInfo* classInfo, const QMetaMethod& meta, int slotIndex, QObject* decorator = NULL, Type type = MemberSlot ):PythonQtMethodInfo()
143 PythonQtSlotInfo(PythonQtClassInfo* classInfo, const QMetaMethod& meta, int slotIndex, QObject* decorator = NULL, Type type = MemberSlot ):PythonQtMethodInfo()
135 {
144 {
136 const PythonQtMethodInfo* info = getCachedMethodInfo(meta, classInfo);
145 const PythonQtMethodInfo* info = getCachedMethodInfo(meta, classInfo);
137 _meta = meta;
146 _meta = meta;
138 _parameters = info->parameters();
147 _parameters = info->parameters();
139 _slotIndex = slotIndex;
148 _slotIndex = slotIndex;
140 _next = NULL;
149 _next = NULL;
141 _decorator = decorator;
150 _decorator = decorator;
142 _type = type;
151 _type = type;
143 _upcastingOffset = 0;
152 _upcastingOffset = 0;
144 }
153 }
145
154
146
155
147 public:
156 public:
148
157
149 void deleteOverloadsAndThis();
158 void deleteOverloadsAndThis();
150
159
151 const QMetaMethod* metaMethod() const { return &_meta; }
160 const QMetaMethod* metaMethod() const { return &_meta; }
152
161
153 void setUpcastingOffset(int upcastingOffset) { _upcastingOffset = upcastingOffset; }
162 void setUpcastingOffset(int upcastingOffset) { _upcastingOffset = upcastingOffset; }
154
163
155 int upcastingOffset() const { return _upcastingOffset; }
164 int upcastingOffset() const { return _upcastingOffset; }
156
165
157 //! get the index of the slot (needed for qt_metacall)
166 //! get the index of the slot (needed for qt_metacall)
158 int slotIndex() const { return _slotIndex; }
167 int slotIndex() const { return _slotIndex; }
159
168
160 //! get next overloaded slot (which has the same name)
169 //! get next overloaded slot (which has the same name)
161 PythonQtSlotInfo* nextInfo() const { return _next; }
170 PythonQtSlotInfo* nextInfo() const { return _next; }
162
171
163 //! set the next overloaded slot
172 //! set the next overloaded slot
164 void setNextInfo(PythonQtSlotInfo* next) { _next = next; }
173 void setNextInfo(PythonQtSlotInfo* next) { _next = next; }
165
174
166 //! returns if the slot is a decorator slot
175 //! returns if the slot is a decorator slot
167 bool isInstanceDecorator() { return _decorator!=NULL && _type == InstanceDecorator; }
176 bool isInstanceDecorator() { return _decorator!=NULL && _type == InstanceDecorator; }
168
177
169 //! returns if the slot is a constructor slot
178 //! returns if the slot is a constructor slot
170 bool isClassDecorator() { return _decorator!=NULL && _type == ClassDecorator; }
179 bool isClassDecorator() { return _decorator!=NULL && _type == ClassDecorator; }
171
180
172 QObject* decorator() { return _decorator; }
181 QObject* decorator() { return _decorator; }
173
182
174 //! get the full signature including return type
183 //! get the full signature including return type
175 QString fullSignature();
184 QString fullSignature();
176
185
177 //! get the short slot name
186 //! get the short slot name
178 QByteArray slotName();
187 QByteArray slotName();
179
188
180 private:
189 private:
181 int _slotIndex;
190 int _slotIndex;
182 PythonQtSlotInfo* _next;
191 PythonQtSlotInfo* _next;
183 QObject* _decorator;
192 QObject* _decorator;
184 Type _type;
193 Type _type;
185 QMetaMethod _meta;
194 QMetaMethod _meta;
186 int _upcastingOffset;
195 int _upcastingOffset;
187 };
196 };
188
197
189
198
190 #endif
199 #endif
@@ -1,731 +1,733
1 /*
1 /*
2 *
2 *
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 *
4 *
5 * This library is free software; you can redistribute it and/or
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
8 * version 2.1 of the License, or (at your option) any later version.
9 *
9 *
10 * This library is distributed in the hope that it will be useful,
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
13 * Lesser General Public License for more details.
14 *
14 *
15 * Further, this software is distributed without any warranty that it is
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
20 * other software, or any other product whatsoever.
21 *
21 *
22 * You should have received a copy of the GNU Lesser General Public
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
25 *
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 * 28359 Bremen, Germany or:
27 * 28359 Bremen, Germany or:
28 *
28 *
29 * http://www.mevis.de
29 * http://www.mevis.de
30 *
30 *
31 */
31 */
32
32
33 //----------------------------------------------------------------------------------
33 //----------------------------------------------------------------------------------
34 /*!
34 /*!
35 // \file PythonQtSlot.cpp
35 // \file PythonQtSlot.cpp
36 // \author Florian Link
36 // \author Florian Link
37 // \author Last changed by $Author: florian $
37 // \author Last changed by $Author: florian $
38 // \date 2006-05
38 // \date 2006-05
39 */
39 */
40 //----------------------------------------------------------------------------------
40 //----------------------------------------------------------------------------------
41
41
42 #include "PythonQt.h"
42 #include "PythonQt.h"
43 #include "PythonQtSlot.h"
43 #include "PythonQtSlot.h"
44 #include "PythonQtInstanceWrapper.h"
44 #include "PythonQtInstanceWrapper.h"
45 #include "PythonQtClassInfo.h"
45 #include "PythonQtClassInfo.h"
46 #include "PythonQtMisc.h"
46 #include "PythonQtMisc.h"
47 #include "PythonQtConversion.h"
47 #include "PythonQtConversion.h"
48 #include <iostream>
48 #include <iostream>
49
49
50 #include <exception>
50 #include <exception>
51 #include <stdexcept>
51 #include <stdexcept>
52
52
53 #include <QByteArray>
53 #include <QByteArray>
54
54
55 #define PYTHONQT_MAX_ARGS 32
55 #define PYTHONQT_MAX_ARGS 32
56
56
57
57
58 bool PythonQtCallSlot(PythonQtClassInfo* classInfo, QObject* objectToCall, PyObject* args, bool strict, PythonQtSlotInfo* info, void* firstArgument, PyObject** pythonReturnValue, void** directReturnValuePointer)
58 bool PythonQtCallSlot(PythonQtClassInfo* classInfo, QObject* objectToCall, PyObject* args, bool strict, PythonQtSlotInfo* info, void* firstArgument, PyObject** pythonReturnValue, void** directReturnValuePointer)
59 {
59 {
60 static unsigned int recursiveEntry = 0;
60 static unsigned int recursiveEntry = 0;
61
61
62 if (directReturnValuePointer) {
62 if (directReturnValuePointer) {
63 *directReturnValuePointer = NULL;
63 *directReturnValuePointer = NULL;
64 }
64 }
65 // store the current storage position, so that we can get back to this state after a slot is called
65 // store the current storage position, so that we can get back to this state after a slot is called
66 // (do this locally, so that we have all positions on the stack
66 // (do this locally, so that we have all positions on the stack
67 PythonQtValueStoragePosition globalValueStoragePos;
67 PythonQtValueStoragePosition globalValueStoragePos;
68 PythonQtValueStoragePosition globalPtrStoragePos;
68 PythonQtValueStoragePosition globalPtrStoragePos;
69 PythonQtValueStoragePosition globalVariantStoragePos;
69 PythonQtValueStoragePosition globalVariantStoragePos;
70 PythonQtConv::global_valueStorage.getPos(globalValueStoragePos);
70 PythonQtConv::global_valueStorage.getPos(globalValueStoragePos);
71 PythonQtConv::global_ptrStorage.getPos(globalPtrStoragePos);
71 PythonQtConv::global_ptrStorage.getPos(globalPtrStoragePos);
72 PythonQtConv::global_variantStorage.getPos(globalVariantStoragePos);
72 PythonQtConv::global_variantStorage.getPos(globalVariantStoragePos);
73
73
74 recursiveEntry++;
74 recursiveEntry++;
75
75
76 // the arguments that are passed to qt_metacall
76 // the arguments that are passed to qt_metacall
77 void* argList[PYTHONQT_MAX_ARGS];
77 void* argList[PYTHONQT_MAX_ARGS];
78 PyObject* result = NULL;
78 PyObject* result = NULL;
79 int argc = info->parameterCount();
79 int argc = info->parameterCount();
80 const QList<PythonQtSlotInfo::ParameterInfo>& params = info->parameters();
80 const QList<PythonQtSlotInfo::ParameterInfo>& params = info->parameters();
81
81
82 const PythonQtSlotInfo::ParameterInfo& returnValueParam = params.at(0);
82 const PythonQtSlotInfo::ParameterInfo& returnValueParam = params.at(0);
83 // set return argument to NULL
83 // set return argument to NULL
84 argList[0] = NULL;
84 argList[0] = NULL;
85
85
86 bool ok = true;
86 bool ok = true;
87 bool skipFirst = false;
87 bool skipFirst = false;
88 if (info->isInstanceDecorator()) {
88 if (info->isInstanceDecorator()) {
89 skipFirst = true;
89 skipFirst = true;
90
90
91 // for decorators on CPP objects, we take the cpp ptr, for QObjects we take the QObject pointer
91 // for decorators on CPP objects, we take the cpp ptr, for QObjects we take the QObject pointer
92 void* arg1 = firstArgument;
92 void* arg1 = firstArgument;
93 if (!arg1) {
93 if (!arg1) {
94 arg1 = objectToCall;
94 arg1 = objectToCall;
95 }
95 }
96 if (arg1) {
96 if (arg1) {
97 // upcast to correct parent class
97 // upcast to correct parent class
98 arg1 = ((char*)arg1)+info->upcastingOffset();
98 arg1 = ((char*)arg1)+info->upcastingOffset();
99 }
99 }
100
100
101 argList[1] = &arg1;
101 argList[1] = &arg1;
102 if (ok) {
102 if (ok) {
103 for (int i = 2; i<argc && ok; i++) {
103 for (int i = 2; i<argc && ok; i++) {
104 const PythonQtSlotInfo::ParameterInfo& param = params.at(i);
104 const PythonQtSlotInfo::ParameterInfo& param = params.at(i);
105 argList[i] = PythonQtConv::ConvertPythonToQt(param, PyTuple_GET_ITEM(args, i-2), strict, classInfo);
105 argList[i] = PythonQtConv::ConvertPythonToQt(param, PyTuple_GET_ITEM(args, i-2), strict, classInfo);
106 if (argList[i]==NULL) {
106 if (argList[i]==NULL) {
107 ok = false;
107 ok = false;
108 break;
108 break;
109 }
109 }
110 }
110 }
111 }
111 }
112 } else {
112 } else {
113 for (int i = 1; i<argc && ok; i++) {
113 for (int i = 1; i<argc && ok; i++) {
114 const PythonQtSlotInfo::ParameterInfo& param = params.at(i);
114 const PythonQtSlotInfo::ParameterInfo& param = params.at(i);
115 argList[i] = PythonQtConv::ConvertPythonToQt(param, PyTuple_GET_ITEM(args, i-1), strict, classInfo);
115 argList[i] = PythonQtConv::ConvertPythonToQt(param, PyTuple_GET_ITEM(args, i-1), strict, classInfo);
116 if (argList[i]==NULL) {
116 if (argList[i]==NULL) {
117 ok = false;
117 ok = false;
118 break;
118 break;
119 }
119 }
120 }
120 }
121 }
121 }
122
122
123 if (ok) {
123 if (ok) {
124 // parameters are ok, now create the qt return value which is assigned to by metacall
124 // parameters are ok, now create the qt return value which is assigned to by metacall
125 if (returnValueParam.typeId != QMetaType::Void) {
125 if (returnValueParam.typeId != QMetaType::Void) {
126 // create empty default value for the return value
126 // create empty default value for the return value
127 if (!directReturnValuePointer) {
127 if (!directReturnValuePointer) {
128 // create empty default value for the return value
128 // create empty default value for the return value
129 argList[0] = PythonQtConv::CreateQtReturnValue(returnValueParam);
129 argList[0] = PythonQtConv::CreateQtReturnValue(returnValueParam);
130 if (argList[0]==NULL) {
130 if (argList[0]==NULL) {
131 // return value could not be created, maybe we have a registered class with a default constructor, so that we can construct the pythonqt wrapper object and
131 // return value could not be created, maybe we have a registered class with a default constructor, so that we can construct the pythonqt wrapper object and
132 // pass its internal pointer
132 // pass its internal pointer
133 PythonQtClassInfo* info = PythonQt::priv()->getClassInfo(returnValueParam.name);
133 PythonQtClassInfo* info = PythonQt::priv()->getClassInfo(returnValueParam.name);
134 if (info && info->pythonQtClassWrapper()) {
134 if (info && info->pythonQtClassWrapper()) {
135 PyObject* emptyTuple = PyTuple_New(0);
135 PyObject* emptyTuple = PyTuple_New(0);
136 // 1) default construct an empty object as python object (owned by PythonQt), by calling the meta class with empty arguments
136 // 1) default construct an empty object as python object (owned by PythonQt), by calling the meta class with empty arguments
137 result = PyObject_Call((PyObject*)info->pythonQtClassWrapper(), emptyTuple, NULL);
137 result = PyObject_Call((PyObject*)info->pythonQtClassWrapper(), emptyTuple, NULL);
138 if (result) {
138 if (result) {
139 argList[0] = ((PythonQtInstanceWrapper*)result)->_wrappedPtr;
139 argList[0] = ((PythonQtInstanceWrapper*)result)->_wrappedPtr;
140 }
140 }
141 Py_DECREF(emptyTuple);
141 Py_DECREF(emptyTuple);
142 }
142 }
143 }
143 }
144 } else {
144 } else {
145 // we can use our pointer directly!
145 // we can use our pointer directly!
146 argList[0] = directReturnValuePointer;
146 argList[0] = directReturnValuePointer;
147 }
147 }
148 }
148 }
149
149
150
150
151 PythonQt::ProfilingCB* profilingCB = PythonQt::priv()->profilingCB();
151 PythonQt::ProfilingCB* profilingCB = PythonQt::priv()->profilingCB();
152 if (profilingCB) {
152 if (profilingCB) {
153 const char* className = NULL;
153 const char* className = NULL;
154 if (info->decorator()) {
154 if (info->decorator()) {
155 className = info->decorator()->metaObject()->className();
155 className = info->decorator()->metaObject()->className();
156 } else {
156 } else {
157 className = objectToCall->metaObject()->className();
157 className = objectToCall->metaObject()->className();
158 }
158 }
159
159
160 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
160 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
161 profilingCB(PythonQt::Enter, className, info->metaMethod()->methodSignature());
161 profilingCB(PythonQt::Enter, className, info->metaMethod()->methodSignature());
162 #else
162 #else
163 profilingCB(PythonQt::Enter, className, info->metaMethod()->signature());
163 profilingCB(PythonQt::Enter, className, info->metaMethod()->signature());
164 #endif
164 #endif
165 }
165 }
166
166
167 // invoke the slot via metacall
167 // invoke the slot via metacall
168 bool hadException = false;
168 bool hadException = false;
169 QObject* obj = info->decorator()?info->decorator():objectToCall;
169 QObject* obj = info->decorator()?info->decorator():objectToCall;
170 if (!obj) {
170 if (!obj) {
171 hadException = true;
171 hadException = true;
172 PyErr_SetString(PyExc_RuntimeError, "Trying to call a slot on a deleted QObject!");
172 PyErr_SetString(PyExc_RuntimeError, "Trying to call a slot on a deleted QObject!");
173 } else {
173 } else {
174 try {
174 try {
175 obj->qt_metacall(QMetaObject::InvokeMetaMethod, info->slotIndex(), argList);
175 obj->qt_metacall(QMetaObject::InvokeMetaMethod, info->slotIndex(), argList);
176 } catch (std::bad_alloc & e) {
176 } catch (std::bad_alloc & e) {
177 hadException = true;
177 hadException = true;
178 QByteArray what("std::bad_alloc: ");
178 QByteArray what("std::bad_alloc: ");
179 what += e.what();
179 what += e.what();
180 PyErr_SetString(PyExc_MemoryError, what.constData());
180 PyErr_SetString(PyExc_MemoryError, what.constData());
181 } catch (std::runtime_error & e) {
181 } catch (std::runtime_error & e) {
182 hadException = true;
182 hadException = true;
183 QByteArray what("std::runtime_error: ");
183 QByteArray what("std::runtime_error: ");
184 what += e.what();
184 what += e.what();
185 PyErr_SetString(PyExc_RuntimeError, what.constData());
185 PyErr_SetString(PyExc_RuntimeError, what.constData());
186 } catch (std::logic_error & e) {
186 } catch (std::logic_error & e) {
187 hadException = true;
187 hadException = true;
188 QByteArray what("std::logic_error: ");
188 QByteArray what("std::logic_error: ");
189 what += e.what();
189 what += e.what();
190 PyErr_SetString(PyExc_RuntimeError, what.constData());
190 PyErr_SetString(PyExc_RuntimeError, what.constData());
191 } catch (std::exception& e) {
191 } catch (std::exception& e) {
192 hadException = true;
192 hadException = true;
193 QByteArray what("std::exception: ");
193 QByteArray what("std::exception: ");
194 what += e.what();
194 what += e.what();
195 #ifdef PY3K
195 #ifdef PY3K
196 PyErr_SetString(PyExc_RuntimeError, what.constData());
196 PyErr_SetString(PyExc_RuntimeError, what.constData());
197 #else
197 #else
198 PyErr_SetString(PyExc_StandardError, what.constData());
198 PyErr_SetString(PyExc_StandardError, what.constData());
199 #endif
199 #endif
200 }
200 }
201 }
201 }
202
202
203 if (profilingCB) {
203 if (profilingCB) {
204 profilingCB(PythonQt::Leave, NULL, NULL);
204 profilingCB(PythonQt::Leave, NULL, NULL);
205 }
205 }
206
206
207 // handle the return value (which in most cases still needs to be converted to a Python object)
207 // handle the return value (which in most cases still needs to be converted to a Python object)
208 if (!hadException) {
208 if (!hadException) {
209 if (argList[0] || returnValueParam.typeId == QMetaType::Void) {
209 if (argList[0] || returnValueParam.typeId == QMetaType::Void) {
210 if (directReturnValuePointer) {
210 if (directReturnValuePointer) {
211 result = NULL;
211 result = NULL;
212 } else {
212 } else {
213 // the resulting object maybe present already, because we created it above at 1)...
213 // the resulting object maybe present already, because we created it above at 1)...
214 if (!result) {
214 if (!result) {
215 result = PythonQtConv::ConvertQtValueToPython(returnValueParam, argList[0]);
215 result = PythonQtConv::ConvertQtValueToPython(returnValueParam, argList[0]);
216 }
216 }
217 }
217 }
218 } else {
218 } else {
219 QString e = QString("Called ") + info->fullSignature() + ", return type '" + returnValueParam.name + "' is ignored because it is unknown to PythonQt. Probably you should register it using qRegisterMetaType() or add a default constructor decorator to the class.";
219 QString e = QString("Called ") + info->fullSignature() + ", return type '" + returnValueParam.name + "' is ignored because it is unknown to PythonQt. Probably you should register it using qRegisterMetaType() or add a default constructor decorator to the class.";
220 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
220 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
221 result = NULL;
221 result = NULL;
222 }
222 }
223 } else {
223 } else {
224 result = NULL;
224 result = NULL;
225 }
225 }
226 }
226 }
227 recursiveEntry--;
227 recursiveEntry--;
228
228
229 // reset the parameter storage position to the stored pos to "pop" the parameter stack
229 // reset the parameter storage position to the stored pos to "pop" the parameter stack
230 PythonQtConv::global_valueStorage.setPos(globalValueStoragePos);
230 PythonQtConv::global_valueStorage.setPos(globalValueStoragePos);
231 PythonQtConv::global_ptrStorage.setPos(globalPtrStoragePos);
231 PythonQtConv::global_ptrStorage.setPos(globalPtrStoragePos);
232 PythonQtConv::global_variantStorage.setPos(globalVariantStoragePos);
232 PythonQtConv::global_variantStorage.setPos(globalVariantStoragePos);
233
233
234 *pythonReturnValue = result;
234 *pythonReturnValue = result;
235 // NOTE: it is important to only return here, otherwise the stack will not be popped!!!
235 // NOTE: it is important to only return here, otherwise the stack will not be popped!!!
236 return result || (directReturnValuePointer && *directReturnValuePointer);
236 return result || (directReturnValuePointer && *directReturnValuePointer);
237 }
237 }
238
238
239 //-----------------------------------------------------------------------------------
239 //-----------------------------------------------------------------------------------
240
240
241 static PythonQtSlotFunctionObject *pythonqtslot_free_list = NULL;
241 static PythonQtSlotFunctionObject *pythonqtslot_free_list = NULL;
242
242
243 PyObject *PythonQtSlotFunction_Call(PyObject *func, PyObject *args, PyObject *kw)
243 PyObject *PythonQtSlotFunction_Call(PyObject *func, PyObject *args, PyObject *kw)
244 {
244 {
245 PythonQtSlotFunctionObject* f = (PythonQtSlotFunctionObject*)func;
245 PythonQtSlotFunctionObject* f = (PythonQtSlotFunctionObject*)func;
246 return PythonQtMemberFunction_Call(f->m_ml, f->m_self, args, kw);
246 return PythonQtMemberFunction_Call(f->m_ml, f->m_self, args, kw);
247 }
247 }
248
248
249 PyObject *PythonQtMemberFunction_Call(PythonQtSlotInfo* info, PyObject* m_self, PyObject *args, PyObject *kw)
249 PyObject *PythonQtMemberFunction_Call(PythonQtSlotInfo* info, PyObject* m_self, PyObject *args, PyObject *kw)
250 {
250 {
251 if (PyObject_TypeCheck(m_self, &PythonQtInstanceWrapper_Type)) {
251 if (PyObject_TypeCheck(m_self, &PythonQtInstanceWrapper_Type)) {
252 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*) m_self;
252 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*) m_self;
253 if (!info->isClassDecorator() && (self->_obj==NULL && self->_wrappedPtr==NULL)) {
253 if (!info->isClassDecorator() && (self->_obj==NULL && self->_wrappedPtr==NULL)) {
254 QString error = QString("Trying to call '") + info->slotName() + "' on a destroyed " + self->classInfo()->className() + " object";
254 QString error = QString("Trying to call '") + info->slotName() + "' on a destroyed " + self->classInfo()->className() + " object";
255 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
255 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
256 return NULL;
256 return NULL;
257 } else {
257 } else {
258 return PythonQtSlotFunction_CallImpl(self->classInfo(), self->_obj, info, args, kw, self->_wrappedPtr);
258 return PythonQtSlotFunction_CallImpl(self->classInfo(), self->_obj, info, args, kw, self->_wrappedPtr);
259 }
259 }
260 } else if (m_self->ob_type == &PythonQtClassWrapper_Type) {
260 } else if (m_self->ob_type == &PythonQtClassWrapper_Type) {
261 PythonQtClassWrapper* type = (PythonQtClassWrapper*) m_self;
261 PythonQtClassWrapper* type = (PythonQtClassWrapper*) m_self;
262 if (info->isClassDecorator()) {
262 if (info->isClassDecorator()) {
263 return PythonQtSlotFunction_CallImpl(type->classInfo(), NULL, info, args, kw);
263 return PythonQtSlotFunction_CallImpl(type->classInfo(), NULL, info, args, kw);
264 } else {
264 } else {
265 // otherwise, it is an unbound call and we have an instanceDecorator or normal slot...
265 // otherwise, it is an unbound call and we have an instanceDecorator or normal slot...
266 Py_ssize_t argc = PyTuple_Size(args);
266 Py_ssize_t argc = PyTuple_Size(args);
267 if (argc>0) {
267 if (argc>0) {
268 PyObject* firstArg = PyTuple_GET_ITEM(args, 0);
268 PyObject* firstArg = PyTuple_GET_ITEM(args, 0);
269 if (PyObject_TypeCheck(firstArg, (PyTypeObject*)&PythonQtInstanceWrapper_Type)
269 if (PyObject_TypeCheck(firstArg, (PyTypeObject*)&PythonQtInstanceWrapper_Type)
270 && ((PythonQtInstanceWrapper*)firstArg)->classInfo()->inherits(type->classInfo())) {
270 && ((PythonQtInstanceWrapper*)firstArg)->classInfo()->inherits(type->classInfo())) {
271 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*)firstArg;
271 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*)firstArg;
272 if (!info->isClassDecorator() && (self->_obj==NULL && self->_wrappedPtr==NULL)) {
272 if (!info->isClassDecorator() && (self->_obj==NULL && self->_wrappedPtr==NULL)) {
273 QString error = QString("Trying to call '") + info->slotName() + "' on a destroyed " + self->classInfo()->className() + " object";
273 QString error = QString("Trying to call '") + info->slotName() + "' on a destroyed " + self->classInfo()->className() + " object";
274 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
274 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
275 return NULL;
275 return NULL;
276 }
276 }
277 // strip the first argument...
277 // strip the first argument...
278 PyObject* newargs = PyTuple_GetSlice(args, 1, argc);
278 PyObject* newargs = PyTuple_GetSlice(args, 1, argc);
279 PyObject* result = PythonQtSlotFunction_CallImpl(self->classInfo(), self->_obj, info, newargs, kw, self->_wrappedPtr);
279 PyObject* result = PythonQtSlotFunction_CallImpl(self->classInfo(), self->_obj, info, newargs, kw, self->_wrappedPtr);
280 Py_DECREF(newargs);
280 Py_DECREF(newargs);
281 return result;
281 return result;
282 } else {
282 } else {
283 // first arg is not of correct type!
283 // first arg is not of correct type!
284 QString error = "slot " + info->fullSignature() + " requires " + type->classInfo()->className() + " instance as first argument, got " + firstArg->ob_type->tp_name;
284 QString error = "slot " + info->fullSignature() + " requires " + type->classInfo()->className() + " instance as first argument, got " + firstArg->ob_type->tp_name;
285 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
285 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
286 return NULL;
286 return NULL;
287 }
287 }
288 } else {
288 } else {
289 // wrong number of args
289 // wrong number of args
290 QString error = "slot " + info->fullSignature() + " requires " + type->classInfo()->className() + " instance as first argument.";
290 QString error = "slot " + info->fullSignature() + " requires " + type->classInfo()->className() + " instance as first argument.";
291 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
291 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
292 return NULL;
292 return NULL;
293 }
293 }
294 }
294 }
295 }
295 }
296 return NULL;
296 return NULL;
297 }
297 }
298
298
299 PyObject *PythonQtSlotFunction_CallImpl(PythonQtClassInfo* classInfo, QObject* objectToCall, PythonQtSlotInfo* info, PyObject *args, PyObject * /*kw*/, void* firstArg, void** directReturnValuePointer)
299 PyObject *PythonQtSlotFunction_CallImpl(PythonQtClassInfo* classInfo, QObject* objectToCall, PythonQtSlotInfo* info, PyObject *args, PyObject * /*kw*/, void* firstArg, void** directReturnValuePointer)
300 {
300 {
301 int argc = args?PyTuple_Size(args):0;
301 int argc = args?PyTuple_Size(args):0;
302
302
303 #ifdef PYTHONQT_DEBUG
303 #ifdef PYTHONQT_DEBUG
304 std::cout << "called " << info->metaMethod()->typeName() << " " << info->metaMethod()->signature() << std::endl;
304 std::cout << "called " << info->metaMethod()->typeName() << " " << info->metaMethod()->signature() << std::endl;
305 #endif
305 #endif
306
306
307 PyObject* r = NULL;
307 PyObject* r = NULL;
308 bool ok = false;
308 bool ok = false;
309 if (directReturnValuePointer) {
309 if (directReturnValuePointer) {
310 *directReturnValuePointer = NULL;
310 *directReturnValuePointer = NULL;
311 }
311 }
312 if (info->nextInfo()) {
312 if (info->nextInfo()) {
313 // overloaded slot call, try on all slots with strict conversion first
313 // overloaded slot call, try on all slots with strict conversion first
314 bool strict = true;
314 bool strict = true;
315 PythonQtSlotInfo* i = info;
315 PythonQtSlotInfo* i = info;
316 while (i) {
316 while (i) {
317 bool skipFirst = i->isInstanceDecorator();
317 bool skipFirst = i->isInstanceDecorator();
318 if (i->parameterCount()-1-(skipFirst?1:0) == argc) {
318 if (i->parameterCount()-1-(skipFirst?1:0) == argc) {
319 PyErr_Clear();
319 PyErr_Clear();
320 ok = PythonQtCallSlot(classInfo, objectToCall, args, strict, i, firstArg, &r, directReturnValuePointer);
320 ok = PythonQtCallSlot(classInfo, objectToCall, args, strict, i, firstArg, &r, directReturnValuePointer);
321 if (PyErr_Occurred() || ok) break;
321 if (PyErr_Occurred() || ok) break;
322 }
322 }
323 i = i->nextInfo();
323 i = i->nextInfo();
324 if (!i) {
324 if (!i) {
325 if (strict) {
325 if (strict) {
326 // one more run without being strict
326 // one more run without being strict
327 strict = false;
327 strict = false;
328 i = info;
328 i = info;
329 }
329 }
330 }
330 }
331 }
331 }
332 if (!ok && !PyErr_Occurred()) {
332 if (!ok && !PyErr_Occurred()) {
333 QString e = QString("Could not find matching overload for given arguments:\n" + PythonQtConv::PyObjGetString(args) + "\n The following slots are available:\n");
333 QString e = QString("Could not find matching overload for given arguments:\n" + PythonQtConv::PyObjGetString(args) + "\n The following slots are available:\n");
334 PythonQtSlotInfo* i = info;
334 PythonQtSlotInfo* i = info;
335 while (i) {
335 while (i) {
336 e += QString(i->fullSignature()) + "\n";
336 e += QString(i->fullSignature()) + "\n";
337 i = i->nextInfo();
337 i = i->nextInfo();
338 }
338 }
339 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
339 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
340 }
340 }
341 } else {
341 } else {
342 // simple (non-overloaded) slot call
342 // simple (non-overloaded) slot call
343 bool skipFirst = info->isInstanceDecorator();
343 bool skipFirst = info->isInstanceDecorator();
344 if (info->parameterCount()-1-(skipFirst?1:0) == argc) {
344 if (info->parameterCount()-1-(skipFirst?1:0) == argc) {
345 PyErr_Clear();
345 PyErr_Clear();
346 ok = PythonQtCallSlot(classInfo, objectToCall, args, false, info, firstArg, &r, directReturnValuePointer);
346 ok = PythonQtCallSlot(classInfo, objectToCall, args, false, info, firstArg, &r, directReturnValuePointer);
347 if (!ok && !PyErr_Occurred()) {
347 if (!ok && !PyErr_Occurred()) {
348 QString e = QString("Called ") + info->fullSignature() + " with wrong arguments: " + PythonQtConv::PyObjGetString(args);
348 QString e = QString("Called ") + info->fullSignature() + " with wrong arguments: " + PythonQtConv::PyObjGetString(args);
349 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
349 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
350 }
350 }
351 } else {
351 } else {
352 QString e = QString("Called ") + info->fullSignature() + " with wrong number of arguments: " + PythonQtConv::PyObjGetString(args);
352 QString e = QString("Called ") + info->fullSignature() + " with wrong number of arguments: " + PythonQtConv::PyObjGetString(args);
353 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
353 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
354 }
354 }
355 }
355 }
356
356
357 return r;
357 return r;
358 }
358 }
359
359
360 PyObject *
360 PyObject *
361 PythonQtSlotFunction_New(PythonQtSlotInfo *ml, PyObject *self, PyObject *module)
361 PythonQtSlotFunction_New(PythonQtSlotInfo *ml, PyObject *self, PyObject *module)
362 {
362 {
363 PythonQtSlotFunctionObject *op;
363 PythonQtSlotFunctionObject *op;
364 op = pythonqtslot_free_list;
364 op = pythonqtslot_free_list;
365 if (op != NULL) {
365 if (op != NULL) {
366 pythonqtslot_free_list = (PythonQtSlotFunctionObject *)(op->m_self);
366 pythonqtslot_free_list = (PythonQtSlotFunctionObject *)(op->m_self);
367 PyObject_INIT(op, &PythonQtSlotFunction_Type);
367 PyObject_INIT(op, &PythonQtSlotFunction_Type);
368 }
368 }
369 else {
369 else {
370 op = PyObject_GC_New(PythonQtSlotFunctionObject, &PythonQtSlotFunction_Type);
370 op = PyObject_GC_New(PythonQtSlotFunctionObject, &PythonQtSlotFunction_Type);
371 if (op == NULL)
371 if (op == NULL)
372 return NULL;
372 return NULL;
373 }
373 }
374 op->m_ml = ml;
374 op->m_ml = ml;
375 Py_XINCREF(self);
375 Py_XINCREF(self);
376 op->m_self = self;
376 op->m_self = self;
377 Py_XINCREF(module);
377 Py_XINCREF(module);
378 op->m_module = module;
378 op->m_module = module;
379 PyObject_GC_Track(op);
379 PyObject_GC_Track(op);
380 return (PyObject *)op;
380 return (PyObject *)op;
381 }
381 }
382
382
383 PythonQtSlotInfo*
383 PythonQtSlotInfo*
384 PythonQtSlotFunction_GetSlotInfo(PyObject *op)
384 PythonQtSlotFunction_GetSlotInfo(PyObject *op)
385 {
385 {
386 if (!PythonQtSlotFunction_Check(op)) {
386 if (!PythonQtSlotFunction_Check(op)) {
387 PyErr_Format(PyExc_SystemError, "%s:%d: bad argument to internal function", __FILE__, __LINE__);
387 PyErr_Format(PyExc_SystemError, "%s:%d: bad argument to internal function", __FILE__, __LINE__);
388 return NULL;
388 return NULL;
389 }
389 }
390 return ((PythonQtSlotFunctionObject *)op) -> m_ml;
390 return ((PythonQtSlotFunctionObject *)op) -> m_ml;
391 }
391 }
392
392
393 PyObject *
393 PyObject *
394 PythonQtSlotFunction_GetSelf(PyObject *op)
394 PythonQtSlotFunction_GetSelf(PyObject *op)
395 {
395 {
396 if (!PythonQtSlotFunction_Check(op)) {
396 if (!PythonQtSlotFunction_Check(op)) {
397 PyErr_Format(PyExc_SystemError, "%s:%d: bad argument to internal function", __FILE__, __LINE__);
397 PyErr_Format(PyExc_SystemError, "%s:%d: bad argument to internal function", __FILE__, __LINE__);
398 return NULL;
398 return NULL;
399 }
399 }
400 return ((PythonQtSlotFunctionObject *)op) -> m_self;
400 return ((PythonQtSlotFunctionObject *)op) -> m_self;
401 }
401 }
402
402
403 /* Methods (the standard built-in methods, that is) */
403 /* Methods (the standard built-in methods, that is) */
404
404
405 static void
405 static void
406 meth_dealloc(PythonQtSlotFunctionObject *m)
406 meth_dealloc(PythonQtSlotFunctionObject *m)
407 {
407 {
408 PyObject_GC_UnTrack(m);
408 PyObject_GC_UnTrack(m);
409 Py_XDECREF(m->m_self);
409 Py_XDECREF(m->m_self);
410 Py_XDECREF(m->m_module);
410 Py_XDECREF(m->m_module);
411 m->m_self = (PyObject *)pythonqtslot_free_list;
411 m->m_self = (PyObject *)pythonqtslot_free_list;
412 pythonqtslot_free_list = m;
412 pythonqtslot_free_list = m;
413 }
413 }
414
414
415 static PyObject *
415 static PyObject *
416 meth_get__doc__(PythonQtSlotFunctionObject * /*m*/, void * /*closure*/)
416 meth_get__doc__(PythonQtSlotFunctionObject *m, void * /*closure*/)
417 {
417 {
418 if( !m->m_ml->doc().isEmpty() )
419 return PythonQtConv::QStringToPyObject(m->m_ml->doc());
418 Py_INCREF(Py_None);
420 Py_INCREF(Py_None);
419 return Py_None;
421 return Py_None;
420 }
422 }
421
423
422 static PyObject *
424 static PyObject *
423 meth_get__name__(PythonQtSlotFunctionObject *m, void * /*closure*/)
425 meth_get__name__(PythonQtSlotFunctionObject *m, void * /*closure*/)
424 {
426 {
425 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
427 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
426 #ifdef PY3K
428 #ifdef PY3K
427 return PyUnicode_FromString(m->m_ml->metaMethod()->methodSignature());
429 return PyUnicode_FromString(m->m_ml->metaMethod()->methodSignature());
428 #else
430 #else
429 return PyString_FromString(m->m_ml->metaMethod()->methodSignature());
431 return PyString_FromString(m->m_ml->metaMethod()->methodSignature());
430 #endif
432 #endif
431 #else
433 #else
432 #ifdef PY3K
434 #ifdef PY3K
433 return PyUnicode_FromString(m->m_ml->metaMethod()->signature());
435 return PyUnicode_FromString(m->m_ml->metaMethod()->signature());
434 #else
436 #else
435 return PyString_FromString(m->m_ml->metaMethod()->signature());
437 return PyString_FromString(m->m_ml->metaMethod()->signature());
436 #endif
438 #endif
437 #endif
439 #endif
438 }
440 }
439
441
440 static int
442 static int
441 meth_traverse(PythonQtSlotFunctionObject *m, visitproc visit, void *arg)
443 meth_traverse(PythonQtSlotFunctionObject *m, visitproc visit, void *arg)
442 {
444 {
443 int err;
445 int err;
444 if (m->m_self != NULL) {
446 if (m->m_self != NULL) {
445 err = visit(m->m_self, arg);
447 err = visit(m->m_self, arg);
446 if (err)
448 if (err)
447 return err;
449 return err;
448 }
450 }
449 if (m->m_module != NULL) {
451 if (m->m_module != NULL) {
450 err = visit(m->m_module, arg);
452 err = visit(m->m_module, arg);
451 if (err)
453 if (err)
452 return err;
454 return err;
453 }
455 }
454 return 0;
456 return 0;
455 }
457 }
456
458
457 static PyObject *
459 static PyObject *
458 meth_get__self__(PythonQtSlotFunctionObject *m, void * /*closure*/)
460 meth_get__self__(PythonQtSlotFunctionObject *m, void * /*closure*/)
459 {
461 {
460 PyObject *self;
462 PyObject *self;
461 #ifndef PY3K
463 #ifndef PY3K
462 if (PyEval_GetRestricted()) {
464 if (PyEval_GetRestricted()) {
463 PyErr_SetString(PyExc_RuntimeError,
465 PyErr_SetString(PyExc_RuntimeError,
464 "method.__self__ not accessible in restricted mode");
466 "method.__self__ not accessible in restricted mode");
465 return NULL;
467 return NULL;
466 }
468 }
467 #endif
469 #endif
468 self = m->m_self;
470 self = m->m_self;
469 if (self == NULL)
471 if (self == NULL)
470 self = Py_None;
472 self = Py_None;
471 Py_INCREF(self);
473 Py_INCREF(self);
472 return self;
474 return self;
473 }
475 }
474
476
475 static PyGetSetDef meth_getsets [] = {
477 static PyGetSetDef meth_getsets [] = {
476 {const_cast<char*>("__doc__"), (getter)meth_get__doc__, NULL, NULL},
478 {const_cast<char*>("__doc__"), (getter)meth_get__doc__, NULL, NULL},
477 {const_cast<char*>("__name__"), (getter)meth_get__name__, NULL, NULL},
479 {const_cast<char*>("__name__"), (getter)meth_get__name__, NULL, NULL},
478 {const_cast<char*>("__self__"), (getter)meth_get__self__, NULL, NULL},
480 {const_cast<char*>("__self__"), (getter)meth_get__self__, NULL, NULL},
479 {NULL, NULL, NULL,NULL},
481 {NULL, NULL, NULL,NULL},
480 };
482 };
481
483
482 #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 6
484 #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 6
483 #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
485 #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
484 #endif
486 #endif
485
487
486 #define OFF(x) offsetof(PythonQtSlotFunctionObject, x)
488 #define OFF(x) offsetof(PythonQtSlotFunctionObject, x)
487
489
488 static PyMemberDef meth_members[] = {
490 static PyMemberDef meth_members[] = {
489 {const_cast<char*>("__module__"), T_OBJECT, OFF(m_module), PY_WRITE_RESTRICTED},
491 {const_cast<char*>("__module__"), T_OBJECT, OFF(m_module), PY_WRITE_RESTRICTED},
490 {NULL}
492 {NULL}
491 };
493 };
492
494
493 static PyObject *PythonQtSlotFunction_parameterTypes(PythonQtSlotFunctionObject* type)
495 static PyObject *PythonQtSlotFunction_parameterTypes(PythonQtSlotFunctionObject* type)
494 {
496 {
495 return PythonQtMemberFunction_parameterTypes(type->m_ml);
497 return PythonQtMemberFunction_parameterTypes(type->m_ml);
496 }
498 }
497
499
498 static PyObject *PythonQtSlotFunction_parameterNames(PythonQtSlotFunctionObject* type)
500 static PyObject *PythonQtSlotFunction_parameterNames(PythonQtSlotFunctionObject* type)
499 {
501 {
500 return PythonQtMemberFunction_parameterNames(type->m_ml);
502 return PythonQtMemberFunction_parameterNames(type->m_ml);
501 }
503 }
502
504
503 static PyObject *PythonQtSlotFunction_typeName(PythonQtSlotFunctionObject* type)
505 static PyObject *PythonQtSlotFunction_typeName(PythonQtSlotFunctionObject* type)
504 {
506 {
505 return PythonQtMemberFunction_typeName(type->m_ml);
507 return PythonQtMemberFunction_typeName(type->m_ml);
506 }
508 }
507
509
508 PyObject *PythonQtMemberFunction_parameterTypes(PythonQtSlotInfo* theInfo)
510 PyObject *PythonQtMemberFunction_parameterTypes(PythonQtSlotInfo* theInfo)
509 {
511 {
510 PythonQtSlotInfo* info = theInfo;
512 PythonQtSlotInfo* info = theInfo;
511 int count = 0;
513 int count = 0;
512 while (info) {
514 while (info) {
513 info = info->nextInfo();
515 info = info->nextInfo();
514 count++;
516 count++;
515 }
517 }
516 info = theInfo;
518 info = theInfo;
517 PyObject* result = PyTuple_New(count);
519 PyObject* result = PyTuple_New(count);
518 for (int j = 0;j<count;j++) {
520 for (int j = 0;j<count;j++) {
519 QList<QByteArray> types = info->metaMethod()->parameterTypes();
521 QList<QByteArray> types = info->metaMethod()->parameterTypes();
520 PyObject* tuple = PyTuple_New(types.count());
522 PyObject* tuple = PyTuple_New(types.count());
521 for (int i = 0; i<types.count();i++) {
523 for (int i = 0; i<types.count();i++) {
522 #ifdef PY3K
524 #ifdef PY3K
523 PyTuple_SET_ITEM(tuple, i, PyUnicode_FromString(types.at(i).constData()));
525 PyTuple_SET_ITEM(tuple, i, PyUnicode_FromString(types.at(i).constData()));
524 #else
526 #else
525 PyTuple_SET_ITEM(tuple, i, PyString_FromString(types.at(i).constData()));
527 PyTuple_SET_ITEM(tuple, i, PyString_FromString(types.at(i).constData()));
526 #endif
528 #endif
527 }
529 }
528 info = info->nextInfo();
530 info = info->nextInfo();
529 PyTuple_SET_ITEM(result, j, tuple);
531 PyTuple_SET_ITEM(result, j, tuple);
530 }
532 }
531 return result;
533 return result;
532 }
534 }
533
535
534 PyObject *PythonQtMemberFunction_parameterNames(PythonQtSlotInfo* theInfo)
536 PyObject *PythonQtMemberFunction_parameterNames(PythonQtSlotInfo* theInfo)
535 {
537 {
536 PythonQtSlotInfo* info = theInfo;
538 PythonQtSlotInfo* info = theInfo;
537 int count = 0;
539 int count = 0;
538 while (info) {
540 while (info) {
539 info = info->nextInfo();
541 info = info->nextInfo();
540 count++;
542 count++;
541 }
543 }
542 info = theInfo;
544 info = theInfo;
543 PyObject* result = PyTuple_New(count);
545 PyObject* result = PyTuple_New(count);
544 for (int j = 0;j<count;j++) {
546 for (int j = 0;j<count;j++) {
545 QList<QByteArray> names = info->metaMethod()->parameterNames();
547 QList<QByteArray> names = info->metaMethod()->parameterNames();
546 PyObject* tuple = PyTuple_New(names.count());
548 PyObject* tuple = PyTuple_New(names.count());
547 for (int i = 0; i<names.count();i++) {
549 for (int i = 0; i<names.count();i++) {
548 #ifdef PY3K
550 #ifdef PY3K
549 PyTuple_SET_ITEM(tuple, i, PyUnicode_FromString(names.at(i).constData()));
551 PyTuple_SET_ITEM(tuple, i, PyUnicode_FromString(names.at(i).constData()));
550 #else
552 #else
551 PyTuple_SET_ITEM(tuple, i, PyString_FromString(names.at(i).constData()));
553 PyTuple_SET_ITEM(tuple, i, PyString_FromString(names.at(i).constData()));
552 #endif
554 #endif
553 }
555 }
554 info = info->nextInfo();
556 info = info->nextInfo();
555 PyTuple_SET_ITEM(result, j, tuple);
557 PyTuple_SET_ITEM(result, j, tuple);
556 }
558 }
557 return result;
559 return result;
558 }
560 }
559
561
560 PyObject *PythonQtMemberFunction_typeName(PythonQtSlotInfo* theInfo)
562 PyObject *PythonQtMemberFunction_typeName(PythonQtSlotInfo* theInfo)
561 {
563 {
562 PythonQtSlotInfo* info = theInfo;
564 PythonQtSlotInfo* info = theInfo;
563 int count = 0;
565 int count = 0;
564 while (info) {
566 while (info) {
565 info = info->nextInfo();
567 info = info->nextInfo();
566 count++;
568 count++;
567 }
569 }
568 info = theInfo;
570 info = theInfo;
569 PyObject* result = PyTuple_New(count);
571 PyObject* result = PyTuple_New(count);
570 for (int j = 0;j<count;j++) {
572 for (int j = 0;j<count;j++) {
571 QByteArray name = info->metaMethod()->typeName();
573 QByteArray name = info->metaMethod()->typeName();
572 #ifdef PY3K
574 #ifdef PY3K
573 PyTuple_SET_ITEM(result, j, PyUnicode_FromString(name.constData()));
575 PyTuple_SET_ITEM(result, j, PyUnicode_FromString(name.constData()));
574 #else
576 #else
575 PyTuple_SET_ITEM(result, j, PyString_FromString(name.constData()));
577 PyTuple_SET_ITEM(result, j, PyString_FromString(name.constData()));
576 #endif
578 #endif
577 info = info->nextInfo();
579 info = info->nextInfo();
578 }
580 }
579 return result;
581 return result;
580 }
582 }
581
583
582 static PyMethodDef meth_methods[] = {
584 static PyMethodDef meth_methods[] = {
583 {"parameterTypes", (PyCFunction)PythonQtSlotFunction_parameterTypes, METH_NOARGS,
585 {"parameterTypes", (PyCFunction)PythonQtSlotFunction_parameterTypes, METH_NOARGS,
584 "Returns a tuple of tuples of the C++ parameter types for all overloads of the slot"
586 "Returns a tuple of tuples of the C++ parameter types for all overloads of the slot"
585 },
587 },
586 {"parameterNames", (PyCFunction)PythonQtSlotFunction_parameterNames, METH_NOARGS,
588 {"parameterNames", (PyCFunction)PythonQtSlotFunction_parameterNames, METH_NOARGS,
587 "Returns a tuple of tuples of the C++ parameter type names (if available), for all overloads of the slot"
589 "Returns a tuple of tuples of the C++ parameter type names (if available), for all overloads of the slot"
588 },
590 },
589 {"typeName", (PyCFunction)PythonQtSlotFunction_typeName, METH_NOARGS,
591 {"typeName", (PyCFunction)PythonQtSlotFunction_typeName, METH_NOARGS,
590 "Returns a tuple of the C++ return value types of each slot overload"
592 "Returns a tuple of the C++ return value types of each slot overload"
591 },
593 },
592 {NULL, NULL, 0 , NULL} /* Sentinel */
594 {NULL, NULL, 0 , NULL} /* Sentinel */
593 };
595 };
594
596
595 static PyObject *
597 static PyObject *
596 meth_repr(PythonQtSlotFunctionObject *f)
598 meth_repr(PythonQtSlotFunctionObject *f)
597 {
599 {
598 if (f->m_self->ob_type == &PythonQtClassWrapper_Type) {
600 if (f->m_self->ob_type == &PythonQtClassWrapper_Type) {
599 PythonQtClassWrapper* self = (PythonQtClassWrapper*) f->m_self;
601 PythonQtClassWrapper* self = (PythonQtClassWrapper*) f->m_self;
600 #ifdef PY3K
602 #ifdef PY3K
601 return PyUnicode_FromFormat("<unbound qt slot %s of %s type>",
603 return PyUnicode_FromFormat("<unbound qt slot %s of %s type>",
602 #else
604 #else
603 return PyString_FromFormat("<unbound qt slot %s of %s type>",
605 return PyString_FromFormat("<unbound qt slot %s of %s type>",
604 #endif
606 #endif
605 f->m_ml->slotName().data(),
607 f->m_ml->slotName().data(),
606 self->classInfo()->className());
608 self->classInfo()->className());
607 } else {
609 } else {
608 #ifdef PY3K
610 #ifdef PY3K
609 return PyUnicode_FromFormat("<qt slot %s of %s instance at %p",
611 return PyUnicode_FromFormat("<qt slot %s of %s instance at %p",
610 #else
612 #else
611 return PyString_FromFormat("<qt slot %s of %s instance at %p>",
613 return PyString_FromFormat("<qt slot %s of %s instance at %p>",
612 #endif
614 #endif
613 f->m_ml->slotName().data(),
615 f->m_ml->slotName().data(),
614 f->m_self->ob_type->tp_name,
616 f->m_self->ob_type->tp_name,
615 f->m_self);
617 f->m_self);
616 }
618 }
617 }
619 }
618
620
619 static int
621 static int
620 meth_compare(PythonQtSlotFunctionObject *a, PythonQtSlotFunctionObject *b)
622 meth_compare(PythonQtSlotFunctionObject *a, PythonQtSlotFunctionObject *b)
621 {
623 {
622 if (a->m_self != b->m_self)
624 if (a->m_self != b->m_self)
623 return (a->m_self < b->m_self) ? -1 : 1;
625 return (a->m_self < b->m_self) ? -1 : 1;
624 if (a->m_ml == b->m_ml)
626 if (a->m_ml == b->m_ml)
625 return 0;
627 return 0;
626 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
628 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
627 if (strcmp(a->m_ml->metaMethod()->methodSignature(), b->m_ml->metaMethod()->methodSignature()) < 0)
629 if (strcmp(a->m_ml->metaMethod()->methodSignature(), b->m_ml->metaMethod()->methodSignature()) < 0)
628 #else
630 #else
629 if (strcmp(a->m_ml->metaMethod()->signature(), b->m_ml->metaMethod()->signature()) < 0)
631 if (strcmp(a->m_ml->metaMethod()->signature(), b->m_ml->metaMethod()->signature()) < 0)
630 #endif
632 #endif
631 return -1;
633 return -1;
632 else
634 else
633 return 1;
635 return 1;
634 }
636 }
635
637
636 static long
638 static long
637 meth_hash(PythonQtSlotFunctionObject *a)
639 meth_hash(PythonQtSlotFunctionObject *a)
638 {
640 {
639 long x,y;
641 long x,y;
640 if (a->m_self == NULL)
642 if (a->m_self == NULL)
641 x = 0;
643 x = 0;
642 else {
644 else {
643 x = PyObject_Hash(a->m_self);
645 x = PyObject_Hash(a->m_self);
644 if (x == -1)
646 if (x == -1)
645 return -1;
647 return -1;
646 }
648 }
647 y = _Py_HashPointer((void*)(a->m_ml));
649 y = _Py_HashPointer((void*)(a->m_ml));
648 if (y == -1)
650 if (y == -1)
649 return -1;
651 return -1;
650 x ^= y;
652 x ^= y;
651 if (x == -1)
653 if (x == -1)
652 x = -2;
654 x = -2;
653 return x;
655 return x;
654 }
656 }
655
657
656 // for python 3.x
658 // for python 3.x
657 static PyObject*
659 static PyObject*
658 meth_richcompare(PythonQtSlotFunctionObject *a, PythonQtSlotFunctionObject *b, int op)
660 meth_richcompare(PythonQtSlotFunctionObject *a, PythonQtSlotFunctionObject *b, int op)
659 {
661 {
660 int x = meth_compare(a, b);
662 int x = meth_compare(a, b);
661 bool r;
663 bool r;
662 if (op == Py_LT)
664 if (op == Py_LT)
663 r = x < 0;
665 r = x < 0;
664 else if (op == Py_LE)
666 else if (op == Py_LE)
665 r = x < 1;
667 r = x < 1;
666 else if (op == Py_EQ)
668 else if (op == Py_EQ)
667 r = x == 0;
669 r = x == 0;
668 else if (op == Py_NE)
670 else if (op == Py_NE)
669 r = x != 0;
671 r = x != 0;
670 else if (op == Py_GE)
672 else if (op == Py_GE)
671 r = x > -1;
673 r = x > -1;
672 else if (op == Py_GT)
674 else if (op == Py_GT)
673 r = x > 0;
675 r = x > 0;
674 if (r)
676 if (r)
675 Py_RETURN_TRUE;
677 Py_RETURN_TRUE;
676 else
678 else
677 Py_RETURN_FALSE;
679 Py_RETURN_FALSE;
678 }
680 }
679
681
680
682
681 PyTypeObject PythonQtSlotFunction_Type = {
683 PyTypeObject PythonQtSlotFunction_Type = {
682 PyVarObject_HEAD_INIT(&PyType_Type, 0)
684 PyVarObject_HEAD_INIT(&PyType_Type, 0)
683 "builtin_qt_slot",
685 "builtin_qt_slot",
684 sizeof(PythonQtSlotFunctionObject),
686 sizeof(PythonQtSlotFunctionObject),
685 0,
687 0,
686 (destructor)meth_dealloc, /* tp_dealloc */
688 (destructor)meth_dealloc, /* tp_dealloc */
687 0, /* tp_print */
689 0, /* tp_print */
688 0, /* tp_getattr */
690 0, /* tp_getattr */
689 0, /* tp_setattr */
691 0, /* tp_setattr */
690 #ifdef PY3K
692 #ifdef PY3K
691 0,
693 0,
692 #else
694 #else
693 (cmpfunc)meth_compare, /* tp_compare */
695 (cmpfunc)meth_compare, /* tp_compare */
694 #endif
696 #endif
695 (reprfunc)meth_repr, /* tp_repr */
697 (reprfunc)meth_repr, /* tp_repr */
696 0, /* tp_as_number */
698 0, /* tp_as_number */
697 0, /* tp_as_sequence */
699 0, /* tp_as_sequence */
698 0, /* tp_as_mapping */
700 0, /* tp_as_mapping */
699 (hashfunc)meth_hash, /* tp_hash */
701 (hashfunc)meth_hash, /* tp_hash */
700 PythonQtSlotFunction_Call, /* tp_call */
702 PythonQtSlotFunction_Call, /* tp_call */
701 0, /* tp_str */
703 0, /* tp_str */
702 PyObject_GenericGetAttr, /* tp_getattro */
704 PyObject_GenericGetAttr, /* tp_getattro */
703 0, /* tp_setattro */
705 0, /* tp_setattro */
704 0, /* tp_as_buffer */
706 0, /* tp_as_buffer */
705 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
707 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
706 0, /* tp_doc */
708 0, /* tp_doc */
707 (traverseproc)meth_traverse, /* tp_traverse */
709 (traverseproc)meth_traverse, /* tp_traverse */
708 0, /* tp_clear */
710 0, /* tp_clear */
709 (richcmpfunc)meth_richcompare, /* tp_richcompare */
711 (richcmpfunc)meth_richcompare, /* tp_richcompare */
710 0, /* tp_weaklistoffset */
712 0, /* tp_weaklistoffset */
711 0, /* tp_iter */
713 0, /* tp_iter */
712 0, /* tp_iternext */
714 0, /* tp_iternext */
713 meth_methods, /* tp_methods */
715 meth_methods, /* tp_methods */
714 meth_members, /* tp_members */
716 meth_members, /* tp_members */
715 meth_getsets, /* tp_getset */
717 meth_getsets, /* tp_getset */
716 0, /* tp_base */
718 0, /* tp_base */
717 0, /* tp_dict */
719 0, /* tp_dict */
718 };
720 };
719
721
720 /* Clear out the free list */
722 /* Clear out the free list */
721
723
722 void
724 void
723 PythonQtSlotFunction_Fini(void)
725 PythonQtSlotFunction_Fini(void)
724 {
726 {
725 while (pythonqtslot_free_list) {
727 while (pythonqtslot_free_list) {
726 PythonQtSlotFunctionObject *v = pythonqtslot_free_list;
728 PythonQtSlotFunctionObject *v = pythonqtslot_free_list;
727 pythonqtslot_free_list = (PythonQtSlotFunctionObject *)(v->m_self);
729 pythonqtslot_free_list = (PythonQtSlotFunctionObject *)(v->m_self);
728 PyObject_GC_Del(v);
730 PyObject_GC_Del(v);
729 }
731 }
730 }
732 }
731
733
@@ -1,52 +1,36
1 # --------- PythonQt profile -------------------
1 # --------- PythonQt profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6
6
7 TARGET = PythonQt
7 TARGET = PythonQt
8 TEMPLATE = lib
8 TEMPLATE = lib
9
9
10
10
11 DESTDIR = ../lib
11 DESTDIR = ../lib
12
12
13 CONFIG += qt dll
13 CONFIG += qt
14 CONFIG -= flat
14 CONFIG -= flat
15
15
16
17 # allow to choose static linking through the environment variable PYTHONQT_STATIC
18 PYTHONQT_STATIC = $$(PYTHONQT_STATIC)
19 isEmpty(PYTHONQT_STATIC) {
20 CONFIG += dll
21 } else {
22 CONFIG += static
23 }
24
16 contains(QT_MAJOR_VERSION, 5) {
25 contains(QT_MAJOR_VERSION, 5) {
17 QT += widgets
26 QT += widgets
18 }
27 }
19
28
20 mac {
29 mac {
21 OTHER_FILES += ../scripts/osx-fix-dylib.sh
30 OTHER_FILES += ../scripts/osx-fix-dylib.sh
22 }
31 }
23
32
24 include ( ../build/common.prf )
33 include ( ../build/common.prf )
25 include ( ../build/python.prf )
34 include ( ../build/python.prf )
26
35
27 include ( src.pri )
36 include ( src.pri )
28 #added by Aje for install QT dirs.
29 #Copyed from Qscintilla config ;).
30
31
32 pythoncfg.path = $$[QT_INSTALL_PREFIX]/mkspecs/features
33 pythoncfg.files = ../build/pythonqt.prf
34
35 target.path = $$[QT_INSTALL_LIBS]
36 isEmpty(target.path) {
37 target.path = $(QTDIR)/lib
38 }
39
40 header.path = $$[QT_INSTALL_HEADERS]/PythonQt
41 header.files = *.h
42 isEmpty(header.path) {
43 header.path = $(QTDIR)/include/PythonQt
44 header.files = *.h
45 }
46 guiheader.path = $$[QT_INSTALL_HEADERS]/PythonQt/gui
47 guiheader.files = gui/*.h
48 isEmpty(guiheader.path) {
49 guiheader.path = $(QTDIR)/include/PythonQt/gui
50 guiheader.files = gui/*.h
51 }
52 INSTALLS += header target guiheader pythoncfg
@@ -1,595 +1,595
1 /*
1 /*
2 *
2 *
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 *
4 *
5 * This library is free software; you can redistribute it and/or
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
8 * version 2.1 of the License, or (at your option) any later version.
9 *
9 *
10 * This library is distributed in the hope that it will be useful,
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
13 * Lesser General Public License for more details.
14 *
14 *
15 * Further, this software is distributed without any warranty that it is
15 * Further, this software is distributed without any warranty that it is
16 * free of the rightful claim of any third person regarding infringement
16 * free of the rightful claim of any third person regarding infringement
17 * or the like. Any license provided herein, whether implied or
17 * or the like. Any license provided herein, whether implied or
18 * otherwise, applies only to this software file. Patent licenses, if
18 * otherwise, applies only to this software file. Patent licenses, if
19 * any, provided herein do not apply to combinations of this program with
19 * any, provided herein do not apply to combinations of this program with
20 * other software, or any other product whatsoever.
20 * other software, or any other product whatsoever.
21 *
21 *
22 * You should have received a copy of the GNU Lesser General Public
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with this library; if not, write to the Free Software
23 * License along with this library; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
25 *
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 * 28359 Bremen, Germany or:
27 * 28359 Bremen, Germany or:
28 *
28 *
29 * http://www.mevis.de
29 * http://www.mevis.de
30 *
30 *
31 */
31 */
32
32
33 //----------------------------------------------------------------------------------
33 //----------------------------------------------------------------------------------
34 /*!
34 /*!
35 // \file PythonQtTests.cpp
35 // \file PythonQtTests.cpp
36 // \author Florian Link
36 // \author Florian Link
37 // \author Last changed by $Author: florian $
37 // \author Last changed by $Author: florian $
38 // \date 2006-05
38 // \date 2006-05
39 */
39 */
40 //----------------------------------------------------------------------------------
40 //----------------------------------------------------------------------------------
41
41
42 #include "PythonQtTests.h"
42 #include "PythonQtTests.h"
43
43
44 void PythonQtTestSlotCalling::initTestCase()
44 void PythonQtTestSlotCalling::initTestCase()
45 {
45 {
46 _helper = new PythonQtTestSlotCallingHelper(this);
46 _helper = new PythonQtTestSlotCallingHelper(this);
47 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
47 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
48 main.evalScript("import PythonQt");
48 main.evalScript("import PythonQt");
49 PythonQt::self()->addObject(main, "obj", _helper);
49 PythonQt::self()->addObject(main, "obj", _helper);
50 }
50 }
51
51
52 void PythonQtTestSlotCalling::init() {
52 void PythonQtTestSlotCalling::init() {
53
53
54 }
54 }
55
55
56
56
57 void* polymorphic_ClassB_Handler(const void* ptr, const char** className) {
57 void* polymorphic_ClassB_Handler(const void* ptr, const char** className) {
58 ClassB* o = (ClassB*)ptr;
58 ClassB* o = (ClassB*)ptr;
59 if (o->type()==2) {
59 if (o->type()==2) {
60 *className = "ClassB";
60 *className = "ClassB";
61 return (ClassB*)o;
61 return (ClassB*)o;
62 }
62 }
63 if (o->type()==3) {
63 if (o->type()==3) {
64 *className = "ClassC";
64 *className = "ClassC";
65 return (ClassC*)o;
65 return (ClassC*)o;
66 }
66 }
67 if (o->type()==4) {
67 if (o->type()==4) {
68 *className = "ClassD";
68 *className = "ClassD";
69 return (ClassD*)o;
69 return (ClassD*)o;
70 }
70 }
71 return NULL;
71 return NULL;
72 }
72 }
73
73
74 void PythonQtTestSlotCalling::testInheritance() {
74 void PythonQtTestSlotCalling::testInheritance() {
75 PythonQt::self()->registerCPPClass("ClassA",NULL,NULL, PythonQtCreateObject<ClassAWrapper>);
75 PythonQt::self()->registerCPPClass("ClassA",NULL,NULL, PythonQtCreateObject<ClassAWrapper>);
76 PythonQt::self()->registerCPPClass("ClassB",NULL,NULL, PythonQtCreateObject<ClassBWrapper>);
76 PythonQt::self()->registerCPPClass("ClassB",NULL,NULL, PythonQtCreateObject<ClassBWrapper>);
77 PythonQt::self()->registerCPPClass("ClassC",NULL,NULL, PythonQtCreateObject<ClassCWrapper>);
77 PythonQt::self()->registerCPPClass("ClassC",NULL,NULL, PythonQtCreateObject<ClassCWrapper>);
78 PythonQt::self()->addParentClass("ClassC", "ClassA", PythonQtUpcastingOffset<ClassC,ClassA>());
78 PythonQt::self()->addParentClass("ClassC", "ClassA", PythonQtUpcastingOffset<ClassC,ClassA>());
79 PythonQt::self()->addParentClass("ClassC", "ClassB", PythonQtUpcastingOffset<ClassC,ClassB>());
79 PythonQt::self()->addParentClass("ClassC", "ClassB", PythonQtUpcastingOffset<ClassC,ClassB>());
80 PythonQt::self()->registerClass(&ClassD::staticMetaObject, NULL, PythonQtCreateObject<ClassDWrapper>);
80 PythonQt::self()->registerClass(&ClassD::staticMetaObject, NULL, PythonQtCreateObject<ClassDWrapper>);
81 PythonQt::self()->addParentClass("ClassD", "ClassA", PythonQtUpcastingOffset<ClassD,ClassA>());
81 PythonQt::self()->addParentClass("ClassD", "ClassA", PythonQtUpcastingOffset<ClassD,ClassA>());
82 PythonQt::self()->addParentClass("ClassD", "ClassB", PythonQtUpcastingOffset<ClassD,ClassB>());
82 PythonQt::self()->addParentClass("ClassD", "ClassB", PythonQtUpcastingOffset<ClassD,ClassB>());
83
83
84 PythonQtObjectPtr classA = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassA");
84 PythonQtObjectPtr classA = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassA");
85 PythonQtObjectPtr classB = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassB");
85 PythonQtObjectPtr classB = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassB");
86 PythonQtObjectPtr classC = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassC");
86 PythonQtObjectPtr classC = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassC");
87 PythonQtObjectPtr classD = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassD");
87 PythonQtObjectPtr classD = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassD");
88 QVERIFY(classA);
88 QVERIFY(classA);
89 QVERIFY(classB);
89 QVERIFY(classB);
90 QVERIFY(classC);
90 QVERIFY(classC);
91 QVERIFY(classD);
91 QVERIFY(classD);
92
92
93 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
93 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
94 QEXPECT_FAIL("", "ClassB can not be converted to ClassA", Continue);
94 QEXPECT_FAIL("", "ClassB can not be converted to ClassA", Continue);
95 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
95 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
96 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
96 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
97 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
97 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
98
98
99 QEXPECT_FAIL("", "ClassA can not be converted to ClassB", Continue);
99 QEXPECT_FAIL("", "ClassA can not be converted to ClassB", Continue);
100 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
100 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
101 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
101 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
102 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
102 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
103 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
103 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
104
104
105 QEXPECT_FAIL("", "ClassA can not be converted to ClassC", Continue);
105 QEXPECT_FAIL("", "ClassA can not be converted to ClassC", Continue);
106 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
106 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
107 QEXPECT_FAIL("", "ClassB can not be converted to ClassC", Continue);
107 QEXPECT_FAIL("", "ClassB can not be converted to ClassC", Continue);
108 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
108 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
109 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
109 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
110 QEXPECT_FAIL("", "ClassD can not be converted to ClassC", Continue);
110 QEXPECT_FAIL("", "ClassD can not be converted to ClassC", Continue);
111 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
111 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
112
112
113 QVERIFY(_helper->runScript("if type(obj.createClassA())==PythonQt.private.ClassA: obj.setPassed();\n"));
113 QVERIFY(_helper->runScript("if type(obj.createClassA())==PythonQt.private.ClassA: obj.setPassed();\n"));
114 QVERIFY(_helper->runScript("if type(obj.createClassB())==PythonQt.private.ClassB: obj.setPassed();\n"));
114 QVERIFY(_helper->runScript("if type(obj.createClassB())==PythonQt.private.ClassB: obj.setPassed();\n"));
115 QVERIFY(_helper->runScript("if type(obj.createClassCAsA())==PythonQt.private.ClassA: obj.setPassed();\n"));
115 QVERIFY(_helper->runScript("if type(obj.createClassCAsA())==PythonQt.private.ClassA: obj.setPassed();\n"));
116 QVERIFY(_helper->runScript("if type(obj.createClassCAsB())==PythonQt.private.ClassB: obj.setPassed();\n"));
116 QVERIFY(_helper->runScript("if type(obj.createClassCAsB())==PythonQt.private.ClassB: obj.setPassed();\n"));
117 QVERIFY(_helper->runScript("if type(obj.createClassD())==PythonQt.private.ClassD: obj.setPassed();\n"));
117 QVERIFY(_helper->runScript("if type(obj.createClassD())==PythonQt.private.ClassD: obj.setPassed();\n"));
118 QVERIFY(_helper->runScript("if type(obj.createClassDAsA())==PythonQt.private.ClassA: obj.setPassed();\n"));
118 QVERIFY(_helper->runScript("if type(obj.createClassDAsA())==PythonQt.private.ClassA: obj.setPassed();\n"));
119 QVERIFY(_helper->runScript("if type(obj.createClassDAsB())==PythonQt.private.ClassB: obj.setPassed();\n"));
119 QVERIFY(_helper->runScript("if type(obj.createClassDAsB())==PythonQt.private.ClassB: obj.setPassed();\n"));
120
120
121 PythonQt::self()->addPolymorphicHandler("ClassB", polymorphic_ClassB_Handler);
121 PythonQt::self()->addPolymorphicHandler("ClassB", polymorphic_ClassB_Handler);
122
122
123 QVERIFY(_helper->runScript("if type(obj.getClassBPtr(obj.createClassB()))==PythonQt.private.ClassB: obj.setPassed();\n"));
123 QVERIFY(_helper->runScript("if type(obj.getClassBPtr(obj.createClassB()))==PythonQt.private.ClassB: obj.setPassed();\n"));
124 QVERIFY(_helper->runScript("if type(obj.createClassCAsB())==PythonQt.private.ClassC: obj.setPassed();\n"));
124 QVERIFY(_helper->runScript("if type(obj.createClassCAsB())==PythonQt.private.ClassC: obj.setPassed();\n"));
125 QVERIFY(_helper->runScript("if type(obj.createClassDAsB())==PythonQt.private.ClassD: obj.setPassed();\n"));
125 QVERIFY(_helper->runScript("if type(obj.createClassDAsB())==PythonQt.private.ClassD: obj.setPassed();\n"));
126
126
127 }
127 }
128
128
129 void PythonQtTestSlotCalling::testAutoConversion() {
129 void PythonQtTestSlotCalling::testAutoConversion() {
130 QVERIFY(_helper->runScript("if obj.setAutoConvertColor(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QColor(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
130 QVERIFY(_helper->runScript("if obj.setAutoConvertColor(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QColor(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
131 QVERIFY(_helper->runScript("if obj.setAutoConvertBrush(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QBrush(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
131 QVERIFY(_helper->runScript("if obj.setAutoConvertBrush(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QBrush(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
132 QVERIFY(_helper->runScript("if obj.setAutoConvertPen(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QPen(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
132 QVERIFY(_helper->runScript("if obj.setAutoConvertPen(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QPen(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
133 QVERIFY(_helper->runScript("if obj.setAutoConvertBrush(PythonQt.Qt.QColor(PythonQt.QtCore.Qt.red))==PythonQt.Qt.QBrush(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
133 QVERIFY(_helper->runScript("if obj.setAutoConvertBrush(PythonQt.Qt.QColor(PythonQt.QtCore.Qt.red))==PythonQt.Qt.QBrush(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
134 QVERIFY(_helper->runScript("if obj.setAutoConvertPen(PythonQt.Qt.QColor(PythonQt.QtCore.Qt.red))==PythonQt.Qt.QPen(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
134 QVERIFY(_helper->runScript("if obj.setAutoConvertPen(PythonQt.Qt.QColor(PythonQt.QtCore.Qt.red))==PythonQt.Qt.QPen(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
135 QVERIFY(_helper->runScript("if obj.setAutoConvertCursor(PythonQt.Qt.QCursor(PythonQt.QtCore.Qt.UpArrowCursor)).shape()==PythonQt.Qt.QCursor(PythonQt.QtCore.Qt.UpArrowCursor).shape(): obj.setPassed();\n"));
135 QVERIFY(_helper->runScript("if obj.setAutoConvertCursor(PythonQt.Qt.QCursor(PythonQt.QtCore.Qt.UpArrowCursor)).shape()==PythonQt.Qt.QCursor(PythonQt.QtCore.Qt.UpArrowCursor).shape(): obj.setPassed();\n"));
136 QVERIFY(_helper->runScript("if obj.setAutoConvertCursor(PythonQt.QtCore.Qt.UpArrowCursor).shape()==PythonQt.Qt.QCursor(PythonQt.QtCore.Qt.UpArrowCursor).shape(): obj.setPassed();\n"));
136 QVERIFY(_helper->runScript("if obj.setAutoConvertCursor(PythonQt.QtCore.Qt.UpArrowCursor).shape()==PythonQt.Qt.QCursor(PythonQt.QtCore.Qt.UpArrowCursor).shape(): obj.setPassed();\n"));
137 }
137 }
138
138
139 void PythonQtTestSlotCalling::testNoArgSlotCall()
139 void PythonQtTestSlotCalling::testNoArgSlotCall()
140 {
140 {
141 QVERIFY(_helper->runScript("obj.testNoArg(); obj.setPassed();\n"));
141 QVERIFY(_helper->runScript("obj.testNoArg(); obj.setPassed();\n"));
142 }
142 }
143
143
144 void PythonQtTestSlotCalling::testOverloadedCall()
144 void PythonQtTestSlotCalling::testOverloadedCall()
145 {
145 {
146 QVERIFY(_helper->runScript("obj.overload(False); obj.setPassed();\n", 0));
146 QVERIFY(_helper->runScript("obj.overload(False); obj.setPassed();\n", 0));
147 QVERIFY(_helper->runScript("obj.overload(True); obj.setPassed();\n", 0));
147 QVERIFY(_helper->runScript("obj.overload(True); obj.setPassed();\n", 0));
148 QVERIFY(_helper->runScript("obj.overload(12.5); obj.setPassed();\n", 1));
148 QVERIFY(_helper->runScript("obj.overload(12.5); obj.setPassed();\n", 1));
149 QVERIFY(_helper->runScript("obj.overload(12); obj.setPassed();\n", 2));
149 QVERIFY(_helper->runScript("obj.overload(12); obj.setPassed();\n", 2));
150 QVERIFY(_helper->runScript("obj.overload('test'); obj.setPassed();\n", 3));
150 QVERIFY(_helper->runScript("obj.overload('test'); obj.setPassed();\n", 3));
151 QVERIFY(_helper->runScript("obj.overload(u'test'); obj.setPassed();\n", 3));
151 QVERIFY(_helper->runScript("obj.overload(u'test'); obj.setPassed();\n", 3));
152 QVERIFY(_helper->runScript("obj.overload(('test','test2')); obj.setPassed();\n", 4));
152 QVERIFY(_helper->runScript("obj.overload(('test','test2')); obj.setPassed();\n", 4));
153 QVERIFY(_helper->runScript("obj.overload(obj); obj.setPassed();\n", 5));
153 QVERIFY(_helper->runScript("obj.overload(obj); obj.setPassed();\n", 5));
154 QVERIFY(_helper->runScript("obj.overload(12,13); obj.setPassed();\n", 6));
154 QVERIFY(_helper->runScript("obj.overload(12,13); obj.setPassed();\n", 6));
155 }
155 }
156
156
157 void PythonQtTestSlotCalling::testPyObjectSlotCall()
157 void PythonQtTestSlotCalling::testPyObjectSlotCall()
158 {
158 {
159 QVERIFY(_helper->runScript("if obj.getPyObject(PythonQt)==PythonQt: obj.setPassed();\n"));
159 QVERIFY(_helper->runScript("if obj.getPyObject(PythonQt)==PythonQt: obj.setPassed();\n"));
160 QVERIFY(_helper->runScript("if obj.getPyObject('Hello')=='Hello': obj.setPassed();\n"));
160 QVERIFY(_helper->runScript("if obj.getPyObject('Hello')=='Hello': obj.setPassed();\n"));
161 QVERIFY(_helper->runScript("if obj.getPyObjectFromVariant(PythonQt)==PythonQt: obj.setPassed();\n"));
161 QVERIFY(_helper->runScript("if obj.getPyObjectFromVariant(PythonQt)==PythonQt: obj.setPassed();\n"));
162 QVERIFY(_helper->runScript("if obj.getPyObjectFromVariant2(PythonQt)==PythonQt: obj.setPassed();\n"));
162 QVERIFY(_helper->runScript("if obj.getPyObjectFromVariant2(PythonQt)==PythonQt: obj.setPassed();\n"));
163 // QVERIFY(_helper->runScript("if obj.getPyObjectFromPtr(PythonQt)==PythonQt: obj.setPassed();\n"));
163 // QVERIFY(_helper->runScript("if obj.getPyObjectFromPtr(PythonQt)==PythonQt: obj.setPassed();\n"));
164 }
164 }
165
165
166 void PythonQtTestSlotCalling::testCPPSlotCalls()
166 void PythonQtTestSlotCalling::testCPPSlotCalls()
167 {
167 {
168 // test QColor compare operation
168 // test QColor compare operation
169 QVERIFY(_helper->runScript("if PythonQt.QtGui.QColor(1,2,3)==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();obj.testNoArg()\n"));
169 QVERIFY(_helper->runScript("if PythonQt.QtGui.QColor(1,2,3)==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();obj.testNoArg()\n"));
170 QVERIFY(_helper->runScript("if PythonQt.QtGui.QColor(1,2,3)!=PythonQt.QtGui.QColor(3,2,1): obj.setPassed();obj.testNoArg()\n"));
170 QVERIFY(_helper->runScript("if PythonQt.QtGui.QColor(1,2,3)!=PythonQt.QtGui.QColor(3,2,1): obj.setPassed();obj.testNoArg()\n"));
171
171
172 // test passing/returning QColors
172 // test passing/returning QColors
173 QVERIFY(_helper->runScript("if obj.getQColor1(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
173 QVERIFY(_helper->runScript("if obj.getQColor1(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
174 QVERIFY(_helper->runScript("if obj.getQColor2(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
174 QVERIFY(_helper->runScript("if obj.getQColor2(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
175 QVERIFY(_helper->runScript("if obj.getQColor3(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
175 QVERIFY(_helper->runScript("if obj.getQColor3(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
176 QVERIFY(_helper->runScript("if obj.getQColor4(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
176 QVERIFY(_helper->runScript("if obj.getQColor4(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
177 QVERIFY(_helper->runScript("if obj.getQColor5()==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
177 QVERIFY(_helper->runScript("if obj.getQColor5()==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
178 }
178 }
179
179
180 void PythonQtTestSlotCalling::testPODSlotCalls()
180 void PythonQtTestSlotCalling::testPODSlotCalls()
181 {
181 {
182 QVERIFY(_helper->runScript("if obj.getBool(False)==False: obj.setPassed();\n"));
182 QVERIFY(_helper->runScript("if obj.getBool(False)==False: obj.setPassed();\n"));
183 QVERIFY(_helper->runScript("if obj.getBool(True)==True: obj.setPassed();\n"));
183 QVERIFY(_helper->runScript("if obj.getBool(True)==True: obj.setPassed();\n"));
184 QVERIFY(_helper->runScript("if obj.getInt(-42)==-42: obj.setPassed();\n"));
184 QVERIFY(_helper->runScript("if obj.getInt(-42)==-42: obj.setPassed();\n"));
185 QVERIFY(_helper->runScript("if obj.getUInt(42)==42: obj.setPassed();\n"));
185 QVERIFY(_helper->runScript("if obj.getUInt(42)==42: obj.setPassed();\n"));
186 QVERIFY(_helper->runScript("if obj.getShort(-43)==-43: obj.setPassed();\n"));
186 QVERIFY(_helper->runScript("if obj.getShort(-43)==-43: obj.setPassed();\n"));
187 QVERIFY(_helper->runScript("if obj.getUShort(43)==43: obj.setPassed();\n"));
187 QVERIFY(_helper->runScript("if obj.getUShort(43)==43: obj.setPassed();\n"));
188 QVERIFY(_helper->runScript("if obj.getChar(-12)==-12: obj.setPassed();\n"));
188 QVERIFY(_helper->runScript("if obj.getChar(-12)==-12: obj.setPassed();\n"));
189 QVERIFY(_helper->runScript("if obj.getUChar(12)==12: obj.setPassed();\n"));
189 QVERIFY(_helper->runScript("if obj.getUChar(12)==12: obj.setPassed();\n"));
190 QVERIFY(_helper->runScript("if obj.getLong(-256*256*256)==-256*256*256: obj.setPassed();\n"));
190 QVERIFY(_helper->runScript("if obj.getLong(-256*256*256)==-256*256*256: obj.setPassed();\n"));
191 QVERIFY(_helper->runScript("if obj.getULong(256*256*256)==256*256*256: obj.setPassed();\n"));
191 QVERIFY(_helper->runScript("if obj.getULong(256*256*256)==256*256*256: obj.setPassed();\n"));
192 QVERIFY(_helper->runScript("if obj.getLongLong(-42)==-42: obj.setPassed();\n"));
192 QVERIFY(_helper->runScript("if obj.getLongLong(-42)==-42: obj.setPassed();\n"));
193 QVERIFY(_helper->runScript("if obj.getULongLong(42)==42: obj.setPassed();\n"));
193 QVERIFY(_helper->runScript("if obj.getULongLong(42)==42: obj.setPassed();\n"));
194 QVERIFY(_helper->runScript("if obj.getQChar(4096)==4096: obj.setPassed();\n"));
194 QVERIFY(_helper->runScript("if obj.getQChar(4096)==4096: obj.setPassed();\n"));
195 QVERIFY(_helper->runScript("if obj.getDouble(47.12)==47.12: obj.setPassed();\n"));
195 QVERIFY(_helper->runScript("if obj.getDouble(47.12)==47.12: obj.setPassed();\n"));
196 QVERIFY(_helper->runScript("if abs(obj.getFloat(47.11)-47.11)<0.01: obj.setPassed();\n"));
196 QVERIFY(_helper->runScript("if abs(obj.getFloat(47.11)-47.11)<0.01: obj.setPassed();\n"));
197 QVERIFY(_helper->runScript("if obj.getQString('testStr')=='testStr': obj.setPassed();\n"));
197 QVERIFY(_helper->runScript("if obj.getQString('testStr')=='testStr': obj.setPassed();\n"));
198 QVERIFY(_helper->runScript("if obj.getQString('')=='': obj.setPassed();\n"));
198 QVERIFY(_helper->runScript("if obj.getQString('')=='': obj.setPassed();\n"));
199 QVERIFY(_helper->runScript("if obj.getQStringList(('test','test2'))==('test','test2'): obj.setPassed();\n"));
199 QVERIFY(_helper->runScript("if obj.getQStringList(('test','test2'))==('test','test2'): obj.setPassed();\n"));
200 }
200 }
201
201
202 void PythonQtTestSlotCalling::testQVariantSlotCalls()
202 void PythonQtTestSlotCalling::testQVariantSlotCalls()
203 {
203 {
204 QVERIFY(_helper->runScript("if obj.getQVariant(-42)==-42: obj.setPassed();\n"));
204 QVERIFY(_helper->runScript("if obj.getQVariant(-42)==-42: obj.setPassed();\n"));
205 QVERIFY(_helper->runScript("if obj.getQVariant('testStr')=='testStr': obj.setPassed();\n"));
205 QVERIFY(_helper->runScript("if obj.getQVariant('testStr')=='testStr': obj.setPassed();\n"));
206 QVERIFY(_helper->runScript("if obj.getQVariant(('test','test2'))==('test','test2'): obj.setPassed();\n"));
206 QVERIFY(_helper->runScript("if obj.getQVariant(('test','test2'))==('test','test2'): obj.setPassed();\n"));
207 QVERIFY(_helper->runScript("if obj.getQVariant(('test',12, 47.11))==('test',12, 47.11): obj.setPassed();\n"));
207 QVERIFY(_helper->runScript("if obj.getQVariant(('test',12, 47.11))==('test',12, 47.11): obj.setPassed();\n"));
208 QVERIFY(_helper->runScript("if obj.getQVariant({'test':'bla','test2':47.11})=={'test':'bla','test2':47.11}: obj.setPassed();\n"));
208 QVERIFY(_helper->runScript("if obj.getQVariant({'test':'bla','test2':47.11})=={'test':'bla','test2':47.11}: obj.setPassed();\n"));
209 QEXPECT_FAIL("", "Testing to pass a map and compare with a different map", Continue);
209 QEXPECT_FAIL("", "Testing to pass a map and compare with a different map", Continue);
210 QVERIFY(_helper->runScript("if obj.getQVariant({'test':'bla2','test2':47.11})=={'test':'bla','test2':47.11}: obj.setPassed();\n"));
210 QVERIFY(_helper->runScript("if obj.getQVariant({'test':'bla2','test2':47.11})=={'test':'bla','test2':47.11}: obj.setPassed();\n"));
211 QVERIFY(_helper->runScript("if obj.getQVariant(obj)==obj: obj.setPassed();\n"));
211 QVERIFY(_helper->runScript("if obj.getQVariant(obj)==obj: obj.setPassed();\n"));
212 }
212 }
213
213
214 void PythonQtTestSlotCalling::testObjectSlotCalls()
214 void PythonQtTestSlotCalling::testObjectSlotCalls()
215 {
215 {
216 QVERIFY(_helper->runScript("if obj.getQObject(obj)==obj: obj.setPassed();\n"));
216 QVERIFY(_helper->runScript("if obj.getQObject(obj)==obj: obj.setPassed();\n"));
217 QVERIFY(_helper->runScript("if obj.getTestObject(obj)==obj: obj.setPassed();\n"));
217 QVERIFY(_helper->runScript("if obj.getTestObject(obj)==obj: obj.setPassed();\n"));
218 QVERIFY(_helper->runScript("if obj.getNewObject().className()=='PythonQtTestSlotCallingHelper': obj.setPassed();\n"));
218 QVERIFY(_helper->runScript("if obj.getNewObject().className()=='PythonQtTestSlotCallingHelper': obj.setPassed();\n"));
219 QEXPECT_FAIL("", "Testing to pass a QObject when another object was expected", Continue);
219 QEXPECT_FAIL("", "Testing to pass a QObject when another object was expected", Continue);
220 QVERIFY(_helper->runScript("if obj.getQWidget(obj)==obj: obj.setPassed();\n"));
220 QVERIFY(_helper->runScript("if obj.getQWidget(obj)==obj: obj.setPassed();\n"));
221 }
221 }
222
222
223 void PythonQtTestSlotCalling::testCppFactory()
223 void PythonQtTestSlotCalling::testCppFactory()
224 {
224 {
225 PythonQtTestCppFactory* f = new PythonQtTestCppFactory;
225 PythonQtTestCppFactory* f = new PythonQtTestCppFactory;
226 PythonQt::self()->addInstanceDecorators(new PQCppObjectDecorator);
226 PythonQt::self()->addInstanceDecorators(new PQCppObjectDecorator);
227 // do not register, since we want to know if that works as well
227 // do not register, since we want to know if that works as well
228 //qRegisterMetaType<PQCppObjectNoWrap>("PQCppObjectNoWrap");
228 //qRegisterMetaType<PQCppObjectNoWrap>("PQCppObjectNoWrap");
229 PythonQt::self()->addDecorators(new PQCppObjectNoWrapDecorator);
229 PythonQt::self()->addDecorators(new PQCppObjectNoWrapDecorator);
230
230
231 PythonQt::self()->addWrapperFactory(f);
231 PythonQt::self()->addWrapperFactory(f);
232 QVERIFY(_helper->runScript("if obj.createPQCppObject(12).getHeight()==12: obj.setPassed();\n"));
232 QVERIFY(_helper->runScript("if obj.createPQCppObject(12).getHeight()==12: obj.setPassed();\n"));
233 QVERIFY(_helper->runScript("if obj.createPQCppObject(12).getH()==12: obj.setPassed();\n"));
233 QVERIFY(_helper->runScript("if obj.createPQCppObject(12).getH()==12: obj.setPassed();\n"));
234 QVERIFY(_helper->runScript("pq1 = obj.createPQCppObject(12);\n"
234 QVERIFY(_helper->runScript("pq1 = obj.createPQCppObject(12);\n"
235 "pq2 = obj.createPQCppObject(13);\n"
235 "pq2 = obj.createPQCppObject(13);\n"
236 "pq3 = obj.getPQCppObject(pq1);\n"
236 "pq3 = obj.getPQCppObject(pq1);\n"
237 "pq4 = obj.getPQCppObject(pq2);\n"
237 "pq4 = obj.getPQCppObject(pq2);\n"
238 "if pq3.getHeight()==12 and pq4.getHeight()==13: obj.setPassed();\n"
238 "if pq3.getHeight()==12 and pq4.getHeight()==13: obj.setPassed();\n"
239 ));
239 ));
240
240
241 QVERIFY(_helper->runScript("if obj.createPQCppObjectNoWrap(12).getH()==12: obj.setPassed();\n"));
241 QVERIFY(_helper->runScript("if obj.createPQCppObjectNoWrap(12).getH()==12: obj.setPassed();\n"));
242
242
243 QVERIFY(_helper->runScript("if obj.getPQCppObjectNoWrapAsValue().getH()==47: obj.setPassed();\n"));
243 QVERIFY(_helper->runScript("if obj.getPQCppObjectNoWrapAsValue().getH()==47: obj.setPassed();\n"));
244
244
245 qRegisterMetaType<PQUnknownButRegisteredValueObject>("PQUnknownButRegisteredValueObject");
245 qRegisterMetaType<PQUnknownButRegisteredValueObject>("PQUnknownButRegisteredValueObject");
246 QVERIFY(_helper->runScript("a = obj.getUnknownButRegisteredValueObjectAsPtr();print (a);\nif a!=None: obj.setPassed();\n"));
246 QVERIFY(_helper->runScript("a = obj.getUnknownButRegisteredValueObjectAsPtr();print (a);\nif a!=None: obj.setPassed();\n"));
247 QVERIFY(_helper->runScript("a = obj.getUnknownButRegisteredValueObjectAsValue();print (a);\nif a!=None: obj.setPassed();\n"));
247 QVERIFY(_helper->runScript("a = obj.getUnknownButRegisteredValueObjectAsValue();print (a);\nif a!=None: obj.setPassed();\n"));
248 QVERIFY(_helper->runScript("a = obj.getUnknownValueObjectAsPtr();print (a);\nif a!=None: obj.setPassed();\n"));
248 QVERIFY(_helper->runScript("a = obj.getUnknownValueObjectAsPtr();print (a);\nif a!=None: obj.setPassed();\n"));
249 QEXPECT_FAIL("", "Testing by value return without the object being registered as QMetaType or having registered a default constructor decorator", Continue);
249 QEXPECT_FAIL("", "Testing by value return without the object being registered as QMetaType or having registered a default constructor decorator", Continue);
250 QVERIFY(_helper->runScript("a = obj.getUnknownValueObjectAsValue();print (a);\nif a!=None: obj.setPassed();\n"));
250 QVERIFY(_helper->runScript("a = obj.getUnknownValueObjectAsValue();print (a);\nif a!=None: obj.setPassed();\n"));
251
251
252 // expect to get strict call to double overload
252 // expect to get strict call to double overload
253 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObjectNoWrap\na = PQCppObjectNoWrap(22.2)\nif a.getH()==2: obj.setPassed();\n"));
253 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObjectNoWrap\na = PQCppObjectNoWrap(22.2)\nif a.getH()==2: obj.setPassed();\n"));
254 // expect to get un-strict call to double overload
254 // expect to get un-strict call to double overload
255 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObjectNoWrap\na = PQCppObjectNoWrap(22)\nif a.getH()==2: obj.setPassed();\n"));
255 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObjectNoWrap\na = PQCppObjectNoWrap(22)\nif a.getH()==2: obj.setPassed();\n"));
256 // expect to get strict call to copy constructor overload
256 // expect to get strict call to copy constructor overload
257 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObjectNoWrap\na = PQCppObjectNoWrap(PQCppObjectNoWrap())\nprint (a.getH())\nif a.getH()==1: obj.setPassed();\n"));
257 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObjectNoWrap\na = PQCppObjectNoWrap(PQCppObjectNoWrap())\nprint (a.getH())\nif a.getH()==1: obj.setPassed();\n"));
258
258
259 // test decorated enums
259 // test decorated enums
260 // already registered by signals test
260 // already registered by signals test
261 //PythonQt::self()->registerCPPClass("PQCppObject2",NULL,NULL, PythonQtCreateObject<PQCppObject2Decorator>);
261 //PythonQt::self()->registerCPPClass("PQCppObject2",NULL,NULL, PythonQtCreateObject<PQCppObject2Decorator>);
262
262
263 // local enum (decorated)
263 // local enum (decorated)
264 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObject2\na = PQCppObject2()\nprint (a.testEnumFlag1)\nif a.testEnumFlag1(PQCppObject2.TestEnumValue2)==PQCppObject2.TestEnumValue2: obj.setPassed();\n"));
264 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObject2\na = PQCppObject2()\nprint (a.testEnumFlag1)\nif a.testEnumFlag1(PQCppObject2.TestEnumValue2)==PQCppObject2.TestEnumValue2: obj.setPassed();\n"));
265 // enum with namespace (decorated)
265 // enum with namespace (decorated)
266 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObject2\na = PQCppObject2()\nif a.testEnumFlag2(PQCppObject2.TestEnumValue2)==PQCppObject2.TestEnumValue2: obj.setPassed();\n"));
266 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObject2\na = PQCppObject2()\nif a.testEnumFlag2(PQCppObject2.TestEnumValue2)==PQCppObject2.TestEnumValue2: obj.setPassed();\n"));
267 // with int overload to check overloading
267 // with int overload to check overloading
268 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObject2\na = PQCppObject2()\nif a.testEnumFlag3(PQCppObject2.TestEnumValue2)==PQCppObject2.TestEnumValue2: obj.setPassed();\n"));
268 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObject2\na = PQCppObject2()\nif a.testEnumFlag3(PQCppObject2.TestEnumValue2)==PQCppObject2.TestEnumValue2: obj.setPassed();\n"));
269
269
270 }
270 }
271
271
272 PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag1(PQCppObject2* obj, PQCppObject2Decorator::TestEnumFlag flag) {
272 PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag1(PQCppObject2* /*obj*/, PQCppObject2Decorator::TestEnumFlag flag) {
273 return flag;
273 return flag;
274 }
274 }
275
275
276 PQCppObject2::TestEnumFlag PQCppObject2Decorator::testEnumFlag2(PQCppObject2* obj, PQCppObject2::TestEnumFlag flag) {
276 PQCppObject2::TestEnumFlag PQCppObject2Decorator::testEnumFlag2(PQCppObject2* /*obj*/, PQCppObject2::TestEnumFlag flag) {
277 return flag;
277 return flag;
278 }
278 }
279
279
280 // with int overload
280 // with int overload
281 PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* obj, int flag) {
281 PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* /*obj*/, int /*flag*/) {
282 return (TestEnumFlag)-1;
282 return (TestEnumFlag)-1;
283 }
283 }
284 PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* obj, PQCppObject2Decorator::TestEnumFlag flag) {
284 PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* /*obj*/, PQCppObject2Decorator::TestEnumFlag flag) {
285 return flag;
285 return flag;
286 }
286 }
287
287
288 void PythonQtTestSlotCalling::testMultiArgsSlotCall()
288 void PythonQtTestSlotCalling::testMultiArgsSlotCall()
289 {
289 {
290 QVERIFY(_helper->runScript("if obj.getMultiArgs(12,47.11,'test')==(12,47.11,'test'): obj.setPassed();\n"));
290 QVERIFY(_helper->runScript("if obj.getMultiArgs(12,47.11,'test')==(12,47.11,'test'): obj.setPassed();\n"));
291 }
291 }
292
292
293 bool PythonQtTestSlotCallingHelper::runScript(const char* script, int expectedOverload)
293 bool PythonQtTestSlotCallingHelper::runScript(const char* script, int expectedOverload)
294 {
294 {
295 _called = false;
295 _called = false;
296 _passed = false;
296 _passed = false;
297 _calledOverload = -1;
297 _calledOverload = -1;
298 PyRun_SimpleString(script);
298 PyRun_SimpleString(script);
299 return _called && _passed && _calledOverload==expectedOverload;
299 return _called && _passed && _calledOverload==expectedOverload;
300 }
300 }
301
301
302
302
303 void PythonQtTestSignalHandler::initTestCase()
303 void PythonQtTestSignalHandler::initTestCase()
304 {
304 {
305 _helper = new PythonQtTestSignalHandlerHelper(this);
305 _helper = new PythonQtTestSignalHandlerHelper(this);
306 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
306 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
307 PythonQt::self()->addObject(main, "obj", _helper);
307 PythonQt::self()->addObject(main, "obj", _helper);
308 }
308 }
309
309
310 void PythonQtTestSignalHandler::testSignalHandler()
310 void PythonQtTestSignalHandler::testSignalHandler()
311 {
311 {
312 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
312 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
313 PyRun_SimpleString("def testIntSignal(a):\n if a==12: obj.setPassed();\n");
313 PyRun_SimpleString("def testIntSignal(a):\n if a==12: obj.setPassed();\n");
314 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(intSignal(int)), main, "testIntSignal"));
314 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(intSignal(int)), main, "testIntSignal"));
315 QVERIFY(_helper->emitIntSignal(12));
315 QVERIFY(_helper->emitIntSignal(12));
316
316
317 PyRun_SimpleString("def testFloatSignal(a):\n if a==12: obj.setPassed();\n");
317 PyRun_SimpleString("def testFloatSignal(a):\n if a==12: obj.setPassed();\n");
318 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(floatSignal(float)), main, "testFloatSignal"));
318 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(floatSignal(float)), main, "testFloatSignal"));
319 QVERIFY(_helper->emitFloatSignal(12));
319 QVERIFY(_helper->emitFloatSignal(12));
320
320
321 // test decorated enums
321 // test decorated enums
322 PythonQt::self()->registerCPPClass("PQCppObject2",NULL,NULL, PythonQtCreateObject<PQCppObject2Decorator>);
322 PythonQt::self()->registerCPPClass("PQCppObject2",NULL,NULL, PythonQtCreateObject<PQCppObject2Decorator>);
323
323
324 PyRun_SimpleString("def testEnumSignal(a):\n if a==1: obj.setPassed();\n");
324 PyRun_SimpleString("def testEnumSignal(a):\n if a==1: obj.setPassed();\n");
325 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(enumSignal(PQCppObject2::TestEnumFlag)), main, "testEnumSignal"));
325 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(enumSignal(PQCppObject2::TestEnumFlag)), main, "testEnumSignal"));
326 QVERIFY(_helper->emitEnumSignal(PQCppObject2::TestEnumValue2));
326 QVERIFY(_helper->emitEnumSignal(PQCppObject2::TestEnumValue2));
327
327
328 PyRun_SimpleString("def testVariantSignal(a):\n if a==obj.expectedVariant(): obj.setPassed();\n");
328 PyRun_SimpleString("def testVariantSignal(a):\n if a==obj.expectedVariant(): obj.setPassed();\n");
329 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(variantSignal(QVariant)), main, "testVariantSignal"));
329 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(variantSignal(QVariant)), main, "testVariantSignal"));
330 _helper->setExpectedVariant(QString("Test"));
330 _helper->setExpectedVariant(QString("Test"));
331 QVERIFY(_helper->emitVariantSignal(QString("Test")));
331 QVERIFY(_helper->emitVariantSignal(QString("Test")));
332 _helper->setExpectedVariant(12);
332 _helper->setExpectedVariant(12);
333 QVERIFY(_helper->emitVariantSignal(12));
333 QVERIFY(_helper->emitVariantSignal(12));
334 _helper->setExpectedVariant(QStringList() << "test1" << "test2");
334 _helper->setExpectedVariant(QStringList() << "test1" << "test2");
335 QVERIFY(_helper->emitVariantSignal(QStringList() << "test1" << "test2"));
335 QVERIFY(_helper->emitVariantSignal(QStringList() << "test1" << "test2"));
336 _helper->setExpectedVariant(qVariantFromValue((QObject*)_helper));
336 _helper->setExpectedVariant(qVariantFromValue((QObject*)_helper));
337 QVERIFY(_helper->emitVariantSignal(qVariantFromValue((QObject*)_helper)));
337 QVERIFY(_helper->emitVariantSignal(qVariantFromValue((QObject*)_helper)));
338
338
339 PyRun_SimpleString("def testComplexSignal(a,b,l,o):\n if a==12 and b==13 and l==('test1','test2') and o == obj: obj.setPassed();\n");
339 PyRun_SimpleString("def testComplexSignal(a,b,l,o):\n if a==12 and b==13 and l==('test1','test2') and o == obj: obj.setPassed();\n");
340 // intentionally not normalized signal:
340 // intentionally not normalized signal:
341 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(complexSignal( int, float , const QStringList , QObject*)), main, "testComplexSignal"));
341 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(complexSignal( int, float , const QStringList , QObject*)), main, "testComplexSignal"));
342 QVERIFY(_helper->emitComplexSignal(12,13,QStringList() << "test1" << "test2", _helper));
342 QVERIFY(_helper->emitComplexSignal(12,13,QStringList() << "test1" << "test2", _helper));
343
343
344 // try removing the handler
344 // try removing the handler
345 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(complexSignal( int, float , const QStringList , QObject*)), main, "testComplexSignal"));
345 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(complexSignal( int, float , const QStringList , QObject*)), main, "testComplexSignal"));
346 // and emit the signal, which should fail because the handler was removed
346 // and emit the signal, which should fail because the handler was removed
347 QVERIFY(!_helper->emitComplexSignal(12,13,QStringList() << "test1" << "test2", _helper));
347 QVERIFY(!_helper->emitComplexSignal(12,13,QStringList() << "test1" << "test2", _helper));
348
348
349 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(intSignal(int)), main, "testIntSignal"));
349 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(intSignal(int)), main, "testIntSignal"));
350 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(floatSignal(float)), main, "testFloatSignal"));
350 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(floatSignal(float)), main, "testFloatSignal"));
351 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(variantSignal(QVariant)), main, "testVariantSignal"));
351 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(variantSignal(QVariant)), main, "testVariantSignal"));
352 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(enumSignal(PQCppObject2::TestEnumFlag)), main, "testEnumSignal"));
352 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(enumSignal(PQCppObject2::TestEnumFlag)), main, "testEnumSignal"));
353
353
354 }
354 }
355
355
356 void PythonQtTestSignalHandler::testRecursiveSignalHandler()
356 void PythonQtTestSignalHandler::testRecursiveSignalHandler()
357 {
357 {
358 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
358 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
359 PyRun_SimpleString("def testSignal1(a):\n obj.emitSignal2(a);\n");
359 PyRun_SimpleString("def testSignal1(a):\n obj.emitSignal2(a);\n");
360 PyRun_SimpleString("def testSignal2(a):\n obj.emitSignal3(float(a));\n");
360 PyRun_SimpleString("def testSignal2(a):\n obj.emitSignal3(float(a));\n");
361 PyRun_SimpleString("def testSignal3(a):\n if a==12: obj.setPassed();\n");
361 PyRun_SimpleString("def testSignal3(a):\n if a==12: obj.setPassed();\n");
362 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal1(int)), main, "testSignal1"));
362 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal1(int)), main, "testSignal1"));
363 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal2(const QString&)), main, "testSignal2"));
363 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal2(const QString&)), main, "testSignal2"));
364 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal3(float)), main, "testSignal3"));
364 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal3(float)), main, "testSignal3"));
365 QVERIFY(_helper->emitSignal1(12));
365 QVERIFY(_helper->emitSignal1(12));
366 }
366 }
367
367
368
368
369 void PythonQtTestApi::initTestCase()
369 void PythonQtTestApi::initTestCase()
370 {
370 {
371 _helper = new PythonQtTestApiHelper();
371 _helper = new PythonQtTestApiHelper();
372 _main = PythonQt::self()->getMainModule();
372 _main = PythonQt::self()->getMainModule();
373 _main.evalScript("import PythonQt");
373 _main.evalScript("import PythonQt");
374 _main.addObject("obj", _helper);
374 _main.addObject("obj", _helper);
375 }
375 }
376
376
377 void PythonQtTestApi::testProperties()
377 void PythonQtTestApi::testProperties()
378 {
378 {
379 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
379 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
380 // check for name alias (for backward comp to Qt3)
380 // check for name alias (for backward comp to Qt3)
381 main.evalScript("obj.name = 'hello'");
381 main.evalScript("obj.name = 'hello'");
382 QVERIFY(QString("hello") == main.getVariable("obj.name").toString());
382 QVERIFY(QString("hello") == main.getVariable("obj.name").toString());
383
383
384 main.evalScript("obj.objectName = 'hello2'");
384 main.evalScript("obj.objectName = 'hello2'");
385 QVERIFY(QString("hello2") == main.getVariable("obj.objectName").toString());
385 QVERIFY(QString("hello2") == main.getVariable("obj.objectName").toString());
386
386
387 }
387 }
388
388
389 void PythonQtTestApi::testDynamicProperties()
389 void PythonQtTestApi::testDynamicProperties()
390 {
390 {
391 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
391 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
392
392
393 // this fails and should fail, but how could that be tested?
393 // this fails and should fail, but how could that be tested?
394 // main.evalScript("obj.testProp = 1");
394 // main.evalScript("obj.testProp = 1");
395
395
396 // create a new dynamic property
396 // create a new dynamic property
397 main.evalScript("obj.setProperty('testProp','testValue')");
397 main.evalScript("obj.setProperty('testProp','testValue')");
398
398
399 // read the property
399 // read the property
400 QVERIFY(QString("testValue") == main.getVariable("obj.testProp").toString());
400 QVERIFY(QString("testValue") == main.getVariable("obj.testProp").toString());
401 // modify and read again
401 // modify and read again
402 main.evalScript("obj.testProp = 12");
402 main.evalScript("obj.testProp = 12");
403 QVERIFY(12 == main.getVariable("obj.testProp").toInt());
403 QVERIFY(12 == main.getVariable("obj.testProp").toInt());
404
404
405 // check if dynamic property is in dict
405 // check if dynamic property is in dict
406 QVERIFY(12 == main.evalScript("obj.__dict__['testProp']", Py_eval_input).toInt());
406 QVERIFY(12 == main.evalScript("obj.__dict__['testProp']", Py_eval_input).toInt());
407
407
408 // check if dynamic property is in introspection
408 // check if dynamic property is in introspection
409 QStringList l = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), "obj", PythonQt::Anything);
409 QStringList l = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), "obj", PythonQt::Anything);
410 QVERIFY(l.contains("testProp"));
410 QVERIFY(l.contains("testProp"));
411
411
412 // check with None, previous value expected
412 // check with None, previous value expected
413 main.evalScript("obj.testProp = None");
413 main.evalScript("obj.testProp = None");
414 QVERIFY(12 == main.getVariable("obj.testProp").toInt());
414 QVERIFY(12 == main.getVariable("obj.testProp").toInt());
415
415
416 // remove the dynamic property
416 // remove the dynamic property
417 main.evalScript("obj.setProperty('testProp', None)");
417 main.evalScript("obj.setProperty('testProp', None)");
418
418
419 // check if dynamic property is really gone
419 // check if dynamic property is really gone
420 QStringList l2 = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), "obj", PythonQt::Anything);
420 QStringList l2 = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), "obj", PythonQt::Anything);
421 QVERIFY(!l2.contains("testProp"));
421 QVERIFY(!l2.contains("testProp"));
422
422
423 }
423 }
424
424
425
425
426 bool PythonQtTestApiHelper::call(const QString& function, const QVariantList& args, const QVariant& expectedResult) {
426 bool PythonQtTestApiHelper::call(const QString& function, const QVariantList& args, const QVariant& expectedResult) {
427 _passed = false;
427 _passed = false;
428 QVariant r = PythonQt::self()->call(PythonQt::self()->getMainModule(), function, args);
428 QVariant r = PythonQt::self()->call(PythonQt::self()->getMainModule(), function, args);
429 return _passed && expectedResult==r;
429 return _passed && expectedResult==r;
430 }
430 }
431
431
432 void PythonQtTestApi::testCall()
432 void PythonQtTestApi::testCall()
433 {
433 {
434 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
434 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
435
435
436 QVERIFY(qvariant_cast<QObject*>(PythonQt::self()->getVariable(main, "obj"))==_helper);
436 QVERIFY(qvariant_cast<QObject*>(PythonQt::self()->getVariable(main, "obj"))==_helper);
437
437
438 PyRun_SimpleString("def testCallNoArgs():\n obj.setPassed();\n");
438 PyRun_SimpleString("def testCallNoArgs():\n obj.setPassed();\n");
439 QVERIFY(_helper->call("testCallNoArgs", QVariantList(), QVariant()));
439 QVERIFY(_helper->call("testCallNoArgs", QVariantList(), QVariant()));
440
440
441 PyRun_SimpleString("def testCall1(a):\n if a=='test': obj.setPassed();\n return 'test2';\n");
441 PyRun_SimpleString("def testCall1(a):\n if a=='test': obj.setPassed();\n return 'test2';\n");
442 QVERIFY(_helper->call("testCall1", QVariantList() << QVariant("test"), QVariant(QString("test2"))));
442 QVERIFY(_helper->call("testCall1", QVariantList() << QVariant("test"), QVariant(QString("test2"))));
443
443
444 PyRun_SimpleString("def testCall2(a, b):\n if a=='test' and b==obj: obj.setPassed();\n return obj;\n");
444 PyRun_SimpleString("def testCall2(a, b):\n if a=='test' and b==obj: obj.setPassed();\n return obj;\n");
445 QVariant r = PythonQt::self()->call(PythonQt::self()->getMainModule(), "testCall2", QVariantList() << QVariant("test") << qVariantFromValue((QObject*)_helper));
445 QVariant r = PythonQt::self()->call(PythonQt::self()->getMainModule(), "testCall2", QVariantList() << QVariant("test") << qVariantFromValue((QObject*)_helper));
446 QObject* p = qvariant_cast<QObject*>(r);
446 QObject* p = qvariant_cast<QObject*>(r);
447 QVERIFY(p==_helper);
447 QVERIFY(p==_helper);
448 }
448 }
449
449
450 void PythonQtTestApi::testVariables()
450 void PythonQtTestApi::testVariables()
451 {
451 {
452 PythonQt::self()->addObject(PythonQt::self()->getMainModule(), "someObject", _helper);
452 PythonQt::self()->addObject(PythonQt::self()->getMainModule(), "someObject", _helper);
453 QVariant v = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject");
453 QVariant v = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject");
454 QObject* p = qvariant_cast<QObject*>(v);
454 QObject* p = qvariant_cast<QObject*>(v);
455 QVERIFY(p==_helper);
455 QVERIFY(p==_helper);
456 // test for unset variable
456 // test for unset variable
457 QVariant v2 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject2");
457 QVariant v2 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject2");
458 QVERIFY(v2==QVariant());
458 QVERIFY(v2==QVariant());
459
459
460 PythonQt::self()->addVariable(PythonQt::self()->getMainModule(), "someValue", QStringList() << "test1" << "test2");
460 PythonQt::self()->addVariable(PythonQt::self()->getMainModule(), "someValue", QStringList() << "test1" << "test2");
461 QVariant v3 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someValue");
461 QVariant v3 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someValue");
462 QVERIFY(v3 == QVariant(QStringList() << "test1" << "test2"));
462 QVERIFY(v3 == QVariant(QStringList() << "test1" << "test2"));
463
463
464 QStringList l = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), QString::null, PythonQt::Variable);
464 QStringList l = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), QString::null, PythonQt::Variable);
465 QSet<QString> s;
465 QSet<QString> s;
466 // check that at least these three variables are set
466 // check that at least these three variables are set
467 s << "obj" << "someObject" << "someValue";
467 s << "obj" << "someObject" << "someValue";
468 foreach (QString value, s) {
468 foreach (QString value, s) {
469 QVERIFY(l.indexOf(value)!=-1);
469 QVERIFY(l.indexOf(value)!=-1);
470 }
470 }
471
471
472 // insert a second time!
472 // insert a second time!
473 PythonQt::self()->addObject(PythonQt::self()->getMainModule(), "someObject", _helper);
473 PythonQt::self()->addObject(PythonQt::self()->getMainModule(), "someObject", _helper);
474 // and remove
474 // and remove
475 PythonQt::self()->removeVariable(PythonQt::self()->getMainModule(), "someObject");
475 PythonQt::self()->removeVariable(PythonQt::self()->getMainModule(), "someObject");
476 // we expect to find no variable
476 // we expect to find no variable
477 QVariant v4 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject");
477 QVariant v4 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject");
478 QVERIFY(v4==QVariant());
478 QVERIFY(v4==QVariant());
479 }
479 }
480
480
481 void PythonQtTestApi::testImporter()
481 void PythonQtTestApi::testImporter()
482 {
482 {
483 PythonQt::self()->setImporter(_helper);
483 PythonQt::self()->setImporter(_helper);
484 PythonQt::self()->overwriteSysPath(QStringList() << "c:\\test");
484 PythonQt::self()->overwriteSysPath(QStringList() << "c:\\test");
485 PyRun_SimpleString("import bla\n");
485 PyRun_SimpleString("import bla\n");
486 }
486 }
487
487
488 void PythonQtTestApi::testQtNamespace()
488 void PythonQtTestApi::testQtNamespace()
489 {
489 {
490 QVERIFY(_main.getVariable("PythonQt.QtCore.Qt.red").toInt()==Qt::red);
490 QVERIFY(_main.getVariable("PythonQt.QtCore.Qt.red").toInt()==Qt::red);
491 QVERIFY(_main.getVariable("PythonQt.QtCore.Qt.FlatCap").toInt()==Qt::FlatCap);
491 QVERIFY(_main.getVariable("PythonQt.QtCore.Qt.FlatCap").toInt()==Qt::FlatCap);
492 #if( QT_VERSION < QT_VERSION_CHECK(5,0,0) )
492 #if( QT_VERSION < QT_VERSION_CHECK(5,0,0) )
493 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.escape")));
493 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.escape")));
494 #endif
494 #endif
495 // check for an enum type wrapper
495 // check for an enum type wrapper
496 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.AlignmentFlag")));
496 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.AlignmentFlag")));
497 // check for a flags type wrapper
497 // check for a flags type wrapper
498 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.Alignment")));
498 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.Alignment")));
499 }
499 }
500
500
501 void PythonQtTestApi::testConnects()
501 void PythonQtTestApi::testConnects()
502 {
502 {
503 // QVERIFY((qvariant_vast<QColor>(_main.evalScript("PythonQt.Qt.QColor(PythonQt.Qt.Qt.red)" ,Py_eval_input)) == QColor(Qt::red));
503 // QVERIFY((qvariant_vast<QColor>(_main.evalScript("PythonQt.Qt.QColor(PythonQt.Qt.Qt.red)" ,Py_eval_input)) == QColor(Qt::red));
504 //TODO: add signal/slot connect both with QObject.connect and connect
504 //TODO: add signal/slot connect both with QObject.connect and connect
505 }
505 }
506
506
507 void PythonQtTestApi::testQColorDecorators()
507 void PythonQtTestApi::testQColorDecorators()
508 {
508 {
509 PythonQtObjectPtr colorClass = _main.getVariable("PythonQt.QtGui.QColor");
509 PythonQtObjectPtr colorClass = _main.getVariable("PythonQt.QtGui.QColor");
510 QVERIFY(colorClass);
510 QVERIFY(colorClass);
511 // verify that the class is in the correct module
511 // verify that the class is in the correct module
512 QVERIFY(colorClass.getVariable("__module__") == "PythonQt.QtGui");
512 QVERIFY(colorClass.getVariable("__module__") == "PythonQt.QtGui");
513 // test on Qt module as well:
513 // test on Qt module as well:
514 colorClass = _main.getVariable("PythonQt.Qt.QColor");
514 colorClass = _main.getVariable("PythonQt.Qt.QColor");
515 QVERIFY(colorClass);
515 QVERIFY(colorClass);
516 // constructors
516 // constructors
517 QVERIFY(qvariant_cast<QColor>(colorClass.call(QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
517 QVERIFY(qvariant_cast<QColor>(colorClass.call(QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
518 QVERIFY(qvariant_cast<QColor>(colorClass.call()) == QColor());
518 QVERIFY(qvariant_cast<QColor>(colorClass.call()) == QColor());
519 QEXPECT_FAIL("", "Testing non-existing constructor", Continue);
519 QEXPECT_FAIL("", "Testing non-existing constructor", Continue);
520 QVERIFY(colorClass.call(QVariantList() << 1 << 2) != QVariant());
520 QVERIFY(colorClass.call(QVariantList() << 1 << 2) != QVariant());
521
521
522 // check that enum overload is taken over int
522 // check that enum overload is taken over int
523 QVERIFY(qvariant_cast<QColor>(_main.evalScript("PythonQt.Qt.QColor(PythonQt.Qt.Qt.red)" ,Py_eval_input)) == QColor(Qt::red));
523 QVERIFY(qvariant_cast<QColor>(_main.evalScript("PythonQt.Qt.QColor(PythonQt.Qt.Qt.red)" ,Py_eval_input)) == QColor(Qt::red));
524 // check that int overload is taken over enum
524 // check that int overload is taken over enum
525 QVERIFY(qvariant_cast<QColor>(_main.evalScript("PythonQt.Qt.QColor(0x112233)" ,Py_eval_input)) == QColor(0x112233));
525 QVERIFY(qvariant_cast<QColor>(_main.evalScript("PythonQt.Qt.QColor(0x112233)" ,Py_eval_input)) == QColor(0x112233));
526
526
527 // check for decorated Cmyk enum value
527 // check for decorated Cmyk enum value
528 QVERIFY(colorClass.getVariable("Cmyk").toInt() == QColor::Cmyk);
528 QVERIFY(colorClass.getVariable("Cmyk").toInt() == QColor::Cmyk);
529 PythonQtObjectPtr staticMethod = colorClass.getVariable("fromRgb");
529 PythonQtObjectPtr staticMethod = colorClass.getVariable("fromRgb");
530 QVERIFY(staticMethod);
530 QVERIFY(staticMethod);
531 // direct call of static method via class
531 // direct call of static method via class
532 QVERIFY(qvariant_cast<QColor>(colorClass.call("fromRgb", QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
532 QVERIFY(qvariant_cast<QColor>(colorClass.call("fromRgb", QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
533 // direct call of static method
533 // direct call of static method
534 QVERIFY(qvariant_cast<QColor>(staticMethod.call(QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
534 QVERIFY(qvariant_cast<QColor>(staticMethod.call(QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
535 PythonQtObjectPtr publicMethod = colorClass.getVariable("red");
535 PythonQtObjectPtr publicMethod = colorClass.getVariable("red");
536 QVERIFY(publicMethod);
536 QVERIFY(publicMethod);
537 // call with passing self in:
537 // call with passing self in:
538 QVERIFY(colorClass.call("red", QVariantList() << QColor(255,0,0)).toInt() == 255);
538 QVERIFY(colorClass.call("red", QVariantList() << QColor(255,0,0)).toInt() == 255);
539 }
539 }
540
540
541 QByteArray PythonQtTestApiHelper::readFileAsBytes(const QString& filename)
541 QByteArray PythonQtTestApiHelper::readFileAsBytes(const QString& /*filename*/)
542 {
542 {
543 QByteArray b;
543 QByteArray b;
544 return b;
544 return b;
545 }
545 }
546
546
547 QByteArray PythonQtTestApiHelper::readSourceFile(const QString& filename, bool& ok)
547 QByteArray PythonQtTestApiHelper::readSourceFile(const QString& /*filename*/, bool& ok)
548 {
548 {
549 QByteArray b;
549 QByteArray b;
550 ok = true;
550 ok = true;
551 return b;
551 return b;
552 }
552 }
553
553
554 bool PythonQtTestApiHelper::exists(const QString& filename)
554 bool PythonQtTestApiHelper::exists(const QString& /*filename*/)
555 {
555 {
556 return true;
556 return true;
557 }
557 }
558
558
559 QDateTime PythonQtTestApiHelper::lastModifiedDate(const QString& filename) {
559 QDateTime PythonQtTestApiHelper::lastModifiedDate(const QString& /*filename*/) {
560 return QDateTime::currentDateTime();
560 return QDateTime::currentDateTime();
561 }
561 }
562
562
563
563
564 void PythonQtTestApi::testRedirect()
564 void PythonQtTestApi::testRedirect()
565 {
565 {
566 connect(PythonQt::self(), SIGNAL(pythonStdOut(const QString&)), _helper, SLOT(stdOut(const QString&)));
566 connect(PythonQt::self(), SIGNAL(pythonStdOut(const QString&)), _helper, SLOT(stdOut(const QString&)));
567 connect(PythonQt::self(), SIGNAL(pythonStdErr(const QString&)), _helper, SLOT(stdErr(const QString&)));
567 connect(PythonQt::self(), SIGNAL(pythonStdErr(const QString&)), _helper, SLOT(stdErr(const QString&)));
568 PyRun_SimpleString("print ('test')\n");
568 PyRun_SimpleString("print ('test')\n");
569 }
569 }
570
570
571 void PythonQtTestApiHelper::stdOut(const QString& s)
571 void PythonQtTestApiHelper::stdOut(const QString& s)
572 {
572 {
573 outBuf.append(s);
573 outBuf.append(s);
574 QStringList x = outBuf.split("\n");
574 QStringList x = outBuf.split("\n");
575 outBuf = x.takeLast();
575 outBuf = x.takeLast();
576 foreach(QString s, x)
576 foreach(QString s, x)
577 qDebug() << s;
577 qDebug() << s;
578 }
578 }
579
579
580 void PythonQtTestApiHelper::stdErr(const QString& s)
580 void PythonQtTestApiHelper::stdErr(const QString& s)
581 {
581 {
582 errBuf.append(s);
582 errBuf.append(s);
583 QStringList x = errBuf.split("\n");
583 QStringList x = errBuf.split("\n");
584 errBuf = x.takeLast();
584 errBuf = x.takeLast();
585 foreach(QString s, x)
585 foreach(QString s, x)
586 qDebug() << s;
586 qDebug() << s;
587 }
587 }
588
588
589 QObject* PythonQtTestCppFactory::create(const QByteArray& name, void *ptr)
589 QObject* PythonQtTestCppFactory::create(const QByteArray& name, void *ptr)
590 {
590 {
591 if (name == "PQCppObject") {
591 if (name == "PQCppObject") {
592 return new PQCppObjectWrapper(ptr);
592 return new PQCppObjectWrapper(ptr);
593 }
593 }
594 return NULL;
594 return NULL;
595 }
595 }
@@ -1,517 +1,517
1 #ifndef _PYTHONQTTESTS_H
1 #ifndef _PYTHONQTTESTS_H
2 #define _PYTHONQTTESTS_H
2 #define _PYTHONQTTESTS_H
3
3
4 /*
4 /*
5 *
5 *
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 *
7 *
8 * This library is free software; you can redistribute it and/or
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
11 * version 2.1 of the License, or (at your option) any later version.
12 *
12 *
13 * This library is distributed in the hope that it will be useful,
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
16 * Lesser General Public License for more details.
17 *
17 *
18 * Further, this software is distributed without any warranty that it is
18 * Further, this software is distributed without any warranty that it is
19 * free of the rightful claim of any third person regarding infringement
19 * free of the rightful claim of any third person regarding infringement
20 * or the like. Any license provided herein, whether implied or
20 * or the like. Any license provided herein, whether implied or
21 * otherwise, applies only to this software file. Patent licenses, if
21 * otherwise, applies only to this software file. Patent licenses, if
22 * any, provided herein do not apply to combinations of this program with
22 * any, provided herein do not apply to combinations of this program with
23 * other software, or any other product whatsoever.
23 * other software, or any other product whatsoever.
24 *
24 *
25 * You should have received a copy of the GNU Lesser General Public
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 *
28 *
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 * 28359 Bremen, Germany or:
30 * 28359 Bremen, Germany or:
31 *
31 *
32 * http://www.mevis.de
32 * http://www.mevis.de
33 *
33 *
34 */
34 */
35
35
36 //----------------------------------------------------------------------------------
36 //----------------------------------------------------------------------------------
37 /*!
37 /*!
38 // \file PythonQtTests.h
38 // \file PythonQtTests.h
39 // \author Florian Link
39 // \author Florian Link
40 // \author Last changed by $Author: florian $
40 // \author Last changed by $Author: florian $
41 // \date 2006-05
41 // \date 2006-05
42 */
42 */
43 //----------------------------------------------------------------------------------
43 //----------------------------------------------------------------------------------
44
44
45 #include "PythonQt.h"
45 #include "PythonQt.h"
46 #include <QtTest/QtTest>
46 #include <QtTest/QtTest>
47 #include <QVariant>
47 #include <QVariant>
48 #include "PythonQtImportFileInterface.h"
48 #include "PythonQtImportFileInterface.h"
49 #include "PythonQtCppWrapperFactory.h"
49 #include "PythonQtCppWrapperFactory.h"
50
50
51 #include <QPen>
51 #include <QPen>
52 #include <QColor>
52 #include <QColor>
53 #include <QBrush>
53 #include <QBrush>
54 #include <QCursor>
54 #include <QCursor>
55
55
56 class PythonQtTestSlotCallingHelper;
56 class PythonQtTestSlotCallingHelper;
57 class PythonQtTestApiHelper;
57 class PythonQtTestApiHelper;
58 class QWidget;
58 class QWidget;
59
59
60 //! test the PythonQt api
60 //! test the PythonQt api
61 class PythonQtTestApi : public QObject
61 class PythonQtTestApi : public QObject
62 {
62 {
63 Q_OBJECT
63 Q_OBJECT
64
64
65 private slots:
65 private slots:
66 void initTestCase();
66 void initTestCase();
67 void testCall();
67 void testCall();
68 void testVariables();
68 void testVariables();
69 void testRedirect();
69 void testRedirect();
70 void testImporter();
70 void testImporter();
71 void testQColorDecorators();
71 void testQColorDecorators();
72 void testQtNamespace();
72 void testQtNamespace();
73 void testConnects();
73 void testConnects();
74
74
75 void testProperties();
75 void testProperties();
76 void testDynamicProperties();
76 void testDynamicProperties();
77
77
78 private:
78 private:
79 PythonQtTestApiHelper* _helper;
79 PythonQtTestApiHelper* _helper;
80 PythonQtObjectPtr _main;
80 PythonQtObjectPtr _main;
81
81
82 };
82 };
83
83
84 class ClassA {
84 class ClassA {
85 public:
85 public:
86 ClassA() { x = 1; }
86 ClassA() { x = 1; }
87 int x;
87 int x;
88 };
88 };
89
89
90 class ClassB {
90 class ClassB {
91 public:
91 public:
92 ClassB() { y = 2; }
92 ClassB() { y = 2; }
93 int y;
93 int y;
94
94
95 virtual int type() { return 2; }
95 virtual int type() { return 2; }
96 };
96 };
97
97
98 class ClassC : public ClassA, public ClassB {
98 class ClassC : public ClassA, public ClassB {
99 public:
99 public:
100 ClassC() { z = 3; }
100 ClassC() { z = 3; }
101 int z;
101 int z;
102
102
103 virtual int type() { return 3; }
103 virtual int type() { return 3; }
104 };
104 };
105
105
106 class ClassD : public QObject, public ClassA, public ClassB {
106 class ClassD : public QObject, public ClassA, public ClassB {
107 Q_OBJECT
107 Q_OBJECT
108 public:
108 public:
109 ClassD() { d = 4; }
109 ClassD() { d = 4; }
110 public slots:
110 public slots:
111 int getD() { return d; }
111 int getD() { return d; }
112 private:
112 private:
113 int d;
113 int d;
114
114
115 virtual int type() { return 4; }
115 virtual int type() { return 4; }
116 };
116 };
117
117
118 class ClassAWrapper : public QObject {
118 class ClassAWrapper : public QObject {
119 Q_OBJECT
119 Q_OBJECT
120 public slots:
120 public slots:
121 ClassA* new_ClassA() { return new ClassA; }
121 ClassA* new_ClassA() { return new ClassA; }
122 int getX(ClassA* o) { return o->x; }
122 int getX(ClassA* o) { return o->x; }
123 };
123 };
124
124
125 class ClassBWrapper : public QObject {
125 class ClassBWrapper : public QObject {
126 Q_OBJECT
126 Q_OBJECT
127 public slots:
127 public slots:
128 ClassB* new_ClassB() { return new ClassB; }
128 ClassB* new_ClassB() { return new ClassB; }
129 int getY(ClassB* o) { return o->y; }
129 int getY(ClassB* o) { return o->y; }
130 };
130 };
131
131
132 class ClassCWrapper : public QObject {
132 class ClassCWrapper : public QObject {
133 Q_OBJECT
133 Q_OBJECT
134 public slots:
134 public slots:
135 ClassC* new_ClassC() { return new ClassC; }
135 ClassC* new_ClassC() { return new ClassC; }
136 int getZ(ClassC* o) { return o->z; }
136 int getZ(ClassC* o) { return o->z; }
137 };
137 };
138
138
139 class ClassDWrapper : public QObject {
139 class ClassDWrapper : public QObject {
140 Q_OBJECT
140 Q_OBJECT
141 public slots:
141 public slots:
142 ClassD* new_ClassD() { return new ClassD; }
142 ClassD* new_ClassD() { return new ClassD; }
143 };
143 };
144
144
145
145
146 //! test the PythonQt api (helper)
146 //! test the PythonQt api (helper)
147 class PythonQtTestApiHelper : public QObject , public PythonQtImportFileInterface
147 class PythonQtTestApiHelper : public QObject , public PythonQtImportFileInterface
148 {
148 {
149 Q_OBJECT
149 Q_OBJECT
150 public:
150 public:
151 PythonQtTestApiHelper() {
151 PythonQtTestApiHelper() {
152 };
152 };
153
153
154 bool call(const QString& function, const QVariantList& args, const QVariant& expectedResult);
154 bool call(const QString& function, const QVariantList& args, const QVariant& expectedResult);
155
155
156 virtual QByteArray readFileAsBytes(const QString& filename);
156 virtual QByteArray readFileAsBytes(const QString& filename);
157
157
158 virtual QByteArray readSourceFile(const QString& filename, bool& ok);
158 virtual QByteArray readSourceFile(const QString& filename, bool& ok);
159
159
160 virtual bool exists(const QString& filename);
160 virtual bool exists(const QString& filename);
161
161
162 virtual QDateTime lastModifiedDate(const QString& filename);
162 virtual QDateTime lastModifiedDate(const QString& filename);
163
163
164 public slots:
164 public slots:
165
165
166 //! call to set that the test has passed (from Python!)
166 //! call to set that the test has passed (from Python!)
167 void setPassed() { _passed = true; }
167 void setPassed() { _passed = true; }
168
168
169 void stdOut(const QString&);
169 void stdOut(const QString&);
170 void stdErr(const QString&);
170 void stdErr(const QString&);
171
171
172 private:
172 private:
173 QString outBuf;
173 QString outBuf;
174 QString errBuf;
174 QString errBuf;
175 bool _passed;
175 bool _passed;
176 };
176 };
177
177
178
178
179 // test implementation of the wrapper factory
179 // test implementation of the wrapper factory
180 class PythonQtTestCppFactory : public PythonQtCppWrapperFactory
180 class PythonQtTestCppFactory : public PythonQtCppWrapperFactory
181 {
181 {
182 public:
182 public:
183 virtual QObject* create(const QByteArray& name, void *ptr);
183 virtual QObject* create(const QByteArray& name, void *ptr);
184 };
184 };
185
185
186 //! an cpp object to be wrapped
186 //! an cpp object to be wrapped
187 class PQCppObject {
187 class PQCppObject {
188
188
189 public:
189 public:
190 PQCppObject(int h) { _height = h; }
190 PQCppObject(int h) { _height = h; }
191
191
192 int getHeight() { return _height; }
192 int getHeight() { return _height; }
193 void setHeight(int h) { _height = h; }
193 void setHeight(int h) { _height = h; }
194
194
195 private:
195 private:
196 int _height;
196 int _height;
197 };
197 };
198
198
199 //! an qobject that wraps the existing cpp object
199 //! an qobject that wraps the existing cpp object
200 class PQCppObjectWrapper : public QObject {
200 class PQCppObjectWrapper : public QObject {
201 Q_OBJECT
201 Q_OBJECT
202 public:
202 public:
203 PQCppObjectWrapper(void* ptr) {
203 PQCppObjectWrapper(void* ptr) {
204 _ptr = (PQCppObject*)ptr;
204 _ptr = (PQCppObject*)ptr;
205 }
205 }
206
206
207 public slots:
207 public slots:
208 int getHeight() { return _ptr->getHeight(); }
208 int getHeight() { return _ptr->getHeight(); }
209 void setHeight(int h) { _ptr->setHeight(h); }
209 void setHeight(int h) { _ptr->setHeight(h); }
210
210
211 private:
211 private:
212 PQCppObject* _ptr;
212 PQCppObject* _ptr;
213 };
213 };
214
214
215 class PQCppObjectDecorator : public QObject {
215 class PQCppObjectDecorator : public QObject {
216 Q_OBJECT
216 Q_OBJECT
217 public slots:
217 public slots:
218 int getH(PQCppObject* obj) { return obj->getHeight(); }
218 int getH(PQCppObject* obj) { return obj->getHeight(); }
219
219
220 };
220 };
221
221
222 //! an cpp object to be wrapped by decorators only
222 //! an cpp object to be wrapped by decorators only
223 class PQCppObjectNoWrap {
223 class PQCppObjectNoWrap {
224
224
225 public:
225 public:
226 PQCppObjectNoWrap() { _height = 0; }
226 PQCppObjectNoWrap() { _height = 0; }
227 PQCppObjectNoWrap(int h) { _height = h; }
227 PQCppObjectNoWrap(int h) { _height = h; }
228
228
229 int getHeight() { return _height; }
229 int getHeight() { return _height; }
230 void setHeight(int h) { _height = h; }
230 void setHeight(int h) { _height = h; }
231
231
232 private:
232 private:
233 int _height;
233 int _height;
234 };
234 };
235
235
236 class PQCppObjectNoWrapDecorator : public QObject {
236 class PQCppObjectNoWrapDecorator : public QObject {
237 Q_OBJECT
237 Q_OBJECT
238
238
239 public slots:
239 public slots:
240 PQCppObjectNoWrap* new_PQCppObjectNoWrap() {
240 PQCppObjectNoWrap* new_PQCppObjectNoWrap() {
241 return new PQCppObjectNoWrap(0);
241 return new PQCppObjectNoWrap(0);
242 }
242 }
243 PQCppObjectNoWrap* new_PQCppObjectNoWrap(const PQCppObjectNoWrap& other) {
243 PQCppObjectNoWrap* new_PQCppObjectNoWrap(const PQCppObjectNoWrap& /*other*/) {
244 return new PQCppObjectNoWrap(1);
244 return new PQCppObjectNoWrap(1);
245 }
245 }
246 PQCppObjectNoWrap* new_PQCppObjectNoWrap(double value) {
246 PQCppObjectNoWrap* new_PQCppObjectNoWrap(double /*value*/) {
247 return new PQCppObjectNoWrap(2);
247 return new PQCppObjectNoWrap(2);
248 }
248 }
249
249
250 int getH(PQCppObjectNoWrap* obj) { return obj->getHeight(); }
250 int getH(PQCppObjectNoWrap* obj) { return obj->getHeight(); }
251
251
252 };
252 };
253
253
254
254
255 //! an cpp object that is to be wrapped by decorators only
255 //! an cpp object that is to be wrapped by decorators only
256 class PQCppObject2 {
256 class PQCppObject2 {
257
257
258 public:
258 public:
259 enum TestEnumFlag {
259 enum TestEnumFlag {
260 TestEnumValue1 = 0,
260 TestEnumValue1 = 0,
261 TestEnumValue2 = 1
261 TestEnumValue2 = 1
262 };
262 };
263
263
264 PQCppObject2() {}
264 PQCppObject2() {}
265
265
266 };
266 };
267
267
268 class PQCppObject2Decorator : public QObject {
268 class PQCppObject2Decorator : public QObject {
269 Q_OBJECT
269 Q_OBJECT
270
270
271 public:
271 public:
272 Q_ENUMS(TestEnumFlag)
272 Q_ENUMS(TestEnumFlag)
273 Q_FLAGS(TestEnum)
273 Q_FLAGS(TestEnum)
274
274
275 enum TestEnumFlag {
275 enum TestEnumFlag {
276 TestEnumValue1 = 0,
276 TestEnumValue1 = 0,
277 TestEnumValue2 = 1
277 TestEnumValue2 = 1
278 };
278 };
279
279
280 Q_DECLARE_FLAGS(TestEnum, TestEnumFlag)
280 Q_DECLARE_FLAGS(TestEnum, TestEnumFlag)
281
281
282 public slots:
282 public slots:
283 PQCppObject2* new_PQCppObject2() {
283 PQCppObject2* new_PQCppObject2() {
284 return new PQCppObject2();
284 return new PQCppObject2();
285 }
285 }
286
286
287 TestEnumFlag testEnumFlag1(PQCppObject2* obj, TestEnumFlag flag);
287 TestEnumFlag testEnumFlag1(PQCppObject2* obj, TestEnumFlag flag);
288
288
289 PQCppObject2::TestEnumFlag testEnumFlag2(PQCppObject2* obj, PQCppObject2::TestEnumFlag flag);
289 PQCppObject2::TestEnumFlag testEnumFlag2(PQCppObject2* obj, PQCppObject2::TestEnumFlag flag);
290
290
291 // with int overload
291 // with int overload
292 TestEnumFlag testEnumFlag3(PQCppObject2* obj, int flag);
292 TestEnumFlag testEnumFlag3(PQCppObject2* obj, int flag);
293 TestEnumFlag testEnumFlag3(PQCppObject2* obj, TestEnumFlag flag);
293 TestEnumFlag testEnumFlag3(PQCppObject2* obj, TestEnumFlag flag);
294
294
295 };
295 };
296
296
297 class PQUnknownValueObject
297 class PQUnknownValueObject
298 {
298 {
299 public:
299 public:
300 PQUnknownValueObject() {};
300 PQUnknownValueObject() {};
301 };
301 };
302
302
303 class PQUnknownButRegisteredValueObject
303 class PQUnknownButRegisteredValueObject
304 {
304 {
305 public:
305 public:
306 PQUnknownButRegisteredValueObject() {};
306 PQUnknownButRegisteredValueObject() {};
307 };
307 };
308
308
309 //! test the calling of slots
309 //! test the calling of slots
310 class PythonQtTestSlotCalling : public QObject
310 class PythonQtTestSlotCalling : public QObject
311 {
311 {
312 Q_OBJECT
312 Q_OBJECT
313
313
314 private slots:
314 private slots:
315 void initTestCase();
315 void initTestCase();
316 void init();
316 void init();
317
317
318 void testNoArgSlotCall();
318 void testNoArgSlotCall();
319 void testPODSlotCalls();
319 void testPODSlotCalls();
320 void testCPPSlotCalls();
320 void testCPPSlotCalls();
321 void testQVariantSlotCalls();
321 void testQVariantSlotCalls();
322 void testObjectSlotCalls();
322 void testObjectSlotCalls();
323 void testMultiArgsSlotCall();
323 void testMultiArgsSlotCall();
324 void testPyObjectSlotCall();
324 void testPyObjectSlotCall();
325 void testOverloadedCall();
325 void testOverloadedCall();
326 void testCppFactory();
326 void testCppFactory();
327 void testInheritance();
327 void testInheritance();
328 void testAutoConversion();
328 void testAutoConversion();
329
329
330 private:
330 private:
331 PythonQtTestSlotCallingHelper* _helper;
331 PythonQtTestSlotCallingHelper* _helper;
332
332
333 };
333 };
334
334
335 //! helper class for slot calling test
335 //! helper class for slot calling test
336 class PythonQtTestSlotCallingHelper : public QObject
336 class PythonQtTestSlotCallingHelper : public QObject
337 {
337 {
338 Q_OBJECT
338 Q_OBJECT
339 public:
339 public:
340 PythonQtTestSlotCallingHelper(PythonQtTestSlotCalling* test) {
340 PythonQtTestSlotCallingHelper(PythonQtTestSlotCalling* test) {
341 _test = test;
341 _test = test;
342 };
342 };
343
343
344 bool runScript(const char* script, int expectedOverload = -1);
344 bool runScript(const char* script, int expectedOverload = -1);
345
345
346 public slots:
346 public slots:
347
347
348 //! call to set that the test has passed (from Python!)
348 //! call to set that the test has passed (from Python!)
349 void setPassed() { _passed = true; }
349 void setPassed() { _passed = true; }
350
350
351 //! no arguments, no return value:
351 //! no arguments, no return value:
352 void testNoArg() { _called = true; }
352 void testNoArg() { _called = true; }
353
353
354 //! overload test!
354 //! overload test!
355 void overload(bool a) { _calledOverload = 0; _called = true; }
355 void overload(bool) { _calledOverload = 0; _called = true; }
356 void overload(float a) { _calledOverload = 1; _called = true;}
356 void overload(float) { _calledOverload = 1; _called = true;}
357 void overload(int a) { _calledOverload = 2; _called = true;}
357 void overload(int) { _calledOverload = 2; _called = true;}
358 void overload(const QString& str) { _calledOverload = 3; _called = true;}
358 void overload(const QString&) { _calledOverload = 3; _called = true;}
359 void overload(const QStringList& str) { _calledOverload = 4; _called = true;}
359 void overload(const QStringList&) { _calledOverload = 4; _called = true;}
360 void overload(QObject* str) { _calledOverload = 5; _called = true;}
360 void overload(QObject*) { _calledOverload = 5; _called = true;}
361 void overload(float a, int b) { _calledOverload = 6; _called = true;}
361 void overload(float, int) { _calledOverload = 6; _called = true;}
362
362
363 //! POD values:
363 //! POD values:
364 int getInt(int a) { _called = true; return a; }
364 int getInt(int a) { _called = true; return a; }
365 unsigned int getUInt(unsigned int a) { _called = true; return a; }
365 unsigned int getUInt(unsigned int a) { _called = true; return a; }
366 bool getBool(bool a) { _called = true; return a; }
366 bool getBool(bool a) { _called = true; return a; }
367 char getChar(char a) { _called = true; return a; }
367 char getChar(char a) { _called = true; return a; }
368 unsigned char getUChar(unsigned char a) { _called = true; return a; }
368 unsigned char getUChar(unsigned char a) { _called = true; return a; }
369 long getLong(long a) { _called = true; return a; }
369 long getLong(long a) { _called = true; return a; }
370 unsigned long getULong(unsigned long a) { _called = true; return a; }
370 unsigned long getULong(unsigned long a) { _called = true; return a; }
371 short getShort(short a) { _called = true; return a; }
371 short getShort(short a) { _called = true; return a; }
372 unsigned short getUShort(unsigned short a) { _called = true; return a; }
372 unsigned short getUShort(unsigned short a) { _called = true; return a; }
373 QChar getQChar(QChar a) { _called = true; return a; }
373 QChar getQChar(QChar a) { _called = true; return a; }
374 qint64 getLongLong(qint64 a) { _called = true; return a; }
374 qint64 getLongLong(qint64 a) { _called = true; return a; }
375 quint64 getULongLong(quint64 a) { _called = true; return a; }
375 quint64 getULongLong(quint64 a) { _called = true; return a; }
376 double getDouble(double d) { _called = true; return d; }
376 double getDouble(double d) { _called = true; return d; }
377 float getFloat(float d) { _called = true; return d; }
377 float getFloat(float d) { _called = true; return d; }
378
378
379 //! important qt types:
379 //! important qt types:
380 QString getQString(const QString& s) { _called = true; return s; }
380 QString getQString(const QString& s) { _called = true; return s; }
381 QStringList getQStringList(const QStringList& l) { _called = true; return l; }
381 QStringList getQStringList(const QStringList& l) { _called = true; return l; }
382 QVariant getQVariant(const QVariant& var) { _called = true; return var; }
382 QVariant getQVariant(const QVariant& var) { _called = true; return var; }
383
383
384 // QColor as representative for C++ value classes
384 // QColor as representative for C++ value classes
385 QColor getQColor1(const QColor& var) { _called = true; return var; }
385 QColor getQColor1(const QColor& var) { _called = true; return var; }
386 QColor getQColor2(QColor& var) { _called = true; return var; }
386 QColor getQColor2(QColor& var) { _called = true; return var; }
387 QColor getQColor3(QColor* col) { _called = true; return *col; }
387 QColor getQColor3(QColor* col) { _called = true; return *col; }
388 QColor getQColor4(const QVariant& color) { _called = true; return color.value<QColor>(); }
388 QColor getQColor4(const QVariant& color) { _called = true; return color.value<QColor>(); }
389 QColor* getQColor5() { _called = true; static QColor c(1,2,3); return &c; }
389 QColor* getQColor5() { _called = true; static QColor c(1,2,3); return &c; }
390
390
391 PyObject* getPyObject(PyObject* obj) { _called = true; return obj; }
391 PyObject* getPyObject(PyObject* obj) { _called = true; return obj; }
392 PyObject* getPyObjectFromVariant(const QVariant& val) { _called = true; return PythonQtObjectPtr(val); }
392 PyObject* getPyObjectFromVariant(const QVariant& val) { _called = true; return PythonQtObjectPtr(val); }
393 QVariant getPyObjectFromVariant2(const QVariant& val) { _called = true; return val; }
393 QVariant getPyObjectFromVariant2(const QVariant& val) { _called = true; return val; }
394 // this does not yet work but is not required to work:
394 // this does not yet work but is not required to work:
395 //PyObject* getPyObjectFromPtr(const PythonQtObjectPtr& val) { _called = true; return val; };
395 //PyObject* getPyObjectFromPtr(const PythonQtObjectPtr& val) { _called = true; return val; };
396
396
397 //! testing pointer passing
397 //! testing pointer passing
398 PythonQtTestSlotCallingHelper* getTestObject(PythonQtTestSlotCallingHelper* obj) { _called = true; return obj; }
398 PythonQtTestSlotCallingHelper* getTestObject(PythonQtTestSlotCallingHelper* obj) { _called = true; return obj; }
399 //! testing inheritance checking
399 //! testing inheritance checking
400 QObject* getQObject(QObject* obj) { _called = true; return obj; }
400 QObject* getQObject(QObject* obj) { _called = true; return obj; }
401 QWidget* getQWidget(QWidget* obj) { _called = true; return obj; }
401 QWidget* getQWidget(QWidget* obj) { _called = true; return obj; }
402 //! testing if an object that was not wrapped is wrapped earlier is wrapped correctly
402 //! testing if an object that was not wrapped is wrapped earlier is wrapped correctly
403 QObject* getNewObject() { _called = true; return new PythonQtTestSlotCallingHelper(NULL); }
403 QObject* getNewObject() { _called = true; return new PythonQtTestSlotCallingHelper(NULL); }
404
404
405 QVariantList getMultiArgs(int a, double b, const QString& str) { _called = true; return (QVariantList() << a << b << str); }
405 QVariantList getMultiArgs(int a, double b, const QString& str) { _called = true; return (QVariantList() << a << b << str); }
406
406
407 //! cpp wrapper factory test
407 //! cpp wrapper factory test
408 PQCppObject* createPQCppObject(int h) { _called = true; return new PQCppObject(h); }
408 PQCppObject* createPQCppObject(int h) { _called = true; return new PQCppObject(h); }
409
409
410 //! cpp wrapper factory test
410 //! cpp wrapper factory test
411 PQCppObject* getPQCppObject(PQCppObject* p) { _called = true; return p; }
411 PQCppObject* getPQCppObject(PQCppObject* p) { _called = true; return p; }
412
412
413 //! cpp wrapper factory test
413 //! cpp wrapper factory test
414 PQCppObjectNoWrap* createPQCppObjectNoWrap(int h) { _called = true; return new PQCppObjectNoWrap(h); }
414 PQCppObjectNoWrap* createPQCppObjectNoWrap(int h) { _called = true; return new PQCppObjectNoWrap(h); }
415
415
416 //! cpp wrapper factory test
416 //! cpp wrapper factory test
417 PQCppObjectNoWrap* getPQCppObjectNoWrap(PQCppObjectNoWrap* p) { _called = true; return p; }
417 PQCppObjectNoWrap* getPQCppObjectNoWrap(PQCppObjectNoWrap* p) { _called = true; return p; }
418
418
419 //! get a return by value PQCppObjectNoWrap
419 //! get a return by value PQCppObjectNoWrap
420 PQCppObjectNoWrap getPQCppObjectNoWrapAsValue() { _called = true; return PQCppObjectNoWrap(47); }
420 PQCppObjectNoWrap getPQCppObjectNoWrapAsValue() { _called = true; return PQCppObjectNoWrap(47); }
421
421
422 PQUnknownButRegisteredValueObject getUnknownButRegisteredValueObjectAsValue() { _called = true; return PQUnknownButRegisteredValueObject(); }
422 PQUnknownButRegisteredValueObject getUnknownButRegisteredValueObjectAsValue() { _called = true; return PQUnknownButRegisteredValueObject(); }
423 PQUnknownValueObject getUnknownValueObjectAsValue() { _called = true; return PQUnknownValueObject(); }
423 PQUnknownValueObject getUnknownValueObjectAsValue() { _called = true; return PQUnknownValueObject(); }
424
424
425 PQUnknownButRegisteredValueObject* getUnknownButRegisteredValueObjectAsPtr() { _called = true; return new PQUnknownButRegisteredValueObject(); }
425 PQUnknownButRegisteredValueObject* getUnknownButRegisteredValueObjectAsPtr() { _called = true; return new PQUnknownButRegisteredValueObject(); }
426 PQUnknownValueObject* getUnknownValueObjectAsPtr() { _called = true; return new PQUnknownValueObject(); }
426 PQUnknownValueObject* getUnknownValueObjectAsPtr() { _called = true; return new PQUnknownValueObject(); }
427
427
428 ClassA* getClassAPtr(ClassA* o) { _called = true; return o; }
428 ClassA* getClassAPtr(ClassA* o) { _called = true; return o; }
429 ClassB* getClassBPtr(ClassB* o) { _called = true; return o; }
429 ClassB* getClassBPtr(ClassB* o) { _called = true; return o; }
430 ClassC* getClassCPtr(ClassC* o) { _called = true; return o; }
430 ClassC* getClassCPtr(ClassC* o) { _called = true; return o; }
431 ClassD* getClassDPtr(ClassD* o) { _called = true; return o; }
431 ClassD* getClassDPtr(ClassD* o) { _called = true; return o; }
432
432
433 ClassA* createClassA() { _called = true; return new ClassA; }
433 ClassA* createClassA() { _called = true; return new ClassA; }
434 ClassB* createClassB() { _called = true; return new ClassB; }
434 ClassB* createClassB() { _called = true; return new ClassB; }
435 ClassC* createClassC() { _called = true; return new ClassC; }
435 ClassC* createClassC() { _called = true; return new ClassC; }
436 ClassD* createClassD() { _called = true; return new ClassD; }
436 ClassD* createClassD() { _called = true; return new ClassD; }
437 ClassA* createClassCAsA() { _called = true; return new ClassC; }
437 ClassA* createClassCAsA() { _called = true; return new ClassC; }
438 ClassB* createClassCAsB() { _called = true; return new ClassC; }
438 ClassB* createClassCAsB() { _called = true; return new ClassC; }
439 ClassA* createClassDAsA() { _called = true; return new ClassD; }
439 ClassA* createClassDAsA() { _called = true; return new ClassD; }
440 ClassB* createClassDAsB() { _called = true; return new ClassD; }
440 ClassB* createClassDAsB() { _called = true; return new ClassD; }
441
441
442 QColor setAutoConvertColor(const QColor& color) { _called = true; return color; };
442 QColor setAutoConvertColor(const QColor& color) { _called = true; return color; };
443 QBrush setAutoConvertBrush(const QBrush& brush) { _called = true; return brush; };
443 QBrush setAutoConvertBrush(const QBrush& brush) { _called = true; return brush; };
444 QPen setAutoConvertPen(const QPen& pen) { _called = true; return pen; };
444 QPen setAutoConvertPen(const QPen& pen) { _called = true; return pen; };
445 QCursor setAutoConvertCursor(const QCursor& cursor) { _called = true; return cursor; };
445 QCursor setAutoConvertCursor(const QCursor& cursor) { _called = true; return cursor; };
446
446
447 private:
447 private:
448 bool _passed;
448 bool _passed;
449 bool _called;
449 bool _called;
450 int _calledOverload;
450 int _calledOverload;
451 PythonQtTestSlotCalling* _test;
451 PythonQtTestSlotCalling* _test;
452 };
452 };
453
453
454 class PythonQtTestSignalHandlerHelper;
454 class PythonQtTestSignalHandlerHelper;
455
455
456 //! test the connection of signals to python
456 //! test the connection of signals to python
457 class PythonQtTestSignalHandler : public QObject
457 class PythonQtTestSignalHandler : public QObject
458 {
458 {
459 Q_OBJECT
459 Q_OBJECT
460
460
461 private slots:
461 private slots:
462 void initTestCase();
462 void initTestCase();
463
463
464 void testSignalHandler();
464 void testSignalHandler();
465 void testRecursiveSignalHandler();
465 void testRecursiveSignalHandler();
466
466
467 private:
467 private:
468 PythonQtTestSignalHandlerHelper* _helper;
468 PythonQtTestSignalHandlerHelper* _helper;
469
469
470 };
470 };
471
471
472 //! helper class for signal testing
472 //! helper class for signal testing
473 class PythonQtTestSignalHandlerHelper : public QObject
473 class PythonQtTestSignalHandlerHelper : public QObject
474 {
474 {
475 Q_OBJECT
475 Q_OBJECT
476
476
477 public:
477 public:
478 PythonQtTestSignalHandlerHelper(PythonQtTestSignalHandler* test) {
478 PythonQtTestSignalHandlerHelper(PythonQtTestSignalHandler* test) {
479 _test = test;
479 _test = test;
480 };
480 };
481
481
482 public slots:
482 public slots:
483 void setPassed() { _passed = true; }
483 void setPassed() { _passed = true; }
484
484
485 bool emitIntSignal(int a) { _passed = false; emit intSignal(a); return _passed; };
485 bool emitIntSignal(int a) { _passed = false; emit intSignal(a); return _passed; };
486 bool emitFloatSignal(float a) { _passed = false; emit floatSignal(a); return _passed; };
486 bool emitFloatSignal(float a) { _passed = false; emit floatSignal(a); return _passed; };
487 bool emitEnumSignal(PQCppObject2::TestEnumFlag flag) { _passed = false; emit enumSignal(flag); return _passed; };
487 bool emitEnumSignal(PQCppObject2::TestEnumFlag flag) { _passed = false; emit enumSignal(flag); return _passed; };
488
488
489 bool emitVariantSignal(const QVariant& v) { _passed = false; emit variantSignal(v); return _passed; };
489 bool emitVariantSignal(const QVariant& v) { _passed = false; emit variantSignal(v); return _passed; };
490 QVariant expectedVariant() { return _v; }
490 QVariant expectedVariant() { return _v; }
491 void setExpectedVariant(const QVariant& v) { _v = v; }
491 void setExpectedVariant(const QVariant& v) { _v = v; }
492
492
493 bool emitComplexSignal(int a, float b, const QStringList& l, QObject* obj) { _passed = false; emit complexSignal(a,b,l,obj); return _passed; };
493 bool emitComplexSignal(int a, float b, const QStringList& l, QObject* obj) { _passed = false; emit complexSignal(a,b,l,obj); return _passed; };
494
494
495 bool emitSignal1(int a) { _passed = false; emit signal1(a); return _passed; };
495 bool emitSignal1(int a) { _passed = false; emit signal1(a); return _passed; };
496 bool emitSignal2(const QString& s) { _passed = false; emit signal2(s); return _passed; };
496 bool emitSignal2(const QString& s) { _passed = false; emit signal2(s); return _passed; };
497 bool emitSignal3(float a) { _passed = false; emit signal3(a); return _passed; };
497 bool emitSignal3(float a) { _passed = false; emit signal3(a); return _passed; };
498
498
499 signals:
499 signals:
500 void intSignal(int);
500 void intSignal(int);
501 void floatSignal(float);
501 void floatSignal(float);
502 void variantSignal(const QVariant& v);
502 void variantSignal(const QVariant& v);
503 void complexSignal(int a, float b, const QStringList& l, QObject* obj);
503 void complexSignal(int a, float b, const QStringList& l, QObject* obj);
504 void enumSignal(PQCppObject2::TestEnumFlag flag);
504 void enumSignal(PQCppObject2::TestEnumFlag flag);
505
505
506 void signal1(int);
506 void signal1(int);
507 void signal2(const QString&);
507 void signal2(const QString&);
508 void signal3(float);
508 void signal3(float);
509
509
510 private:
510 private:
511 bool _passed;
511 bool _passed;
512 QVariant _v;
512 QVariant _v;
513
513
514 PythonQtTestSignalHandler* _test;
514 PythonQtTestSignalHandler* _test;
515 };
515 };
516
516
517 #endif
517 #endif
@@ -1,23 +1,39
1 # --------- PythonQtTest profile -------------------
1 # --------- PythonQtTest profile -------------------
2 # Last changed by $Author: florian $
2 # Last changed by $Author: florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 # $Source$
4 # $Source$
5 # --------------------------------------------------
5 # --------------------------------------------------
6 TARGET = PythonQtTest
6 TARGET = PythonQtTest
7 TEMPLATE = app
7 TEMPLATE = app
8 DESTDIR = ../lib
9
10 mac {
11 CONFIG -= app_bundle
12 }
13
14 QT += testlib
15
16 include ( ../build/common.prf )
17 CONFIG+=BUILDING_QTALL
18 include ( ../build/pythonqt.prf )
8
19
9 contains(QT_MAJOR_VERSION, 5) {
20 contains(QT_MAJOR_VERSION, 5) {
10 QT += testlib widgets
21 QT += widgets
11 } else {
12 CONFIG += qtestlib
13 }
22 }
14
23
15 include ( ../build/common.prf )
16 include ( ../build/PythonQt.prf )
17
18 HEADERS += \
24 HEADERS += \
19 PythonQtTests.h
25 PythonQtTests.h
20
26
21 SOURCES += \
27 SOURCES += \
22 PythonQtTestMain.cpp \
28 PythonQtTestMain.cpp \
23 PythonQtTests.cpp
29 PythonQtTests.cpp
30
31 # run the tests after compiling
32 macx {
33 QMAKE_POST_LINK = cd $${DESTDIR} && ./$${TARGET}
34 } else:win32 {
35 QMAKE_POST_LINK = \"$${DESTDIR}/$${TARGET}.exe\"
36 } else:unix {
37 # linux
38 QMAKE_POST_LINK = cd $${DESTDIR} && LD_LIBRARY_PATH=$$(LD_LIBRARY_PATH):./ xvfb-run -a ./$${TARGET}
39 }
General Comments 0
You need to be logged in to leave comments. Login now