##// 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 1 project(PythonQt)
2 2 cmake_minimum_required(VERSION 2.8.10)
3 3
4 4 IF(POLICY CMP0020)
5 5 cmake_policy(SET CMP0020 NEW)
6 6 ENDIF()
7 7
8 8 include(CTestUseLaunchers OPTIONAL)
9 9
10 10 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
11 11
12 12 #-----------------------------------------------------------------------------
13 13 # Version
14 14 SET(PythonQt_VERSION 2.2.0)
15 15
16 16 #-----------------------------------------------------------------------------
17 17 # Debug
18 18 option(PythonQt_DEBUG "Enable/Disable PythonQt debug output" OFF)
19 19 if(PythonQt_DEBUG)
20 20 add_definitions(-DPYTHONQT_DEBUG)
21 21 else()
22 22 remove_definitions(-DPYTHONQT_DEBUG)
23 23 endif()
24 24
25 25 if(NOT CMAKE_BUILD_TYPE)
26 26 set(CMAKE_BUILD_TYPE Release)
27 27 endif()
28 28
29 29 #-----------------------------------------------------------------------------
30 30 # Qt
31 31 option(PythonQt_Qt5 "Use Qt 5.x" OFF)
32 32 if(PythonQt_Qt5)
33 33 include(PythonQt_Qt_5x)
34 34 else(PythonQt_Qt5)
35 35 include(PythonQt_Qt_4x)
36 36 endif(PythonQt_Qt5)
37 37
38 38 #-----------------------------------------------------------------------------
39 39 # The variable "generated_cpp_suffix" allows to conditionnally compile the generated wrappers
40 40 # associated with the Qt version being used.
41 41 set(generated_cpp_suffix "_${QT_VERSION_MAJOR}${QT_VERSION_MINOR}")
42 42
43 43 if("${generated_cpp_suffix}" STREQUAL "_48")
44 44 set(generated_cpp_suffix "")
45 45 endif()
46 46 if("${generated_cpp_suffix}" STREQUAL "_46")
47 47 set(generated_cpp_suffix "_47") # Also use 4.7 wrappers for 4.6.x version
48 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 52 set(generated_cpp_suffix "_50")
51 53 endif()
52 54
53 55 #-----------------------------------------------------------------------------
54 56 # Generator
55 57 if(PythonQt_Qt5)
56 58 add_subdirectory(generator_50 EXCLUDE_FROM_ALL)
57 59 add_custom_target(generator)
58 60 add_dependencies(generator pythonqt_generator)
59 61 endif()
60 62
61 63 # TODO
62 64
63 65 #-----------------------------------------------------------------------------
64 66 # Build options
65 67
66 68 #option(PythonQt_Wrap_QtAll "Make all Qt components available in python" OFF)
67 69 #
68 70 #set(qtlibs core gui network opengl sql svg uitools webkit xml xmlpatterns)
69 71 #foreach(qtlib ${qtlibs})
70 72 # OPTION(PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
71 73 #endforeach()
72 74
73 75 # Force option if it applies
74 76 #if(PythonQt_Wrap_QtAll)
75 77 # list(REMOVE_ITEM qtlibs xmlpatterns) # xmlpatterns wrapper does *NOT* build at all :(
76 78 # foreach(qtlib ${qtlibs})
77 79 # if(NOT ${PythonQt_Wrap_Qt${qtlib}})
78 80 # set(PythonQt_Wrap_Qt${qtlib} ON CACHE BOOL "Make all of Qt${qtlib} available in python" FORCE)
79 81 # message(STATUS "Enabling [PythonQt_Wrap_Qt${qtlib}] because of [PythonQt_Wrap_QtAll] evaluates to True")
80 82 # endif()
81 83 # endforeach()
82 84 #endif()
83 85
84 86 #-----------------------------------------------------------------------------
85 87 # Add extra sources
86 88 #foreach(qtlib core gui network opengl sql svg uitools webkit xml xmlpatterns)
87 89 #
88 90 # if (${PythonQt_Wrap_Qt${qtlib}})
89 91 #
90 92 # ADD_DEFINITIONS(-DPYTHONQT_WRAP_Qt${qtlib})
91 93 #
92 94 # set(file_prefix generated_cpp${generated_cpp_suffix}/com_trolltech_qt_${qtlib}/com_trolltech_qt_${qtlib})
93 95 #
94 96 # foreach(index RANGE 0 11)
95 97 #
96 98 # # Source files
97 99 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.cpp)
98 100 # list(APPEND sources ${file_prefix}${index}.cpp)
99 101 # endif()
100 102 #
101 103 # # Headers that should run through moc
102 104 # if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}${index}.h)
103 105 # list(APPEND moc_sources ${file_prefix}${index}.h)
104 106 # endif()
105 107 #
106 108 # endforeach()
107 109 #
108 110 # list(APPEND sources ${file_prefix}_init.cpp)
109 111 #
110 112 # endif()
111 113 #endforeach()
112 114
113 115 #-----------------------------------------------------------------------------
114 116 # Find Python
115 117 option(PythonQt_Python3 "Use Python 3.x (3.3+)" OFF)
116 118 option(PythonQt_Python "Use specific Python Version" OFF)
117 119 if(PythonQt_Python)
118 120 find_package(Python ${PythonQt_Python} REQUIRED EXACT)
119 121 elseif(PythonQt_Python3)
120 122 find_package(Python 3.3 REQUIRED)
121 123 else()
122 124 find_package(Python 2.6 REQUIRED)
123 125 endif()
124 126
125 127 if(NOT ${PYTHON_VERSION} VERSION_LESS 3)
126 128 set(PythonQt_Python3 ON)
127 129 else()
128 130 set(PythonQt_Python3 OFF)
129 131 endif()
130 132
131 133 include_directories(${PYTHON_INCLUDE_DIRS})
132 134 add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
133 135
134 136 #-----------------------------------------------------------------------------
135 137 # Library Name
136 138 # The variable PythonQt contains the PythonQt core library name
137 139 # It incorporates library mayor versions
138 140 set(PythonQt PythonQt)
139 141
140 142 if(PythonQt_Qt5)
141 143 set(PythonQt ${PythonQt}5)
142 144 endif()
143 145
144 146 if(PythonQt_Python3)
145 147 set(PythonQt ${PythonQt}_3)
146 148 endif()
147 149
148 150 set(CMAKE_DEBUG_POSTFIX "_d")
149 151
150 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 155 # Core
154 156 add_subdirectory(src)
155 157
156 158 #-----------------------------------------------------------------------------
157 159 # Tests
158 160 add_subdirectory(tests EXCLUDE_FROM_ALL)
159 161 # test alias
160 162 add_custom_target(test COMMAND tests/PythonQtTest WORKING_DIRECTORY ${CURRENT_BINARY_DIR})
161 163 add_dependencies(test PythonQtTest)
162 164
163 165 #-----------------------------------------------------------------------------
164 166 # Extenseions (QtAll)
165 167 add_subdirectory(extensions)
166 168 # QtAll alias
167 169 add_custom_target(QtAll)
168 170 add_dependencies(QtAll ${PythonQt_QtAll})
169 171
170 172 #-----------------------------------------------------------------------------
171 173 # Examples
172 174 include_directories(src)
173 175 include_directories(extensions/PythonQt_QtAll)
174 176 add_subdirectory(examples EXCLUDE_FROM_ALL)
175 177
176 178 #-----------------------------------------------------------------------------
177 179 # uninstall target
178 180 configure_file(
179 181 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
180 182 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
181 183 IMMEDIATE @ONLY)
182 184
183 185 add_custom_target(uninstall
184 186 COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
@@ -1,5 +1,10
1 1 TEMPLATE = subdirs
2 2
3 3 CONFIG += ordered
4 #SUBDIRS = src extensions tests examples generator_50
5 SUBDIRS = src extensions generator_50
4 SUBDIRS = src extensions tests examples
5
6 #contains(QT_MAJOR_VERSION, 5) {
7 #SUBDIRS += generator_50
8 #} else {
9 #SUBDIRS += generator
10 #}
@@ -1,189 +1,189
1 1 # - Find python
2 2 # This module searches for both the python interpreter and the python libraries
3 3 # and determines where they are located
4 4 #
5 5 #
6 6 # PYTHON_FOUND - The requested Python components were found
7 7 # PYTHON_EXECUTABLE - path to the Python interpreter
8 8 # PYTHON_INCLUDE_DIRS - path to the Python header files
9 9 # PYTHON_LIBRARIES - the libraries to link against for python
10 10 # PYTHON_VERSION - the python version
11 11 #
12 12
13 13 #=============================================================================
14 14 # Copyright 2010 Branan Purvine-Riley
15 15 # 2013 Orochimarufan
16 16 #
17 17 # Redistribution and use in source and binary forms, with or without
18 18 # modification, are permitted provided that the following conditions
19 19 # are met:
20 20 #
21 21 # * Redistributions of source code must retain the above copyright
22 22 # notice, this list of conditions and the following disclaimer.
23 23 #
24 24 # * Redistributions in binary form must reproduce the above copyright
25 25 # notice, this list of conditions and the following disclaimer in the
26 26 # documentation and/or other materials provided with the distribution.
27 27 #
28 28 # * Neither the names of Kitware, Inc., the Insight Software Consortium,
29 29 # nor the names of their contributors may be used to endorse or promote
30 30 # products derived from this software without specific prior written
31 31 # permission.
32 32 #
33 33 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34 34 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35 35 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
36 36 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
37 37 # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38 38 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
39 39 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
40 40 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
41 41 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42 42 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
43 43 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 44 #=============================================================================
45 45
46 46 IF("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
47 47 SET(PYTHON_3_OK "TRUE")
48 48 SET(PYTHON_2_OK "FALSE") # redundant in version selection code, but skips a FOREACH
49 49 ELSE("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
50 50 SET(PYTHON_2_OK "TRUE")
51 51 # don't set PYTHON_3_OK to false here - if the user specified it we want to search for Python 2 & 3
52 52 ENDIF("3" STREQUAL "${Python_FIND_VERSION_MAJOR}")
53 53
54 54 # This is heavily inspired by FindBoost.cmake, with the addition of a second version list to keep
55 55 # python 2 and python 3 separate
56 56 IF(Python_FIND_VERSION_EXACT)
57 57 SET(_PYTHON_TEST_VERSIONS "${Python_FIND_VERSION_MAJOR}.${Python_FIND_VERSION_MINOR}")
58 58 ELSE(Python_FIND_VERSION_EXACT)
59 59 # Version lists
60 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 62 SET(_PYTHON_2_KNOWN_VERSIONS ${PYTHON_2_ADDITIONAL_VERSIONS}
63 63 "2.7" "2.6" "2.5" "2.4" "2.3" "2.2" "2.1" "2.0" "1.6" "1.5")
64 64 SET(_PYTHON_2_TEST_VERSIONS)
65 65 SET(_PYTHON_3_TEST_VERSIONS)
66 66 SET(_PYTHON_TEST_VERSIONS)
67 67 IF(Python_FIND_VERSION)
68 68 # python 3 versions
69 69 IF(PYTHON_3_OK)
70 70 FOREACH(version ${_PYTHON_3_KNOWN_VERSIONS})
71 71 IF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
72 72 LIST(APPEND _PYTHON_3_TEST_VERSIONS ${version})
73 73 ENDIF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
74 74 ENDFOREACH(version)
75 75 ENDIF(PYTHON_3_OK)
76 76 # python 2 versions
77 77 IF(PYTHON_2_OK)
78 78 FOREACH(version ${_PYTHON_2_KNOWN_VERSIONS})
79 79 IF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
80 80 LIST(APPEND _PYTHON_2_TEST_VERSIONS ${version})
81 81 ENDIF(NOT ${version} VERSION_LESS ${Python_FIND_VERSION})
82 82 ENDFOREACH(version)
83 83 ENDIF(PYTHON_2_OK)
84 84 # all versions
85 85 ELSE(Python_FIND_VERSION)
86 86 IF(PYTHON_3_OK)
87 87 LIST(APPEND _PYTHON_3_TEST_VERSIONS ${_PYTHON_3_KNOWN_VERSIONS})
88 88 ENDIF(PYTHON_3_OK)
89 89 IF(PYTHON_2_OK)
90 90 LIST(APPEND _PYTHON_2_TEST_VERSIONS ${_PYTHON_2_KNOWN_VERSIONS})
91 91 ENDIF(PYTHON_2_OK)
92 92 ENDIF(Python_FIND_VERSION)
93 93 # fix python3 version flags
94 94 IF(PYTHON_3_OK)
95 95 FOREACH(version ${_PYTHON_3_TEST_VERSIONS})
96 96 IF(${version} VERSION_GREATER 3.1)
97 97 LIST(APPEND _PYTHON_TEST_VERSIONS "${version}mu" "${version}m" "${version}u" "${version}")
98 98 ELSE(${version} VERSION_GREATER 3.1)
99 99 LIST(APPEND _PYTHON_TEST_VERSIONS ${version})
100 100 ENDIF(${version} VERSION_GREATER 3.1)
101 101 ENDFOREACH(version)
102 102 ENDIF(PYTHON_3_OK)
103 103 IF(PYTHON_2_OK)
104 104 LIST(APPEND _PYTHON_TEST_VERSIONS ${_PYTHON_2_TEST_VERSIONS})
105 105 ENDIF(PYTHON_2_OK)
106 106 ENDIF(Python_FIND_VERSION_EXACT)
107 107
108 108 SET(_PYTHON_EXE_VERSIONS)
109 109 FOREACH(version ${_PYTHON_TEST_VERSIONS})
110 110 LIST(APPEND _PYTHON_EXE_VERSIONS python${version})
111 111 ENDFOREACH(version ${_PYTHON_TEST_VERSIONS})
112 112
113 113 IF(WIN32)
114 114 SET(_PYTHON_REGISTRY_KEYS)
115 115 FOREACH(version ${_PYTHON_TEST_VERSIONS})
116 116 LIST(APPEND _PYTHON_REGISTRY_KEYS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${version}\\InstallPath])
117 117 ENDFOREACH(version ${_PYTHON_TEST_VERSIONS})
118 118 # this will find any standard windows Python install before it finds anything from Cygwin
119 119 FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python ${_PYTHON_EXE_VERSIONS} PATHS ${_PYTHON_REGISTRY_KEYS})
120 120 ELSE(WIN32)
121 121 FIND_PROGRAM(PYTHON_EXECUTABLE NAMES ${_PYTHON_EXE_VERSIONS} PATHS)
122 122 ENDIF(WIN32)
123 123
124 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 126 # Get our library path and include directory from python
127 127 IF(${PYTHON_VERSION} VERSION_GREATER 3.1)
128 128 SET(_PYTHON_SYSCONFIG "sysconfig")
129 129 SET(_PYTHON_SC_INCLUDE "sysconfig.get_path('include')")
130 130 ELSE()
131 131 SET(_PYTHON_SYSCONFIG "distutils.sysconfig")
132 132 SET(_PYTHON_SC_INCLUDE "distutils.sysconfig.get_python_inc()")
133 133 ENDIF()
134 134
135 135 IF(WIN32)
136 136 EXECUTE_PROCESS(
137 137 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('prefix'))"
138 138 OUTPUT_VARIABLE _PYTHON_PREFIX
139 139 )
140 140 EXECUTE_PROCESS(
141 141 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('py_version_nodot'))"
142 142 OUTPUT_VARIABLE _PYTHON_VERSION_MAJOR
143 143 )
144 144 SET(_PYTHON_LIBRARY_PATH ${_PYTHON_PREFIX}/libs)
145 145 SET(_PYTHON_LIBRARY_NAME libpython${_PYTHON_VERSION_MAJOR}.a)
146 146 ELSE(WIN32)
147 147 EXECUTE_PROCESS(
148 148 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LIBDIR'))"
149 149 OUTPUT_VARIABLE _PYTHON_LIBRARY_PATH
150 150 )
151 151 EXECUTE_PROCESS(
152 152 COMMAND "${PYTHON_EXECUTABLE}" -c "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SYSCONFIG}.get_config_var('LDLIBRARY'))"
153 153 OUTPUT_VARIABLE _PYTHON_LIBRARY_NAME
154 154 )
155 155 # Multiarch
156 156 EXECUTE_PROCESS(
157 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 158 OUTPUT_VARIABLE _PYTHON_LIBRARY_MULTIARCH
159 159 )
160 160 IF(NOT "${_PYTHON_LIBRARY_MULTIARCH}" STREQUAL "PYTHON_LIBRARY_MULTIARCH-NOTFOUND")
161 161 SET(_PYTHON_LIBRARY_PATH_X ${_PYTHON_LIBRARY_PATH})
162 162 SET(_PYTHON_LIBRARY_PATH)
163 163 FOREACH(path ${_PYTHON_LIBRARY_PATH_X})
164 164 LIST(APPEND _PYTHON_LIBRARY_PATH "${path}/${_PYTHON_LIBRARY_MULTIARCH}" "${path}")
165 165 ENDFOREACH(path)
166 166 ENDIF(NOT "${_PYTHON_LIBRARY_MULTIARCH}" STREQUAL "PYTHON_LIBRARY_MULTIARCH-NOTFOUND")
167 167 ENDIF(WIN32)
168 168 EXECUTE_PROCESS(COMMAND "${PYTHON_EXECUTABLE}"
169 169 "-c" "import ${_PYTHON_SYSCONFIG}; import sys; sys.stdout.write(${_PYTHON_SC_INCLUDE})"
170 170 OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
171 171 )
172 172
173 173 FIND_FILE(PYTHON_LIBRARY ${_PYTHON_LIBRARY_NAME} PATHS ${_PYTHON_LIBRARY_PATH} NO_DEFAULT_PATH)
174 174 FIND_FILE(PYTHON_HEADER "Python.h" PATHS ${PYTHON_INCLUDE_DIR} NO_DEFAULT_PATH)
175 175
176 176 set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR})
177 177 set(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
178 178
179 179 INCLUDE(FindPackageHandleStandardArgs)
180 180 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python
181 181 REQUIRED_VARS PYTHON_EXECUTABLE PYTHON_HEADER PYTHON_LIBRARY
182 182 VERSION_VAR PYTHON_VERSION
183 183 )
184 184
185 185 MARK_AS_ADVANCED(PYTHON_EXECUTABLE)
186 186 MARK_AS_ADVANCED(PYTHON_INCLUDE_DIRS)
187 187 MARK_AS_ADVANCED(PYTHON_LIBRARIES)
188 188 MARK_AS_ADVANCED(PYTHON_VERSION)
189 189
@@ -1,45 +1,46
1 1 #include <PythonQt.h>
2 2 #include <QtGui>
3 #include <QApplication>
3 4
4 5 int main (int argc, char* argv[]) {
5 6 QApplication app(argc, argv);
6 7 PythonQt::init();
7 8 PythonQtObjectPtr mainModule = PythonQt::self()->getMainModule();
8 9 mainModule.evalScript(QString("import sys\n"));
9 10 Q_ASSERT(!mainModule.isNull());
10 11 {
11 12 // evaluate a python file embedded in executable as resource:
12 13 mainModule.evalFile(":eyed3tagger.py");
13 14 // create an object, hold onto its reference
14 15 PythonQtObjectPtr tag = mainModule.evalScript("EyeD3Tagger()\n", Py_eval_input);
15 16 Q_ASSERT(!tag.isNull());
16 17 tag.call("setFileName", QVariantList() << "t.mp3");
17 18 QVariant fn = tag.call("fileName", QVariantList());
18 19 Q_ASSERT(fn.toString() == QString("t.mp3"));
19 20 // tag goes out of scope, reference count decremented.
20 21 }
21 22 {
22 23 // Allow the python system path to recognize QFile paths in the sys.path
23 24 PythonQt::self()->setImporter(NULL);
24 25 // append the Qt resource root directory to the sys.path
25 26 mainModule.evalScript("sys.path.append(':')\n");
26 27 mainModule.evalScript("import eyed3tagger\n");
27 28 PythonQtObjectPtr tag = mainModule.evalScript("eyed3tagger.EyeD3Tagger()\n", Py_eval_input);
28 29 Q_ASSERT(!tag.isNull());
29 30 tag.call("setFileName", QVariantList() << "t.mp3");
30 31 QVariant fn = tag.call("fileName", QVariantList());
31 32 Q_ASSERT(fn.toString() == QString("t.mp3"));
32 33 }
33 34 { // alternative using import and loading it as a real module from sys.path
34 35 // import sys first
35 36 mainModule.evalScript(QString("sys.path.append('%1')\n").arg(QDir::currentPath()));
36 37 mainModule.evalScript("import eyed3tagger\n");
37 38 PythonQtObjectPtr tag = mainModule.evalScript("eyed3tagger.EyeD3Tagger()\n", Py_eval_input);
38 39 Q_ASSERT(!tag.isNull());
39 40 tag.call("setFileName", QVariantList() << "t.mp3");
40 41 QVariant fn = tag.call("fileName", QVariantList());
41 42 Q_ASSERT(fn.toString() == QString("t.mp3"));
42 43 }
43 44 qDebug() << "finished";
44 45 return 0;
45 46 }
@@ -1,15 +1,21
1 1
2 2 TARGET = CPPPyWrapperExample
3 3 TEMPLATE = app
4 4
5 5 mac:CONFIG -= app_bundle
6 6
7 7 DESTDIR = ../../lib
8 8
9 contains(QT_MAJOR_VERSION, 5) {
10 QT += widgets
11 }
12
13
9 14 include ( ../../build/common.prf )
10 include ( ../../build/PythonQt.prf )
15 CONFIG+=BUILDING_QTALL
16 include ( ../../build/pythonqt.prf )
11 17
12 18 SOURCES += \
13 19 CPPPyWrapperExample.cpp
14 20
15 21 RESOURCES += CPPPyWrapperExample.qrc
@@ -1,35 +1,36
1 1 TARGET = NicePyConsole
2 2 TEMPLATE = app
3 3
4 4 DESTDIR = ../../lib
5 5
6 6 contains(QT_MAJOR_VERSION, 5) {
7 7 QT += widgets
8 8 }
9 9
10 10 mac:CONFIG-= app_bundle
11 11
12 include ( ../../build/common.prf )
13 include ( ../../build/PythonQt.prf )
12 include ( ../../build/common.prf )
13 CONFIG+=BUILDING_QTALL
14 include ( ../../build/pythonqt.prf )
14 15 include ( ../../build/PythonQt_QtAll.prf )
15 16
16 17
17 18 HEADERS += \
18 19 SimpleConsole.h \
19 20 NicePyConsole.h \
20 21 PygmentsHighlighter.h \
21 22 PythonCompleter.h \
22 23 PythonCompleterPopup.h
23 24
24 25 SOURCES += \
25 26 SimpleConsole.cpp \
26 27 NicePyConsole.cpp \
27 28 main.cpp \
28 29 PygmentsHighlighter.cpp \
29 30 PythonCompleter.cpp \
30 31 PythonCompleterPopup.cpp
31 32
32 33 OTHER_FILES += \
33 34 PygmentsHighlighter.py \
34 35 PythonCompleter.py \
35 36 module_completion.py
@@ -1,22 +1,27
1 1 # --------- PyCPPWrapperExample profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6
7 7 TARGET = PyCPPWrapperExample
8 8 TEMPLATE = app
9 9
10 10 DESTDIR = ../../lib
11 11
12 contains(QT_MAJOR_VERSION, 5) {
13 QT += widgets
14 }
15
12 16 include ( ../../build/common.prf )
13 include ( ../../build/PythonQt.prf )
17 CONFIG+=BUILDING_QTALL
18 include ( ../../build/pythonqt.prf )
14 19
15 20 HEADERS += \
16 21 CustomObjects.h
17 22
18 23 SOURCES += \
19 24 main.cpp \
20 25 CustomObjects.cpp
21 26
22 27 RESOURCES += PyCPPWrapperExample.qrc
@@ -1,23 +1,27
1 1 # --------- PyCustomMetaTypeExample profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6
7 7 TARGET = PyCustomMetaTypeExample
8 8 TEMPLATE = app
9 9
10 10 DESTDIR = ../../lib
11 11
12 contains(QT_MAJOR_VERSION, 5) {
13 QT += widgets
14 }
15
12 16 include ( ../../build/common.prf )
13 17 include ( ../../build/PythonQt.prf )
14 18
15 19
16 20 HEADERS += \
17 21 CustomObject.h
18 22
19 23 SOURCES += \
20 24 main.cpp \
21 25 CustomObject.cpp
22 26
23 27 RESOURCES += PyCustomMetaTypeExample.qrc
@@ -1,23 +1,27
1 1 # --------- PyGuiExample profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6
7 7 TARGET = PyDecoratorsExample
8 8 TEMPLATE = app
9 9
10 10 DESTDIR = ../../lib
11 11
12 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 20 HEADERS += \
17 21 PyExampleDecorators.h
18 22
19 23 SOURCES += \
20 24 main.cpp \
21 25 PyExampleDecorators.cpp
22 26
23 27 RESOURCES += PyDecoratorsExample.qrc
@@ -1,95 +1,102
1 1 #ifndef _PYEXAMPLEDECORATORS_H
2 2 #define _PYEXAMPLEDECORATORS_H
3 3
4 4 /*
5 5 *
6 6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 7 *
8 8 * This library is free software; you can redistribute it and/or
9 9 * modify it under the terms of the GNU Lesser General Public
10 10 * License as published by the Free Software Foundation; either
11 11 * version 2.1 of the License, or (at your option) any later version.
12 12 *
13 13 * This library is distributed in the hope that it will be useful,
14 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 16 * Lesser General Public License for more details.
17 17 *
18 18 * Further, this software is distributed without any warranty that it is
19 19 * free of the rightful claim of any third person regarding infringement
20 20 * or the like. Any license provided herein, whether implied or
21 21 * otherwise, applies only to this software file. Patent licenses, if
22 22 * any, provided herein do not apply to combinations of this program with
23 23 * other software, or any other product whatsoever.
24 24 *
25 25 * You should have received a copy of the GNU Lesser General Public
26 26 * License along with this library; if not, write to the Free Software
27 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 28 *
29 29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 30 * 28359 Bremen, Germany or:
31 31 *
32 32 * http://www.mevis.de
33 33 *
34 34 */
35 35
36 36 //----------------------------------------------------------------------------------
37 37 /*!
38 38 // \file PyExampleDecorators.h
39 39 // \author Florian Link
40 40 // \author Last changed by $Author: florian $
41 41 // \date 2007-4
42 42 */
43 43 //----------------------------------------------------------------------------------
44 44
45 45 #include "PythonQt.h"
46 46 #include <QDebug>
47 47 #include <QObject>
48 48 #include <QPushButton>
49 49
50 50 // an example CPP object
51 51 class YourCPPObject {
52 52 public:
53 53 YourCPPObject(int arg1, float arg2) { a = arg1; b = arg2; }
54 54
55 55 float doSomething(int arg1) { return arg1*a*b; };
56 56
57 57 private:
58 58
59 59 int a;
60 60 float b;
61 61 };
62 62
63 63 // an example decorator
64 64 class PyExampleDecorators : public QObject
65 65 {
66 66 Q_OBJECT
67 67
68 68 public slots:
69 69 // add a constructor to QSize variant that takes a QPoint
70 70 QSize* new_QSize(const QPoint& p) { return new QSize(p.x(), p.y()); }
71 71
72 72 // add a constructor for QPushButton that takes a text and a parent widget
73 73 QPushButton* new_QPushButton(const QString& text, QWidget* parent=NULL) { return new QPushButton(text, parent); }
74 74
75 75 // add a constructor for a CPP object
76 76 YourCPPObject* new_YourCPPObject(int arg1, float arg2) { return new YourCPPObject(arg1, arg2); }
77 77
78 78 // add a destructor for a CPP object
79 79 void delete_YourCPPObject(YourCPPObject* obj) { delete obj; }
80 80
81 81 // add a static method to QWidget
82 82 QWidget* static_QWidget_mouseGrabber() { return QWidget::mouseGrabber(); }
83 83
84 84 // add an additional slot to QWidget (make move() callable, which is not declared as a slot in QWidget)
85 85 void move(QWidget* w, const QPoint& p) { w->move(p); }
86 86
87 87 // add an additional slot to QWidget, overloading the above move method
88 88 void move(QWidget* w, int x, int y) { w->move(x,y); }
89 89
90 90 // add a method to your own CPP object
91 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 102 #endif
@@ -1,28 +1,34
1 1 from PythonQt import QtCore, QtGui, example
2 2
3 3 # call our new constructor of QSize
4 4 size = QtCore.QSize(QtCore.QPoint(1,2));
5 5
6 6 # call our new QPushButton constructor
7 7 button = QtGui.QPushButton("sometext");
8 8
9 9 # call the move slot (overload1)
10 10 button.move(QtCore.QPoint(0,0))
11 11
12 12 # call the move slot (overload2)
13 13 button.move(0,0)
14 14
15 15 # call the static method
16 16 print QtGui.QWidget.mouseGrabber();
17 17
18 18 # create a CPP object via constructor
19 19 yourCpp = example.YourCPPObject(2,11.5)
20 20
21 21 # call the wrapped method on CPP object
22 22 print yourCpp.doSomething(3);
23 23
24 24 # show slots available on yourCpp
25 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 33 # destructor will be called:
28 34 yourCpp = None
@@ -1,20 +1,25
1 1 # --------- PyScriptingConsole profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6
7 7 TARGET = PyGettingStarted
8 8 TEMPLATE = app
9 9
10 10 DESTDIR = ../../lib
11 11
12 12 CONFIG += console
13 13
14 contains(QT_MAJOR_VERSION, 5) {
15 QT += widgets
16 }
17
14 18 include ( ../../build/common.prf )
15 include ( ../../build/PythonQt.prf )
19 CONFIG+=BUILDING_QTALL
20 include ( ../../build/pythonqt.prf )
16 21
17 22 SOURCES += \
18 23 main.cpp
19 24
20 25 RESOURCES += PyGettingStarted.qrc
@@ -1,21 +1,27
1 1 # --------- PyGuiExample profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6
7 7 TARGET = PyGuiExample
8 8 TEMPLATE = app
9 9
10 10 mac:CONFIG -= app_bundle
11 11
12 12 DESTDIR = ../../lib
13 13
14 contains(QT_MAJOR_VERSION, 5) {
15 QT += widgets
16 }
17
18
14 19 include ( ../../build/common.prf )
15 include ( ../../build/PythonQt.prf )
20 CONFIG+=BUILDING_QTALL
21 include ( ../../build/pythonqt.prf )
16 22 include ( ../../build/PythonQt_QtAll.prf )
17 23
18 24 SOURCES += \
19 25 main.cpp
20 26
21 27 RESOURCES += PyGuiExample.qrc
@@ -1,19 +1,24
1 1 # --------- PyLauncher profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6
7 7 TARGET = PyLauncher
8 8 TEMPLATE = app
9 9
10 10 mac:CONFIG -= app_bundle
11 11
12 12 DESTDIR = ../../lib
13 13
14 contains(QT_MAJOR_VERSION, 5) {
15 QT += widgets
16 }
17
14 18 include ( ../../build/common.prf )
15 include ( ../../build/PythonQt.prf )
19 CONFIG+=BUILDING_QTALL
20 include ( ../../build/pythonqt.prf )
16 21 include ( ../../build/PythonQt_QtAll.prf )
17 22
18 23 SOURCES += \
19 24 main.cpp
@@ -1,87 +1,87
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Research GmbH, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PyExampleObject.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-10
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PyExampleObject.h"
43 43 #include <QMessageBox>
44 44 #include <QDir>
45 45
46 46 PyExampleObject::PyExampleObject():QObject(NULL)
47 47 {
48 48 }
49 49
50 50 PyObject* PyExampleObject::getMainModule() {
51 51 return PythonQt::self()->getMainModule();
52 52 }
53 53
54 54 void PyExampleObject::showInformation(const QString& str)
55 55 {
56 56 QMessageBox::information ( NULL, "Test", str);
57 57 }
58 58
59 59 QStringList PyExampleObject::readDirectory(const QString& dir)
60 60 {
61 61 QDir d(dir);
62 62 return d.entryList();
63 63 }
64 64
65 65 QMainWindow* PyExampleObject::createWindow()
66 66 {
67 67 QMainWindow* m = new QMainWindow();
68 68 QPushButton* b = new QPushButton(m);
69 69 b->setObjectName("button1");
70 70
71 71 m->show();
72 72 return m;
73 73 }
74 74
75 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 80 QVariantMap PyExampleObject::testMap()
81 81 {
82 82 QVariantMap m;
83 83 m.insert("a", QStringList() << "test1" << "test2");
84 84 m.insert("b", 12);
85 85 m.insert("c", 12.);
86 86 return m;
87 87 }
@@ -1,25 +1,30
1 1 # --------- PyScriptingConsole profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6
7 7 TARGET = PyScriptingConsole
8 8 TEMPLATE = app
9 9
10 10 DESTDIR = ../../lib
11 11
12 contains(QT_MAJOR_VERSION, 5) {
13 QT += widgets
14 }
15
12 16 mac:CONFIG-= app_bundle
13 17
14 18 include ( ../../build/common.prf )
15 include ( ../../build/PythonQt.prf )
16 include ( ../../build/PythonQt_QtAll.prf )
19 CONFIG+=BUILDING_QTALL
20 include ( ../../build/pythonqt.prf )
21 include ( ../../build/PythonQt_QtAll.prf )
17 22
18 23 HEADERS += \
19 24 PyExampleObject.h
20 25
21 26 SOURCES += \
22 27 PyExampleObject.cpp \
23 28 main.cpp
24 29
25 30 RESOURCES += PyScriptingConsole.qrc
@@ -1,9 +1,10
1 1 TEMPLATE = subdirs
2 2 SUBDIRS = CPPPyWrapperExample \
3 3 PyGettingStarted \
4 4 PyCPPWrapperExample \
5 5 PyCustomMetaTypeExample \
6 6 PyGuiExample \
7 7 PyDecoratorsExample \
8 8 PyScriptingConsole \
9 PyLauncher
9 PyLauncher \
10 NicePyConsole
@@ -1,67 +1,65
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 #include "PythonQt_QtAll.h"
34 34
35 35 #include "PythonQt.h"
36 36
37 37 void PythonQt_init_QtGui(PyObject*);
38 38 void PythonQt_init_QtSvg(PyObject*);
39 39 void PythonQt_init_QtSql(PyObject*);
40 40 void PythonQt_init_QtNetwork(PyObject*);
41 41 void PythonQt_init_QtCore(PyObject*);
42 42 void PythonQt_init_QtWebKit(PyObject*);
43 43 void PythonQt_init_QtOpenGL(PyObject*);
44 44 void PythonQt_init_QtXml(PyObject*);
45 45 void PythonQt_init_QtXmlPatterns(PyObject*);
46 46 void PythonQt_init_QtUiTools(PyObject*);
47 47 void PythonQt_init_QtPhonon(PyObject*);
48 48
49 49 namespace PythonQt_QtAll
50 50 {
51 51 PYTHONQT_QTALL_EXPORT void init() {
52 52 PythonQt_init_QtCore(0);
53 53 PythonQt_init_QtNetwork(0);
54 54 PythonQt_init_QtGui(0);
55 55 PythonQt_init_QtXml(0);
56 56 PythonQt_init_QtSvg(0);
57 57 PythonQt_init_QtSql(0);
58 58 PythonQt_init_QtWebKit(0);
59 59 PythonQt_init_QtOpenGL(0);
60 60 PythonQt_init_QtUiTools(0);
61 61 // Does not compile yet:
62 62 // PythonQt_init_QtXmlPatterns(0);
63 63 // PythonQt_init_QtPhonon(0);
64 };
65 };
66
67
64 }
65 }
1 NO CONTENT: modified file chmod 100644 => 100755
1 NO CONTENT: modified file chmod 100644 => 100755
@@ -1,92 +1,100
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
4 4 ** All rights reserved.
5 5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 6 **
7 7 ** This file is part of the Qt Script Generator project on Qt Labs.
8 8 **
9 9 ** $QT_BEGIN_LICENSE:LGPL$
10 10 ** No Commercial Usage
11 11 ** This file contains pre-release code and may not be distributed.
12 12 ** You may use this file in accordance with the terms and conditions
13 13 ** contained in the Technology Preview License Agreement accompanying
14 14 ** this package.
15 15 **
16 16 ** GNU Lesser General Public License Usage
17 17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 18 ** General Public License version 2.1 as published by the Free Software
19 19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 20 ** packaging of this file. Please review the following information to
21 21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23 23 **
24 24 ** In addition, as a special exception, Nokia gives you certain additional
25 25 ** rights. These rights are described in the Nokia Qt LGPL Exception
26 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27 27 **
28 28 ** If you have questions regarding the use of this file, please contact
29 29 ** Nokia at qt-info@nokia.com.
30 30 **
31 31 **
32 32 **
33 33 **
34 34 **
35 35 **
36 36 **
37 37 **
38 38 ** $QT_END_LICENSE$
39 39 **
40 40 ****************************************************************************/
41 41
42 42 #ifndef PP_ITERATOR_H
43 43 #define PP_ITERATOR_H
44 44
45 45 #include <iterator>
46 46
47 47 namespace rpp {
48 48
49 49 class pp_null_output_iterator
50 50 : public std::iterator<std::output_iterator_tag, void, void, void, void>
51 51 {
52 52 public:
53 53 pp_null_output_iterator() {}
54 54
55 55 template <typename _Tp>
56 56 pp_null_output_iterator &operator=(_Tp const &)
57 57 { return *this; }
58 58
59 59 inline pp_null_output_iterator &operator * () { return *this; }
60 60 inline pp_null_output_iterator &operator ++ () { return *this; }
61 61 inline pp_null_output_iterator operator ++ (int) { return *this; }
62 62 };
63 63
64 64 template <typename _Container>
65 65 class pp_output_iterator
66 66 : public std::iterator<std::output_iterator_tag, void, void, void, void>
67 67 {
68 68 std::string &_M_result;
69 69
70 70 public:
71 71 explicit pp_output_iterator(std::string &__result):
72 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 82 inline pp_output_iterator &operator=(typename _Container::const_reference __v)
75 83 {
76 84 if (_M_result.capacity () == _M_result.size ())
77 85 _M_result.reserve (_M_result.capacity () << 2);
78 86
79 87 _M_result.push_back(__v);
80 88 return *this;
81 89 }
82 90
83 91 inline pp_output_iterator &operator * () { return *this; }
84 92 inline pp_output_iterator &operator ++ () { return *this; }
85 93 inline pp_output_iterator operator ++ (int) { return *this; }
86 94 };
87 95
88 96 } // namespace rpp
89 97
90 98 #endif // PP_ITERATOR_H
91 99
92 100 // kate: space-indent on; indent-width 2; replace-tabs on;
@@ -1,5720 +1,5721
1 1 <?xml version="1.0"?>
2 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 4 <rejection class="*" function-name="d_func"/>
5 5
6 6 <rejection class="*" field-name="d_ptr"/>
7 7 <rejection class="*" field-name="d"/>
8 8
9 9
10 10 <rejection class="QGenericMatrix"/>
11 11 <rejection class="QPixmapFilterPrivate"/>
12 12 <rejection class="QPenPrivate"/>
13 13 <rejection class="QGtkStyle"/>
14 14 <rejection class="QWindowsCEStyle"/>
15 15 <rejection class="QWindowsMobileStyle"/>
16 16 <rejection class="QAbstractUndoItem"/>
17 17 <rejection class="QAccessibleApplication"/>
18 18 <rejection class="QBrushData"/>
19 19 <rejection class="QImageTextKeyLang"/>
20 20 <rejection class="QItemEditorCreator"/>
21 21 <rejection class="QLinkedList"/>
22 22 <rejection class="QLinkedListData"/>
23 23 <rejection class="QLinkedListIterator"/>
24 24 <rejection class="QLinkedListNode"/>
25 25 <rejection class="QMimeSource"/>
26 26 <rejection class="QPainterPathPrivate"/>
27 27 <rejection class="QRegionData"/>
28 28 <rejection class="QStandardItemEditorCreator"/>
29 29 <rejection class="QStyleOptionQ3DockWindow"/>
30 30 <rejection class="QStyleOptionQ3ListView"/>
31 31 <rejection class="QStyleOptionQ3ListViewItem"/>
32 32 <rejection class="QTextFrameLayoutData"/>
33 33 <rejection class="QUpdateLaterEvent"/>
34 34 <rejection class="QVFbHeader"/>
35 35 <rejection class="QWidgetData"/>
36 36 <rejection class="QWindowSurface"/>
37 37 <rejection class="QWindowsXPStyle"/>
38 38 <rejection class="QWindowsVistaStyle"/>
39 39 <rejection class="QWSEmbedWidget"/>
40 40 <rejection class="QRegion::QRegionData"/>
41 41 <rejection class="JObject_key"/>
42 42 <rejection class="QAccessibleEditableTextInterface"/>
43 43 <rejection class="QAccessibleSimpleEditableTextInterface"/>
44 44 <rejection class="QAccessibleTextInterface"/>
45 45 <rejection class="QAccessibleValueInterface"/>
46 46 <rejection class="QIconEngineFactoryInterface"/>
47 47 <rejection class="QIconEnginePlugin"/>
48 48 <rejection class="QWidgetItemV2"/>
49 49 <rejection class="QAbstractItemDelegate" function-name="operator="/>
50 50 <rejection class="QAccessible" function-name="installFactory"/>
51 51 <rejection class="QAccessible" function-name="installRootObjectHandler"/>
52 52 <rejection class="QAccessible" function-name="installUpdateHandler"/>
53 53 <rejection class="QAccessible" function-name="removeFactory"/>
54 54 <rejection class="QApplication" function-name="compressEvent"/>
55 55 <rejection class="QBrush" function-name="cleanUp"/>
56 56 <rejection class="QPictureIO" function-name="defineIOHandler"/>
57 57 <rejection class="QPolygon" function-name="putPoints"/>
58 58 <rejection class="QPolygon" function-name="setPoints"/>
59 59 <rejection class="QPolygon" function-name="setPoint"/>
60 60 <rejection class="QPolygon" function-name="points"/>
61 61 <rejection class="QPolygon" function-name="point"/>
62 62 <rejection class="QPrinter" function-name="printerSelectionOption"/>
63 63 <rejection class="QPrinter" function-name="setPrinterSelectionOption"/>
64 64 <rejection class="QWidget" function-name="create"/>
65 65 <rejection class="QWidget" function-name="find"/>
66 66 <rejection class="QWidget" function-name="handle"/>
67 67 <rejection class="QWidget" function-name="styleChange"/>
68 68 <rejection class="QWidget" function-name="internalWinId"/>
69 69 <rejection class="QActionGroup" function-name="selected"/>
70 70 <rejection class="QPaintEngine" function-name="fix_neg_rect"/>
71 71 <rejection class="QTreeModel" function-name="node"/>
72 72 <rejection class="QTreeModel" function-name="initializeNode"/>
73 73 <rejection class="QTreeModel" function-name="queryChildren"/>
74 74 <rejection class="QTextObjectInterface"/>
75 75 <rejection class="QAccessible" function-name="cast_helper"/>
76 76 <rejection class="QAccessible2"/>
77 77 <rejection class="QAccessibleInterface" function-name="backgroundColor"/>
78 78 <rejection class="QAccessibleInterface" function-name="foregroundColor"/>
79 79 <rejection class="QAccessibleInterface" function-name="textInterface"/>
80 80 <rejection class="QAccessibleInterface" function-name="valueInterface"/>
81 81 <rejection class="QAccessibleInterface" function-name="tableInterface"/>
82 82 <rejection class="QAccessibleInterface" function-name="editableTextInterface"/>
83 83 <rejection class="QAccessibleInterface" function-name="cast_helper"/>
84 84 <rejection class="QAccessibleInterfaceEx" function-name="interface_cast"/>
85 85 <rejection class="QAccessibleBridgePlugin"/>
86 86 <rejection class="QAccessibleBridgeFactoryInterface"/>
87 87 <rejection class="QTabletEvent" field-name="mExtra"/>
88 88 <rejection class="QWidgetItem" field-name="wid"/>
89 89 <rejection class="QFont" enum-name="ResolveProperties"/>
90 90 <rejection class="QGradient" enum-name="InterpolationMode"/>
91 91 <rejection class="QIconEngineV2::AvailableSizesArgument"/>
92 92 <rejection class="QIconEngineV2" enum-name="IconEngineHook"/>
93 93 <rejection class="QGradient" enum-name="InterpolationMode"/>
94 94 <rejection class="QGradient" function-name="setInterpolationMode"/>
95 95 <rejection class="QGradient" function-name="interpolationMode"/>
96 96 <rejection class="QAbstractTextDocumentLayout" function-name="handlerForObject"/>
97 97
98 98 <enum-type name="QStaticText::PerformanceHint"/>
99 99 <enum-type name="QTextBlockFormat::LineHeightTypes"/>
100 100 <enum-type name="QStyleOptionTabWidgetFrameV2::StyleOptionVersion"/>
101 101 <enum-type name="QStyleOptionTabBarBaseV2::StyleOptionVersion"/>
102 102 <enum-type name="QTabBar::SelectionBehavior"/>
103 103 <enum-type name="QTabBar::ButtonPosition"/>
104 104 <enum-type name="QInputDialog::InputMode"/>
105 105 <enum-type name="QInputDialog::InputDialogOption" flags="QInputDialog::InputDialogOptions"/>
106 106 <enum-type name="QFontDialog::FontDialogOption" flags="QFontDialog::FontDialogOptions"/>
107 107 <enum-type name="QColorDialog::ColorDialogOption" flags="QColorDialog::ColorDialogOptions"/>
108 108 <enum-type name="QAbstractItemDelegate::EndEditHint"/>
109 109 <enum-type name="QAbstractItemView::CursorAction"/>
110 110 <enum-type name="QAbstractItemView::DragDropMode"/>
111 111 <enum-type name="QAbstractItemView::DropIndicatorPosition"/>
112 112 <enum-type name="QAbstractItemView::EditTrigger" flags="QAbstractItemView::EditTriggers"/>
113 113 <enum-type name="QAbstractItemView::ScrollHint"/>
114 114 <enum-type name="QAbstractItemView::ScrollMode"/>
115 115 <enum-type name="QAbstractItemView::SelectionBehavior"/>
116 116 <enum-type name="QAbstractItemView::SelectionMode"/>
117 117 <enum-type name="QAbstractItemView::State"/>
118 118 <enum-type name="QAbstractPrintDialog::PrintDialogOption" flags="QAbstractPrintDialog::PrintDialogOptions"/>
119 119 <enum-type name="QAbstractPrintDialog::PrintRange"/>
120 120 <enum-type name="QAbstractSlider::SliderAction"/>
121 121 <enum-type name="QAbstractSlider::SliderChange"/>
122 122 <enum-type name="QAbstractSpinBox::ButtonSymbols"/>
123 123 <enum-type name="QAbstractSpinBox::CorrectionMode"/>
124 124 <enum-type name="QAbstractSpinBox::StepEnabledFlag" flags="QAbstractSpinBox::StepEnabled"/>
125 125 <enum-type name="QAccessible::Event"/>
126 126 <enum-type name="QAccessible::Method"/>
127 127 <enum-type name="QAccessible::RelationFlag" flags="QAccessible::Relation"/>
128 128 <enum-type name="QAccessible::Role"/>
129 129 <enum-type name="QAccessible::StateFlag" flags="QAccessible::State"/>
130 130 <enum-type name="QAccessible::Text"/>
131 131 <enum-type name="QDesktopServices::StandardLocation"/>
132 132 <enum-type name="QDirModel::Roles"/>
133 133 <enum-type name="QFont::Capitalization"/>
134 134 <enum-type name="QFont::SpacingType"/>
135 135 <enum-type name="QGraphicsItem::CacheMode"/>
136 136 <enum-type name="QMdiArea::AreaOption" flags="QMdiArea::AreaOptions"/>
137 137 <enum-type name="QMdiArea::WindowOrder"/>
138 138 <enum-type name="QMdiArea::ViewMode"/>
139 139 <enum-type name="QFileSystemModel::Roles"/>
140 140 <enum-type name="QFormLayout::FieldGrowthPolicy"/>
141 141 <enum-type name="QFormLayout::FormStyle"/>
142 142 <enum-type name="QFormLayout::ItemRole"/>
143 143 <enum-type name="QFormLayout::RowWrapPolicy"/>
144 144 <enum-type name="QGraphicsProxyWidget::enum_1"/>
145 145 <enum-type name="QGraphicsWidget::enum_1"/>
146 146 <enum-type name="QPlainTextEdit::LineWrapMode"/>
147 147 <enum-type name="QPrintPreviewWidget::ViewMode"/>
148 148 <enum-type name="QPrintPreviewWidget::ZoomMode"/>
149 149 <enum-type name="QStyleOptionTabV3::StyleOptionVersion"/>
150 150 <enum-type name="QStyleOptionFrameV3::StyleOptionVersion"/>
151 151 <enum-type name="QStyleOptionViewItemV4::StyleOptionVersion"/>
152 152 <enum-type name="QStyleOptionViewItemV4::ViewItemPosition"/>
153 153
154 154 <enum-type name="QMdiSubWindow::SubWindowOption" flags="QMdiSubWindow::SubWindowOptions"/>
155 155
156 156 <enum-type name="QAction::ActionEvent"/>
157 157 <enum-type name="QAction::MenuRole"/>
158 158 <enum-type name="QApplication::ColorSpec"/>
159 159 <enum-type name="QApplication::Type"/>
160 160 <enum-type name="QCalendarWidget::HorizontalHeaderFormat"/>
161 161 <enum-type name="QCalendarWidget::SelectionMode"/>
162 162 <enum-type name="QCalendarWidget::VerticalHeaderFormat"/>
163 163 <enum-type name="QColor::Spec"/>
164 164 <enum-type name="QColormap::Mode"/>
165 165 <enum-type name="QComboBox::InsertPolicy"/>
166 166 <enum-type name="QComboBox::SizeAdjustPolicy"/>
167 167 <enum-type name="QCompleter::CompletionMode"/>
168 168 <enum-type name="QCompleter::ModelSorting"/>
169 169 <enum-type name="QContextMenuEvent::Reason"/>
170 170 <enum-type name="QDataWidgetMapper::SubmitPolicy"/>
171 171 <enum-type name="QDateTimeEdit::Section" flags="QDateTimeEdit::Sections"/>
172 172 <enum-type name="QDialog::DialogCode"/>
173 173 <enum-type name="QDialogButtonBox::ButtonLayout"/>
174 174 <enum-type name="QDialogButtonBox::ButtonRole"/>
175 175 <enum-type name="QFileDialog::AcceptMode"/>
176 176 <enum-type name="QFileDialog::DialogLabel"/>
177 177 <enum-type name="QFileDialog::FileMode"/>
178 178 <enum-type name="QFileDialog::Option" flags="QFileDialog::Options"/>
179 179 <enum-type name="QFileDialog::ViewMode"/>
180 180 <enum-type name="QFileIconProvider::IconType"/>
181 181 <enum-type name="QFont::Stretch"/>
182 182 <enum-type name="QFont::Style"/>
183 183 <enum-type name="QFont::StyleStrategy"/>
184 184 <enum-type name="QFont::Weight"/>
185 185 <enum-type name="QFontComboBox::FontFilter" flags="QFontComboBox::FontFilters"/>
186 186 <enum-type name="QFrame::Shadow" extensible="yes"/>
187 187 <enum-type name="QFrame::Shape"/>
188 188 <enum-type name="QFrame::StyleMask"/>
189 189 <enum-type name="QGradient::CoordinateMode"/>
190 190 <enum-type name="QGradient::Spread" lower-bound="QGradient.PadSpread" upper-bound="QGradient.RepeatSpread"/>
191 191 <enum-type name="QGradient::Type"/>
192 192 <enum-type name="QGraphicsEllipseItem::enum_1"/>
193 193 <enum-type name="QGraphicsItem::Extension"/>
194 194 <enum-type name="QGraphicsItem::GraphicsItemChange"/>
195 195 <enum-type name="QGraphicsItem::GraphicsItemFlag" flags="QGraphicsItem::GraphicsItemFlags"/>
196 196 <enum-type name="QGraphicsItem::enum_1"/>
197 197 <enum-type name="QGraphicsItemGroup::enum_1"/>
198 198 <enum-type name="QGraphicsLineItem::enum_1"/>
199 199 <enum-type name="QGraphicsPathItem::enum_1"/>
200 200 <enum-type name="QGraphicsPixmapItem::ShapeMode"/>
201 201 <enum-type name="QGraphicsPixmapItem::enum_1"/>
202 202 <enum-type name="QGraphicsPolygonItem::enum_1"/>
203 203 <enum-type name="QGraphicsRectItem::enum_1"/>
204 204 <enum-type name="QGraphicsScene::ItemIndexMethod"/>
205 205 <enum-type name="QGraphicsSceneContextMenuEvent::Reason"/>
206 206 <enum-type name="QGraphicsSimpleTextItem::enum_1"/>
207 207 <enum-type name="QGraphicsTextItem::enum_1"/>
208 208 <enum-type name="QGraphicsView::CacheModeFlag" flags="QGraphicsView::CacheMode"/>
209 209 <enum-type name="QGraphicsView::DragMode"/>
210 210 <enum-type name="QGraphicsView::OptimizationFlag" flags="QGraphicsView::OptimizationFlags"/>
211 211 <enum-type name="QGraphicsView::ViewportAnchor"/>
212 212 <enum-type name="QGraphicsView::ViewportUpdateMode"/>
213 213 <enum-type name="QIcon::Mode"/>
214 214 <enum-type name="QIcon::State"/>
215 215 <enum-type name="QImage::Format"/>
216 216 <enum-type name="QImage::InvertMode"/>
217 217 <enum-type name="QImageIOHandler::ImageOption"/>
218 218 <enum-type name="QImageReader::ImageReaderError"/>
219 219 <enum-type name="QImageWriter::ImageWriterError"/>
220 220 <enum-type name="QInputContext::StandardFormat"/>
221 221 <enum-type name="QInputMethodEvent::AttributeType"/>
222 222 <enum-type name="QItemSelectionModel::SelectionFlag" flags="QItemSelectionModel::SelectionFlags"/>
223 223 <enum-type name="QKeySequence::SequenceFormat"/>
224 224 <enum-type name="QKeySequence::SequenceMatch"/>
225 225 <enum-type name="QKeySequence::StandardKey"/>
226 226 <enum-type name="QLCDNumber::Mode"/>
227 227 <enum-type name="QLCDNumber::SegmentStyle"/>
228 228 <enum-type name="QLayout::SizeConstraint"/>
229 229 <enum-type name="QLineEdit::EchoMode"/>
230 230 <enum-type name="QListView::Flow"/>
231 231 <enum-type name="QListView::LayoutMode"/>
232 232 <enum-type name="QListView::Movement"/>
233 233 <enum-type name="QListView::ResizeMode"/>
234 234 <enum-type name="QListView::ViewMode"/>
235 235 <enum-type name="QListWidgetItem::ItemType"/>
236 236 <enum-type name="QMainWindow::DockOption" flags="QMainWindow::DockOptions"/>
237 237 <enum-type name="QMessageBox::ButtonRole"/>
238 238 <enum-type name="QMessageBox::Icon"/>
239 239 <enum-type name="QMovie::CacheMode"/>
240 240 <enum-type name="QMovie::MovieState"/>
241 241 <enum-type name="QPaintDevice::PaintDeviceMetric"/>
242 242 <enum-type name="QPaintEngine::DirtyFlag" flags="QPaintEngine::DirtyFlags"/>
243 243 <enum-type name="QPaintEngine::PaintEngineFeature" flags="QPaintEngine::PaintEngineFeatures"/>
244 244 <enum-type name="QPaintEngine::PolygonDrawMode"/>
245 245 <enum-type name="QPaintEngine::Type"/>
246 246 <enum-type name="QPageSetupDialog::PageSetupDialogOption" flags="QPageSetupDialog::PageSetupDialogOptions"/>
247 247 <enum-type name="QPainter::CompositionMode"/>
248 248 <enum-type name="QPainter::RenderHint" flags="QPainter::RenderHints"/>
249 249 <enum-type name="QPainterPath::ElementType"/>
250 250 <enum-type name="QPrintEngine::PrintEnginePropertyKey">
251 251 <reject-enum-value name="PPK_PaperSize"/>
252 252 </enum-type>
253 253 <enum-type name="QPrinter::ColorMode"/>
254 254 <enum-type name="QPrinter::Orientation"/>
255 255 <enum-type name="QPrinter::OutputFormat"/>
256 256 <enum-type name="QPrinter::PageOrder"/>
257 257 <enum-type name="QPrinter::PaperSource"/>
258 258 <enum-type name="QPrinter::PrintRange"/>
259 259 <enum-type name="QPrinter::PrinterMode"/>
260 260 <enum-type name="QPrinter::PrinterState"/>
261 261 <enum-type name="QPrinter::Unit"/>
262 262 <enum-type name="QPrinter::DuplexMode"/>
263 263 <enum-type name="QProgressBar::Direction"/>
264 264 <enum-type name="QRegion::RegionType"/>
265 265 <enum-type name="QRubberBand::Shape"/>
266 266 <enum-type name="QSessionManager::RestartHint"/>
267 267 <enum-type name="QSizePolicy::Policy"/>
268 268 <enum-type name="QSizePolicy::PolicyFlag"/>
269 269 <enum-type name="QSizePolicy::ControlType" flags="QSizePolicy::ControlTypes"/>
270 270 <enum-type name="QStandardItem::ItemType"/>
271 271 <enum-type name="QStyle::SubControl" flags="QStyle::SubControls" extensible="yes" force-integer="yes"/>
272 272 <enum-type name="QStyle::ComplexControl" extensible="yes"/>
273 273 <enum-type name="QStyle::ContentsType" extensible="yes"/>
274 274 <enum-type name="QStyle::ControlElement" extensible="yes"/>
275 275 <enum-type name="QStyle::PixelMetric" extensible="yes">
276 276 <reject-enum-value name="PM_MDIFrameWidth"/>
277 277 <reject-enum-value name="PM_MDIMinimizedWidth"/>
278 278 </enum-type>
279 279 <enum-type name="QStyle::PrimitiveElement" extensible="yes">
280 280 <reject-enum-value name="PE_IndicatorItemViewItemCheck"/>
281 281 <reject-enum-value name="PE_FrameStatusBarItem"/>
282 282 </enum-type>
283 283 <enum-type name="QStyle::StandardPixmap" extensible="yes"/>
284 284 <enum-type name="QStyle::StateFlag" flags="QStyle::State"/>
285 285 <enum-type name="QStyle::SubElement" extensible="yes">
286 286 <reject-enum-value name="SE_ItemViewItemCheckIndicator"/>
287 287 </enum-type>
288 288 <enum-type name="QStyleHintReturn::HintReturnType"/>
289 289 <enum-type name="QStyleHintReturn::StyleOptionType"/>
290 290 <enum-type name="QStyleHintReturn::StyleOptionVersion"/>
291 291 <enum-type name="QStyleHintReturnVariant::StyleOptionType"/>
292 292 <enum-type name="QStyleHintReturnVariant::StyleOptionVersion"/>
293 293
294 294 <enum-type name="QStyleHintReturnMask::StyleOptionType"/>
295 295 <enum-type name="QStyleHintReturnMask::StyleOptionVersion"/>
296 296 <enum-type name="QStyleOption::StyleOptionType"/>
297 297 <enum-type name="QStyleOption::OptionType" extensible="yes"/>
298 298 <enum-type name="QStyleOption::StyleOptionVersion"/>
299 299 <enum-type name="QStyleOptionButton::ButtonFeature" flags="QStyleOptionButton::ButtonFeatures"/>
300 300 <enum-type name="QStyleOptionButton::StyleOptionType"/>
301 301 <enum-type name="QStyleOptionButton::StyleOptionVersion"/>
302 302 <enum-type name="QStyleOptionComboBox::StyleOptionType"/>
303 303 <enum-type name="QStyleOptionComboBox::StyleOptionVersion"/>
304 304 <enum-type name="QStyleOptionComplex::StyleOptionType"/>
305 305 <enum-type name="QStyleOptionComplex::StyleOptionVersion"/>
306 306 <enum-type name="QStyleOptionDockWidget::StyleOptionType"/>
307 307 <enum-type name="QStyleOptionDockWidget::StyleOptionVersion"/>
308 308 <enum-type name="QStyleOptionDockWidgetV2::StyleOptionVersion"/>
309 309 <enum-type name="QStyleOptionFocusRect::StyleOptionType"/>
310 310 <enum-type name="QStyleOptionFocusRect::StyleOptionVersion"/>
311 311 <enum-type name="QStyleOptionFrame::StyleOptionType"/>
312 312 <enum-type name="QStyleOptionFrame::StyleOptionVersion"/>
313 313 <enum-type name="QStyleOptionFrameV2::FrameFeature" flags="QStyleOptionFrameV2::FrameFeatures"/>
314 314 <enum-type name="QStyleOptionFrameV2::StyleOptionVersion"/>
315 315 <enum-type name="QStyleOptionGraphicsItem::StyleOptionType"/>
316 316 <enum-type name="QStyleOptionGraphicsItem::StyleOptionVersion"/>
317 317 <enum-type name="QStyleOptionGroupBox::StyleOptionType"/>
318 318 <enum-type name="QStyleOptionGroupBox::StyleOptionVersion"/>
319 319 <enum-type name="QStyleOptionHeader::SectionPosition"/>
320 320 <enum-type name="QStyleOptionHeader::SelectedPosition"/>
321 321 <enum-type name="QStyleOptionHeader::SortIndicator"/>
322 322 <enum-type name="QStyleOptionHeader::StyleOptionType"/>
323 323 <enum-type name="QStyleOptionHeader::StyleOptionVersion"/>
324 324 <enum-type name="QStyleOptionMenuItem::CheckType"/>
325 325 <enum-type name="QStyleOptionMenuItem::MenuItemType"/>
326 326 <enum-type name="QStyleOptionMenuItem::StyleOptionType"/>
327 327 <enum-type name="QStyleOptionMenuItem::StyleOptionVersion"/>
328 328 <enum-type name="QStyleOptionProgressBar::StyleOptionType"/>
329 329 <enum-type name="QStyleOptionProgressBar::StyleOptionVersion"/>
330 330 <enum-type name="QStyleOptionProgressBarV2::StyleOptionType"/>
331 331 <enum-type name="QStyleOptionProgressBarV2::StyleOptionVersion"/>
332 332 <enum-type name="QStyleOptionRubberBand::StyleOptionType"/>
333 333 <enum-type name="QStyleOptionRubberBand::StyleOptionVersion"/>
334 334 <enum-type name="QStyleOptionSizeGrip::StyleOptionType"/>
335 335 <enum-type name="QStyleOptionSizeGrip::StyleOptionVersion"/>
336 336 <enum-type name="QStyleOptionSlider::StyleOptionType"/>
337 337 <enum-type name="QStyleOptionSlider::StyleOptionVersion"/>
338 338 <enum-type name="QStyleOptionSpinBox::StyleOptionType"/>
339 339 <enum-type name="QStyleOptionSpinBox::StyleOptionVersion"/>
340 340 <enum-type name="QStyleOptionTab::CornerWidget" flags="QStyleOptionTab::CornerWidgets"/>
341 341 <enum-type name="QStyleOptionTab::SelectedPosition"/>
342 342 <enum-type name="QStyleOptionTab::StyleOptionType"/>
343 343 <enum-type name="QStyleOptionTab::StyleOptionVersion"/>
344 344 <enum-type name="QStyleOptionTab::TabPosition"/>
345 345 <enum-type name="QStyleOptionTabBarBase::StyleOptionType"/>
346 346 <enum-type name="QStyleOptionTabBarBase::StyleOptionVersion"/>
347 347 <enum-type name="QStyleOptionTabV2::StyleOptionVersion"/>
348 348 <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionType"/>
349 349 <enum-type name="QStyleOptionTabWidgetFrame::StyleOptionVersion"/>
350 350 <enum-type name="QStyleOptionTitleBar::StyleOptionType"/>
351 351 <enum-type name="QStyleOptionTitleBar::StyleOptionVersion"/>
352 352 <enum-type name="QStyleOptionToolBar::StyleOptionType"/>
353 353 <enum-type name="QStyleOptionToolBar::StyleOptionVersion"/>
354 354 <enum-type name="QStyleOptionToolBar::ToolBarFeature" flags="QStyleOptionToolBar::ToolBarFeatures"/>
355 355 <enum-type name="QStyleOptionToolBar::ToolBarPosition"/>
356 356 <enum-type name="QStyleOptionToolBox::StyleOptionType"/>
357 357 <enum-type name="QStyleOptionToolBox::StyleOptionVersion"/>
358 358 <enum-type name="QStyleOptionToolButton::StyleOptionType"/>
359 359 <enum-type name="QStyleOptionToolButton::StyleOptionVersion"/>
360 360 <enum-type name="QStyleOptionToolButton::ToolButtonFeature" flags="QStyleOptionToolButton::ToolButtonFeatures">
361 361 <reject-enum-value name="MenuButtonPopup"/>
362 362 </enum-type>
363 363 <enum-type name="QStyleOptionViewItem::Position"/>
364 364 <enum-type name="QStyleOptionViewItem::StyleOptionType"/>
365 365 <enum-type name="QStyleOptionViewItem::StyleOptionVersion"/>
366 366 <enum-type name="QStyleOptionViewItemV2::StyleOptionVersion"/>
367 367 <enum-type name="QStyleOptionViewItemV2::ViewItemFeature" flags="QStyleOptionViewItemV2::ViewItemFeatures"/>
368 368 <enum-type name="QSystemTrayIcon::ActivationReason"/>
369 369 <enum-type name="QSystemTrayIcon::MessageIcon"/>
370 370 <enum-type name="QTabBar::Shape"/>
371 371 <enum-type name="QTabWidget::TabPosition"/>
372 372 <enum-type name="QTabWidget::TabShape"/>
373 373 <enum-type name="QTableWidgetItem::ItemType"/>
374 374 <enum-type name="QTabletEvent::PointerType"/>
375 375 <enum-type name="QTabletEvent::TabletDevice"/>
376 376 <enum-type name="QTextCharFormat::UnderlineStyle"/>
377 377 <enum-type name="QTextCharFormat::VerticalAlignment"/>
378 378 <enum-type name="QTextCursor::MoveMode"/>
379 379 <enum-type name="QTextCursor::MoveOperation"/>
380 380 <enum-type name="QTextCursor::SelectionType"/>
381 381 <enum-type name="QTextDocument::FindFlag" flags="QTextDocument::FindFlags"/>
382 382 <enum-type name="QTextDocument::MetaInformation"/>
383 383 <enum-type name="QTextDocument::ResourceType"/>
384 384 <enum-type name="QTextEdit::AutoFormattingFlag" flags="QTextEdit::AutoFormatting"/>
385 385 <enum-type name="QTextEdit::LineWrapMode"/>
386 386 <enum-type name="QTextFormat::ObjectTypes"/>
387 387 <enum-type name="QTextFormat::PageBreakFlag" flags="QTextFormat::PageBreakFlags"/>
388 388 <enum-type name="QTextFrameFormat::Position"/>
389 389 <enum-type name="QTextFrameFormat::BorderStyle"/>
390 390 <enum-type name="QTextItem::RenderFlag" flags="QTextItem::RenderFlags"/>
391 391 <enum-type name="QTextLayout::CursorMode"/>
392 392 <enum-type name="QTextLength::Type"/>
393 393 <enum-type name="QTextLine::CursorPosition"/>
394 394 <enum-type name="QTextLine::Edge"/>
395 395 <enum-type name="QTextListFormat::Style"/>
396 396 <enum-type name="QTextOption::Flag" flags="QTextOption::Flags"/>
397 397 <enum-type name="QTextOption::WrapMode"/>
398 398 <enum-type name="QTextOption::TabType"/>
399 399 <enum-type name="QToolButton::ToolButtonPopupMode"/>
400 400 <enum-type name="QTreeWidgetItem::ItemType"/>
401 401 <enum-type name="QTreeWidgetItemIterator::IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
402 402 <enum-type name="QValidator::State"/>
403 403 <enum-type name="QWidget::RenderFlag" flags="QWidget::RenderFlags"/>
404 404 <enum-type name="QWorkspace::WindowOrder"/>
405 405 <enum-type name="QDoubleValidator::Notation"/>
406 406 <enum-type name="QGraphicsScene::SceneLayer" flags="QGraphicsScene::SceneLayers"/>
407 407 <enum-type name="QStyleOptionToolBoxV2::SelectedPosition"/>
408 408 <enum-type name="QStyleOptionToolBoxV2::StyleOptionVersion"/>
409 409 <enum-type name="QStyleOptionToolBoxV2::TabPosition"/>
410 410 <enum-type name="QStyleOptionViewItemV3::StyleOptionVersion"/>
411 411 <enum-type name="QTransform::TransformationType"/>
412 412 <enum-type name="QTreeWidgetItem::ChildIndicatorPolicy"/>
413 413 <enum-type name="QWizard::WizardOption" flags="QWizard::WizardOptions"/>
414 414 <enum-type name="QWizard::WizardPixmap"/>
415 415 <enum-type name="QWizard::WizardStyle"/>
416 416 <enum-type name="QImageIOPlugin::Capability" flags="QImageIOPlugin::Capabilities"/>
417 417 <enum-type name="QStackedLayout::StackingMode"/>
418 418
419 419 <enum-type name="QWizard::WizardButton">
420 420 <reject-enum-value name="NStandardButtons"/>
421 421 <reject-enum-value name="NButtons"/>
422 422 </enum-type>
423 423
424 424 <enum-type name="QAccessible::Action">
425 425 <reject-enum-value name="FirstStandardAction"/>
426 426 <reject-enum-value name="LastStandardAction"/>
427 427 </enum-type>
428 428
429 429 <enum-type name="QBoxLayout::Direction">
430 430 <reject-enum-value name="Down"/>
431 431 <reject-enum-value name="Up"/>
432 432 </enum-type>
433 433
434 434
435 435 <enum-type name="QClipboard::Mode">
436 436 <reject-enum-value name="LastMode"/>
437 437 </enum-type>
438 438
439 439 <enum-type name="QDialogButtonBox::StandardButton" flags="QDialogButtonBox::StandardButtons">
440 440 <reject-enum-value name="FirstButton"/>
441 441 <reject-enum-value name="LastButton"/>
442 442 <reject-enum-value name="YesAll"/>
443 443 <reject-enum-value name="NoAll"/>
444 444 <reject-enum-value name="Default"/>
445 445 <reject-enum-value name="Escape"/>
446 446 <reject-enum-value name="FlagMask"/>
447 447 <reject-enum-value name="ButtonMask"/>
448 448 </enum-type>
449 449
450 450 <enum-type name="QDockWidget::DockWidgetFeature" flags="QDockWidget::DockWidgetFeatures"/>
451 451
452 452 <enum-type name="QFont::StyleHint">
453 453 <reject-enum-value name="SansSerif"/>
454 454 <reject-enum-value name="Serif"/>
455 455 <reject-enum-value name="TypeWriter"/>
456 456 <reject-enum-value name="Decorative"/>
457 457 </enum-type>
458 458
459 459 <enum-type name="QFontDatabase::WritingSystem">
460 460 <reject-enum-value name="Other"/>
461 461 </enum-type>
462 462
463 463 <enum-type name="QHeaderView::ResizeMode">
464 464 <reject-enum-value name="Custom"/>
465 465 </enum-type>
466 466
467 467
468 468 <enum-type name="QMessageBox::StandardButton" flags="QMessageBox::StandardButtons">
469 469 <reject-enum-value name="FirstButton"/>
470 470 <reject-enum-value name="LastButton"/>
471 471 <reject-enum-value name="YesAll"/>
472 472 <reject-enum-value name="NoAll"/>
473 473 </enum-type>
474 474
475 475 <enum-type name="QPalette::ColorGroup">
476 476 <reject-enum-value name="Normal"/>
477 477 </enum-type>
478 478
479 479 <enum-type name="QPalette::ColorRole">
480 480 <reject-enum-value name="NColorRoles"/>
481 481 <reject-enum-value name="Foreground"/>
482 482 <reject-enum-value name="Background"/>
483 483 </enum-type>
484 484
485 485 <enum-type name="QPrinter::PageSize">
486 486 <reject-enum-value name="NPageSize"/>
487 487 <reject-enum-value name="NPaperSize"/>
488 488 </enum-type>
489 489
490 490 <enum-type name="QSlider::TickPosition">
491 491 <reject-enum-value name="TicksLeft"/>
492 492 <reject-enum-value name="TicksRight"/>
493 493 </enum-type>
494 494
495 495 <enum-type name="QStyle::StyleHint" extensible="yes">
496 496 <reject-enum-value name="SH_ScrollBar_StopMouseOverSlider"/>
497 497 </enum-type>
498 498
499 499
500 500 <enum-type name="QTextFormat::FormatType"/>
501 501
502 502 <enum-type name="QTextFormat::Property">
503 503 <reject-enum-value name="FontSizeIncrement"/>
504 504 <reject-enum-value name="FirstFontProperty"/>
505 505 <reject-enum-value name="LastFontProperty"/>
506 506 </enum-type>
507 507
508 508 <enum-type name="QAction::Priority"/>
509 509 <enum-type name="QAction::SoftKeyRole"/>
510 510 <enum-type name="QGraphicsEffect::ChangeFlag" flags="QGraphicsEffect::ChangeFlags"/>
511 511 <enum-type name="QGraphicsItem::PanelModality"/>
512 512 <enum-type name="QPinchGesture::WhatChange" flags="QPinchGesture::WhatChanged"/>
513 513 <enum-type name="QPinchGesture::ChangeFlag" flags="QPinchGesture::ChangeFlags"/>
514 514 <enum-type name="QGraphicsBlurEffect::BlurHint" flags="QGraphicsBlurEffect::BlurHints"/>
515 515 <enum-type name="QGraphicsEffect::PixmapPadMode"/>
516 516 <enum-type name="QGestureRecognizer::ResultFlag" flags="QGestureRecognizer::Result"/>
517 517 <enum-type name="QGestureRecognizer::LineHeightTypes"/>
518 518 <enum-type name="QStyle::RequestSoftwareInputPanel"/>
519 519 <enum-type name="QSwipeGesture::SwipeDirection"/>
520 520 <enum-type name="QTouchEvent::DeviceType"/>
521 521 <enum-type name="QFont::HintingPreference"/>
522 522 <enum-type name="QGesture::GestureCancelPolicy"/>
523 523 <enum-type name="QTextDocument::Stacks"/>
524 524 <enum-type name="QPainter::PixmapFragmentHint"/>
525 525
526 526 <object-type name="QAbstractProxyModel"/>
527 527 <object-type name="QDirModel"/>
528 528 <object-type name="QFileSystemModel"/>
529 529 <object-type name="QPrinterInfo"/>
530 530 <object-type name="QSortFilterProxyModel"/>
531 531 <object-type name="QProxyModel"/>
532 532 <object-type name="QTextOption"/>
533 533 <object-type name="QFontDatabase"/>
534 534 <object-type name="QGestureRecognizer" force-abstract="yes"/>
535 535
536 536 <value-type name="QPixmapCache::Key"/>
537 537 <value-type name="QTileRules"/>
538 538 <value-type name="QVector2D"/>
539 539 <value-type name="QVector3D"/>
540 540 <value-type name="QVector4D"/>
541 541 <value-type name="QTouchEvent::TouchPoint"/>
542 542
543 543
544 544 <value-type name="QTransform">
545 545 <modify-function signature="operator=(QTransform)" remove="all"/>
546 546 <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
547 547 <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
548 548
549 549 <modify-function signature="operator*=(double)" access="private"/>
550 550 <modify-function signature="operator+=(double)" access="private"/>
551 551 <modify-function signature="operator-=(double)" access="private"/>
552 552 <modify-function signature="operator/=(double)" access="private"/>
553 553 <modify-function signature="operator*(QTransform)const" rename="multiplied"/>
554 554 <modify-function signature="operator*=(QTransform)" access="private"/>
555 555
556 556 <modify-function signature="inverted(bool*)const">
557 557 <modify-argument index="1">
558 558 <remove-argument/>
559 559 </modify-argument>
560 560 </modify-function>
561 561 </value-type>
562 562
563 563 <value-type name="QStyleOption" delete-in-main-thread="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type == QStyleOption::SO_Default">
564 564 <modify-function signature="operator=(QStyleOption)" remove="all"/>
565 565 <modify-function signature="init(const QWidget*)" remove="all"/> <!--### Obsolete in 4.3-->
566 566 </value-type>
567 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 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 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 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 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 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 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 574 <modify-function signature="operator=(QStyleOptionDockWidget)" remove="all"/>
575 575 </value-type>
576 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 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 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 580 <modify-function signature="operator=(QStyleOptionFrame)" remove="all"/>
581 581 </value-type>
582 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 583 <modify-function signature="operator=(QStyleOptionFrame)" remove="all"/>
584 584 </value-type>
585 585
586 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 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 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 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 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 592 <modify-function signature="operator=(QStyleOptionProgressBar)" remove="all"/>
593 593 </value-type>
594 594
595 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 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 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 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 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 600 <modify-function signature="operator=(const QStyleOptionTab &amp;)" remove="all"/>
601 601 </value-type>
602 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 603 <modify-function signature="operator=(QStyleOptionTab)" remove="all"/>
604 604 </value-type>
605 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 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 607 <modify-function signature="operator=(QStyleOptionTabBarBase)" remove="all"/>
608 608 </value-type>
609 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 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 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 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 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 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 615 <modify-function signature="operator=(QStyleOptionToolBox)" remove="all"/>
616 616 </value-type>
617 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 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 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 620 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
621 621 </value-type>
622 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 623 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
624 624 </value-type>
625 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 626 <modify-function signature="operator=(QStyleOptionViewItem)" remove="all"/>
627 627 </value-type>
628 628 <value-type name="QTextFragment" delete-in-main-thread="yes">
629 629 <modify-function signature="operator=(QTextFragment)" remove="all"/>
630 630 </value-type>
631 631 <value-type name="QBitmap" delete-in-main-thread="yes">
632 632 <modify-function signature="operator=(const QPixmap &amp;)" remove="all"/>
633 633 <modify-function signature="QBitmap(QString,const char*)" access="private">
634 634 <modify-argument index="2"> <remove-default-expression/> </modify-argument>
635 635 </modify-function>
636 636
637 637 <modify-function signature="fromData(QSize,const unsigned char*,QImage::Format)">
638 638 <access modifier="private"/>
639 639 <modify-argument index="3">
640 640 <remove-default-expression/>
641 641 </modify-argument>
642 642 </modify-function>
643 643
644 644 <modify-function signature="fromData(QSize,const uchar*,QImage::Format)" remove="all"/>
645 645
646 646 <modify-function signature="QBitmap(QString,const char*)">
647 647 <modify-argument index="2">
648 648 <replace-type modified-type="QString"/>
649 649 <conversion-rule class="native">
650 650 <insert-template name="core.convert_string_arg_to_char*"/>
651 651 </conversion-rule>
652 652 </modify-argument>
653 653 </modify-function>
654 654 </value-type>
655 655 <value-type name="QTextInlineObject" delete-in-main-thread="yes"/>
656 656 <value-type name="QSizePolicy"/>
657 657 <value-type name="QTableWidgetSelectionRange"/>
658 658 <value-type name="QTextDocumentFragment" delete-in-main-thread="yes">
659 659 <modify-function signature="operator=(QTextDocumentFragment)" remove="all"/>
660 660 </value-type>
661 661 <value-type name="QTextOption" delete-in-main-thread="yes">
662 662 <modify-function signature="operator=(const QTextOption &amp;)" remove="all"/>
663 663 </value-type>
664 664 <value-type name="QTextLine" delete-in-main-thread="yes">
665 665 <modify-function signature="cursorToX(int*,QTextLine::Edge)const">
666 666 <remove/>
667 667 </modify-function>
668 668 </value-type>
669 669 <value-type name="QTextTableFormat" delete-in-main-thread="yes"/>
670 670 <value-type name="QTextImageFormat" delete-in-main-thread="yes"/>
671 671 <value-type name="QTextFrameFormat" delete-in-main-thread="yes">
672 672 <modify-function signature="isValid()const" access="non-final"/>
673 673 </value-type>
674 674 <value-type name="QTextLength" delete-in-main-thread="yes"/>
675 675 <value-type name="QItemSelectionRange">
676 676 <modify-function signature="intersect(QItemSelectionRange)const" remove="all"/> <!--### Obsolete in 4.3-->
677 677 </value-type>
678 678
679 679 <value-type name="QPainterPath">
680 680 <modify-function signature="operator=(QPainterPath)" remove="all"/>
681 681 </value-type>
682 682 <value-type name="QPalette">
683 683 <modify-function signature="operator=(const QPalette&amp;)" remove="all"/>
684 684
685 685 <modify-function signature="QPalette(QColor, QColor, QColor, QColor, QColor, QColor, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
686 686 <modify-function signature="background()const" remove="all"/> <!--### Obsolete in 4.3-->
687 687 <modify-function signature="foreground()const" remove="all"/> <!--### Obsolete in 4.3-->
688 688 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
689 689 </value-type>
690 690 <value-type name="QKeySequence">
691 691 <modify-function signature="operator=(QKeySequence)" remove="all"/>
692 692 <modify-function signature="operator int()const" access="private"/>
693 693 <modify-function signature="operator[](uint)const" access="private"/>
694 694 </value-type>
695 695
696 696 <value-type name="QPicture" delete-in-main-thread="yes">
697 697 <modify-function signature="operator=(QPicture)" remove="all"/>
698 698 <modify-function signature="pictureFormat(QString)">
699 699 <remove/>
700 700 </modify-function>
701 701
702 702 <modify-function signature="inputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
703 703 <modify-function signature="inputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
704 704 <modify-function signature="outputFormatList()" remove="all"/> <!--### Obsolete in 4.3-->
705 705 <modify-function signature="outputFormats()" remove="all"/> <!--### Obsolete in 4.3-->
706 706
707 707 <modify-function signature="setData(const char*,uint)" remove="all"/>
708 708
709 709 <modify-function signature="load(QIODevice*,const char*)">
710 710 <modify-argument index="2">
711 711 <replace-type modified-type="QString"/>
712 712 <conversion-rule class="native">
713 713 <insert-template name="core.convert_string_arg_to_char*"/>
714 714 </conversion-rule>
715 715 </modify-argument>
716 716 </modify-function>
717 717
718 718 <modify-function signature="load(QString,const char*)">
719 719 <modify-argument index="2">
720 720 <replace-type modified-type="QString"/>
721 721 <conversion-rule class="native">
722 722 <insert-template name="core.convert_string_arg_to_char*"/>
723 723 </conversion-rule>
724 724 </modify-argument>
725 725 </modify-function>
726 726
727 727 <modify-function signature="save(QIODevice*,const char*)">
728 728 <modify-argument index="2">
729 729 <replace-type modified-type="QString"/>
730 730 <conversion-rule class="native">
731 731 <insert-template name="core.convert_string_arg_to_char*"/>
732 732 </conversion-rule>
733 733 </modify-argument>
734 734 </modify-function>
735 735
736 736 <modify-function signature="save(QString,const char*)">
737 737 <modify-argument index="2">
738 738 <replace-type modified-type="QString"/>
739 739 <conversion-rule class="native">
740 740 <insert-template name="core.convert_string_arg_to_char*"/>
741 741 </conversion-rule>
742 742 </modify-argument>
743 743 </modify-function>
744 744 </value-type>
745 745
746 746 <value-type name="QRegion" expense-limit="4096">
747 747 <modify-function signature="operator=(QRegion)" remove="all"/>
748 748 <modify-function signature="operator&amp;=(QRegion)" remove="all"/>
749 749 <modify-function signature="operator+=(QRegion)" remove="all"/>
750 750 <modify-function signature="operator-=(QRegion)" remove="all"/>
751 751 <modify-function signature="operator^=(QRegion)" remove="all"/>
752 752 <modify-function signature="operator|=(QRegion)" remove="all"/>
753 753 <modify-function signature="operator&amp;(QRegion)const" remove="all"/>
754 754 <modify-function signature="operator+(QRegion)const" remove="all"/>
755 755 <modify-function signature="operator-(QRegion)const" remove="all"/>
756 756 <modify-function signature="operator^(QRegion)const" remove="all"/>
757 757 <modify-function signature="operator|(QRegion)const" remove="all"/>
758 758 <modify-function signature="eor(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
759 759 <modify-function signature="intersect(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
760 760 <modify-function signature="subtract(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
761 761 <modify-function signature="unite(QRegion)const" remove="all"/> <!--### Obsolete in 4.3-->
762 762 <modify-function signature="operator&amp;=(QRect)" remove="all"/>
763 763 <modify-function signature="operator+=(QRect)" remove="all"/>
764 764
765 765 </value-type>
766 766
767 767 <value-type name="QTextBlock" delete-in-main-thread="yes">
768 768 <modify-function signature="operator=(QTextBlock)" remove="all"/>
769 769 <modify-function signature="setUserData(QTextBlockUserData *)">
770 770 <modify-argument index="1">
771 771 <define-ownership class="java" owner="c++"/>
772 772 </modify-argument>
773 773 </modify-function>
774 774 </value-type>
775 775 <value-type name="QTextBlockFormat" delete-in-main-thread="yes"/>
776 776 <value-type name="QTextTableCellFormat" delete-in-main-thread="yes"/>
777 777 <value-type name="QTextCharFormat" delete-in-main-thread="yes">
778 778 <modify-function signature="isValid()const" access="non-final"/>
779 779
780 780 <modify-function signature="anchorName()const" remove="all"/> <!--### Obsolete in 4.3-->
781 781 <modify-function signature="setAnchorName(QString)" remove="all"/> <!--### Obsolete in 4.3-->
782 782 </value-type>
783 783 <value-type name="QTextFormat" delete-in-main-thread="yes">
784 784 <modify-function signature="operator=(QTextFormat)" remove="all"/>
785 785 <modify-function signature="isValid()const" access="non-final"/>
786 786
787 787
788 788 <modify-function signature="setProperty(int,QVector&lt;QTextLength&gt;)" rename="setLengthVectorProperty"/>
789 789 <inject-code class="native" position="constructor">
790 790 if ((context-&gt;argumentCount() == 1) &amp;&amp; (qMetaTypeId&lt;QTextFormat&gt;() == context-&gt;argument(0).toVariant().userType())) {
791 791 QTextFormat _q_arg0 = qscriptvalue_cast&lt;QTextFormat&gt;(context-&gt;argument(0));
792 792 QTextFormat _q_cpp_result(_q_arg0);
793 793 QScriptValue _q_result = context-&gt;engine()-&gt;newVariant(context-&gt;thisObject(), qVariantFromValue(_q_cpp_result));
794 794 return _q_result;
795 795 }
796 796 </inject-code>
797 797 </value-type>
798 798
799 799 <value-type name="QTextListFormat" delete-in-main-thread="yes"/>
800 800 <value-type name="QPolygon">
801 801 <modify-function signature="QPolygon(int, const int *)" remove="all"/>
802 802 <modify-function signature="operator+(QVector&lt;QPoint&gt;)const" remove="all"/>
803 803 <modify-function signature="operator&lt;&lt;(QPoint)" remove="all"/>
804 804 <modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)" remove="all"/>
805 805
806 806
807 807 </value-type>
808 808
809 809 <value-type name="QPolygonF">
810 810 <modify-function signature="operator+(QVector&lt;QPointF&gt;)const" remove="all"/>
811 811 <modify-function signature="operator&lt;&lt;(QPointF)" remove="all"/>
812 812 <modify-function signature="operator&lt;&lt;(QVector&lt;QPointF&gt;)" remove="all"/>
813 813 </value-type>
814 814
815 815 <value-type name="QIcon" delete-in-main-thread="yes">
816 816 <modify-function signature="operator=(QIcon)" remove="all"/>
817 817 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
818 818 <modify-function signature="QIcon(QIconEngineV2 *)">
819 819 <modify-argument index="1">
820 820 <define-ownership class="java" owner="c++"/>
821 821 </modify-argument>
822 822 </modify-function>
823 823 <modify-function signature="QIcon(QIconEngine *)">
824 824 <modify-argument index="1">
825 825 <define-ownership class="java" owner="c++"/>
826 826 </modify-argument>
827 827 </modify-function>
828 828 </value-type>
829 829
830 830 <value-type name="QTextFrame::iterator" delete-in-main-thread="yes">
831 831 <include file-name="QTextFrame" location="global"/>
832 832 <modify-function signature="operator++(int)" remove="all"/>
833 833 <modify-function signature="operator--(int)" remove="all"/>
834 834 <modify-function signature="operator=(QTextFrame::iterator)" remove="all"/>
835 835 <modify-function signature="operator++()" access="private"/>
836 836 <modify-function signature="operator--()" access="private"/>
837 837 </value-type>
838 838
839 839 <value-type name="QTreeWidgetItemIterator" delete-in-main-thread="yes">
840 840 <custom-constructor>
841 841 return new QTreeWidgetItemIterator(*copy);
842 842 </custom-constructor>
843 843 <custom-destructor>
844 844 delete copy;
845 845 </custom-destructor>
846 846 <modify-function signature="operator=(QTreeWidgetItemIterator)" remove="all"/>
847 847 <modify-function signature="operator++(int)" remove="all"/>
848 848 <modify-function signature="operator--(int)" remove="all"/>
849 849 <modify-function signature="operator+=(int)" access="private"/>
850 850 <modify-function signature="operator-=(int)" access="private"/>
851 851 <modify-function signature="operator++()" access="private"/>
852 852 <modify-function signature="operator--()" access="private"/>
853 853 <modify-function signature="operator*()const" access="private"/>
854 854 </value-type>
855 855
856 856 <value-type name="QTextBlock::iterator" delete-in-main-thread="yes">
857 857 <include file-name="QTextBlock" location="global"/>
858 858
859 859 <modify-function signature="operator++()" access="private"/>
860 860 <modify-function signature="operator--()" access="private"/>
861 861 <modify-function signature="operator++(int)" remove="all"/>
862 862 <modify-function signature="operator--(int)" remove="all"/>
863 863 </value-type>
864 864
865 865 <value-type name="QAbstractTextDocumentLayout::PaintContext" delete-in-main-thread="yes">
866 866 <include file-name="QAbstractTextDocumentLayout" location="global"/>
867 867 </value-type>
868 868 <value-type name="QAbstractTextDocumentLayout::Selection" delete-in-main-thread="yes"/>
869 869
870 870 <value-type name="QPixmap" delete-in-main-thread="yes">
871 871 <modify-function signature="operator=(QPixmap)" remove="all"/>
872 872 <modify-function signature="operator!()const" remove="all"/>
873 873 <modify-function signature="QPixmap(const char **)" remove="all"/>
874 874 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
875 875
876 876 <modify-function signature="loadFromData(const uchar *,uint,const char *,QFlags&lt;Qt::ImageConversionFlag&gt;)" remove="all"/>
877 877
878 878 <modify-function signature="QPixmap(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
879 879 <modify-argument index="2">
880 880 <replace-type modified-type="QString"/>
881 881 <conversion-rule class="native">
882 882 <insert-template name="core.convert_string_arg_to_char*"/>
883 883 </conversion-rule>
884 884 </modify-argument>
885 885 </modify-function>
886 886
887 887 <modify-function signature="load(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
888 888 <modify-argument index="2">
889 889 <replace-type modified-type="QString"/>
890 890 <conversion-rule class="native">
891 891 <insert-template name="core.convert_string_arg_to_char*"/>
892 892 </conversion-rule>
893 893 </modify-argument>
894 894 </modify-function>
895 895
896 896 <modify-function signature="loadFromData(QByteArray,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
897 897 <modify-argument index="2">
898 898 <replace-type modified-type="QString"/>
899 899 <conversion-rule class="native">
900 900 <insert-template name="core.convert_string_arg_to_char*"/>
901 901 </conversion-rule>
902 902 </modify-argument>
903 903 </modify-function>
904 904
905 905 <modify-function signature="save(QIODevice*,const char*,int)const">
906 906 <modify-argument index="2">
907 907 <replace-type modified-type="QString"/>
908 908 <conversion-rule class="native">
909 909 <insert-template name="core.convert_string_arg_to_char*"/>
910 910 </conversion-rule>
911 911 </modify-argument>
912 912 </modify-function>
913 913
914 914 <modify-function signature="save(QString,const char*,int)const">
915 915 <modify-argument index="2">
916 916 <replace-type modified-type="QString"/>
917 917 <conversion-rule class="native">
918 918 <insert-template name="core.convert_string_arg_to_char*"/>
919 919 </conversion-rule>
920 920 </modify-argument>
921 921 </modify-function>
922 922 </value-type>
923 923
924 924 <value-type name="QTextCursor" delete-in-main-thread="yes">
925 925 <extra-includes>
926 926 <include file-name="QTextBlock" location="global"/>
927 927 <include file-name="QTextDocumentFragment" location="global"/>
928 928 </extra-includes>
929 929 <modify-function signature="operator=(QTextCursor)" remove="all"/>
930 930 <modify-function signature="selectedTableCells(int*,int*,int*,int*)const">
931 931 <access modifier="private"/>
932 932 </modify-function>
933 933 </value-type>
934 934
935 935 <value-type name="QTextLayout::FormatRange">
936 936 <include file-name="QTextLayout" location="global"/>
937 937 </value-type>
938 938
939 939 <value-type name="QInputMethodEvent::Attribute">
940 940 <include file-name="QInputMethodEvent" location="global"/>
941 941 <custom-constructor>
942 942 return new QInputMethodEvent::Attribute(copy-&gt;type, copy-&gt;start, copy-&gt;length, copy-&gt;value);
943 943 </custom-constructor>
944 944 <custom-destructor>
945 945 delete copy;
946 946 </custom-destructor>
947 947 </value-type>
948 948
949 949 <value-type name="QItemSelection" delete-in-main-thread="yes">
950 950
951 951 <modify-function signature="operator+(const QList&lt;QItemSelectionRange&gt;&amp;)const" remove="all"/>
952 952 <modify-function signature="operator+=(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
953 953 <modify-function signature="operator+=(const QItemSelectionRange&amp;)" remove="all"/>
954 954 <modify-function signature="operator&lt;&lt;(const QList&lt;QItemSelectionRange&gt;&amp;)" remove="all"/>
955 955 <modify-function signature="operator&lt;&lt;(QItemSelectionRange)" remove="all"/>
956 956 </value-type>
957 957
958 958 <value-type name="QMatrix4x4">
959 959 <modify-function signature="data()const" remove="all"/>
960 960 <modify-function signature="operator()(int, int)const" remove="all"/>
961 961 </value-type>
962 962 <value-type name="QMatrix">
963 963 <extra-includes>
964 964 <include file-name="QPainterPath" location="global"/>
965 965 </extra-includes>
966 966
967 967 <modify-function signature="map(int,int,int*,int*)const" remove="all"/>
968 968 <modify-function signature="map(double,double,double*,double*)const" remove="all"/>
969 969 <modify-function signature="operator=(QMatrix)" remove="all"/>
970 970
971 971 <modify-function signature="operator*(QMatrix)const" access="private"/>
972 972 <modify-function signature="operator*=(QMatrix)" access="private"/>
973 973 <modify-function signature="rotate(double)" access="private" rename="rotate_private"/>
974 974 <modify-function signature="scale(double,double)" access="private" rename="scale_private"/>
975 975 <modify-function signature="shear(double,double)" access="private" rename="shear_private"/>
976 976 <modify-function signature="translate(double,double)" access="private" rename="translate_private"/>
977 977
978 978 <modify-function signature="inverted(bool*)const">
979 979 <access modifier="private"/>
980 980 <modify-argument index="1">
981 981 <remove-default-expression/>
982 982 </modify-argument>
983 983 </modify-function>
984 984
985 985 <inject-code>
986 986 <insert-template name="core.unary_other_type">
987 987 <replace from="%FUNCTION_NAME" to="rotate"/>
988 988 <replace from="%OUT_TYPE" to="QMatrix"/>
989 989 <replace from="%IN_TYPE" to="double"/>
990 990 </insert-template>
991 991
992 992 <insert-template name="core.private_function_return_self">
993 993 <replace from="%RETURN_TYPE" to="QMatrix"/>
994 994 <replace from="%FUNCTION_NAME" to="scale"/>
995 995 <replace from="%ARGUMENTS" to="double sx, double sy"/>
996 996 <replace from="%ARGUMENT_NAMES" to="sx, sy"/>
997 997 </insert-template>
998 998
999 999 <insert-template name="core.private_function_return_self">
1000 1000 <replace from="%RETURN_TYPE" to="QMatrix"/>
1001 1001 <replace from="%FUNCTION_NAME" to="shear"/>
1002 1002 <replace from="%ARGUMENTS" to="double sh, double sv"/>
1003 1003 <replace from="%ARGUMENT_NAMES" to="sh, sv"/>
1004 1004 </insert-template>
1005 1005
1006 1006 <insert-template name="core.private_function_return_self">
1007 1007 <replace from="%RETURN_TYPE" to="QMatrix"/>
1008 1008 <replace from="%FUNCTION_NAME" to="translate"/>
1009 1009 <replace from="%ARGUMENTS" to="double dx, double dy"/>
1010 1010 <replace from="%ARGUMENT_NAMES" to="dx, dy"/>
1011 1011 </insert-template>
1012 1012 </inject-code>
1013 1013
1014 1014 <modify-function signature="inverted(bool*)const">
1015 1015 <modify-argument index="1">
1016 1016 <remove-argument/>
1017 1017 </modify-argument>
1018 1018 </modify-function>
1019 1019 </value-type>
1020 1020
1021 1021 <value-type name="QConicalGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::ConicalGradient">
1022 1022 <custom-constructor>
1023 1023 return new QConicalGradient(copy-&gt;center(), copy-&gt;angle());
1024 1024 </custom-constructor>
1025 1025 <custom-destructor>
1026 1026 delete copy;
1027 1027 </custom-destructor>
1028 1028 </value-type>
1029 1029
1030 1030 <value-type name="QFontInfo" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1031 1031 <custom-constructor>
1032 1032 return new QFontInfo(*copy);
1033 1033 </custom-constructor>
1034 1034 <custom-destructor>
1035 1035 delete copy;
1036 1036 </custom-destructor>
1037 1037 <modify-function signature="operator=(QFontInfo)" remove="all"/>
1038 1038
1039 1039
1040 1040 <modify-function signature="QFontInfo(QFontInfo)">
1041 1041 <modify-argument index="1">
1042 1042 <replace-type modified-type="QFontInfo*"/>
1043 1043 <conversion-rule class="native">
1044 1044 QFontInfo &amp; %out% = *qscriptvalue_cast&lt;QFontInfo*&gt;(%in%);
1045 1045 </conversion-rule>
1046 1046 </modify-argument>
1047 1047 </modify-function>
1048 1048 </value-type>
1049 1049
1050 1050 <value-type name="QRadialGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::RadialGradient">
1051 1051 <custom-constructor>
1052 1052 return new QRadialGradient(copy-&gt;center(), copy-&gt;radius(), copy-&gt;focalPoint());
1053 1053 </custom-constructor>
1054 1054 <custom-destructor>
1055 1055 delete copy;
1056 1056 </custom-destructor>
1057 1057 </value-type>
1058 1058
1059 1059 <value-type name="QPainterPath::Element">
1060 1060 <modify-field name="x" write="false"/>
1061 1061 <modify-field name="y" write="false"/>
1062 1062 <modify-field name="type" write="false"/>
1063 1063 <include file-name="QPainterPath" location="global"/>
1064 1064 <modify-function signature="operator QPointF()const" access="private"/>
1065 1065 </value-type>
1066 1066
1067 1067 <value-type name="QTextEdit::ExtraSelection" delete-in-main-thread="yes">
1068 1068 <include file-name="QTextEdit" location="global"/>
1069 1069 </value-type>
1070 1070
1071 1071 <value-type name="QFont" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1072 1072 <extra-includes>
1073 1073 <include file-name="QStringList" location="global"/>
1074 1074 </extra-includes>
1075 1075 <modify-function signature="operator=(QFont)" remove="all"/>
1076 1076 </value-type>
1077 1077
1078 1078 <value-type name="QTextTableCell" delete-in-main-thread="yes">
1079 1079 <extra-includes>
1080 1080 <include file-name="QTextCursor" location="global"/>
1081 1081 </extra-includes>
1082 1082 <modify-function signature="operator=(QTextTableCell)" remove="all"/>
1083 1083 </value-type>
1084 1084
1085 1085 <value-type name="QImage" expense-limit="67108864" expense-cost="height()*bytesPerLine()">
1086 1086 <modify-function signature="QImage(const char *, const char *)">
1087 1087 <remove/>
1088 1088 </modify-function>
1089 1089 <modify-function signature="QImage(const char **)">
1090 1090 <access modifier="private"/>
1091 1091 </modify-function>
1092 1092 <modify-function signature="QImage(const unsigned char*,int,int,int,QImage::Format)">
1093 1093 <remove/>
1094 1094 </modify-function>
1095 1095 <modify-function signature="bits()const">
1096 1096 <remove/>
1097 1097 </modify-function>
1098 1098 <modify-function signature="scanLine(int)const">
1099 1099 <remove/>
1100 1100 </modify-function>
1101 1101 <modify-function signature="constBits()const">
1102 1102 <remove/>
1103 1103 </modify-function>
1104 1104 <modify-function signature="constScanLine(int)const">
1105 1105 <remove/>
1106 1106 </modify-function>
1107 1107 <modify-function signature="QImage(const unsigned char *, int, int, QImage::Format)">
1108 1108 <remove/>
1109 1109 </modify-function>
1110 1110
1111 1111 <extra-includes>
1112 1112 <include file-name="QStringList" location="global"/>
1113 1113 <include file-name="QMatrix" location="global"/>
1114 1114 </extra-includes>
1115 1115 <modify-function signature="save(const QString &amp;, const char *, int) const">
1116 1116 <access modifier="private"/>
1117 1117 <rename to="private_save"/>
1118 1118 <modify-argument index="2">
1119 1119 <remove-default-expression/>
1120 1120 </modify-argument>
1121 1121 <modify-argument index="3">
1122 1122 <remove-default-expression/>
1123 1123 </modify-argument>
1124 1124 </modify-function>
1125 1125
1126 1126 <modify-function signature="QImage(unsigned char*,int,int,QImage::Format)">
1127 1127 <access modifier="private"/>
1128 1128 </modify-function>
1129 1129
1130 1130 <modify-function signature="QImage(QString,const char*)">
1131 1131 <access modifier="private"/>
1132 1132 <modify-argument index="2">
1133 1133 <remove-default-expression/>
1134 1134 </modify-argument>
1135 1135 </modify-function>
1136 1136
1137 1137 <modify-function signature="load(QString,const char*)">
1138 1138 <access modifier="private"/>
1139 1139 <modify-argument index="2">
1140 1140 <remove-default-expression/>
1141 1141 </modify-argument>
1142 1142 </modify-function>
1143 1143
1144 1144 <modify-function signature="load(QIODevice*,const char*)">
1145 1145 <access modifier="private"/>
1146 1146 </modify-function>
1147 1147
1148 1148 <modify-function signature="loadFromData(const unsigned char*,int,const char*)">
1149 1149 <access modifier="private"/>
1150 1150 <modify-argument index="2">
1151 1151 <remove-default-expression/>
1152 1152 </modify-argument>
1153 1153 <modify-argument index="3">
1154 1154 <remove-default-expression/>
1155 1155 </modify-argument>
1156 1156 </modify-function>
1157 1157
1158 1158 <modify-function signature="loadFromData(QByteArray,const char*)">
1159 1159 <access modifier="private"/>
1160 1160 <modify-argument index="2">
1161 1161 <remove-default-expression/>
1162 1162 </modify-argument>
1163 1163 </modify-function>
1164 1164
1165 1165 <modify-function signature="operator=(QImage)" remove="all"/>
1166 1166
1167 1167 <modify-function signature="setText(const char*,const char*,QString)">
1168 1168 <remove/>
1169 1169 </modify-function>
1170 1170
1171 1171 <modify-function signature="text(const char*,const char*)const">
1172 1172 <remove/>
1173 1173 </modify-function>
1174 1174
1175 1175 <modify-function signature="fromData(QByteArray,const char*)">
1176 1176 <access modifier="private"/>
1177 1177 <modify-argument index="2">
1178 1178 <remove-default-expression/>
1179 1179 </modify-argument>
1180 1180 </modify-function>
1181 1181
1182 1182 <modify-function signature="fromData(const unsigned char*,int,const char*)">
1183 1183 <remove/>
1184 1184 </modify-function>
1185 1185
1186 1186 <modify-function signature="serialNumber()const" remove="all"/> <!--### Obsolete in 4.3-->
1187 1187 <modify-function signature="textLanguages()const" remove="all"/> <!--### Obsolete in 4.3-->
1188 1188
1189 1189 <modify-function signature="QImage(const char**)" remove="all"/>
1190 1190 <modify-function signature="QImage(const uchar *,int,int,QImage::Format)" remove="all"/>
1191 1191 <modify-function signature="QImage(const uchar *,int,int,int,QImage::Format)" remove="all"/>
1192 1192 <modify-function signature="QImage(uchar *,int,int,QImage::Format)" remove="all"/>
1193 1193 <modify-function signature="QImage(uchar *,int,int,int,QImage::Format)" remove="all"/>
1194 1194 <modify-function signature="setColorTable(const QVector&lt;uint&gt;)" remove="all"/>
1195 1195 <modify-function signature="loadFromData(const uchar *,int,const char *)" remove="all"/>
1196 1196 <modify-function signature="fromData(const uchar *,int,const char *)" remove="all"/>
1197 1197 <modify-function signature="bits()" remove="all"/>
1198 1198 <modify-function signature="scanLine(int)" remove="all"/>
1199 1199
1200 1200 <modify-function signature="QImage(QString,const char*)">
1201 1201 <modify-argument index="2">
1202 1202 <replace-type modified-type="QString"/>
1203 1203 <conversion-rule class="native">
1204 1204 <insert-template name="core.convert_string_arg_to_char*"/>
1205 1205 </conversion-rule>
1206 1206 </modify-argument>
1207 1207 </modify-function>
1208 1208
1209 1209 <modify-function signature="fromData(QByteArray,const char*)">
1210 1210 <modify-argument index="2">
1211 1211 <replace-type modified-type="QString"/>
1212 1212 <conversion-rule class="native">
1213 1213 <insert-template name="core.convert_string_arg_to_char*"/>
1214 1214 </conversion-rule>
1215 1215 </modify-argument>
1216 1216 </modify-function>
1217 1217
1218 1218 <modify-function signature="load(QString,const char*)">
1219 1219 <modify-argument index="2">
1220 1220 <replace-type modified-type="QString"/>
1221 1221 <conversion-rule class="native">
1222 1222 <insert-template name="core.convert_string_arg_to_char*"/>
1223 1223 </conversion-rule>
1224 1224 </modify-argument>
1225 1225 </modify-function>
1226 1226
1227 1227 <modify-function signature="load(QIODevice*,const char*)">
1228 1228 <modify-argument index="2">
1229 1229 <replace-type modified-type="QString"/>
1230 1230 <conversion-rule class="native">
1231 1231 <insert-template name="core.convert_string_arg_to_char*"/>
1232 1232 </conversion-rule>
1233 1233 </modify-argument>
1234 1234 </modify-function>
1235 1235
1236 1236 <modify-function signature="loadFromData(QByteArray,const char*)">
1237 1237 <modify-argument index="2">
1238 1238 <replace-type modified-type="QString"/>
1239 1239 <conversion-rule class="native">
1240 1240 <insert-template name="core.convert_string_arg_to_char*"/>
1241 1241 </conversion-rule>
1242 1242 </modify-argument>
1243 1243 </modify-function>
1244 1244
1245 1245 <modify-function signature="save(QString,const char*,int)const">
1246 1246 <modify-argument index="2">
1247 1247 <replace-type modified-type="QString"/>
1248 1248 <conversion-rule class="native">
1249 1249 <insert-template name="core.convert_string_arg_to_char*"/>
1250 1250 </conversion-rule>
1251 1251 </modify-argument>
1252 1252 </modify-function>
1253 1253
1254 1254 <modify-function signature="save(QIODevice*,const char*,int)const">
1255 1255 <modify-argument index="2">
1256 1256 <replace-type modified-type="QString"/>
1257 1257 <conversion-rule class="native">
1258 1258 <insert-template name="core.convert_string_arg_to_char*"/>
1259 1259 </conversion-rule>
1260 1260 </modify-argument>
1261 1261 </modify-function>
1262 1262 <inject-code class="pywrap-h">
1263 1263 QImage* new_QImage( const uchar * data, int width, int height, QImage::Format format )
1264 1264 {
1265 1265 QImage* image = new QImage(width, height, format);
1266 1266 memcpy(image-&gt;bits(), data, image-&gt;byteCount());
1267 1267 return image;
1268 1268 }
1269 1269
1270 1270 PyObject* bits(QImage* image) {
1271 1271 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;bits(), image-&gt;bytesPerLine()* image-&gt;height());
1272 1272 }
1273 1273
1274 1274 #if QT_VERSION &gt;= QT_VERSION_CHECK(4,7,0)
1275 1275 PyObject* constBits(QImage* image) {
1276 1276 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;constBits(), image-&gt;byteCount());
1277 1277 }
1278 1278 #endif
1279 1279
1280 1280 PyObject* scanLine(QImage* image, int line) {
1281 1281 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;scanLine(line), image-&gt;bytesPerLine());
1282 1282 }
1283 1283
1284 1284 #if QT_VERSION &gt;= QT_VERSION_CHECK(4,7,0)
1285 1285 PyObject* constScanLine(QImage* image, int line) {
1286 1286 return PythonQtPrivate::wrapMemoryAsBuffer(image-&gt;constScanLine(line), image-&gt;bytesPerLine());
1287 1287 }
1288 1288 #endif
1289 1289
1290 1290 </inject-code>
1291 1291 </value-type>
1292 1292
1293 1293 <value-type name="QColormap" delete-in-main-thread="yes">
1294 1294 <modify-function signature="operator=(QColormap)" remove="all"/>
1295 1295 <extra-includes>
1296 1296 <include file-name="QColor" location="global"/>
1297 1297 </extra-includes>
1298 1298 <custom-constructor>
1299 1299 return new QColormap(*copy);
1300 1300 </custom-constructor>
1301 1301 <custom-destructor>
1302 1302 delete copy;
1303 1303 </custom-destructor>
1304 1304 </value-type>
1305 1305
1306 1306 <value-type name="QCursor" delete-in-main-thread="yes">
1307 1307 <extra-includes>
1308 1308 <include file-name="QPixmap" location="global"/>
1309 1309 </extra-includes>
1310 1310 <modify-function signature="operator=(QCursor)" remove="all"/>
1311 1311 </value-type>
1312 1312
1313 1313 <value-type name="QFontDatabase" delete-in-main-thread="yes">
1314 1314 <extra-includes>
1315 1315 <include file-name="QStringList" location="global"/>
1316 1316 </extra-includes>
1317 1317 </value-type>
1318 1318
1319 1319 <value-type name="QPen">
1320 1320 <extra-includes>
1321 1321 <include file-name="QBrush" location="global"/>
1322 1322 </extra-includes>
1323 1323
1324 1324 <modify-function signature="operator=(QPen)" remove="all"/>
1325 1325 </value-type>
1326 1326
1327 1327 <value-type name="QBrush">
1328 1328 <modify-function signature="QBrush(Qt::GlobalColor, Qt::BrushStyle)" remove="all"/>
1329 1329 <modify-function signature="operator=(const QBrush &amp;)" remove="all"/>
1330 1330
1331 1331 <extra-includes>
1332 1332 <include file-name="QPixmap" location="global"/>
1333 1333 </extra-includes>
1334 1334
1335 1335 <modify-function signature="QBrush(QGradient)">
1336 1336 <modify-argument index="1">
1337 1337 <replace-type modified-type="QGradient*"/>
1338 1338 <conversion-rule class="native">
1339 1339 QGradient &amp; %out% = *qscriptvalue_cast&lt;QGradient*&gt;(%in%);
1340 1340 </conversion-rule>
1341 1341 </modify-argument>
1342 1342 </modify-function>
1343 1343 </value-type>
1344 1344
1345 1345 <value-type name="QColor">
1346 1346 <modify-function signature="QColor(QColor::Spec)" remove="all"/>
1347 1347 <modify-function signature="operator=(QColor)" remove="all"/>
1348 1348 <modify-function signature="operator=(Qt::GlobalColor)" remove="all"/>
1349 1349
1350 1350 <modify-function signature="QColor(const char*)">
1351 1351 <remove/>
1352 1352 </modify-function>
1353 1353
1354 1354 <modify-function signature="getCmyk(int*,int*,int*,int*,int*)">
1355 1355 <remove/>
1356 1356 </modify-function>
1357 1357
1358 1358 <modify-function signature="getCmykF(double*,double*,double*,double*,double*)">
1359 1359 <remove/>
1360 1360 </modify-function>
1361 1361
1362 1362 <modify-function signature="getHsv(int*,int*,int*,int*)const">
1363 1363 <remove/>
1364 1364 </modify-function>
1365 1365
1366 1366 <modify-function signature="getHsvF(double*,double*,double*,double*)const">
1367 1367 <remove/>
1368 1368 </modify-function>
1369 1369
1370 1370 <modify-function signature="getRgb(int*,int*,int*,int*)const">
1371 1371 <remove/>
1372 1372 </modify-function>
1373 1373
1374 1374 <modify-function signature="getRgbF(double*,double*,double*,double*)const">
1375 1375 <remove/>
1376 1376 </modify-function>
1377 1377
1378 1378 <modify-function signature="dark(int)const" remove="all"/> <!--### Obsolete in 4.3-->
1379 1379 <modify-function signature="light(int)const" remove="all"/> <!--### Obsolete in 4.3-->
1380 1380 </value-type>
1381 1381
1382 1382 <value-type name="QFontMetricsF" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1383 1383 <custom-constructor>
1384 1384 return new QFontMetricsF(*copy);
1385 1385 </custom-constructor>
1386 1386 <custom-destructor>
1387 1387 delete copy;
1388 1388 </custom-destructor>
1389 1389 <modify-function signature="operator!=(const QFontMetricsF &amp;)">
1390 1390 <remove/>
1391 1391 </modify-function>
1392 1392 <modify-function signature="operator==(const QFontMetricsF &amp;)">
1393 1393 <remove/>
1394 1394 </modify-function>
1395 1395
1396 1396 <modify-function signature="boundingRect(QRectF,int,QString,int,int*)const">
1397 1397 <access modifier="private"/>
1398 1398 <modify-argument index="4">
1399 1399 <remove-default-expression/>
1400 1400 </modify-argument>
1401 1401 <modify-argument index="5">
1402 1402 <remove-default-expression/>
1403 1403 </modify-argument>
1404 1404 </modify-function>
1405 1405
1406 1406 <modify-function signature="operator=(QFontMetrics)" remove="all"/>
1407 1407 <modify-function signature="operator=(QFontMetricsF)" remove="all"/>
1408 1408
1409 1409 <modify-function signature="size(int,QString,int,int*)const">
1410 1410 <access modifier="private"/>
1411 1411 <modify-argument index="3">
1412 1412 <remove-default-expression/>
1413 1413 </modify-argument>
1414 1414 <modify-argument index="4">
1415 1415 <remove-default-expression/>
1416 1416 </modify-argument>
1417 1417 </modify-function>
1418 1418
1419 1419 <modify-function signature="QFontMetricsF(QFontMetricsF)" remove="all"/>
1420 1420 <modify-function signature="QFontMetricsF(QFontMetrics)" remove="all"/>
1421 1421 <modify-function signature="operator==(QFontMetricsF)const" remove="all"/>
1422 1422 <modify-function signature="operator!=(QFontMetricsF)const" remove="all"/>
1423 1423 </value-type>
1424 1424 <value-type name="QTextOption::Tab"/>
1425 1425
1426 1426 <value-type name="QFontMetrics" delete-in-main-thread="yes" expense-cost="1" expense-limit="1000">
1427 1427 <custom-constructor>
1428 1428 return new QFontMetrics(*copy);
1429 1429 </custom-constructor>
1430 1430 <custom-destructor>
1431 1431 delete copy;
1432 1432 </custom-destructor>
1433 1433 <modify-function signature="operator!=(const QFontMetrics &amp;)">
1434 1434 <remove/>
1435 1435 </modify-function>
1436 1436 <modify-function signature="operator==(const QFontMetrics &amp;)">
1437 1437 <remove/>
1438 1438 </modify-function>
1439 1439
1440 1440 <modify-function signature="boundingRect(int,int,int,int,int,QString,int,int*)const">
1441 1441 <access modifier="private"/>
1442 1442 <modify-argument index="7">
1443 1443 <remove-default-expression/>
1444 1444 </modify-argument>
1445 1445 <modify-argument index="8">
1446 1446 <remove-default-expression/>
1447 1447 </modify-argument>
1448 1448 </modify-function>
1449 1449
1450 1450 <modify-function signature="boundingRect(QRect,int,QString,int,int*)const">
1451 1451 <access modifier="private"/>
1452 1452 <modify-argument index="4">
1453 1453 <remove-default-expression/>
1454 1454 </modify-argument>
1455 1455 <modify-argument index="5">
1456 1456 <remove-default-expression/>
1457 1457 </modify-argument>
1458 1458 </modify-function>
1459 1459
1460 1460 <modify-function signature="operator=(QFontMetrics)" remove="all"/>
1461 1461
1462 1462 <modify-function signature="size(int,QString,int,int*)const">
1463 1463 <access modifier="private"/>
1464 1464 <modify-argument index="3">
1465 1465 <remove-default-expression/>
1466 1466 </modify-argument>
1467 1467 <modify-argument index="4">
1468 1468 <remove-default-expression/>
1469 1469 </modify-argument>
1470 1470 </modify-function>
1471 1471
1472 1472
1473 1473 <modify-function signature="QFontMetrics(QFontMetrics)" remove="all"/>
1474 1474 <modify-function signature="operator==(QFontMetrics)const" remove="all"/>
1475 1475 <modify-function signature="operator!=(QFontMetrics)const" remove="all"/>
1476 1476 </value-type>
1477 1477
1478 1478 <value-type name="QGradient" force-abstract="yes" polymorphic-base="yes" polymorphic-id-expression="%1-&gt;type() == QGradient::NoGradient">
1479 1479 <custom-constructor>
1480 1480 Q_UNUSED(copy)
1481 1481 qWarning("Copying empty QGradient object");
1482 1482 return new QGradient();
1483 1483 </custom-constructor>
1484 1484 <custom-destructor>
1485 1485 delete copy;
1486 1486 </custom-destructor>
1487 1487 <modify-function signature="operator==(const QGradient &amp;)">
1488 1488 <remove/>
1489 1489 </modify-function>
1490 1490 </value-type>
1491 1491
1492 1492 <value-type name="QLinearGradient" polymorphic-id-expression="%1-&gt;type() == QGradient::LinearGradient">
1493 1493 <custom-constructor>
1494 1494 QLinearGradient *lg = new QLinearGradient(copy-&gt;start(), copy-&gt;finalStop());
1495 1495 lg-&gt;setSpread(copy-&gt;spread());
1496 1496 lg-&gt;setStops(copy-&gt;stops());
1497 1497 return (void *) lg;
1498 1498 </custom-constructor>
1499 1499 <custom-destructor>
1500 1500 delete copy;
1501 1501 </custom-destructor>
1502 1502 </value-type>
1503 1503
1504 1504 <value-type name="QPrinterInfo">
1505 1505 <modify-function signature="operator=(const QPrinterInfo &amp;)" remove="all"/>
1506 1506 </value-type>
1507 1507
1508 1508 <value-type name="QMargins"/>
1509 1509
1510 1510 <interface-type name="QLayoutItem"/>
1511 1511 <interface-type name="QPaintDevice"/>
1512 1512
1513 1513 <interface-type name="QGraphicsItem" delete-in-main-thread="yes" polymorphic-base="yes">
1514 1514 <modify-function signature="setCursorForItemOnly(QCursor)" remove="all"/>
1515 1515
1516 1516 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/>
1517 1517 <modify-function signature="toGraphicsObject() const" remove="all"/>
1518 1518
1519 1519 <modify-function signature="paint(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
1520 1520 <modify-argument index="1" invalidate-after-use="yes"/>
1521 1521 </modify-function>
1522 1522 <modify-function signature="collidesWithItem(const QGraphicsItem*,Qt::ItemSelectionMode)const">
1523 1523 <modify-argument index="1" invalidate-after-use="yes"/>
1524 1524 </modify-function>
1525 1525
1526 1526 <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
1527 1527 <modify-argument index="1" invalidate-after-use="yes"/>
1528 1528 </modify-function>
1529 1529 <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
1530 1530 <modify-argument index="1" invalidate-after-use="yes"/>
1531 1531 </modify-function>
1532 1532 <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
1533 1533 <modify-argument index="1" invalidate-after-use="yes"/>
1534 1534 </modify-function>
1535 1535 <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
1536 1536 <modify-argument index="1" invalidate-after-use="yes"/>
1537 1537 </modify-function>
1538 1538 <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
1539 1539 <modify-argument index="1" invalidate-after-use="yes"/>
1540 1540 </modify-function>
1541 1541 <modify-function signature="focusInEvent(QFocusEvent*)">
1542 1542 <modify-argument index="1" invalidate-after-use="yes"/>
1543 1543 </modify-function>
1544 1544 <modify-function signature="focusOutEvent(QFocusEvent*)">
1545 1545 <modify-argument index="1" invalidate-after-use="yes"/>
1546 1546 </modify-function>
1547 1547 <modify-function signature="hoverEnterEvent(QGraphicsSceneHoverEvent*)">
1548 1548 <modify-argument index="1" invalidate-after-use="yes"/>
1549 1549 </modify-function>
1550 1550 <modify-function signature="hoverLeaveEvent(QGraphicsSceneHoverEvent*)">
1551 1551 <modify-argument index="1" invalidate-after-use="yes"/>
1552 1552 </modify-function>
1553 1553 <modify-function signature="hoverMoveEvent(QGraphicsSceneHoverEvent*)">
1554 1554 <modify-argument index="1" invalidate-after-use="yes"/>
1555 1555 </modify-function>
1556 1556 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
1557 1557 <modify-argument index="1" invalidate-after-use="yes"/>
1558 1558 </modify-function>
1559 1559 <modify-function signature="isObscuredBy(const QGraphicsItem*)const">
1560 1560 <modify-argument index="1" invalidate-after-use="yes"/>
1561 1561 </modify-function>
1562 1562 <modify-function signature="keyPressEvent(QKeyEvent*)">
1563 1563 <modify-argument index="1" invalidate-after-use="yes"/>
1564 1564 </modify-function>
1565 1565 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
1566 1566 <modify-argument index="1" invalidate-after-use="yes"/>
1567 1567 </modify-function>
1568 1568 <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
1569 1569 <modify-argument index="1" invalidate-after-use="yes"/>
1570 1570 </modify-function>
1571 1571 <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
1572 1572 <modify-argument index="1" invalidate-after-use="yes"/>
1573 1573 </modify-function>
1574 1574 <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
1575 1575 <modify-argument index="1" invalidate-after-use="yes"/>
1576 1576 </modify-function>
1577 1577 <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
1578 1578 <modify-argument index="1" invalidate-after-use="yes"/>
1579 1579 </modify-function>
1580 1580 <modify-function signature="sceneEvent(QEvent*)">
1581 1581 <modify-argument index="1" invalidate-after-use="yes"/>
1582 1582 </modify-function>
1583 1583 <modify-function signature="sceneEventFilter(QGraphicsItem*,QEvent*)">
1584 1584 <modify-argument index="1" invalidate-after-use="yes"/>
1585 1585 <modify-argument index="2" invalidate-after-use="yes"/>
1586 1586 </modify-function>
1587 1587 <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
1588 1588 <modify-argument index="1" invalidate-after-use="yes"/>
1589 1589 </modify-function>
1590 1590
1591 1591 <modify-function signature="children()const" remove="all"/>
1592 1592 <modify-function signature="installSceneEventFilter(QGraphicsItem *)">
1593 1593 <modify-argument index="1">
1594 1594 <!-- Safe to ignore because items in a scene are memory managed by the scene -->
1595 1595 <reference-count action="ignore"/>
1596 1596 </modify-argument>
1597 1597 </modify-function>
1598 1598 <modify-function signature="removeSceneEventFilter(QGraphicsItem *)">
1599 1599 <modify-argument index="1">
1600 1600 <!-- Safe to ignore because items in a scene are memory managed by the scene -->
1601 1601 <reference-count action="ignore"/>
1602 1602 </modify-argument>
1603 1603 </modify-function>
1604 1604
1605 1605 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1606 1606 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1607 1607 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1608 1608 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1609 1609
1610 1610 <modify-function signature="supportsExtension(QGraphicsItem::Extension)const" remove="all"/>
1611 1611 <modify-function signature="setExtension(QGraphicsItem::Extension,QVariant)" remove="all"/>
1612 1612 </interface-type>
1613 1613
1614 1614 <object-type name="QAbstractGraphicsShapeItem" delete-in-main-thread="yes">
1615 1615 <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
1616 1616 <inject-code position="end">
1617 1617 <argument-map index="1" meta-name="%1"/>
1618 1618 if (%1 != null) disableGarbageCollection();
1619 1619 </inject-code>
1620 1620 </modify-function>
1621 1621
1622 1622 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1623 1623 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1624 1624 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1625 1625 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1626 1626 </object-type>
1627 1627
1628 1628 <object-type name="QAbstractItemView">
1629 1629 <modify-function signature="update()" remove="all"/>
1630 1630 <modify-function signature="horizontalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
1631 1631 <modify-function signature="setHorizontalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
1632 1632 <modify-function signature="setVerticalStepsPerItem(int)" remove="all"/> <!--### Obsolete in 4.3-->
1633 1633 <modify-function signature="verticalStepsPerItem()const" remove="all"/> <!--### Obsolete in 4.3-->
1634 1634
1635 1635 <modify-function signature="edit(QModelIndex,QAbstractItemView::EditTrigger,QEvent*)">
1636 1636 <modify-argument index="3" invalidate-after-use="yes"/>
1637 1637 </modify-function>
1638 1638 <modify-function signature="selectionCommand(QModelIndex,const QEvent*)const">
1639 1639 <modify-argument index="2" invalidate-after-use="yes"/>
1640 1640 </modify-function>
1641 1641
1642 1642
1643 1643 <!-- ### because the CursorAction enum is protected -->
1644 1644 <modify-function signature="moveCursor(QAbstractItemView::CursorAction,QFlags&lt;Qt::KeyboardModifier&gt;)" remove="all"/>
1645 1645 <inject-code class="shell-declaration">
1646 1646 QModelIndex moveCursor(QAbstractItemView::CursorAction, Qt::KeyboardModifiers)
1647 1647 { return QModelIndex(); }
1648 1648 </inject-code>
1649 1649 </object-type>
1650 1650
1651 1651 <object-type name="QAbstractPageSetupDialog"/>
1652 1652 <object-type name="QAbstractPrintDialog"/>
1653 1653 <object-type name="QAbstractSlider">
1654 1654 <modify-function signature="sliderChange(QAbstractSlider::SliderChange)" remove="all"/>
1655 1655 </object-type>
1656 1656 <object-type name="QAbstractTextDocumentLayout">
1657 1657 <modify-function signature="setPaintDevice(QPaintDevice*)">
1658 1658 <modify-argument index="1">
1659 1659 <reference-count action="set" variable-name="__rcPaintDevice"/>
1660 1660 </modify-argument>
1661 1661 </modify-function>
1662 1662
1663 1663 <modify-function signature="draw(QPainter*,QAbstractTextDocumentLayout::PaintContext)">
1664 1664 <modify-argument index="1" invalidate-after-use="yes"/>
1665 1665 </modify-function>
1666 1666 <modify-function signature="drawInlineObject(QPainter*,QRectF,QTextInlineObject,int,QTextFormat)">
1667 1667 <modify-argument index="1" invalidate-after-use="yes"/>
1668 1668 </modify-function>
1669 1669
1670 1670 </object-type>
1671 1671 <object-type name="QAccessible">
1672 1672 <modify-function signature="initialize()" remove="all"/>
1673 1673 <modify-function signature="cleanup()" remove="all"/>
1674 1674 <modify-function signature="setRootObject(QObject *)">
1675 1675 <modify-argument index="1">
1676 1676 <reference-count action="ignore"/>
1677 1677 </modify-argument>
1678 1678 </modify-function>
1679 1679 <modify-function signature="queryAccessibleInterface(QObject *)">
1680 1680 <modify-argument index="return">
1681 1681 <define-ownership class="java" owner="java"/>
1682 1682 </modify-argument>
1683 1683 </modify-function>
1684 1684 </object-type>
1685 1685 <object-type name="QAccessibleBridge">
1686 1686 <modify-function signature="setRootObject(QAccessibleInterface *)">
1687 1687 <modify-argument index="1">
1688 1688 <define-ownership class="shell" owner="java"/>
1689 1689 </modify-argument>
1690 1690 </modify-function>
1691 1691 <modify-function signature="notifyAccessibilityUpdate(int,QAccessibleInterface*,int)">
1692 1692 <modify-argument invalidate-after-use="yes" index="2"/>
1693 1693 </modify-function>
1694 1694 </object-type>
1695 1695 <object-type name="QAccessible2Interface"/>
1696 1696 <object-type name="QAccessibleTableInterface">
1697 1697 <modify-function signature="qAccessibleTableCastHelper()" remove="all"/>
1698 1698 </object-type>
1699 1699
1700 1700 <object-type name="QAccessibleInterface">
1701 1701 <modify-function signature="indexOfChild(const QAccessibleInterface*)const">
1702 1702 <modify-argument invalidate-after-use="yes" index="1"/>
1703 1703 </modify-function>
1704 1704 <modify-function signature="relationTo(int,const QAccessibleInterface*,int)const">
1705 1705 <modify-argument invalidate-after-use="yes" index="2"/>
1706 1706 </modify-function>
1707 1707 </object-type>
1708 1708 <object-type name="QAccessibleInterfaceEx"/>
1709 1709 <object-type name="QAccessibleObject"/>
1710 1710 <object-type name="QAccessibleObjectEx"/>
1711 1711 <object-type name="QAccessibleWidget"/>
1712 1712 <object-type name="QAccessibleWidgetEx"/>
1713 1713 <object-type name="QActionGroup"/>
1714 1714 <object-type name="QCDEStyle">
1715 1715 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1716 1716 </object-type>
1717 1717 <object-type name="QCheckBox">
1718 1718 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
1719 1719 <access modifier="private"/>
1720 1720 </modify-function>
1721 1721 </object-type>
1722 1722 <object-type name="QCleanlooksStyle">
1723 1723 <modify-function signature="standardPixmap(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
1724 1724 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1725 1725 </object-type>
1726 1726 <object-type name="QCommonStyle">
1727 1727 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*,const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
1728 1728 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
1729 1729 </object-type>
1730 1730 <object-type name="QDataWidgetMapper">
1731 1731 <modify-function signature="addMapping(QWidget*,int)">
1732 1732 <modify-argument index="1">
1733 1733 <reference-count action="add" variable-name="__rcMappings"/>
1734 1734 </modify-argument>
1735 1735 </modify-function>
1736 1736 <modify-function signature="addMapping(QWidget*,int,QByteArray)">
1737 1737 <modify-argument index="1">
1738 1738 <reference-count action="add" variable-name="__rcMappings"/>
1739 1739 </modify-argument>
1740 1740 </modify-function>
1741 1741 <modify-function signature="removeMapping(QWidget*)">
1742 1742 <modify-argument index="1">
1743 1743 <reference-count action="remove" variable-name="__rcMappings"/>
1744 1744 </modify-argument>
1745 1745 </modify-function>
1746 1746 <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
1747 1747 <modify-argument index="1">
1748 1748 <reference-count action="set" variable-name="__rcItemDelegate"/>
1749 1749 </modify-argument>
1750 1750 </modify-function>
1751 1751 <modify-function signature="setModel(QAbstractItemModel*)">
1752 1752 <modify-argument index="1">
1753 1753 <reference-count action="set" variable-name="__rcModel"/>
1754 1754 </modify-argument>
1755 1755 </modify-function>
1756 1756 </object-type>
1757 1757 <object-type name="QDateEdit"/>
1758 1758 <object-type name="QDesktopServices">
1759 1759 <modify-function signature="setUrlHandler(const QString &amp;, QObject *, const char *)" access="private">
1760 1760 <modify-argument index="2">
1761 1761 <reference-count action="ignore"/> <!-- Handled in injected code -->
1762 1762 </modify-argument>
1763 1763 </modify-function>
1764 1764 </object-type>
1765 1765 <object-type name="QDialog">
1766 1766 <modify-function signature="setExtension(QWidget*)" remove="all"/>
1767 1767 <modify-function signature="exec()" access="non-final"/>
1768 1768 <modify-function signature="extension()const" remove="all"/> <!--### Obsolete in 4.3-->
1769 1769 <modify-function signature="orientation()const" remove="all"/> <!--### Obsolete in 4.3-->
1770 1770 <modify-function signature="open()" virtual-slot="yes"/>
1771 1771 <modify-function signature="setOrientation(Qt::Orientation)" remove="all"/> <!--### Obsolete in 4.3-->
1772 1772 <modify-function signature="showExtension(bool)" remove="all"/> <!--### Obsolete in 4.3-->
1773 1773 <modify-function signature="setVisible(bool)" allow-as-slot="yes"/>
1774 1774 </object-type>
1775 1775 <object-type name="QDialogButtonBox">
1776 1776 <modify-function signature="addButton(QAbstractButton*,QDialogButtonBox::ButtonRole)">
1777 1777 <modify-argument index="1">
1778 1778 <reference-count action="ignore"/>
1779 1779 </modify-argument>
1780 1780 </modify-function>
1781 1781 <modify-function signature="removeButton(QAbstractButton*)">
1782 1782 <modify-argument index="1">
1783 1783 <reference-count action="ignore"/>
1784 1784 </modify-argument>
1785 1785 </modify-function>
1786 1786 </object-type>
1787 1787 <object-type name="QDirModel">
1788 1788 <modify-function signature="parent()const" remove="all"/>
1789 1789 <modify-function signature="setIconProvider(QFileIconProvider*)">
1790 1790 <modify-argument index="1">
1791 1791 <reference-count action="set" variable-name="__rcIconProvider"/>
1792 1792 </modify-argument>
1793 1793 </modify-function>
1794 1794 </object-type>
1795 1795 <object-type name="QDoubleValidator"/>
1796 1796 <object-type name="QFileIconProvider"/>
1797 1797 <object-type name="QWizard">
1798 1798 <!-- ### Requires correct class name in meta object -->
1799 1799 <modify-function signature="setDefaultProperty(const char *, const char *, const char *)" remove="all"/>
1800 1800 <modify-function signature="addPage(QWizardPage*)">
1801 1801 <modify-argument index="1">
1802 1802 <no-null-pointer/>
1803 1803 <reference-count action="ignore"/>
1804 1804 </modify-argument>
1805 1805 </modify-function>
1806 1806 <modify-function signature="setButton(QWizard::WizardButton,QAbstractButton*)">
1807 1807 <modify-argument index="1">
1808 1808 <reference-count action="ignore"/>
1809 1809 </modify-argument>
1810 1810 </modify-function>
1811 1811 <modify-function signature="setPage(int,QWizardPage*)">
1812 1812 <modify-argument index="2">
1813 1813 <no-null-pointer/>
1814 1814 <reference-count action="ignore"/>
1815 1815 </modify-argument>
1816 1816 </modify-function>
1817 1817
1818 1818 </object-type>
1819 1819 <object-type name="QWizardPage">
1820 1820 <!-- ### Reduced functionality due to meta object having missing information -->
1821 1821 <modify-function signature="registerField(const QString &amp;, QWidget *, const char *, const char *)">
1822 1822 <access modifier="private"/>
1823 1823 <modify-argument index="3">
1824 1824 <remove-default-expression/>
1825 1825 </modify-argument>
1826 1826 <modify-argument index="4">
1827 1827 <remove-default-expression/>
1828 1828 </modify-argument>
1829 1829 </modify-function>
1830 1830
1831 1831 </object-type>
1832 1832 <object-type name="QFocusFrame">
1833 1833 <modify-function signature="initStyleOption(QStyleOption*)const">
1834 1834 <access modifier="private"/>
1835 1835 </modify-function>
1836 1836 <modify-function signature="setWidget(QWidget*)">
1837 1837 <modify-argument index="1">
1838 1838 <reference-count action="set" variable-name="__rcWidget"/>
1839 1839 </modify-argument>
1840 1840 </modify-function>
1841 1841 <inject-code>
1842 1842 <insert-template name="gui.init_style_option">
1843 1843 <replace from="%TYPE" to="QStyleOption"/>
1844 1844 </insert-template>
1845 1845 </inject-code>
1846 1846 </object-type>
1847 1847 <object-type name="QFontComboBox"/>
1848 1848 <object-type name="QFontDialog">
1849 1849 <inject-code class="native" position="beginning">
1850 1850 Q_DECLARE_METATYPE(QScriptValue)
1851 1851 </inject-code>
1852 1852 <modify-function signature="getFont(bool*,QWidget*)">
1853 1853 <modify-argument index="1">
1854 1854 <remove-argument/>
1855 1855 <conversion-rule class="native">
1856 1856 <insert-template name="core.prepare_removed_bool*_argument"/>
1857 1857 </conversion-rule>
1858 1858 </modify-argument>
1859 1859 <modify-argument index="return">
1860 1860 <conversion-rule class="native">
1861 1861 <insert-template name="core.convert_to_null_or_wrap"/>
1862 1862 </conversion-rule>
1863 1863 </modify-argument>
1864 1864 </modify-function>
1865 1865
1866 1866 <modify-function signature="getFont(bool*,QFont,QWidget*)">
1867 1867 <modify-argument index="1">
1868 1868 <remove-argument/>
1869 1869 <conversion-rule class="native">
1870 1870 <insert-template name="core.prepare_removed_bool*_argument"/>
1871 1871 </conversion-rule>
1872 1872 </modify-argument>
1873 1873 <modify-argument index="return">
1874 1874 <conversion-rule class="native">
1875 1875 <insert-template name="core.convert_to_null_or_wrap"/>
1876 1876 </conversion-rule>
1877 1877 </modify-argument>
1878 1878 </modify-function>
1879 1879
1880 1880 <modify-function signature="getFont(bool*,QFont,QWidget*,QString)">
1881 1881 <modify-argument index="1">
1882 1882 <remove-argument/>
1883 1883 <conversion-rule class="native">
1884 1884 <insert-template name="core.prepare_removed_bool*_argument"/>
1885 1885 </conversion-rule>
1886 1886 </modify-argument>
1887 1887 <modify-argument index="return">
1888 1888 <conversion-rule class="native">
1889 1889 <insert-template name="core.convert_to_null_or_wrap"/>
1890 1890 </conversion-rule>
1891 1891 </modify-argument>
1892 1892 </modify-function>
1893 1893 </object-type>
1894 1894
1895 1895 <object-type name="QGraphicsEllipseItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsEllipseItem::Type" />
1896 1896 <object-type name="QGraphicsItemAnimation">
1897 1897 <modify-function signature="setItem(QGraphicsItem*)">
1898 1898 <modify-argument index="1">
1899 1899 <reference-count action="set" variable-name="__rcItem"/>
1900 1900 </modify-argument>
1901 1901 </modify-function>
1902 1902 <modify-function signature="setTimeLine(QTimeLine*)">
1903 1903 <modify-argument index="1">
1904 1904 <reference-count action="set" variable-name="__rcTimeLine"/>
1905 1905 </modify-argument>
1906 1906 </modify-function>
1907 1907
1908 1908 <extra-includes>
1909 1909 <include file-name="QPair" location="global"/>
1910 1910 </extra-includes>
1911 1911 </object-type>
1912 1912 <object-type name="QGraphicsItemGroup" delete-in-main-thread="yes"
1913 1913 polymorphic-id-expression="%1-&gt;type() == QGraphicsItemGroup::Type">
1914 1914 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1915 1915 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1916 1916 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1917 1917 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1918 1918 </object-type>
1919 1919 <object-type name="QGraphicsLineItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsLineItem::Type">
1920 1920 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1921 1921 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1922 1922 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1923 1923 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1924 1924 </object-type>
1925 1925 <object-type name="QGraphicsPathItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPathItem::Type"/>
1926 1926
1927 1927 <object-type name="QGraphicsPixmapItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPixmapItem::Type">
1928 1928 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1929 1929 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
1930 1930 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
1931 1931 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
1932 1932 </object-type>
1933 1933 <object-type name="QGraphicsPolygonItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsPolygonItem::Type"/>
1934 1934 <object-type name="QGraphicsRectItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsRectItem::Type"/>
1935 1935 <object-type name="QGraphicsSimpleTextItem" delete-in-main-thread="yes" polymorphic-id-expression="%1-&gt;type() == QGraphicsSimpleTextItem::Type"/>
1936 1936 <object-type name="QHBoxLayout"/>
1937 1937 <object-type name="QHeaderView">
1938 1938 <modify-function signature="initStyleOption(QStyleOptionHeader*)const">
1939 1939 <access modifier="private"/>
1940 1940 </modify-function>
1941 1941
1942 1942 <modify-function signature="paintSection(QPainter*,QRect,int)const">
1943 1943 <modify-argument index="1" invalidate-after-use="yes"/>
1944 1944 </modify-function>
1945 1945
1946 1946 <inject-code>
1947 1947 <insert-template name="gui.init_style_option">
1948 1948 <replace from="%TYPE" to="QStyleOptionHeader"/>
1949 1949 </insert-template>
1950 1950 </inject-code>
1951 1951 <modify-function signature="setModel(QAbstractItemModel*)">
1952 1952 <modify-argument index="1">
1953 1953 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcModel"/>
1954 1954 </modify-argument>
1955 1955 </modify-function>
1956 1956 </object-type>
1957 1957 <object-type name="QIconEngine">
1958 1958 <modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)">
1959 1959 <modify-argument index="1" invalidate-after-use="yes"/>
1960 1960 </modify-function>
1961 1961 </object-type>
1962 1962 <object-type name="QIconEngineV2">
1963 1963 <modify-function signature="read(QDataStream&amp;)">
1964 1964 <modify-argument index="1" invalidate-after-use="yes"/>
1965 1965 </modify-function>
1966 1966 <modify-function signature="write(QDataStream&amp;)const">
1967 1967 <modify-argument index="1" invalidate-after-use="yes"/>
1968 1968 </modify-function>
1969 1969
1970 1970 <modify-function signature="virtual_hook(int,void*)" remove="all"/>
1971 1971 <modify-function signature="clone()const">
1972 1972 <modify-argument index="return">
1973 1973 <define-ownership class="shell" owner="c++"/>
1974 1974 </modify-argument>
1975 1975 </modify-function>
1976 1976 </object-type>
1977 1977 <object-type name="QImageWriter">
1978 1978 <modify-function signature="setDevice(QIODevice*)">
1979 1979 <modify-argument index="1">
1980 1980 <reference-count action="set" variable-name="__rcDevice"/>
1981 1981 </modify-argument>
1982 1982 </modify-function>
1983 1983 <modify-function signature="description()const" remove="all"/> <!--### Obsolete in 4.3-->
1984 1984 <modify-function signature="setDescription(QString)" remove="all"/> <!--### Obsolete in 4.3-->
1985 1985 </object-type>
1986 1986 <object-type name="QInputContextFactory"/>
1987 1987 <object-type name="QIntValidator"/>
1988 1988 <object-type name="QItemDelegate">
1989 1989 <modify-function signature="doLayout(QStyleOptionViewItem,QRect*,QRect*,QRect*,bool)const">
1990 1990 <remove/>
1991 1991 </modify-function>
1992 1992
1993 1993 <modify-function signature="drawCheck(QPainter*,QStyleOptionViewItem,QRect,Qt::CheckState)const">
1994 1994 <modify-argument index="1" invalidate-after-use="yes"/>
1995 1995 </modify-function>
1996 1996 <modify-function signature="drawDecoration(QPainter*,QStyleOptionViewItem,QRect,QPixmap)const">
1997 1997 <modify-argument index="1" invalidate-after-use="yes"/>
1998 1998 </modify-function>
1999 1999 <modify-function signature="drawDisplay(QPainter*,QStyleOptionViewItem,QRect,QString)const">
2000 2000 <modify-argument index="1" invalidate-after-use="yes"/>
2001 2001 </modify-function>
2002 2002 <modify-function signature="drawFocus(QPainter*,QStyleOptionViewItem,QRect)const">
2003 2003 <modify-argument index="1" invalidate-after-use="yes"/>
2004 2004 </modify-function>
2005 2005
2006 2006
2007 2007 <modify-function signature="selected(QPixmap,QPalette,bool)const">
2008 2008 <remove/>
2009 2009 </modify-function>
2010 2010 <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
2011 2011 <modify-argument index="1">
2012 2012 <reference-count action="set" variable-name="__rcItemEditorFactory"/>
2013 2013 </modify-argument>
2014 2014 </modify-function>
2015 2015 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
2016 2016 <modify-argument index="1">
2017 2017 <reference-count action="ignore"/>
2018 2018 </modify-argument>
2019 2019 </modify-function>
2020 2020 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
2021 2021 <modify-argument index="1">
2022 2022 <reference-count action="ignore"/>
2023 2023 </modify-argument>
2024 2024 </modify-function>
2025 2025
2026 2026 </object-type>
2027 2027 <object-type name="QItemEditorCreatorBase"/>
2028 2028 <object-type name="QItemEditorFactory">
2029 2029 <modify-function signature="registerEditor(QVariant::Type, QItemEditorCreatorBase *)">
2030 2030 <modify-argument index="2">
2031 2031 <define-ownership class="java" owner="c++"/>
2032 2032 </modify-argument>
2033 2033 </modify-function>
2034 2034 <modify-function signature="setDefaultFactory(QItemEditorFactory *)">
2035 2035 <modify-argument index="1">
2036 2036 <reference-count action="set" variable-name="__rcDefaultItemEditorFactory"/>
2037 2037 </modify-argument>
2038 2038 </modify-function>
2039 2039 </object-type>
2040 2040 <object-type name="QItemSelectionModel"/>
2041 2041 <object-type name="QTreeModel"/>
2042 2042 <object-type name="QListView"/>
2043 2043 <object-type name="QColumnView">
2044 2044 <modify-function signature="setPreviewWidget(QWidget*)">
2045 2045 <modify-argument index="1">
2046 2046 <reference-count action="ignore"/>
2047 2047 </modify-argument>
2048 2048 </modify-function>
2049 2049 <modify-function signature="setModel(QAbstractItemModel*)">
2050 2050 <modify-argument index="1">
2051 2051 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2052 2052 </modify-argument>
2053 2053 </modify-function>
2054 2054 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2055 2055 <modify-argument index="1">
2056 2056 <no-null-pointer/>
2057 2057 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2058 2058 </modify-argument>
2059 2059 </modify-function>
2060 2060 </object-type>
2061 2061 <object-type name="QMainWindow">
2062 2062 <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*,Qt::Orientation)">
2063 2063 <modify-argument index="2">
2064 2064 <reference-count action="ignore"/>
2065 2065 </modify-argument>
2066 2066 </modify-function>
2067 2067 <modify-function signature="addDockWidget(Qt::DockWidgetArea,QDockWidget*)">
2068 2068 <modify-argument index="2">
2069 2069 <reference-count action="ignore"/>
2070 2070 </modify-argument>
2071 2071 </modify-function>
2072 2072 <modify-function signature="addToolBar(QToolBar*)">
2073 2073 <modify-argument index="1">
2074 2074 <reference-count action="ignore"/>
2075 2075 </modify-argument>
2076 2076 </modify-function>
2077 2077 <modify-function signature="addToolBar(Qt::ToolBarArea,QToolBar*)">
2078 2078 <modify-argument index="2">
2079 2079 <reference-count action="ignore"/>
2080 2080 </modify-argument>
2081 2081 </modify-function>
2082 2082 <modify-function signature="insertToolBar(QToolBar*,QToolBar*)">
2083 2083 <modify-argument index="2">
2084 2084 <reference-count action="ignore"/>
2085 2085 </modify-argument>
2086 2086 <modify-argument index="2">
2087 2087 <reference-count action="ignore"/>
2088 2088 </modify-argument>
2089 2089 </modify-function>
2090 2090 <modify-function signature="insertToolBarBreak(QToolBar*)">
2091 2091 <modify-argument index="1">
2092 2092 <reference-count action="ignore"/>
2093 2093 </modify-argument>
2094 2094 </modify-function>
2095 2095 <modify-function signature="removeDockWidget(QDockWidget*)">
2096 2096 <modify-argument index="1">
2097 2097 <reference-count action="ignore"/>
2098 2098 </modify-argument>
2099 2099 </modify-function>
2100 2100 <modify-function signature="removeToolBar(QToolBar*)">
2101 2101 <modify-argument index="1">
2102 2102 <reference-count action="ignore"/>
2103 2103 </modify-argument>
2104 2104 </modify-function>
2105 2105 <modify-function signature="removeToolBarBreak(QToolBar*)">
2106 2106 <modify-argument index="1">
2107 2107 <reference-count action="ignore"/>
2108 2108 </modify-argument>
2109 2109 </modify-function>
2110 2110 <modify-function signature="setCentralWidget(QWidget*)">
2111 2111 <modify-argument index="1">
2112 2112 <reference-count action="ignore"/>
2113 2113 </modify-argument>
2114 2114 </modify-function>
2115 2115 <modify-function signature="setMenuBar(QMenuBar*)">
2116 2116 <modify-argument index="1">
2117 2117 <reference-count action="ignore"/>
2118 2118 </modify-argument>
2119 2119 </modify-function>
2120 2120 <modify-function signature="setMenuWidget(QWidget*)">
2121 2121 <modify-argument index="1">
2122 2122 <reference-count action="ignore"/>
2123 2123 </modify-argument>
2124 2124 </modify-function>
2125 2125 <modify-function signature="setStatusBar(QStatusBar*)">
2126 2126 <modify-argument index="1">
2127 2127 <reference-count action="ignore"/>
2128 2128 </modify-argument>
2129 2129 </modify-function>
2130 2130
2131 2131 </object-type>
2132 2132 <object-type name="QMdiArea">
2133 2133 <modify-function signature="addSubWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
2134 2134 <modify-argument index="1">
2135 2135 <reference-count action="ignore"/>
2136 2136 </modify-argument>
2137 2137 </modify-function>
2138 2138
2139 2139 <modify-function signature="removeSubWindow(QWidget*)">
2140 2140 <modify-argument index="1">
2141 2141 <reference-count action="ignore"/>
2142 2142 </modify-argument>
2143 2143 </modify-function>
2144 2144
2145 2145 <modify-function signature="setActiveSubWindow(QMdiSubWindow*)">
2146 2146 <modify-argument index="1">
2147 2147 <reference-count action="ignore"/>
2148 2148 </modify-argument>
2149 2149 </modify-function>
2150 2150
2151 2151 <modify-function signature="setupViewport(QWidget*)">
2152 2152 <modify-argument index="1">
2153 2153 <reference-count action="ignore"/>
2154 2154 </modify-argument>
2155 2155 </modify-function>
2156 2156
2157 2157 </object-type>
2158 2158 <object-type name="QMdiSubWindow">
2159 2159 <modify-function signature="setSystemMenu(QMenu*)">
2160 2160 <modify-argument index="1">
2161 2161 <reference-count action="ignore"/>
2162 2162 </modify-argument>
2163 2163 </modify-function>
2164 2164 <modify-function signature="setWidget(QWidget*)">
2165 2165 <modify-argument index="1">
2166 2166 <reference-count action="ignore"/>
2167 2167 </modify-argument>
2168 2168 </modify-function>
2169 2169 </object-type>
2170 2170 <object-type name="QMenu">
2171 2171 <modify-function signature="insertSeparator(QAction*)">
2172 2172 <modify-argument index="1">
2173 2173 <reference-count action="ignore"/>
2174 2174 </modify-argument>
2175 2175 </modify-function>
2176 2176 <modify-function signature="setActiveAction(QAction*)">
2177 2177 <modify-argument index="1">
2178 2178 <reference-count action="ignore"/>
2179 2179 </modify-argument>
2180 2180 </modify-function>
2181 2181 <modify-function signature="setDefaultAction(QAction*)">
2182 2182 <modify-argument index="1">
2183 2183 <reference-count action="ignore"/>
2184 2184 </modify-argument>
2185 2185 </modify-function>
2186 2186 <modify-function signature="setNoReplayFor(QWidget*)">
2187 2187 <remove/>
2188 2188 </modify-function>
2189 2189
2190 2190 <inject-code class="pywrap-h">
2191 2191 QAction* addAction (QMenu* menu, const QString &amp; text, PyObject* callable, const QKeySequence &amp; shortcut = 0) {
2192 2192 QAction* a = menu-&gt;addAction(text);
2193 2193 a-&gt;setShortcut(shortcut);
2194 2194 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2195 2195 return a;
2196 2196 }
2197 2197
2198 2198 QAction* addAction (QMenu* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable, const QKeySequence&amp; shortcut = 0)
2199 2199 {
2200 2200 QAction* a = menu-&gt;addAction(text);
2201 2201 a-&gt;setIcon(icon);
2202 2202 a-&gt;setShortcut(shortcut);
2203 2203 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2204 2204 return a;
2205 2205 }
2206 2206 </inject-code>
2207 2207 </object-type>
2208 2208
2209 2209 <object-type name="QMenuBar">
2210 2210
2211 2211 <modify-function signature="setActiveAction(QAction*)">
2212 2212 <modify-argument index="1">
2213 2213 <reference-count action="ignore"/>
2214 2214 </modify-argument>
2215 2215 </modify-function>
2216 2216 <modify-function signature="setCornerWidget(QWidget*,Qt::Corner) ">
2217 2217 <modify-argument index="1">
2218 2218 <reference-count action="ignore"/>
2219 2219 </modify-argument>
2220 2220 </modify-function>
2221 2221
2222 2222 <inject-code class="pywrap-h">
2223 2223 QAction* addAction (QMenuBar* menu, const QString &amp; text, PyObject* callable)
2224 2224 {
2225 2225 QAction* a = menu-&gt;addAction(text);
2226 2226 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2227 2227 return a;
2228 2228 }
2229 2229 </inject-code>
2230 2230 </object-type>
2231 2231 <object-type name="QMotifStyle">
2232 2232 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2233 2233 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2234 2234 </object-type>
2235 2235 <object-type name="QPainterPathStroker"/>
2236 2236
2237 2237 <object-type name="QPictureIO">
2238 2238 <modify-function signature="QPictureIO(QIODevice*,const char*)">
2239 2239 <access modifier="private"/>
2240 2240 <modify-argument index="1">
2241 2241 <reference-count action="set" variable-name="__rcDevice"/>
2242 2242 </modify-argument>
2243 2243 </modify-function>
2244 2244
2245 2245 <modify-function signature="setIODevice(QIODevice*)">
2246 2246 <modify-argument index="1">
2247 2247 <reference-count action="set" variable-name="__rcDevice"/>
2248 2248 </modify-argument>
2249 2249 </modify-function>
2250 2250
2251 2251 <modify-function signature="QPictureIO(QString,const char*)">
2252 2252 <access modifier="private"/>
2253 2253 </modify-function>
2254 2254
2255 2255 <modify-function signature="format()const">
2256 2256 <access modifier="private"/>
2257 2257 <rename to="format_private"/>
2258 2258 </modify-function>
2259 2259
2260 2260 <modify-function signature="parameters()const">
2261 2261 <access modifier="private"/>
2262 2262 <rename to="parameters_private"/>
2263 2263 </modify-function>
2264 2264
2265 2265 <modify-function signature="setFormat(const char*)">
2266 2266 <access modifier="private"/>
2267 2267 </modify-function>
2268 2268
2269 2269 <modify-function signature="setParameters(const char*)">
2270 2270 <access modifier="private"/>
2271 2271 </modify-function>
2272 2272
2273 2273
2274 2274 <modify-function signature="QPictureIO(QIODevice*,const char*)">
2275 2275 <modify-argument index="2">
2276 2276 <replace-type modified-type="QString"/>
2277 2277 <conversion-rule class="native">
2278 2278 <insert-template name="core.convert_string_arg_to_char*"/>
2279 2279 </conversion-rule>
2280 2280 </modify-argument>
2281 2281 </modify-function>
2282 2282
2283 2283 <modify-function signature="QPictureIO(QString,const char*)">
2284 2284 <modify-argument index="2">
2285 2285 <replace-type modified-type="QString"/>
2286 2286 <conversion-rule class="native">
2287 2287 <insert-template name="core.convert_string_arg_to_char*"/>
2288 2288 </conversion-rule>
2289 2289 </modify-argument>
2290 2290 </modify-function>
2291 2291
2292 2292 <modify-function signature="setFormat(const char*)">
2293 2293 <modify-argument index="1">
2294 2294 <replace-type modified-type="QString"/>
2295 2295 <conversion-rule class="native">
2296 2296 <insert-template name="core.convert_string_arg_to_char*"/>
2297 2297 </conversion-rule>
2298 2298 </modify-argument>
2299 2299 </modify-function>
2300 2300
2301 2301 <modify-function signature="setParameters(const char*)">
2302 2302 <modify-argument index="1">
2303 2303 <replace-type modified-type="QString"/>
2304 2304 <conversion-rule class="native">
2305 2305 <insert-template name="core.convert_string_arg_to_char*"/>
2306 2306 </conversion-rule>
2307 2307 </modify-argument>
2308 2308 </modify-function>
2309 2309 </object-type>
2310 2310
2311 2311 <object-type name="QPixmapCache">
2312 2312 <modify-function signature="find(QString)">
2313 2313 <remove/>
2314 2314 </modify-function>
2315 2315 <modify-function signature="find(QString,QPixmap*)" remove="all"/>
2316 2316
2317 2317 <modify-function signature="find(QString,QPixmap&amp;)">
2318 2318 <access modifier="private"/>
2319 2319 </modify-function>
2320 2320 </object-type>
2321 2321 <object-type name="QPlastiqueStyle">
2322 2322 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2323 2323 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2324 2324 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
2325 2325 </object-type>
2326 2326 <object-type name="QPrintDialog">
2327 2327 </object-type>
2328 2328 <object-type name="QPrintEngine"/>
2329 2329 <object-type name="QProgressBar">
2330 2330 <modify-function signature="initStyleOption(QStyleOptionProgressBar*)const">
2331 2331 <access modifier="private"/>
2332 2332 </modify-function>
2333 2333 </object-type>
2334 2334 <object-type name="QPushButton">
2335 2335 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
2336 2336 <access modifier="private"/>
2337 2337 </modify-function>
2338 2338
2339 2339 <modify-function signature="setMenu(QMenu*)">
2340 2340 <modify-argument index="1">
2341 2341 <reference-count action="set" variable-name="__rcMenu"/>
2342 2342 </modify-argument>
2343 2343 </modify-function>
2344 2344 </object-type>
2345 2345 <object-type name="QRegExpValidator"/>
2346 2346 <object-type name="QScrollArea">
2347 2347 <modify-function signature="setWidget(QWidget*)">
2348 2348 <modify-argument index="1">
2349 2349 <reference-count action="ignore"/>
2350 2350 </modify-argument>
2351 2351 </modify-function>
2352 2352 </object-type>
2353 2353 <object-type name="QSessionManager"/>
2354 2354 <object-type name="QShortcut">
2355 2355 <modify-function signature="QShortcut(QKeySequence,QWidget*,const char*,const char*,Qt::ShortcutContext)">
2356 2356 <access modifier="private"/>
2357 2357 <modify-argument index="3">
2358 2358 <remove-default-expression/>
2359 2359 </modify-argument>
2360 2360 <modify-argument index="4">
2361 2361 <remove-default-expression/>
2362 2362 </modify-argument>
2363 2363 <modify-argument index="5">
2364 2364 <remove-default-expression/>
2365 2365 </modify-argument>
2366 2366 </modify-function>
2367 2367 </object-type>
2368 2368 <object-type name="QSizeGrip"/>
2369 2369 <object-type name="QSound"/>
2370 2370 <object-type name="QSpacerItem"/>
2371 2371 <object-type name="QStandardItem">
2372 2372 <modify-function signature="operator=(QStandardItem)" remove="all"/>
2373 2373 <modify-function signature="operator&lt;(QStandardItem)const">
2374 2374 <modify-argument index="1" invalidate-after-use="yes"/>
2375 2375 </modify-function>
2376 2376 <modify-function signature="read(QDataStream&amp;)">
2377 2377 <modify-argument index="1" invalidate-after-use="yes"/>
2378 2378 </modify-function>
2379 2379 <modify-function signature="write(QDataStream&amp;)const">
2380 2380 <modify-argument index="1" invalidate-after-use="yes"/>
2381 2381 </modify-function>
2382 2382
2383 2383
2384 2384 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
2385 2385 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
2386 2386 <modify-function signature="operator=(QStandardItem)" remove="all"/>
2387 2387 <modify-function signature="operator&lt;(QStandardItem)const" remove="all"/>
2388 2388 </object-type>
2389 2389 <object-type name="QStatusBar">
2390 2390 <modify-function signature="addPermanentWidget(QWidget *, int)">
2391 2391 <modify-argument index="1">
2392 2392 <reference-count action="ignore"/>
2393 2393 </modify-argument>
2394 2394 </modify-function>
2395 2395 <modify-function signature="addWidget(QWidget *, int)">
2396 2396 <modify-argument index="1">
2397 2397 <reference-count action="ignore"/>
2398 2398 </modify-argument>
2399 2399 </modify-function>
2400 2400 <modify-function signature="removeWidget(QWidget *)">
2401 2401 <modify-argument index="1">
2402 2402 <reference-count action="ignore"/>
2403 2403 </modify-argument>
2404 2404 </modify-function>
2405 2405 <modify-function signature="insertPermanentWidget(int, QWidget *, int)">
2406 2406 <modify-argument index="2">
2407 2407 <reference-count action="ignore"/>
2408 2408 </modify-argument>
2409 2409 </modify-function>
2410 2410 <modify-function signature="insertWidget(int, QWidget *, int)">
2411 2411 <modify-argument index="2">
2412 2412 <reference-count action="ignore"/>
2413 2413 </modify-argument>
2414 2414 </modify-function>
2415 2415 </object-type>
2416 2416 <object-type name="QStringListModel"/>
2417 2417 <object-type name="QStyleFactory"/>
2418 2418 <object-type name="QStyleHintReturn"/>
2419 2419 <object-type name="QStyleHintReturnVariant"/>
2420 2420 <object-type name="QStyleHintReturnMask"/>
2421 2421 <object-type name="QStylePainter" delete-in-main-thread="yes"/>
2422 2422 <object-type name="QSyntaxHighlighter">
2423 2423 <modify-function signature="setCurrentBlockUserData(QTextBlockUserData*)">
2424 2424 <modify-argument index="1">
2425 2425 <define-ownership class="java" owner="c++"/>
2426 2426 </modify-argument>
2427 2427 </modify-function>
2428 2428 <modify-function signature="setDocument(QTextDocument*)">
2429 2429 <modify-argument index="1">
2430 2430 <reference-count action="set" variable-name="__rcDocument"/>
2431 2431 </modify-argument>
2432 2432 </modify-function>
2433 2433
2434 2434 </object-type>
2435 2435 <object-type name="QSystemTrayIcon">
2436 2436 <modify-function signature="setContextMenu(QMenu*)">
2437 2437 <modify-argument index="1">
2438 2438 <reference-count action="set" variable-name="__rcContextMenu"/>
2439 2439 </modify-argument>
2440 2440 </modify-function>
2441 2441 </object-type>
2442 2442 <object-type name="QTableView">
2443 2443 <modify-function signature="setHorizontalHeader(QHeaderView*)">
2444 2444 <modify-argument index="1">
2445 2445 <reference-count action="ignore"/>
2446 2446 </modify-argument>
2447 2447 </modify-function>
2448 2448 <modify-function signature="setVerticalHeader(QHeaderView*)">
2449 2449 <modify-argument index="1">
2450 2450 <reference-count action="ignore"/>
2451 2451 </modify-argument>
2452 2452 </modify-function>
2453 2453 <modify-function signature="setModel(QAbstractItemModel*)">
2454 2454 <modify-argument index="1">
2455 2455 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2456 2456 </modify-argument>
2457 2457 </modify-function>
2458 2458 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2459 2459 <modify-argument index="1">
2460 2460 <no-null-pointer/>
2461 2461 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2462 2462 </modify-argument>
2463 2463 </modify-function>
2464 2464
2465 2465 <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
2466 2466 </object-type>
2467 2467 <object-type name="QTextBlockGroup" delete-in-main-thread="yes"/>
2468 2468 <object-type name="QTextBlockUserData" delete-in-main-thread="yes"/>
2469 2469 <object-type name="QTextItem" delete-in-main-thread="yes"/>
2470 2470 <object-type name="QTextList" delete-in-main-thread="yes">
2471 2471 <modify-function signature="format()const" rename="textListFormat"/>
2472 2472
2473 2473 <modify-function signature="isEmpty()const" remove="all"/> <!--### Obsolete in 4.3-->
2474 2474 </object-type>
2475 2475 <object-type name="QTextObject" delete-in-main-thread="yes"/>
2476 2476
2477 2477 <!-- The original QTextObjectInterface has been rejected and replaced by this, since the original
2478 2478 usage is based on an interface pattern we can't mimic in Java (our users can't implement our
2479 2479 interfaces.) The new class inherits both QObject and QTextObjectInterface, and can be extended
2480 2480 in Java to get a type that can properly be used with registerHandler() in
2481 2481 QAbstractTextDocumentLayout. -->
2482 2482 <object-type name="QtJambiTextObjectInterface" delete-in-main-thread="yes" java-name="QTextObjectInterface">
2483 2483 <modify-function signature="drawObject(QPainter*,QRectF,QTextDocument*,int,QTextFormat)">
2484 2484 <modify-argument index="1" invalidate-after-use="yes"/>
2485 2485 </modify-function>
2486 2486 </object-type>
2487 2487
2488 2488 <object-type name="QTimeEdit"/>
2489 2489 <object-type name="QToolBox">
2490 2490 <modify-function signature="addItem(QWidget*,QString)">
2491 2491 <modify-argument index="1">
2492 2492 <reference-count action="ignore"/>
2493 2493 </modify-argument>
2494 2494 </modify-function>
2495 2495 <modify-function signature="addItem(QWidget*,QIcon,QString)">
2496 2496 <modify-argument index="1">
2497 2497 <reference-count action="ignore"/>
2498 2498 </modify-argument>
2499 2499 </modify-function>
2500 2500 <modify-function signature="insertItem(int,QWidget*,QIcon,QString)">
2501 2501 <modify-argument index="2">
2502 2502 <reference-count action="ignore"/>
2503 2503 </modify-argument>
2504 2504 </modify-function>
2505 2505 <modify-function signature="insertItem(int,QWidget*,QString)">
2506 2506 <modify-argument index="2">
2507 2507 <reference-count action="ignore"/>
2508 2508 </modify-argument>
2509 2509 </modify-function>
2510 2510 <modify-function signature="setCurrentWidget(QWidget*) ">
2511 2511 <modify-argument index="1">
2512 2512 <reference-count action="ignore"/>
2513 2513 </modify-argument>
2514 2514 </modify-function>
2515 2515 </object-type>
2516 2516 <object-type name="QToolButton">
2517 2517 <modify-function signature="initStyleOption(QStyleOptionToolButton*)const">
2518 2518 <access modifier="private"/>
2519 2519 </modify-function>
2520 2520
2521 2521 <modify-function signature="setDefaultAction(QAction *)">
2522 2522 <modify-argument index="1">
2523 2523 <reference-count action="set" variable-name="__rcDefaultAction"/>
2524 2524 </modify-argument>
2525 2525 </modify-function>
2526 2526 <modify-function signature="setMenu(QMenu *)">
2527 2527 <modify-argument index="1">
2528 2528 <reference-count action="set" variable-name="__rcMenu"/>
2529 2529 </modify-argument>
2530 2530 </modify-function>
2531 2531 </object-type>
2532 2532 <object-type name="QToolTip"/>
2533 2533 <object-type name="QTreeView">
2534 2534
2535 2535 <modify-function signature="drawBranches(QPainter*,QRect,QModelIndex)const">
2536 2536 <modify-argument index="1" invalidate-after-use="yes"/>
2537 2537 </modify-function>
2538 2538 <modify-function signature="drawRow(QPainter*,QStyleOptionViewItem,QModelIndex)const">
2539 2539 <modify-argument index="1" invalidate-after-use="yes"/>
2540 2540 </modify-function>
2541 2541
2542 2542 <modify-function signature="setHeader(QHeaderView*)">
2543 2543 <modify-argument index="1">
2544 2544 <reference-count action="ignore"/>
2545 2545 </modify-argument>
2546 2546 </modify-function>
2547 2547 <modify-function signature="setModel(QAbstractItemModel*)">
2548 2548 <modify-argument index="1">
2549 2549 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemModel"/>
2550 2550 </modify-argument>
2551 2551 </modify-function>
2552 2552 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
2553 2553 <modify-argument index="1">
2554 2554 <no-null-pointer/>
2555 2555 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
2556 2556 </modify-argument>
2557 2557 </modify-function>
2558 2558
2559 2559 <modify-function signature="sortByColumn(int)" remove="all"/> <!--### Obsolete in 4.3-->
2560 2560 </object-type>
2561 2561 <object-type name="QUndoCommand">
2562 2562 <modify-function signature="mergeWith(const QUndoCommand*)">
2563 2563 <modify-argument index="1" invalidate-after-use="yes"/>
2564 2564 </modify-function>
2565 2565 </object-type>
2566 2566 <object-type name="QUndoGroup">
2567 2567 <modify-function signature="addStack(QUndoStack*)">
2568 2568 <modify-argument index="1">
2569 2569 <reference-count action="add" variable-name="__rcStacks"/>
2570 2570 </modify-argument>
2571 2571 </modify-function>
2572 2572 <modify-function signature="removeStack(QUndoStack*)">
2573 2573 <modify-argument index="1">
2574 2574 <reference-count action="remove" variable-name="__rcStacks"/>
2575 2575 </modify-argument>
2576 2576 </modify-function>
2577 2577 <modify-function signature="setActiveStack(QUndoStack*)">
2578 2578 <modify-argument index="1">
2579 2579 <reference-count action="ignore"/>
2580 2580 </modify-argument>
2581 2581 </modify-function>
2582 2582 </object-type>
2583 2583
2584 2584 <object-type name="QUndoStack"/>
2585 2585
2586 2586 <object-type name="QUndoView">
2587 2587 <modify-function signature="setGroup(QUndoGroup *)">
2588 2588 <modify-argument index="1">
2589 2589 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2590 2590 </modify-argument>
2591 2591 </modify-function>
2592 2592 <modify-function signature="setStack(QUndoStack *)">
2593 2593 <modify-argument index="1">
2594 2594 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2595 2595 </modify-argument>
2596 2596 </modify-function>
2597 2597 <modify-function signature="QUndoView(QUndoGroup *,QWidget *)">
2598 2598 <modify-argument index="1">
2599 2599 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2600 2600 </modify-argument>
2601 2601 </modify-function>
2602 2602 <modify-function signature="QUndoView(QUndoStack *,QWidget *)">
2603 2603 <modify-argument index="1">
2604 2604 <reference-count action="set" variable-name="__rcGroupOrStack"/>
2605 2605 </modify-argument>
2606 2606 </modify-function>
2607 2607 </object-type>
2608 2608 <object-type name="QVBoxLayout"/>
2609 2609 <object-type name="QValidator"/>
2610 2610 <object-type name="QWhatsThis"/>
2611 2611 <object-type name="QWidgetAction">
2612 2612 <modify-function signature="createWidget(QWidget*)">
2613 2613 <modify-argument index="return">
2614 2614 <define-ownership class="shell" owner="c++"/>
2615 2615 </modify-argument>
2616 2616 </modify-function>
2617 2617 </object-type>
2618 2618 <object-type name="QWidgetItem"/>
2619 2619 <object-type name="QWindowsStyle">
2620 2620 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2621 2621 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2622 2622 </object-type>
2623 2623 <object-type name="QWorkspace">
2624 2624 <modify-function signature="addWindow(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
2625 2625 <modify-argument index="1">
2626 2626 <reference-count action="ignore"/>
2627 2627 </modify-argument>
2628 2628 </modify-function>
2629 2629 <modify-function signature="setActiveWindow(QWidget*)">
2630 2630 <modify-argument index="1">
2631 2631 <reference-count action="ignore"/>
2632 2632 </modify-argument>
2633 2633 </modify-function>
2634 2634 </object-type>
2635 2635
2636 2636 <object-type name="QActionEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ActionAdded || %1-&gt;type() == QEvent::ActionRemoved || %1-&gt;type() == QEvent::ActionChanged"/>
2637 2637 <object-type name="QClipboardEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Clipboard"/>
2638 2638 <object-type name="QCloseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Close"/>
2639 2639 <object-type name="QContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ContextMenu"/>
2640 2640 <object-type name="QDragEnterEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragEnter"/>
2641 2641 <object-type name="QDragLeaveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragLeave"/>
2642 2642 <object-type name="QDragMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragMove">
2643 2643 <modify-function signature="accept()" remove="all"/>
2644 2644 <modify-function signature="ignore()" remove="all"/>
2645 2645 </object-type>
2646 2646 <object-type name="QDropEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Drop">
2647 2647 <modify-function signature="encodedData(const char*)const">
2648 2648 <remove/>
2649 2649 </modify-function>
2650 2650
2651 2651 <modify-function signature="format(int)const">
2652 2652 <remove/>
2653 2653 </modify-function>
2654 2654
2655 2655 <modify-function signature="provides(const char*)const">
2656 2656 <remove/>
2657 2657 </modify-function>
2658 2658
2659 2659
2660 2660 </object-type>
2661 2661 <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
2662 2662 <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut">
2663 2663 <modify-function signature="reason()const">
2664 2664 <remove/>
2665 2665 </modify-function>
2666 2666 </object-type>
2667 2667
2668 2668 <object-type name="QGraphicsSceneContextMenuEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneContextMenu"/>
2669 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 2670 <modify-function signature="setMimeData(const QMimeData *)">
2671 2671 <remove/>
2672 2672 </modify-function>
2673 2673 <modify-function signature="setSource(QWidget *)">
2674 2674 <remove/>
2675 2675 </modify-function>
2676 2676 </object-type>
2677 2677 <object-type name="QGraphicsSceneEvent">
2678 2678 <modify-function signature="setWidget(QWidget *)">
2679 2679 <remove/>
2680 2680 </modify-function>
2681 2681 </object-type>
2682 2682 <object-type name="QGraphicsSceneMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneMove"/>
2683 2683 <object-type name="QGraphicsSceneResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneResize"/>
2684 2684 <object-type name="QGraphicsSceneHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHelp"/>
2685 2685 <object-type name="QGraphicsSceneHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneHoverEnter || %1-&gt;type() == QEvent::GraphicsSceneHoverLeave || %1-&gt;type() == QEvent::GraphicsSceneHoverMove"/>
2686 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 2687 <object-type name="QGraphicsSceneWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::GraphicsSceneWheel"/>
2688 2688 <object-type name="QHelpEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolTip || %1-&gt;type() == QEvent::WhatsThis"/>
2689 2689 <object-type name="QHideEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Hide"/>
2690 2690 <object-type name="QHoverEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::HoverEnter || %1-&gt;type() == QEvent::HoverLeave || %1-&gt;type() == QEvent::HoverMove"/>
2691 2691 <object-type name="QIconDragEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::IconDrag"/>
2692 2692 <object-type name="QInputMethodEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::InputMethod"/>
2693 2693 <object-type name="QMoveEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Move"/>
2694 2694 <object-type name="QResizeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Resize"/>
2695 2695 <object-type name="QShortcutEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Shortcut">
2696 2696 <!-- All these have const overloads that are used instead -->
2697 2697 <modify-function signature="isAmbiguous()">
2698 2698 <remove/>
2699 2699 </modify-function>
2700 2700 <modify-function signature="shortcutId()">
2701 2701 <remove/>
2702 2702 </modify-function>
2703 2703 <modify-function signature="key()">
2704 2704 <remove/>
2705 2705 </modify-function>
2706 2706 </object-type>
2707 2707 <object-type name="QShowEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Show"/>
2708 2708 <object-type name="QStatusTipEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::StatusTip"/>
2709 2709 <object-type name="QTabletEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::TabletMove || %1-&gt;type() == QEvent::TabletPress || %1-&gt;type() == QEvent::TabletRelease"/>
2710 2710 <object-type name="QToolBarChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::ToolBarChange"/>
2711 2711 <object-type name="QWhatsThisClickedEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WhatsThisClicked"/>
2712 2712 <object-type name="QWheelEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Wheel"/>
2713 2713 <object-type name="QWindowStateChangeEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::WindowStateChange"/>
2714 2714 <object-type name="QDragResponseEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::DragResponse"/>
2715 2715 <object-type name="QInputEvent">
2716 2716 <modify-function signature="modifiers()const" access="non-final"/>
2717 2717 </object-type>
2718 2718 <object-type name="QGestureEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Gesture || %1-&gt;type() == QEvent::GestureOverride"/>
2719 2719 <object-type name="QKeyEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::KeyPress || %1-&gt;type() == QEvent::KeyRelease"/>
2720 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 2721 <object-type name="QPaintEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::Paint"/>
2722 2722 <object-type name="QAccessibleEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::AccessibilityDescription || %1-&gt;type() == QEvent::AccessibilityHelp"/>
2723 2723
2724 2724 <object-type name="QAbstractButton"/>
2725 2725
2726 2726 <object-type name="QStyle">
2727 2727 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap, const QStyleOption *, const QWidget *)const" virtual-slot="yes"/>
2728 2728 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType, QSizePolicy::ControlType, Qt::Orientation, const QStyleOption *, const QWidget *) const" virtual-slot="yes"/>
2729 2729
2730 2730 <modify-function signature="drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const">
2731 2731 <modify-argument index="3" invalidate-after-use="yes"/>
2732 2732 </modify-function>
2733 2733 <modify-function signature="drawControl(QStyle::ControlElement,const QStyleOption*,QPainter*,const QWidget*)const">
2734 2734 <modify-argument index="3" invalidate-after-use="yes"/>
2735 2735 </modify-function>
2736 2736 <modify-function signature="drawPrimitive(QStyle::PrimitiveElement,const QStyleOption*,QPainter*,const QWidget*)const">
2737 2737 <modify-argument index="3" invalidate-after-use="yes"/>
2738 2738 </modify-function>
2739 2739 <modify-function signature="styleHint(QStyle::StyleHint,const QStyleOption*,const QWidget*,QStyleHintReturn*)const">
2740 2740 <modify-argument index="4" invalidate-after-use="yes"/>
2741 2741 </modify-function>
2742 2742 <modify-function signature="drawItemPixmap(QPainter*,QRect,int,QPixmap)const">
2743 2743 <modify-argument index="1" invalidate-after-use="yes"/>
2744 2744 </modify-function>
2745 2745 <modify-function signature="drawItemText(QPainter*,QRect,int,QPalette,bool,QString,QPalette::ColorRole)const">
2746 2746 <modify-argument index="1" invalidate-after-use="yes"/>
2747 2747 </modify-function>
2748 2748
2749 2749
2750 2750 <modify-function signature="itemTextRect(QFontMetrics,QRect,int,bool,QString)const" remove="all"/>
2751 2751 </object-type>
2752 2752
2753 2753 <object-type name="QColorDialog">
2754 2754
2755 2755 <modify-function signature="getColor(const QColor &amp;, QWidget *)">
2756 2756 <modify-argument index="1">
2757 2757 <replace-default-expression with="QColor.white"/>
2758 2758 </modify-argument>
2759 2759 </modify-function>
2760 2760 <modify-function signature="getRgba(uint,bool*,QWidget*)">
2761 2761 <rename to="getRgba_internal"/>
2762 2762 <access modifier="private"/>
2763 2763 <modify-argument index="1">
2764 2764 <remove-default-expression/>
2765 2765 </modify-argument>
2766 2766 <modify-argument index="2">
2767 2767 <remove-default-expression/>
2768 2768 </modify-argument>
2769 2769 <modify-argument index="3">
2770 2770 <remove-default-expression/>
2771 2771 </modify-argument>
2772 2772 </modify-function>
2773 2773 </object-type>
2774 2774
2775 2775 <object-type name="QLayout">
2776 2776 <modify-function signature="addItem(QLayoutItem*)">
2777 2777 <modify-argument index="1" invalidate-after-use="yes"/>
2778 2778 </modify-function>
2779 2779
2780 2780 <modify-function signature="setSpacing(int)" rename="setWidgetSpacing"/>
2781 2781 <modify-function signature="spacing()const" rename="widgetSpacing"/>
2782 2782 <modify-function signature="addWidget(QWidget *)">
2783 2783 <modify-argument index="1">
2784 2784 <no-null-pointer/>
2785 2785 <reference-count variable-name="__rcWidgets" action="add"/>
2786 2786 </modify-argument>
2787 2787 </modify-function>
2788 2788 <modify-function signature="addChildWidget(QWidget *)">
2789 2789 <modify-argument index="1">
2790 2790 <no-null-pointer/>
2791 2791 <reference-count variable-name="__rcWidgets" action="add"/>
2792 2792 </modify-argument>
2793 2793 </modify-function>
2794 2794 <modify-function signature="removeWidget(QWidget *)">
2795 2795 <modify-argument index="1">
2796 2796 <no-null-pointer/>
2797 2797 <reference-count variable-name="__rcWidgets" action="remove"/>
2798 2798 </modify-argument>
2799 2799 </modify-function>
2800 2800
2801 2801 <modify-function signature="setAlignment(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
2802 2802 <modify-argument index="1">
2803 2803 <reference-count action="ignore"/>
2804 2804 </modify-argument>
2805 2805 </modify-function>
2806 2806 <modify-function signature="setAlignment(QLayout*,QFlags&lt;Qt::AlignmentFlag&gt;)">
2807 2807 <modify-argument index="1">
2808 2808 <reference-count action="ignore"/>
2809 2809 </modify-argument>
2810 2810 </modify-function>
2811 2811 <modify-function signature="setMenuBar(QWidget*)">
2812 2812 <modify-argument index="1">
2813 2813 <reference-count action="set" variable-name="__rcMenuBar"/>
2814 2814 </modify-argument>
2815 2815 </modify-function>
2816 2816 <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
2817 2817 <access modifier="private"/>
2818 2818 </modify-function>
2819 2819
2820 2820 <modify-function signature="margin()const" remove="all"/> <!--### Obsolete in 4.3-->
2821 2821 <!-- <modify-function signature="setMargin(int)" remove="all"/> --> <!--### Obsolete in 4.3-->
2822 2822 </object-type>
2823 2823
2824 2824 <object-type name="QStackedLayout">
2825 2825 <modify-function signature="addItem(QLayoutItem *)">
2826 2826 <modify-argument index="1">
2827 2827 <define-ownership class="java" owner="c++"/>
2828 2828 </modify-argument>
2829 2829 </modify-function>
2830 2830 <modify-function signature="itemAt(int) const">
2831 2831 <modify-argument index="return">
2832 2832 <define-ownership class="java" owner="c++"/>
2833 2833 </modify-argument>
2834 2834 </modify-function>
2835 2835 <modify-function signature="addWidget(QWidget *)">
2836 2836 <rename to="addStackedWidget"/>
2837 2837 <modify-argument index="1">
2838 2838 <no-null-pointer/>
2839 2839 <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
2840 2840 </modify-argument>
2841 2841 </modify-function>
2842 2842 <modify-function signature="insertWidget(int,QWidget*)">
2843 2843 <modify-argument index="2">
2844 2844 <no-null-pointer/>
2845 2845 <reference-count action="add" declare-variable="QLayout" variable-name="__rcWidgets"/>
2846 2846 </modify-argument>
2847 2847 </modify-function>
2848 2848 <modify-function signature="setCurrentWidget(QWidget*)">
2849 2849 <modify-argument index="1">
2850 2850 <!-- Safe to ignore because current widget must have been added to layout already -->
2851 2851 <reference-count action="ignore"/>
2852 2852 </modify-argument>
2853 2853 </modify-function>
2854 2854 </object-type>
2855 2855
2856 2856 <object-type name="QBoxLayout">
2857 2857 <modify-function signature="addWidget(QWidget *, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2858 2858 <modify-argument index="1">
2859 2859 <no-null-pointer/>
2860 2860 </modify-argument>
2861 2861 </modify-function>
2862 2862 <modify-function signature="addItem(QLayoutItem *)">
2863 2863 <modify-argument index="1">
2864 2864 <define-ownership class="java" owner="c++"/>
2865 2865 </modify-argument>
2866 2866 </modify-function>
2867 2867 <modify-function signature="insertLayout(int, QLayout *, int)">
2868 2868 <modify-argument index="2">
2869 2869 <define-ownership class="java" owner="c++"/>
2870 2870 </modify-argument>
2871 2871 </modify-function>
2872 2872 <modify-function signature="insertItem(int, QLayoutItem *)">
2873 2873 <modify-argument index="2">
2874 2874 <define-ownership class="java" owner="c++"/>
2875 2875 </modify-argument>
2876 2876 </modify-function>
2877 2877 <modify-function signature="addSpacerItem(QSpacerItem*)">
2878 2878 <modify-argument index="1">
2879 2879 <define-ownership class="java" owner="c++"/>
2880 2880 </modify-argument>
2881 2881 </modify-function>
2882 2882 <modify-function signature="insertSpacerItem(int,QSpacerItem*)">
2883 2883 <modify-argument index="2">
2884 2884 <define-ownership class="java" owner="c++"/>
2885 2885 </modify-argument>
2886 2886 </modify-function>
2887 2887
2888 2888 <modify-function signature="addLayout(QLayout *, int)">
2889 2889 <modify-argument index="1">
2890 2890 <define-ownership class="java" owner="c++"/>
2891 2891 </modify-argument>
2892 2892 </modify-function>
2893 2893 <modify-function signature="addWidget(QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2894 2894 <modify-argument index="1">
2895 2895 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2896 2896 </modify-argument>
2897 2897 </modify-function>
2898 2898 <modify-function signature="insertWidget(int,QWidget*,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2899 2899 <modify-argument index="2">
2900 2900 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2901 2901 </modify-argument>
2902 2902 </modify-function>
2903 2903 <modify-function signature="setStretchFactor(QWidget*,int)">
2904 2904 <modify-argument index="1">
2905 2905 <reference-count action="ignore"/>
2906 2906 </modify-argument>
2907 2907 </modify-function>
2908 2908 <modify-function signature="setStretchFactor(QLayout*,int)">
2909 2909 <modify-argument index="1">
2910 2910 <reference-count action="ignore"/>
2911 2911 </modify-argument>
2912 2912 </modify-function>
2913 2913 </object-type>
2914 2914
2915 2915 <object-type name="QGridLayout">
2916 2916 <modify-function signature="addWidget(QWidget *)" remove="all"/>
2917 2917 <modify-function signature="addItem(QLayoutItem *)">
2918 2918 <modify-argument index="1">
2919 2919 <define-ownership class="java" owner="c++"/>
2920 2920 </modify-argument>
2921 2921 </modify-function>
2922 2922 <modify-function signature="addItem(QLayoutItem *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2923 2923 <modify-argument index="1">
2924 2924 <define-ownership class="java" owner="c++"/>
2925 2925 </modify-argument>
2926 2926 </modify-function>
2927 2927 <modify-function signature="addLayout(QLayout *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2928 2928 <modify-argument index="1">
2929 2929 <define-ownership class="java" owner="c++"/>
2930 2930 </modify-argument>
2931 2931 </modify-function>
2932 2932 <modify-function signature="addLayout(QLayout *, int, int, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
2933 2933 <modify-argument index="1">
2934 2934 <define-ownership class="java" owner="c++"/>
2935 2935 </modify-argument>
2936 2936 </modify-function>
2937 2937 <modify-function signature="addWidget(QWidget*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2938 2938 <modify-argument index="1">
2939 2939 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2940 2940 </modify-argument>
2941 2941 </modify-function>
2942 2942 <modify-function signature="addWidget(QWidget*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
2943 2943 <modify-argument index="1">
2944 2944 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2945 2945 </modify-argument>
2946 2946 </modify-function>
2947 2947 <modify-function signature="addWidget(QWidget*)">
2948 2948 <modify-argument index="1">
2949 2949 <reference-count declare-variable="QLayout" action="add" variable-name="__rcWidgets"/>
2950 2950 </modify-argument>
2951 2951 </modify-function>
2952 2952 <modify-function signature="getItemPosition(int,int*,int*,int*,int*)">
2953 2953 <access modifier="private"/>
2954 2954 </modify-function>
2955 2955 </object-type>
2956 2956
2957 2957 <object-type name="QGraphicsView">
2958 2958 <extra-includes>
2959 2959 <include file-name="QPainterPath" location="global"/>
2960 2960 <include file-name="QVarLengthArray" location="global"/>
2961 2961 </extra-includes>
2962 2962 <modify-function signature="fitInView(const QGraphicsItem *, Qt::AspectRatioMode)">
2963 2963 <modify-argument index="1">
2964 2964 <no-null-pointer/>
2965 2965 </modify-argument>
2966 2966 </modify-function>
2967 2967 <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
2968 2968 <modify-function signature="setScene(QGraphicsScene*)">
2969 2969 <modify-argument index="1">
2970 2970 <reference-count action="set" variable-name="__rcScene"/>
2971 2971 </modify-argument>
2972 2972 </modify-function>
2973 2973 <modify-function signature="setupViewport(QWidget*)">
2974 2974 <modify-argument index="1">
2975 2975 <reference-count action="ignore"/>
2976 2976 </modify-argument>
2977 2977 </modify-function>
2978 2978
2979 2979 <modify-function signature="drawBackground(QPainter*,QRectF)">
2980 2980 <modify-argument index="1" invalidate-after-use="yes"/>
2981 2981 </modify-function>
2982 2982 <modify-function signature="drawForeground(QPainter*,QRectF)">
2983 2983 <modify-argument index="1" invalidate-after-use="yes"/>
2984 2984 </modify-function>
2985 2985 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
2986 2986 <modify-argument index="1" invalidate-after-use="yes"/>
2987 2987 </modify-function>
2988 2988
2989 2989 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*)">
2990 2990 <modify-argument index="2">
2991 2991 <remove-argument/>
2992 2992 <conversion-rule class="shell">
2993 2993 // nothing
2994 2994 </conversion-rule>
2995 2995 <conversion-rule class="native">
2996 2996 <insert-template name="core.get_array_length">
2997 2997 <replace from="%ARRAY" to="%3"/>
2998 2998 </insert-template>
2999 2999 int __length = %out;
3000 3000 </conversion-rule>
3001 3001 </modify-argument>
3002 3002
3003 3003 <modify-argument index="3">
3004 3004 <replace-type modified-type="com.trolltech.qt.gui.QGraphicsItemInterface[]"/>
3005 3005 <conversion-rule class="shell">
3006 3006 <insert-template name="gui.convert_graphicsitem_array_to_java">
3007 3007 <replace from="%LENGTH" to="%2"/>
3008 3008 </insert-template>
3009 3009 jobjectArray graphicsItemArrayHolder = %out;
3010 3010 </conversion-rule>
3011 3011 <conversion-rule class="native">
3012 3012 <insert-template name="gui.convert_graphicsitem_array_from_java"/>
3013 3013 </conversion-rule>
3014 3014 </modify-argument>
3015 3015
3016 3016 <modify-argument index="4">
3017 3017 <replace-type modified-type="com.trolltech.qt.gui.QStyleOptionGraphicsItem[]"/>
3018 3018 <conversion-rule class="shell">
3019 3019 <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
3020 3020 <replace from="%LENGTH" to="%2"/>
3021 3021 </insert-template>
3022 3022 jobjectArray styleOptionArrayHolder = %out;
3023 3023 </conversion-rule>
3024 3024 <conversion-rule class="native">
3025 3025 <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
3026 3026 </conversion-rule>
3027 3027 </modify-argument>
3028 3028
3029 3029 <modify-argument index="return">
3030 3030 <conversion-rule class="shell">
3031 3031 qtjambi_invalidate_array(__jni_env, styleOptionArrayHolder);
3032 3032 qtjambi_invalidate_array(__jni_env, graphicsItemArrayHolder);
3033 3033 </conversion-rule>
3034 3034 </modify-argument>
3035 3035
3036 3036 </modify-function>
3037 3037 </object-type>
3038 3038
3039 3039 <object-type name="QInputDialog">
3040 3040
3041 3041 <modify-function signature="getInt(QWidget*,QString,QString,int,int,int,int,bool*,QFlags&lt;Qt::WindowType&gt;)">
3042 3042 <rename to="getInt_private"/>
3043 3043 <access modifier="private"/>
3044 3044 <modify-argument index="4">
3045 3045 <remove-default-expression/>
3046 3046 </modify-argument>
3047 3047 <modify-argument index="5">
3048 3048 <remove-default-expression/>
3049 3049 </modify-argument>
3050 3050 <modify-argument index="6">
3051 3051 <remove-default-expression/>
3052 3052 </modify-argument>
3053 3053 <modify-argument index="7">
3054 3054 <remove-default-expression/>
3055 3055 </modify-argument>
3056 3056 <modify-argument index="8">
3057 3057 <remove-default-expression/>
3058 3058 </modify-argument>
3059 3059 <modify-argument index="9">
3060 3060 <remove-default-expression/>
3061 3061 </modify-argument>
3062 3062 </modify-function>
3063 3063
3064 3064 <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3065 3065 <rename to="getDouble_internal"/>
3066 3066 <access modifier="private"/>
3067 3067 <modify-argument index="4">
3068 3068 <remove-default-expression/>
3069 3069 </modify-argument>
3070 3070 <modify-argument index="5">
3071 3071 <remove-default-expression/>
3072 3072 </modify-argument>
3073 3073 <modify-argument index="6">
3074 3074 <remove-default-expression/>
3075 3075 </modify-argument>
3076 3076 <modify-argument index="7">
3077 3077 <remove-default-expression/>
3078 3078 </modify-argument>
3079 3079 <modify-argument index="8">
3080 3080 <remove-default-expression/>
3081 3081 </modify-argument>
3082 3082 <modify-argument index="9">
3083 3083 <remove-default-expression/>
3084 3084 </modify-argument>
3085 3085 </modify-function>
3086 3086
3087 3087 <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3088 3088 <rename to="getInteger_internal"/>
3089 3089 <access modifier="private"/>
3090 3090 <modify-argument index="4">
3091 3091 <remove-default-expression/>
3092 3092 </modify-argument>
3093 3093 <modify-argument index="5">
3094 3094 <remove-default-expression/>
3095 3095 </modify-argument>
3096 3096 <modify-argument index="6">
3097 3097 <remove-default-expression/>
3098 3098 </modify-argument>
3099 3099 <modify-argument index="7">
3100 3100 <remove-default-expression/>
3101 3101 </modify-argument>
3102 3102 <modify-argument index="8">
3103 3103 <remove-default-expression/>
3104 3104 </modify-argument>
3105 3105 <modify-argument index="9">
3106 3106 <remove-default-expression/>
3107 3107 </modify-argument>
3108 3108 </modify-function>
3109 3109
3110 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 3111 <rename to="getItem_internal"/>
3112 3112 <access modifier="private"/>
3113 3113 <modify-argument index="4">
3114 3114 <remove-default-expression/>
3115 3115 </modify-argument>
3116 3116 <modify-argument index="5">
3117 3117 <remove-default-expression/>
3118 3118 </modify-argument>
3119 3119 <modify-argument index="6">
3120 3120 <remove-default-expression/>
3121 3121 </modify-argument>
3122 3122 <modify-argument index="7">
3123 3123 <remove-default-expression/>
3124 3124 </modify-argument>
3125 3125 <modify-argument index="8">
3126 3126 <remove-default-expression/>
3127 3127 </modify-argument>
3128 3128 </modify-function>
3129 3129
3130 3130 <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
3131 3131 <rename to="getText_internal"/>
3132 3132 <access modifier="private"/>
3133 3133 <modify-argument index="4">
3134 3134 <remove-default-expression/>
3135 3135 </modify-argument>
3136 3136 <modify-argument index="5">
3137 3137 <remove-default-expression/>
3138 3138 </modify-argument>
3139 3139 <modify-argument index="6">
3140 3140 <remove-default-expression/>
3141 3141 </modify-argument>
3142 3142 <modify-argument index="7">
3143 3143 <remove-default-expression/>
3144 3144 </modify-argument>
3145 3145 </modify-function>
3146 3146
3147 3147 <inject-code class="native" position="beginning">
3148 3148 Q_DECLARE_METATYPE(QScriptValue)
3149 3149 </inject-code>
3150 3150 <modify-function signature="getDouble(QWidget *, const QString &amp;, const QString &amp;, double, double, double, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3151 3151 <modify-argument index="8">
3152 3152 <remove-argument/>
3153 3153 <conversion-rule class="native">
3154 3154 <insert-template name="core.prepare_removed_bool*_argument"/>
3155 3155 </conversion-rule>
3156 3156 </modify-argument>
3157 3157 <modify-argument index="return">
3158 3158 <conversion-rule class="native">
3159 3159 <insert-template name="core.convert_to_null_or_primitive"/>
3160 3160 </conversion-rule>
3161 3161 </modify-argument>
3162 3162 </modify-function>
3163 3163
3164 3164 <modify-function signature="getInteger(QWidget *, const QString &amp;, const QString &amp;, int, int, int, int, bool *, QFlags&lt;Qt::WindowType&gt;)">
3165 3165 <modify-argument index="8">
3166 3166 <remove-argument/>
3167 3167 <conversion-rule class="native">
3168 3168 <insert-template name="core.prepare_removed_bool*_argument"/>
3169 3169 </conversion-rule>
3170 3170 </modify-argument>
3171 3171 <modify-argument index="return">
3172 3172 <conversion-rule class="native">
3173 3173 <insert-template name="core.convert_to_null_or_primitive"/>
3174 3174 </conversion-rule>
3175 3175 </modify-argument>
3176 3176 </modify-function>
3177 3177
3178 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 3179 <modify-argument index="7">
3180 3180 <remove-argument/>
3181 3181 <conversion-rule class="native">
3182 3182 <insert-template name="core.prepare_removed_bool*_argument"/>
3183 3183 </conversion-rule>
3184 3184 </modify-argument>
3185 3185 <modify-argument index="return">
3186 3186 <conversion-rule class="native">
3187 3187 <insert-template name="core.convert_to_null_or_primitive"/>
3188 3188 </conversion-rule>
3189 3189 </modify-argument>
3190 3190 </modify-function>
3191 3191
3192 3192 <modify-function signature="getText(QWidget *, const QString &amp;, const QString &amp;, QLineEdit::EchoMode, const QString &amp;, bool *, QFlags&lt;Qt::WindowType&gt;)">
3193 3193 <modify-argument index="6">
3194 3194 <remove-argument/>
3195 3195 <conversion-rule class="native">
3196 3196 <insert-template name="core.prepare_removed_bool*_argument"/>
3197 3197 </conversion-rule>
3198 3198 </modify-argument>
3199 3199 <modify-argument index="return">
3200 3200 <conversion-rule class="native">
3201 3201 <insert-template name="core.convert_to_null_or_primitive"/>
3202 3202 </conversion-rule>
3203 3203 </modify-argument>
3204 3204 </modify-function>
3205 3205 </object-type>
3206 3206
3207 3207
3208 3208 <object-type name="QGraphicsScene">
3209 3209 <extra-includes>
3210 3210 <include file-name="QVarLengthArray" location="global"/>
3211 3211 </extra-includes>
3212 3212
3213 3213 <modify-function signature="contextMenuEvent(QGraphicsSceneContextMenuEvent*)">
3214 3214 <modify-argument index="1" invalidate-after-use="yes"/>
3215 3215 </modify-function>
3216 3216 <modify-function signature="dragEnterEvent(QGraphicsSceneDragDropEvent*)">
3217 3217 <modify-argument index="1" invalidate-after-use="yes"/>
3218 3218 </modify-function>
3219 3219 <modify-function signature="dragLeaveEvent(QGraphicsSceneDragDropEvent*)">
3220 3220 <modify-argument index="1" invalidate-after-use="yes"/>
3221 3221 </modify-function>
3222 3222 <modify-function signature="dragMoveEvent(QGraphicsSceneDragDropEvent*)">
3223 3223 <modify-argument index="1" invalidate-after-use="yes"/>
3224 3224 </modify-function>
3225 3225 <modify-function signature="drawBackground(QPainter*,QRectF)">
3226 3226 <modify-argument index="1" invalidate-after-use="yes"/>
3227 3227 </modify-function>
3228 3228 <modify-function signature="drawForeground(QPainter*,QRectF)">
3229 3229 <modify-argument index="1" invalidate-after-use="yes"/>
3230 3230 </modify-function>
3231 3231 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
3232 3232 <modify-argument index="1" invalidate-after-use="yes"/>
3233 3233 </modify-function>
3234 3234 <modify-function signature="dropEvent(QGraphicsSceneDragDropEvent*)">
3235 3235 <modify-argument index="1" invalidate-after-use="yes"/>
3236 3236 </modify-function>
3237 3237 <modify-function signature="focusInEvent(QFocusEvent*)">
3238 3238 <modify-argument index="1" invalidate-after-use="yes"/>
3239 3239 </modify-function>
3240 3240 <modify-function signature="focusOutEvent(QFocusEvent*)">
3241 3241 <modify-argument index="1" invalidate-after-use="yes"/>
3242 3242 </modify-function>
3243 3243 <modify-function signature="helpEvent(QGraphicsSceneHelpEvent*)">
3244 3244 <modify-argument index="1" invalidate-after-use="yes"/>
3245 3245 </modify-function>
3246 3246 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
3247 3247 <modify-argument index="1" invalidate-after-use="yes"/>
3248 3248 </modify-function>
3249 3249 <modify-function signature="keyPressEvent(QKeyEvent*)">
3250 3250 <modify-argument index="1" invalidate-after-use="yes"/>
3251 3251 </modify-function>
3252 3252 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
3253 3253 <modify-argument index="1" invalidate-after-use="yes"/>
3254 3254 </modify-function>
3255 3255 <modify-function signature="mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)">
3256 3256 <modify-argument index="1" invalidate-after-use="yes"/>
3257 3257 </modify-function>
3258 3258 <modify-function signature="mouseMoveEvent(QGraphicsSceneMouseEvent*)">
3259 3259 <modify-argument index="1" invalidate-after-use="yes"/>
3260 3260 </modify-function>
3261 3261 <modify-function signature="mousePressEvent(QGraphicsSceneMouseEvent*)">
3262 3262 <modify-argument index="1" invalidate-after-use="yes"/>
3263 3263 </modify-function>
3264 3264 <modify-function signature="mouseReleaseEvent(QGraphicsSceneMouseEvent*)">
3265 3265 <modify-argument index="1" invalidate-after-use="yes"/>
3266 3266 </modify-function>
3267 3267 <modify-function signature="wheelEvent(QGraphicsSceneWheelEvent*)">
3268 3268 <modify-argument index="1" invalidate-after-use="yes"/>
3269 3269 </modify-function>
3270 3270
3271 3271 <modify-function signature="setActiveWindow(QGraphicsWidget*)">
3272 3272 <modify-argument index="1">
3273 3273 <reference-count action="ignore"/>
3274 3274 </modify-argument>
3275 3275 </modify-function>
3276 3276 <modify-function signature="setStyle(QStyle*)">
3277 3277 <modify-argument index="1">
3278 3278 <reference-count action="ignore"/>
3279 3279 </modify-argument>
3280 3280 </modify-function>
3281 3281
3282 3282 <modify-function signature="addItem(QGraphicsItem *)">
3283 3283 <modify-argument index="1">
3284 3284 <define-ownership class="java" owner="c++"/>
3285 3285 </modify-argument>
3286 3286 </modify-function>
3287 3287 <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
3288 3288 <modify-argument index="return">
3289 3289 <define-ownership class="java" owner="c++"/>
3290 3290 </modify-argument>
3291 3291 </modify-function>
3292 3292 <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)">
3293 3293 <modify-argument index="return">
3294 3294 <define-ownership class="java" owner="c++"/>
3295 3295 </modify-argument>
3296 3296 </modify-function>
3297 3297 <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)">
3298 3298 <modify-argument index="return">
3299 3299 <define-ownership class="java" owner="c++"/>
3300 3300 </modify-argument>
3301 3301 </modify-function>
3302 3302 <modify-function signature="addPixmap(const QPixmap &amp;)">
3303 3303 <modify-argument index="return">
3304 3304 <define-ownership class="java" owner="c++"/>
3305 3305 </modify-argument>
3306 3306 </modify-function>
3307 3307 <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)">
3308 3308 <modify-argument index="return">
3309 3309 <define-ownership class="java" owner="c++"/>
3310 3310 </modify-argument>
3311 3311 </modify-function>
3312 3312 <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)">
3313 3313 <modify-argument index="return">
3314 3314 <define-ownership class="java" owner="c++"/>
3315 3315 </modify-argument>
3316 3316 </modify-function>
3317 3317 <modify-function signature="addText(const QString &amp;, const QFont &amp;)">
3318 3318 <modify-argument index="return">
3319 3319 <define-ownership class="java" owner="c++"/>
3320 3320 </modify-argument>
3321 3321 </modify-function>
3322 3322 <modify-function signature="addWidget(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3323 3323 <modify-argument index="return">
3324 3324 <define-ownership class="java" owner="c++"/>
3325 3325 </modify-argument>
3326 3326 <modify-argument index="1">
3327 3327 <define-ownership class="java" owner="c++"/>
3328 3328 </modify-argument>
3329 3329 </modify-function>
3330 3330 <modify-function signature="removeItem(QGraphicsItem*)">
3331 3331 <modify-argument index="1">
3332 3332 <define-ownership class="java" owner="default"/>
3333 3333 </modify-argument>
3334 3334 </modify-function>
3335 3335 <modify-function signature="setFocusItem(QGraphicsItem*,Qt::FocusReason)">
3336 3336 <modify-argument index="1">
3337 3337 <reference-count action="set" variable-name="__rcFocusItem"/>
3338 3338 </modify-argument>
3339 3339 </modify-function>
3340 3340 </object-type>
3341 3341
3342 3342
3343 3343 <object-type name="QCalendarWidget">
3344 3344 <extra-includes>
3345 3345 <include file-name="QTextCharFormat" location="global"/>
3346 3346 </extra-includes>
3347 3347
3348 3348 <modify-function signature="isHeaderVisible()const" remove="all"/> <!--### Obsolete in 4.3-->
3349 3349 <modify-function signature="setHeaderVisible(bool)" remove="all"/> <!--### Obsolete in 4.3-->
3350 3350
3351 3351 <modify-function signature="paintCell(QPainter*,QRect,QDate)const">
3352 3352 <modify-argument invalidate-after-use="yes" index="1"/>
3353 3353 </modify-function>
3354 3354
3355 3355 <modify-function signature="sizeHint()const" rename="getSizeHint"/>
3356 3356 <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
3357 3357 </object-type>
3358 3358
3359 3359 <object-type name="QTreeWidget">
3360 3360 <modify-function signature="setSelectionModel(QItemSelectionModel*)">
3361 3361 <modify-argument index="1">
3362 3362 <no-null-pointer/>
3363 3363 <reference-count declare-variable="QAbstractItemView" action="set" variable-name="__rcItemSelectionModel"/>
3364 3364 </modify-argument>
3365 3365 </modify-function>
3366 3366 <modify-function signature="removeItemWidget(QTreeWidgetItem*,int)">
3367 3367 <modify-argument index="1">
3368 3368 <reference-count action="ignore"/>
3369 3369 </modify-argument>
3370 3370 </modify-function>
3371 3371 <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const">
3372 3372 <modify-argument index="1" invalidate-after-use="yes"/>
3373 3373 </modify-function>
3374 3374 <modify-function signature="dropMimeData(QTreeWidgetItem*,int,const QMimeData*,Qt::DropAction)">
3375 3375 <modify-argument index="1" invalidate-after-use="yes"/>
3376 3376 </modify-function>
3377 3377 <modify-function signature="isSortingEnabled()const" remove="all"/>
3378 3378 <modify-function signature="setSortingEnabled(bool)" remove="all"/>
3379 3379 <modify-function signature="indexOfTopLevelItem(QTreeWidgetItem *)">
3380 3380 <remove/>
3381 3381 </modify-function>
3382 3382 <modify-function signature="addTopLevelItem(QTreeWidgetItem *)">
3383 3383 <modify-argument index="1">
3384 3384 <define-ownership class="java" owner="c++"/>
3385 3385 </modify-argument>
3386 3386 </modify-function>
3387 3387 <modify-function signature="takeTopLevelItem(int)">
3388 3388 <modify-argument index="return">
3389 3389 <define-ownership class="java" owner="default"/>
3390 3390 </modify-argument>
3391 3391 </modify-function>
3392 3392 <modify-function signature="addTopLevelItems(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3393 3393 <modify-argument index="1">
3394 3394 <define-ownership class="java" owner="c++"/>
3395 3395 </modify-argument>
3396 3396 </modify-function>
3397 3397 <modify-function signature="insertTopLevelItem(int, QTreeWidgetItem *)">
3398 3398 <modify-argument index="2">
3399 3399 <define-ownership class="java" owner="c++"/>
3400 3400 </modify-argument>
3401 3401 </modify-function>
3402 3402 <modify-function signature="insertTopLevelItems(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3403 3403 <modify-argument index="2">
3404 3404 <define-ownership class="java" owner="c++"/>
3405 3405 </modify-argument>
3406 3406 </modify-function>
3407 3407 <modify-function signature="setHeaderItem(QTreeWidgetItem *)">
3408 3408 <modify-argument index="1">
3409 3409 <define-ownership class="java" owner="c++"/>
3410 3410 </modify-argument>
3411 3411 </modify-function>
3412 3412 <modify-function signature="takeTopLevelItem(int)">
3413 3413 <modify-argument index="return">
3414 3414 <define-ownership class="java" owner="default"/>
3415 3415 </modify-argument>
3416 3416 </modify-function>
3417 3417 <modify-function signature="setCurrentItem(QTreeWidgetItem*,int,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
3418 3418 <modify-argument index="1">
3419 3419 <reference-count action="ignore"/>
3420 3420 </modify-argument>
3421 3421 </modify-function>
3422 3422 <modify-function signature="setFirstItemColumnSpanned(const QTreeWidgetItem*,bool)">
3423 3423 <modify-argument index="1">
3424 3424 <reference-count action="ignore"/>
3425 3425 </modify-argument>
3426 3426 </modify-function>
3427 3427 <modify-function signature="setCurrentItem(QTreeWidgetItem*)">
3428 3428 <modify-argument index="1">
3429 3429 <reference-count action="ignore"/>
3430 3430 </modify-argument>
3431 3431 </modify-function>
3432 3432 <modify-function signature="setCurrentItem(QTreeWidgetItem*,int)">
3433 3433 <modify-argument index="1">
3434 3434 <reference-count action="ignore"/>
3435 3435 </modify-argument>
3436 3436 </modify-function>
3437 3437 <modify-function signature="setItemExpanded(const QTreeWidgetItem*,bool)">
3438 3438 <remove/>
3439 3439 </modify-function>
3440 3440 <modify-function signature="isItemExpanded(const QTreeWidgetItem*)const">
3441 3441 <remove/>
3442 3442 </modify-function>
3443 3443 <modify-function signature="setItemHidden(const QTreeWidgetItem*,bool)">
3444 3444 <remove/>
3445 3445 </modify-function>
3446 3446 <modify-function signature="isItemHidden(const QTreeWidgetItem*)const">
3447 3447 <remove/>
3448 3448 </modify-function>
3449 3449 <modify-function signature="isItemSelected(const QTreeWidgetItem*)const">
3450 3450 <remove/>
3451 3451 </modify-function>
3452 3452 <modify-function signature="setItemSelected(const QTreeWidgetItem*,bool)">
3453 3453 <remove/>
3454 3454 </modify-function>
3455 3455 <modify-function signature="setItemWidget(QTreeWidgetItem*,int,QWidget*)">
3456 3456 <modify-argument index="1">
3457 3457 <reference-count action="ignore"/>
3458 3458 </modify-argument>
3459 3459 <modify-argument index="3">
3460 3460 <reference-count action="ignore"/>
3461 3461 </modify-argument>
3462 3462 </modify-function>
3463 3463 <modify-function signature="setModel(QAbstractItemModel*)">
3464 3464 <modify-argument index="1">
3465 3465 <reference-count action="ignore"/>
3466 3466 </modify-argument>
3467 3467 </modify-function>
3468 3468
3469 3469 <modify-function signature="items(const QMimeData*)const" remove="all"/> <!--### Obsolete in 4.3-->
3470 3470
3471 3471 <modify-function signature="mimeData(const QList&lt;QTreeWidgetItem*&gt;)const" remove="all"/>
3472 3472 </object-type>
3473 3473
3474 3474 <object-type name="QAbstractItemDelegate">
3475 3475 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
3476 3476 <modify-argument index="1">
3477 3477 <!-- Safe to ignore because this implementation is documented to do nothing -->
3478 3478 <reference-count action="ignore"/>
3479 3479 </modify-argument>
3480 3480 </modify-function>
3481 3481 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
3482 3482 <modify-argument index="1">
3483 3483 <reference-count action="ignore"/>
3484 3484 </modify-argument>
3485 3485 <modify-argument index="2">
3486 3486 <reference-count action="ignore"/>
3487 3487 </modify-argument>
3488 3488 </modify-function>
3489 3489
3490 3490 <modify-function signature="paint(QPainter*,QStyleOptionViewItem,QModelIndex)const">
3491 3491 <modify-argument index="1" invalidate-after-use="yes"/>
3492 3492 </modify-function>
3493 3493 <modify-function signature="editorEvent(QEvent*,QAbstractItemModel*,QStyleOptionViewItem,QModelIndex)">
3494 3494 <modify-argument index="1" invalidate-after-use="yes"/>
3495 3495 </modify-function>
3496 3496
3497 3497 <modify-function signature="elidedText(QFontMetrics, int, Qt::TextElideMode, QString)" remove="all"/> <!--### Obsolete in 4.3-->
3498 3498 </object-type>
3499 3499
3500 3500 <object-type name="QTableWidgetItem" delete-in-main-thread="yes">
3501 3501 <modify-function signature="operator=(const QTableWidgetItem&amp;)" remove="all"/>
3502 3502 <modify-function signature="clone() const">
3503 3503 <modify-argument index="return">
3504 3504 <define-ownership class="shell" owner="c++"/>
3505 3505 </modify-argument>
3506 3506 </modify-function>
3507 3507
3508 3508 <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3509 3509 <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3510 3510 <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3511 3511 <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3512 3512
3513 3513 <modify-function signature="operator&lt;(QTableWidgetItem)const">
3514 3514 <modify-argument index="1" invalidate-after-use="yes"/>
3515 3515 </modify-function>
3516 3516 <modify-function signature="read(QDataStream&amp;)">
3517 3517 <modify-argument index="1" invalidate-after-use="yes"/>
3518 3518 </modify-function>
3519 3519 <modify-function signature="write(QDataStream&amp;)const">
3520 3520 <modify-argument index="1" invalidate-after-use="yes"/>
3521 3521 </modify-function>
3522 3522
3523 3523
3524 3524 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3525 3525 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3526 3526 <modify-function signature="QTableWidgetItem(QTableWidgetItem)" remove="all"/>
3527 3527 <modify-function signature="operator=(QTableWidgetItem)" remove="all"/>
3528 3528 <modify-function signature="operator&lt;(QTableWidgetItem)const" remove="all"/>
3529 3529 </object-type>
3530 3530
3531 3531 <object-type name="QListWidgetItem" delete-in-main-thread="yes">
3532 3532
3533 3533 <modify-function signature="operator&lt;(QListWidgetItem)const">
3534 3534 <modify-argument index="1" invalidate-after-use="yes"/>
3535 3535 </modify-function>
3536 3536 <modify-function signature="read(QDataStream&amp;)">
3537 3537 <modify-argument index="1" invalidate-after-use="yes"/>
3538 3538 </modify-function>
3539 3539 <modify-function signature="write(QDataStream&amp;)const">
3540 3540 <modify-argument index="1" invalidate-after-use="yes"/>
3541 3541 </modify-function>
3542 3542
3543 3543
3544 3544 <modify-function signature="operator=(const QListWidgetItem&amp;)" remove="all"/>
3545 3545 <modify-function signature="QListWidgetItem(QListWidget *, int)">
3546 3546 <modify-argument index="this">
3547 3547 <define-ownership class="java" owner="c++"/>
3548 3548 </modify-argument>
3549 3549 </modify-function>
3550 3550 <modify-function signature="QListWidgetItem(const QString &amp;, QListWidget *, int)">
3551 3551 <modify-argument index="this">
3552 3552 <define-ownership class="java" owner="c++"/>
3553 3553 </modify-argument>
3554 3554 </modify-function>
3555 3555 <modify-function signature="QListWidgetItem(const QIcon &amp;, const QString &amp;, QListWidget *, int)">
3556 3556 <modify-argument index="this">
3557 3557 <define-ownership class="java" owner="c++"/>
3558 3558 </modify-argument>
3559 3559 </modify-function>
3560 3560 <modify-function signature="clone() const">
3561 3561 <modify-argument index="return">
3562 3562 <define-ownership class="shell" owner="c++"/>
3563 3563 </modify-argument>
3564 3564 </modify-function>
3565 3565
3566 3566 <modify-function signature="backgroundColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3567 3567 <modify-function signature="setBackgroundColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3568 3568 <modify-function signature="setTextColor(QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3569 3569 <modify-function signature="textColor()const" remove="all"/> <!--### Obsolete in 4.3-->
3570 3570
3571 3571 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3572 3572 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3573 3573 <modify-function signature="QListWidgetItem(QListWidgetItem)" remove="all"/>
3574 3574 <modify-function signature="operator=(QListWidgetItem)" remove="all"/>
3575 3575 <modify-function signature="operator&lt;(QListWidgetItem)const" remove="all"/>
3576 3576 </object-type>
3577 3577
3578 3578 <object-type name="QGraphicsTextItem" polymorphic-id-expression="%1-&gt;type() == QGraphicsTextItem::Type"> <!-- a QObject so main-thread delete redundant -->
3579 3579 <extra-includes>
3580 3580 <include file-name="QTextCursor" location="global"/>
3581 3581 </extra-includes>
3582 3582 <modify-function signature="QGraphicsTextItem(QGraphicsItem*,QGraphicsScene*)">
3583 3583 <inject-code position="end">
3584 3584 <argument-map index="1" meta-name="%1"/>
3585 3585 if (%1 != null) disableGarbageCollection();
3586 3586 </inject-code>
3587 3587 </modify-function>
3588 3588 <modify-function signature="QGraphicsTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
3589 3589 <inject-code position="end">
3590 3590 <argument-map index="2" meta-name="%2"/>
3591 3591 if (%2 != null) disableGarbageCollection();
3592 3592 </inject-code>
3593 3593 </modify-function>
3594 3594 <modify-function signature="setDocument(QTextDocument*)">
3595 3595 <modify-argument index="1">
3596 3596 <reference-count action="set" variable-name="__rcDocument"/>
3597 3597 </modify-argument>
3598 3598 </modify-function>
3599 3599
3600 3600 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
3601 3601 <modify-function signature="resetMatrix()" remove="all"/> <!--### Obsolete in 4.3-->
3602 3602 <modify-function signature="sceneMatrix()const" remove="all"/> <!--### Obsolete in 4.3-->
3603 3603 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
3604 3604 </object-type>
3605 3605
3606 3606 <object-type name="QCompleter">
3607 3607 <modify-function signature="activated(const QModelIndex &amp;)">
3608 3608 <rename to="activatedIndex"/>
3609 3609 </modify-function>
3610 3610 <modify-function signature="highlighted(const QModelIndex &amp;)">
3611 3611 <rename to="highlightedIndex"/>
3612 3612 </modify-function>
3613 3613 <modify-function signature="setModel(QAbstractItemModel *)">
3614 3614 <modify-argument index="1">
3615 3615 <reference-count action="set" variable-name="__rcModel"/>
3616 3616 </modify-argument>
3617 3617 </modify-function>
3618 3618 <modify-function signature="setPopup(QAbstractItemView *)">
3619 3619 <modify-argument index="1">
3620 3620 <no-null-pointer/>
3621 3621 <define-ownership class="java" owner="c++"/>
3622 3622 </modify-argument>
3623 3623 </modify-function>
3624 3624 <modify-function signature="setWidget(QWidget *)">
3625 3625 <modify-argument index="1">
3626 3626 <reference-count action="set" variable-name="__rcWidget"/>
3627 3627 </modify-argument>
3628 3628 </modify-function>
3629 3629 </object-type>
3630 3630
3631 3631
3632 3632 <object-type name="QTreeWidgetItem" delete-in-main-thread="yes">
3633 3633
3634 3634 <modify-function signature="operator&lt;(QTreeWidgetItem)const">
3635 3635 <modify-argument index="1" invalidate-after-use="yes"/>
3636 3636 </modify-function>
3637 3637 <modify-function signature="read(QDataStream&amp;)">
3638 3638 <modify-argument index="1" invalidate-after-use="yes"/>
3639 3639 </modify-function>
3640 3640 <modify-function signature="write(QDataStream&amp;)const">
3641 3641 <modify-argument index="1" invalidate-after-use="yes"/>
3642 3642 </modify-function>
3643 3643
3644 3644 <modify-function signature="QTreeWidgetItem(const QTreeWidgetItem &amp;)" remove="all"/>
3645 3645 <modify-function signature="operator=(const QTreeWidgetItem&amp;)" remove="all"/>
3646 3646
3647 3647 <modify-function signature="QTreeWidgetItem(QTreeWidget *,int)">
3648 3648 <modify-argument index="this">
3649 3649 <define-ownership class="java" owner="c++"/>
3650 3650 </modify-argument>
3651 3651 </modify-function>
3652 3652 <modify-function signature="QTreeWidgetItem(QTreeWidget *,const QStringList&lt;QString&gt; &amp;,int)">
3653 3653 <modify-argument index="this">
3654 3654 <define-ownership class="java" owner="c++"/>
3655 3655 </modify-argument>
3656 3656 </modify-function>
3657 3657 <modify-function signature="QTreeWidgetItem(QTreeWidget *,QTreeWidgetItem *,int)">
3658 3658 <modify-argument index="this">
3659 3659 <define-ownership class="java" owner="c++"/>
3660 3660 </modify-argument>
3661 3661 </modify-function>
3662 3662 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,int)">
3663 3663 <modify-argument index="this">
3664 3664 <define-ownership class="java" owner="c++"/>
3665 3665 </modify-argument>
3666 3666 </modify-function>
3667 3667 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,const QStringList&lt;QString&gt; &amp;,int)">
3668 3668 <modify-argument index="this">
3669 3669 <define-ownership class="java" owner="c++"/>
3670 3670 </modify-argument>
3671 3671 </modify-function>
3672 3672 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem *,QTreeWidgetItem *,int)">
3673 3673 <modify-argument index="this">
3674 3674 <define-ownership class="java" owner="c++"/>
3675 3675 </modify-argument>
3676 3676 </modify-function>
3677 3677 <modify-function signature="clone() const">
3678 3678 <modify-argument index="return">
3679 3679 <define-ownership class="shell" owner="c++"/>
3680 3680 </modify-argument>
3681 3681 </modify-function>
3682 3682 <modify-function signature="addChild(QTreeWidgetItem *)">
3683 3683 <modify-argument index="1">
3684 3684 <define-ownership class="java" owner="c++"/>
3685 3685 </modify-argument>
3686 3686 </modify-function>
3687 3687 <modify-function signature="addChildren(const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3688 3688 <modify-argument index="1">
3689 3689 <define-ownership class="java" owner="c++"/>
3690 3690 </modify-argument>
3691 3691 </modify-function>
3692 3692 <modify-function signature="insertChild(int, QTreeWidgetItem *)">
3693 3693 <modify-argument index="2">
3694 3694 <define-ownership class="java" owner="c++"/>
3695 3695 </modify-argument>
3696 3696 </modify-function>
3697 3697 <modify-function signature="insertChildren(int, const QList&lt;QTreeWidgetItem*&gt; &amp;)">
3698 3698 <modify-argument index="2">
3699 3699 <define-ownership class="java" owner="c++"/>
3700 3700 </modify-argument>
3701 3701 </modify-function>
3702 3702 <modify-function signature="removeChild(QTreeWidgetItem*)">
3703 3703 <modify-argument index="1">
3704 3704 <define-ownership class="java" owner="default"/>
3705 3705 </modify-argument>
3706 3706 </modify-function>
3707 3707 <modify-function signature="takeChild(int)">
3708 3708 <modify-argument index="return">
3709 3709 <define-ownership class="java" owner="default"/>
3710 3710 </modify-argument>
3711 3711 </modify-function>
3712 3712 <modify-function signature="takeChildren()">
3713 3713 <modify-argument index="return">
3714 3714 <define-ownership class="java" owner="default"/>
3715 3715 </modify-argument>
3716 3716 </modify-function>
3717 3717
3718 3718 <modify-function signature="backgroundColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3719 3719 <modify-function signature="setBackgroundColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3720 3720 <modify-function signature="setTextColor(int, QColor)" remove="all"/> <!--### Obsolete in 4.3-->
3721 3721 <modify-function signature="textColor(int)const" remove="all"/> <!--### Obsolete in 4.3-->
3722 3722
3723 3723 <modify-function signature="read(QDataStream &amp;)" remove="all"/>
3724 3724 <modify-function signature="write(QDataStream &amp;)const" remove="all"/>
3725 3725 <modify-function signature="QTreeWidgetItem(QTreeWidgetItem)" remove="all"/>
3726 3726 <modify-function signature="operator=(QTreeWidgetItem)" remove="all"/>
3727 3727 <modify-function signature="operator&lt;(QTreeWidgetItem)const" remove="all"/>
3728 3728 </object-type>
3729 3729
3730 3730 <object-type name="QListWidget">
3731 3731 <modify-function signature="mimeData(const QList&lt;QListWidgetItem *&gt;)const">
3732 3732 <modify-argument index="1" invalidate-after-use="yes"/>
3733 3733 </modify-function>
3734 3734 <modify-function signature="addItem(QListWidgetItem *)">
3735 3735 <modify-argument index="1">
3736 3736 <define-ownership class="java" owner="c++"/>
3737 3737 </modify-argument>
3738 3738 </modify-function>
3739 3739 <modify-function signature="insertItem(int, QListWidgetItem *)">
3740 3740 <modify-argument index="2">
3741 3741 <define-ownership class="java" owner="c++"/>
3742 3742 </modify-argument>
3743 3743 </modify-function>
3744 3744 <modify-function signature="setCurrentItem(QListWidgetItem*)">
3745 3745 <modify-argument index="1">
3746 3746 <reference-count action="ignore"/>
3747 3747 </modify-argument>
3748 3748 </modify-function>
3749 3749 <modify-function signature="setCurrentItem(QListWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
3750 3750 <modify-argument index="1">
3751 3751 <reference-count action="ignore"/>
3752 3752 </modify-argument>
3753 3753 </modify-function>
3754 3754 <modify-function signature="setItemHidden(const QListWidgetItem*,bool)">
3755 3755 <remove/>
3756 3756 </modify-function>
3757 3757 <modify-function signature="isItemHidden(const QListWidgetItem*)const">
3758 3758 <remove/>
3759 3759 </modify-function>
3760 3760 <modify-function signature="setItemSelected(const QListWidgetItem*,bool)">
3761 3761 <remove/>
3762 3762 </modify-function>
3763 3763 <modify-function signature="isItemSelected(const QListWidgetItem*)const">
3764 3764 <remove/>
3765 3765 </modify-function>
3766 3766 <modify-function signature="takeItem(int)">
3767 3767 <modify-argument index="return">
3768 3768 <define-ownership class="java" owner="default"/>
3769 3769 </modify-argument>
3770 3770 </modify-function>
3771 3771 <modify-function signature="setItemWidget(QListWidgetItem*,QWidget*)">
3772 3772 <modify-argument index="1">
3773 3773 <reference-count action="ignore"/>
3774 3774 </modify-argument>
3775 3775 <modify-argument index="2">
3776 3776 <reference-count action="ignore"/>
3777 3777 </modify-argument>
3778 3778 </modify-function>
3779 3779 <modify-function signature="removeItemWidget(QListWidgetItem*)">
3780 3780 <modify-argument index="1">
3781 3781 <reference-count action="ignore"/>
3782 3782 </modify-argument>
3783 3783 </modify-function>
3784 3784 <modify-function signature="setModel(QAbstractItemModel*)">
3785 3785 <modify-argument index="1">
3786 3786 <reference-count action="ignore"/>
3787 3787 </modify-argument>
3788 3788 </modify-function>
3789 3789
3790 3790
3791 3791 <modify-function signature="mimeData(const QList&lt;QListWidgetItem*&gt;)const" remove="all"/>
3792 3792 </object-type>
3793 3793
3794 3794 <object-type name="QWidget">
3795 3795 <extra-includes>
3796 3796 <include file-name="QIcon" location="global"/>
3797 3797 <include file-name="QMessageBox" location="global"/>
3798 3798 </extra-includes>
3799 3799
3800 3800 <modify-function signature="actionEvent(QActionEvent*)">
3801 3801 <modify-argument index="1" invalidate-after-use="yes"/>
3802 3802 </modify-function>
3803 3803 <modify-function signature="changeEvent(QEvent*)">
3804 3804 <modify-argument index="1" invalidate-after-use="yes"/>
3805 3805 </modify-function>
3806 3806 <modify-function signature="closeEvent(QCloseEvent*)">
3807 3807 <modify-argument index="1" invalidate-after-use="yes"/>
3808 3808 </modify-function>
3809 3809 <modify-function signature="contextMenuEvent(QContextMenuEvent*)">
3810 3810 <modify-argument index="1" invalidate-after-use="yes"/>
3811 3811 </modify-function>
3812 3812 <modify-function signature="dragEnterEvent(QDragEnterEvent*)">
3813 3813 <modify-argument index="1" invalidate-after-use="yes"/>
3814 3814 </modify-function>
3815 3815 <modify-function signature="dragLeaveEvent(QDragLeaveEvent*)">
3816 3816 <modify-argument index="1" invalidate-after-use="yes"/>
3817 3817 </modify-function>
3818 3818 <modify-function signature="dragMoveEvent(QDragMoveEvent*)">
3819 3819 <modify-argument index="1" invalidate-after-use="yes"/>
3820 3820 </modify-function>
3821 3821 <modify-function signature="dropEvent(QDropEvent*)">
3822 3822 <modify-argument index="1" invalidate-after-use="yes"/>
3823 3823 </modify-function>
3824 3824 <modify-function signature="enterEvent(QEvent*)">
3825 3825 <modify-argument index="1" invalidate-after-use="yes"/>
3826 3826 </modify-function>
3827 3827 <modify-function signature="focusInEvent(QFocusEvent*)">
3828 3828 <modify-argument index="1" invalidate-after-use="yes"/>
3829 3829 </modify-function>
3830 3830 <modify-function signature="focusOutEvent(QFocusEvent*)">
3831 3831 <modify-argument index="1" invalidate-after-use="yes"/>
3832 3832 </modify-function>
3833 3833 <modify-function signature="hideEvent(QHideEvent*)">
3834 3834 <modify-argument index="1" invalidate-after-use="yes"/>
3835 3835 </modify-function>
3836 3836 <modify-function signature="inputMethodEvent(QInputMethodEvent*)">
3837 3837 <modify-argument index="1" invalidate-after-use="yes"/>
3838 3838 </modify-function>
3839 3839 <modify-function signature="keyPressEvent(QKeyEvent*)">
3840 3840 <modify-argument index="1" invalidate-after-use="yes"/>
3841 3841 </modify-function>
3842 3842 <modify-function signature="keyReleaseEvent(QKeyEvent*)">
3843 3843 <modify-argument index="1" invalidate-after-use="yes"/>
3844 3844 </modify-function>
3845 3845 <modify-function signature="leaveEvent(QEvent*)">
3846 3846 <modify-argument index="1" invalidate-after-use="yes"/>
3847 3847 </modify-function>
3848 3848 <modify-function signature="mouseDoubleClickEvent(QMouseEvent*)">
3849 3849 <modify-argument index="1" invalidate-after-use="yes"/>
3850 3850 </modify-function>
3851 3851 <modify-function signature="mouseMoveEvent(QMouseEvent*)">
3852 3852 <modify-argument index="1" invalidate-after-use="yes"/>
3853 3853 </modify-function>
3854 3854 <modify-function signature="mousePressEvent(QMouseEvent*)">
3855 3855 <modify-argument index="1" invalidate-after-use="yes"/>
3856 3856 </modify-function>
3857 3857 <modify-function signature="mouseReleaseEvent(QMouseEvent*)">
3858 3858 <modify-argument index="1" invalidate-after-use="yes"/>
3859 3859 </modify-function>
3860 3860 <modify-function signature="moveEvent(QMoveEvent*)">
3861 3861 <modify-argument index="1" invalidate-after-use="yes"/>
3862 3862 </modify-function>
3863 3863 <modify-function signature="paintEvent(QPaintEvent*)">
3864 3864 <modify-argument index="1" invalidate-after-use="yes"/>
3865 3865 </modify-function>
3866 3866 <modify-function signature="resizeEvent(QResizeEvent*)">
3867 3867 <modify-argument index="1" invalidate-after-use="yes"/>
3868 3868 </modify-function>
3869 3869 <modify-function signature="showEvent(QShowEvent*)">
3870 3870 <modify-argument index="1" invalidate-after-use="yes"/>
3871 3871 </modify-function>
3872 3872 <modify-function signature="tabletEvent(QTabletEvent*)">
3873 3873 <modify-argument index="1" invalidate-after-use="yes"/>
3874 3874 </modify-function>
3875 3875 <modify-function signature="wheelEvent(QWheelEvent*)">
3876 3876 <modify-argument index="1" invalidate-after-use="yes"/>
3877 3877 </modify-function>
3878 3878
3879 3879 <modify-function signature="render(QPainter*,QPoint,QRegion,QFlags&lt;QWidget::RenderFlag&gt;)">
3880 3880 <modify-argument index="2">
3881 3881 <!-- Removed because the render(QPainter*) overload conflicts with the identical function in QGraphicsView -->
3882 3882 <remove-default-expression/>
3883 3883 </modify-argument>
3884 3884 </modify-function>
3885 3885
3886 3886 <inject-code class="native">
3887 3887 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowTitle)
3888 3888 (JNIEnv *__jni_env,
3889 3889 jclass,
3890 3890 jlong __this_nativeId,
3891 3891 jobject title0)
3892 3892 {
3893 3893 QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowTitle(const QString &amp; title)");
3894 3894 QString __qt_title0 = qtjambi_to_qstring(__jni_env, (jstring) title0);
3895 3895 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3896 3896 QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
3897 3897 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3898 3898 Q_ASSERT(__qt_this);
3899 3899 __qt_this-&gt;setWindowTitle((const QString&amp; )__qt_title0);
3900 3900 QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowTitle(const QString &amp; title)");
3901 3901 }
3902 3902 </inject-code>
3903 3903
3904 3904 <inject-code class="native">
3905 3905 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QWidget__1_1qt_1QMessageBox_1setWindowModality)
3906 3906 (JNIEnv *__jni_env,
3907 3907 jclass,
3908 3908 jlong __this_nativeId,
3909 3909 jint windowModality0)
3910 3910 {
3911 3911 Q_UNUSED(__jni_env);
3912 3912 QTJAMBI_DEBUG_TRACE("(native) entering: QMessageBox::setWindowModality(Qt::WindowModality modality)");
3913 3913 Qt::WindowModality __qt_windowModality0 = (Qt::WindowModality) windowModality0;
3914 3914 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3915 3915 QMessageBox *__qt_this = (QMessageBox *) qtjambi_from_jlong(__this_nativeId);
3916 3916 QTJAMBI_EXCEPTION_CHECK(__jni_env);
3917 3917 Q_ASSERT(__qt_this);
3918 3918 __qt_this-&gt;setWindowModality((Qt::WindowModality )__qt_windowModality0);
3919 3919 QTJAMBI_DEBUG_TRACE("(native) -&gt; leaving: QMessageBox::setWindowModality(Qt::WindowModality modality)");
3920 3920 }
3921 3921 </inject-code>
3922 3922
3923 3923 <modify-function signature="render(QPaintDevice *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
3924 3924 <modify-argument index="4">
3925 3925 <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
3926 3926 </modify-argument>
3927 3927 </modify-function>
3928 3928 <modify-function signature="render(QPainter *, const QPoint &amp;, const QRegion &amp;, QFlags&lt;QWidget::RenderFlag&gt;)">
3929 3929 <modify-argument index="4">
3930 3930 <replace-default-expression with="RenderFlag.DrawWindowBackground, RenderFlag.DrawChildren"/>
3931 3931 </modify-argument>
3932 3932 </modify-function>
3933 3933 <modify-function signature="setFocusProxy(QWidget*)">
3934 3934 <modify-argument index="1">
3935 3935 <reference-count action="set" variable-name="__rcFocusProxy"/>
3936 3936 </modify-argument>
3937 3937 </modify-function>
3938 3938 <modify-function signature="setInputContext(QInputContext*)">
3939 3939 <modify-argument index="1">
3940 3940 <define-ownership class="java" owner="c++"/>
3941 3941 </modify-argument>
3942 3942 </modify-function>
3943 3943 <modify-function signature="setLayout(QLayout*)">
3944 3944 <modify-argument index="1">
3945 3945 <no-null-pointer/>
3946 3946 <reference-count action="ignore"/>
3947 3947 </modify-argument>
3948 3948 </modify-function>
3949 3949 <modify-function signature="setParent(QWidget*,QFlags&lt;Qt::WindowType&gt;)">
3950 3950 <modify-argument index="1">
3951 3951 <reference-count action="ignore"/>
3952 3952 </modify-argument>
3953 3953 </modify-function>
3954 3954 <modify-function signature="setParent(QWidget*)">
3955 3955 <modify-argument index="1">
3956 3956 <reference-count action="ignore"/>
3957 3957 </modify-argument>
3958 3958 </modify-function>
3959 3959 <modify-function signature="setStyle(QStyle*)">
3960 3960 <modify-argument index="1">
3961 3961 <reference-count action="set" variable-name="__rcStyle"/>
3962 3962 </modify-argument>
3963 3963 </modify-function>
3964 3964 <modify-function signature="setTabOrder(QWidget*,QWidget*)">
3965 3965 <modify-argument index="1">
3966 3966 <reference-count action="ignore"/>
3967 3967 </modify-argument>
3968 3968 <modify-argument index="2">
3969 3969 <reference-count action="ignore"/>
3970 3970 </modify-argument>
3971 3971 </modify-function>
3972 3972 <modify-function signature="getContentsMargins(int*,int*,int*,int*)const">
3973 3973 <access modifier="private"/>
3974 3974 </modify-function>
3975 3975
3976 3976 <modify-function signature="addAction(QAction *)">
3977 3977 <modify-argument index="1">
3978 3978 <reference-count action="add" variable-name="__rcActions"/>
3979 3979 </modify-argument>
3980 3980 </modify-function>
3981 3981
3982 3982 <modify-function signature="insertAction(QAction *, QAction *)">
3983 3983 <modify-argument index="2">
3984 3984 <reference-count action="add" variable-name="__rcActions"/>
3985 3985 </modify-argument>
3986 3986 </modify-function>
3987 3987
3988 3988 <modify-function signature="addActions(const QList&lt;QAction *&gt; &amp;)">
3989 3989 <modify-argument index="1">
3990 3990 <reference-count action="add-all" variable-name="__rcActions"/>
3991 3991 </modify-argument>
3992 3992 </modify-function>
3993 3993
3994 3994 <modify-function signature="insertActions(QAction *, const QList&lt;QAction *&gt; &amp;)">
3995 3995 <modify-argument index="2">
3996 3996 <reference-count action="add-all" variable-name="__rcActions"/>
3997 3997 </modify-argument>
3998 3998 </modify-function>
3999 3999
4000 4000 <modify-function signature="removeAction(QAction *)">
4001 4001 <modify-argument index="1">
4002 4002 <reference-count action="remove" variable-name="__rcActions"/>
4003 4003 </modify-argument>
4004 4004 </modify-function>
4005 4005 <modify-function signature="enabledChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4006 4006 <modify-function signature="fontChange(QFont)" remove="all"/> <!--### Obsolete in 4.3-->
4007 4007 <modify-function signature="isEnabledToTLW()const" remove="all"/> <!--### Obsolete in 4.3-->
4008 4008 <modify-function signature="isTopLevel()const" remove="all"/> <!--### Obsolete in 4.3-->
4009 4009 <modify-function signature="paletteChange(QPalette)" remove="all"/> <!--### Obsolete in 4.3-->
4010 4010 <modify-function signature="setShown(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4011 4011 <modify-function signature="topLevelWidget()const" remove="all"/> <!--### Obsolete in 4.3-->
4012 4012 <modify-function signature="windowActivationChange(bool)" remove="all"/> <!--### Obsolete in 4.3-->
4013 4013
4014 4014 <modify-function signature="fontInfo()const" remove="all"/>
4015 4015 <modify-function signature="fontMetrics()const" remove="all"/>
4016 4016 <modify-function signature="sizeHint()const" rename="getSizeHint"/>
4017 4017 <modify-function signature="minimumSizeHint()const" rename="getMinimumSizeHint"/>
4018 4018 <modify-function signature="setVisible(bool)" remove="all"/>
4019 4019 </object-type>
4020 4020
4021 4021 <object-type name="QMessageBox">
4022 4022
4023 4023
4024 4024 <modify-function signature="setWindowTitle(const QString &amp;)" remove="all"/>
4025 4025 <modify-function signature="setWindowModality(Qt::WindowModality)" remove="all"/>
4026 4026 <extra-includes>
4027 4027 <include file-name="QPixmap" location="global"/>
4028 4028 </extra-includes>
4029 4029 <modify-function signature="addButton(QAbstractButton*,QMessageBox::ButtonRole)">
4030 4030 <modify-argument index="1">
4031 4031 <reference-count action="ignore"/>
4032 4032 </modify-argument>
4033 4033 </modify-function>
4034 4034 <modify-function signature="removeButton(QAbstractButton*)">
4035 4035 <modify-argument index="1">
4036 4036 <reference-count action="ignore"/>
4037 4037 </modify-argument>
4038 4038 </modify-function>
4039 4039 <modify-function signature="setDefaultButton(QPushButton*)">
4040 4040 <modify-argument index="1">
4041 4041 <reference-count action="ignore"/>
4042 4042 </modify-argument>
4043 4043 </modify-function>
4044 4044 <modify-function signature="setEscapeButton(QAbstractButton*)">
4045 4045 <modify-argument index="1">
4046 4046 <reference-count action="ignore"/>
4047 4047 </modify-argument>
4048 4048 </modify-function>
4049 4049
4050 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 4051 <modify-function signature="buttonText(int)const" remove="all"/> <!--### Obsolete in 4.3-->
4052 4052 <modify-function signature="setButtonText(int, QString)" remove="all"/> <!--### Obsolete in 4.3-->
4053 4053 <modify-function signature="standardIcon(QMessageBox::Icon)" remove="all"/> <!--### Obsolete in 4.3-->
4054 4054
4055 4055 <modify-function signature="critical(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4056 4056 <modify-function signature="critical(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4057 4057 <modify-function signature="information(QWidget*,QString,QString,int,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4058 4058 <modify-function signature="information(QWidget*,QString,QString,QString,QString,QString,int,int)" remove="all"/> <!--### Obsolete in 4.3-->
4059 4059 <modify-function signature="question(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4060 4060 <modify-function signature="question(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4061 4061 <modify-function signature="warning(QWidget*, QString, QString, int, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4062 4062 <modify-function signature="warning(QWidget*, QString, QString, QString, QString, QString, int, int)" remove="all"/> <!--### Obsolete in 4.3-->
4063 4063 </object-type>
4064 4064
4065 4065 <object-type name="QAbstractSpinBox">
4066 4066 <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const">
4067 4067 <access modifier="private"/>
4068 4068 </modify-function>
4069 4069 <modify-function signature="setLineEdit(QLineEdit*)">
4070 4070 <modify-argument index="1">
4071 4071 <!-- Safe to ignore because the spinbox reparents the line edit -->
4072 4072 <reference-count action="ignore"/>
4073 4073 <no-null-pointer/>
4074 4074 </modify-argument>
4075 4075 </modify-function>
4076 4076 </object-type>
4077 4077
4078 4078 <object-type name="QTextFrame" delete-in-main-thread="yes">
4079 4079 <extra-includes>
4080 4080 <include file-name="QTextCursor" location="global"/>
4081 4081 </extra-includes>
4082 4082 </object-type>
4083 4083
4084 4084 <object-type name="QImageIOHandler">
4085 4085 <extra-includes>
4086 4086 <include file-name="QRect" location="global"/>
4087 4087 </extra-includes>
4088 4088 <modify-function signature="setFormat(const QByteArray &amp;)const">
4089 4089 <remove/>
4090 4090 </modify-function>
4091 4091 <modify-function signature="setDevice(QIODevice*)">
4092 4092 <modify-argument index="1">
4093 4093 <reference-count action="set" variable-name="__rcDevice"/>
4094 4094 </modify-argument>
4095 4095 </modify-function>
4096 4096 <modify-function signature="read(QImage*)">
4097 4097 <modify-argument index="1">
4098 4098 <replace-type modified-type="com.trolltech.qt.gui.QImage"/>
4099 4099 <conversion-rule class="shell">
4100 4100 jobject %out = qtjambi_from_object(__jni_env, %in, "QImage", "com/trolltech/qt/gui/", false);
4101 4101
4102 4102 QtJambiLink *__link = %out != 0 ? QtJambiLink::findLink(__jni_env, %out) : 0;
4103 4103 </conversion-rule>
4104 4104 <conversion-rule class="native">
4105 4105 QImage *%out = (QImage *) qtjambi_to_object(__jni_env, %in);
4106 4106 </conversion-rule>
4107 4107 </modify-argument>
4108 4108 <modify-argument index="0">
4109 4109 <conversion-rule class="shell">
4110 4110 // Invalidate object
4111 4111 if (__link != 0) __link-&gt;resetObject(__jni_env);
4112 4112 bool %out = (bool) %in;
4113 4113 </conversion-rule>
4114 4114 </modify-argument>
4115 4115 </modify-function>
4116 4116
4117 4117 <modify-function signature="name()const" remove="all"/> <!--### Obsolete in 4.3-->
4118 4118 </object-type>
4119 4119
4120 4120 <object-type name="QProxyModel">
4121 4121 <modify-function signature="parent()const" remove="all"/>
4122 4122 <extra-includes>
4123 4123 <include file-name="QPixmap" location="global"/>
4124 4124 <include file-name="QStringList" location="global"/>
4125 4125 <include file-name="QSize" location="global"/>
4126 4126 </extra-includes>
4127 4127 <modify-function signature="setModel(QAbstractItemModel*)">
4128 4128 <modify-argument index="1">
4129 4129 <reference-count action="set" variable-name="__rcModel"/>
4130 4130 </modify-argument>
4131 4131 </modify-function>
4132 4132 </object-type>
4133 4133
4134 4134 <object-type name="QImageReader">
4135 4135 <extra-includes>
4136 4136 <include file-name="QColor" location="global"/>
4137 4137 <include file-name="QRect" location="global"/>
4138 4138 <include file-name="QSize" location="global"/>
4139 4139 <include file-name="QStringList" location="global"/>
4140 4140 <include file-name="QImage" location="global"/>
4141 4141 </extra-includes>
4142 4142 <modify-function signature="read(QImage*) ">
4143 4143 <remove/>
4144 4144 </modify-function>
4145 4145 <modify-function signature="setDevice(QIODevice*)">
4146 4146 <modify-argument index="1">
4147 4147 <reference-count action="set" variable-name="__rcDevice"/>
4148 4148 </modify-argument>
4149 4149 </modify-function>
4150 4150 </object-type>
4151 4151
4152 4152 <object-type name="QMovie">
4153 4153 <extra-includes>
4154 4154 <include file-name="QColor" location="global"/>
4155 4155 <include file-name="QImage" location="global"/>
4156 4156 <include file-name="QPixmap" location="global"/>
4157 4157 <include file-name="QRect" location="global"/>
4158 4158 <include file-name="QSize" location="global"/>
4159 4159 </extra-includes>
4160 4160 <modify-function signature="cacheMode()">
4161 4161 <remove/>
4162 4162 </modify-function>
4163 4163 <modify-function signature="setDevice(QIODevice*)">
4164 4164 <modify-argument index="1">
4165 4165 <reference-count action="set" variable-name="__rcDevice"/>
4166 4166 </modify-argument>
4167 4167 </modify-function>
4168 4168 </object-type>
4169 4169
4170 4170 <object-type name="QPageSetupDialog"/>
4171 4171
4172 4172 <object-type name="QTabWidget">
4173 4173 <modify-function signature="initStyleOption(QStyleOptionTabWidgetFrame*)const">
4174 4174 <access modifier="private"/>
4175 4175 </modify-function>
4176 4176 <inject-code>
4177 4177 <insert-template name="gui.init_style_option">
4178 4178 <replace from="%TYPE" to="QStyleOptionTabWidgetFrame"/>
4179 4179 </insert-template>
4180 4180 </inject-code>
4181 4181 <modify-function signature="addTab(QWidget*,QIcon,QString)">
4182 4182 <modify-argument index="1">
4183 4183 <reference-count action="ignore"/>
4184 4184 </modify-argument>
4185 4185 </modify-function>
4186 4186 <modify-function signature="addTab(QWidget*,QString)">
4187 4187 <modify-argument index="1">
4188 4188 <reference-count action="ignore"/>
4189 4189 </modify-argument>
4190 4190 </modify-function>
4191 4191 <modify-function signature="insertTab(int,QWidget*,QString)">
4192 4192 <modify-argument index="2">
4193 4193 <reference-count action="ignore"/>
4194 4194 </modify-argument>
4195 4195 </modify-function>
4196 4196 <modify-function signature="insertTab(int,QWidget*,QIcon,QString)">
4197 4197 <modify-argument index="2">
4198 4198 <reference-count action="ignore"/>
4199 4199 </modify-argument>
4200 4200 </modify-function>
4201 4201 <modify-function signature="setCornerWidget(QWidget*,Qt::Corner)">
4202 4202 <modify-argument index="1">
4203 4203 <reference-count action="ignore"/>
4204 4204 </modify-argument>
4205 4205 </modify-function>
4206 4206 <modify-function signature="setCurrentWidget(QWidget*)">
4207 4207 <modify-argument index="1">
4208 4208 <reference-count action="ignore"/>
4209 4209 </modify-argument>
4210 4210 </modify-function>
4211 4211 <modify-function signature="setTabBar(QTabBar*)">
4212 4212 <modify-argument index="1">
4213 4213 <reference-count action="ignore"/>
4214 4214 </modify-argument>
4215 4215 </modify-function>
4216 4216 </object-type>
4217 4217 <object-type name="QDrag">
4218 4218 <extra-includes>
4219 4219 <include file-name="QPoint" location="global"/>
4220 4220 <include file-name="QPixmap" location="global"/>
4221 4221 </extra-includes>
4222 4222 <modify-function signature="setMimeData(QMimeData*)">
4223 4223 <modify-argument index="1">
4224 4224 <define-ownership class="java" owner="c++"/>
4225 4225 </modify-argument>
4226 4226 </modify-function>
4227 4227
4228 4228 <modify-function signature="start(QFlags&lt;Qt::DropAction&gt;)" remove="all"/> <!--### Obsolete in 4.3-->
4229 4229 </object-type>
4230 4230
4231 4231 <object-type name="QDateTimeEdit">
4232 4232 <modify-function signature="initStyleOption(QStyleOptionSpinBox*)const" access="private" rename="initDateTimeEditStyleOption"/>
4233 4233 <modify-function signature="setCalendarWidget(QCalendarWidget*)">
4234 4234 <modify-argument index="1">
4235 4235 <!-- Safe to ignore because widget is reparented -->
4236 4236 <reference-count action="ignore"/>
4237 4237 </modify-argument>
4238 4238 </modify-function>
4239 4239
4240 4240 </object-type>
4241 4241
4242 4242 <object-type name="QSortFilterProxyModel">
4243 4243 <modify-function signature="parent()const" remove="all"/>
4244 4244 <extra-includes>
4245 4245 <include file-name="QItemSelection" location="global"/>
4246 4246 <include file-name="QStringList" location="global"/>
4247 4247 <include file-name="QSize" location="global"/>
4248 4248 </extra-includes>
4249 4249
4250 4250 <modify-function signature="setSourceModel(QAbstractItemModel *)">
4251 4251 <modify-argument index="1">
4252 4252 <reference-count action="set" variable-name="__rcSourceModel"/>
4253 4253 </modify-argument>
4254 4254 </modify-function>
4255 4255
4256 4256 <modify-function signature="clear()" remove="all"/> <!--### Obsolete in 4.3-->
4257 4257 <modify-function signature="filterChanged()" remove="all"/> <!--### Obsolete in 4.3-->
4258 4258 </object-type>
4259 4259
4260 4260 <object-type name="QSlider">
4261 4261 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4262 4262 <access modifier="private"/>
4263 4263 </modify-function>
4264 4264 </object-type>
4265 4265
4266 4266 <object-type name="QInputContext">
4267 4267 <extra-includes>
4268 4268 <include file-name="QTextFormat" location="global"/>
4269 4269 </extra-includes>
4270 4270 <modify-function signature="setFocusWidget(QWidget*)">
4271 4271 <remove/>
4272 4272 </modify-function>
4273 4273 <modify-function signature="filterEvent(const QEvent*)">
4274 4274 <modify-argument index="1" invalidate-after-use="yes"/>
4275 4275 </modify-function>
4276 4276 <modify-function signature="mouseHandler(int,QMouseEvent*)">
4277 4277 <modify-argument index="2" invalidate-after-use="yes"/>
4278 4278 </modify-function>
4279 4279
4280 4280 </object-type>
4281 4281
4282 4282 <object-type name="QProgressDialog">
4283 4283
4284 4284 <modify-function signature="setBar(QProgressBar*)">
4285 4285 <modify-argument index="1">
4286 4286 <define-ownership class="java" owner="c++"/>
4287 4287 </modify-argument>
4288 4288 </modify-function>
4289 4289 <modify-function signature="setCancelButton(QPushButton*)">
4290 4290 <modify-argument index="1">
4291 4291 <!-- Safe to ignore because button is reparented -->
4292 4292 <reference-count action="ignore"/>
4293 4293 </modify-argument>
4294 4294 </modify-function>
4295 4295 <modify-function signature="setLabel(QLabel*)">
4296 4296 <modify-argument index="1">
4297 4297 <!-- Safe to ignore because label is reparented -->
4298 4298 <reference-count action="ignore"/>
4299 4299 </modify-argument>
4300 4300 </modify-function>
4301 4301
4302 4302 </object-type>
4303 4303
4304 4304 <object-type name="QLabel">
4305 4305 <modify-function signature="picture()const">
4306 4306 <access modifier="private"/>
4307 4307 <rename to="picture_private"/>
4308 4308 </modify-function>
4309 4309
4310 4310 <modify-function signature="setBuddy(QWidget *)">
4311 4311 <modify-argument index="1">
4312 4312 <reference-count action="set" variable-name="__rcBuddy"/>
4313 4313 </modify-argument>
4314 4314 </modify-function>
4315 4315 <modify-function signature="setMovie(QMovie *)">
4316 4316 <modify-argument index="1">
4317 4317 <reference-count action="set" variable-name="__rcMovie"/>
4318 4318 </modify-argument>
4319 4319 </modify-function>
4320 4320 <modify-function signature="pixmap()const">
4321 4321 <access modifier="private"/>
4322 4322 <rename to="pixmap_private"/>
4323 4323 </modify-function>
4324 4324 </object-type>
4325 4325
4326 4326 <object-type name="QFileDialog">
4327 4327 <extra-includes>
4328 4328 <include file-name="QUrl" location="global"/>
4329 4329 </extra-includes>
4330 4330
4331 4331 <modify-function signature="getOpenFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4332 4332 <access modifier="private"/>
4333 4333 <modify-argument index="1">
4334 4334 <remove-default-expression/>
4335 4335 </modify-argument>
4336 4336 <modify-argument index="2">
4337 4337 <remove-default-expression/>
4338 4338 </modify-argument>
4339 4339 <modify-argument index="3">
4340 4340 <remove-default-expression/>
4341 4341 </modify-argument>
4342 4342 <modify-argument index="4">
4343 4343 <remove-default-expression/>
4344 4344 </modify-argument>
4345 4345 <modify-argument index="5">
4346 4346 <remove-default-expression/>
4347 4347 </modify-argument>
4348 4348 <modify-argument index="6">
4349 4349 <remove-default-expression/>
4350 4350 </modify-argument>
4351 4351 </modify-function>
4352 4352
4353 4353 <modify-function signature="getOpenFileNames(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4354 4354 <access modifier="private"/>
4355 4355 <modify-argument index="1">
4356 4356 <remove-default-expression/>
4357 4357 </modify-argument>
4358 4358 <modify-argument index="2">
4359 4359 <remove-default-expression/>
4360 4360 </modify-argument>
4361 4361 <modify-argument index="3">
4362 4362 <remove-default-expression/>
4363 4363 </modify-argument>
4364 4364 <modify-argument index="4">
4365 4365 <remove-default-expression/>
4366 4366 </modify-argument>
4367 4367 <modify-argument index="5">
4368 4368 <remove-default-expression/>
4369 4369 </modify-argument>
4370 4370 <modify-argument index="6">
4371 4371 <remove-default-expression/>
4372 4372 </modify-argument>
4373 4373 </modify-function>
4374 4374
4375 4375 <modify-function signature="getSaveFileName(QWidget*,QString,QString,QString,QString*,QFlags&lt;QFileDialog::Option&gt;)">
4376 4376 <access modifier="private"/>
4377 4377 <modify-argument index="1">
4378 4378 <remove-default-expression/>
4379 4379 </modify-argument>
4380 4380 <modify-argument index="2">
4381 4381 <remove-default-expression/>
4382 4382 </modify-argument>
4383 4383 <modify-argument index="3">
4384 4384 <remove-default-expression/>
4385 4385 </modify-argument>
4386 4386 <modify-argument index="4">
4387 4387 <remove-default-expression/>
4388 4388 </modify-argument>
4389 4389 <modify-argument index="5">
4390 4390 <remove-default-expression/>
4391 4391 </modify-argument>
4392 4392 <modify-argument index="6">
4393 4393 <remove-default-expression/>
4394 4394 </modify-argument>
4395 4395 </modify-function>
4396 4396
4397 4397 <modify-function signature="setIconProvider(QFileIconProvider*)">
4398 4398 <modify-argument index="1">
4399 4399 <reference-count action="set" variable-name="__rcIconProvider"/>
4400 4400 </modify-argument>
4401 4401 </modify-function>
4402 4402
4403 4403 <modify-function signature="setItemDelegate(QAbstractItemDelegate*)">
4404 4404 <modify-argument index="1">
4405 4405 <reference-count action="set" variable-name="__rcItemDelegate"/>
4406 4406 </modify-argument>
4407 4407 </modify-function>
4408 4408
4409 4409 <modify-function signature="setProxyModel(QAbstractProxyModel*)">
4410 4410 <modify-argument index="1">
4411 4411 <!-- Reparented -->
4412 4412 <reference-count action="ignore"/>
4413 4413 </modify-argument>
4414 4414 </modify-function>
4415 4415
4416 4416 </object-type>
4417 4417
4418 4418 <object-type name="QErrorMessage"/>
4419 4419
4420 4420 <object-type name="QTabBar">
4421 4421 <extra-includes>
4422 4422 <include file-name="QIcon" location="global"/>
4423 4423 </extra-includes>
4424 4424 <modify-function signature="initStyleOption(QStyleOptionTab*,int)const">
4425 4425 <access modifier="private"/>
4426 4426 </modify-function>
4427 4427 <modify-function signature="setTabButton(int,QTabBar::ButtonPosition,QWidget*)">
4428 4428 <modify-argument index="3">
4429 4429 <reference-count action="ignore"/>
4430 4430 </modify-argument>
4431 4431 </modify-function>
4432 4432 </object-type>
4433 4433
4434 4434 <object-type name="QStandardItemModel">
4435 4435 <modify-function signature="insertColumn(int,const QModelIndex &amp;)" remove="all"/>
4436 4436 <modify-function signature="insertRow(int,const QModelIndex &amp;)" remove="all"/>
4437 4437 <modify-function signature="parent()const" remove="all"/>
4438 4438 <extra-includes>
4439 4439 <include file-name="QStringList" location="global"/>
4440 4440 <include file-name="QSize" location="global"/>
4441 4441 </extra-includes>
4442 4442
4443 4443 <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt;&amp;)">
4444 4444 <modify-argument index="1">
4445 4445 <define-ownership class="java" owner="c++"/>
4446 4446 </modify-argument>
4447 4447 </modify-function>
4448 4448 <modify-function signature="takeColumn(int)">
4449 4449 <modify-argument index="return">
4450 4450 <define-ownership class="java" owner="default"/>
4451 4451 </modify-argument>
4452 4452 </modify-function>
4453 4453 <modify-function signature="takeRow(int)">
4454 4454 <modify-argument index="return">
4455 4455 <define-ownership class="java" owner="default"/>
4456 4456 </modify-argument>
4457 4457 </modify-function>
4458 4458 <modify-function signature="takeHorizontalHeaderItem(int)">
4459 4459 <modify-argument index="return">
4460 4460 <define-ownership class="java" owner="default"/>
4461 4461 </modify-argument>
4462 4462 </modify-function>
4463 4463 <modify-function signature="takeVerticalHeaderItem(int)">
4464 4464 <modify-argument index="return">
4465 4465 <define-ownership class="java" owner="default"/>
4466 4466 </modify-argument>
4467 4467 </modify-function>
4468 4468 <modify-function signature="takeItem(int,int)">
4469 4469 <modify-argument index="return">
4470 4470 <define-ownership class="java" owner="default"/>
4471 4471 </modify-argument>
4472 4472 </modify-function>
4473 4473 <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt;&amp;)">
4474 4474 <modify-argument index="1">
4475 4475 <define-ownership class="java" owner="c++"/>
4476 4476 </modify-argument>
4477 4477 </modify-function>
4478 4478 <modify-function signature="appendRow(QStandardItem *)">
4479 4479 <modify-argument index="1">
4480 4480 <define-ownership class="java" owner="c++"/>
4481 4481 </modify-argument>
4482 4482 </modify-function>
4483 4483 <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt;&amp;)">
4484 4484 <modify-argument index="2">
4485 4485 <define-ownership class="java" owner="c++"/>
4486 4486 </modify-argument>
4487 4487 </modify-function>
4488 4488 <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt;&amp;)">
4489 4489 <modify-argument index="2">
4490 4490 <define-ownership class="java" owner="c++"/>
4491 4491 </modify-argument>
4492 4492 </modify-function>
4493 4493 <modify-function signature="insertRow(int, QStandardItem *)">
4494 4494 <modify-argument index="2">
4495 4495 <define-ownership class="java" owner="c++"/>
4496 4496 </modify-argument>
4497 4497 </modify-function>
4498 4498 <modify-function signature="setHorizontalHeaderItem(int, QStandardItem *)">
4499 4499 <modify-argument index="2">
4500 4500 <define-ownership class="java" owner="c++"/>
4501 4501 </modify-argument>
4502 4502 </modify-function>
4503 4503 <modify-function signature="setItem(int, int, QStandardItem *)">
4504 4504 <modify-argument index="3">
4505 4505 <define-ownership class="java" owner="c++"/>
4506 4506 </modify-argument>
4507 4507 </modify-function>
4508 4508 <modify-function signature="setItem(int, QStandardItem *)">
4509 4509 <modify-argument index="2">
4510 4510 <define-ownership class="java" owner="c++"/>
4511 4511 </modify-argument>
4512 4512 </modify-function>
4513 4513 <modify-function signature="setItemPrototype(const QStandardItem *)">
4514 4514 <modify-argument index="1">
4515 4515 <define-ownership class="java" owner="c++"/>
4516 4516 </modify-argument>
4517 4517 </modify-function>
4518 4518 <modify-function signature="setVerticalHeaderItem(int, QStandardItem *)">
4519 4519 <modify-argument index="2">
4520 4520 <define-ownership class="java" owner="c++"/>
4521 4521 </modify-argument>
4522 4522 </modify-function>
4523 4523 </object-type>
4524 4524
4525 4525 <object-type name="QRadioButton">
4526 4526 <modify-function signature="initStyleOption(QStyleOptionButton*)const">
4527 4527 <access modifier="private"/>
4528 4528 </modify-function>
4529 4529 </object-type>
4530 4530
4531 4531 <object-type name="QScrollBar">
4532 4532 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4533 4533 <access modifier="private"/>
4534 4534 </modify-function>
4535 4535 </object-type>
4536 4536
4537 4537 <object-type name="QClipboard">
4538 4538 <extra-includes>
4539 4539 <include file-name="QImage" location="global"/>
4540 4540 <include file-name="QPixmap" location="global"/>
4541 4541 </extra-includes>
4542 <modify-function signature="event(QEvent*)" remove="all"/>
4542 4543 <modify-function signature="setMimeData(QMimeData *, QClipboard::Mode)">
4543 4544 <modify-argument index="1">
4544 4545 <define-ownership class="java" owner="c++"/>
4545 4546 </modify-argument>
4546 4547 </modify-function>
4547 4548 <modify-function signature="text(QString&amp;,QClipboard::Mode)const">
4548 4549 <access modifier="private"/>
4549 4550 <modify-argument index="2">
4550 4551 <remove-default-expression/>
4551 4552 </modify-argument>
4552 4553 </modify-function>
4553 4554
4554 4555 </object-type>
4555 4556
4556 4557 <object-type name="QAbstractScrollArea">
4557 4558 <modify-function signature="setupViewport(QWidget *)" access="non-final"/>
4558 4559 <modify-function signature="addScrollBarWidget(QWidget*,QFlags&lt;Qt::AlignmentFlag&gt;)">
4559 4560 <modify-argument index="1">
4560 4561 <reference-count action="ignore"/>
4561 4562 </modify-argument>
4562 4563 </modify-function>
4563 4564 <modify-function signature="setCornerWidget(QWidget*)">
4564 4565 <modify-argument index="1">
4565 4566 <reference-count action="ignore"/>
4566 4567 </modify-argument>
4567 4568 </modify-function>
4568 4569 <modify-function signature="setHorizontalScrollBar(QScrollBar*)">
4569 4570 <modify-argument index="1">
4570 4571 <reference-count action="ignore"/>
4571 4572 </modify-argument>
4572 4573 </modify-function>
4573 4574
4574 4575 <modify-function signature="setVerticalScrollBar(QScrollBar*)">
4575 4576 <modify-argument index="1">
4576 4577 <reference-count action="ignore"/>
4577 4578 </modify-argument>
4578 4579 </modify-function>
4579 4580
4580 4581 <modify-function signature="setViewport(QWidget*)">
4581 4582 <modify-argument index="1">
4582 4583 <reference-count action="ignore"/>
4583 4584 </modify-argument>
4584 4585 </modify-function>
4585 4586
4586 4587 <modify-function signature="setupViewport(QWidget*)">
4587 4588 <modify-argument index="1">
4588 4589 <reference-count action="ignore"/>
4589 4590 </modify-argument>
4590 4591 </modify-function>
4591 4592
4592 4593 <modify-function signature="viewportEvent(QEvent*)">
4593 4594 <modify-argument index="1" invalidate-after-use="yes"/>
4594 4595 </modify-function>
4595 4596
4596 4597 </object-type>
4597 4598
4598 4599 <object-type name="QPaintEngineState">
4599 4600 <extra-includes>
4600 4601 <include file-name="QPainterPath" location="global"/>
4601 4602 </extra-includes>
4602 4603 </object-type>
4603 4604
4604 4605 <object-type name="QRubberBand">
4605 4606 <modify-function signature="initStyleOption(QStyleOptionRubberBand*)const">
4606 4607 <access modifier="private"/>
4607 4608 </modify-function>
4608 4609 <modify-function signature="move(int,int)" rename="moveRubberBand"/>
4609 4610 <modify-function signature="move(const QPoint &amp;)" rename="moveRubberBand"/>
4610 4611 <modify-function signature="resize(int,int)" rename="resizeRubberBand"/>
4611 4612 <modify-function signature="resize(const QSize &amp;)" rename="resizeRubberBand"/>
4612 4613 <modify-function signature="setGeometry(int,int,int,int)" rename="setRubberBandGeometry"/>
4613 4614 <modify-function signature="setGeometry(const QRect &amp;)" rename="setRubberBandGeometry"/>
4614 4615 </object-type>
4615 4616
4616 4617 <object-type name="QTextLayout">
4617 4618 <extra-includes>
4618 4619 <include file-name="QTextOption" location="global"/>
4619 4620 </extra-includes>
4620 4621 </object-type>
4621 4622
4622 4623 <object-type name="QTableWidget">
4623 4624 <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const">
4624 4625 <modify-argument index="1" invalidate-after-use="yes"/>
4625 4626 </modify-function>
4626 4627 <modify-function signature="isSortingEnabled()const" remove="all"/>
4627 4628 <modify-function signature="setSortingEnabled(bool)" remove="all"/>
4628 4629 <modify-function signature="setHorizontalHeaderItem(int, QTableWidgetItem *)">
4629 4630 <modify-argument index="2">
4630 4631 <define-ownership class="java" owner="c++"/>
4631 4632 </modify-argument>
4632 4633 </modify-function>
4633 4634 <modify-function signature="setItem(int, int, QTableWidgetItem *)">
4634 4635 <modify-argument index="3">
4635 4636 <define-ownership class="java" owner="c++"/>
4636 4637 </modify-argument>
4637 4638 </modify-function>
4638 4639 <modify-function signature="takeHorizontalHeaderItem(int)">
4639 4640 <modify-argument index="return">
4640 4641 <define-ownership class="java" owner="default"/>
4641 4642 </modify-argument>
4642 4643 </modify-function>
4643 4644 <modify-function signature="takeVerticalHeaderItem(int)">
4644 4645 <modify-argument index="return">
4645 4646 <define-ownership class="java" owner="default"/>
4646 4647 </modify-argument>
4647 4648 </modify-function>
4648 4649 <modify-function signature="takeItem(int,int)">
4649 4650 <modify-argument index="return">
4650 4651 <define-ownership class="java" owner="default"/>
4651 4652 </modify-argument>
4652 4653 </modify-function>
4653 4654 <modify-function signature="setItemPrototype(const QTableWidgetItem *)">
4654 4655 <modify-argument index="1">
4655 4656 <define-ownership class="java" owner="c++"/>
4656 4657 </modify-argument>
4657 4658 </modify-function>
4658 4659 <modify-function signature="setVerticalHeaderItem(int, QTableWidgetItem *)">
4659 4660 <modify-argument index="2">
4660 4661 <define-ownership class="java" owner="c++"/>
4661 4662 </modify-argument>
4662 4663 </modify-function>
4663 4664 <modify-function signature="setCellWidget(int,int,QWidget*)">
4664 4665 <modify-argument index="3">
4665 4666 <reference-count action="ignore"/>
4666 4667 </modify-argument>
4667 4668 </modify-function>
4668 4669 <modify-function signature="setCurrentItem(QTableWidgetItem*)">
4669 4670 <modify-argument index="1">
4670 4671 <reference-count action="ignore"/>
4671 4672 </modify-argument>
4672 4673 </modify-function>
4673 4674 <modify-function signature="setCurrentItem(QTableWidgetItem*,QFlags&lt;QItemSelectionModel::SelectionFlag&gt;)">
4674 4675 <modify-argument index="1">
4675 4676 <reference-count action="ignore"/>
4676 4677 </modify-argument>
4677 4678 </modify-function>
4678 4679 <modify-function signature="setItemSelected(const QTableWidgetItem*,bool)">
4679 4680 <remove/>
4680 4681 </modify-function>
4681 4682 <modify-function signature="isItemSelected(const QTableWidgetItem*)const">
4682 4683 <remove/>
4683 4684 </modify-function>
4684 4685 <modify-function signature="setModel(QAbstractItemModel*)">
4685 4686 <modify-argument index="1">
4686 4687 <reference-count action="ignore"/>
4687 4688 </modify-argument>
4688 4689 </modify-function>
4689 4690
4690 4691 <modify-function signature="mimeData(const QList&lt;QTableWidgetItem*&gt;)const" remove="all"/>
4691 4692 </object-type>
4692 4693 <object-type name="QTextDocument">
4693 4694 <extra-includes>
4694 4695 <include file-name="QTextBlock" location="global"/>
4695 4696 <include file-name="QTextFormat" location="global"/>
4696 4697 <include file-name="QTextCursor" location="global"/>
4697 4698 </extra-includes>
4698 4699 <modify-function signature="redo(QTextCursor*)">
4699 4700 <access modifier="private"/>
4700 4701 </modify-function>
4701 4702 <modify-function signature="setDocumentLayout(QAbstractTextDocumentLayout*)">
4702 4703 <modify-argument index="1">
4703 4704 <define-ownership class="java" owner="c++"/>
4704 4705 </modify-argument>
4705 4706 </modify-function>
4706 4707
4707 4708 <modify-function signature="undo(QTextCursor*)">
4708 4709 <access modifier="private"/>
4709 4710 </modify-function>
4710 4711 </object-type>
4711 4712
4712 4713 <object-type name="QTextDocumentWriter">
4713 4714 <modify-function signature="setCodec(QTextCodec*)">
4714 4715 <modify-argument index="1">
4715 4716 <reference-count action="set" variable-name="__rcCodec"/>
4716 4717 </modify-argument>
4717 4718 </modify-function>
4718 4719 <modify-function signature="setDevice(QIODevice*)">
4719 4720 <modify-argument index="1">
4720 4721 <reference-count action="set" variable-name="__rcDevice"/>
4721 4722 </modify-argument>
4722 4723 </modify-function>
4723 4724 </object-type>
4724 4725
4725 4726 <object-type name="QSplitter">
4726 4727
4727 4728 <modify-function signature="getRange(int,int*,int*)const">
4728 4729 <access modifier="private"/>
4729 4730 </modify-function>
4730 4731 <modify-function signature="addWidget(QWidget *)">
4731 4732 <modify-argument index="1">
4732 4733 <reference-count action="ignore"/>
4733 4734 </modify-argument>
4734 4735 </modify-function>
4735 4736 <modify-function signature="insertWidget(int, QWidget *)">
4736 4737 <modify-argument index="2">
4737 4738 <reference-count action="ignore"/>
4738 4739 </modify-argument>
4739 4740 </modify-function>
4740 4741 </object-type>
4741 4742
4742 4743 <object-type name="QGroupBox">
4743 4744 <modify-function signature="initStyleOption(QStyleOptionGroupBox*)const">
4744 4745 <access modifier="private"/>
4745 4746 </modify-function>
4746 4747 </object-type>
4747 4748
4748 4749 <object-type name="QStackedWidget">
4749 4750 <modify-function signature="addWidget(QWidget*)">
4750 4751 <modify-argument index="1">
4751 4752 <reference-count action="ignore"/>
4752 4753 </modify-argument>
4753 4754 </modify-function>
4754 4755 <modify-function signature="insertWidget(int,QWidget*)">
4755 4756 <modify-argument index="2">
4756 4757 <reference-count action="ignore"/>
4757 4758 </modify-argument>
4758 4759 </modify-function>
4759 4760 <modify-function signature="removeWidget(QWidget*)">
4760 4761 <modify-argument index="1">
4761 4762 <reference-count action="ignore"/>
4762 4763 </modify-argument>
4763 4764 </modify-function>
4764 4765 <modify-function signature="setCurrentWidget(QWidget*)">
4765 4766 <modify-argument index="1">
4766 4767 <reference-count action="ignore"/>
4767 4768 </modify-argument>
4768 4769 </modify-function>
4769 4770 </object-type>
4770 4771
4771 4772 <object-type name="QSplitterHandle">
4772 4773 </object-type>
4773 4774
4774 4775 <object-type name="QDial">
4775 4776 <modify-function signature="initStyleOption(QStyleOptionSlider*)const">
4776 4777 <access modifier="private"/>
4777 4778 </modify-function>
4778 4779 </object-type>
4779 4780
4780 4781 <object-type name="QLineEdit">
4781 4782 <modify-function signature="initStyleOption(QStyleOptionFrame*)const">
4782 4783 <access modifier="private"/>
4783 4784 </modify-function>
4784 4785 <modify-function signature="setCompleter(QCompleter *)">
4785 4786 <modify-argument index="1">
4786 4787 <reference-count action="set" variable-name="__rcCompleter"/>
4787 4788 </modify-argument>
4788 4789 </modify-function>
4789 4790 <modify-function signature="setValidator(const QValidator *)">
4790 4791 <modify-argument index="1">
4791 4792 <reference-count action="set" variable-name="__rcValidator"/>
4792 4793 </modify-argument>
4793 4794 </modify-function>
4794 4795 </object-type>
4795 4796
4796 4797 <object-type name="QLCDNumber"/>
4797 4798
4798 4799 <object-type name="QSplashScreen">
4799 4800 <modify-function signature="showMessage(const QString &amp;, int, const QColor &amp;)">
4800 4801 <modify-argument index="3">
4801 4802 <replace-default-expression with="QColor.black"/>
4802 4803 </modify-argument>
4803 4804 </modify-function>
4804 4805 <modify-function signature="repaint()" remove="all"/>
4805 4806 <modify-function signature="drawContents(QPainter*)">
4806 4807 <modify-argument index="1" invalidate-after-use="yes"/>
4807 4808 </modify-function>
4808 4809 </object-type>
4809 4810
4810 4811 <object-type name="QDockWidget">
4811 4812 <modify-function signature="initStyleOption(QStyleOptionDockWidget*)const">
4812 4813 <access modifier="private"/>
4813 4814 </modify-function>
4814 4815 <inject-code>
4815 4816 <insert-template name="gui.init_style_option">
4816 4817 <replace from="%TYPE" to="QStyleOptionDockWidget"/>
4817 4818 </insert-template>
4818 4819 </inject-code>
4819 4820 <modify-function signature="setTitleBarWidget(QWidget*)">
4820 4821 <modify-argument index="1">
4821 4822 <reference-count action="ignore"/>
4822 4823 </modify-argument>
4823 4824 </modify-function>
4824 4825 <modify-function signature="setWidget(QWidget*)">
4825 4826 <modify-argument index="1">
4826 4827 <reference-count action="ignore"/>
4827 4828 </modify-argument>
4828 4829 </modify-function>
4829 4830 </object-type>
4830 4831
4831 4832 <object-type name="QAbstractProxyModel">
4832 4833 <extra-includes>
4833 4834 <include file-name="QItemSelection" location="global"/>
4834 4835 <include file-name="QStringList" location="global"/>
4835 4836 <include file-name="QSize" location="global"/>
4836 4837 </extra-includes>
4837 4838
4838 4839 <modify-function signature="setSourceModel(QAbstractItemModel *)">
4839 4840 <modify-argument index="1">
4840 4841 <reference-count action="set" variable-name="__rcSourceModel"/>
4841 4842 </modify-argument>
4842 4843 </modify-function>
4843 4844
4844 4845 </object-type>
4845 4846
4846 4847 <object-type name="QDesktopWidget">
4847 4848 </object-type>
4848 4849
4849 4850 <object-type name="QFrame">
4850 4851 </object-type>
4851 4852
4852 4853 <object-type name="QTextTable">
4853 4854 <modify-function signature="format() const">
4854 4855 <rename to="tableFormat"/>
4855 4856 </modify-function>
4856 4857 <extra-includes>
4857 4858 <include file-name="QTextCursor" location="global"/>
4858 4859 </extra-includes>
4859 4860 </object-type>
4860 4861
4861 4862 <object-type name="QSpinBox">
4862 4863 <modify-function signature="valueChanged(const QString &amp;)">
4863 4864 <rename to="valueStringChanged"/>
4864 4865 </modify-function>
4865 4866 </object-type>
4866 4867
4867 4868 <object-type name="QTextBrowser">
4868 4869 <modify-function signature="highlighted(const QString &amp;)">
4869 4870 <rename to="highlightedString"/>
4870 4871 </modify-function>
4871 4872 </object-type>
4872 4873
4873 4874 <object-type name="QDoubleSpinBox">
4874 4875 <modify-function signature="valueChanged(const QString &amp;)">
4875 4876 <rename to="valueStringChanged"/>
4876 4877 </modify-function>
4877 4878 </object-type>
4878 4879
4879 4880 <object-type name="QButtonGroup">
4880 4881 <modify-function signature="buttonClicked(int)">
4881 4882 <rename to="buttonIdClicked"/>
4882 4883 </modify-function>
4883 4884 <modify-function signature="buttonPressed(int)">
4884 4885 <rename to="buttonIdPressed"/>
4885 4886 </modify-function>
4886 4887 <modify-function signature="buttonReleased(int)">
4887 4888 <rename to="buttonIdReleased"/>
4888 4889 </modify-function>
4889 4890 <modify-function signature="addButton(QAbstractButton *)">
4890 4891 <modify-argument index="1">
4891 4892 <reference-count action="add" variable-name="__rcButtons"/>
4892 4893 <no-null-pointer/>
4893 4894 </modify-argument>
4894 4895 </modify-function>
4895 4896 <modify-function signature="addButton(QAbstractButton *, int)">
4896 4897 <modify-argument index="1">
4897 4898 <reference-count action="add" variable-name="__rcButtons"/>
4898 4899 <no-null-pointer/>
4899 4900 </modify-argument>
4900 4901 </modify-function>
4901 4902 <modify-function signature="removeButton(QAbstractButton *)">
4902 4903 <modify-argument index="1">
4903 4904 <reference-count action="remove" variable-name="__rcButtons"/>
4904 4905 <no-null-pointer/>
4905 4906 </modify-argument>
4906 4907 </modify-function>
4907 4908 <modify-function signature="setId(QAbstractButton *,int)">
4908 4909 <modify-argument index="1">
4909 4910 <reference-count action="ignore"/>
4910 4911 </modify-argument>
4911 4912 </modify-function>
4912 4913 </object-type>
4913 4914
4914 4915 <object-type name="QToolBar">
4915 4916 <modify-function signature="addWidget(QWidget*)">
4916 4917 <modify-argument index="1">
4917 4918 <define-ownership class="java" owner="c++"/>
4918 4919 </modify-argument>
4919 4920 </modify-function>
4920 4921 <modify-function signature="insertWidget(QAction*,QWidget*)">
4921 4922 <modify-argument index="1">
4922 4923 <reference-count action="ignore"/>
4923 4924 </modify-argument>
4924 4925 <modify-argument index="2">
4925 4926 <define-ownership class="java" owner="c++"/>
4926 4927 </modify-argument>
4927 4928 </modify-function>
4928 4929 <modify-function signature="insertSeparator(QAction*)">
4929 4930 <modify-argument index="1">
4930 4931 <reference-count action="ignore"/>
4931 4932 </modify-argument>
4932 4933 </modify-function>
4933 4934
4934 4935 <inject-code class="pywrap-h">
4935 4936 QAction* addAction (QToolBar* menu, const QString &amp; text, PyObject* callable)
4936 4937 {
4937 4938 QAction* a = menu-&gt;addAction(text);
4938 4939 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4939 4940 return a;
4940 4941 }
4941 4942
4942 4943 QAction* addAction (QToolBar* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable)
4943 4944 {
4944 4945 QAction* a = menu-&gt;addAction(text);
4945 4946 a-&gt;setIcon(icon);
4946 4947 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4947 4948 return a;
4948 4949 }
4949 4950 </inject-code>
4950 4951 </object-type>
4951 4952
4952 4953 <object-type name="QPaintEngine">
4953 4954
4954 4955 <modify-function signature="begin(QPaintDevice*)">
4955 4956 <modify-argument index="1" invalidate-after-use="yes"/>
4956 4957 </modify-function>
4957 4958 <modify-function signature="updateState(QPaintEngineState)">
4958 4959 <modify-argument index="1" invalidate-after-use="yes"/>
4959 4960 </modify-function>
4960 4961 <modify-function signature="drawTextItem(QPointF,QTextItem)">
4961 4962 <modify-argument index="2" invalidate-after-use="yes"/>
4962 4963 </modify-function>
4963 4964
4964 4965 <extra-includes>
4965 4966 <include file-name="QVarLengthArray" location="global"/>
4966 4967 </extra-includes>
4967 4968 <modify-function signature="setPaintDevice(QPaintDevice*)">
4968 4969 <remove/>
4969 4970 </modify-function>
4970 4971 <modify-field name="state" read="false" write="false"/>
4971 4972 </object-type>
4972 4973
4973 4974 <object-type name="QAbstractTableModel">
4974 4975 <extra-includes>
4975 4976 <include file-name="QStringList" location="global"/>
4976 4977 <include file-name="QSize" location="global"/>
4977 4978 </extra-includes>
4978 4979 </object-type>
4979 4980
4980 4981 <object-type name="QGuiSignalMapper"/>
4981 4982
4982 4983 <object-type name="QComboBox">
4983 4984 <modify-function signature="initStyleOption(QStyleOptionComboBox*)const">
4984 4985 <access modifier="private"/>
4985 4986 </modify-function>
4986 4987 <modify-function signature="setCompleter(QCompleter*)">
4987 4988 <modify-argument index="1">
4988 4989 <reference-count variable-name="__rcCompleter" action="set"/>
4989 4990 </modify-argument>
4990 4991 </modify-function>
4991 4992 <modify-function signature="setValidator(const QValidator*)">
4992 4993 <modify-argument index="1">
4993 4994 <reference-count variable-name="__rcValidator" action="set"/>
4994 4995 </modify-argument>
4995 4996 </modify-function>
4996 4997 <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
4997 4998 <modify-argument index="1">
4998 4999 <define-ownership class="java" owner="c++"/>
4999 5000 <no-null-pointer/>
5000 5001 </modify-argument>
5001 5002 </modify-function>
5002 5003 <modify-function signature="setView(QAbstractItemView *)">
5003 5004 <modify-argument index="1">
5004 5005 <no-null-pointer/>
5005 5006 <!-- Safe to ignore because combo box reparents view -->
5006 5007 <reference-count action="ignore"/>
5007 5008 </modify-argument>
5008 5009 </modify-function>
5009 5010 <modify-function signature="setLineEdit(QLineEdit *)">
5010 5011 <modify-argument index="1">
5011 5012 <no-null-pointer/>
5012 5013 <!-- Safe to ignore because combo box reparents line edit -->
5013 5014 <reference-count action="ignore"/>
5014 5015 </modify-argument>
5015 5016 </modify-function>
5016 5017 <modify-function signature="setModel(QAbstractItemModel *)">
5017 5018 <modify-argument index="1">
5018 5019 <no-null-pointer/>
5019 5020 <reference-count action="set" variable-name="__rcModel"/>
5020 5021 </modify-argument>
5021 5022 </modify-function>
5022 5023 <inject-code>
5023 5024 <insert-template name="gui.init_style_option">
5024 5025 <replace from="%TYPE" to="QStyleOptionComboBox"/>
5025 5026 </insert-template>
5026 5027 </inject-code>
5027 5028 <modify-function signature="activated(int)">&gt;
5028 5029 <rename to="activatedIndex"/>
5029 5030 </modify-function>
5030 5031 <modify-function signature="currentIndexChanged(const QString &amp;)">
5031 5032 <rename to="currentStringChanged"/>
5032 5033 </modify-function>
5033 5034 <modify-function signature="highlighted(int)">
5034 5035 <rename to="highlightedIndex"/>
5035 5036 </modify-function>
5036 5037
5037 5038 <modify-function signature="autoCompletion()const" remove="all"/> <!--### Obsolete in 4.3-->
5038 5039 <modify-function signature="autoCompletionCaseSensitivity()const" remove="all"/> <!--### Obsolete in 4.3-->
5039 5040 <modify-function signature="setAutoCompletion(bool)" remove="all"/> <!--### Obsolete in 4.3-->
5040 5041 <modify-function signature="setAutoCompletionCaseSensitivity(Qt::CaseSensitivity)" remove="all"/> <!--### Obsolete in 4.3-->
5041 5042 </object-type>
5042 5043
5043 5044 <object-type name="QTextEdit">
5044 5045 <extra-includes>
5045 5046 <include file-name="QTextCursor" location="global"/>
5046 5047 </extra-includes>
5047 5048 <modify-function signature="setDocument(QTextDocument*)">
5048 5049 <modify-argument index="1">
5049 5050 <reference-count action="set" variable-name="__rcDocument"/>
5050 5051 </modify-argument>
5051 5052 </modify-function>
5052 5053 <modify-function signature="insertFromMimeData(const QMimeData*) ">
5053 5054 <modify-argument index="1">
5054 5055 <reference-count action="ignore"/>
5055 5056 </modify-argument>
5056 5057 </modify-function>
5057 5058 </object-type>
5058 5059
5059 5060 <object-type name="QPrinter" delete-in-main-thread="yes">
5060 5061 <modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
5061 5062 <modify-argument index="1">
5062 5063 <reference-count action="set" variable-name="__rcPrintEngine"/>
5063 5064 </modify-argument>
5064 5065 <modify-argument index="2">
5065 5066 <reference-count action="set" variable-name="__rcPaintEngine"/>
5066 5067 </modify-argument>
5067 5068 </modify-function>
5068 5069
5069 5070 <extra-includes>
5070 5071 <include file-name="QPrinterInfo" location="global"/>
5071 5072 </extra-includes>
5072 5073 </object-type>
5073 5074
5074 5075 <object-type name="QAction">
5075 5076 <modify-function signature="setMenu(QMenu*)">
5076 5077 <modify-argument index="1">
5077 5078 <reference-count action="set" variable-name="__rcMenu"/>
5078 5079 </modify-argument>
5079 5080 </modify-function>
5080 5081
5081 5082 </object-type>
5082 5083
5083 5084 <object-type name="QPainter">
5084 5085 <extra-includes>
5085 5086 <include file-name="QWidget" location="global"/>
5086 5087 <include file-name="QPainterPath" location="global"/>
5087 5088 <include file-name="QPixmap" location="global"/>
5088 5089 </extra-includes>
5089 5090
5090 5091 <modify-function signature="drawText(const QPointF &amp;, const QString &amp;, int, int)" remove="all"/>
5091 5092
5092 5093 <modify-function signature="drawConvexPolygon(const QPoint *, int)">
5093 5094 <remove/>
5094 5095 </modify-function>
5095 5096 <modify-function signature="drawConvexPolygon(const QPointF *, int)">
5096 5097 <remove/>
5097 5098 </modify-function>
5098 5099 <modify-function signature="drawLines(const QLine *, int)">
5099 5100 <remove/>
5100 5101 </modify-function>
5101 5102 <modify-function signature="drawLines(const QLineF *, int)">
5102 5103 <remove/>
5103 5104 </modify-function>
5104 5105 <modify-function signature="drawLines(const QPoint *, int)">
5105 5106 <remove/>
5106 5107 </modify-function>
5107 5108 <modify-function signature="drawLines(const QPointF *, int)">
5108 5109 <remove/>
5109 5110 </modify-function>
5110 5111 <modify-function signature="drawPoints(const QPoint *, int)">
5111 5112 <remove/>
5112 5113 </modify-function>
5113 5114 <modify-function signature="drawPoints(const QPointF *, int)">
5114 5115 <remove/>
5115 5116 </modify-function>
5116 5117 <modify-function signature="drawPolygon(const QPoint *, int, Qt::FillRule)">
5117 5118 <remove/>
5118 5119 </modify-function>
5119 5120 <modify-function signature="drawPolygon(const QPointF *, int, Qt::FillRule)">
5120 5121 <remove/>
5121 5122 </modify-function>
5122 5123 <modify-function signature="drawPolyline(const QPoint *, int)">
5123 5124 <remove/>
5124 5125 </modify-function>
5125 5126 <modify-function signature="drawPolyline(const QPointF *, int)">
5126 5127 <remove/>
5127 5128 </modify-function>
5128 5129 <modify-function signature="drawRects(const QRect *, int)">
5129 5130 <remove/>
5130 5131 </modify-function>
5131 5132 <modify-function signature="drawRects(const QRectF *, int)">
5132 5133 <remove/>
5133 5134 </modify-function>
5134 5135 <modify-function signature="drawLines(const QVector&lt;QPoint&gt; &amp;)">
5135 5136 <rename to="drawLinesFromPoints"/>
5136 5137 </modify-function>
5137 5138 <modify-function signature="drawLines(const QVector&lt;QPointF&gt; &amp;)">
5138 5139 <rename to="drawLinesFromPointsF"/>
5139 5140 </modify-function>
5140 5141 <modify-function signature="drawLines(const QVector&lt;QLineF&gt; &amp;)">
5141 5142 <rename to="drawLinesF"/>
5142 5143 </modify-function>
5143 5144 <modify-function signature="drawRects(const QVector&lt;QRectF&gt; &amp;)">
5144 5145 <rename to="drawRectsF"/>
5145 5146 </modify-function>
5146 5147
5147 5148 <modify-function signature="QPainter(QPaintDevice *)">
5148 5149 <modify-argument index="1">
5149 5150 <no-null-pointer/>
5150 5151 </modify-argument>
5151 5152 </modify-function>
5152 5153 <modify-function signature="begin(QPaintDevice *)">
5153 5154 <modify-argument index="1">
5154 5155 <no-null-pointer/>
5155 5156 </modify-argument>
5156 5157 </modify-function>
5157 5158 <modify-function signature="initFrom(const QWidget *)">
5158 5159 <modify-argument index="1">
5159 5160 <no-null-pointer/>
5160 5161 </modify-argument>
5161 5162 </modify-function>
5162 5163 <modify-function signature="setRedirected(const QPaintDevice *, QPaintDevice *, const QPoint &amp;)">
5163 5164 <modify-argument index="1">
5164 5165 <no-null-pointer/>
5165 5166 </modify-argument>
5166 5167 </modify-function>
5167 5168 <modify-function signature="restoreRedirected(const QPaintDevice *)">
5168 5169 <modify-argument index="1">
5169 5170 <no-null-pointer/>
5170 5171 </modify-argument>
5171 5172 </modify-function>
5172 5173
5173 5174 <modify-function signature="drawText(QRect,int,QString,QRect*)">
5174 5175 <access modifier="private"/>
5175 5176 <modify-argument index="4">
5176 5177 <remove-default-expression/>
5177 5178 </modify-argument>
5178 5179 </modify-function>
5179 5180
5180 5181 <modify-function signature="drawText(QRectF,int,QString,QRectF*)">
5181 5182 <access modifier="private"/>
5182 5183 <modify-argument index="4">
5183 5184 <remove-default-expression/>
5184 5185 </modify-argument>
5185 5186 </modify-function>
5186 5187
5187 5188 <modify-function signature="drawText(int,int,int,int,int,QString,QRect*)">
5188 5189 <access modifier="private"/>
5189 5190 <modify-argument index="7">
5190 5191 <remove-default-expression/>
5191 5192 </modify-argument>
5192 5193 </modify-function>
5193 5194
5194 5195 <modify-function signature="redirected(const QPaintDevice*,QPoint*)">
5195 5196 <access modifier="private"/>
5196 5197 <modify-argument index="2">
5197 5198 <remove-default-expression/>
5198 5199 </modify-argument>
5199 5200 </modify-function>
5200 5201 <modify-function signature="matrix()const" remove="all"/> <!--### Obsolete in 4.3-->
5201 5202 <modify-function signature="matrixEnabled()const" remove="all"/> <!--### Obsolete in 4.3-->
5202 5203 <modify-function signature="setMatrix(QMatrix, bool)" remove="all"/> <!--### Obsolete in 4.3-->
5203 5204 <modify-function signature="setMatrixEnabled(bool)" remove="all"/> <!--### Obsolete in 4.3-->
5204 5205
5205 5206 <modify-function signature="setBrush(Qt::BrushStyle)" remove="all"/> <!--### Problematic in PythonQt -->
5206 5207
5207 5208 <modify-function signature="begin(QPaintDevice*)">
5208 5209 <modify-argument index="1">
5209 5210 <conversion-rule class="native">
5210 5211 <insert-template name="core.convert_pointer_arg_and_check_null">
5211 5212 <replace from="%TYPE%" to="QPaintDevice*"/>
5212 5213 <replace from="%CLASS_NAME%" to="QPainter"/>
5213 5214 <replace from="%FUNCTION_NAME%" to="begin"/>
5214 5215 </insert-template>
5215 5216 </conversion-rule>
5216 5217 </modify-argument>
5217 5218 </modify-function>
5218 5219 </object-type>
5219 5220
5220 5221 <object-type name="QApplication">
5221 5222 <extra-includes>
5222 5223 <include file-name="QBasicTimer" location="global"/>
5223 5224 <include file-name="QFont" location="global"/>
5224 5225 <include file-name="QFontMetrics" location="global"/>
5225 5226 <include file-name="QPalette" location="global"/>
5226 5227 <include file-name="QIcon" location="global"/>
5227 5228 <include file-name="QLocale" location="global"/>
5228 5229 </extra-includes>
5229 5230
5230 5231 <modify-function signature="QApplication(int &amp;, char **, int)">
5231 5232 <access modifier="private"/>
5232 5233 </modify-function>
5233 5234 <modify-function signature="QApplication(int &amp;, char **, QApplication::Type, int)">
5234 5235 <remove/>
5235 5236 </modify-function>
5236 5237 <modify-function signature="QApplication(int &amp;, char **, bool, int)">
5237 5238 <remove/>
5238 5239 </modify-function>
5239 5240
5240 5241 <modify-function signature="font(const char*)">
5241 5242 <remove/>
5242 5243 </modify-function>
5243 5244 <modify-function signature="setFont(QFont,const char*)">
5244 5245 <access modifier="private"/>
5245 5246 <modify-argument index="2">
5246 5247 <remove-default-expression/>
5247 5248 </modify-argument>
5248 5249 </modify-function>
5249 5250
5250 5251 <modify-function signature="palette(const char*)">
5251 5252 <remove/>
5252 5253 </modify-function>
5253 5254 <modify-function signature="setPalette(QPalette,const char*)">
5254 5255 <access modifier="private"/>
5255 5256 <modify-argument index="2">
5256 5257 <remove-default-expression/>
5257 5258 </modify-argument>
5258 5259 </modify-function>
5259 5260
5260 5261 <modify-function signature="overrideCursor()">
5261 5262 <access modifier="private"/>
5262 5263 <rename to="overrideCursor_private"/>
5263 5264 </modify-function>
5264 5265
5265 5266 <modify-function signature="setInputContext(QInputContext*)">
5266 5267 <modify-argument index="1">
5267 5268 <define-ownership class="java" owner="c++"/>
5268 5269 </modify-argument>
5269 5270 </modify-function>
5270 5271 <modify-function signature="setActiveWindow(QWidget*)">
5271 5272 <modify-argument index="1">
5272 5273 <reference-count action="ignore"/>
5273 5274 </modify-argument>
5274 5275 </modify-function>
5275 5276 <modify-function signature="setStyle(QStyle*)">
5276 5277 <modify-argument index="1">
5277 5278 <reference-count action="ignore"/>
5278 5279 </modify-argument>
5279 5280 </modify-function>
5280 5281
5281 5282 <modify-function signature="QApplication(int&amp;,char**,QApplication::Type,int)" remove="all"/>
5282 5283 <modify-function signature="QApplication(int&amp;,char**,bool,int)" remove="all"/>
5283 5284 <modify-function signature="QApplication(int&amp;,char**,int)" remove="all"/>
5284 5285 <modify-function signature="commitData(QSessionManager&amp;)" remove="all"/>
5285 5286 <modify-function signature="saveState(QSessionManager&amp;)" remove="all"/>
5286 5287 <modify-function signature="fontMetrics()" remove="all"/>
5287 5288 <modify-function signature="setFont(QFont,const char*)">
5288 5289 <modify-argument index="2">
5289 5290 <replace-type modified-type="QString"/>
5290 5291 <conversion-rule class="native">
5291 5292 <insert-template name="core.convert_string_arg_to_char*"/>
5292 5293 </conversion-rule>
5293 5294 </modify-argument>
5294 5295 </modify-function>
5295 5296 <modify-function signature="setPalette(QPalette,const char*)">
5296 5297 <modify-argument index="2">
5297 5298 <replace-type modified-type="QString"/>
5298 5299 <conversion-rule class="native">
5299 5300 <insert-template name="core.convert_string_arg_to_char*"/>
5300 5301 </conversion-rule>
5301 5302 </modify-argument>
5302 5303 </modify-function>
5303 5304 </object-type>
5304 5305
5305 5306 <object-type name="QMouseEventTransition"/>
5306 5307 <object-type name="QKeyEventTransition"/>
5307 5308 <value-type name="QQuaternion"/>
5308 5309
5309 5310 <object-type name="QCommandLinkButton"/>
5310 5311 <object-type name="QFileSystemModel">
5311 5312 <modify-function signature="setIconProvider(QFileIconProvider*)">
5312 5313 <modify-argument index="1">
5313 5314 <reference-count action="set" variable-name="__rcIconProvider"/>
5314 5315 </modify-argument>
5315 5316 </modify-function>
5316 5317 </object-type>
5317 5318 <object-type name="QFormLayout">
5318 5319 <modify-function signature="addRow(QWidget*,QWidget*)">
5319 5320 <modify-argument index="1">
5320 5321 <reference-count action="ignore"/>
5321 5322 </modify-argument>
5322 5323 <modify-argument index="2">
5323 5324 <reference-count action="ignore"/>
5324 5325 </modify-argument>
5325 5326 </modify-function>
5326 5327 <modify-function signature="addRow(QLayout*)">
5327 5328 <modify-argument index="1">
5328 5329 <reference-count action="ignore"/>
5329 5330 </modify-argument>
5330 5331 </modify-function>
5331 5332 <modify-function signature="addRow(QWidget*,QLayout*)">
5332 5333 <modify-argument index="1">
5333 5334 <reference-count action="ignore"/>
5334 5335 </modify-argument>
5335 5336 <modify-argument index="2">
5336 5337 <reference-count action="ignore"/>
5337 5338 </modify-argument>
5338 5339 </modify-function>
5339 5340
5340 5341 <modify-function signature="addRow(QWidget*)">
5341 5342 <modify-argument index="1">
5342 5343 <reference-count action="ignore"/>
5343 5344 </modify-argument>
5344 5345 </modify-function>
5345 5346 <modify-function signature="addRow(QString,QLayout*)">
5346 5347 <modify-argument index="2">
5347 5348 <reference-count action="ignore"/>
5348 5349 </modify-argument>
5349 5350 </modify-function>
5350 5351 <modify-function signature="addRow(QString,QWidget*)">
5351 5352 <modify-argument index="2">
5352 5353 <reference-count action="ignore"/>
5353 5354 </modify-argument>
5354 5355 </modify-function>
5355 5356 <modify-function signature="insertRow(int,QLayout*)">
5356 5357 <modify-argument index="2">
5357 5358 <reference-count action="ignore"/>
5358 5359 </modify-argument>
5359 5360 </modify-function>
5360 5361 <modify-function signature="insertRow(int,QWidget*,QLayout*)">
5361 5362 <modify-argument index="2">
5362 5363 <reference-count action="ignore"/>
5363 5364 </modify-argument>
5364 5365 <modify-argument index="3">
5365 5366 <reference-count action="ignore"/>
5366 5367 </modify-argument>
5367 5368 </modify-function>
5368 5369 <modify-function signature="insertRow(int,QWidget*,QWidget*)">
5369 5370 <modify-argument index="2">
5370 5371 <reference-count action="ignore"/>
5371 5372 </modify-argument>
5372 5373 <modify-argument index="3">
5373 5374 <reference-count action="ignore"/>
5374 5375 </modify-argument>
5375 5376 </modify-function>
5376 5377 <modify-function signature="insertRow(int,QWidget*)">
5377 5378 <modify-argument index="2">
5378 5379 <reference-count action="ignore"/>
5379 5380 </modify-argument>
5380 5381 </modify-function>
5381 5382 <modify-function signature="insertRow(int,QString,QLayout*)">
5382 5383 <modify-argument index="3">
5383 5384 <reference-count action="ignore"/>
5384 5385 </modify-argument>
5385 5386 </modify-function>
5386 5387 <modify-function signature="insertRow(int,QString,QWidget*)">
5387 5388 <modify-argument index="3">
5388 5389 <reference-count action="ignore"/>
5389 5390 </modify-argument>
5390 5391 </modify-function>
5391 5392 <modify-function signature="setLayout(int,QFormLayout::ItemRole,QLayout*)">
5392 5393 <modify-argument index="3">
5393 5394 <reference-count action="ignore"/>
5394 5395 </modify-argument>
5395 5396 </modify-function>
5396 5397 <modify-function signature="setWidget(int,QFormLayout::ItemRole,QWidget*)">
5397 5398 <modify-argument index="3">
5398 5399 <reference-count action="ignore"/>
5399 5400 </modify-argument>
5400 5401 </modify-function>
5401 5402 <modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)" access="private" rename="setItem_private">
5402 5403 <modify-argument index="3">
5403 5404 <define-ownership class="java" owner="c++"/>
5404 5405 </modify-argument>
5405 5406 </modify-function>
5406 5407 <modify-function signature="addItem(QLayoutItem*)">
5407 5408 <modify-argument index="1">
5408 5409 <define-ownership class="java" owner="c++"/>
5409 5410 </modify-argument>
5410 5411 </modify-function>
5411 5412 </object-type>
5412 5413 <object-type name="QGraphicsGridLayout" delete-in-main-thread="yes">
5413 5414 <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
5414 5415 <modify-argument index="1">
5415 5416 <reference-count action="add" variable-name="__rcItems"/>
5416 5417 </modify-argument>
5417 5418 </modify-function>
5418 5419 <modify-function signature="addItem(QGraphicsLayoutItem*,int,int,int,int,QFlags&lt;Qt::AlignmentFlag&gt;)">
5419 5420 <modify-argument index="1">
5420 5421 <reference-count action="add" variable-name="__rcItems"/>
5421 5422 </modify-argument>
5422 5423 </modify-function>
5423 5424 <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
5424 5425 <modify-argument index="1">
5425 5426 <reference-count action="ignore"/>
5426 5427 </modify-argument>
5427 5428 </modify-function>
5428 5429 </object-type>
5429 5430 <object-type name="QGraphicsLayout" delete-in-main-thread="yes">
5430 5431
5431 5432 <modify-function signature="widgetEvent(QEvent*)">
5432 5433 <modify-argument index="1" invalidate-after-use="yes"/>
5433 5434 </modify-function>
5434 5435 <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
5435 5436 <modify-argument index="1">
5436 5437 <reference-count action="set" variable-name="__rcParentLayoutItem"/>
5437 5438 </modify-argument>
5438 5439 </modify-function>
5439 5440 <modify-function signature="setGraphicsItem(QGraphicsItem*)">
5440 5441 <modify-argument index="1">
5441 5442 <reference-count action="set" variable-name="__rcItem"/>
5442 5443 </modify-argument>
5443 5444 </modify-function>
5444 5445 </object-type>
5445 5446 <interface-type name="QGraphicsLayoutItem" delete-in-main-thread="yes">
5446 5447 <modify-function signature="setParentLayoutItem(QGraphicsLayoutItem*)">
5447 5448 <modify-argument index="1">
5448 5449 <reference-count action="set" variable-name="__rcParentLayoutItem"/>
5449 5450 </modify-argument>
5450 5451 </modify-function>
5451 5452 <modify-function signature="setGraphicsItem(QGraphicsItem*)">
5452 5453 <modify-argument index="1">
5453 5454 <reference-count action="set" variable-name="__rcItem"/>
5454 5455 </modify-argument>
5455 5456 </modify-function>
5456 5457 </interface-type>
5457 5458 <object-type name="QGraphicsLinearLayout" delete-in-main-thread="yes">
5458 5459 <modify-function signature="addItem(QGraphicsLayoutItem*)">
5459 5460 <modify-argument index="1">
5460 5461 <reference-count action="add" variable-name="__rcItems"/>
5461 5462 </modify-argument>
5462 5463 </modify-function>
5463 5464 <modify-function signature="insertItem(int,QGraphicsLayoutItem*)">
5464 5465 <modify-argument index="2">
5465 5466 <reference-count action="add" variable-name="__rcItems"/>
5466 5467 </modify-argument>
5467 5468 </modify-function>
5468 5469 <modify-function signature="removeItem(QGraphicsLayoutItem*)">
5469 5470 <modify-argument index="1">
5470 5471 <reference-count action="remove" variable-name="__rcItems"/>
5471 5472 </modify-argument>
5472 5473 </modify-function>
5473 5474 <modify-function signature="setAlignment(QGraphicsLayoutItem*,QFlags&lt;Qt::AlignmentFlag&gt;)">
5474 5475 <modify-argument index="1">
5475 5476 <reference-count action="ignore"/>
5476 5477 </modify-argument>
5477 5478 </modify-function>
5478 5479 <modify-function signature="setStretchFactor(QGraphicsLayoutItem*,int)">
5479 5480 <modify-argument index="1">
5480 5481 <reference-count action="ignore"/>
5481 5482 </modify-argument>
5482 5483 </modify-function>
5483 5484 </object-type>
5484 5485 <object-type name="QGraphicsProxyWidget"/> <!-- a QObject so main-thread delete redundant -->
5485 5486 <object-type name="QGraphicsWidget"
5486 5487 polymorphic-id-expression="%1-&gt;isWidget()">
5487 5488 <!-- a QObject so main-thread delete redundant -->
5488 5489 <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
5489 5490 <modify-function signature="children()const" remove="all"/>
5490 5491 <modify-function signature="setLayout(QGraphicsLayout*)">
5491 5492 <modify-argument index="1">
5492 5493 <reference-count action="set" variable-name="__rcLayout"/>
5493 5494 </modify-argument>
5494 5495 </modify-function>
5495 5496
5496 5497 <modify-function signature="addAction(QAction*)">
5497 5498 <modify-argument index="1">
5498 5499 <reference-count action="add" variable-name="__rcActions"/>
5499 5500 </modify-argument>
5500 5501 </modify-function>
5501 5502 <modify-function signature="insertAction(QAction*,QAction*)">
5502 5503 <modify-argument index="2">
5503 5504 <reference-count action="add" variable-name="__rcActions"/>
5504 5505 </modify-argument>
5505 5506 </modify-function>
5506 5507 <modify-function signature="insertActions(QAction*,QList&lt;QAction*&gt;)">
5507 5508 <modify-argument index="2">
5508 5509 <reference-count action="add" variable-name="__rcActions"/>
5509 5510 </modify-argument>
5510 5511 </modify-function>
5511 5512 <modify-function signature="removeAction(QAction*)">
5512 5513 <modify-argument index="1">
5513 5514 <reference-count action="remove" variable-name="__rcActions"/>
5514 5515 </modify-argument>
5515 5516 </modify-function>
5516 5517
5517 5518
5518 5519 <modify-function signature="changeEvent(QEvent*)">
5519 5520 <modify-argument index="1" invalidate-after-use="yes"/>
5520 5521 </modify-function>
5521 5522 <modify-function signature="closeEvent(QCloseEvent*)">
5522 5523 <modify-argument index="1" invalidate-after-use="yes"/>
5523 5524 </modify-function>
5524 5525 <modify-function signature="grabKeyboardEvent(QEvent*)">
5525 5526 <modify-argument index="1" invalidate-after-use="yes"/>
5526 5527 </modify-function>
5527 5528 <modify-function signature="grabMouseEvent(QEvent*)">
5528 5529 <modify-argument index="1" invalidate-after-use="yes"/>
5529 5530 </modify-function>
5530 5531 <modify-function signature="hideEvent(QHideEvent*)">
5531 5532 <modify-argument index="1" invalidate-after-use="yes"/>
5532 5533 </modify-function>
5533 5534 <modify-function signature="moveEvent(QGraphicsSceneMoveEvent*)">
5534 5535 <modify-argument index="1" invalidate-after-use="yes"/>
5535 5536 </modify-function>
5536 5537 <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
5537 5538 <modify-argument index="1" invalidate-after-use="yes"/>
5538 5539 </modify-function>
5539 5540 <modify-function signature="resizeEvent(QGraphicsSceneResizeEvent*)">
5540 5541 <modify-argument index="1" invalidate-after-use="yes"/>
5541 5542 </modify-function>
5542 5543 <modify-function signature="showEvent(QShowEvent*)">
5543 5544 <modify-argument index="1" invalidate-after-use="yes"/>
5544 5545 </modify-function>
5545 5546 <modify-function signature="ungrabKeyboardEvent(QEvent*)">
5546 5547 <modify-argument index="1" invalidate-after-use="yes"/>
5547 5548 </modify-function>
5548 5549 <modify-function signature="ungrabMouseEvent(QEvent*)">
5549 5550 <modify-argument index="1" invalidate-after-use="yes"/>
5550 5551 </modify-function>
5551 5552 <modify-function signature="windowFrameEvent(QEvent*)">
5552 5553 <modify-argument index="1" invalidate-after-use="yes"/>
5553 5554 </modify-function>
5554 5555
5555 5556 <modify-function signature="setStyle(QStyle*)">
5556 5557 <modify-argument index="1">
5557 5558 <reference-count action="set" variable-name="__rcStyle"/>
5558 5559 </modify-argument>
5559 5560 </modify-function>
5560 5561 <modify-function signature="setTabOrder(QGraphicsWidget*,QGraphicsWidget*)">
5561 5562 <modify-argument index="1">
5562 5563 <reference-count action="ignore"/>
5563 5564 </modify-argument>
5564 5565 <modify-argument index="2">
5565 5566 <reference-count action="ignore"/>
5566 5567 </modify-argument>
5567 5568 </modify-function>
5568 5569 </object-type>
5569 5570 <object-type name="QPlainTextDocumentLayout"/>
5570 5571 <object-type name="QPlainTextEdit">
5571 5572 <modify-function signature="setDocument(QTextDocument*)">
5572 5573 <modify-argument index="1">
5573 5574 <reference-count action="set" variable-name="__rcDocument"/>
5574 5575 </modify-argument>
5575 5576 </modify-function>
5576 5577 <modify-function signature="insertFromMimeData(const QMimeData*)">
5577 5578 <modify-argument index="1">
5578 5579 <reference-count action="ignore"/>
5579 5580 </modify-argument>
5580 5581 </modify-function>
5581 5582 </object-type>
5582 5583 <object-type name="QPrintPreviewDialog">
5583 5584 </object-type>
5584 5585 <object-type name="QPrintPreviewWidget"/>
5585 5586 <object-type name="QStyledItemDelegate">
5586 5587 <modify-function signature="setItemEditorFactory(QItemEditorFactory*)">
5587 5588 <modify-argument index="1">
5588 5589 <reference-count action="set" variable-name="__rcItemEditorFactory"/>
5589 5590 </modify-argument>
5590 5591 </modify-function>
5591 5592 <modify-function signature="setEditorData(QWidget*,QModelIndex)const">
5592 5593 <modify-argument index="1">
5593 5594 <reference-count action="ignore"/>
5594 5595 </modify-argument>
5595 5596 </modify-function>
5596 5597 <modify-function signature="setModelData(QWidget*,QAbstractItemModel*,QModelIndex)const">
5597 5598 <modify-argument index="1">
5598 5599 <reference-count action="ignore"/>
5599 5600 </modify-argument>
5600 5601 </modify-function>
5601 5602 </object-type>
5602 5603
5603 5604 <interface-type name="QAccessibleFactoryInterface" java-name="QAbstractAccessibleFactory"/>
5604 5605 <interface-type name="QIconEngineFactoryInterfaceV2" java-name="QAbstractIconEngineFactoryV2"/>
5605 5606 <interface-type name="QImageIOHandlerFactoryInterface" java-name="QAbstractImageIOHandlerFactory"/>
5606 5607 <interface-type name="QInputContextFactoryInterface" java-name="QAbstractInputContextFactory"/>
5607 5608 <interface-type name="QStyleFactoryInterface" java-name="QAbstractStyleFactory"/>
5608 5609 <interface-type name="QTextCodecFactoryInterface" java-name="QAbstractTextCodecFactory"/>
5609 5610 <interface-type name="QPictureFormatInterface" java-name="QAbstractPictureFormat"/>
5610 5611
5611 5612 <object-type name="QIconEnginePluginV2"/>
5612 5613 <object-type name="QAccessiblePlugin"/>
5613 5614 <object-type name="QImageIOPlugin"/>
5614 5615 <object-type name="QInputContextPlugin"/>
5615 5616 <object-type name="QPictureFormatPlugin"/>
5616 5617 <object-type name="QStylePlugin"/>
5617 5618 <object-type name="QTextCodecPlugin"/>
5618 5619 <object-type name="QGesture"/>
5619 5620 <object-type name="QTapGesture"/>
5620 5621 <object-type name="QTapAndHoldGesture"/>
5621 5622 <object-type name="QGraphicsAnchorLayout"/>
5622 5623 <object-type name="QGraphicsAnchor"/>
5623 5624 <object-type name="QGraphicsEffect"/>
5624 5625 <object-type name="QStaticText"/>
5625 5626 <object-type name="QGraphicsObject">
5626 5627 <!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
5627 5628 <modify-function signature="children()const" remove="all"/>
5628 5629 </object-type>
5629 5630 <object-type name="QGraphicsBlurEffect"/>
5630 5631 <object-type name="QGraphicsColorizeEffect"/>
5631 5632 <object-type name="QGraphicsDropShadowEffect"/>
5632 5633 <object-type name="QGraphicsOpacityEffect"/>
5633 5634 <object-type name="QGraphicsPixelizeEffect"/>
5634 5635 <object-type name="QGraphicsRotation"/>
5635 5636 <object-type name="QGraphicsScale"/>
5636 5637 <object-type name="QGraphicsTransform"/>
5637 5638 <object-type name="QPanGesture"/>
5638 5639 <object-type name="QPinchGesture"/>
5639 5640 <object-type name="QProxyStyle"/>
5640 5641 <object-type name="QSwipeGesture"/>
5641 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 5644 <!-- Inefficient hash codes -->
5644 5645 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFrame_iterator' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5645 5646 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextTableCell' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5646 5647 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextOption_Tab' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5647 5648 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextLength' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5648 5649 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock_iterator' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5649 5650 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextBlock' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5650 5651 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextCursor' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5651 5652 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath_Element' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5652 5653 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPainterPath' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5653 5654 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QItemSelection' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5654 5655 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QKeySequence' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5655 5656 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QSizePolicy' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5656 5657 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFragment' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5657 5658 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetrics' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5658 5659 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGradient' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5659 5660 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QFontMetricsF' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5660 5661 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QTextFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5661 5662 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QEasingCurve' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5662 5663 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGenericMatrix' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5663 5664 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMatrix4x4' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5664 5665 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QMargins' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5665 5666 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QPixmapCache_Key' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5666 5667 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector4D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5667 5668 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QQuaternion' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5668 5669 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QVector2D' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
5669 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 5672 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QPanGesture'"/>
5672 5673 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'event(QEvent * event)' in 'QPanGesture'"/>
5673 5674 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QSwipeGesture'"/>
5674 5675 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'eventFilter(QObject * receiver, QEvent * event)' in 'QPinchGesture'"/>
5675 5676 <suppress-warning text="WARNING(MetaJavaBuilder) :: private virtual function 'event(QEvent * event)' in 'QPinchGesture'"/>
5676 5677
5677 5678 <!-- Intentional omissions. See explanation for QtJambiTextObjectInterface class in typesystem and headers. -->
5678 5679 <suppress-warning text="WARNING(MetaJavaBuilder) :: class 'QTextObjectInterface' inherits from unknown base class 'QTextObjectInterface'"/>
5679 5680 <suppress-warning text="WARNING(MetaJavaBuilder) :: unknown interface for 'QTextObjectInterface': 'QTextObjectInterfaceInterface'"/>
5680 5681
5681 5682 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QPixmapFilter' inherits from polymorphic class 'QPixmapFilter', but has no polymorphic id set"/>
5682 5683 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::QPixmap', unmatched parameter type 'QPixmapData*'"/>
5683 5684 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private&amp;'"/>
5684 5685 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private\*'"/>
5685 5686 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*Private const\*'"/>
5686 5687 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextEngine\*'"/>
5687 5688 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QFontEngine\*'"/>
5688 5689 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QPixmap::Type'"/>
5689 5690 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QInputDialog::Type'"/>
5690 5691 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QTextFrameLayoutData\*'"/>
5691 5692 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QAbstractUndoItem\*'"/>
5692 5693 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type '*QImageTextKeyLang*'"/>
5693 5694 <suppress-warning text="WARNING(MetaJavaBuilder) :: non-public function '*' in interface '*'"/>
5694 5695 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
5695 5696 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
5696 5697 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVector&lt;FormatRange&gt;()' of argument in function '*', class '*'"/>
5697 5698 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QVariantList()' of argument in function '*', class '*'"/>
5698 5699 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
5699 5700 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QTextLayout::QTextLayout', unmatched parameter type 'QTextEngine*'"/>
5700 5701 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value of argument in function 'doAction', class 'QAccessibleInterface'"/>
5701 5702 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QFileDialog::QFileDialog', unmatched parameter type 'QFileDialogArgs const&amp;'"/>
5702 5703 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '0., 0., 1000000000., 1000000000.' of argument in function 'update', class 'QAbstractTextDocumentLayout'"/>
5703 5704 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::windowSurface', unmatched return type 'QWindowSurface*'"/>
5704 5705 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWidget::setWindowSurface', unmatched parameter type 'QWindowSurface*'"/>
5705 5706 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QStyleOption::StyleOptionType' does not have a type entry or is not an enum"/>
5706 5707 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~FlagMask in QMessageBox::StandardButton"/>
5707 5708 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~FlagMask"/>
5708 5709 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QGraphicsSceneEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
5709 5710 <suppress-warning text="WARNING(MetaInfoGenerator) :: class 'QInputEvent' inherits from polymorphic class 'QEvent', but has no polymorphic id set"/>
5710 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 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 5714 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QPixmap::pixmapData', unmatched return type 'QPixmapData*'"/>
5714 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 5717 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles"/>
5717 5718
5718 5719 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'QtSharedPointer' does not have a type entry"/>
5719 5720
5720 5721 </typesystem>
@@ -1,173 +1,174
1 1 <?xml version="1.0"?>
2 2 <typesystem package="com.trolltech.qt.webkit">
3 3 <rejection class="WebCore"/>
4 4 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping field 'QWebPluginFactory_Plugin::mimeTypes' with unmatched type 'QList&lt;MimeType&gt;'"/>
5 5 <namespace-type name="WebCore"/>
6 6
7 7 <enum-type name="QWebSettings::FontFamily"/>
8 8 <enum-type name="QWebSettings::FontSize"/>
9 9 <enum-type name="QWebSettings::WebGraphic"/>
10 10 <enum-type name="QWebSettings::WebAttribute">
11 11 <reject-enum-value name="LocalStorageEnabled"/>
12 12 </enum-type>
13 13
14 14 <enum-type name="QWebFrame::RenderLayer"/>
15 15
16 16 <enum-type name="QWebPage::Feature"/>
17 17 <enum-type name="QWebPage::PermissionPolicy"/>
18 18 <enum-type name="QWebPage::Extension"/>
19 19 <enum-type name="QWebPage::NavigationType"/>
20 20 <enum-type name="QWebPage::WebAction"/>
21 21 <enum-type name="QWebPage::WebWindowType"/>
22 22 <enum-type name="QWebPage::FindFlag" flags="QWebPage::FindFlags"/>
23 23 <enum-type name="QWebPage::LinkDelegationPolicy"/>
24 24 <enum-type name="QWebPluginFactory::Extension"/>
25 25 <enum-type name="QWebElement::StyleResolveStrategy"/>
26 26 <enum-type name="QWebHistory::HistoryStateVersion">
27 27 <reject-enum-value name="DefaultHistoryVersion"/>
28 28 </enum-type>
29 29 <enum-type name="QWebPage::ErrorDomain"/>
30 30
31 31 <object-type name="QWebHistory"/>
32 32 <object-type name="QWebHistoryItem"/>
33 33 <value-type name="QWebElementCollection"/>
34 34
35 35 <object-type name="QGraphicsWebView"/>
36 36 <object-type name="QWebView">
37 37 <modify-function signature="setPage(QWebPage*)">
38 38 <modify-argument index="1">
39 39 <define-ownership class="java" owner="c++"/>
40 40 </modify-argument>
41 41 </modify-function>
42 42 </object-type>
43 43 <object-type name="QWebFrame">
44 44 <modify-function signature="addToJavaScriptWindowObject(QString,QObject*)">
45 45 <modify-argument index="2">
46 46 <reference-count action="ignore"/>
47 47 </modify-argument>
48 48 </modify-function>
49 <modify-function signature="event(QEvent*)" remove="all"/>
49 50 </object-type>
50 51 <object-type name="QWebPage::ExtensionOption"/>
51 52 <object-type name="QWebPage::ChooseMultipleFilesExtensionOption"/>
52 53 <object-type name="QWebPage::ExtensionReturn"/>
53 54 <object-type name="QWebPage::ChooseMultipleFilesExtensionReturn"/>
54 55 <object-type name="QWebHistory">
55 56 <modify-function signature="saveState(QWebHistory::HistoryStateVersion)const">
56 57 <modify-argument index="1"><remove-default-expression/></modify-argument>
57 58 </modify-function>
58 59 </object-type>
59 60 <object-type name="QWebSettings"/>
60 61 <object-type name="QWebPage">
61 62 <modify-function signature="javaScriptPrompt(QWebFrame*,QString,QString,QString*)">
62 63 <access modifier="private"/>
63 64 </modify-function>
64 65 <modify-function signature="setView(QWidget*)">
65 66 <modify-argument index="1">
66 67 <reference-count action="set" variable-name="__rcView"/>
67 68 </modify-argument>
68 69 </modify-function>
69 70 <modify-function signature="setNetworkAccessManager(QNetworkAccessManager*)">
70 71 <modify-argument index="1">
71 72 <define-ownership class="java" owner="c++"/>
72 73 </modify-argument>
73 74 </modify-function>
74 75 </object-type>
75 76
76 77 <value-type name="QWebHitTestResult">
77 78 <modify-function signature="operator=(QWebHitTestResult)" remove="all"/>
78 79 </value-type>
79 80
80 81 <value-type name="QWebHistoryItem">
81 82 <custom-constructor>
82 83 return new QWebHistoryItem(*copy);
83 84 </custom-constructor>
84 85 <custom-destructor>
85 86 delete copy;
86 87 </custom-destructor>
87 88 <modify-function signature="operator=(QWebHistoryItem)" remove="all"/>
88 89 </value-type>
89 90
90 91 <object-type name="QWebHistoryInterface">
91 92 <modify-function signature="setDefaultInterface(QWebHistoryInterface*)">
92 93 <modify-argument index="1">
93 94 <reference-count action="set" variable-name="__rcInterface"/>
94 95 </modify-argument>
95 96 </modify-function>
96 97 </object-type>
97 98
98 99 <object-type name="QWebPluginFactory"/>
99 100 <object-type name="QWebPluginDatabase"/>
100 101 <object-type name="QWebInspector"/>
101 102
102 103 <value-type name="QWebPluginInfo"/>
103 104 <value-type name="QWebElement"/>
104 105 <value-type name="QWebPluginFactory::Plugin"/>
105 106 <value-type name="QWebPluginFactory::MimeType"/>
106 107 <value-type name="QWebSecurityOrigin">
107 108 <custom-constructor>
108 109 return new QWebSecurityOrigin(*copy);
109 110 </custom-constructor>
110 111 <custom-destructor>
111 112 delete copy;
112 113 </custom-destructor>
113 114 </value-type>
114 115 <value-type name="QWebDatabase">
115 116 <custom-constructor>
116 117 return new QWebDatabase(*copy);
117 118 </custom-constructor>
118 119 <custom-destructor>
119 120 delete copy;
120 121 </custom-destructor>
121 122 </value-type>
122 123 <object-type name="QWebPluginFactory::ExtensionOption"/>
123 124 <object-type name="QWebPluginFactory::ExtensionReturn"/>
124 125 <object-type name="QWebPage::ErrorPageExtensionOption"/>
125 126 <object-type name="QWebPage::ErrorPageExtensionReturn"/>
126 127
127 128 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebFrame::QWebFrame', unmatched parameter type 'QWebFrameData*'"/>
128 129 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebSettings::QWebSettings', unmatched parameter type 'WebCore::Settings*'"/>
129 130 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebPluginInfo::QWebPluginInfo', unmatched parameter type 'WebCore::PluginPackage*'"/>
130 131 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::enclosingElement', unmatched parameter type 'WebCore::Node*'"/>
131 132 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::QWebElement', unmatched parameter type 'WebCore::Node*'"/>
132 133 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebElement::QWebElement', unmatched parameter type 'WebCore::Element*'"/>
133 134 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping field 'QWebPluginFactory_Plugin::mimeTypes' with unmatched type 'QList&lt;MimeType&gt;'"/>
134 135 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QWebPluginInfo' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
135 136 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QWebPluginFactory_MimeType' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
136 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 139 <!-- Needed to avoid warnings on compilers that don't support webkit -->
139 140 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::Plugin' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
140 141 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::ExtensionReturn' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
141 142 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::MimeType' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
142 143 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'Extension' is not declared"/>
143 144 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory::ExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
144 145 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPluginFactory' for enum 'Extension' is not declared"/>
145 146 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPluginFactory' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
146 147 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'NavigationRequestResponse' is not declared"/>
147 148 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'WebAttribute' is not declared"/>
148 149 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebSettings' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
149 150 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryItem' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
150 151 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistoryInterface' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
151 152 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'WebAction' is not declared"/>
152 153 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontSize' is not declared"/>
153 154 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'WebGraphic' is not declared"/>
154 155 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'NavigationType' is not declared"/>
155 156 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontType' is not declared"/>
156 157 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebFrame' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
157 158 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHistory' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
158 159 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebView' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
159 160 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
160 161 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebHitTestResult' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
161 162 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'FindFlag' is not declared"/>
162 163 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'LinkDelegationPolicy' is not declared"/>
163 164 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebSettings' for enum 'FontFamily' is not declared"/>
164 165 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace 'com.trolltech.qt.webkit.QWebPage' for enum 'WebWindowType' is not declared"/>
165 166 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function 'QWebFrame::addToJavaScriptWindowObject', unmatched parameter type 'QScriptEngine::ValueOwnership'"/>
166 167 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebDatabase' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
167 168 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ExtensionReturn' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
168 169 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
169 170 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebPage::ChooseMultipleFilesExtensionOption' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
170 171 <suppress-warning text="WARNING(MetaJavaBuilder) :: type 'QWebSecurityOrigin' is specified in typesystem, but not defined. This could potentially lead to compilation errors."/>
171 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 174 </typesystem>
1 NO CONTENT: modified file chmod 100644 => 100755
@@ -1,1604 +1,1604
1 1 <?xml version="1.0"?>
2 2 <typesystem package="com.trolltech.qt.core">
3 3
4 4 <template name="core.prepare_removed_bool*_argument">
5 5 bool __ok;
6 6 bool *%out% = &amp;__ok;
7 7 </template>
8 8
9 9 <template name="core.convert_to_null_or_wrap">
10 10 QScriptValue %out%;
11 11 if (!__ok)
12 12 %out% = context->engine()->nullValue();
13 13 else
14 14 %out% = qScriptValueFromValue(context->engine(), %in%);
15 15 </template>
16 16
17 17 <template name="core.convert_to_null_or_primitive">
18 18 QScriptValue %out%;
19 19 if (!__ok)
20 20 %out% = context->engine()->nullValue();
21 21 else
22 22 %out% = QScriptValue(context->engine(), %in%);
23 23 </template>
24 24
25 25 <template name="core.convert_string_arg_to_latin1">
26 26 QByteArray %out% = %in%.toString().toLatin1();
27 27 </template>
28 28
29 29 <template name="core.convert_string_arg_to_char*">
30 30 QByteArray tmp_%out% = %in%.toString().toLatin1();
31 31 const char * %out% = tmp_%out%.constData();
32 32 </template>
33 33
34 34 <template name="core.convert_int_arg_and_check_range">
35 35 int %out% = %in%.toInt32();
36 36 if ((%out% &lt; 0) || (%this%-&gt;size() &lt; %out%)) {
37 37 return context->throwError(QScriptContext::RangeError,
38 38 QString::fromLatin1("%CLASS_NAME%::%FUNCTION_NAME%(): index out of range"));
39 39 }
40 40 </template>
41 41
42 42 <template name="core.convert_pointer_arg_and_check_null">
43 43 %TYPE% %out% = qscriptvalue_cast&lt;%TYPE%&gt;(%in%);
44 44 if (!%out%) {
45 45 return context->throwError(QScriptContext::TypeError,
46 46 QString::fromLatin1("%CLASS_NAME%::%FUNCTION_NAME%(): failed to convert argument to %TYPE%"));
47 47 }
48 48 </template>
49 49
50 50 <template name="core.convert_stringref_to_string">
51 51 QString %out% = %in%.toString();
52 52 </template>
53 53
54 54 <namespace-type name="Qt">
55 55 <extra-includes>
56 56 <include file-name="QTextDocument" location="global"/>
57 57 </extra-includes>
58 58 </namespace-type>
59 59
60 60 <!-- classes that aren't deemed relevant to scripts -->
61 61 <rejection class="QTextCodec::ConverterState"/>
62 62 <rejection class="QTextCodecFactoryInterface"/>
63 63 <rejection class="QAbstractEventDispatcher"/>
64 64 <rejection class="QAbstractFileEngine"/>
65 65 <rejection class="QAbstractFileEngineHandler"/>
66 66 <rejection class="QAbstractFileEngineIterator"/>
67 67 <rejection class="QFSFileEngine"/>
68 68 <rejection class="QSystemLocale"/>
69 69 <rejection class="QThread"/>
70 70
71 71 <rejection class="QFutureWatcherBase"/>
72 72 <rejection class="QFutureSynchronizer"/> <!-- ### problem with shell class -->
73 73
74 74 <namespace-type name="QtConcurrent">
75 75 <extra-includes>
76 76 <include file-name="qtconcurrentreducekernel.h" location="global"/>
77 77 <include file-name="qtconcurrentthreadengine.h" location="global"/>
78 78 </extra-includes>
79 79 </namespace-type>
80 80
81 81 <rejection class="QByteArray" function-name="contains"/>
82 82
83 83 <value-type name="QFileInfo">
84 84 <modify-function signature="QFileInfo(QFile)">
85 85 <modify-argument index="1">
86 86 <replace-type modified-type="QFile*"/>
87 87 <conversion-rule class="native">
88 88 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
89 89 </conversion-rule>
90 90 </modify-argument>
91 91 </modify-function>
92 92 <modify-function signature="setFile(QFile)">
93 93 <modify-argument index="1">
94 94 <replace-type modified-type="QFile*"/>
95 95 <conversion-rule class="native">
96 96 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
97 97 </conversion-rule>
98 98 </modify-argument>
99 99 </modify-function>
100 100 </value-type>
101 101 <object-type name="QTemporaryFile">
102 102 <modify-function signature="createLocalFile(QFile&amp;)">
103 103 <modify-argument index="1">
104 104 <replace-type modified-type="QFile*"/>
105 105 <conversion-rule class="native">
106 106 QFile &amp; %out% = *qscriptvalue_cast&lt;QFile*&gt;(%in%);
107 107 </conversion-rule>
108 108 </modify-argument>
109 109 </modify-function>
110 110 </object-type>
111 111
112 112 <value-type name="QLocale">
113 113 <extra-includes>
114 114 <include file-name="QDate" location="global"/>
115 115 </extra-includes>
116 116
117 117 <inject-code class="native" position="beginning">
118 118 Q_DECLARE_METATYPE(QScriptValue)
119 119 </inject-code>
120 120
121 121 <modify-function signature="toDouble(QString,bool*)const">
122 122 <modify-argument index="2">
123 123 <remove-default-expression/>
124 124 <remove-argument/>
125 125 <conversion-rule class="native">
126 126 <insert-template name="core.prepare_removed_bool*_argument"/>
127 127 </conversion-rule>
128 128 </modify-argument>
129 129 <modify-argument index="return">
130 130 <conversion-rule class="native">
131 131 <insert-template name="core.convert_to_null_or_primitive"/>
132 132 </conversion-rule>
133 133 </modify-argument>
134 134 </modify-function>
135 135
136 136 <modify-function signature="toFloat(QString,bool*)const">
137 137 <modify-argument index="2">
138 138 <remove-default-expression/>
139 139 <remove-argument/>
140 140 <conversion-rule class="native">
141 141 <insert-template name="core.prepare_removed_bool*_argument"/>
142 142 </conversion-rule>
143 143 </modify-argument>
144 144 <modify-argument index="return">
145 145 <conversion-rule class="native">
146 146 <insert-template name="core.convert_to_null_or_primitive"/>
147 147 </conversion-rule>
148 148 </modify-argument>
149 149 </modify-function>
150 150
151 151 <modify-function signature="toInt(QString,bool*,int)const">
152 152 <modify-argument index="2">
153 153 <remove-default-expression/>
154 154 <remove-argument/>
155 155 <conversion-rule class="native">
156 156 <insert-template name="core.prepare_removed_bool*_argument"/>
157 157 </conversion-rule>
158 158 </modify-argument>
159 159 <modify-argument index="return">
160 160 <conversion-rule class="native">
161 161 <insert-template name="core.convert_to_null_or_primitive"/>
162 162 </conversion-rule>
163 163 </modify-argument>
164 164 </modify-function>
165 165
166 166 <modify-function signature="toLongLong(QString,bool*,int)const">
167 167 <modify-argument index="2">
168 168 <remove-default-expression/>
169 169 <remove-argument/>
170 170 <conversion-rule class="native">
171 171 <insert-template name="core.prepare_removed_bool*_argument"/>
172 172 </conversion-rule>
173 173 </modify-argument>
174 174 <modify-argument index="return">
175 175 <conversion-rule class="native">
176 176 QScriptValue %out%;
177 177 if (!__ok)
178 178 %out% = context->engine()->nullValue();
179 179 else
180 180 %out% = QScriptValue(context->engine(), double(%in%)).toObject();
181 181 </conversion-rule>
182 182 </modify-argument>
183 183 </modify-function>
184 184
185 185 <modify-function signature="toShort(QString,bool*,int)const">
186 186 <modify-argument index="2">
187 187 <remove-default-expression/>
188 188 <remove-argument/>
189 189 <conversion-rule class="native">
190 190 <insert-template name="core.prepare_removed_bool*_argument"/>
191 191 </conversion-rule>
192 192 </modify-argument>
193 193 <modify-argument index="return">
194 194 <conversion-rule class="native">
195 195 <insert-template name="core.convert_to_null_or_primitive"/>
196 196 </conversion-rule>
197 197 </modify-argument>
198 198 </modify-function>
199 199
200 200 <modify-function signature="toUShort(QString,bool*,int)const">
201 201 <modify-argument index="2">
202 202 <remove-default-expression/>
203 203 <remove-argument/>
204 204 <conversion-rule class="native">
205 205 <insert-template name="core.prepare_removed_bool*_argument"/>
206 206 </conversion-rule>
207 207 </modify-argument>
208 208 <modify-argument index="return">
209 209 <conversion-rule class="native">
210 210 <insert-template name="core.convert_to_null_or_primitive"/>
211 211 </conversion-rule>
212 212 </modify-argument>
213 213 </modify-function>
214 214 </value-type>
215 215
216 216 <!-- object-type name="QAbstractEventDispatcher">
217 217 <extra-includes>
218 218 <include file-name="QPair" location="global"/>
219 219 </extra-includes>
220 220 </object-type -->
221 221
222 222 <value-type name="QBitArray">
223 223 <modify-function signature="at(int)const">
224 224 <modify-argument index="1">
225 225 <conversion-rule class="native">
226 226 <insert-template name="core.convert_int_arg_and_check_range">
227 227 <replace from="%CLASS_NAME%" to="QBitArray"/>
228 228 <replace from="%FUNCTION_NAME%" to="at"/>
229 229 </insert-template>
230 230 </conversion-rule>
231 231 </modify-argument>
232 232 </modify-function>
233 233
234 234 <modify-function signature="clearBit(int)">
235 235 <modify-argument index="1">
236 236 <conversion-rule class="native">
237 237 <insert-template name="core.convert_int_arg_and_check_range">
238 238 <replace from="%CLASS_NAME%" to="QBitArray"/>
239 239 <replace from="%FUNCTION_NAME%" to="clearBit"/>
240 240 </insert-template>
241 241 </conversion-rule>
242 242 </modify-argument>
243 243 </modify-function>
244 244
245 245 <modify-function signature="setBit(int)">
246 246 <modify-argument index="1">
247 247 <conversion-rule class="native">
248 248 <insert-template name="core.convert_int_arg_and_check_range">
249 249 <replace from="%CLASS_NAME%" to="QBitArray"/>
250 250 <replace from="%FUNCTION_NAME%" to="setBit"/>
251 251 </insert-template>
252 252 </conversion-rule>
253 253 </modify-argument>
254 254 </modify-function>
255 255
256 256 <modify-function signature="setBit(int,bool)">
257 257 <modify-argument index="1">
258 258 <conversion-rule class="native">
259 259 <insert-template name="core.convert_int_arg_and_check_range">
260 260 <replace from="%CLASS_NAME%" to="QBitArray"/>
261 261 <replace from="%FUNCTION_NAME%" to="setBit"/>
262 262 </insert-template>
263 263 </conversion-rule>
264 264 </modify-argument>
265 265 </modify-function>
266 266
267 267 <modify-function signature="testBit(int)const">
268 268 <modify-argument index="1">
269 269 <conversion-rule class="native">
270 270 <insert-template name="core.convert_int_arg_and_check_range">
271 271 <replace from="%CLASS_NAME%" to="QBitArray"/>
272 272 <replace from="%FUNCTION_NAME%" to="testBit"/>
273 273 </insert-template>
274 274 </conversion-rule>
275 275 </modify-argument>
276 276 </modify-function>
277 277
278 278 <modify-function signature="toggleBit(int)">
279 279 <modify-argument index="1">
280 280 <conversion-rule class="native">
281 281 <insert-template name="core.convert_int_arg_and_check_range">
282 282 <replace from="%CLASS_NAME%" to="QBitArray"/>
283 283 <replace from="%FUNCTION_NAME%" to="toggleBit"/>
284 284 </insert-template>
285 285 </conversion-rule>
286 286 </modify-argument>
287 287 </modify-function>
288 288
289 289 <modify-function signature="operator&amp;=(QBitArray)">
290 290 <modify-argument index="0" replace-value="this"/>
291 291 </modify-function>
292 292 <modify-function signature="operator=(QBitArray)">
293 293 <modify-argument index="0" replace-value="this"/>
294 294 </modify-function>
295 295 <modify-function signature="operator^=(QBitArray)">
296 296 <modify-argument index="0" replace-value="this"/>
297 297 </modify-function>
298 298 <modify-function signature="operator|=(QBitArray)">
299 299 <modify-argument index="0" replace-value="this"/>
300 300 </modify-function>
301 301 </value-type>
302 302
303 303 <object-type name="QBuffer">
304 304 <!-- ### modify to return value by pointer? -->
305 305 <modify-function signature="buffer()const" remove="all"/>
306 306 <modify-function signature="data()const" remove="all"/>
307 307
308 308 <modify-function signature="setData(const char*,int)" remove="all"/>
309 309 </object-type>
310 310
311 311 <object-type name="QCoreApplication">
312 312 <modify-function signature="QCoreApplication(int &amp;, char **)" remove="all"/>
313 313 <!-- ### arguments() causes a warning: "QScriptValue::setProperty(arguments): cannot change flags of a native property" -->
314 314 <modify-function signature="arguments()" remove="all"/>
315 315 <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding,int)">
316 316 <modify-argument index="1">
317 317 <replace-type modified-type="QString"/>
318 318 <conversion-rule class="native">
319 319 <insert-template name="core.convert_string_arg_to_char*"/>
320 320 </conversion-rule>
321 321 </modify-argument>
322 322 <modify-argument index="2">
323 323 <replace-type modified-type="QString"/>
324 324 <conversion-rule class="native">
325 325 <insert-template name="core.convert_string_arg_to_char*"/>
326 326 </conversion-rule>
327 327 </modify-argument>
328 328 <modify-argument index="3">
329 329 <replace-type modified-type="QString"/>
330 330 <conversion-rule class="native">
331 331 <insert-template name="core.convert_string_arg_to_char*"/>
332 332 </conversion-rule>
333 333 </modify-argument>
334 334 </modify-function>
335 335 <modify-function signature="translate(const char *,const char *,const char *,QCoreApplication::Encoding)">
336 336 <modify-argument index="1">
337 337 <replace-type modified-type="QString"/>
338 338 <conversion-rule class="native">
339 339 <insert-template name="core.convert_string_arg_to_char*"/>
340 340 </conversion-rule>
341 341 </modify-argument>
342 342 <modify-argument index="2">
343 343 <replace-type modified-type="QString"/>
344 344 <conversion-rule class="native">
345 345 <insert-template name="core.convert_string_arg_to_char*"/>
346 346 </conversion-rule>
347 347 </modify-argument>
348 348 <modify-argument index="3">
349 349 <replace-type modified-type="QString"/>
350 350 <conversion-rule class="native">
351 351 <insert-template name="core.convert_string_arg_to_char*"/>
352 352 </conversion-rule>
353 353 </modify-argument>
354 354 </modify-function>
355 355
356 356 </object-type>
357 357
358 358 <value-type name="QByteArray">
359 359 <inject-code class="pywrap-h">
360 360 PyObject* data(QByteArray* b) {
361 361 if (b->data()) {
362 362 #ifdef PY3K
363 363 return PyUnicode_FromStringAndSize(b-&gt;data(), b-&gt;size());
364 364 #else
365 365 return PyString_FromStringAndSize(b-&gt;data(), b-&gt;size());
366 366 #endif
367 367 } else {
368 368 Py_INCREF(Py_None);
369 369 return Py_None;
370 370 }
371 371 }
372 372 </inject-code>
373 373
374 374 <inject-code class="native" position="beginning">
375 375 Q_DECLARE_METATYPE(QScriptValue)
376 376 </inject-code>
377 377
378 378
379 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 382 <modify-function signature="at(int)const">
383 383 <modify-argument index="1">
384 384 <conversion-rule class="native">
385 385 <insert-template name="core.convert_int_arg_and_check_range">
386 386 <replace from="%CLASS_NAME%" to="QByteArray"/>
387 387 <replace from="%FUNCTION_NAME%" to="at"/>
388 388 </insert-template>
389 389 </conversion-rule>
390 390 </modify-argument>
391 391 </modify-function>
392 392
393 393 <modify-function signature="append(const char *)" remove="all"/>
394 394 <modify-function signature="append(QByteArray)">
395 395 <modify-argument index="0" replace-value="this"/>
396 396 </modify-function>
397 397 <modify-function signature="append(QString)">
398 398 <modify-argument index="0" replace-value="this"/>
399 399 </modify-function>
400 400 <modify-function signature="append(const char *)" remove="all">
401 401 <modify-argument index="0" replace-value="this"/>
402 402 </modify-function>
403 403 <modify-function signature="append(char)">
404 404 <modify-argument index="0" replace-value="this"/>
405 405 <rename to="appendByte"/>
406 406 </modify-function>
407 407
408 408 <modify-function signature="count(const char *)const" remove="all"/>
409 409
410 410 <modify-function signature="data()" remove="all"/>
411 411
412 412 <modify-function signature="endsWith(const char *)const" remove="all"/>
413 413
414 414 <modify-function signature="fill(char,int)">
415 415 <modify-argument index="0" replace-value="this"/>
416 416 </modify-function>
417 417
418 418 <modify-function signature="indexOf(const char*,int)const" remove="all"/>
419 419 <modify-function signature="indexOf(char,int)const">
420 420 <rename to="indexOfByte"/>
421 421 </modify-function>
422 422
423 423 <modify-function signature="insert(int,QByteArray)">
424 424 <modify-argument index="0" replace-value="this"/>
425 425 </modify-function>
426 426 <modify-function signature="insert(int,QString)">
427 427 <modify-argument index="0" replace-value="this"/>
428 428 </modify-function>
429 429 <modify-function signature="insert(int,const char *)" remove="all"/>
430 430 <modify-function signature="insert(int,char)">
431 431 <modify-argument index="0" replace-value="this"/>
432 432 <rename to="insertByte"/>
433 433 </modify-function>
434 434
435 435 <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/>
436 436 <modify-function signature="lastIndexOf(char,int)const">
437 437 <rename to="lastIndexOfByte"/>
438 438 </modify-function>
439 439
440 440 <modify-function signature="prepend(QByteArray)">
441 441 <modify-argument index="0" replace-value="this"/>
442 442 </modify-function>
443 443 <modify-function signature="prepend(const char *)" remove="all"/>
444 444 <modify-function signature="prepend(char)">
445 445 <modify-argument index="0" replace-value="this"/>
446 446 <rename to="prependByte"/>
447 447 </modify-function>
448 448
449 449 <modify-function signature="remove(int,int)">
450 450 <modify-argument index="0" replace-value="this"/>
451 451 </modify-function>
452 452
453 453 <modify-function signature="replace(int,int,QByteArray)">
454 454 <modify-argument index="0" replace-value="this"/>
455 455 </modify-function>
456 456 <modify-function signature="replace(int,int,const char *)" remove="all"/>
457 457 <modify-function signature="replace(QByteArray,QByteArray)">
458 458 <modify-argument index="0" replace-value="this"/>
459 459 </modify-function>
460 460 <modify-function signature="replace(const char*,QByteArray)" remove="all"/>
461 461 <modify-function signature="replace(QByteArray,const char *)" remove="all"/>
462 462 <modify-function signature="replace(QString,QByteArray)">
463 463 <modify-argument index="0" replace-value="this"/>
464 464 </modify-function>
465 465 <modify-function signature="replace(QString,const char *)" remove="all"/>
466 466 <modify-function signature="replace(const char *,const char *)" remove="all"/>
467 467 <modify-function signature="replace(char,QByteArray)">
468 468 <modify-argument index="0" replace-value="this"/>
469 469 </modify-function>
470 470 <modify-function signature="replace(char,QString)">
471 471 <modify-argument index="0" replace-value="this"/>
472 472 </modify-function>
473 473 <modify-function signature="replace(char,const char *)" remove="all"/>
474 474 <modify-function signature="replace(char,char)">
475 475 <modify-argument index="0" replace-value="this"/>
476 476 </modify-function>
477 477
478 478 <modify-function signature="startsWith(const char *)const" remove="all"/>
479 479
480 480 <modify-function signature="fromRawData(const char*,int)" remove="all"/>
481 481
482 482 <modify-function signature="number(int,int)">
483 483 <rename to="fromInt"/>
484 484 </modify-function>
485 485 <modify-function signature="number(uint,int)">
486 486 <rename to="fromUInt"/>
487 487 </modify-function>
488 488 <modify-function signature="number(qlonglong,int)">
489 489 <rename to="fromLongLong"/>
490 490 </modify-function>
491 491 <modify-function signature="number(qulonglong,int)">
492 492 <rename to="fromULongLong"/>
493 493 </modify-function>
494 494
495 495 <modify-function signature="setNum(int,int)">
496 496 <modify-argument index="0" replace-value="this"/>
497 497 <rename to="setInt"/>
498 498 </modify-function>
499 499 <modify-function signature="setNum(uint,int)">
500 500 <modify-argument index="0" replace-value="this"/>
501 501 <rename to="setUInt"/>
502 502 </modify-function>
503 503 <modify-function signature="setNum(short,int)">
504 504 <modify-argument index="0" replace-value="this"/>
505 505 <rename to="setShort"/>
506 506 </modify-function>
507 507 <modify-function signature="setNum(ushort,int)">
508 508 <modify-argument index="0" replace-value="this"/>
509 509 <rename to="setUShort"/>
510 510 </modify-function>
511 511 <modify-function signature="setNum(qlonglong,int)">
512 512 <modify-argument index="0" replace-value="this"/>
513 513 <rename to="setLongLong"/>
514 514 </modify-function>
515 515 <modify-function signature="setNum(qulonglong,int)">
516 516 <modify-argument index="0" replace-value="this"/>
517 517 <rename to="setULongLong"/>
518 518 </modify-function>
519 519 <modify-function signature="setNum(double,char,int)">
520 520 <modify-argument index="0" replace-value="this"/>
521 521 <rename to="setDouble"/>
522 522 </modify-function>
523 523 <modify-function signature="setNum(float,char,int)">
524 524 <modify-argument index="0" replace-value="this"/>
525 525 <rename to="setFloat"/>
526 526 </modify-function>
527 527
528 528 <modify-function signature="toDouble(bool*)const">
529 529 <modify-argument index="1">
530 530 <remove-default-expression/>
531 531 <remove-argument/>
532 532 <conversion-rule class="native">
533 533 <insert-template name="core.prepare_removed_bool*_argument"/>
534 534 </conversion-rule>
535 535 </modify-argument>
536 536 <modify-argument index="return">
537 537 <conversion-rule class="native">
538 538 <insert-template name="core.convert_to_null_or_primitive"/>
539 539 </conversion-rule>
540 540 </modify-argument>
541 541 </modify-function>
542 542
543 543 <modify-function signature="toFloat(bool*)const">
544 544 <modify-argument index="1">
545 545 <remove-default-expression/>
546 546 <remove-argument/>
547 547 <conversion-rule class="native">
548 548 <insert-template name="core.prepare_removed_bool*_argument"/>
549 549 </conversion-rule>
550 550 </modify-argument>
551 551 <modify-argument index="return">
552 552 <conversion-rule class="native">
553 553 <insert-template name="core.convert_to_null_or_primitive"/>
554 554 </conversion-rule>
555 555 </modify-argument>
556 556 </modify-function>
557 557
558 558 <modify-function signature="toInt(bool*,int)const">
559 559 <modify-argument index="1">
560 560 <remove-default-expression/>
561 561 <remove-argument/>
562 562 <conversion-rule class="native">
563 563 <insert-template name="core.prepare_removed_bool*_argument"/>
564 564 </conversion-rule>
565 565 </modify-argument>
566 566 <modify-argument index="return">
567 567 <conversion-rule class="native">
568 568 <insert-template name="core.convert_to_null_or_primitive"/>
569 569 </conversion-rule>
570 570 </modify-argument>
571 571 </modify-function>
572 572
573 573 <modify-function signature="toUShort(bool*,int)const">
574 574 <modify-argument index="1">
575 575 <remove-default-expression/>
576 576 <remove-argument/>
577 577 <conversion-rule class="native">
578 578 <insert-template name="core.prepare_removed_bool*_argument"/>
579 579 </conversion-rule>
580 580 </modify-argument>
581 581 <modify-argument index="return">
582 582 <conversion-rule class="native">
583 583 <insert-template name="core.convert_to_null_or_primitive"/>
584 584 </conversion-rule>
585 585 </modify-argument>
586 586 </modify-function>
587 587 </value-type>
588 588
589 589 <object-type name="QIODevice">
590 590 <modify-function signature="peek(char *,qint64)" remove="all"/>
591 591 <modify-function signature="read(char *,qint64)" remove="all"/>
592 592 <modify-function signature="readLine(char *,qint64)" remove="all"/>
593 593 <modify-function signature="write(const char *,qint64)" remove="all"/>
594 594 </object-type>
595 595
596 596 <object-type name="QFile">
597 597 <modify-function signature="open(int,QFlags&lt;QIODevice::OpenModeFlag&gt;)" remove="all"/>
598 598 <modify-function signature="decodeName(const char*)" remove="all"/>
599 599 <modify-function signature="map(qint64,qint64,QFile::MemoryMapFlags)" remove="all"/>
600 600 <modify-function signature="unmap(uchar*)" remove="all"/>
601 601 </object-type>
602 602
603 603 <object-type name="QSignalMapper">
604 604 <!-- ### overloads -->
605 605 <modify-function signature="mapping(int)const">
606 606 <rename to="mappingById"/>
607 607 </modify-function>
608 608 <modify-function signature="mapping(QString)const">
609 609 <rename to="mappingByString"/>
610 610 </modify-function>
611 611 <modify-function signature="mapping(QObject*)const">
612 612 <rename to="mappingByObject"/>
613 613 </modify-function>
614 614 <modify-function signature="setMapping(QObject*,int)">
615 615 <rename to="setMappingById"/>
616 616 </modify-function>
617 617 <modify-function signature="setMapping(QObject*,QString)">
618 618 <rename to="setMappingByString"/>
619 619 </modify-function>
620 620 <modify-function signature="setMapping(QObject*,QObject*)">
621 621 <rename to="setMappingByObject"/>
622 622 </modify-function>
623 623 </object-type>
624 624
625 625 <object-type name="QDataStream">
626 626 <modify-function signature="operator&gt;&gt;(signed char&amp;)" remove="all"/>
627 627 <modify-function signature="operator&lt;&lt;(signed char)" remove="all"/>
628 628
629 629 <modify-function signature="operator&lt;&lt;(bool)">
630 630 <rename to="writeBoolean"/>
631 631 <modify-argument index="0" replace-value="this"/>
632 632 </modify-function>
633 633 <modify-function signature="operator&lt;&lt;(unsigned char)">
634 634 <modify-argument index="0" replace-value="this"/>
635 635 <rename to="writeByte"/>
636 636 </modify-function>
637 637 <modify-function signature="operator&lt;&lt;(int)">
638 638 <rename to="writeInt"/>
639 639 <modify-argument index="0" replace-value="this"/>
640 640 </modify-function>
641 641 <modify-function signature="operator&lt;&lt;(qint64)">
642 642 <rename to="writeLongLong"/>
643 643 <modify-argument index="0" replace-value="this"/>
644 644 </modify-function>
645 645 <modify-function signature="operator&lt;&lt;(float)">
646 646 <rename to="writeFloat"/>
647 647 <modify-argument index="0" replace-value="this"/>
648 648 </modify-function>
649 649 <modify-function signature="operator&lt;&lt;(double)">
650 650 <rename to="writeDouble"/>
651 651 <modify-argument index="0" replace-value="this"/>
652 652 </modify-function>
653 653 <modify-function signature="operator&lt;&lt;(short)">
654 654 <rename to="writeShort"/>
655 655 <modify-argument index="0" replace-value="this"/>
656 656 </modify-function>
657 657
658 658 <modify-function signature="operator&gt;&gt;(bool &amp;)">
659 659 <rename to="readBoolean"/>
660 660 <modify-argument index="1">
661 661 <remove-argument/>
662 662 <conversion-rule class="native">
663 663 bool __result;
664 664 bool &amp; %out% = __result;
665 665 </conversion-rule>
666 666 </modify-argument>
667 667 <modify-argument index="0" replace-value="void">
668 668 <conversion-rule class="native">
669 669 bool %out% = __result;
670 670 </conversion-rule>
671 671 </modify-argument>
672 672 </modify-function>
673 673 <modify-function signature="operator&gt;&gt;(unsigned char &amp;)">
674 674 <rename to="readByte"/>
675 675 <modify-argument index="1">
676 676 <remove-argument/>
677 677 <conversion-rule class="native">
678 678 unsigned char __result;
679 679 unsigned char &amp; %out% = __result;
680 680 </conversion-rule>
681 681 </modify-argument>
682 682 <modify-argument index="0" replace-value="void">
683 683 <conversion-rule class="native">
684 684 int %out% = __result;
685 685 </conversion-rule>
686 686 </modify-argument>
687 687 </modify-function>
688 688 <modify-function signature="operator&gt;&gt;(int &amp;)">
689 689 <rename to="readInt"/>
690 690 <modify-argument index="1">
691 691 <remove-argument/>
692 692 <conversion-rule class="native">
693 693 int __result;
694 694 int &amp; %out% = __result;
695 695 </conversion-rule>
696 696 </modify-argument>
697 697 <modify-argument index="0" replace-value="void">
698 698 <conversion-rule class="native">
699 699 int %out% = __result;
700 700 </conversion-rule>
701 701 </modify-argument>
702 702 </modify-function>
703 703 <modify-function signature="operator&gt;&gt;(uint &amp;)">
704 704 <rename to="readUInt"/>
705 705 <modify-argument index="1">
706 706 <remove-argument/>
707 707 <conversion-rule class="native">
708 708 uint __result;
709 709 uint &amp; %out% = __result;
710 710 </conversion-rule>
711 711 </modify-argument>
712 712 <modify-argument index="0" replace-value="void">
713 713 <conversion-rule class="native">
714 714 uint %out% = __result;
715 715 </conversion-rule>
716 716 </modify-argument>
717 717 </modify-function>
718 718 <modify-function signature="operator&gt;&gt;(qint64 &amp;)">
719 719 <rename to="readLongLong"/>
720 720 <modify-argument index="1">
721 721 <remove-argument/>
722 722 <conversion-rule class="native">
723 723 qint64 __result;
724 724 qint64 &amp; %out% = __result;
725 725 </conversion-rule>
726 726 </modify-argument>
727 727 <modify-argument index="0" replace-value="void">
728 728 <conversion-rule class="native">
729 729 qint64 %out% = __result;
730 730 </conversion-rule>
731 731 </modify-argument>
732 732 </modify-function>
733 733 <modify-function signature="operator&gt;&gt;(unsigned long long &amp;)">
734 734 <rename to="readULongLong"/>
735 735 <modify-argument index="1">
736 736 <remove-argument/>
737 737 <conversion-rule class="native">
738 738 unsigned long long __result;
739 739 unsigned long long &amp; %out% = __result;
740 740 </conversion-rule>
741 741 </modify-argument>
742 742 <modify-argument index="0" replace-value="void">
743 743 <conversion-rule class="native">
744 744 unsigned long long %out% = __result;
745 745 </conversion-rule>
746 746 </modify-argument>
747 747 </modify-function>
748 748 <modify-function signature="operator&gt;&gt;(float &amp;)">
749 749 <rename to="readFloat"/>
750 750 <modify-argument index="1">
751 751 <remove-argument/>
752 752 <conversion-rule class="native">
753 753 float __result;
754 754 float &amp; %out% = __result;
755 755 </conversion-rule>
756 756 </modify-argument>
757 757 <modify-argument index="0" replace-value="void">
758 758 <conversion-rule class="native">
759 759 float %out% = __result;
760 760 </conversion-rule>
761 761 </modify-argument>
762 762 </modify-function>
763 763 <modify-function signature="operator&gt;&gt;(double &amp;)">
764 764 <rename to="readDouble"/>
765 765 <modify-argument index="1">
766 766 <remove-argument/>
767 767 <conversion-rule class="native">
768 768 double __result;
769 769 double &amp; %out% = __result;
770 770 </conversion-rule>
771 771 </modify-argument>
772 772 <modify-argument index="0" replace-value="void">
773 773 <conversion-rule class="native">
774 774 double %out% = __result;
775 775 </conversion-rule>
776 776 </modify-argument>
777 777 </modify-function>
778 778 <modify-function signature="operator&gt;&gt;(short &amp;)">
779 779 <rename to="readShort"/>
780 780 <modify-argument index="1">
781 781 <remove-argument/>
782 782 <conversion-rule class="native">
783 783 short __result;
784 784 short &amp; %out% = __result;
785 785 </conversion-rule>
786 786 </modify-argument>
787 787 <modify-argument index="0" replace-value="void">
788 788 <conversion-rule class="native">
789 789 short %out% = __result;
790 790 </conversion-rule>
791 791 </modify-argument>
792 792 </modify-function>
793 793 <modify-function signature="operator&gt;&gt;(unsigned short &amp;)">
794 794 <rename to="readUShort"/>
795 795 <modify-argument index="1">
796 796 <remove-argument/>
797 797 <conversion-rule class="native">
798 798 unsigned short __result;
799 799 unsigned short &amp; %out% = __result;
800 800 </conversion-rule>
801 801 </modify-argument>
802 802 <modify-argument index="0" replace-value="void">
803 803 <conversion-rule class="native">
804 804 unsigned short %out% = __result;
805 805 </conversion-rule>
806 806 </modify-argument>
807 807 </modify-function>
808 808 </object-type>
809 809
810 810 <object-type name="QTextStream">
811 811 <modify-function signature="setCodec(const char *)">
812 812 <modify-argument index="1">
813 813 <replace-type modified-type="QString"/>
814 814 <conversion-rule class="native">
815 815 <insert-template name="core.convert_string_arg_to_char*"/>
816 816 </conversion-rule>
817 817 </modify-argument>
818 818 </modify-function>
819 819
820 820 <modify-function signature="operator&lt;&lt;(QBool)">
821 821 <rename to="writeBoolean"/>
822 822 <modify-argument index="0" replace-value="this"/>
823 823 </modify-function>
824 824 <modify-function signature="operator&lt;&lt;(char)">
825 825 <modify-argument index="0" replace-value="this"/>
826 826 <rename to="writeByte"/>
827 827 </modify-function>
828 828 <modify-function signature="operator&lt;&lt;(signed int)">
829 829 <rename to="writeInt"/>
830 830 <modify-argument index="0" replace-value="this"/>
831 831 </modify-function>
832 832 <modify-function signature="operator&lt;&lt;(qlonglong)">
833 833 <rename to="writeLongLong"/>
834 834 <modify-argument index="0" replace-value="this"/>
835 835 </modify-function>
836 836 <modify-function signature="operator&lt;&lt;(float)">
837 837 <rename to="writeFloat"/>
838 838 <modify-argument index="0" replace-value="this"/>
839 839 </modify-function>
840 840 <modify-function signature="operator&lt;&lt;(double)">
841 841 <rename to="writeDouble"/>
842 842 <modify-argument index="0" replace-value="this"/>
843 843 </modify-function>
844 844 <modify-function signature="operator&lt;&lt;(signed short)">
845 845 <rename to="writeShort"/>
846 846 <modify-argument index="0" replace-value="this"/>
847 847 </modify-function>
848 848 <modify-function signature="operator&lt;&lt;(const QByteArray&amp;)">
849 849 <rename to="writeByteArray"/>
850 850 <modify-argument index="0" replace-value="this"/>
851 851 </modify-function>
852 852 <modify-function signature="operator&lt;&lt;(const QString&amp;)">
853 853 <rename to="writeString"/>
854 854 <modify-argument index="0" replace-value="this"/>
855 855 </modify-function>
856 856
857 857 <modify-function signature="operator&gt;&gt;(char&amp;)">
858 858 <rename to="readByte"/>
859 859 <modify-argument index="1">
860 860 <remove-argument/>
861 861 <conversion-rule class="native">
862 862 char __result;
863 863 char &amp; %out% = __result;
864 864 </conversion-rule>
865 865 </modify-argument>
866 866 <modify-argument index="0" replace-value="void">
867 867 <conversion-rule class="native">
868 868 int %out% = __result;
869 869 </conversion-rule>
870 870 </modify-argument>
871 871 </modify-function>
872 872 <modify-function signature="operator&gt;&gt;(signed short&amp;)">
873 873 <rename to="readShort"/>
874 874 <modify-argument index="1">
875 875 <remove-argument/>
876 876 <conversion-rule class="native">
877 877 short __result;
878 878 short &amp; %out% = __result;
879 879 </conversion-rule>
880 880 </modify-argument>
881 881 <modify-argument index="0" replace-value="void">
882 882 <conversion-rule class="native">
883 883 short %out% = __result;
884 884 </conversion-rule>
885 885 </modify-argument>
886 886 </modify-function>
887 887 <modify-function signature="operator&gt;&gt;(signed int&amp;)">
888 888 <rename to="readInt"/>
889 889 <modify-argument index="1">
890 890 <remove-argument/>
891 891 <conversion-rule class="native">
892 892 int __result;
893 893 int &amp; %out% = __result;
894 894 </conversion-rule>
895 895 </modify-argument>
896 896 <modify-argument index="0" replace-value="void">
897 897 <conversion-rule class="native">
898 898 int %out% = __result;
899 899 </conversion-rule>
900 900 </modify-argument>
901 901 </modify-function>
902 902 <modify-function signature="operator&gt;&gt;(unsigned short&amp;)">
903 903 <rename to="readUShort"/>
904 904 <modify-argument index="1">
905 905 <remove-argument/>
906 906 <conversion-rule class="native">
907 907 unsigned short __result;
908 908 unsigned short &amp; %out% = __result;
909 909 </conversion-rule>
910 910 </modify-argument>
911 911 <modify-argument index="0" replace-value="void">
912 912 <conversion-rule class="native">
913 913 unsigned short %out% = __result;
914 914 </conversion-rule>
915 915 </modify-argument>
916 916 </modify-function>
917 917 <modify-function signature="operator&gt;&gt;(unsigned int&amp;)">
918 918 <rename to="readUInt"/>
919 919 <modify-argument index="1">
920 920 <remove-argument/>
921 921 <conversion-rule class="native">
922 922 unsigned int __result;
923 923 unsigned int &amp; %out% = __result;
924 924 </conversion-rule>
925 925 </modify-argument>
926 926 <modify-argument index="0" replace-value="void">
927 927 <conversion-rule class="native">
928 928 unsigned int %out% = __result;
929 929 </conversion-rule>
930 930 </modify-argument>
931 931 </modify-function>
932 932 <modify-function signature="operator&gt;&gt;(qlonglong&amp;)">
933 933 <rename to="readLongLong"/>
934 934 <modify-argument index="1">
935 935 <remove-argument/>
936 936 <conversion-rule class="native">
937 937 qlonglong __result;
938 938 qlonglong &amp; %out% = __result;
939 939 </conversion-rule>
940 940 </modify-argument>
941 941 <modify-argument index="0" replace-value="void">
942 942 <conversion-rule class="native">
943 943 qlonglong %out% = __result;
944 944 </conversion-rule>
945 945 </modify-argument>
946 946 </modify-function>
947 947 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)">
948 948 <rename to="readULongLong"/>
949 949 <modify-argument index="1">
950 950 <remove-argument/>
951 951 <conversion-rule class="native">
952 952 qulonglong __result;
953 953 qulonglong &amp; %out% = __result;
954 954 </conversion-rule>
955 955 </modify-argument>
956 956 <modify-argument index="0" replace-value="void">
957 957 <conversion-rule class="native">
958 958 qulonglong %out% = __result;
959 959 </conversion-rule>
960 960 </modify-argument>
961 961 </modify-function>
962 962 <modify-function signature="operator&gt;&gt;(float&amp;)">
963 963 <rename to="readFloat"/>
964 964 <modify-argument index="1">
965 965 <remove-argument/>
966 966 <conversion-rule class="native">
967 967 float __result;
968 968 float &amp; %out% = __result;
969 969 </conversion-rule>
970 970 </modify-argument>
971 971 <modify-argument index="0" replace-value="void">
972 972 <conversion-rule class="native">
973 973 float %out% = __result;
974 974 </conversion-rule>
975 975 </modify-argument>
976 976 </modify-function>
977 977 <modify-function signature="operator&gt;&gt;(double&amp;)">
978 978 <rename to="readDouble"/>
979 979 <modify-argument index="1">
980 980 <remove-argument/>
981 981 <conversion-rule class="native">
982 982 double __result;
983 983 double &amp; %out% = __result;
984 984 </conversion-rule>
985 985 </modify-argument>
986 986 <modify-argument index="0" replace-value="void">
987 987 <conversion-rule class="native">
988 988 double %out% = __result;
989 989 </conversion-rule>
990 990 </modify-argument>
991 991 </modify-function>
992 992
993 993 <modify-function signature="operator&lt;&lt;(qulonglong)" remove="all"/>
994 994 <modify-function signature="operator&gt;&gt;(qulonglong&amp;)" remove="all"/>
995 995 </object-type>
996 996
997 997 <value-type name="QPointF">
998 998 <modify-function signature="rx()" remove="all"/>
999 999 <modify-function signature="ry()" remove="all"/>
1000 1000 </value-type>
1001 1001
1002 1002 <value-type name="QPoint">
1003 1003 <modify-function signature="rx()" remove="all"/>
1004 1004 <modify-function signature="ry()" remove="all"/>
1005 1005 </value-type>
1006 1006
1007 1007 <value-type name="QPixmap">
1008 1008 <modify-function signature="save(QIODevice*, const char*, int)" remove="all"/>
1009 1009 </value-type>
1010 1010
1011 1011 <object-type name="QObject">
1012 1012 <modify-function signature="property(const char*)const">
1013 1013 <modify-argument index="1">
1014 1014 <replace-type modified-type="QString"/>
1015 1015 <conversion-rule class="native">
1016 1016 <insert-template name="core.convert_string_arg_to_char*"/>
1017 1017 </conversion-rule>
1018 1018 </modify-argument>
1019 1019 </modify-function>
1020 1020
1021 1021 <modify-function signature="setProperty(const char*,QVariant)">
1022 1022 <modify-argument index="1">
1023 1023 <replace-type modified-type="QString"/>
1024 1024 <conversion-rule class="native">
1025 1025 <insert-template name="core.convert_string_arg_to_char*"/>
1026 1026 </conversion-rule>
1027 1027 </modify-argument>
1028 1028 </modify-function>
1029 1029
1030 1030 <modify-function signature="inherits(const char*)const">
1031 1031 <modify-argument index="1">
1032 1032 <replace-type modified-type="QString"/>
1033 1033 <conversion-rule class="native">
1034 1034 <insert-template name="core.convert_string_arg_to_char*"/>
1035 1035 </conversion-rule>
1036 1036 </modify-argument>
1037 1037 </modify-function>
1038 1038 </object-type>
1039 1039
1040 1040 <object-type name="QCryptographicHash">
1041 1041 <modify-function signature="addData(const char*,int)" remove="all"/>
1042 1042 </object-type>
1043 1043
1044 1044
1045 1045 <value-type name="QtScriptFuture">
1046 1046 <modify-function signature="operator==(const QFuture &amp;)const">
1047 1047 <modify-argument index="1">
1048 1048 <replace-type modified-type="QtScriptFuture*"/>
1049 1049 <conversion-rule class="native">
1050 1050 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1051 1051 </conversion-rule>
1052 1052 </modify-argument>
1053 1053 </modify-function>
1054 1054 <modify-function signature="QFuture(const QFuture &amp;)">
1055 1055 <modify-argument index="1">
1056 1056 <replace-type modified-type="QtScriptFuture" />
1057 1057 <conversion-rule class="native">
1058 1058 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1059 1059 </conversion-rule>
1060 1060 </modify-argument>
1061 1061 </modify-function>
1062 1062 <inject-code class="native">
1063 1063 </inject-code>
1064 1064 </value-type>
1065 1065
1066 1066 <value-type name="QtScriptVoidFuture">
1067 1067 <modify-function signature="operator==(const QFuture &amp;)const">
1068 1068 <modify-argument index="1">
1069 1069 <replace-type modified-type="QtScriptVoidFuture*"/>
1070 1070 <conversion-rule class="native">
1071 1071 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1072 1072 </conversion-rule>
1073 1073 </modify-argument>
1074 1074 </modify-function>
1075 1075 <modify-function signature="QFuture(const QFuture &amp;)">
1076 1076 <modify-argument index="1">
1077 1077 <replace-type modified-type="QtScriptVoidFuture*"/>
1078 1078 <conversion-rule class="native">
1079 1079 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1080 1080 </conversion-rule>
1081 1081 </modify-argument>
1082 1082 </modify-function>
1083 1083 </value-type>
1084 1084
1085 1085 <object-type name="QtScriptFutureWatcher">
1086 1086 <modify-function signature="setFuture(const QFuture &amp;)">
1087 1087 <modify-argument index="1">
1088 1088 <replace-type modified-type="QtScriptFuture*" />
1089 1089 <conversion-rule class="native">
1090 1090 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1091 1091 </conversion-rule>
1092 1092 </modify-argument>
1093 1093 </modify-function>
1094 1094 </object-type>
1095 1095
1096 1096 <object-type name="QtScriptVoidFutureWatcher">
1097 1097 <modify-function signature="setFuture(const QFuture &amp;)">
1098 1098 <modify-argument index="1">
1099 1099 <replace-type modified-type="QtScriptVoidFuture*" />
1100 1100 <conversion-rule class="native">
1101 1101 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1102 1102 </conversion-rule>
1103 1103 </modify-argument>
1104 1104 </modify-function>
1105 1105 </object-type>
1106 1106
1107 1107 <object-type name="QtScriptFutureSynchronizer">
1108 1108 <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
1109 1109 <modify-argument index="1">
1110 1110 <replace-type modified-type="QtScriptFuture*" />
1111 1111 <conversion-rule class="native">
1112 1112 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1113 1113 </conversion-rule>
1114 1114 </modify-argument>
1115 1115 </modify-function>
1116 1116 <modify-function signature="addFuture(const QFuture &amp;)">
1117 1117 <modify-argument index="1">
1118 1118 <replace-type modified-type="QtScriptFuture*" />
1119 1119 <conversion-rule class="native">
1120 1120 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1121 1121 </conversion-rule>
1122 1122 </modify-argument>
1123 1123 </modify-function>
1124 1124 <modify-function signature="setFuture(const QFuture &amp;)">
1125 1125 <modify-argument index="1">
1126 1126 <replace-type modified-type="QtScriptFuture*" />
1127 1127 <conversion-rule class="native">
1128 1128 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1129 1129 </conversion-rule>
1130 1130 </modify-argument>
1131 1131 </modify-function>
1132 1132 <modify-function signature="futures()const" remove="all" />
1133 1133 </object-type>
1134 1134 <object-type name="QtScriptVoidFutureSynchronizer">
1135 1135 <modify-function signature="QFutureSynchronizer(const QFuture &amp;)">
1136 1136 <modify-argument index="1">
1137 1137 <replace-type modified-type="QtScriptVoidFuture*" />
1138 1138 <conversion-rule class="native">
1139 1139 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1140 1140 </conversion-rule>
1141 1141 </modify-argument>
1142 1142 </modify-function>
1143 1143 <modify-function signature="addFuture(const QFuture &amp;)">
1144 1144 <modify-argument index="1">
1145 1145 <replace-type modified-type="QtScriptVoidFuture*" />
1146 1146 <conversion-rule class="native">
1147 1147 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1148 1148 </conversion-rule>
1149 1149 </modify-argument>
1150 1150 </modify-function>
1151 1151 <modify-function signature="setFuture(const QFuture &amp;)">
1152 1152 <modify-argument index="1">
1153 1153 <replace-type modified-type="QtScriptVoidFuture*" />
1154 1154 <conversion-rule class="native">
1155 1155 const QtScriptVoidFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptVoidFuture*&gt;(%in%);
1156 1156 </conversion-rule>
1157 1157 </modify-argument>
1158 1158 </modify-function>
1159 1159 <modify-function signature="futures()const" remove="all" />
1160 1160 </object-type>
1161 1161
1162 1162 <object-type name="QtScriptFutureIterator">
1163 1163 <modify-function signature="QFutureIterator(const QFuture &amp;)">
1164 1164 <modify-argument index="1">
1165 1165 <replace-type modified-type="QtScriptFuture*" />
1166 1166 <conversion-rule class="native">
1167 1167 const QtScriptFuture &amp; %out% = *qscriptvalue_cast&lt;QtScriptFuture*&gt;(%in%);
1168 1168 </conversion-rule>
1169 1169 </modify-argument>
1170 1170 </modify-function>
1171 1171 </object-type>
1172 1172
1173 1173
1174 1174 <!-- QXMLStream stream stuff. This was moved from QtXml to QtCore in 4.4 -->
1175 1175
1176 1176 <enum-type name="QXmlStreamReader::Error" />
1177 1177 <enum-type name="QXmlStreamReader::TokenType" />
1178 1178
1179 1179 <value-type name="QXmlStreamAttribute">
1180 1180 <modify-function signature="operator=(QXmlStreamAttribute)" remove="all"/>
1181 1181
1182 1182 <modify-function signature="name()const">
1183 1183 <modify-argument index="return">
1184 1184 <conversion-rule class="native">
1185 1185 <insert-template name="core.convert_stringref_to_string"/>
1186 1186 </conversion-rule>
1187 1187 </modify-argument>
1188 1188 </modify-function>
1189 1189
1190 1190 <modify-function signature="namespaceUri()const">
1191 1191 <modify-argument index="return">
1192 1192 <conversion-rule class="native">
1193 1193 <insert-template name="core.convert_stringref_to_string"/>
1194 1194 </conversion-rule>
1195 1195 </modify-argument>
1196 1196 </modify-function>
1197 1197
1198 1198 <modify-function signature="prefix()const">
1199 1199 <modify-argument index="return">
1200 1200 <conversion-rule class="native">
1201 1201 <insert-template name="core.convert_stringref_to_string"/>
1202 1202 </conversion-rule>
1203 1203 </modify-argument>
1204 1204 </modify-function>
1205 1205
1206 1206 <modify-function signature="qualifiedName()const">
1207 1207 <modify-argument index="return">
1208 1208 <conversion-rule class="native">
1209 1209 <insert-template name="core.convert_stringref_to_string"/>
1210 1210 </conversion-rule>
1211 1211 </modify-argument>
1212 1212 </modify-function>
1213 1213
1214 1214 <modify-function signature="value()const">
1215 1215 <modify-argument index="return">
1216 1216 <conversion-rule class="native">
1217 1217 <insert-template name="core.convert_stringref_to_string"/>
1218 1218 </conversion-rule>
1219 1219 </modify-argument>
1220 1220 </modify-function>
1221 1221
1222 1222 </value-type>
1223 1223
1224 1224 <value-type name="QXmlStreamAttributes">
1225 1225 <modify-function signature="operator+(QVector&lt;QXmlStreamAttribute>)const" remove="all"/>
1226 1226 <modify-function signature="operator&lt;&lt;(QVector&lt;QXmlStreamAttribute>)" remove="all"/>
1227 1227 <modify-function signature="operator&lt;&lt;(QXmlStreamAttribute)" remove="all"/>
1228 1228 <modify-function signature="push_back(QXmlStreamAttribute)" remove="all"/>
1229 1229 <modify-function signature="pop_back()" remove="all"/>
1230 1230 <modify-function signature="push_front(QXmlStreamAttribute)" remove="all"/>
1231 1231 <modify-function signature="pop_front()" remove="all"/>
1232 1232
1233 1233 <modify-function signature="value(const QString &amp;, const QLatin1String &amp;)const">
1234 1234 <remove />
1235 1235 </modify-function>
1236 1236 <modify-function signature="value(const QLatin1String &amp;, const QLatin1String &amp;)const">
1237 1237 <remove />
1238 1238 </modify-function>
1239 1239 <modify-function signature="value(const QLatin1String &amp;)const">
1240 1240 <remove />
1241 1241 </modify-function>
1242 1242 <modify-function signature="hasAttribute(const QLatin1String &amp;)const">
1243 1243 <remove />
1244 1244 </modify-function>
1245 1245
1246 1246
1247 1247 <modify-function signature="value(QString,QString)const">
1248 1248 <modify-argument index="return">
1249 1249 <conversion-rule class="native">
1250 1250 <insert-template name="core.convert_stringref_to_string"/>
1251 1251 </conversion-rule>
1252 1252 </modify-argument>
1253 1253 </modify-function>
1254 1254
1255 1255 <modify-function signature="value(QString)const">
1256 1256 <modify-argument index="return">
1257 1257 <conversion-rule class="native">
1258 1258 <insert-template name="core.convert_stringref_to_string"/>
1259 1259 </conversion-rule>
1260 1260 </modify-argument>
1261 1261 </modify-function>
1262 1262
1263 1263 </value-type>
1264 1264
1265 1265 <value-type name="QXmlStreamNamespaceDeclaration">
1266 1266 <modify-function signature="operator=(QXmlStreamNamespaceDeclaration)" remove="all"/>
1267 1267
1268 1268 <modify-function signature="namespaceUri()const">
1269 1269 <modify-argument index="return">
1270 1270 <conversion-rule class="native">
1271 1271 <insert-template name="core.convert_stringref_to_string"/>
1272 1272 </conversion-rule>
1273 1273 </modify-argument>
1274 1274 </modify-function>
1275 1275
1276 1276 <modify-function signature="prefix()const">
1277 1277 <modify-argument index="return">
1278 1278 <conversion-rule class="native">
1279 1279 <insert-template name="core.convert_stringref_to_string"/>
1280 1280 </conversion-rule>
1281 1281 </modify-argument>
1282 1282 </modify-function>
1283 1283
1284 1284 </value-type>
1285 1285
1286 1286 <value-type name="QXmlStreamNotationDeclaration">
1287 1287 <modify-function signature="operator=(QXmlStreamNotationDeclaration)" remove="all"/>
1288 1288
1289 1289 <modify-function signature="name()const">
1290 1290 <modify-argument index="return">
1291 1291 <conversion-rule class="native">
1292 1292 <insert-template name="core.convert_stringref_to_string"/>
1293 1293 </conversion-rule>
1294 1294 </modify-argument>
1295 1295 </modify-function>
1296 1296
1297 1297 <modify-function signature="publicId()const">
1298 1298 <modify-argument index="return">
1299 1299 <conversion-rule class="native">
1300 1300 <insert-template name="core.convert_stringref_to_string"/>
1301 1301 </conversion-rule>
1302 1302 </modify-argument>
1303 1303 </modify-function>
1304 1304
1305 1305 <modify-function signature="systemId()const">
1306 1306 <modify-argument index="return">
1307 1307 <conversion-rule class="native">
1308 1308 <insert-template name="core.convert_stringref_to_string"/>
1309 1309 </conversion-rule>
1310 1310 </modify-argument>
1311 1311 </modify-function>
1312 1312
1313 1313 </value-type>
1314 1314
1315 1315 <value-type name="QXmlStreamEntityDeclaration">
1316 1316 <modify-function signature="operator=(QXmlStreamEntityDeclaration)" remove="all"/>
1317 1317
1318 1318 <modify-function signature="name()const">
1319 1319 <modify-argument index="return">
1320 1320 <conversion-rule class="native">
1321 1321 <insert-template name="core.convert_stringref_to_string"/>
1322 1322 </conversion-rule>
1323 1323 </modify-argument>
1324 1324 </modify-function>
1325 1325
1326 1326 <modify-function signature="notationName()const">
1327 1327 <modify-argument index="return">
1328 1328 <conversion-rule class="native">
1329 1329 <insert-template name="core.convert_stringref_to_string"/>
1330 1330 </conversion-rule>
1331 1331 </modify-argument>
1332 1332 </modify-function>
1333 1333
1334 1334 <modify-function signature="publicId()const">
1335 1335 <modify-argument index="return">
1336 1336 <conversion-rule class="native">
1337 1337 <insert-template name="core.convert_stringref_to_string"/>
1338 1338 </conversion-rule>
1339 1339 </modify-argument>
1340 1340 </modify-function>
1341 1341
1342 1342 <modify-function signature="systemId()const">
1343 1343 <modify-argument index="return">
1344 1344 <conversion-rule class="native">
1345 1345 <insert-template name="core.convert_stringref_to_string"/>
1346 1346 </conversion-rule>
1347 1347 </modify-argument>
1348 1348 </modify-function>
1349 1349
1350 1350 <modify-function signature="value()const">
1351 1351 <modify-argument index="return">
1352 1352 <conversion-rule class="native">
1353 1353 <insert-template name="core.convert_stringref_to_string"/>
1354 1354 </conversion-rule>
1355 1355 </modify-argument>
1356 1356 </modify-function>
1357 1357
1358 1358 </value-type>
1359 1359
1360 1360 <object-type name="QXmlStreamReader">
1361 1361 <modify-function signature="QXmlStreamReader(const char*)" remove="all" />
1362 1362 <modify-function signature="addData(const char*)" remove="all" />
1363 1363 <modify-function signature="setEntityResolver(QXmlStreamEntityResolver*)">
1364 1364 <modify-argument index="1">
1365 1365 <reference-count action="set" variable-name="__rcEntityResolver" />
1366 1366 </modify-argument>
1367 1367 </modify-function>
1368 1368
1369 1369 <modify-function signature="name()const">
1370 1370 <modify-argument index="return">
1371 1371 <conversion-rule class="native">
1372 1372 <insert-template name="core.convert_stringref_to_string"/>
1373 1373 </conversion-rule>
1374 1374 </modify-argument>
1375 1375 </modify-function>
1376 1376
1377 1377 <modify-function signature="documentEncoding()const">
1378 1378 <modify-argument index="return">
1379 1379 <conversion-rule class="native">
1380 1380 <insert-template name="core.convert_stringref_to_string"/>
1381 1381 </conversion-rule>
1382 1382 </modify-argument>
1383 1383 </modify-function>
1384 1384
1385 1385 <modify-function signature="documentVersion()const">
1386 1386 <modify-argument index="return">
1387 1387 <conversion-rule class="native">
1388 1388 <insert-template name="core.convert_stringref_to_string"/>
1389 1389 </conversion-rule>
1390 1390 </modify-argument>
1391 1391 </modify-function>
1392 1392
1393 1393 <modify-function signature="dtdName()const">
1394 1394 <modify-argument index="return">
1395 1395 <conversion-rule class="native">
1396 1396 <insert-template name="core.convert_stringref_to_string"/>
1397 1397 </conversion-rule>
1398 1398 </modify-argument>
1399 1399 </modify-function>
1400 1400
1401 1401 <modify-function signature="dtdPublicId()const">
1402 1402 <modify-argument index="return">
1403 1403 <conversion-rule class="native">
1404 1404 <insert-template name="core.convert_stringref_to_string"/>
1405 1405 </conversion-rule>
1406 1406 </modify-argument>
1407 1407 </modify-function>
1408 1408
1409 1409 <modify-function signature="dtdSystemId()const">
1410 1410 <modify-argument index="return">
1411 1411 <conversion-rule class="native">
1412 1412 <insert-template name="core.convert_stringref_to_string"/>
1413 1413 </conversion-rule>
1414 1414 </modify-argument>
1415 1415 </modify-function>
1416 1416
1417 1417 <modify-function signature="namespaceUri()const">
1418 1418 <modify-argument index="return">
1419 1419 <conversion-rule class="native">
1420 1420 <insert-template name="core.convert_stringref_to_string"/>
1421 1421 </conversion-rule>
1422 1422 </modify-argument>
1423 1423 </modify-function>
1424 1424
1425 1425 <modify-function signature="prefix()const">
1426 1426 <modify-argument index="return">
1427 1427 <conversion-rule class="native">
1428 1428 <insert-template name="core.convert_stringref_to_string"/>
1429 1429 </conversion-rule>
1430 1430 </modify-argument>
1431 1431 </modify-function>
1432 1432
1433 1433 <modify-function signature="processingInstructionData()const">
1434 1434 <modify-argument index="return">
1435 1435 <conversion-rule class="native">
1436 1436 <insert-template name="core.convert_stringref_to_string"/>
1437 1437 </conversion-rule>
1438 1438 </modify-argument>
1439 1439 </modify-function>
1440 1440
1441 1441 <modify-function signature="processingInstructionTarget()const">
1442 1442 <modify-argument index="return">
1443 1443 <conversion-rule class="native">
1444 1444 <insert-template name="core.convert_stringref_to_string"/>
1445 1445 </conversion-rule>
1446 1446 </modify-argument>
1447 1447 </modify-function>
1448 1448
1449 1449 <modify-function signature="qualifiedName()const">
1450 1450 <modify-argument index="return">
1451 1451 <conversion-rule class="native">
1452 1452 <insert-template name="core.convert_stringref_to_string"/>
1453 1453 </conversion-rule>
1454 1454 </modify-argument>
1455 1455 </modify-function>
1456 1456
1457 1457 <modify-function signature="text()const">
1458 1458 <modify-argument index="return">
1459 1459 <conversion-rule class="native">
1460 1460 <insert-template name="core.convert_stringref_to_string"/>
1461 1461 </conversion-rule>
1462 1462 </modify-argument>
1463 1463 </modify-function>
1464 1464 </object-type>
1465 1465
1466 1466 <object-type name="QXmlStreamWriter">
1467 1467 <modify-function signature="QXmlStreamWriter(QString *)">
1468 1468 <remove />
1469 1469 </modify-function>
1470 1470
1471 1471 <modify-function signature="setCodec(const char*)">
1472 1472 <modify-argument index="1">
1473 1473 <replace-type modified-type="QString"/>
1474 1474 <conversion-rule class="native">
1475 1475 <insert-template name="core.convert_string_arg_to_char*"/>
1476 1476 </conversion-rule>
1477 1477 </modify-argument>
1478 1478 </modify-function>
1479 1479
1480 1480 <modify-function signature="writeCurrentToken(QXmlStreamReader)">
1481 1481 <modify-argument index="1">
1482 1482 <replace-type modified-type="QXmlStreamReader*"/>
1483 1483 <conversion-rule class="native">
1484 1484 QXmlStreamReader &amp; %out% = *qscriptvalue_cast&lt;QXmlStreamReader*&gt;(%in%);
1485 1485 </conversion-rule>
1486 1486 </modify-argument>
1487 1487 </modify-function>
1488 1488
1489 1489 </object-type>
1490 1490
1491 1491 <value-type name="QEasingCurve">
1492 1492 <modify-function signature="QEasingCurve(QEasingCurve)" remove="all" />
1493 1493 <modify-function signature="operator=(QEasingCurve)" remove="all"/>
1494 1494 <modify-function signature="operator==(const QEasingCurve &amp;)const" remove="all"/>
1495 1495 <modify-function signature="operator!=(const QEasingCurve &amp;)const" remove="all"/>
1496 1496 <modify-function signature="setCustomType(double)" remove="all"/>
1497 1497 <modify-function signature="customType()const" remove="all"/>
1498 1498 </value-type>
1499 1499
1500 1500 <object-type name="QPropertyAnimation">
1501 1501 <modify-function signature="QPropertyAnimation(QObject*,QByteArray,QObject*)">
1502 1502 <modify-argument index="2">
1503 1503 <replace-type modified-type="QString"/>
1504 1504 <conversion-rule class="native">
1505 1505 <insert-template name="core.convert_string_arg_to_latin1"/>
1506 1506 </conversion-rule>
1507 1507 </modify-argument>
1508 1508 </modify-function>
1509 1509 </object-type>
1510 1510
1511 1511 <object-type name="QState">
1512 1512 <modify-function signature="addTransition(QObject*,const char*,QAbstractState*)">
1513 1513 <modify-argument index="2">
1514 1514 <replace-type modified-type="QString"/>
1515 1515 <conversion-rule class="native">
1516 1516 <insert-template name="core.convert_string_arg_to_char*"/>
1517 1517 </conversion-rule>
1518 1518 </modify-argument>
1519 1519 </modify-function>
1520 1520 <modify-function signature="assignProperty(QObject*,const char*,QVariant)">
1521 1521 <modify-argument index="2">
1522 1522 <replace-type modified-type="QString"/>
1523 1523 <conversion-rule class="native">
1524 1524 <insert-template name="core.convert_string_arg_to_char*"/>
1525 1525 </conversion-rule>
1526 1526 </modify-argument>
1527 1527 </modify-function>
1528 1528 </object-type>
1529 1529
1530 1530 <value-type name="QRegExp">
1531 1531 <modify-function signature="cap(int)" remove="all"/>
1532 1532 <modify-function signature="capturedTexts()" remove="all"/>
1533 1533 <modify-function signature="pos(int)" remove="all"/>
1534 1534 <modify-function signature="errorString()" remove="all"/>
1535 1535 </value-type>
1536 1536
1537 1537 <primitive-type name="bool"/>
1538 1538 <primitive-type name="double"/>
1539 1539 <primitive-type name="qreal"/>
1540 1540 <primitive-type name="float"/>
1541 1541 <primitive-type name="qint64"/>
1542 1542 <primitive-type name="__int64"/>
1543 1543 <primitive-type name="unsigned __int64"/>
1544 1544 <primitive-type name="unsigned long long"/>
1545 1545 <primitive-type name="long long"/>
1546 1546 <primitive-type name="qlonglong"/>
1547 1547 <primitive-type name="qulonglong"/>
1548 1548 <primitive-type name="short"/>
1549 1549 <primitive-type name="short"/>
1550 1550 <primitive-type name="signed short"/>
1551 1551 <primitive-type name="ushort"/>
1552 1552 <primitive-type name="unsigned short"/>
1553 1553 <primitive-type name="char"/>
1554 1554 <primitive-type name="signed char"/>
1555 1555 <primitive-type name="uchar"/>
1556 1556 <primitive-type name="unsigned char"/>
1557 1557 <primitive-type name="int"/>
1558 1558 <primitive-type name="signed int"/>
1559 1559 <primitive-type name="uint"/>
1560 1560 <primitive-type name="ulong"/>
1561 1561 <primitive-type name="unsigned int"/>
1562 1562 <primitive-type name="signed long"/>
1563 1563 <primitive-type name="long"/>
1564 1564 <primitive-type name="unsigned long"/>
1565 1565 <primitive-type name="WId"/>
1566 1566 <primitive-type name="Qt::HANDLE"/>
1567 1567 <primitive-type name="QVariant::Type"/>
1568 1568 <primitive-type name="QByteRef"/>
1569 1569 <primitive-type name="QBitRef"/>
1570 1570 <primitive-type name="QBool"/>
1571 1571 <primitive-type name="jobject"/>
1572 1572 <primitive-type name="quintptr"/>
1573 1573
1574 1574 <suppress-warning text="WARNING(MetaJavaBuilder) :: signal 'finished' in class 'QProcess' is overloaded." />
1575 1575 <suppress-warning text="WARNING(MetaJavaBuilder) :: missing required class for enums: QRegExp" />
1576 1576 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'QtValidLicenseForScriptToolsModule' does not have a type entry or is not an enum" />
1577 1577 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QDataStream::Qt_4_5" />
1578 1578 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::MatchFlags(Qt::MatchStartsWith in Qt::MatchFlag" />
1579 1579 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::MatchWrap) in Qt::MatchFlag" />
1580 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 1582 <suppress-warning text="WARNING(MetaJavaBuilder) :: Unable to decide type of property: 'Qt::GestureState' in class 'QGesture'" />
1583 1583 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum 'Qt::GestureState' does not have a type entry or is not an enum" />
1584 1584 <suppress-warning text="WARNING(MetaJavaBuilder) :: template baseclass 'QGenericMatrix&lt;qreal&gt;' of 'QMatrix3x3' is not known" />
1585 1585 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: ~0u in Qt::GestureType" />
1586 1586 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum ~0u" />
1587 1587 <suppress-warning text="WARNING(MetaJavaBuilder) :: unhandled enum value: Qt::GestureFlags() in Qt::GestureFlag" />
1588 1588 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::GestureFlags() when parsing default value of 'grabGesture' in class 'QWidget'" />
1589 1589 <suppress-warning text="WARNING(MetaJavaBuilder) :: unmatched enum Qt::GestureFlags() when parsing default value of 'grabGesture' in class 'QGraphicsObject'" />
1590 1590
1591 1591 <!-- some catch-all warning suppressions -->
1592 1592 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value 'QLatin1String(defaultConnection)' of argument in function '*', class '*'"/>
1593 1593 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class '*' has equals operators but no qHash() function" />
1594 1594 <suppress-warning text="WARNING(MetaJavaBuilder) :: type '*' is specified in typesystem, but not defined. This could potentially lead to compilation errors." />
1595 1595 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace '*' for enum '*' is not declared" />
1596 1596 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function '*', unmatched parameter type '*'" />
1597 1597 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping function '*', unmatched return type '*'" />
1598 1598 <suppress-warning text="WARNING(MetaJavaBuilder) :: signature '*' for function modification in '*' not found. Possible candidates: " />
1599 1599 <suppress-warning text="WARNING(MetaJavaBuilder) :: namespace '*' does not have a type entry" />
1600 1600 <suppress-warning text="WARNING(MetaJavaBuilder) :: unsupported default value '*' of argument in function '*', class '*'" />
1601 1601 <suppress-warning text="WARNING(MetaJavaBuilder) :: Shadowing: * and *; Java code will not compile" />
1602 1602 <suppress-warning text="WARNING(MetaJavaBuilder) :: enum '*' is specified in typesystem, but not declared" />
1603 1603
1604 1604 </typesystem>
@@ -1,99 +1,106
1 1 <?xml version="1.0"?>
2 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 3 <rejection class="QGLColormap::QGLColormapData"/>
4 4 <rejection class="QGLWidget" function-name="setMouseTracking"/>
5 5
6 6 <enum-type name="QGL::FormatOption" flags="QGL::FormatOptions"/>
7 7 <enum-type name="QGLFormat::OpenGLVersionFlag" flags="QGLFormat::OpenGLVersionFlags"/>
8 8 <enum-type name="QGLFramebufferObject::Attachment"/>
9 9 <enum-type name="QGLContext::BindOption" flags="QGLContext::BindOptions"/>
10 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 18 <namespace-type name="QGL">
14 19 <include file-name="qgl.h" location="global"/>
15 20 </namespace-type>
16 21
17 22 <value-type name="QGLColormap">
18 23 <modify-function signature="operator=(QGLColormap)" remove="all"/>
19 24
20 25 <modify-function signature="setEntries(int,const unsigned int*,int)">
21 26 <access modifier="private"/>
22 27 </modify-function>
23 28 </value-type>
24 29
25 30 <value-type name="QGLFormat">
26 31 <modify-function signature="operator=(QGLFormat)" remove="all"/>
27 32 </value-type>
28 33
29 34 <value-type name="QGLFramebufferObjectFormat"/>
35 <object-type name="QGLFunctions"/>
36 <object-type name="QGLBuffer"/>
30 37 <object-type name="QGLShader"/>
31 38 <object-type name="QGLShaderProgram">
32 39 <!-- Should be disambiguated later by fixing the native pointer API -->
33 40 <modify-function signature="setAttributeArray(int, const QVector2D *, int)" rename="setAttributeArray_QVector2D"/>
34 41 <modify-function signature="setAttributeArray(int, const QVector3D *, int)" rename="setAttributeArray_QVector3D"/>
35 42 <modify-function signature="setAttributeArray(int, const QVector4D *, int)" rename="setAttributeArray_QVector4D"/>
36 43 <modify-function signature="setAttributeArray(const char *, const QVector2D *, int)" rename="setAttributeArray_QVector2D"/>
37 44 <modify-function signature="setAttributeArray(const char *, const QVector3D *, int)" rename="setAttributeArray_QVector3D"/>
38 45 <modify-function signature="setAttributeArray(const char *, const QVector4D *, int)" rename="setAttributeArray_QVector4D"/>
39 46 <modify-function signature="setUniformValueArray(int, const GLint *, int)" rename="setUniformValueArray_int"/>
40 47 <modify-function signature="setUniformValueArray(int, const GLuint *, int)" rename="setUniformValueArray_uint"/>
41 48 <modify-function signature="setUniformValueArray(int, const QVector2D *, int)" rename="setUniformValueArray_QVector2D"/>
42 49 <modify-function signature="setUniformValueArray(int, const QVector3D *, int)" rename="setUniformValueArray_QVector3D"/>
43 50 <modify-function signature="setUniformValueArray(int, const QVector4D *, int)" rename="setUniformValueArray_QVector4D"/>
44 51
45 52 <modify-function signature="setUniformValueArray(const char*, const GLint *, int)" rename="setUniformValueArray_int"/>
46 53 <modify-function signature="setUniformValueArray(const char*, const GLuint *, int)" remove="all"/>
47 54 <modify-function signature="setUniformValueArray(const char*, const QVector2D *, int)" rename="setUniformValueArray_QVector2D"/>
48 55 <modify-function signature="setUniformValueArray(const char*, const QVector3D *, int)" rename="setUniformValueArray_QVector3D"/>
49 56 <modify-function signature="setUniformValueArray(const char*, const QVector4D *, int)" rename="setUniformValueArray_QVector4D"/>
50 57 <modify-function signature="setUniformValue(int, GLuint)" remove="all"/>
51 58 <modify-function signature="setUniformValue(const char*, GLuint)" remove="all"/>
52 59 <modify-function signature="setUniformValue(int, Array)" remove="all"/>
53 60 <modify-function signature="setUniformValue(const char*, Array)" remove="all"/>
54 61 </object-type>
55 62 <object-type name="QGLContext">
56 63
57 64 <modify-function signature="chooseContext(const QGLContext*)">
58 65 <modify-argument index="1" invalidate-after-use="yes"/>
59 66 </modify-function>
60 67 <modify-function signature="create(const QGLContext*)">
61 68 <modify-argument index="1" invalidate-after-use="yes"/>
62 69 </modify-function>
63 70
64 71 <modify-function signature="getProcAddress(QString)const">
65 72 <remove/>
66 73 </modify-function>
67 74 <modify-field name="currentCtx" read="false" write="false"/>
68 75 <modify-function signature="setDevice(QPaintDevice*)">
69 76 <remove/>
70 77 </modify-function>
71 78 <modify-function signature="generateFontDisplayLists(QFont, int)" remove="all"/>
72 79 </object-type>
73 80 <object-type name="QGLFramebufferObject"/>
74 81 <object-type name="QGLPixelBuffer">
75 82 <extra-includes>
76 83 <include file-name="QImage" location="global"/>
77 84 </extra-includes>
78 85 </object-type>
79 86 <object-type name="QGLWidget">
80 87 <extra-includes>
81 88 <include file-name="QImage" location="global"/>
82 89 <include file-name="QPixmap" location="global"/>
83 90 </extra-includes>
84 91 <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)">
85 92 <remove/> <!--- Obsolete -->
86 93 </modify-function>
87 94 <modify-function signature="fontDisplayListBase(QFont, int)" remove="all"/>
88 95 <modify-function signature="setFormat(QGLFormat)" remove="all"/>
89 96 </object-type>
90 97
91 98 <suppress-warning text="WARNING(MetaJavaBuilder) :: Class 'QGLFormat' has equals operators but no qHash() function. Hashcode of objects will consistently be 0."/>
92 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 101 <suppress-warning text="WARNING(MetaJavaBuilder) :: skipping * unmatched *type 'QGLColormap::QGLColormapData\*'"/>
95 102 <suppress-warning text="WARNING(MetaJavaBuilder) :: visibility of function '*' modified in class '*'"/>
96 103 <suppress-warning text="WARNING(MetaJavaBuilder) :: hiding of function '*' in class '*'"/>
97 104 <suppress-warning text="WARNING(CppImplGenerator) :: protected function '*' in final class '*'"/>
98 105
99 106 </typesystem>
@@ -1,2067 +1,2094
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQt.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQt.h"
43 43 #include "PythonQtImporter.h"
44 44 #include "PythonQtClassInfo.h"
45 45 #include "PythonQtMethodInfo.h"
46 46 #include "PythonQtSignal.h"
47 47 #include "PythonQtSignalReceiver.h"
48 48 #include "PythonQtConversion.h"
49 49 #include "PythonQtStdIn.h"
50 50 #include "PythonQtStdOut.h"
51 51 #include "PythonQtCppWrapperFactory.h"
52 52 #include "PythonQtVariants.h"
53 53 #include "PythonQtStdDecorators.h"
54 54 #include "PythonQtQFileImporter.h"
55 55 #include <pydebug.h>
56 56 #include <vector>
57 57
58 58 PythonQt* PythonQt::_self = NULL;
59 59 int PythonQt::_uniqueModuleCount = 0;
60 60
61 61 void PythonQt_init_QtGuiBuiltin(PyObject*);
62 62 void PythonQt_init_QtCoreBuiltin(PyObject*);
63 63
64 64
65 65 PyObject* PythonQtConvertFromStringRef(const void* inObject, int /*metaTypeId*/)
66 66 {
67 67 return PythonQtConv::QStringToPyObject(((QStringRef*)inObject)->toString());
68 68 }
69 69
70 70 void PythonQt::init(int flags, const QByteArray& pythonQtModuleName)
71 71 {
72 72 if (!_self) {
73 73 _self = new PythonQt(flags, pythonQtModuleName);
74 74
75 75 PythonQt::priv()->setupSharedLibrarySuffixes();
76 76
77 77 PythonQtMethodInfo::addParameterTypeAlias("QObjectList", "QList<QObject*>");
78 78 qRegisterMetaType<QList<QObject*> >("QList<void*>");
79 79
80 80 int stringRefId = qRegisterMetaType<QStringRef>("QStringRef");
81 81 PythonQtConv::registerMetaTypeToPythonConverter(stringRefId, PythonQtConvertFromStringRef);
82 82
83 83 PythonQtRegisterToolClassesTemplateConverter(int);
84 84 PythonQtRegisterToolClassesTemplateConverter(float);
85 85 PythonQtRegisterToolClassesTemplateConverter(double);
86 86 PythonQtRegisterToolClassesTemplateConverter(qint32);
87 87 PythonQtRegisterToolClassesTemplateConverter(quint32);
88 88 PythonQtRegisterToolClassesTemplateConverter(qint64);
89 89 PythonQtRegisterToolClassesTemplateConverter(quint64);
90 90 // TODO: which other POD types should be available for QList etc.
91 91
92 92 PythonQt_init_QtCoreBuiltin(NULL);
93 93 PythonQt_init_QtGuiBuiltin(NULL);
94 94
95 95 PythonQt::self()->addDecorators(new PythonQtStdDecorators());
96 96 PythonQt::self()->registerCPPClass("QMetaObject",0, "QtCore", PythonQtCreateObject<PythonQtWrapper_QMetaObject>);
97 97
98 98 PythonQtRegisterToolClassesTemplateConverter(QByteArray);
99 99 PythonQtRegisterToolClassesTemplateConverter(QDate);
100 100 PythonQtRegisterToolClassesTemplateConverter(QTime);
101 101 PythonQtRegisterToolClassesTemplateConverter(QDateTime);
102 102 PythonQtRegisterToolClassesTemplateConverter(QUrl);
103 103 PythonQtRegisterToolClassesTemplateConverter(QLocale);
104 104 PythonQtRegisterToolClassesTemplateConverter(QRect);
105 105 PythonQtRegisterToolClassesTemplateConverter(QRectF);
106 106 PythonQtRegisterToolClassesTemplateConverter(QSize);
107 107 PythonQtRegisterToolClassesTemplateConverter(QSizeF);
108 108 PythonQtRegisterToolClassesTemplateConverter(QLine);
109 109 PythonQtRegisterToolClassesTemplateConverter(QLineF);
110 110 PythonQtRegisterToolClassesTemplateConverter(QPoint);
111 111 PythonQtRegisterToolClassesTemplateConverter(QPointF);
112 112 PythonQtRegisterToolClassesTemplateConverter(QRegExp);
113 113
114 114 PythonQtRegisterToolClassesTemplateConverter(QFont);
115 115 PythonQtRegisterToolClassesTemplateConverter(QPixmap);
116 116 PythonQtRegisterToolClassesTemplateConverter(QBrush);
117 117 PythonQtRegisterToolClassesTemplateConverter(QColor);
118 118 PythonQtRegisterToolClassesTemplateConverter(QPalette);
119 119 PythonQtRegisterToolClassesTemplateConverter(QIcon);
120 120 PythonQtRegisterToolClassesTemplateConverter(QImage);
121 121 PythonQtRegisterToolClassesTemplateConverter(QPolygon);
122 122 PythonQtRegisterToolClassesTemplateConverter(QRegion);
123 123 PythonQtRegisterToolClassesTemplateConverter(QBitmap);
124 124 PythonQtRegisterToolClassesTemplateConverter(QCursor);
125 125 PythonQtRegisterToolClassesTemplateConverter(QSizePolicy);
126 126 PythonQtRegisterToolClassesTemplateConverter(QKeySequence);
127 127 PythonQtRegisterToolClassesTemplateConverter(QPen);
128 128 PythonQtRegisterToolClassesTemplateConverter(QTextLength);
129 129 PythonQtRegisterToolClassesTemplateConverter(QTextFormat);
130 130 PythonQtRegisterToolClassesTemplateConverter(QMatrix);
131 131
132 132
133 133 PyObject* pack = PythonQt::priv()->packageByName("QtCore");
134 134 PyObject* pack2 = PythonQt::priv()->packageByName("Qt");
135 135 PyObject* qtNamespace = PythonQt::priv()->getClassInfo("Qt")->pythonQtClassWrapper();
136 136 const char* names[16] = {"SIGNAL", "SLOT", "qAbs", "qBound","qDebug","qWarning","qCritical","qFatal"
137 137 ,"qFuzzyCompare", "qMax","qMin","qRound","qRound64","qVersion","qrand","qsrand"};
138 138 for (unsigned int i = 0;i<16; i++) {
139 139 PyObject* obj = PyObject_GetAttrString(qtNamespace, names[i]);
140 140 if (obj) {
141 141 PyModule_AddObject(pack, names[i], obj);
142 142 Py_INCREF(obj);
143 143 PyModule_AddObject(pack2, names[i], obj);
144 144 } else {
145 145 std::cerr << "method not found " << names[i] << std::endl;
146 146 }
147 147 }
148 148 }
149 149 }
150 150
151 151 void PythonQt::cleanup()
152 152 {
153 153 if (_self) {
154 154 delete _self;
155 155 _self = NULL;
156 156 }
157 157 }
158 158
159 159 PythonQt* PythonQt::self() { return _self; }
160 160
161 161 PythonQt::PythonQt(int flags, const QByteArray& pythonQtModuleName)
162 162 {
163 163 _p = new PythonQtPrivate;
164 164 _p->_initFlags = flags;
165 165
166 166 _p->_PythonQtObjectPtr_metaId = qRegisterMetaType<PythonQtObjectPtr>("PythonQtObjectPtr");
167 167
168 168 if ((flags & PythonAlreadyInitialized) == 0) {
169 169 #ifdef PY3K
170 170 Py_SetProgramName(const_cast<wchar_t*>(L"PythonQt"));
171 171 #else
172 172 Py_SetProgramName(const_cast<char*>("PythonQt"));
173 173 #endif
174 174 if (flags & IgnoreSiteModule) {
175 175 // this prevents the automatic importing of Python site files
176 176 Py_NoSiteFlag = 1;
177 177 }
178 178 Py_Initialize();
179 179 }
180 180
181 181 // add our own python object types for qt object slots
182 182 if (PyType_Ready(&PythonQtSlotFunction_Type) < 0) {
183 183 std::cerr << "could not initialize PythonQtSlotFunction_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
184 184 }
185 185 Py_INCREF(&PythonQtSlotFunction_Type);
186 186
187 187 if (PyType_Ready(&PythonQtSignalFunction_Type) < 0) {
188 188 std::cerr << "could not initialize PythonQtSignalFunction_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
189 189 }
190 190 Py_INCREF(&PythonQtSignalFunction_Type);
191 191
192 192 // according to Python docs, set the type late here, since it can not safely be stored in the struct when declaring it
193 193 PythonQtClassWrapper_Type.tp_base = &PyType_Type;
194 194 // add our own python object types for classes
195 195 if (PyType_Ready(&PythonQtClassWrapper_Type) < 0) {
196 196 std::cerr << "could not initialize PythonQtClassWrapper_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
197 197 }
198 198 Py_INCREF(&PythonQtClassWrapper_Type);
199 199
200 200 // add our own python object types for CPP instances
201 201 if (PyType_Ready(&PythonQtInstanceWrapper_Type) < 0) {
202 202 PythonQt::handleError();
203 203 std::cerr << "could not initialize PythonQtInstanceWrapper_Type" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
204 204 }
205 205 Py_INCREF(&PythonQtInstanceWrapper_Type);
206 206
207 207 // add our own python object types for redirection of stdout
208 208 if (PyType_Ready(&PythonQtStdOutRedirectType) < 0) {
209 209 std::cerr << "could not initialize PythonQtStdOutRedirectType" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
210 210 }
211 211 Py_INCREF(&PythonQtStdOutRedirectType);
212 212
213 213 // add our own python object types for redirection of stdin
214 214 if (PyType_Ready(&PythonQtStdInRedirectType) < 0) {
215 215 std::cerr << "could not initialize PythonQtStdInRedirectType" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
216 216 }
217 217 Py_INCREF(&PythonQtStdInRedirectType);
218 218
219 219 initPythonQtModule(flags & RedirectStdOut, pythonQtModuleName);
220 220
221 221 }
222 222
223 223 PythonQt::~PythonQt() {
224 224 delete _p;
225 225 _p = NULL;
226 226 }
227 227
228 228 PythonQtPrivate::~PythonQtPrivate() {
229 229 delete _defaultImporter;
230 230 _defaultImporter = NULL;
231 231
232 232 {
233 233 QHashIterator<QByteArray, PythonQtClassInfo *> i(_knownClassInfos);
234 234 while (i.hasNext()) {
235 235 delete i.next().value();
236 236 }
237 237 }
238 238 PythonQtConv::global_valueStorage.clear();
239 239 PythonQtConv::global_ptrStorage.clear();
240 240 PythonQtConv::global_variantStorage.clear();
241 241
242 242 PythonQtMethodInfo::cleanupCachedMethodInfos();
243 243 }
244 244
245 245 void PythonQt::setRedirectStdInCallback(PythonQtInputChangedCB* callback, void * callbackData)
246 246 {
247 247 if (!callback)
248 248 {
249 249 std::cerr << "PythonQt::setRedirectStdInCallback - callback parameter is NULL !" << std::endl;
250 250 return;
251 251 }
252 252
253 253 PythonQtObjectPtr sys;
254 254 PythonQtObjectPtr in;
255 255 sys.setNewRef(PyImport_ImportModule("sys"));
256 256
257 257 // Backup original 'sys.stdin' if not yet done
258 258 if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") )
259 259 PyObject_SetAttrString(sys.object(), "pythonqt_original_stdin", PyObject_GetAttrString(sys.object(), "stdin"));
260 260
261 261 in = PythonQtStdInRedirectType.tp_new(&PythonQtStdInRedirectType, NULL, NULL);
262 262 ((PythonQtStdInRedirect*)in.object())->_cb = callback;
263 263 ((PythonQtStdInRedirect*)in.object())->_callData = callbackData;
264 264 // replace the built in file objects with our own objects
265 265 PyModule_AddObject(sys.object(), "stdin", in);
266 266
267 267 // Backup custom 'stdin' into 'pythonqt_stdin'
268 268 Py_IncRef(in);
269 269 PyModule_AddObject(sys.object(), "pythonqt_stdin", in);
270 270 }
271 271
272 272 void PythonQt::setRedirectStdInCallbackEnabled(bool enabled)
273 273 {
274 274 PythonQtObjectPtr sys;
275 275 sys.setNewRef(PyImport_ImportModule("sys"));
276 276
277 277 if (enabled)
278 278 {
279 279 if( !PyObject_HasAttrString(sys.object(), "pythonqt_stdin") )
280 280 PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_stdin"));
281 281 }
282 282 else
283 283 {
284 284 if( !PyObject_HasAttrString(sys.object(), "pythonqt_original_stdin") )
285 285 PyObject_SetAttrString(sys.object(), "stdin", PyObject_GetAttrString(sys.object(), "pythonqt_original_stdin"));
286 286 }
287 287 }
288 288
289 289 PythonQtImportFileInterface* PythonQt::importInterface()
290 290 {
291 291 return _self->_p->_importInterface?_self->_p->_importInterface:_self->_p->_defaultImporter;
292 292 }
293 293
294 294 void PythonQt::qObjectNoLongerWrappedCB(QObject* o)
295 295 {
296 296 if (_self->_p->_noLongerWrappedCB) {
297 297 (*_self->_p->_noLongerWrappedCB)(o);
298 298 };
299 299 }
300 300
301 301 void PythonQt::registerClass(const QMetaObject* metaobject, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell)
302 302 {
303 303 _p->registerClass(metaobject, package, wrapperCreator, shell);
304 304 }
305 305
306 306 void PythonQtPrivate::registerClass(const QMetaObject* metaobject, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell, PyObject* module, int typeSlots)
307 307 {
308 308 // we register all classes in the hierarchy
309 309 const QMetaObject* m = metaobject;
310 310 bool first = true;
311 311 while (m) {
312 312 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(m->className());
313 313 if (!info->pythonQtClassWrapper()) {
314 314 info->setTypeSlots(typeSlots);
315 315 info->setupQObject(m);
316 316 createPythonQtClassWrapper(info, package, module);
317 317 if (m->superClass()) {
318 318 PythonQtClassInfo* parentInfo = lookupClassInfoAndCreateIfNotPresent(m->superClass()->className());
319 319 info->addParentClass(PythonQtClassInfo::ParentClassInfo(parentInfo));
320 320 }
321 321 } else if (first && module) {
322 322 // There is a wrapper already, but if we got a module, we want to place the wrapper into that module as well,
323 323 // since it might have been placed into "private" earlier on.
324 324 // If the wrapper was already added to module before, it is just readded, which does no harm.
325 325 PyObject* classWrapper = info->pythonQtClassWrapper();
326 326 // AddObject steals a reference, so we need to INCREF
327 327 Py_INCREF(classWrapper);
328 328 PyModule_AddObject(module, info->className(), classWrapper);
329 329 }
330 330 if (first) {
331 331 first = false;
332 332 if (wrapperCreator) {
333 333 info->setDecoratorProvider(wrapperCreator);
334 334 }
335 335 if (shell) {
336 336 info->setShellSetInstanceWrapperCB(shell);
337 337 }
338 338 }
339 339 m = m->superClass();
340 340 }
341 341 }
342 342
343 343 void PythonQtPrivate::createPythonQtClassWrapper(PythonQtClassInfo* info, const char* package, PyObject* module)
344 344 {
345 345 PyObject* pack = module?module:packageByName(package);
346 346 PyObject* pyobj = (PyObject*)createNewPythonQtClassWrapper(info, pack);
347 347 PyModule_AddObject(pack, info->className(), pyobj);
348 348 if (!module && package && strncmp(package,"Qt",2)==0) {
349 349 // since PyModule_AddObject steals the reference, we need a incref once more...
350 350 Py_INCREF(pyobj);
351 351 // put all qt objects into Qt as well
352 352 PyModule_AddObject(packageByName("Qt"), info->className(), pyobj);
353 353 }
354 354 info->setPythonQtClassWrapper(pyobj);
355 355 }
356 356
357 357 PyObject* PythonQtPrivate::wrapQObject(QObject* obj)
358 358 {
359 359 if (!obj) {
360 360 Py_INCREF(Py_None);
361 361 return Py_None;
362 362 }
363 363 PythonQtInstanceWrapper* wrap = findWrapperAndRemoveUnused(obj);
364 364 if (wrap && wrap->_wrappedPtr) {
365 365 // uh oh, we want to wrap a QObject, but have a C++ wrapper at that
366 366 // address, so probably that C++ wrapper has been deleted earlier and
367 367 // now we see a QObject with the same address.
368 368 // Do not use the old wrapper anymore.
369 369 wrap = NULL;
370 370 }
371 371 if (!wrap) {
372 372 // smuggling it in...
373 373 PythonQtClassInfo* classInfo = _knownClassInfos.value(obj->metaObject()->className());
374 374 if (!classInfo || classInfo->pythonQtClassWrapper()==NULL) {
375 375 registerClass(obj->metaObject());
376 376 classInfo = _knownClassInfos.value(obj->metaObject()->className());
377 377 }
378 378 wrap = createNewPythonQtInstanceWrapper(obj, classInfo);
379 379 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
380 380 } else {
381 381 Py_INCREF(wrap);
382 382 // mlabDebugConst("MLABPython","qobject wrapper reused " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
383 383 }
384 384 return (PyObject*)wrap;
385 385 }
386 386
387 387 PyObject* PythonQtPrivate::wrapPtr(void* ptr, const QByteArray& name)
388 388 {
389 389 if (!ptr) {
390 390 Py_INCREF(Py_None);
391 391 return Py_None;
392 392 }
393 393
394 394 PythonQtInstanceWrapper* wrap = findWrapperAndRemoveUnused(ptr);
395 395 PythonQtInstanceWrapper* possibleStillAliveWrapper = NULL;
396 396 if (wrap && wrap->_wrappedPtr) {
397 397 // we have a previous C++ wrapper... if the wrapper is for a C++ object,
398 398 // we are not sure if it may have been deleted earlier and we just see the same C++
399 399 // pointer once again. To make sure that we do not reuse a wrapper of the wrong type,
400 400 // we compare the classInfo() pointer and only reuse the wrapper if it has the same
401 401 // info. This is only needed for non-QObjects, since we know it when a QObject gets deleted.
402 402 possibleStillAliveWrapper = wrap;
403 403 wrap = NULL;
404 404 }
405 405 if (!wrap) {
406 406 PythonQtClassInfo* info = _knownClassInfos.value(name);
407 407 if (!info) {
408 408 // maybe it is a PyObject, which we can return directly
409 409 if (name == "PyObject") {
410 410 PyObject* p = (PyObject*)ptr;
411 411 Py_INCREF(p);
412 412 return p;
413 413 }
414 414
415 415 // we do not know the metaobject yet, but we might know it by its name:
416 416 if (_knownQObjectClassNames.find(name)!=_knownQObjectClassNames.end()) {
417 417 // yes, we know it, so we can convert to QObject
418 418 QObject* qptr = (QObject*)ptr;
419 419 registerClass(qptr->metaObject());
420 420 info = _knownClassInfos.value(qptr->metaObject()->className());
421 421 }
422 422 }
423 423 if (info && info->isQObject()) {
424 424 QObject* qptr = (QObject*)ptr;
425 425 // if the object is a derived object, we want to switch the class info to the one of the derived class:
426 426 if (name!=(qptr->metaObject()->className())) {
427 427 info = _knownClassInfos.value(qptr->metaObject()->className());
428 428 if (!info) {
429 429 registerClass(qptr->metaObject());
430 430 info = _knownClassInfos.value(qptr->metaObject()->className());
431 431 }
432 432 }
433 433 wrap = createNewPythonQtInstanceWrapper(qptr, info);
434 434 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
435 435 return (PyObject*)wrap;
436 436 }
437 437
438 438 // not a known QObject, try to wrap via foreign wrapper factories
439 439 PyObject* foreignWrapper = NULL;
440 440 for (int i=0; i<_foreignWrapperFactories.size(); i++) {
441 441 foreignWrapper = _foreignWrapperFactories.at(i)->wrap(name, ptr);
442 442 if (foreignWrapper) {
443 443 return foreignWrapper;
444 444 }
445 445 }
446 446
447 447 // not a known QObject, so try our wrapper factory:
448 448 QObject* wrapper = NULL;
449 449 for (int i=0; i<_cppWrapperFactories.size(); i++) {
450 450 wrapper = _cppWrapperFactories.at(i)->create(name, ptr);
451 451 if (wrapper) {
452 452 break;
453 453 }
454 454 }
455 455
456 456 if (info) {
457 457 // try to downcast in the class hierarchy, which will modify info and ptr if it is successfull
458 458 ptr = info->castDownIfPossible(ptr, &info);
459 459
460 460 // if downcasting found out that the object is a QObject,
461 461 // handle it like one:
462 462 if (info && info->isQObject()) {
463 463 QObject* qptr = (QObject*)ptr;
464 464 // if the object is a derived object, we want to switch the class info to the one of the derived class:
465 465 if (name!=(qptr->metaObject()->className())) {
466 466 registerClass(qptr->metaObject());
467 467 info = _knownClassInfos.value(qptr->metaObject()->className());
468 468 }
469 469 wrap = createNewPythonQtInstanceWrapper(qptr, info);
470 470 // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
471 471 return (PyObject*)wrap;
472 472 }
473 473 }
474 474
475 475 if (!info || info->pythonQtClassWrapper()==NULL) {
476 476 // still unknown, register as CPP class
477 477 registerCPPClass(name.constData());
478 478 info = _knownClassInfos.value(name);
479 479 }
480 480 if (wrapper && (info->metaObject() != wrapper->metaObject())) {
481 481 // if we a have a QObject wrapper and the metaobjects do not match, set the metaobject again!
482 482 info->setMetaObject(wrapper->metaObject());
483 483 }
484 484
485 485 if (possibleStillAliveWrapper && possibleStillAliveWrapper->classInfo() == info) {
486 486 wrap = possibleStillAliveWrapper;
487 487 Py_INCREF(wrap);
488 488 } else {
489 489 wrap = createNewPythonQtInstanceWrapper(wrapper, info, ptr);
490 490 }
491 491 // mlabDebugConst("MLABPython","new c++ wrapper added " << wrap->_wrappedPtr << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
492 492 } else {
493 493 Py_INCREF(wrap);
494 494 //mlabDebugConst("MLABPython","c++ wrapper reused " << wrap->_wrappedPtr << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());
495 495 }
496 496 return (PyObject*)wrap;
497 497 }
498 498
499 499 PyObject* PythonQtPrivate::dummyTuple() {
500 500 static PyObject* dummyTuple = NULL;
501 501 if (dummyTuple==NULL) {
502 502 dummyTuple = PyTuple_New(1);
503 503 #ifdef PY3K
504 504 PyTuple_SET_ITEM(dummyTuple, 0, PyUnicode_FromString("dummy"));
505 505 #else
506 506 PyTuple_SET_ITEM(dummyTuple, 0 , PyString_FromString("dummy"));
507 507 #endif
508 508 }
509 509 return dummyTuple;
510 510 }
511 511
512 512
513 513 PythonQtInstanceWrapper* PythonQtPrivate::createNewPythonQtInstanceWrapper(QObject* obj, PythonQtClassInfo* info, void* wrappedPtr) {
514 514 // call the associated class type to create a new instance...
515 515 PythonQtInstanceWrapper* result = (PythonQtInstanceWrapper*)PyObject_Call(info->pythonQtClassWrapper(), dummyTuple(), NULL);
516 516
517 517 result->setQObject(obj);
518 518 result->_wrappedPtr = wrappedPtr;
519 519 result->_ownedByPythonQt = false;
520 520 result->_useQMetaTypeDestroy = false;
521 521
522 522 if (wrappedPtr) {
523 523 _wrappedObjects.insert(wrappedPtr, result);
524 524 } else {
525 525 _wrappedObjects.insert(obj, result);
526 526 if (obj->parent()== NULL && _wrappedCB) {
527 527 // tell someone who is interested that the qobject is wrapped the first time, if it has no parent
528 528 (*_wrappedCB)(obj);
529 529 }
530 530 }
531 531 return result;
532 532 }
533 533
534 534 PythonQtClassWrapper* PythonQtPrivate::createNewPythonQtClassWrapper(PythonQtClassInfo* info, PyObject* parentModule) {
535 535 PythonQtClassWrapper* result;
536 536
537 537 #ifdef PY3K
538 538 PyObject* className = PyUnicode_FromString(info->className());
539 539 #else
540 540 PyObject* className = PyString_FromString(info->className());
541 541 #endif
542 542
543 543 PyObject* baseClasses = PyTuple_New(1);
544 544 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PythonQtInstanceWrapper_Type);
545 545
546 546 PyObject* typeDict = PyDict_New();
547 547 PyObject* moduleName = PyObject_GetAttrString(parentModule, "__name__");
548 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 555 PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict);
551 556
552 557 // set the class info so that PythonQtClassWrapper_new can read it
553 558 _currentClassInfoForClassWrapperCreation = info;
554 559 // create the new type object by calling the type
555 560 result = (PythonQtClassWrapper *)PyObject_Call((PyObject *)&PythonQtClassWrapper_Type, args, NULL);
556 561
557 562 Py_DECREF(baseClasses);
558 563 Py_DECREF(typeDict);
559 564 Py_DECREF(args);
560 565 Py_DECREF(className);
561 566
562 567 return result;
563 568 }
564 569
565 570 PyObject* PythonQtPrivate::createEnumValueInstance(PyObject* enumType, unsigned int enumValue)
566 571 {
567 572 PyObject* args = Py_BuildValue("(i)", enumValue);
568 573 PyObject* result = PyObject_Call(enumType, args, NULL);
569 574 Py_DECREF(args);
570 575 return result;
571 576 }
572 577
573 578 PyObject* PythonQtPrivate::createNewPythonQtEnumWrapper(const char* enumName, PyObject* parentObject) {
574 579 PyObject* result;
575 580
576 581 #ifdef PY3K
577 582 PyObject* className = PyUnicode_FromString(enumName);
578 583 #else
579 584 PyObject* className = PyString_FromString(enumName);
580 585 #endif
581 586
582 587 PyObject* baseClasses = PyTuple_New(1);
583 588 #ifdef PY3K
584 589 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyLong_Type);
585 590 #else
586 591 PyTuple_SET_ITEM(baseClasses, 0, (PyObject*)&PyInt_Type);
587 592 #endif
588 593
589 594 PyObject* module = PyObject_GetAttrString(parentObject, "__module__");
590 595 PyObject* typeDict = PyDict_New();
591 596 PyDict_SetItemString(typeDict, "__module__", module);
592 597
593 598 PyObject* args = Py_BuildValue("OOO", className, baseClasses, typeDict);
594 599
595 600 // create the new int derived type object by calling the core type
596 601 result = PyObject_Call((PyObject *)&PyType_Type, args, NULL);
597 602
598 603 Py_DECREF(baseClasses);
599 604 Py_DECREF(typeDict);
600 605 Py_DECREF(args);
601 606 Py_DECREF(className);
602 607
603 608 return result;
604 609 }
605 610
606 611 PythonQtSignalReceiver* PythonQt::getSignalReceiver(QObject* obj)
607 612 {
608 613 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
609 614 if (!r) {
610 615 r = new PythonQtSignalReceiver(obj);
611 616 _p->_signalReceivers.insert(obj, r);
612 617 }
613 618 return r;
614 619 }
615 620
616 621 bool PythonQt::addSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname)
617 622 {
618 623 bool flag = false;
619 624 PythonQtObjectPtr callable = lookupCallable(module, objectname);
620 625 if (callable) {
621 626 PythonQtSignalReceiver* r = getSignalReceiver(obj);
622 627 flag = r->addSignalHandler(signal, callable);
623 628 if (!flag) {
624 629 // signal not found
625 630 }
626 631 } else {
627 632 // callable not found
628 633 }
629 634 return flag;
630 635 }
631 636
632 637 bool PythonQt::addSignalHandler(QObject* obj, const char* signal, PyObject* receiver)
633 638 {
634 639 bool flag = false;
635 640 PythonQtSignalReceiver* r = getSignalReceiver(obj);
636 641 if (r) {
637 642 flag = r->addSignalHandler(signal, receiver);
638 643 }
639 644 return flag;
640 645 }
641 646
642 647 bool PythonQt::removeSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname)
643 648 {
644 649 bool flag = false;
645 650 PythonQtObjectPtr callable = lookupCallable(module, objectname);
646 651 if (callable) {
647 652 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
648 653 if (r) {
649 654 flag = r->removeSignalHandler(signal, callable);
650 655 }
651 656 } else {
652 657 // callable not found
653 658 }
654 659 return flag;
655 660 }
656 661
657 662 bool PythonQt::removeSignalHandler(QObject* obj, const char* signal, PyObject* receiver)
658 663 {
659 664 bool flag = false;
660 665 PythonQtSignalReceiver* r = _p->_signalReceivers[obj];
661 666 if (r) {
662 667 flag = r->removeSignalHandler(signal, receiver);
663 668 }
664 669 return flag;
665 670 }
666 671
667 672 PythonQtObjectPtr PythonQt::lookupCallable(PyObject* module, const QString& name)
668 673 {
669 674 PythonQtObjectPtr p = lookupObject(module, name);
670 675 if (p) {
671 676 if (PyCallable_Check(p)) {
672 677 return p;
673 678 }
674 679 }
675 680 PyErr_Clear();
676 681 return NULL;
677 682 }
678 683
679 684 PythonQtObjectPtr PythonQt::lookupObject(PyObject* module, const QString& name)
680 685 {
681 686 QStringList l = name.split('.');
682 687 PythonQtObjectPtr p = module;
683 688 PythonQtObjectPtr prev;
684 689 QByteArray b;
685 690 for (QStringList::ConstIterator i = l.begin(); i!=l.end() && p; ++i) {
686 691 prev = p;
687 692 b = (*i).toLatin1();
688 693 if (PyDict_Check(p)) {
689 694 p = PyDict_GetItemString(p, b.data());
690 695 } else {
691 696 p.setNewRef(PyObject_GetAttrString(p, b.data()));
692 697 }
693 698 }
694 699 PyErr_Clear();
695 700 return p;
696 701 }
697 702
698 703 PythonQtObjectPtr PythonQt::getMainModule() {
699 704 //both borrowed
700 705 PythonQtObjectPtr dict = PyImport_GetModuleDict();
701 706 return PyDict_GetItemString(dict, "__main__");
702 707 }
703 708
704 709 PythonQtObjectPtr PythonQt::importModule(const QString& name)
705 710 {
706 711 PythonQtObjectPtr mod;
707 712 mod.setNewRef(PyImport_ImportModule(name.toLatin1().constData()));
708 713 return mod;
709 714 }
710 715
711 716
712 717 QVariant PythonQt::evalCode(PyObject* object, PyObject* pycode) {
713 718 QVariant result;
714 719 clearError();
715 720 if (pycode) {
716 721 PyObject* dict = NULL;
717 722 PyObject* globals = NULL;
718 723 if (PyModule_Check(object)) {
719 724 dict = PyModule_GetDict(object);
720 725 globals = dict;
721 726 } else if (PyDict_Check(object)) {
722 727 dict = object;
723 728 globals = dict;
724 729 } else {
725 730 dict = PyObject_GetAttrString(object, "__dict__");
726 731 globals = PyObject_GetAttrString(PyImport_ImportModule(
727 732 #ifdef PY3K
728 733 PyUnicode_AsUTF8(
729 734 #else
730 735 PyString_AS_STRING(
731 736 #endif
732 737 PyObject_GetAttrString(object, "__module__"))),"__dict__");
733 738 }
734 739 PyObject* r = NULL;
735 740 if (dict) {
736 741 #ifdef PY3K
737 742 r = PyEval_EvalCode(pycode, globals, dict);
738 743 #else
739 744 r = PyEval_EvalCode((PyCodeObject*)pycode, globals , dict);
740 745 #endif
741 746 }
742 747 if (r) {
743 748 result = PythonQtConv::PyObjToQVariant(r);
744 749 Py_DECREF(r);
745 750 } else {
746 751 handleError();
747 752 }
748 753 } else {
749 754 handleError();
750 755 }
751 756 return result;
752 757 }
753 758
754 759 QVariant PythonQt::evalScript(PyObject* object, const QString& script, int start)
755 760 {
756 761 QVariant result;
757 762 PythonQtObjectPtr p;
758 763 PyObject* dict = NULL;
759 764 clearError();
760 765 if (PyModule_Check(object)) {
761 766 dict = PyModule_GetDict(object);
762 767 } else if (PyDict_Check(object)) {
763 768 dict = object;
764 769 }
765 770 if (dict) {
766 771 p.setNewRef(PyRun_String(script.toLatin1().data(), start, dict, dict));
767 772 }
768 773 if (p) {
769 774 result = PythonQtConv::PyObjToQVariant(p);
770 775 } else {
771 776 handleError();
772 777 }
773 778 return result;
774 779 }
775 780
776 781 void PythonQt::evalFile(PyObject* module, const QString& filename)
777 782 {
778 783 PythonQtObjectPtr code = parseFile(filename);
779 784 clearError();
780 785 if (code) {
781 786 evalCode(module, code);
782 787 } else {
783 788 handleError();
784 789 }
785 790 }
786 791
787 792 PythonQtObjectPtr PythonQt::parseFile(const QString& filename)
788 793 {
789 794 PythonQtObjectPtr p;
790 795 p.setNewRef(PythonQtImport::getCodeFromPyc(filename));
791 796 clearError();
792 797 if (!p) {
793 798 handleError();
794 799 }
795 800 return p;
796 801 }
797 802
798 803 PythonQtObjectPtr PythonQt::createModuleFromFile(const QString& name, const QString& filename)
799 804 {
800 805 PythonQtObjectPtr code = parseFile(filename);
801 806 PythonQtObjectPtr module = _p->createModule(name, code);
802 807 return module;
803 808 }
804 809
805 810 PythonQtObjectPtr PythonQt::createModuleFromScript(const QString& name, const QString& script)
806 811 {
807 812 PyErr_Clear();
808 813 QString scriptCode = script;
809 814 if (scriptCode.isEmpty()) {
810 815 // we always need at least a linefeed
811 816 scriptCode = "\n";
812 817 }
813 818 PythonQtObjectPtr pycode;
814 819 pycode.setNewRef(Py_CompileString((char*)scriptCode.toLatin1().data(), "", Py_file_input));
815 820 PythonQtObjectPtr module = _p->createModule(name, pycode);
816 821 return module;
817 822 }
818 823
819 824 PythonQtObjectPtr PythonQt::createUniqueModule()
820 825 {
821 826 static QString pyQtStr("PythonQt_module");
822 827 QString moduleName = pyQtStr+QString::number(_uniqueModuleCount++);
823 828 return createModuleFromScript(moduleName);
824 829 }
825 830
826 831 void PythonQt::addObject(PyObject* object, const QString& name, QObject* qObject)
827 832 {
828 833 if (PyModule_Check(object)) {
829 834 PyModule_AddObject(object, name.toLatin1().data(), _p->wrapQObject(qObject));
830 835 } else if (PyDict_Check(object)) {
831 836 PyDict_SetItemString(object, name.toLatin1().data(), _p->wrapQObject(qObject));
832 837 } else {
833 838 PyObject_SetAttrString(object, name.toLatin1().data(), _p->wrapQObject(qObject));
834 839 }
835 840 }
836 841
837 842 void PythonQt::addVariable(PyObject* object, const QString& name, const QVariant& v)
838 843 {
839 844 if (PyModule_Check(object)) {
840 845 PyModule_AddObject(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
841 846 } else if (PyDict_Check(object)) {
842 847 PyDict_SetItemString(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
843 848 } else {
844 849 PyObject_SetAttrString(object, name.toLatin1().data(), PythonQtConv::QVariantToPyObject(v));
845 850 }
846 851 }
847 852
848 853 void PythonQt::removeVariable(PyObject* object, const QString& name)
849 854 {
850 855 if (PyDict_Check(object)) {
851 856 PyDict_DelItemString(object, name.toLatin1().data());
852 857 } else {
853 858 PyObject_DelAttrString(object, name.toLatin1().data());
854 859 }
855 860 }
856 861
857 862 QVariant PythonQt::getVariable(PyObject* object, const QString& objectname)
858 863 {
859 864 QVariant result;
860 865 PythonQtObjectPtr obj = lookupObject(object, objectname);
861 866 if (obj) {
862 867 result = PythonQtConv::PyObjToQVariant(obj);
863 868 }
864 869 return result;
865 870 }
866 871
867 872 QStringList PythonQt::introspection(PyObject* module, const QString& objectname, PythonQt::ObjectType type)
868 873 {
869 874 QStringList results;
870 875
871 876 PythonQtObjectPtr object;
872 877 if (objectname.isEmpty()) {
873 878 object = module;
874 879 } else {
875 880 object = lookupObject(module, objectname);
876 881 if (!object && type == CallOverloads) {
877 882 PyObject* dict = lookupObject(module, "__builtins__");
878 883 if (dict) {
879 884 object = PyDict_GetItemString(dict, objectname.toLatin1().constData());
880 885 }
881 886 }
882 887 }
883 888
884 889 if (object) {
885 890 results = introspectObject(object, type);
886 891 }
887 892
888 893 return results;
889 894 }
890 895
891 896 QStringList PythonQt::introspectObject(PyObject* object, ObjectType type)
892 897 {
893 898 QStringList results;
894 899
895 900 if (type == CallOverloads) {
896 901 if (PythonQtSlotFunction_Check(object)) {
897 902 PythonQtSlotFunctionObject* o = (PythonQtSlotFunctionObject*)object;
898 903 PythonQtSlotInfo* info = o->m_ml;
899 904
900 905 while (info) {
901 906 results << info->fullSignature();
902 907 info = info->nextInfo();
903 908 }
904 909 } else if (PythonQtSignalFunction_Check(object)) {
905 910 PythonQtSignalFunctionObject* o = (PythonQtSignalFunctionObject*)object;
906 911 PythonQtSlotInfo* info = o->m_ml;
907 912
908 913 while (info) {
909 914 results << info->fullSignature();
910 915 info = info->nextInfo();
911 916 }
912 917 } else if (object->ob_type == &PythonQtClassWrapper_Type) {
913 918 PythonQtClassWrapper* o = (PythonQtClassWrapper*)object;
914 919 PythonQtSlotInfo* info = o->classInfo()->constructors();
915 920
916 921 while (info) {
917 922 results << info->fullSignature();
918 923 info = info->nextInfo();
919 924 }
920 925 } else {
921 926 QString signature = _p->getSignature(object);
922 927 if (!signature.isEmpty()) {
923 928 results << signature;
924 929 } else {
925 930 PyObject* doc = PyObject_GetAttrString(object, "__doc__");
926 931 if (doc) {
927 932 #ifdef PY3K
928 933 results << PyUnicode_AsUTF8(doc);
929 934 #else
930 935 results << PyString_AsString(doc);
931 936 #endif
932 937 Py_DECREF(doc);
933 938 }
934 939 }
935 940 }
936 941 } else {
937 942 PyObject* keys = NULL;
938 943 bool isDict = false;
939 944 if (PyDict_Check(object)) {
940 945 keys = PyDict_Keys(object);
941 946 isDict = true;
942 947 } else {
943 948 keys = PyObject_Dir(object);
944 949 }
945 950 if (keys) {
946 951 int count = PyList_Size(keys);
947 952 PyObject* key;
948 953 PyObject* value;
949 954 QString keystr;
950 955 for (int i = 0;i<count;i++) {
951 956 key = PyList_GetItem(keys,i);
952 957 if (isDict) {
953 958 value = PyDict_GetItem(object, key);
954 959 Py_INCREF(value);
955 960 } else {
956 961 value = PyObject_GetAttr(object, key);
957 962 }
958 963 if (!value) continue;
959 964 #ifdef PY3K
960 965 keystr = PyUnicode_AsUTF8(key);
961 966 #else
962 967 keystr = PyString_AsString(key);
963 968 #endif
964 969 static const QString underscoreStr("__tmp");
965 970 if (!keystr.startsWith(underscoreStr)) {
966 971 switch (type) {
967 972 case Anything:
968 973 results << keystr;
969 974 break;
970 975 case Class:
971 976 #ifdef PY3K
972 977 if(PyType_Check(value)) {
973 978 #else
974 979 if (value->ob_type == &PyClass_Type || value->ob_type == &PyType_Type) {
975 980 #endif
976 981 results << keystr;
977 982 }
978 983 break;
979 984 case Variable:
980 985 if (
981 986 #ifndef PY3K
982 987 value->ob_type != &PyClass_Type &&
983 988 #endif
984 989 value->ob_type != &PyCFunction_Type &&
985 990 value->ob_type != &PyFunction_Type &&
986 991 value->ob_type != &PyMethod_Type &&
987 992 value->ob_type != &PyModule_Type &&
988 993 value->ob_type != &PyType_Type &&
989 994 value->ob_type != &PythonQtSlotFunction_Type
990 995 ) {
991 996 results << keystr;
992 997 }
993 998 break;
994 999 case Function:
995 1000 if (value->ob_type == &PyCFunction_Type ||
996 1001 value->ob_type == &PyFunction_Type ||
997 1002 value->ob_type == &PyMethod_Type ||
998 1003 value->ob_type == &PythonQtSlotFunction_Type
999 1004 ) {
1000 1005 results << keystr;
1001 1006 }
1002 1007 break;
1003 1008 case Module:
1004 1009 if (value->ob_type == &PyModule_Type) {
1005 1010 results << keystr;
1006 1011 }
1007 1012 break;
1008 1013 default:
1009 1014 std::cerr << "PythonQt: introspection: unknown case" << ", in " << __FILE__ << ":" << __LINE__ << std::endl;
1010 1015 }
1011 1016 }
1012 1017 Py_DECREF(value);
1013 1018 }
1014 1019 Py_DECREF(keys);
1015 1020 }
1016 1021 if ((type == Anything) || (type == Variable)) {
1017 1022 if (object->ob_type == &PythonQtClassWrapper_Type) {
1018 1023 PythonQtClassWrapper* o = (PythonQtClassWrapper*)object;
1019 1024 PythonQtClassInfo* info = o->classInfo();
1020 1025 results += info->propertyList();
1021 1026 }
1022 1027 }
1023 1028 }
1024 1029 return results;
1025 1030 }
1026 1031
1027 1032 PyObject* PythonQt::getObjectByType(const QString& typeName)
1028 1033 {
1029 1034 PythonQtObjectPtr sys;
1030 1035 sys.setNewRef(PyImport_ImportModule("sys"));
1031 1036 PythonQtObjectPtr modules = lookupObject(sys, "modules");
1032 1037 Q_ASSERT(PyDict_Check(modules));
1033 1038
1034 1039 QStringList tmp = typeName.split(".");
1035 1040 QString simpleTypeName = tmp.takeLast();
1036 1041 QString moduleName = tmp.join(".");
1037 1042
1038 1043 PyObject* object = NULL;
1039 1044 PyObject* moduleObject = PyDict_GetItemString(modules, moduleName.toLatin1().constData());
1040 1045 if (moduleObject) {
1041 1046 object = PyObject_GetAttrString(moduleObject, simpleTypeName.toLatin1().constData());
1042 1047 }
1043 1048
1044 1049 if (!object) {
1045 1050 moduleObject = PyDict_GetItemString(modules, "__builtin__");
1046 1051 if (moduleObject) {
1047 1052 object = PyObject_GetAttrString(moduleObject, simpleTypeName.toLatin1().constData());
1048 1053 }
1049 1054 }
1050 1055
1051 1056 return object;
1052 1057 }
1053 1058
1054 1059 QStringList PythonQt::introspectType(const QString& typeName, ObjectType type)
1055 1060 {
1056 1061 QStringList results;
1057 1062 PyObject* object = getObjectByType(typeName);
1058 1063 if (!object) {
1059 1064 // the last item may be a member, split it away and try again
1060 1065 QStringList tmp = typeName.split(".");
1061 1066 QString memberName = tmp.takeLast();
1062 1067 QString typeName;
1063 1068 if (tmp.isEmpty()) {
1064 1069 typeName = memberName;
1065 1070 memberName.clear();
1066 1071 } else {
1067 1072 typeName = tmp.takeLast();
1068 1073 }
1069 1074 PyObject* typeObject = getObjectByType(typeName);
1070 1075 if (typeObject) {
1071 1076 object = PyObject_GetAttrString(typeObject, memberName.toLatin1().constData());
1072 1077 }
1073 1078 }
1074 1079 if (object) {
1075 1080 results = introspectObject(object, type);
1076 1081 Py_DECREF(object);
1077 1082 }
1078 1083 return results;
1079 1084 }
1080 1085
1081 1086 QVariant PythonQt::call(PyObject* object, const QString& name, const QVariantList& args, const QVariantMap& kwargs)
1082 1087 {
1083 1088 PythonQtObjectPtr callable = lookupCallable(object, name);
1084 1089 if (callable) {
1085 1090 return call(callable, args, kwargs);
1086 1091 } else {
1087 1092 return QVariant();
1088 1093 }
1089 1094 }
1090 1095
1091 1096 QVariant PythonQt::call(PyObject* callable, const QVariantList& args, const QVariantMap& kwargs)
1092 1097 {
1093 1098 QVariant r;
1094 1099 PythonQtObjectPtr result;
1095 1100 result.setNewRef(callAndReturnPyObject(callable, args, kwargs));
1096 1101 clearError();
1097 1102 if (result) {
1098 1103 r = PythonQtConv::PyObjToQVariant(result);
1099 1104 } else {
1100 1105 PythonQt::self()->handleError();
1101 1106 }
1102 1107 return r;
1103 1108 }
1104 1109
1105 1110 PyObject* PythonQt::callAndReturnPyObject(PyObject* callable, const QVariantList& args, const QVariantMap& kwargs)
1106 1111 {
1107 1112 PyObject* result = NULL;
1108 1113 if (callable) {
1109 1114 bool err = false;
1110 1115 PythonQtObjectPtr pargs;
1111 1116 int count = args.size();
1112 1117 if ((count > 0) || (kwargs.count() > 0)) { // create empty tuple if kwargs are given
1113 1118 pargs.setNewRef(PyTuple_New(count));
1114 1119
1115 1120 // transform QVariant arguments to Python
1116 1121 for (int i = 0; i < count; i++) {
1117 1122 PyObject* arg = PythonQtConv::QVariantToPyObject(args.at(i));
1118 1123 if (arg) {
1119 1124 // steals reference, no unref
1120 1125 PyTuple_SetItem(pargs, i,arg);
1121 1126 } else {
1122 1127 err = true;
1123 1128 break;
1124 1129 }
1125 1130 }
1126 1131 }
1127 1132 if (!err) {
1128 1133 if (kwargs.isEmpty()) {
1129 1134 // do a direct call if we have no keyword arguments
1130 1135 PyErr_Clear();
1131 1136 result = PyObject_CallObject(callable, pargs);
1132 1137 } else {
1133 1138 // convert keyword arguments to Python
1134 1139 PythonQtObjectPtr pkwargs;
1135 1140 pkwargs.setNewRef(PyDict_New());
1136 1141 QMapIterator<QString, QVariant> it(kwargs);
1137 1142 while (it.hasNext()) {
1138 1143 it.next();
1139 1144 PyObject* arg = PythonQtConv::QVariantToPyObject(it.value());
1140 1145 if (arg) {
1141 1146 PyDict_SetItemString(pkwargs, it.key().toLatin1().constData(), arg);
1142 1147 } else {
1143 1148 err = true;
1144 1149 break;
1145 1150 }
1146 1151 }
1147 1152 if (!err) {
1148 1153 // call with arguments and keyword arguments
1149 1154 PyErr_Clear();
1150 1155 result = PyObject_Call(callable, pargs, pkwargs);
1151 1156 }
1152 1157 }
1153 1158 }
1154 1159 }
1155 1160 return result;
1156 1161 }
1157 1162
1158 1163 void PythonQt::addInstanceDecorators(QObject* o)
1159 1164 {
1160 1165 _p->addDecorators(o, PythonQtPrivate::InstanceDecorator);
1161 1166 }
1162 1167
1163 1168 void PythonQt::addClassDecorators(QObject* o)
1164 1169 {
1165 1170 _p->addDecorators(o, PythonQtPrivate::StaticDecorator | PythonQtPrivate::ConstructorDecorator | PythonQtPrivate::DestructorDecorator);
1166 1171 }
1167 1172
1168 1173 void PythonQt::addDecorators(QObject* o)
1169 1174 {
1170 1175 _p->addDecorators(o, PythonQtPrivate::AllDecorators);
1171 1176 }
1172 1177
1173 1178 void PythonQt::registerQObjectClassNames(const QStringList& names)
1174 1179 {
1175 1180 _p->registerQObjectClassNames(names);
1176 1181 }
1177 1182
1178 1183 void PythonQt::setImporter(PythonQtImportFileInterface* importInterface)
1179 1184 {
1180 1185 _p->_importInterface = importInterface;
1181 1186 PythonQtImport::init();
1182 1187 }
1183 1188
1184 1189 void PythonQt::setImporterIgnorePaths(const QStringList& paths)
1185 1190 {
1186 1191 _p->_importIgnorePaths = paths;
1187 1192 }
1188 1193
1189 1194 const QStringList& PythonQt::getImporterIgnorePaths()
1190 1195 {
1191 1196 return _p->_importIgnorePaths;
1192 1197 }
1193 1198
1194 1199 void PythonQt::addWrapperFactory(PythonQtCppWrapperFactory* factory)
1195 1200 {
1196 1201 _p->_cppWrapperFactories.append(factory);
1197 1202 }
1198 1203
1199 1204 void PythonQt::addWrapperFactory( PythonQtForeignWrapperFactory* factory )
1200 1205 {
1201 1206 _p->_foreignWrapperFactories.append(factory);
1202 1207 }
1203 1208
1204 1209 //---------------------------------------------------------------------------------------------------
1205 1210 PythonQtPrivate::PythonQtPrivate()
1206 1211 {
1207 1212 _importInterface = NULL;
1208 1213 _defaultImporter = new PythonQtQFileImporter;
1209 1214 _noLongerWrappedCB = NULL;
1210 1215 _wrappedCB = NULL;
1211 1216 _currentClassInfoForClassWrapperCreation = NULL;
1212 1217 _profilingCB = NULL;
1213 1218 _hadError = false;
1214 1219 _systemExitExceptionHandlerEnabled = false;
1215 1220 }
1216 1221
1217 1222 void PythonQtPrivate::setupSharedLibrarySuffixes()
1218 1223 {
1219 1224 _sharedLibrarySuffixes.clear();
1220 1225 PythonQtObjectPtr imp;
1221 1226 imp.setNewRef(PyImport_ImportModule("imp"));
1222 1227 int cExtensionCode = imp.getVariable("C_EXTENSION").toInt();
1223 1228 QVariant result = imp.call("get_suffixes");
1224 1229 #ifdef __linux
1225 1230 #ifdef _DEBUG
1226 1231 // First look for shared libraries with the '_d' suffix in debug mode on Linux.
1227 1232 // This is a workaround, because python does not append the '_d' suffix on Linux
1228 1233 // and would always load the release library otherwise.
1229 1234 _sharedLibrarySuffixes << "_d.so";
1230 1235 #endif
1231 1236 #endif
1232 1237 Q_FOREACH (QVariant entry, result.toList()) {
1233 1238 QVariantList suffixEntry = entry.toList();
1234 1239 if (suffixEntry.count()==3) {
1235 1240 int code = suffixEntry.at(2).toInt();
1236 1241 if (code == cExtensionCode) {
1237 1242 _sharedLibrarySuffixes << suffixEntry.at(0).toString();
1238 1243 }
1239 1244 }
1240 1245 }
1241 1246 }
1242 1247
1243 1248 PythonQtClassInfo* PythonQtPrivate::currentClassInfoForClassWrapperCreation()
1244 1249 {
1245 1250 PythonQtClassInfo* info = _currentClassInfoForClassWrapperCreation;
1246 1251 _currentClassInfoForClassWrapperCreation = NULL;
1247 1252 return info;
1248 1253 }
1249 1254
1250 1255 void PythonQtPrivate::addDecorators(QObject* o, int decoTypes)
1251 1256 {
1252 1257 o->setParent(this);
1253 1258 int numMethods = o->metaObject()->methodCount();
1254 1259 for (int i = 0; i < numMethods; i++) {
1255 1260 QMetaMethod m = o->metaObject()->method(i);
1256 1261 if ((m.methodType() == QMetaMethod::Method ||
1257 1262 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
1258 1263 // QMetaMethod::signature changed to QMetaMethod::methodSignature in QT5
1259 1264 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
1260 1265 QByteArray signature = m.methodSignature();
1261 1266 #else
1262 1267 QByteArray signature = m.signature();
1263 1268 #endif
1264 1269 if (signature.startsWith("new_")) {
1265 1270 if ((decoTypes & ConstructorDecorator) == 0) continue;
1266 1271 const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL);
1267 1272 if (info->parameters().at(0).pointerCount == 1) {
1268 1273 QByteArray nameOfClass = signature.mid(4, signature.indexOf('(')-4);
1269 1274 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1270 1275 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1271 1276 classInfo->addConstructor(newSlot);
1272 1277 }
1273 1278 } else if (signature.startsWith("delete_")) {
1274 1279 if ((decoTypes & DestructorDecorator) == 0) continue;
1275 1280 QByteArray nameOfClass = signature.mid(7, signature.indexOf('(')-7);
1276 1281 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1277 1282 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1278 1283 classInfo->setDestructor(newSlot);
1279 1284 } else if (signature.startsWith("static_")) {
1280 1285 if ((decoTypes & StaticDecorator) == 0) continue;
1281 1286 QByteArray nameOfClass = signature.mid(7);
1282 1287 nameOfClass = nameOfClass.mid(0, nameOfClass.indexOf('_'));
1283 1288 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(nameOfClass);
1284 1289 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::ClassDecorator);
1285 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 1313 } else {
1287 1314 if ((decoTypes & InstanceDecorator) == 0) continue;
1288 1315 const PythonQtMethodInfo* info = PythonQtMethodInfo::getCachedMethodInfo(m, NULL);
1289 1316 if (info->parameters().count()>1) {
1290 1317 PythonQtMethodInfo::ParameterInfo p = info->parameters().at(1);
1291 1318 if (p.pointerCount==1) {
1292 1319 PythonQtClassInfo* classInfo = lookupClassInfoAndCreateIfNotPresent(p.name);
1293 1320 PythonQtSlotInfo* newSlot = new PythonQtSlotInfo(NULL, m, i, o, PythonQtSlotInfo::InstanceDecorator);
1294 1321 classInfo->addDecoratorSlot(newSlot);
1295 1322 }
1296 1323 }
1297 1324 }
1298 1325 }
1299 1326 }
1300 1327 }
1301 1328
1302 1329 void PythonQtPrivate::registerQObjectClassNames(const QStringList& names)
1303 1330 {
1304 1331 Q_FOREACH(QString name, names) {
1305 1332 _knownQObjectClassNames.insert(name.toLatin1(), true);
1306 1333 }
1307 1334 }
1308 1335
1309 1336 void PythonQtPrivate::removeSignalEmitter(QObject* obj)
1310 1337 {
1311 1338 _signalReceivers.remove(obj);
1312 1339 }
1313 1340
1314 1341 namespace
1315 1342 {
1316 1343 //! adapted from python source file "pythonrun.c", function "handle_system_exit"
1317 1344 //! return the exitcode instead of calling "Py_Exit".
1318 1345 //! it gives the application an opportunity to properly terminate.
1319 1346 int custom_system_exit_exception_handler()
1320 1347 {
1321 1348 PyObject *exception, *value, *tb;
1322 1349 int exitcode = 0;
1323 1350
1324 1351 // if (Py_InspectFlag)
1325 1352 // /* Don't exit if -i flag was given. This flag is set to 0
1326 1353 // * when entering interactive mode for inspecting. */
1327 1354 // return exitcode;
1328 1355
1329 1356 PyErr_Fetch(&exception, &value, &tb);
1330 1357 #ifdef PY3K
1331 1358 std::cout << std::endl;
1332 1359 #else
1333 1360 if (Py_FlushLine())
1334 1361 PyErr_Clear();
1335 1362 #endif
1336 1363 fflush(stdout);
1337 1364 if (value == NULL || value == Py_None)
1338 1365 goto done;
1339 1366 if (PyExceptionInstance_Check(value)) {
1340 1367 /* The error code should be in the `code' attribute. */
1341 1368 PyObject *code = PyObject_GetAttrString(value, "code");
1342 1369 if (code) {
1343 1370 Py_DECREF(value);
1344 1371 value = code;
1345 1372 if (value == Py_None)
1346 1373 goto done;
1347 1374 }
1348 1375 /* If we failed to dig out the 'code' attribute,
1349 1376 just let the else clause below print the error. */
1350 1377 }
1351 1378 #ifdef PY3K
1352 1379 if (PyLong_Check(value))
1353 1380 exitcode = (int)PyLong_AsLong(value);
1354 1381 #else
1355 1382 if (PyInt_Check(value))
1356 1383 exitcode = (int)PyInt_AsLong(value);
1357 1384 #endif
1358 1385 else {
1359 1386 PyObject *sys_stderr = PySys_GetObject(const_cast<char*>("stderr"));
1360 1387 if (sys_stderr != NULL && sys_stderr != Py_None) {
1361 1388 PyFile_WriteObject(value, sys_stderr, Py_PRINT_RAW);
1362 1389 } else {
1363 1390 PyObject_Print(value, stderr, Py_PRINT_RAW);
1364 1391 fflush(stderr);
1365 1392 }
1366 1393 PySys_WriteStderr("\n");
1367 1394 exitcode = 1;
1368 1395 }
1369 1396 done:
1370 1397 /* Restore and clear the exception info, in order to properly decref
1371 1398 * the exception, value, and traceback. If we just exit instead,
1372 1399 * these leak, which confuses PYTHONDUMPREFS output, and may prevent
1373 1400 * some finalizers from running.
1374 1401 */
1375 1402 PyErr_Restore(exception, value, tb);
1376 1403 PyErr_Clear();
1377 1404 return exitcode;
1378 1405 //Py_Exit(exitcode);
1379 1406 }
1380 1407 }
1381 1408
1382 1409 bool PythonQt::handleError()
1383 1410 {
1384 1411 bool flag = false;
1385 1412 if (PyErr_Occurred()) {
1386 1413
1387 1414 if (_p->_systemExitExceptionHandlerEnabled &&
1388 1415 PyErr_ExceptionMatches(PyExc_SystemExit)) {
1389 1416 int exitcode = custom_system_exit_exception_handler();
1390 1417 Q_EMIT PythonQt::self()->systemExitExceptionRaised(exitcode);
1391 1418 }
1392 1419 else
1393 1420 {
1394 1421 // currently we just print the error and the stderr handler parses the errors
1395 1422 PyErr_Print();
1396 1423
1397 1424 /*
1398 1425 // EXTRA: the format of the ptype and ptraceback is not really documented, so I use PyErr_Print() above
1399 1426 PyObject *ptype;
1400 1427 PyObject *pvalue;
1401 1428 PyObject *ptraceback;
1402 1429 PyErr_Fetch( &ptype, &pvalue, &ptraceback);
1403 1430
1404 1431 Py_XDECREF(ptype);
1405 1432 Py_XDECREF(pvalue);
1406 1433 Py_XDECREF(ptraceback);
1407 1434 */
1408 1435 PyErr_Clear();
1409 1436 }
1410 1437 flag = true;
1411 1438 }
1412 1439 _p->_hadError = flag;
1413 1440 return flag;
1414 1441 }
1415 1442
1416 1443 bool PythonQt::hadError()const
1417 1444 {
1418 1445 return _p->_hadError;
1419 1446 }
1420 1447
1421 1448 void PythonQt::clearError()
1422 1449 {
1423 1450 _p->_hadError = false;
1424 1451 }
1425 1452
1426 1453 void PythonQt::setSystemExitExceptionHandlerEnabled(bool value)
1427 1454 {
1428 1455 _p->_systemExitExceptionHandlerEnabled = value;
1429 1456 }
1430 1457
1431 1458 bool PythonQt::systemExitExceptionHandlerEnabled() const
1432 1459 {
1433 1460 return _p->_systemExitExceptionHandlerEnabled;
1434 1461 }
1435 1462
1436 1463 void PythonQt::addSysPath(const QString& path)
1437 1464 {
1438 1465 PythonQtObjectPtr sys;
1439 1466 sys.setNewRef(PyImport_ImportModule("sys"));
1440 1467 PythonQtObjectPtr obj = lookupObject(sys, "path");
1441 1468 PyList_Insert(obj, 0, PythonQtConv::QStringToPyObject(path));
1442 1469 }
1443 1470
1444 1471 void PythonQt::overwriteSysPath(const QStringList& paths)
1445 1472 {
1446 1473 PythonQtObjectPtr sys;
1447 1474 sys.setNewRef(PyImport_ImportModule("sys"));
1448 1475 PyModule_AddObject(sys, "path", PythonQtConv::QStringListToPyList(paths));
1449 1476 }
1450 1477
1451 1478 void PythonQt::setModuleImportPath(PyObject* module, const QStringList& paths)
1452 1479 {
1453 1480 PyModule_AddObject(module, "__path__", PythonQtConv::QStringListToPyList(paths));
1454 1481 }
1455 1482
1456 1483 void PythonQt::stdOutRedirectCB(const QString& str)
1457 1484 {
1458 1485 if (!PythonQt::self()) {
1459 1486 std::cout << str.toLatin1().data() << std::endl;
1460 1487 return;
1461 1488 }
1462 1489 Q_EMIT PythonQt::self()->pythonStdOut(str);
1463 1490 }
1464 1491
1465 1492 void PythonQt::stdErrRedirectCB(const QString& str)
1466 1493 {
1467 1494 if (!PythonQt::self()) {
1468 1495 std::cerr << str.toLatin1().data() << std::endl;
1469 1496 return;
1470 1497 }
1471 1498 Q_EMIT PythonQt::self()->pythonStdErr(str);
1472 1499 }
1473 1500
1474 1501 void PythonQt::setQObjectWrappedCallback(PythonQtQObjectWrappedCB* cb)
1475 1502 {
1476 1503 _p->_wrappedCB = cb;
1477 1504 }
1478 1505
1479 1506 void PythonQt::setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB* cb)
1480 1507 {
1481 1508 _p->_noLongerWrappedCB = cb;
1482 1509 }
1483 1510
1484 1511 void PythonQt::setProfilingCallback(ProfilingCB* cb)
1485 1512 {
1486 1513 _p->_profilingCB = cb;
1487 1514 }
1488 1515
1489 1516
1490 1517 static PyMethodDef PythonQtMethods[] = {
1491 1518 {NULL, NULL, 0, NULL}
1492 1519 };
1493 1520
1494 1521 #ifdef PY3K
1495 1522 static PyModuleDef PythonQtModuleDef = {
1496 1523 PyModuleDef_HEAD_INIT,
1497 1524 "",
1498 1525 NULL,
1499 1526 -1,
1500 1527 PythonQtMethods,
1501 1528 NULL,
1502 1529 NULL,
1503 1530 NULL,
1504 1531 NULL
1505 1532 };
1506 1533 #endif
1507 1534
1508 1535 void PythonQt::initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName)
1509 1536 {
1510 1537 QByteArray name = "PythonQt";
1511 1538 if (!pythonQtModuleName.isEmpty()) {
1512 1539 name = pythonQtModuleName;
1513 1540 }
1514 1541 #ifdef PY3K
1515 1542 PythonQtModuleDef.m_name = name.constData();
1516 1543 _p->_pythonQtModule = PyModule_Create(&PythonQtModuleDef);
1517 1544 #else
1518 1545 _p->_pythonQtModule = Py_InitModule(name.constData(), PythonQtMethods);
1519 1546 #endif
1520 1547 _p->_pythonQtModuleName = name;
1521 1548
1522 1549 PythonQtObjectPtr sys;
1523 1550 sys.setNewRef(PyImport_ImportModule("sys"));
1524 1551
1525 1552 if (redirectStdOut) {
1526 1553 PythonQtObjectPtr out;
1527 1554 PythonQtObjectPtr err;
1528 1555 // create a redirection object for stdout and stderr
1529 1556 out = PythonQtStdOutRedirectType.tp_new(&PythonQtStdOutRedirectType,NULL, NULL);
1530 1557 ((PythonQtStdOutRedirect*)out.object())->_cb = stdOutRedirectCB;
1531 1558 err = PythonQtStdOutRedirectType.tp_new(&PythonQtStdOutRedirectType,NULL, NULL);
1532 1559 ((PythonQtStdOutRedirect*)err.object())->_cb = stdErrRedirectCB;
1533 1560 // replace the built in file objects with our own objects
1534 1561 PyModule_AddObject(sys, "stdout", out);
1535 1562 PyModule_AddObject(sys, "stderr", err);
1536 1563 }
1537 1564
1538 1565 // add PythonQt to the list of builtin module names
1539 1566 PyObject *old_module_names = PyObject_GetAttrString(sys.object(),"builtin_module_names");
1540 1567 Py_ssize_t old_size = PyTuple_Size(old_module_names);
1541 1568 PyObject *module_names = PyTuple_New(old_size+1);
1542 1569 for(Py_ssize_t i = 0; i < old_size; i++)
1543 1570 PyTuple_SetItem(module_names, i, PyTuple_GetItem(old_module_names, i));
1544 1571 #ifdef PY3K
1545 1572 PyTuple_SetItem(module_names, old_size, PyUnicode_FromString(name.constData()));
1546 1573 #else
1547 1574 PyTuple_SetItem(module_names, old_size, PyString_FromString(name.constData()));
1548 1575 #endif
1549 1576 PyModule_AddObject(sys.object(),"builtin_module_names",module_names);
1550 1577 Py_DecRef(old_module_names);
1551 1578
1552 1579 #ifdef PY3K
1553 1580 PyDict_SetItem(PyObject_GetAttrString(sys.object(), "modules"), PyUnicode_FromString(name.constData()), _p->_pythonQtModule.object());
1554 1581 #endif
1555 1582 }
1556 1583
1557 1584 QString PythonQt::getReturnTypeOfWrappedMethod(PyObject* module, const QString& name)
1558 1585 {
1559 1586 QStringList tmp = name.split(".");
1560 1587 QString methodName = tmp.takeLast();
1561 1588 QString variableName = tmp.join(".");
1562 1589 // TODO: the variableName may be a type name, this needs to be handled differently,
1563 1590 // because it is not necessarily known in the module context
1564 1591 PythonQtObjectPtr variableObject = lookupObject(module, variableName);
1565 1592 if (variableObject.isNull()) {
1566 1593 return "";
1567 1594 }
1568 1595
1569 1596 return getReturnTypeOfWrappedMethodHelper(variableObject, methodName, name);
1570 1597 }
1571 1598
1572 1599 QString PythonQt::getReturnTypeOfWrappedMethod(const QString& typeName, const QString& methodName)
1573 1600 {
1574 1601 PythonQtObjectPtr typeObject = getObjectByType(typeName);
1575 1602 if (typeObject.isNull()) {
1576 1603 return "";
1577 1604 }
1578 1605 return getReturnTypeOfWrappedMethodHelper(typeObject, methodName, typeName + "." + methodName);
1579 1606 }
1580 1607
1581 1608 QString PythonQt::getReturnTypeOfWrappedMethodHelper(const PythonQtObjectPtr& variableObject, const QString& methodName, const QString& context)
1582 1609 {
1583 1610 PythonQtObjectPtr methodObject;
1584 1611 if (PyDict_Check(variableObject)) {
1585 1612 methodObject = PyDict_GetItemString(variableObject, methodName.toLatin1().constData());
1586 1613 } else {
1587 1614 methodObject.setNewRef(PyObject_GetAttrString(variableObject, methodName.toLatin1().constData()));
1588 1615 }
1589 1616 if (methodObject.isNull()) {
1590 1617 return "";
1591 1618 }
1592 1619
1593 1620 QString type;
1594 1621
1595 1622 #ifdef PY3K
1596 1623 if (PyType_Check(methodObject)) {
1597 1624 #else
1598 1625 if (methodObject->ob_type == &PyClass_Type || methodObject->ob_type == &PyType_Type) {
1599 1626 #endif
1600 1627 // the methodObject is not a method, but the name of a type/class. This means
1601 1628 // a constructor is called. Return the context.
1602 1629 type = context;
1603 1630 } else if (methodObject->ob_type == &PythonQtSlotFunction_Type) {
1604 1631 QString className;
1605 1632
1606 1633 if (PyObject_TypeCheck(variableObject, &PythonQtInstanceWrapper_Type)) {
1607 1634 // the type name of wrapped instance is the class name
1608 1635 className = variableObject->ob_type->tp_name;
1609 1636 } else {
1610 1637 PyObject* classNameObject = PyObject_GetAttrString(variableObject, "__name__");
1611 1638 if (classNameObject) {
1612 1639 #ifdef PY3K
1613 1640 Q_ASSERT(PyUnicode_Check(classNameObject));
1614 1641 className = PyUnicode_AsUTF8(classNameObject);
1615 1642 #else
1616 1643 Q_ASSERT(PyString_Check(classNameObject));
1617 1644 className = PyString_AsString(classNameObject);
1618 1645 #endif
1619 1646 Py_DECREF(classNameObject);
1620 1647 }
1621 1648 }
1622 1649
1623 1650 if (!className.isEmpty()) {
1624 1651 PythonQtClassInfo* info = _p->_knownClassInfos.value(className.toLatin1().constData());
1625 1652 if (info) {
1626 1653 PythonQtSlotInfo* slotInfo = info->member(methodName.toLatin1().constData())._slot;
1627 1654 if (slotInfo) {
1628 1655 if (slotInfo->metaMethod()) {
1629 1656 type = slotInfo->metaMethod()->typeName();
1630 1657 if (!type.isEmpty()) {
1631 1658 QChar c = type.at(type.length()-1);
1632 1659 while (c == '*' || c == '&') {
1633 1660 type.truncate(type.length()-1);
1634 1661 if (!type.isEmpty()) {
1635 1662 c = type.at(type.length()-1);
1636 1663 } else {
1637 1664 break;
1638 1665 }
1639 1666 }
1640 1667 // split away template arguments
1641 1668 type = type.split("<").first();
1642 1669 // split away const
1643 1670 type = type.split(" ").last().trimmed();
1644 1671
1645 1672 // if the type is a known class info, then create the full type name, i.e. include the
1646 1673 // module name. For example, the slot may return a QDate, then this looks up the
1647 1674 // name _PythonQt.QtCore.QDate.
1648 1675 PythonQtClassInfo* typeInfo = _p->_knownClassInfos.value(type.toLatin1().constData());
1649 1676 if (typeInfo && typeInfo->pythonQtClassWrapper()) {
1650 1677 PyObject* s = PyObject_GetAttrString(typeInfo->pythonQtClassWrapper(), "__module__");
1651 1678 #ifdef PY3K
1652 1679 Q_ASSERT(PyUnicode_Check(s));
1653 1680 type = QString(PyUnicode_AsUTF8(s));
1654 1681 #else
1655 1682 Q_ASSERT(PyString_Check(s));
1656 1683 type = QString(PyString_AsString(s)) + "." + type;
1657 1684 #endif
1658 1685 Py_DECREF(s);
1659 1686 s = PyObject_GetAttrString(typeInfo->pythonQtClassWrapper(), "__name__");
1660 1687 #ifdef PY3K
1661 1688 Q_ASSERT(PyUnicode_Check(s));
1662 1689 #else
1663 1690 Q_ASSERT(PyString_Check(s));
1664 1691 #endif
1665 1692 Py_DECREF(s);
1666 1693 }
1667 1694 }
1668 1695 }
1669 1696 }
1670 1697 }
1671 1698 }
1672 1699 }
1673 1700 return type;
1674 1701 }
1675 1702
1676 1703 void PythonQt::registerCPPClass(const char* typeName, const char* parentTypeName, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell)
1677 1704 {
1678 1705 _p->registerCPPClass(typeName, parentTypeName, package, wrapperCreator, shell);
1679 1706 }
1680 1707
1681 1708
1682 1709 PythonQtClassInfo* PythonQtPrivate::lookupClassInfoAndCreateIfNotPresent(const char* typeName)
1683 1710 {
1684 1711 PythonQtClassInfo* info = _knownClassInfos.value(typeName);
1685 1712 if (!info) {
1686 1713 info = new PythonQtClassInfo();
1687 1714 info->setupCPPObject(typeName);
1688 1715 _knownClassInfos.insert(typeName, info);
1689 1716 }
1690 1717 return info;
1691 1718 }
1692 1719
1693 1720 void PythonQt::addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb)
1694 1721 {
1695 1722 _p->addPolymorphicHandler(typeName, cb);
1696 1723 }
1697 1724
1698 1725 void PythonQtPrivate::addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb)
1699 1726 {
1700 1727 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(typeName);
1701 1728 info->addPolymorphicHandler(cb);
1702 1729 }
1703 1730
1704 1731 bool PythonQt::addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset)
1705 1732 {
1706 1733 return _p->addParentClass(typeName, parentTypeName, upcastingOffset);
1707 1734 }
1708 1735
1709 1736 bool PythonQtPrivate::addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset)
1710 1737 {
1711 1738 PythonQtClassInfo* info = _knownClassInfos.value(typeName);
1712 1739 if (info) {
1713 1740 PythonQtClassInfo* parentInfo = lookupClassInfoAndCreateIfNotPresent(parentTypeName);
1714 1741 info->addParentClass(PythonQtClassInfo::ParentClassInfo(parentInfo, upcastingOffset));
1715 1742 return true;
1716 1743 } else {
1717 1744 return false;
1718 1745 }
1719 1746 }
1720 1747
1721 1748 void PythonQtPrivate::registerCPPClass(const char* typeName, const char* parentTypeName, const char* package, PythonQtQObjectCreatorFunctionCB* wrapperCreator, PythonQtShellSetInstanceWrapperCB* shell, PyObject* module, int typeSlots)
1722 1749 {
1723 1750 PythonQtClassInfo* info = lookupClassInfoAndCreateIfNotPresent(typeName);
1724 1751 if (!info->pythonQtClassWrapper()) {
1725 1752 info->setTypeSlots(typeSlots);
1726 1753 info->setupCPPObject(typeName);
1727 1754 createPythonQtClassWrapper(info, package, module);
1728 1755 }
1729 1756 if (parentTypeName && strcmp(parentTypeName,"")!=0) {
1730 1757 addParentClass(typeName, parentTypeName, 0);
1731 1758 }
1732 1759 if (wrapperCreator) {
1733 1760 info->setDecoratorProvider(wrapperCreator);
1734 1761 }
1735 1762 if (shell) {
1736 1763 info->setShellSetInstanceWrapperCB(shell);
1737 1764 }
1738 1765 }
1739 1766
1740 1767 PyObject* PythonQtPrivate::packageByName(const char* name)
1741 1768 {
1742 1769 if (name==NULL || name[0]==0) {
1743 1770 name = "private";
1744 1771 }
1745 1772 PyObject* v = _packages.value(name);
1746 1773 if (!v) {
1747 1774 v = PyImport_AddModule((_pythonQtModuleName + "." + name).constData());
1748 1775 _packages.insert(name, v);
1749 1776 // AddObject steals the reference, so increment it!
1750 1777 Py_INCREF(v);
1751 1778 PyModule_AddObject(_pythonQtModule, name, v);
1752 1779 }
1753 1780 return v;
1754 1781 }
1755 1782
1756 1783 void PythonQtPrivate::handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result)
1757 1784 {
1758 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 1786 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
1760 1787 PythonQt::self()->handleError();
1761 1788 }
1762 1789
1763 1790 PyObject* PythonQt::helpCalled(PythonQtClassInfo* info)
1764 1791 {
1765 1792 if (_p->_initFlags & ExternalHelp) {
1766 1793 Q_EMIT pythonHelpRequest(QByteArray(info->className()));
1767 1794 return Py_BuildValue("");
1768 1795 } else {
1769 1796 #ifdef PY3K
1770 1797 return PyUnicode_FromString(info->help().toLatin1().data());
1771 1798 #else
1772 1799 return PyString_FromString(info->help().toLatin1().data());
1773 1800 #endif
1774 1801 }
1775 1802 }
1776 1803
1777 1804 void PythonQt::clearNotFoundCachedMembers()
1778 1805 {
1779 1806 Q_FOREACH(PythonQtClassInfo* info, _p->_knownClassInfos) {
1780 1807 info->clearNotFoundCachedMembers();
1781 1808 }
1782 1809 }
1783 1810
1784 1811 void PythonQt::removeWrapperFactory( PythonQtCppWrapperFactory* factory )
1785 1812 {
1786 1813 _p->_cppWrapperFactories.removeAll(factory);
1787 1814 }
1788 1815
1789 1816 void PythonQt::removeWrapperFactory( PythonQtForeignWrapperFactory* factory )
1790 1817 {
1791 1818 _p->_foreignWrapperFactories.removeAll(factory);
1792 1819 }
1793 1820
1794 1821 void PythonQtPrivate::removeWrapperPointer(void* obj)
1795 1822 {
1796 1823 _wrappedObjects.remove(obj);
1797 1824 }
1798 1825
1799 1826 void PythonQtPrivate::addWrapperPointer(void* obj, PythonQtInstanceWrapper* wrapper)
1800 1827 {
1801 1828 _wrappedObjects.insert(obj, wrapper);
1802 1829 }
1803 1830
1804 1831 PythonQtInstanceWrapper* PythonQtPrivate::findWrapperAndRemoveUnused(void* obj)
1805 1832 {
1806 1833 PythonQtInstanceWrapper* wrap = _wrappedObjects.value(obj);
1807 1834 if (wrap && !wrap->_wrappedPtr && wrap->_obj == NULL) {
1808 1835 // this is a wrapper whose QObject was already removed due to destruction
1809 1836 // so the obj pointer has to be a new QObject with the same address...
1810 1837 // we remove the old one and set the copy to NULL
1811 1838 wrap->_objPointerCopy = NULL;
1812 1839 removeWrapperPointer(obj);
1813 1840 wrap = NULL;
1814 1841 }
1815 1842 return wrap;
1816 1843 }
1817 1844
1818 1845 PythonQtObjectPtr PythonQtPrivate::createModule(const QString& name, PyObject* pycode)
1819 1846 {
1820 1847 PythonQtObjectPtr result;
1821 1848 PythonQt::self()->clearError();
1822 1849 if (pycode) {
1823 1850 result.setNewRef(PyImport_ExecCodeModule((char*)name.toLatin1().data(), pycode));
1824 1851 } else {
1825 1852 PythonQt::self()->handleError();
1826 1853 }
1827 1854 return result;
1828 1855 }
1829 1856
1830 1857 void* PythonQtPrivate::unwrapForeignWrapper( const QByteArray& classname, PyObject* obj )
1831 1858 {
1832 1859 void* foreignObject = NULL;
1833 1860 for (int i=0; i<_foreignWrapperFactories.size(); i++) {
1834 1861 foreignObject = _foreignWrapperFactories.at(i)->unwrap(classname, obj);
1835 1862 if (foreignObject) {
1836 1863 return foreignObject;
1837 1864 }
1838 1865 }
1839 1866 return NULL;
1840 1867 }
1841 1868
1842 1869 bool PythonQtPrivate::isMethodDescriptor(PyObject* object) const
1843 1870 {
1844 1871 // This implementation is the same as in inspect.ismethoddescriptor(), inspect.py.
1845 1872 if (PyObject_HasAttrString(object, "__get__") &&
1846 1873 !PyObject_HasAttrString(object, "__set__") &&
1847 1874 !PyMethod_Check(object) &&
1848 1875 !PyFunction_Check(object)
1849 1876 #ifndef PY3K
1850 1877 && !PyClass_Check(object)
1851 1878 #endif
1852 1879 ) {
1853 1880 return true;
1854 1881 }
1855 1882 return false;
1856 1883 }
1857 1884
1858 1885 QString PythonQtPrivate::getSignature(PyObject* object)
1859 1886 {
1860 1887 QString signature;
1861 1888
1862 1889 if (object) {
1863 1890 PyMethodObject* method = NULL;
1864 1891 PyFunctionObject* func = NULL;
1865 1892
1866 1893 bool decrefMethod = false;
1867 1894
1868 1895 #ifdef PY3K
1869 1896 if (PyType_Check(object)) {
1870 1897 #else
1871 1898 if (object->ob_type == &PyClass_Type || object->ob_type == &PyType_Type) {
1872 1899 #endif
1873 1900 method = (PyMethodObject*)PyObject_GetAttrString(object, "__init__");
1874 1901 decrefMethod = true;
1875 1902 } else if (object->ob_type == &PyFunction_Type) {
1876 1903 func = (PyFunctionObject*)object;
1877 1904 } else if (object->ob_type == &PyMethod_Type) {
1878 1905 method = (PyMethodObject*)object;
1879 1906 }
1880 1907 if (method) {
1881 1908 if (PyFunction_Check(method->im_func)) {
1882 1909 func = (PyFunctionObject*)method->im_func;
1883 1910 } else if (isMethodDescriptor((PyObject*)method)) {
1884 1911 QString docstr;
1885 1912 PyObject* doc = PyObject_GetAttrString(object, "__doc__");
1886 1913 if (doc) {
1887 1914 #ifdef PY3K
1888 1915 docstr = PyUnicode_AsUTF8(doc);
1889 1916 #else
1890 1917 docstr = PyString_AsString(doc);
1891 1918 #endif
1892 1919 Py_DECREF(doc);
1893 1920 }
1894 1921
1895 1922 PyObject* s = PyObject_GetAttrString(object, "__name__");
1896 1923 if (s) {
1897 1924 #ifdef PY3K
1898 1925 Q_ASSERT(PyUnicode_Check(s));
1899 1926 signature = PyUnicode_AsUTF8(s);
1900 1927 #else
1901 1928 Q_ASSERT(PyString_Check(s));
1902 1929 signature = PyString_AsString(s);
1903 1930 #endif
1904 1931 if (docstr.startsWith(signature + "(")) {
1905 1932 signature = docstr;
1906 1933 } else {
1907 1934 signature += "(...)";
1908 1935 if (!docstr.isEmpty()) {
1909 1936 signature += "\n\n" + docstr;
1910 1937 }
1911 1938 }
1912 1939 Py_DECREF(s);
1913 1940 }
1914 1941 }
1915 1942 }
1916 1943
1917 1944 if (func) {
1918 1945 QString funcName;
1919 1946 PyObject* s = PyObject_GetAttrString((PyObject*)func, "__name__");
1920 1947 if (s) {
1921 1948 #ifdef PY3K
1922 1949 Q_ASSERT(PyUnicode_Check(s));
1923 1950 funcName = PyUnicode_AsUTF8(s);
1924 1951 #else
1925 1952 Q_ASSERT(PyString_Check(s));
1926 1953 funcName = PyString_AsString(s);
1927 1954 #endif
1928 1955 Py_DECREF(s);
1929 1956 }
1930 1957 if (method && funcName == "__init__") {
1931 1958 PyObject* s = PyObject_GetAttrString(object, "__name__");
1932 1959 if (s) {
1933 1960 #ifdef PY3K
1934 1961 Q_ASSERT(PyUnicode_Check(s));
1935 1962 funcName = PyUnicode_AsUTF8(s);
1936 1963 #else
1937 1964 Q_ASSERT(PyString_Check(s));
1938 1965 funcName = PyString_AsString(s);
1939 1966 #endif
1940 1967 Py_DECREF(s);
1941 1968 }
1942 1969 }
1943 1970
1944 1971 QStringList arguments;
1945 1972 QStringList defaults;
1946 1973 QString varargs;
1947 1974 QString varkeywords;
1948 1975 // NOTE: This implementation is based on function getargs() in inspect.py.
1949 1976 // inspect.getargs() can handle anonymous (tuple) arguments, while this code does not.
1950 1977 // It can be implemented, but it may be rarely needed and not necessary.
1951 1978 PyCodeObject* code = (PyCodeObject*)func->func_code;
1952 1979 if (code->co_varnames) {
1953 1980 int nargs = code->co_argcount;
1954 1981 Q_ASSERT(PyTuple_Check(code->co_varnames));
1955 1982 for (int i=0; i<nargs; i++) {
1956 1983 PyObject* name = PyTuple_GetItem(code->co_varnames, i);
1957 1984 #ifdef PY3K
1958 1985 Q_ASSERT(PyUnicode_Check(name));
1959 1986 arguments << PyUnicode_AsUTF8(name);
1960 1987 #else
1961 1988 Q_ASSERT(PyString_Check(name));
1962 1989 arguments << PyString_AsString(name);
1963 1990 #endif
1964 1991 }
1965 1992 if (code->co_flags & CO_VARARGS) {
1966 1993 PyObject* s = PyTuple_GetItem(code->co_varnames, nargs);
1967 1994 #ifdef PY3K
1968 1995 Q_ASSERT(PyUnicode_Check(s));
1969 1996 varargs = PyUnicode_AsUTF8(s);
1970 1997 #else
1971 1998 Q_ASSERT(PyString_Check(s));
1972 1999 varargs = PyString_AsString(s);
1973 2000 #endif
1974 2001 nargs += 1;
1975 2002 }
1976 2003 if (code->co_flags & CO_VARKEYWORDS) {
1977 2004 PyObject* s = PyTuple_GetItem(code->co_varnames, nargs);
1978 2005 #ifdef PY3K
1979 2006 Q_ASSERT(PyUnicode_Check(s));
1980 2007 varkeywords = PyUnicode_AsUTF8(s);
1981 2008 #else
1982 2009 Q_ASSERT(PyString_Check(s));
1983 2010 varkeywords = PyString_AsString(s);
1984 2011 #endif
1985 2012 }
1986 2013 }
1987 2014
1988 2015 PyObject* defaultsTuple = func->func_defaults;
1989 2016 if (defaultsTuple) {
1990 2017 Q_ASSERT(PyTuple_Check(defaultsTuple));
1991 2018 for (Py_ssize_t i=0; i<PyTuple_Size(defaultsTuple); i++) {
1992 2019 PyObject* d = PyTuple_GetItem(defaultsTuple, i);
1993 2020 PyObject* s = PyObject_Repr(d);
1994 2021 #ifdef PY3K
1995 2022 Q_ASSERT(PyUnicode_Check(s));
1996 2023 defaults << PyUnicode_AsUTF8(s);
1997 2024 #else
1998 2025 Q_ASSERT(PyString_Check(s));
1999 2026 defaults << PyString_AsString(s);
2000 2027 #endif
2001 2028 Py_DECREF(s);
2002 2029 }
2003 2030 }
2004 2031
2005 2032 int firstdefault = arguments.size() - defaults.size();
2006 2033 for (int i=0; i<arguments.size(); i++) {
2007 2034 if (!signature.isEmpty()) { signature += ", "; }
2008 2035 if (!method || i>0 || arguments[i] != "self") {
2009 2036 signature += arguments[i];
2010 2037 if (i >= firstdefault) {
2011 2038 signature += "=" + defaults[i-firstdefault];
2012 2039 }
2013 2040 }
2014 2041 }
2015 2042 if (!varargs.isEmpty()) {
2016 2043 if (!signature.isEmpty()) { signature += ", "; }
2017 2044 signature += "*" + varargs;
2018 2045 }
2019 2046 if (!varkeywords.isEmpty()) {
2020 2047 if (!signature.isEmpty()) { signature += ", "; }
2021 2048 signature += "**" + varkeywords;
2022 2049 }
2023 2050 signature = funcName + "(" + signature + ")";
2024 2051 }
2025 2052
2026 2053 if (method && decrefMethod) {
2027 2054 Py_DECREF(method);
2028 2055 }
2029 2056 }
2030 2057
2031 2058 return signature;
2032 2059 }
2033 2060
2034 2061 void PythonQtPrivate::shellClassDeleted( void* shellClass )
2035 2062 {
2036 2063 PythonQtInstanceWrapper* wrap = _wrappedObjects.value(shellClass);
2037 2064 if (wrap && wrap->_wrappedPtr) {
2038 2065 // this is a pure C++ wrapper and the shell has gone, so we need
2039 2066 // to set the _wrappedPtr to NULL on the wrapper
2040 2067 wrap->_wrappedPtr = NULL;
2041 2068 // and then we remove the wrapper, since the wrapped class is gone
2042 2069 _wrappedObjects.remove(shellClass);
2043 2070 }
2044 2071 // if the wrapper is a QObject, we do not handle this here,
2045 2072 // it will be handled by the QPointer<> to the QObject, which becomes NULL
2046 2073 // via the QObject destructor.
2047 2074 }
2048 2075
2049 2076 PyObject* PythonQtPrivate::wrapMemoryAsBuffer( const void* data, Py_ssize_t size )
2050 2077 {
2051 2078 // P3K port needed later on! -- not anymore :D
2052 2079 #ifdef PY3K
2053 2080 return PyMemoryView_FromMemory((char*)data, size, PyBUF_READ);
2054 2081 #else
2055 2082 return PyBuffer_FromMemory((char*)data, size);
2056 2083 #endif
2057 2084 }
2058 2085
2059 2086 PyObject* PythonQtPrivate::wrapMemoryAsBuffer( void* data, Py_ssize_t size )
2060 2087 {
2061 2088 // P3K port needed later on! -- not anymore :D
2062 2089 #ifdef PY3K
2063 2090 return PyMemoryView_FromMemory((char*)data, size, PyBUF_READ | PyBUF_WRITE);
2064 2091 #else
2065 2092 return PyBuffer_FromReadWriteMemory((char*)data, size);
2066 2093 #endif
2067 2094 }
@@ -1,743 +1,744
1 1 #ifndef _PYTHONQT_H
2 2 #define _PYTHONQT_H
3 3
4 4 /*
5 5 *
6 6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 7 *
8 8 * This library is free software; you can redistribute it and/or
9 9 * modify it under the terms of the GNU Lesser General Public
10 10 * License as published by the Free Software Foundation; either
11 11 * version 2.1 of the License, or (at your option) any later version.
12 12 *
13 13 * This library is distributed in the hope that it will be useful,
14 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 16 * Lesser General Public License for more details.
17 17 *
18 18 * Further, this software is distributed without any warranty that it is
19 19 * free of the rightful claim of any third person regarding infringement
20 20 * or the like. Any license provided herein, whether implied or
21 21 * otherwise, applies only to this software file. Patent licenses, if
22 22 * any, provided herein do not apply to combinations of this program with
23 23 * other software, or any other product whatsoever.
24 24 *
25 25 * You should have received a copy of the GNU Lesser General Public
26 26 * License along with this library; if not, write to the Free Software
27 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 28 *
29 29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 30 * 28359 Bremen, Germany or:
31 31 *
32 32 * http://www.mevis.de
33 33 *
34 34 */
35 35
36 36 //----------------------------------------------------------------------------------
37 37 /*!
38 38 // \file PythonQt.h
39 39 // \author Florian Link
40 40 // \author Last changed by $Author: florian $
41 41 // \date 2006-05
42 42 */
43 43 //----------------------------------------------------------------------------------
44 44
45 45 #include "PythonQtSystem.h"
46 46 #include "PythonQtInstanceWrapper.h"
47 47 #include "PythonQtClassWrapper.h"
48 48 #include "PythonQtSlot.h"
49 49 #include "PythonQtObjectPtr.h"
50 50 #include "PythonQtStdIn.h"
51 51 #include <QObject>
52 52 #include <QVariant>
53 53 #include <QList>
54 54 #include <QHash>
55 55 #include <QByteArray>
56 56 #include <QStringList>
57 57 #include <QtDebug>
58 58 #include <iostream>
59 59
60 60
61 61 class PythonQtClassInfo;
62 62 class PythonQtPrivate;
63 63 class PythonQtMethodInfo;
64 64 class PythonQtSignalReceiver;
65 65 class PythonQtImportFileInterface;
66 66 class PythonQtCppWrapperFactory;
67 67 class PythonQtForeignWrapperFactory;
68 68 class PythonQtQFileImporter;
69 69
70 70 typedef void PythonQtQObjectWrappedCB(QObject* object);
71 71 typedef void PythonQtQObjectNoLongerWrappedCB(QObject* object);
72 72 typedef void* PythonQtPolymorphicHandlerCB(const void *ptr, const char **class_name);
73 73
74 74 typedef void PythonQtShellSetInstanceWrapperCB(void* object, PythonQtInstanceWrapper* wrapper);
75 75
76 76 template<class T> void PythonQtSetInstanceWrapperOnShell(void* object, PythonQtInstanceWrapper* wrapper) {
77 77 (reinterpret_cast<T*>(object))->_wrapper = wrapper;
78 78 }
79 79
80 80 //! returns the offset that needs to be added to upcast an object of type T1 to T2
81 81 template<class T1, class T2> int PythonQtUpcastingOffset() {
82 82 return ((reinterpret_cast<char*>(static_cast<T2*>(reinterpret_cast<T1*>(0x100))))
83 83 - (reinterpret_cast<char*>(reinterpret_cast<T1*>(0x100))));
84 84 }
85 85
86 86 //! callback to create a QObject lazily
87 87 typedef QObject* PythonQtQObjectCreatorFunctionCB();
88 88
89 89 //! helper template to create a derived QObject class
90 90 template<class T> QObject* PythonQtCreateObject() { return new T(); };
91 91
92 92 //! The main interface to the Python Qt binding, realized as a singleton
93 93 /*!
94 94 Use PythonQt::init() to initialize the singleton and PythonQt::self() to access it.
95 95 While there can be only one PythonQt instance, you can have any number of Python context to do scripting in.
96 96 One possibility is to use createModuleFromFile(), createModuleFromScript() or createUniqueModule() to get a context
97 97 that is separated from the other contexts. Alternatively you can use Python dicts as contexts for script evaluation,
98 98 but you will need to populate the dict with the __builtins__ instance to have all Pythons available when running
99 99 code in the scope of a dict.
100 100 */
101 101 class PYTHONQT_EXPORT PythonQt : public QObject {
102 102
103 103 Q_OBJECT
104 104
105 105 public:
106 106
107 107 //! flags that can be passed to PythonQt::init()
108 108 enum InitFlags {
109 109 RedirectStdOut = 1, //!<< sets if the std out/err is redirected to pythonStdOut() and pythonStdErr() signals
110 110 IgnoreSiteModule = 2, //!<< sets if Python should ignore the site module
111 111 ExternalHelp = 4, //!<< sets if help() calls on PythonQt modules are forwarded to the pythonHelpRequest() signal
112 112 PythonAlreadyInitialized = 8 //!<< sets that PythonQt should not can PyInitialize, since it is already done
113 113 };
114 114
115 115 //! flags that tell PythonQt which operators to expect on the registered type
116 116 enum TypeSlots {
117 117 Type_Add = 1,
118 118 Type_Subtract = 1 << 1,
119 119 Type_Multiply = 1 << 2,
120 120 Type_Divide = 1 << 3,
121 121 Type_Mod = 1 << 4,
122 122 Type_And = 1 << 5,
123 123 Type_Or = 1 << 6,
124 124 Type_Xor = 1 << 7,
125 125 Type_LShift = 1 << 8,
126 126 Type_RShift = 1 << 9,
127 127
128 128 Type_InplaceAdd = 1 << 10,
129 129 Type_InplaceSubtract = 1 << 11,
130 130 Type_InplaceMultiply = 1 << 12,
131 131 Type_InplaceDivide = 1 << 13,
132 132 Type_InplaceMod = 1 << 14,
133 133 Type_InplaceAnd = 1 << 15,
134 134 Type_InplaceOr = 1 << 16,
135 135 Type_InplaceXor = 1 << 17,
136 136 Type_InplaceLShift = 1 << 18,
137 137 Type_InplaceRShift = 1 << 19,
138 138
139 139 // Not yet needed/nicely mappable/generated...
140 140 //Type_Positive = 1 << 29,
141 141 //Type_Negative = 1 << 29,
142 142 //Type_Abs = 1 << 29,
143 143 //Type_Hash = 1 << 29,
144 144
145 145 Type_Invert = 1 << 29,
146 146 Type_RichCompare = 1 << 30,
147 147 Type_NonZero = 1 << 31,
148 148
149 149 };
150 150
151 151 //! enum for profiling callback
152 152 enum ProfilingCallbackState {
153 153 Enter = 1,
154 154 Leave = 2
155 155 };
156 156
157 157 //! callback for profiling. className and methodName are only passed when state == Enter, otherwise
158 158 //! they are NULL.
159 159 typedef void ProfilingCB(ProfilingCallbackState state, const char* className, const char* methodName);
160 160
161 161 //---------------------------------------------------------------------------
162 162 //! \name Singleton Initialization
163 163 //@{
164 164
165 165 //! initialize the python qt binding (flags are a or combination of PythonQt::InitFlags), if \c pythonQtModuleName is given
166 166 //! it defines the name of the python module that PythonQt will add, otherwise "PythonQt" is used.
167 167 //! This can be used to e.g. pass in PySide or PyQt4 to make it more compatible.
168 168 static void init(int flags = IgnoreSiteModule | RedirectStdOut, const QByteArray& pythonQtModuleName = QByteArray());
169 169
170 170 //! cleanup of the singleton
171 171 static void cleanup();
172 172
173 173 //! get the singleton instance
174 174 static PythonQt* self();
175 175
176 176 //@}
177 177
178 178 //! defines the object types for introspection
179 179 enum ObjectType {
180 180 Class,
181 181 Function,
182 182 Variable,
183 183 Module,
184 184 Anything,
185 185 CallOverloads
186 186 };
187 187
188 188
189 189 //---------------------------------------------------------------------------
190 190 //! \name Standard input handling
191 191 //@{
192 192
193 193 //! Overwrite default handling of stdin using a custom callback. It internally backup
194 194 //! the original 'sys.stdin' into 'sys.pythonqt_original_stdin'
195 195 void setRedirectStdInCallback(PythonQtInputChangedCB* callback, void * callbackData = 0);
196 196
197 197 //! Enable or disable stdin custom callback. It resets 'sys.stdin' using either 'sys.pythonqt_stdin'
198 198 //! or 'sys.pythonqt_original_stdin'
199 199 void setRedirectStdInCallbackEnabled(bool enabled);
200 200
201 201 //@}
202 202
203 203 //---------------------------------------------------------------------------
204 204 //! \name Modules
205 205 //@{
206 206
207 207 //! get the __main__ module of python
208 208 PythonQtObjectPtr getMainModule();
209 209
210 210 //! import the given module and return a reference to it (useful to import e.g. "sys" and call something on it)
211 211 //! If a module is already imported, this returns the already imported module.
212 212 PythonQtObjectPtr importModule(const QString& name);
213 213
214 214 //! creates the new module \c name and evaluates the given file in the context of that module
215 215 //! If the \c script is empty, the module contains no initial code. You can use evalScript/evalCode to add code
216 216 //! to a module later on.
217 217 //! The user needs to make sure that the \c name is unique in the python module dictionary.
218 218 PythonQtObjectPtr createModuleFromFile(const QString& name, const QString& filename);
219 219
220 220 //! creates the new module \c name and evaluates the given script in the context of that module.
221 221 //! If the \c script is empty, the module contains no initial code. You can use evalScript/evalCode to add code
222 222 //! to a module later on.
223 223 //! The user needs to make sure that the \c name is unique in the python module dictionary.
224 224 PythonQtObjectPtr createModuleFromScript(const QString& name, const QString& script = QString());
225 225
226 226 //! create a uniquely named module, you can use evalFile or evalScript to populate the module with
227 227 //! script code
228 228 PythonQtObjectPtr createUniqueModule();
229 229
230 230 //@}
231 231
232 232 //---------------------------------------------------------------------------
233 233 //! \name Importing/Paths
234 234 //@{
235 235
236 236 //! overwrite the python sys path (call this directly after PythonQt::init() if you want to change the std python sys path)
237 237 void overwriteSysPath(const QStringList& paths);
238 238
239 239 //! prepend a path to sys.path to allow importing from it
240 240 void addSysPath(const QString& path);
241 241
242 242 //! sets the __path__ list of a module to the given list (important for local imports)
243 243 void setModuleImportPath(PyObject* module, const QStringList& paths);
244 244
245 245 //@}
246 246
247 247 //---------------------------------------------------------------------------
248 248 //! \name Registering Classes
249 249 //@{
250 250
251 251 //! registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
252 252 /* Since Qt4 does not offer a way to detect if a given classname is derived from QObject and thus has a QMetaObject,
253 253 you MUST register all your QObject derived classes here when you want them to be detected in signal and slot calls */
254 254 void registerClass(const QMetaObject* metaobject, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL);
255 255
256 256 //! add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants
257 257 //! (ownership of wrapper is passed to PythonQt)
258 258 /*! Make sure that you have done a qRegisterMetaType first, if typeName is a user type!
259 259
260 260 This will add a wrapper object that is used to make calls to the given classname \c typeName.
261 261 All slots that take a pointer to typeName as the first argument will be callable from Python on
262 262 a variant object that contains such a type.
263 263 */
264 264 void registerCPPClass(const char* typeName, const char* parentTypeName = NULL, const char* package = NULL, PythonQtQObjectCreatorFunctionCB* wrapperCreator = NULL, PythonQtShellSetInstanceWrapperCB* shell = NULL);
265 265
266 266 //! as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes
267 267 //! and it will register the classes when it first sees a pointer to such a derived class
268 268 void registerQObjectClassNames(const QStringList& names);
269 269
270 270 //! add a parent class relation to the \c given typeName, the upcastingOffset is needed for multiple inheritance
271 271 //! and can be calculated using PythonQtUpcastingOffset<type,parentType>(), which also verifies that
272 272 //! type is really derived from parentType.
273 273 //! Returns false if the typeName was not yet registered.
274 274 bool addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset=0);
275 275
276 276 //! add a handler for polymorphic downcasting
277 277 void addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb);
278 278
279 279 //@}
280 280
281 281 //---------------------------------------------------------------------------
282 282 //! \name Script Parsing and Evaluation
283 283 //@{
284 284
285 285 //! parses the given file and returns the python code object, this can then be used to call evalCode()
286 286 PythonQtObjectPtr parseFile(const QString& filename);
287 287
288 288 //! evaluates the given code and returns the result value (use Py_Compile etc. to create pycode from string)
289 289 //! If pycode is NULL, a python error is printed.
290 290 QVariant evalCode(PyObject* object, PyObject* pycode);
291 291
292 292 //! evaluates the given script code and returns the result value
293 293 QVariant evalScript(PyObject* object, const QString& script, int start = Py_file_input);
294 294
295 295 //! evaluates the given script code from file
296 296 void evalFile(PyObject* object, const QString& filename);
297 297
298 298 //@}
299 299
300 300 //---------------------------------------------------------------------------
301 301 //! \name Signal Handlers
302 302 //@{
303 303
304 304 //! add a signal handler to the given \c signal of \c obj and connect it to a callable \c objectname in module
305 305 bool addSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname);
306 306
307 307 //! remove a signal handler from the given \c signal of \c obj
308 308 bool removeSignalHandler(QObject* obj, const char* signal, PyObject* module, const QString& objectname);
309 309
310 310 //! add a signal handler to the given \c signal of \c obj and connect it to a callable \c receiver
311 311 bool addSignalHandler(QObject* obj, const char* signal, PyObject* receiver);
312 312
313 313 //! remove a signal handler from the given \c signal of \c obj
314 314 bool removeSignalHandler(QObject* obj, const char* signal, PyObject* receiver);
315 315
316 316 //@}
317 317
318 318 //---------------------------------------------------------------------------
319 319 //! \name Variable access
320 320 //@{
321 321
322 322 //! add the given \c qObject to the python \c object as a variable with \c name (it can be removed via clearVariable)
323 323 void addObject(PyObject* object, const QString& name, QObject* qObject);
324 324
325 325 //! add the given variable to the object
326 326 void addVariable(PyObject* object, const QString& name, const QVariant& v);
327 327
328 328 //! remove the given variable
329 329 void removeVariable(PyObject* module, const QString& name);
330 330
331 331 //! get the variable with the \c name of the \c object, returns an invalid QVariant on error
332 332 QVariant getVariable(PyObject* object, const QString& name);
333 333
334 334 //! read vars etc. in scope of an \c object, optional looking inside of an object \c objectname
335 335 QStringList introspection(PyObject* object, const QString& objectname, ObjectType type);
336 336 //! read vars etc. in scope of the given \c object
337 337 QStringList introspectObject(PyObject* object, ObjectType type);
338 338 //! read vars etc. in scope of the type object called \c typename. First the typename
339 339 //! of the form module.type is split into module and type. Then the module is looked up
340 340 //! in sys.modules. If the module or type is not found there, then the type is looked up in
341 341 //! the __builtin__ module.
342 342 QStringList introspectType(const QString& typeName, ObjectType type);
343 343
344 344 //! returns the found callable object or NULL
345 345 //! @return new reference
346 346 PythonQtObjectPtr lookupCallable(PyObject* object, const QString& name);
347 347
348 348 //! returns the return type of the method of a wrapped c++ object referenced by \c objectname
349 349 QString getReturnTypeOfWrappedMethod(PyObject* module, const QString& objectname);
350 350 //! returns the return type of the method \c methodName of a wrapped c++ type referenced by \c typeName
351 351 QString getReturnTypeOfWrappedMethod(const QString& typeName, const QString& methodName);
352 352 //@}
353 353
354 354 //---------------------------------------------------------------------------
355 355 //! \name Calling Python Objects
356 356 //@{
357 357
358 358 //! call the given python \c callable in the scope of object, returns the result converted to a QVariant
359 359 QVariant call(PyObject* object, const QString& callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
360 360
361 361 //! call the given python object, returns the result converted to a QVariant
362 362 QVariant call(PyObject* callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
363 363
364 364 //! call the given python object, returns the result as new PyObject
365 365 PyObject* callAndReturnPyObject(PyObject* callable, const QVariantList& args = QVariantList(), const QVariantMap& kwargs = QVariantMap());
366 366
367 367 //@}
368 368
369 369 //---------------------------------------------------------------------------
370 370 //! \name Decorations, Constructors, Wrappers...
371 371 //@{
372 372
373 373 //! add an object whose slots will be used as decorator slots for
374 374 //! other QObjects or CPP classes. The slots need to follow the
375 375 //! convention that the first argument is a pointer to the wrapped object.
376 376 //! (ownership is passed to PythonQt)
377 377 /*!
378 378 Example:
379 379
380 380 A slot with the signature
381 381
382 382 \code
383 383 bool doSomething(QWidget* w, int a)
384 384 \endcode
385 385
386 386 will extend QWidget instances (and derived classes) with a "bool doSomething(int a)" slot
387 387 that will be called with the concrete instance as first argument.
388 388 So in Python you can now e.g. call
389 389
390 390 \code
391 391 someWidget.doSomething(12)
392 392 \endcode
393 393
394 394 without QWidget really having this method. This allows to easily make normal methods
395 395 of Qt classes callable by forwarding them with such decorator slots
396 396 or to make CPP classes (which are not derived from QObject) callable from Python.
397 397 */
398 398 void addInstanceDecorators(QObject* o);
399 399
400 400 //! add an object whose slots will be used as decorator slots for
401 401 //! class objects (ownership is passed to PythonQt)
402 402 /*!
403 403 The slots need to follow the following convention:
404 404 - SomeClass* new_SomeClass(...)
405 405 - QVariant new_SomeClass(...)
406 406 - void delete_SomeClass(SomeClass*)
407 407 - ... static_SomeClass_someName(...)
408 408
409 409 This will add:
410 410 - a constructor
411 411 - a constructor which generates a QVariant
412 412 - a destructor (only useful for CPP objects)
413 413 - a static decorator slot which will be available on the MetaObject (visible in PythonQt module)
414 414
415 415 */
416 416 void addClassDecorators(QObject* o);
417 417
418 418 //! this will add the object both as class and instance decorator (ownership is passed to PythonQt)
419 419 void addDecorators(QObject* o);
420 420
421 421 //! add the given factory to PythonQt (ownership stays with caller)
422 422 void addWrapperFactory(PythonQtCppWrapperFactory* factory);
423 423
424 424 //! add the given factory to PythonQt (ownership stays with caller)
425 425 void addWrapperFactory(PythonQtForeignWrapperFactory* factory);
426 426
427 427 //! remove the wrapper factory
428 428 void removeWrapperFactory(PythonQtCppWrapperFactory* factory);
429 429
430 430 //! remove the wrapper factory
431 431 void removeWrapperFactory(PythonQtForeignWrapperFactory* factory);
432 432
433 433 //@}
434 434
435 435 //---------------------------------------------------------------------------
436 436 //! \name Custom Importer
437 437 //@{
438 438
439 439 //! replace the internal import implementation and use the supplied interface to load files (both py and pyc files)
440 440 //! (this method should be called directly after initialization of init() and before calling overwriteSysPath().
441 441 //! On the first call to this method, it will install a generic PythonQt importer in Pythons "path_hooks".
442 442 //! This is not reversible, so even setting setImporter(NULL) afterwards will
443 443 //! keep the custom PythonQt importer with a QFile default import interface.
444 444 //! Subsequent python import calls will make use of the passed importInterface
445 445 //! which forwards all import calls to the given \c importInterface.
446 446 //! Passing NULL will install a default QFile importer.
447 447 //! (\c importInterface ownership stays with caller)
448 448 void setImporter(PythonQtImportFileInterface* importInterface);
449 449
450 450 //! this installs the default QFile importer (which effectively does a setImporter(NULL))
451 451 //! (without calling setImporter or installDefaultImporter at least once, the default python import
452 452 //! mechanism is in place)
453 453 //! the default importer allows to import files from anywhere QFile can read from,
454 454 //! including the Qt resource system using ":". Keep in mind that you need to extend
455 455 //! "sys.path" with ":" to be able to import from the Qt resources.
456 456 void installDefaultImporter() { setImporter(NULL); }
457 457
458 458 //! set paths that the importer should ignore
459 459 void setImporterIgnorePaths(const QStringList& paths);
460 460
461 461 //! get paths that the importer should ignore
462 462 const QStringList& getImporterIgnorePaths();
463 463
464 464 //! get access to the file importer (if set)
465 465 static PythonQtImportFileInterface* importInterface();
466 466
467 467 //@}
468 468
469 469 //---------------------------------------------------------------------------
470 470 //! \name Other Stuff
471 471 //@{
472 472
473 473 //! get access to internal data (should not be used on the public API, but is used by some C functions)
474 474 static PythonQtPrivate* priv() { return _self->_p; }
475 475
476 476 //! clear all NotFound entries on all class infos, to ensure that
477 477 //! newly loaded wrappers can add methods even when the object was wrapped by PythonQt before the wrapper was loaded
478 478 void clearNotFoundCachedMembers();
479 479
480 480 //! handle a python error, call this when a python function fails. If no error occurred, it returns false.
481 481 //! The error is currently just output to the python stderr, future version might implement better trace printing
482 482 bool handleError();
483 483
484 484 //! return \a true if \a handleError() has been called and an error occured.
485 485 bool hadError()const;
486 486
487 487 //! reset error flag. After calling this, hadError() will return false.
488 488 //! \sa hadError()
489 489 void clearError();
490 490
491 491 //! if set to true, the systemExitExceptionRaised signal will be emitted if exception SystemExit is caught
492 492 //! \sa handleError()
493 493 void setSystemExitExceptionHandlerEnabled(bool value);
494 494
495 495 //! return \a true if SystemExit exception is handled by PythonQt
496 496 //! \sa setSystemExitExceptionHandlerEnabled()
497 497 bool systemExitExceptionHandlerEnabled() const;
498 498
499 499 //! set a callback that is called when a QObject with parent == NULL is wrapped by PythonQt
500 500 void setQObjectWrappedCallback(PythonQtQObjectWrappedCB* cb);
501 501 //! set a callback that is called when a QObject with parent == NULL is no longer wrapped by PythonQt
502 502 void setQObjectNoLongerWrappedCallback(PythonQtQObjectNoLongerWrappedCB* cb);
503 503
504 504 //! call the callback if it is set
505 505 static void qObjectNoLongerWrappedCB(QObject* o);
506 506
507 507 //! called by internal help methods
508 508 PyObject* helpCalled(PythonQtClassInfo* info);
509 509
510 510 //! returns the found object or NULL
511 511 //! @return new reference
512 512 PythonQtObjectPtr lookupObject(PyObject* module, const QString& name);
513 513
514 514 //! sets a callback that is called before and after function calls for profiling
515 515 void setProfilingCallback(ProfilingCB* cb);
516 516
517 517 //@}
518 518
519 519 Q_SIGNALS:
520 520 //! emitted when python outputs something to stdout (and redirection is turned on)
521 521 void pythonStdOut(const QString& str);
522 522 //! emitted when python outputs something to stderr (and redirection is turned on)
523 523 void pythonStdErr(const QString& str);
524 524
525 525 //! emitted when help() is called on a PythonQt object and \c ExternalHelp is enabled
526 526 void pythonHelpRequest(const QByteArray& cppClassName);
527 527
528 528 //! emitted when both custom SystemExit exception handler is enabled and a SystemExit
529 529 //! exception is raised.
530 530 //! \sa setSystemExitExceptionHandlerEnabled(bool)
531 531 void systemExitExceptionRaised(int exitCode);
532 532
533 533 private:
534 534 void initPythonQtModule(bool redirectStdOut, const QByteArray& pythonQtModuleName);
535 535
536 536 QString getReturnTypeOfWrappedMethodHelper(const PythonQtObjectPtr& variableObject, const QString& methodName, const QString& context);
537 537
538 538 PyObject* getObjectByType(const QString& typeName);
539 539
540 540 //! callback for stdout redirection, emits pythonStdOut signal
541 541 static void stdOutRedirectCB(const QString& str);
542 542 //! callback for stderr redirection, emits pythonStdErr signal
543 543 static void stdErrRedirectCB(const QString& str);
544 544
545 545 //! get (and create if not available) the signal receiver of that QObject, signal receiver is made child of the passed \c obj
546 546 PythonQtSignalReceiver* getSignalReceiver(QObject* obj);
547 547
548 548 PythonQt(int flags, const QByteArray& pythonQtModuleName);
549 549 ~PythonQt();
550 550
551 551 static PythonQt* _self;
552 552 static int _uniqueModuleCount;
553 553
554 554 PythonQtPrivate* _p;
555 555
556 556 };
557 557
558 558 //! internal PythonQt details
559 559 class PYTHONQT_EXPORT PythonQtPrivate : public QObject {
560 560
561 561 Q_OBJECT
562 562
563 563 public:
564 564 PythonQtPrivate();
565 565 ~PythonQtPrivate();
566 566
567 567 enum DecoratorTypes {
568 568 StaticDecorator = 1,
569 569 ConstructorDecorator = 2,
570 570 DestructorDecorator = 4,
571 571 InstanceDecorator = 8,
572 DocstringDecorator = 16,
572 573 AllDecorators = 0xffff
573 574 };
574 575
575 576 //! get the suffixes that are used for shared libraries
576 577 const QStringList& sharedLibrarySuffixes() { return _sharedLibrarySuffixes; }
577 578
578 579 //! returns if the id is the id for PythonQtObjectPtr
579 580 bool isPythonQtObjectPtrMetaId(int id) { return _PythonQtObjectPtr_metaId == id; }
580 581
581 582 //! add the wrapper pointer (for reuse if the same obj appears while wrapper still exists)
582 583 void addWrapperPointer(void* obj, PythonQtInstanceWrapper* wrapper);
583 584 //! remove the wrapper ptr again
584 585 void removeWrapperPointer(void* obj);
585 586
586 587 //! called by destructor of shells to allow invalidation of the Python wrapper
587 588 void shellClassDeleted(void* shellClass);
588 589
589 590 //! try to unwrap the given object to a C++ pointer using the foreign wrapper factories
590 591 void* unwrapForeignWrapper(const QByteArray& classname, PyObject* obj);
591 592
592 593 //! add parent class relation
593 594 bool addParentClass(const char* typeName, const char* parentTypeName, int upcastingOffset);
594 595
595 596 //! add a handler for polymorphic downcasting
596 597 void addPolymorphicHandler(const char* typeName, PythonQtPolymorphicHandlerCB* cb);
597 598
598 599 //! lookup existing classinfo and return new if not yet present
599 600 PythonQtClassInfo* lookupClassInfoAndCreateIfNotPresent(const char* typeName);
600 601
601 602 //! called when a signal emitting QObject is destroyed to remove the signal handler from the hash map
602 603 void removeSignalEmitter(QObject* obj);
603 604
604 605 //! wrap the given QObject into a Python object (or return existing wrapper!)
605 606 PyObject* wrapQObject(QObject* obj);
606 607
607 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 609 PyObject* wrapPtr(void* ptr, const QByteArray& name);
609 610
610 611 //! create a read-only buffer object from the given memory
611 612 static PyObject* wrapMemoryAsBuffer(const void* data, Py_ssize_t size);
612 613
613 614 //! create a read-write buffer object from the given memory
614 615 static PyObject* wrapMemoryAsBuffer(void* data, Py_ssize_t size);
615 616
616 617 //! registers a QObject derived class to PythonQt (this is implicitly called by addObject as well)
617 618 /* Since Qt4 does not offer a way to detect if a given classname is derived from QObject and thus has a QMetaObject,
618 619 you MUST register all your QObject derived classes here when you want them to be detected in signal and slot calls */
619 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 622 //! add a wrapper object for the given QMetaType typeName, also does an addClassDecorators() to add constructors for variants
622 623 //! (ownership of wrapper is passed to PythonQt)
623 624 /*! Make sure that you have done a qRegisterMetaType first, if typeName is a user type!
624 625
625 626 This will add a wrapper object that is used to make calls to the given classname \c typeName.
626 627 All slots that take a pointer to typeName as the first argument will be callable from Python on
627 628 a variant object that contains such a type.
628 629 */
629 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 632 //! as an alternative to registerClass, you can tell PythonQt the names of QObject derived classes
632 633 //! and it will register the classes when it first sees a pointer to such a derived class
633 634 void registerQObjectClassNames(const QStringList& names);
634 635
635 636 //! add a decorator object
636 637 void addDecorators(QObject* o, int decoTypes);
637 638
638 639 //! helper method that creates a PythonQtClassWrapper object (returns a new reference)
639 640 PythonQtClassWrapper* createNewPythonQtClassWrapper(PythonQtClassInfo* info, PyObject* module);
640 641
641 642 //! create a new instance of the given enum type with given value (returns a new reference)
642 643 static PyObject* createEnumValueInstance(PyObject* enumType, unsigned int enumValue);
643 644
644 645 //! helper that creates a new int derived class that represents the enum of the given name (returns a new reference)
645 646 static PyObject* createNewPythonQtEnumWrapper(const char* enumName, PyObject* parentObject);
646 647
647 648 //! helper method that creates a PythonQtInstanceWrapper object and registers it in the object map
648 649 PythonQtInstanceWrapper* createNewPythonQtInstanceWrapper(QObject* obj, PythonQtClassInfo* info, void* wrappedPtr = NULL);
649 650
650 651 //! get the class info for a meta object (if available)
651 652 PythonQtClassInfo* getClassInfo(const QMetaObject* meta) { return _knownClassInfos.value(meta->className()); }
652 653
653 654 //! get the class info for a meta object (if available)
654 655 PythonQtClassInfo* getClassInfo(const QByteArray& className) { return _knownClassInfos.value(className); }
655 656
656 657 //! creates the new module from the given pycode
657 658 PythonQtObjectPtr createModule(const QString& name, PyObject* pycode);
658 659
659 660 //! get the current class info (for the next PythonQtClassWrapper that is created) and reset it to NULL again
660 661 PythonQtClassInfo* currentClassInfoForClassWrapperCreation();
661 662
662 663 //! the dummy tuple (which is empty and may be used to detected that a wrapper is called from internal wrapper creation
663 664 static PyObject* dummyTuple();
664 665
665 666 //! called by virtual overloads when a python return value can not be converted to the required Qt type
666 667 void handleVirtualOverloadReturnError(const char* signature, const PythonQtMethodInfo* methodInfo, PyObject* result);
667 668
668 669 //! get access to the PythonQt module
669 670 PythonQtObjectPtr pythonQtModule() const { return _pythonQtModule; }
670 671
671 672 //! returns the profiling callback, which may be NULL
672 673 PythonQt::ProfilingCB* profilingCB() const { return _profilingCB; }
673 674
674 675 //! determines the signature of the given callable object (similar as pydoc)
675 676 QString getSignature(PyObject* object);
676 677
677 678 //! returns true if the object is a method descriptor (same as inspect.ismethoddescriptor() in inspect.py)
678 679 bool isMethodDescriptor(PyObject* object) const;
679 680
680 681 private:
681 682 //! Setup the shared library suffixes by getting them from the "imp" module.
682 683 void setupSharedLibrarySuffixes();
683 684
684 685 //! create a new pythonqt class wrapper and place it in the pythonqt module
685 686 void createPythonQtClassWrapper(PythonQtClassInfo* info, const char* package, PyObject* module = NULL);
686 687
687 688 //! get/create new package module (the returned object is a borrowed reference)
688 689 PyObject* packageByName(const char* name);
689 690
690 691 //! get the wrapper for a given pointer (and remove a wrapper of an already destroyed qobject)
691 692 PythonQtInstanceWrapper* findWrapperAndRemoveUnused(void* obj);
692 693
693 694 //! stores pointer to PyObject mapping of wrapped QObjects AND C++ objects
694 695 QHash<void* , PythonQtInstanceWrapper *> _wrappedObjects;
695 696
696 697 //! stores the meta info of known Qt classes
697 698 QHash<QByteArray, PythonQtClassInfo *> _knownClassInfos;
698 699
699 700 //! names of qobject derived classes that can be casted to qobject savely
700 701 QHash<QByteArray, bool> _knownQObjectClassNames;
701 702
702 703 //! stores signal receivers for QObjects
703 704 QHash<QObject* , PythonQtSignalReceiver *> _signalReceivers;
704 705
705 706 //! the PythonQt python module
706 707 PythonQtObjectPtr _pythonQtModule;
707 708
708 709 //! the name of the PythonQt python module
709 710 QByteArray _pythonQtModuleName;
710 711
711 712 //! the importer interface (if set)
712 713 PythonQtImportFileInterface* _importInterface;
713 714
714 715 //! the default importer
715 716 PythonQtQFileImporter* _defaultImporter;
716 717
717 718 PythonQtQObjectNoLongerWrappedCB* _noLongerWrappedCB;
718 719 PythonQtQObjectWrappedCB* _wrappedCB;
719 720
720 721 QStringList _importIgnorePaths;
721 722 QStringList _sharedLibrarySuffixes;
722 723
723 724 //! the cpp object wrapper factories
724 725 QList<PythonQtCppWrapperFactory*> _cppWrapperFactories;
725 726
726 727 QList<PythonQtForeignWrapperFactory*> _foreignWrapperFactories;
727 728
728 729 QHash<QByteArray, PyObject*> _packages;
729 730
730 731 PythonQtClassInfo* _currentClassInfoForClassWrapperCreation;
731 732
732 733 PythonQt::ProfilingCB* _profilingCB;
733 734
734 735 int _initFlags;
735 736 int _PythonQtObjectPtr_metaId;
736 737
737 738 bool _hadError;
738 739 bool _systemExitExceptionHandlerEnabled;
739 740
740 741 friend class PythonQt;
741 742 };
742 743
743 744 #endif
@@ -1,910 +1,913
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQt.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtClassInfo.h"
43 43 #include "PythonQtMethodInfo.h"
44 44 #include "PythonQt.h"
45 45 #include <QMetaMethod>
46 46 #include <QMetaObject>
47 47 #include <QMetaEnum>
48 48
49 49 QHash<QByteArray, int> PythonQtMethodInfo::_parameterTypeDict;
50 50
51 51 PythonQtClassInfo::PythonQtClassInfo() {
52 52 _meta = NULL;
53 53 _constructors = NULL;
54 54 _destructor = NULL;
55 55 _decoratorProvider = NULL;
56 56 _decoratorProviderCB = NULL;
57 57 _pythonQtClassWrapper = NULL;
58 58 _shellSetInstanceWrapperCB = NULL;
59 59 _metaTypeId = -1;
60 60 _typeSlots = 0;
61 61 _isQObject = false;
62 62 _enumsCreated = false;
63 63 }
64 64
65 65 PythonQtClassInfo::~PythonQtClassInfo()
66 66 {
67 67 clearCachedMembers();
68 68
69 69 if (_constructors) {
70 70 _constructors->deleteOverloadsAndThis();
71 71 }
72 72 if (_destructor) {
73 73 _destructor->deleteOverloadsAndThis();
74 74 }
75 75 Q_FOREACH(PythonQtSlotInfo* info, _decoratorSlots) {
76 76 info->deleteOverloadsAndThis();
77 77 }
78 78 }
79 79
80 80 void PythonQtClassInfo::setupQObject(const QMetaObject* meta)
81 81 {
82 82 // _wrappedClassName is already set earlier in the class setup
83 83 _isQObject = true;
84 84 _meta = meta;
85 85 }
86 86
87 87 void PythonQtClassInfo::setupCPPObject(const QByteArray& classname)
88 88 {
89 89 _isQObject = false;
90 90 _wrappedClassName = classname;
91 91 _metaTypeId = QMetaType::type(classname);
92 92 }
93 93
94 94 void PythonQtClassInfo::clearCachedMembers()
95 95 {
96 96 QHashIterator<QByteArray, PythonQtMemberInfo> i(_cachedMembers);
97 97 while (i.hasNext()) {
98 98 PythonQtMemberInfo member = i.next().value();
99 99 if (member._type== PythonQtMemberInfo::Slot || member._type== PythonQtMemberInfo::Signal) {
100 100 PythonQtSlotInfo* info = member._slot;
101 101 while (info) {
102 102 PythonQtSlotInfo* next = info->nextInfo();
103 103 delete info;
104 104 info = next;
105 105 }
106 106 }
107 107 }
108 108 }
109 109
110 110 int PythonQtClassInfo::findCharOffset(const char* sigStart, char someChar)
111 111 {
112 112 const char* sigEnd = sigStart;
113 113 char c;
114 114 do {
115 115 c = *sigEnd++;
116 116 } while (c!=someChar && c!=0);
117 117 return sigEnd-sigStart-1;
118 118 }
119 119
120 120 bool PythonQtClassInfo::lookForPropertyAndCache(const char* memberName)
121 121 {
122 122 if (!_meta) return false;
123 123
124 124 bool found = false;
125 125 bool nameMapped = false;
126 126 const char* attributeName = memberName;
127 127 // look for properties
128 128 int i = _meta->indexOfProperty(attributeName);
129 129 if (i==-1) {
130 130 // try to map name to objectName
131 131 if (qstrcmp(attributeName, "name")==0) {
132 132 attributeName = "objectName";
133 133 nameMapped = true;
134 134 i = _meta->indexOfProperty(attributeName);
135 135 }
136 136 }
137 137 if (i!=-1) {
138 138 PythonQtMemberInfo newInfo(_meta->property(i));
139 139 _cachedMembers.insert(attributeName, newInfo);
140 140 if (nameMapped) {
141 141 _cachedMembers.insert(memberName, newInfo);
142 142 }
143 143 #ifdef PYTHONQT_DEBUG
144 144 std::cout << "caching property " << memberName << " on " << _meta->className() << std::endl;
145 145 #endif
146 146 found = true;
147 147 }
148 148 return found;
149 149 }
150 150
151 151 PythonQtSlotInfo* PythonQtClassInfo::recursiveFindDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset)
152 152 {
153 153 inputInfo = findDecoratorSlotsFromDecoratorProvider(memberName, inputInfo, found, memberCache, upcastingOffset);
154 154 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
155 155 inputInfo = info._parent->recursiveFindDecoratorSlotsFromDecoratorProvider(memberName, inputInfo, found, memberCache, upcastingOffset+info._upcastingOffset);
156 156 }
157 157 return inputInfo;
158 158 }
159 159
160 160 PythonQtSlotInfo* PythonQtClassInfo::findDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset) {
161 161 QObject* decoratorProvider = decorator();
162 162 int memberNameLen = static_cast<int>(strlen(memberName));
163 163 if (decoratorProvider) {
164 164 //qDebug()<< "looking " << decoratorProvider->metaObject()->className() << " " << memberName << " " << upcastingOffset;
165 165 const QMetaObject* meta = decoratorProvider->metaObject();
166 166 int numMethods = meta->methodCount();
167 167 int startFrom = QObject::staticMetaObject.methodCount();
168 168 for (int i = startFrom; i < numMethods; i++) {
169 169 QMetaMethod m = meta->method(i);
170 170 if ((m.methodType() == QMetaMethod::Method ||
171 171 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
172 172
173 173 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
174 174 QByteArray sigStart = m.methodSignature();
175 175 #else
176 176 QByteArray sigStart = m.signature();
177 177 #endif
178 178 bool isClassDeco = false;
179 179 if (sigStart.startsWith("static_")) {
180 180 // skip the static_classname_ part of the string
181 181 sigStart.remove(0,7+strlen(className())+1);
182 182 isClassDeco = true;
183 183 } else if (sigStart.startsWith("new_")) {
184 184 isClassDeco = true;
185 185 } else if (sigStart.startsWith("delete_")) {
186 186 isClassDeco = true;
187 187 }
188 188 // find the first '('
189 189 int offset = findCharOffset(sigStart, '(');
190 190
191 191 // XXX no checking is currently done if the slots have correct first argument or not...
192 192
193 193 // check if same length and same name
194 194 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
195 195 found = true;
196 196 PythonQtSlotInfo* info = new PythonQtSlotInfo(this, m, i, decoratorProvider, isClassDeco?PythonQtSlotInfo::ClassDecorator:PythonQtSlotInfo::InstanceDecorator);
197 197 info->setUpcastingOffset(upcastingOffset);
198 198 //qDebug()<< "adding " << decoratorProvider->metaObject()->className() << " " << memberName << " " << upcastingOffset;
199 199 if (tail) {
200 200 tail->setNextInfo(info);
201 201 } else {
202 202 PythonQtMemberInfo newInfo(info);
203 203 memberCache.insert(memberName, newInfo);
204 204 }
205 205 tail = info;
206 206 }
207 207 }
208 208 }
209 209 }
210 210
211 211 tail = findDecoratorSlots(memberName, memberNameLen, tail, found, memberCache, upcastingOffset);
212 212
213 213 // now look for slots/signals/methods on this level of the meta object
214 214 if (_meta) {
215 215 int numMethods = _meta->methodCount();
216 216 // start from methodOffset, to only add slots which are located in this class,
217 217 // and not in the parent class, which is traversed recursively later on.
218 218 // (if the class in not a QObject, we are working with a script wrapper QObject
219 219 // and need to read all slots/signals starting from 0).
220 220 int methodOffset = _isQObject?_meta->methodOffset():0;
221 221 for (int i = methodOffset; i < numMethods; i++) {
222 222 QMetaMethod m = _meta->method(i);
223 223 if (((m.methodType() == QMetaMethod::Method ||
224 224 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public)
225 225 || m.methodType()==QMetaMethod::Signal) {
226 226
227 227 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
228 228 QByteArray sigStart = m.methodSignature();
229 229 #else
230 230 QByteArray sigStart = m.signature();
231 231 #endif
232 232 // find the first '('
233 233 int offset = findCharOffset(sigStart, '(');
234 234
235 235 // check if same length and same name
236 236 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
237 237 found = true;
238 238 PythonQtSlotInfo* info = new PythonQtSlotInfo(this, m, i);
239 239 if (tail) {
240 240 tail->setNextInfo(info);
241 241 } else {
242 242 PythonQtMemberInfo newInfo(info);
243 243 memberCache.insert(memberName, newInfo);
244 244 }
245 245 tail = info;
246 246 }
247 247 }
248 248 }
249 249 }
250 250 return tail;
251 251 }
252 252
253 253 bool PythonQtClassInfo::lookForMethodAndCache(const char* memberName)
254 254 {
255 255 bool found = false;
256 256 PythonQtSlotInfo* tail = NULL;
257 257
258 258 // look for dynamic decorators in this class and in derived classes
259 259 // (do this first to allow overloading of existing slots with generated wrappers,
260 260 // e.g. QDialog::accept is overloaded with PythonQtWrapper_QDialog::accept decorator)
261 261 tail = recursiveFindDecoratorSlotsFromDecoratorProvider(memberName, tail, found, _cachedMembers, 0);
262 262
263 263 return found;
264 264 }
265 265
266 266 bool PythonQtClassInfo::lookForEnumAndCache(const QMetaObject* meta, const char* memberName)
267 267 {
268 268 bool found = false;
269 269 // look for enum values
270 270 int enumCount = meta->enumeratorCount();
271 271 for (int i=0;i<enumCount; i++) {
272 272 QMetaEnum e = meta->enumerator(i);
273 273 // we do not want flags, they will cause our values to appear two times
274 274 if (e.isFlag()) continue;
275 275
276 276 for (int j=0; j < e.keyCount(); j++) {
277 277 if (qstrcmp(e.key(j), memberName)==0) {
278 278 PyObject* enumType = findEnumWrapper(e.name());
279 279 if (enumType) {
280 280 PythonQtObjectPtr enumValuePtr;
281 281 enumValuePtr.setNewRef(PythonQtPrivate::createEnumValueInstance(enumType, e.value(j)));
282 282 PythonQtMemberInfo newInfo(enumValuePtr);
283 283 _cachedMembers.insert(memberName, newInfo);
284 284 #ifdef PYTHONQT_DEBUG
285 285 std::cout << "caching enum " << memberName << " on " << meta->className() << std::endl;
286 286 #endif
287 287 found = true;
288 288 break;
289 289 } else {
290 290 std::cout << "enum " << e.name() << " not found on " << className() << std::endl;
291 291 }
292 292 }
293 293 }
294 294 }
295 295 return found;
296 296 }
297 297
298 298 PythonQtMemberInfo PythonQtClassInfo::member(const char* memberName)
299 299 {
300 300 PythonQtMemberInfo info = _cachedMembers.value(memberName);
301 301 if (info._type != PythonQtMemberInfo::Invalid) {
302 302 return info;
303 303 } else {
304 304 bool found = false;
305 305
306 306 found = lookForPropertyAndCache(memberName);
307 307 if (!found) {
308 308 found = lookForMethodAndCache(memberName);
309 309 }
310 310 if (!found) {
311 311 if (_meta) {
312 312 // check enums in our meta object directly
313 313 found = lookForEnumAndCache(_meta, memberName);
314 314 }
315 315 if (!found) {
316 316 // check enums in the class hierachy of CPP classes
317 317 // look for dynamic decorators in this class and in derived classes
318 318 QList<QObject*> decoObjects;
319 319 recursiveCollectDecoratorObjects(decoObjects);
320 320 Q_FOREACH(QObject* deco, decoObjects) {
321 321 // call on ourself for caching, but with different metaObject():
322 322 found = lookForEnumAndCache(deco->metaObject(), memberName);
323 323 if (found) {
324 324 break;
325 325 }
326 326 }
327 327 }
328 328 }
329 329 if (!found) {
330 330 // maybe it is an enum wrapper?
331 331 PyObject* p = findEnumWrapper(memberName);
332 332 if (p) {
333 333 info._type = PythonQtMemberInfo::EnumWrapper;
334 334 info._enumWrapper = p;
335 335 _cachedMembers.insert(memberName, info);
336 336 found = true;
337 337 }
338 338 }
339 339 if (!found) {
340 340 // since python keywords can not be looked up, we check if the name contains a single trailing _
341 341 // and remove that and look again, so that we e.g. find exec on an exec_ lookup
342 342 QByteArray mbrName(memberName);
343 343 if ((mbrName.length()>2) &&
344 344 (mbrName.at(mbrName.length()-1) == '_') &&
345 345 (mbrName.at(mbrName.length()-2) != '_')) {
346 346 mbrName = mbrName.mid(0,mbrName.length()-1);
347 347 found = lookForMethodAndCache(mbrName.constData());
348 348 if (found) {
349 349 return _cachedMembers.value(mbrName);
350 350 }
351 351 }
352 352 }
353 353 if (!found) {
354 354 // we store a NotFound member, so that we get a quick result for non existing members (e.g. operator_equal lookup)
355 355 info._type = PythonQtMemberInfo::NotFound;
356 356 _cachedMembers.insert(memberName, info);
357 357 }
358 358 }
359 359
360 360 return _cachedMembers.value(memberName);
361 361 }
362 362
363 363 void PythonQtClassInfo::recursiveCollectDecoratorObjects(QList<QObject*>& decoratorObjects) {
364 364 QObject* deco = decorator();
365 365 if (deco) {
366 366 decoratorObjects.append(deco);
367 367 }
368 368 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
369 369 info._parent->recursiveCollectDecoratorObjects(decoratorObjects);
370 370 }
371 371 }
372 372
373 373 void PythonQtClassInfo::recursiveCollectClassInfos(QList<PythonQtClassInfo*>& classInfoObjects) {
374 374 classInfoObjects.append(this);
375 375 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
376 376 info._parent->recursiveCollectClassInfos(classInfoObjects);
377 377 }
378 378 }
379 379
380 380 PythonQtSlotInfo* PythonQtClassInfo::findDecoratorSlots(const char* memberName, int memberNameLen, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset)
381 381 {
382 382 QListIterator<PythonQtSlotInfo*> it(_decoratorSlots);
383 383 while (it.hasNext()) {
384 384
385 385 PythonQtSlotInfo* infoOrig = it.next();
386 386
387 387 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
388 388 QByteArray sigStart = infoOrig->metaMethod()->methodSignature();
389 389 #else
390 390 QByteArray sigStart = infoOrig->metaMethod()->signature();
391 391 #endif
392 392 if (sigStart.startsWith("static_")) {
393 393 sigStart.remove(0,7);
394 394 int offset = findCharOffset(sigStart, '_');
395 395 sigStart.remove(0,offset+1);
396 396 }
397 397 int offset = findCharOffset(sigStart, '(');
398 398 if (memberNameLen == offset && qstrncmp(memberName, sigStart, offset)==0) {
399 399 //make a copy, otherwise we will have trouble on overloads!
400 400 PythonQtSlotInfo* info = new PythonQtSlotInfo(*infoOrig);
401 401 info->setUpcastingOffset(upcastingOffset);
402 402 found = true;
403 403 if (tail) {
404 404 tail->setNextInfo(info);
405 405 } else {
406 406 PythonQtMemberInfo newInfo(info);
407 407 memberCache.insert(memberName, newInfo);
408 408 }
409 409 tail = info;
410 410 }
411 411 }
412 412 return tail;
413 413 }
414 414
415 415 void PythonQtClassInfo::listDecoratorSlotsFromDecoratorProvider(QStringList& list, bool metaOnly) {
416 416 QObject* decoratorProvider = decorator();
417 417 if (decoratorProvider) {
418 418 const QMetaObject* meta = decoratorProvider->metaObject();
419 419 int numMethods = meta->methodCount();
420 420 int startFrom = QObject::staticMetaObject.methodCount();
421 421 for (int i = startFrom; i < numMethods; i++) {
422 422 QMetaMethod m = meta->method(i);
423 423 if ((m.methodType() == QMetaMethod::Method ||
424 424 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
425 425
426 426 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
427 427 QByteArray sigStart = m.methodSignature();
428 428 #else
429 429 QByteArray sigStart = m.signature();
430 430 #endif
431 431 bool isClassDeco = false;
432 432 if (sigStart.startsWith("static_")) {
433 433 // skip the static_classname_ part of the string
434 434 sigStart.remove(0,7+strlen(className())+1);
435 435 isClassDeco = true;
436 436 } else if (sigStart.startsWith("new_")) {
437 437 continue;
438 438 } else if (sigStart.startsWith("delete_")) {
439 439 continue;
440 440 } else if (sigStart.startsWith("py_")) {
441 441 // hide everything that starts with py_
442 442 continue;
443 443 }
444 444 // find the first '('
445 445 int offset = findCharOffset(sigStart, '(');
446 446
447 447 // XXX no checking is currently done if the slots have correct first argument or not...
448 448 if (!metaOnly || isClassDeco) {
449 449 list << QString::fromLatin1(sigStart, offset);
450 450 }
451 451 }
452 452 }
453 453 }
454 454
455 455 // look for global decorator slots
456 456 QListIterator<PythonQtSlotInfo*> it(_decoratorSlots);
457 457 while (it.hasNext()) {
458 458 PythonQtSlotInfo* slot = it.next();
459 459 if (metaOnly) {
460 460 if (slot->isClassDecorator()) {
461 461 QByteArray first = slot->slotName();
462 462 if (first.startsWith("static_")) {
463 463 int idx = first.indexOf('_');
464 464 idx = first.indexOf('_', idx+1);
465 465 first = first.mid(idx+1);
466 466 }
467 467 list << first;
468 468 }
469 469 } else {
470 470 list << slot->slotName();
471 471 }
472 472 }
473 473 }
474 474
475 475 QStringList PythonQtClassInfo::propertyList()
476 476 {
477 477 QStringList l;
478 478 if (_isQObject && _meta) {
479 479 int i;
480 480 int numProperties = _meta->propertyCount();
481 481 for (i = 0; i < numProperties; i++) {
482 482 QMetaProperty p = _meta->property(i);
483 483 l << QString(p.name());
484 484 }
485 485 }
486 486 return l;
487 487 }
488 488
489 489 QStringList PythonQtClassInfo::memberList()
490 490 {
491 491 decorator();
492 492
493 493 QStringList l;
494 494 QString h;
495 495 // normal slots of QObject (or wrapper QObject)
496 496 if (_meta) {
497 497 int numMethods = _meta->methodCount();
498 498 bool skipQObj = !_isQObject;
499 499 for (int i = skipQObj?QObject::staticMetaObject.methodCount():0; i < numMethods; i++) {
500 500 QMetaMethod m = _meta->method(i);
501 501 if (((m.methodType() == QMetaMethod::Method ||
502 502 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public)
503 503 || m.methodType()==QMetaMethod::Signal) {
504 504 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
505 505 QByteArray signa(m.methodSignature());
506 506 #else
507 507 QByteArray signa(m.signature());
508 508 #endif
509 509 signa = signa.left(signa.indexOf('('));
510 510 l << signa;
511 511 }
512 512 }
513 513 }
514 514
515 515 {
516 516 // look for dynamic decorators in this class and in derived classes
517 517 QList<PythonQtClassInfo*> infos;
518 518 recursiveCollectClassInfos(infos);
519 519 Q_FOREACH(PythonQtClassInfo* info, infos) {
520 520 info->listDecoratorSlotsFromDecoratorProvider(l, false);
521 521 }
522 522 }
523 523
524 524 // List enumerator keys...
525 525 QList<const QMetaObject*> enumMetaObjects;
526 526 if (_meta) {
527 527 enumMetaObjects << _meta;
528 528 }
529 529 // check enums in the class hierachy of CPP classes
530 530 QList<QObject*> decoObjects;
531 531 recursiveCollectDecoratorObjects(decoObjects);
532 532 Q_FOREACH(QObject* deco, decoObjects) {
533 533 enumMetaObjects << deco->metaObject();
534 534 }
535 535
536 536 Q_FOREACH(const QMetaObject* meta, enumMetaObjects) {
537 537 for (int i = 0; i<meta->enumeratorCount(); i++) {
538 538 QMetaEnum e = meta->enumerator(i);
539 539 l << e.name();
540 540 // we do not want flags, they will cause our values to appear two times
541 541 if (e.isFlag()) continue;
542 542
543 543 for (int j=0; j < e.keyCount(); j++) {
544 544 l << QString(e.key(j));
545 545 }
546 546 }
547 547 }
548 548
549 549 return QSet<QString>::fromList(l).toList();
550 550 }
551 551
552 552 const char* PythonQtClassInfo::className()
553 553 {
554 554 return _wrappedClassName.constData();
555 555 }
556 556
557 557 void* PythonQtClassInfo::castTo(void* ptr, const char* classname)
558 558 {
559 559 if (ptr==NULL) {
560 560 return NULL;
561 561 }
562 562 if (_wrappedClassName == classname) {
563 563 return ptr;
564 564 }
565 565 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
566 566 void* result = info._parent->castTo((char*)ptr + info._upcastingOffset, classname);
567 567 if (result) {
568 568 return result;
569 569 }
570 570 }
571 571 return NULL;
572 572 }
573 573
574 574 bool PythonQtClassInfo::inherits(const char* name)
575 575 {
576 576 if (_wrappedClassName == name) {
577 577 return true;
578 578 }
579 579 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
580 580 if (info._parent->inherits(name)) {
581 581 return true;
582 582 }
583 583 }
584 584 return false;
585 585 }
586 586
587 587 bool PythonQtClassInfo::inherits(PythonQtClassInfo* classInfo)
588 588 {
589 589 if (classInfo == this) {
590 590 return true;
591 591 }
592 592 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
593 593 if (info._parent->inherits(classInfo)) {
594 594 return true;
595 595 }
596 596 }
597 597 return false;
598 598 }
599 599
600 600 QString PythonQtClassInfo::help()
601 601 {
602 602 decorator();
603 603 QString h;
604 604 h += QString("--- ") + QString(className()) + QString(" ---\n");
605
606 if (!_doc.isNull())
607 h += "Description:\n" + _doc + "\n";
605 608
606 609 if (_isQObject) {
607 610 h += "Properties:\n";
608 611
609 612 int i;
610 613 int numProperties = _meta->propertyCount();
611 614 for (i = 0; i < numProperties; i++) {
612 615 QMetaProperty p = _meta->property(i);
613 616 h += QString(p.name()) + " (" + QString(p.typeName()) + " )\n";
614 617 }
615 618 }
616 619
617 620 if (constructors()) {
618 621 h += "Constructors:\n";
619 622 PythonQtSlotInfo* constr = constructors();
620 623 while (constr) {
621 624 h += constr->fullSignature() + "\n";
622 625 constr = constr->nextInfo();
623 626 }
624 627 }
625 628
626 629 h += "Slots:\n";
627 630 h += "QString help()\n";
628 631 h += "QString className()\n";
629 632
630 633 if (_meta) {
631 634 int numMethods = _meta->methodCount();
632 635 for (int i = 0; i < numMethods; i++) {
633 636 QMetaMethod m = _meta->method(i);
634 637 if ((m.methodType() == QMetaMethod::Method ||
635 638 m.methodType() == QMetaMethod::Slot) && m.access() == QMetaMethod::Public) {
636 639 PythonQtSlotInfo slot(this, m, i);
637 640 h += slot.fullSignature()+ "\n";
638 641 }
639 642 }
640 643 }
641 644
642 645 // TODO xxx : decorators and enums from decorator() are missing...
643 646 // maybe we can reuse memberlist()?
644 647
645 648 if (_meta && _meta->enumeratorCount()) {
646 649 h += "Enums:\n";
647 650 for (int i = 0; i<_meta->enumeratorCount(); i++) {
648 651 QMetaEnum e = _meta->enumerator(i);
649 652 h += QString(e.name()) + " {";
650 653 for (int j=0; j < e.keyCount(); j++) {
651 654 if (j) { h+= ", "; }
652 655 h += e.key(j);
653 656 }
654 657 h += " }\n";
655 658 }
656 659 }
657 660
658 661 if (_isQObject && _meta) {
659 662 int numMethods = _meta->methodCount();
660 663 if (numMethods>0) {
661 664 h += "Signals:\n";
662 665 for (int i = 0; i < numMethods; i++) {
663 666 QMetaMethod m = _meta->method(i);
664 667 if (m.methodType() == QMetaMethod::Signal) {
665 668 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
666 669 h += QString(m.methodSignature()) + "\n";
667 670 #else
668 671 h += QString(m.signature()) + "\n";
669 672 #endif
670 673 }
671 674 }
672 675 }
673 676 }
674 677 return h;
675 678 }
676 679
677 680 PythonQtSlotInfo* PythonQtClassInfo::constructors()
678 681 {
679 682 if (!_constructors) {
680 683 // force creation of lazy decorator, which will register the decorators
681 684 decorator();
682 685 }
683 686 return _constructors;
684 687 }
685 688
686 689 PythonQtSlotInfo* PythonQtClassInfo::destructor()
687 690 {
688 691 if (!_destructor) {
689 692 // force creation of lazy decorator, which will register the decorators
690 693 decorator();
691 694 }
692 695 return _destructor;
693 696 }
694 697
695 698 void PythonQtClassInfo::addConstructor(PythonQtSlotInfo* info)
696 699 {
697 700 PythonQtSlotInfo* prev = constructors();
698 701 if (prev) {
699 702 info->setNextInfo(prev->nextInfo());
700 703 prev->setNextInfo(info);
701 704 } else {
702 705 _constructors = info;
703 706 }
704 707 }
705 708
706 709 void PythonQtClassInfo::addDecoratorSlot(PythonQtSlotInfo* info)
707 710 {
708 711 _decoratorSlots.append(info);
709 712 }
710 713
711 714 void PythonQtClassInfo::setDestructor(PythonQtSlotInfo* info)
712 715 {
713 716 if (_destructor) {
714 717 _destructor->deleteOverloadsAndThis();
715 718 }
716 719 _destructor = info;
717 720 }
718 721
719 722 void PythonQtClassInfo::setMetaObject(const QMetaObject* meta)
720 723 {
721 724 _meta = meta;
722 725 clearCachedMembers();
723 726 }
724 727
725 728 QObject* PythonQtClassInfo::decorator()
726 729 {
727 730 if (!_decoratorProvider && _decoratorProviderCB) {
728 731 _decoratorProvider = (*_decoratorProviderCB)();
729 732 if (_decoratorProvider) {
730 733 _decoratorProvider->setParent(PythonQt::priv());
731 734 // setup enums early, since they might be needed by the constructor decorators:
732 735 if (!_enumsCreated) {
733 736 createEnumWrappers();
734 737 }
735 738 PythonQt::priv()->addDecorators(_decoratorProvider, PythonQtPrivate::ConstructorDecorator | PythonQtPrivate::DestructorDecorator);
736 739 }
737 740 }
738 741 // check if enums need to be created and create them if they are not yet created
739 742 if (!_enumsCreated) {
740 743 createEnumWrappers();
741 744 }
742 745 return _decoratorProvider;
743 746 }
744 747
745 748 void* PythonQtClassInfo::recursiveCastDownIfPossible(void* ptr, const char** resultClassName)
746 749 {
747 750 if (!_polymorphicHandlers.isEmpty()) {
748 751 Q_FOREACH(PythonQtPolymorphicHandlerCB* cb, _polymorphicHandlers) {
749 752 void* resultPtr = (*cb)(ptr, resultClassName);
750 753 if (resultPtr) {
751 754 return resultPtr;
752 755 }
753 756 }
754 757 }
755 758 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
756 759 if (!info._parent->isQObject()) {
757 760 void* resultPtr = info._parent->recursiveCastDownIfPossible((char*)ptr + info._upcastingOffset, resultClassName);
758 761 if (resultPtr) {
759 762 return resultPtr;
760 763 }
761 764 }
762 765 }
763 766 return NULL;
764 767 }
765 768
766 769 void* PythonQtClassInfo::castDownIfPossible(void* ptr, PythonQtClassInfo** resultClassInfo)
767 770 {
768 771 const char* className;
769 772 // this would do downcasting recursively...
770 773 // void* resultPtr = recursiveCastDownIfPossible(ptr, &className);
771 774
772 775 // we only do downcasting on the base object, not on the whole inheritance tree...
773 776 void* resultPtr = NULL;
774 777 if (!_polymorphicHandlers.isEmpty()) {
775 778 Q_FOREACH(PythonQtPolymorphicHandlerCB* cb, _polymorphicHandlers) {
776 779 resultPtr = (*cb)(ptr, &className);
777 780 if (resultPtr) {
778 781 break;
779 782 }
780 783 }
781 784 }
782 785 if (resultPtr) {
783 786 *resultClassInfo = PythonQt::priv()->getClassInfo(className);
784 787 } else {
785 788 *resultClassInfo = this;
786 789 resultPtr = ptr;
787 790 }
788 791 return resultPtr;
789 792 }
790 793
791 794 PyObject* PythonQtClassInfo::findEnumWrapper(const QByteArray& name, PythonQtClassInfo* localScope, bool* isLocalEnum)
792 795 {
793 796 if (isLocalEnum) {
794 797 *isLocalEnum = true;
795 798 }
796 799 int scopePos = name.lastIndexOf("::");
797 800 if (scopePos != -1) {
798 801 if (isLocalEnum) {
799 802 *isLocalEnum = false;
800 803 }
801 804 // split into scope and enum name
802 805 QByteArray enumScope = name.mid(0,scopePos);
803 806 QByteArray enumName = name.mid(scopePos+2);
804 807 PythonQtClassInfo* info = PythonQt::priv()->getClassInfo(enumScope);
805 808 if (info) {
806 809 return info->findEnumWrapper(enumName);
807 810 } else{
808 811 return NULL;
809 812 }
810 813 }
811 814 if (localScope) {
812 815 return localScope->findEnumWrapper(name);
813 816 } else {
814 817 return NULL;
815 818 }
816 819 }
817 820
818 821 void PythonQtClassInfo::createEnumWrappers(const QMetaObject* meta)
819 822 {
820 823 for (int i = meta->enumeratorOffset();i<meta->enumeratorCount();i++) {
821 824 QMetaEnum e = meta->enumerator(i);
822 825 PythonQtObjectPtr p;
823 826 p.setNewRef(PythonQtPrivate::createNewPythonQtEnumWrapper(e.name(), _pythonQtClassWrapper));
824 827 _enumWrappers.append(p);
825 828 }
826 829 }
827 830
828 831 void PythonQtClassInfo::createEnumWrappers()
829 832 {
830 833 if (!_enumsCreated) {
831 834 _enumsCreated = true;
832 835 if (_meta) {
833 836 createEnumWrappers(_meta);
834 837 }
835 838 if (decorator()) {
836 839 createEnumWrappers(decorator()->metaObject());
837 840 }
838 841 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
839 842 info._parent->createEnumWrappers();
840 843 }
841 844 }
842 845 }
843 846
844 847 PyObject* PythonQtClassInfo::findEnumWrapper(const char* name) {
845 848 // force enum creation
846 849 if (!_enumsCreated) {
847 850 createEnumWrappers();
848 851 }
849 852 Q_FOREACH(const PythonQtObjectPtr& p, _enumWrappers) {
850 853 const char* className = ((PyTypeObject*)p.object())->tp_name;
851 854 if (qstrcmp(className, name)==0) {
852 855 return p.object();
853 856 }
854 857 }
855 858 Q_FOREACH(const ParentClassInfo& info, _parentClasses) {
856 859 PyObject* p = info._parent->findEnumWrapper(name);
857 860 if (p) return p;
858 861 }
859 862 return NULL;
860 863 }
861 864
862 865 void PythonQtClassInfo::setDecoratorProvider( PythonQtQObjectCreatorFunctionCB* cb )
863 866 {
864 867 _decoratorProviderCB = cb;
865 868 _decoratorProvider = NULL;
866 869 _enumsCreated = false;
867 870 }
868 871
869 872 void PythonQtClassInfo::clearNotFoundCachedMembers()
870 873 {
871 874 // remove all not found entries, since a new decorator means new slots,
872 875 // which might have been cached as "NotFound" already.
873 876 QMutableHashIterator<QByteArray, PythonQtMemberInfo> it(_cachedMembers);
874 877 while (it.hasNext()) {
875 878 it.next();
876 879 if (it.value()._type == PythonQtMemberInfo::NotFound) {
877 880 it.remove();
878 881 }
879 882 }
880 883 }
881 884
882 885 //-------------------------------------------------------------------------
883 886
884 887 PythonQtMemberInfo::PythonQtMemberInfo( PythonQtSlotInfo* info )
885 888 {
886 889 if (info->metaMethod()->methodType() == QMetaMethod::Signal) {
887 890 _type = Signal;
888 891 } else {
889 892 _type = Slot;
890 893 }
891 894 _slot = info;
892 895 _enumValue = NULL;
893 896 }
894 897
895 898 PythonQtMemberInfo::PythonQtMemberInfo( const PythonQtObjectPtr& enumValue )
896 899 {
897 900 _type = EnumValue;
898 901 _slot = NULL;
899 902 _enumValue = enumValue;
900 903 _enumWrapper = NULL;
901 904 }
902 905
903 906 PythonQtMemberInfo::PythonQtMemberInfo( const QMetaProperty& prop )
904 907 {
905 908 _type = Property;
906 909 _slot = NULL;
907 910 _enumValue = NULL;
908 911 _property = prop;
909 912 _enumWrapper = NULL;
910 913 }
@@ -1,247 +1,255
1 1 #ifndef _PYTHONQTCLASSINFO_H
2 2 #define _PYTHONQTCLASSINFO_H
3 3
4 4 /*
5 5 *
6 6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 7 *
8 8 * This library is free software; you can redistribute it and/or
9 9 * modify it under the terms of the GNU Lesser General Public
10 10 * License as published by the Free Software Foundation; either
11 11 * version 2.1 of the License, or (at your option) any later version.
12 12 *
13 13 * This library is distributed in the hope that it will be useful,
14 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 16 * Lesser General Public License for more details.
17 17 *
18 18 * Further, this software is distributed without any warranty that it is
19 19 * free of the rightful claim of any third person regarding infringement
20 20 * or the like. Any license provided herein, whether implied or
21 21 * otherwise, applies only to this software file. Patent licenses, if
22 22 * any, provided herein do not apply to combinations of this program with
23 23 * other software, or any other product whatsoever.
24 24 *
25 25 * You should have received a copy of the GNU Lesser General Public
26 26 * License along with this library; if not, write to the Free Software
27 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 28 *
29 29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 30 * 28359 Bremen, Germany or:
31 31 *
32 32 * http://www.mevis.de
33 33 *
34 34 */
35 35
36 36 #include <QMetaObject>
37 37 #include <QMetaMethod>
38 38 #include <QHash>
39 39 #include <QByteArray>
40 40 #include <QList>
41 41 #include "PythonQt.h"
42 42
43 43 class PythonQtSlotInfo;
44 44
45 45 struct PythonQtMemberInfo {
46 46 enum Type {
47 47 Invalid, Slot, Signal, EnumValue, EnumWrapper, Property, NotFound
48 48 };
49 49
50 50 PythonQtMemberInfo():_type(Invalid),_slot(NULL),_enumWrapper(NULL),_enumValue(0) { }
51 51
52 52 PythonQtMemberInfo(PythonQtSlotInfo* info);
53 53
54 54 PythonQtMemberInfo(const PythonQtObjectPtr& enumValue);
55 55
56 56 PythonQtMemberInfo(const QMetaProperty& prop);
57 57
58 58 Type _type;
59 59
60 60 // TODO: this could be a union...
61 61 PythonQtSlotInfo* _slot;
62 62 PyObject* _enumWrapper;
63 63 PythonQtObjectPtr _enumValue;
64 64 QMetaProperty _property;
65 65 };
66 66
67 67 //! a class that stores all required information about a Qt object (and an optional associated C++ class name)
68 68 /*! for fast lookup of slots when calling the object from Python
69 69 */
70 70 class PYTHONQT_EXPORT PythonQtClassInfo {
71 71
72 72 public:
73 73 PythonQtClassInfo();
74 74 ~PythonQtClassInfo();
75 75
76 76 //! store information about parent classes
77 77 struct ParentClassInfo {
78 78 ParentClassInfo(PythonQtClassInfo* parent, int upcastingOffset=0):_parent(parent),_upcastingOffset(upcastingOffset)
79 79 {};
80 80
81 81 PythonQtClassInfo* _parent;
82 82 int _upcastingOffset;
83 83 };
84 84
85 85
86 86 //! setup as a QObject, taking the meta object as meta information about the QObject
87 87 void setupQObject(const QMetaObject* meta);
88 88
89 89 //! setup as a CPP (non-QObject), taking the classname
90 90 void setupCPPObject(const QByteArray& classname);
91 91
92 92 //! set the type capabilities
93 93 void setTypeSlots(int typeSlots) { _typeSlots = typeSlots; }
94 94 //! get the type capabilities
95 95 int typeSlots() const { return _typeSlots; }
96 96
97 97 //! get the Python method definition for a given slot name (without return type and signature)
98 98 PythonQtMemberInfo member(const char* member);
99 99
100 100 //! get access to the constructor slot (which may be overloaded if there are multiple constructors)
101 101 PythonQtSlotInfo* constructors();
102 102
103 103 //! get access to the destructor slot
104 104 PythonQtSlotInfo* destructor();
105 105
106 106 //! add a constructor, ownership is passed to classinfo
107 107 void addConstructor(PythonQtSlotInfo* info);
108 108
109 109 //! set a destructor, ownership is passed to classinfo
110 110 void setDestructor(PythonQtSlotInfo* info);
111 111
112 112 //! add a decorator slot, ownership is passed to classinfo
113 113 void addDecoratorSlot(PythonQtSlotInfo* info);
114 114
115 115 //! get the classname (either of the QObject or of the wrapped CPP object)
116 116 const char* className();
117 117
118 118 //! returns if the QObject
119 119 bool isQObject() { return _isQObject; }
120 120
121 121 //! returns if the class is a CPP wrapper
122 122 bool isCPPWrapper() { return !_isQObject; }
123 123
124 124 //! get the meta object
125 125 const QMetaObject* metaObject() { return _meta; }
126 126
127 127 //! set the meta object, this will reset the caching
128 128 void setMetaObject(const QMetaObject* meta);
129 129
130 130 //! returns if this class inherits from the given classname
131 131 bool inherits(const char* classname);
132 132
133 133 //! returns if this class inherits from the given classinfo
134 134 bool inherits(PythonQtClassInfo* info);
135 135
136 136 //! casts the given \c ptr to an object of type \c classname, returns the new pointer
137 137 //! which might be different to \c ptr due to C++ multiple inheritance
138 138 //! (if the cast is not possible or if ptr is NULL, NULL is returned)
139 139 void* castTo(void* ptr, const char* classname);
140 140
141 141 //! get help string for the metaobject
142 142 QString help();
143 143
144 144 //! get list of all properties (on QObjects only, otherwise the list is empty)
145 145 QStringList propertyList();
146 146
147 147 //! get list of all members (excluding properties, which can be listed with propertyList())
148 148 QStringList memberList();
149 149
150 150 //! get the meta type id of this class (only valid for isCPPWrapper() == true)
151 151 int metaTypeId() { return _metaTypeId; }
152 152
153 153 //! set an additional decorator provider that offers additional decorator slots for this class
154 154 void setDecoratorProvider(PythonQtQObjectCreatorFunctionCB* cb);
155 155
156 156 //! get the decorator qobject instance
157 157 QObject* decorator();
158 158
159 159 //! add the parent class info of a CPP object
160 160 void addParentClass(const ParentClassInfo& info) { _parentClasses.append(info); }
161 161
162 162 //! set the associated PythonQtClassWrapper (which handles instance creation of this type)
163 163 void setPythonQtClassWrapper(PyObject* obj) { _pythonQtClassWrapper = obj; }
164 164
165 165 //! get the associated PythonQtClassWrapper (which handles instance creation of this type)
166 166 PyObject* pythonQtClassWrapper() { return _pythonQtClassWrapper; }
167 167
168 168 //! set the shell set instance wrapper cb
169 169 void setShellSetInstanceWrapperCB(PythonQtShellSetInstanceWrapperCB* cb) {
170 170 _shellSetInstanceWrapperCB = cb;
171 171 }
172 172
173 173 //! get the shell set instance wrapper cb
174 174 PythonQtShellSetInstanceWrapperCB* shellSetInstanceWrapperCB() {
175 175 return _shellSetInstanceWrapperCB;
176 176 }
177 177
178 178 //! add a handler for polymorphic downcasting
179 179 void addPolymorphicHandler(PythonQtPolymorphicHandlerCB* cb) { _polymorphicHandlers.append(cb); }
180 180
181 181 //! cast the pointer down in the class hierarchy if a polymorphic handler allows to do that
182 182 void* castDownIfPossible(void* ptr, PythonQtClassInfo** resultClassInfo);
183 183
184 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 185 static PyObject* findEnumWrapper(const QByteArray& name, PythonQtClassInfo* localScope, bool* isLocalEnum = NULL);
186 186
187 187 //! clear all members that where cached as "NotFound"
188 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 196 private:
191 197 void createEnumWrappers();
192 198 void createEnumWrappers(const QMetaObject* meta);
193 199 PyObject* findEnumWrapper(const char* name);
194 200
195 201 //! clear all cached members
196 202 void clearCachedMembers();
197 203
198 204 void* recursiveCastDownIfPossible(void* ptr, const char** resultClassName);
199 205
200 206 PythonQtSlotInfo* findDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
201 207 void listDecoratorSlotsFromDecoratorProvider(QStringList& list, bool metaOnly);
202 208 PythonQtSlotInfo* recursiveFindDecoratorSlotsFromDecoratorProvider(const char* memberName, PythonQtSlotInfo* inputInfo, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
203 209
204 210 void recursiveCollectClassInfos(QList<PythonQtClassInfo*>& classInfoObjects);
205 211 void recursiveCollectDecoratorObjects(QList<QObject*>& decoratorObjects);
206 212
207 213 bool lookForPropertyAndCache(const char* memberName);
208 214 bool lookForMethodAndCache(const char* memberName);
209 215 bool lookForEnumAndCache(const QMetaObject* m, const char* memberName);
210 216
211 217 PythonQtSlotInfo* findDecoratorSlots(const char* memberName, int memberNameLen, PythonQtSlotInfo* tail, bool &found, QHash<QByteArray, PythonQtMemberInfo>& memberCache, int upcastingOffset);
212 218 int findCharOffset(const char* sigStart, char someChar);
213 219
214 220 QHash<QByteArray, PythonQtMemberInfo> _cachedMembers;
215 221
216 222 PythonQtSlotInfo* _constructors;
217 223 PythonQtSlotInfo* _destructor;
218 224 QList<PythonQtSlotInfo*> _decoratorSlots;
219 225
220 226 QList<PythonQtObjectPtr> _enumWrappers;
221 227
222 228 const QMetaObject* _meta;
223 229
224 230 QByteArray _wrappedClassName;
225 231 QList<ParentClassInfo> _parentClasses;
226 232
227 233 QList<PythonQtPolymorphicHandlerCB*> _polymorphicHandlers;
228 234
229 235 QObject* _decoratorProvider;
230 236 PythonQtQObjectCreatorFunctionCB* _decoratorProviderCB;
231 237
232 238 PyObject* _pythonQtClassWrapper;
233 239
234 240 PythonQtShellSetInstanceWrapperCB* _shellSetInstanceWrapperCB;
235 241
236 242 int _metaTypeId;
237 243 int _typeSlots;
238 244
239 245 bool _isQObject;
240 246 bool _enumsCreated;
247
248 QString _doc;
241 249
242 250 };
243 251
244 252 //---------------------------------------------------------------
245 253
246 254
247 255 #endif
@@ -1,504 +1,504
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtClassWrapper.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtClassWrapper.h"
43 43 #include <QObject>
44 44
45 45 #include "PythonQt.h"
46 46 #include "PythonQtSlot.h"
47 47 #include "PythonQtSignal.h"
48 48 #include "PythonQtClassInfo.h"
49 49 #include "PythonQtConversion.h"
50 50 #include "PythonQtInstanceWrapper.h"
51 51
52 52 static PyObject* PythonQtInstanceWrapper_invert(PythonQtInstanceWrapper* wrapper)
53 53 {
54 54 PyObject* result = NULL;
55 55 static QByteArray memberName = "__invert__";
56 56 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
57 57 if (opSlot._type == PythonQtMemberInfo::Slot) {
58 58 result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, NULL, NULL, wrapper->_wrappedPtr);
59 59 }
60 60 return result;
61 61 }
62 62
63 63 static int PythonQtInstanceWrapper_nonzero(PythonQtInstanceWrapper* wrapper)
64 64 {
65 65 int result = (wrapper->_wrappedPtr == NULL && wrapper->_obj == NULL)?0:1;
66 66 if (result) {
67 67 static QByteArray memberName = "__nonzero__";
68 68 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(memberName);
69 69 if (opSlot._type == PythonQtMemberInfo::Slot) {
70 70 PyObject* resultObj = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, NULL, NULL, wrapper->_wrappedPtr);
71 71 if (resultObj == Py_False) {
72 72 result = 0;
73 73 }
74 74 Py_XDECREF(resultObj);
75 75 }
76 76 }
77 77 return result;
78 78 }
79 79
80 80
81 81 static PyObject* PythonQtInstanceWrapper_binaryfunc(PyObject* self, PyObject* other, const QByteArray& opName, const QByteArray& fallbackOpName = QByteArray())
82 82 {
83 83 // since we disabled type checking, we can receive any object as self, but we currently only support
84 84 // different objects on the right. Otherwise we would need to generate __radd__ etc. methods.
85 85 if (!PyObject_TypeCheck(self, &PythonQtInstanceWrapper_Type)) {
86 86 QString error = "Unsupported operation " + opName + "(" + self->ob_type->tp_name + ", " + other->ob_type->tp_name + ")";
87 87 PyErr_SetString(PyExc_ArithmeticError, error.toLatin1().data());
88 88 return NULL;
89 89 }
90 90 PythonQtInstanceWrapper* wrapper = (PythonQtInstanceWrapper*)self;
91 91 PyObject* result = NULL;
92 92 PythonQtMemberInfo opSlot = wrapper->classInfo()->member(opName);
93 93 if (opSlot._type == PythonQtMemberInfo::Slot) {
94 94 // TODO get rid of tuple
95 95 PyObject* args = PyTuple_New(1);
96 96 Py_INCREF(other);
97 97 PyTuple_SET_ITEM(args, 0, other);
98 98 result = PythonQtSlotFunction_CallImpl(wrapper->classInfo(), wrapper->_obj, opSlot._slot, args, NULL, wrapper->_wrappedPtr);
99 99 Py_DECREF(args);
100 100 if (!result && !fallbackOpName.isEmpty()) {
101 101 // try fallback if we did not get a result
102 102 result = PythonQtInstanceWrapper_binaryfunc(self, other, fallbackOpName);
103 103 }
104 104 }
105 105 return result;
106 106 }
107 107
108 108 #define BINARY_OP(NAME) \
109 109 static PyObject* PythonQtInstanceWrapper_ ## NAME(PyObject* self, PyObject* other) \
110 110 { \
111 111 static const QByteArray opName("__" #NAME "__"); \
112 112 return PythonQtInstanceWrapper_binaryfunc(self, other, opName); \
113 113 }
114 114
115 115 #define BINARY_OP_INPLACE(NAME) \
116 116 static PyObject* PythonQtInstanceWrapper_i ## NAME(PyObject* self, PyObject* other) \
117 117 { \
118 118 static const QByteArray opName("__i" #NAME "__"); \
119 119 static const QByteArray fallbackName("__" #NAME "__"); \
120 120 return PythonQtInstanceWrapper_binaryfunc(self, other, opName, fallbackName); \
121 121 }
122 122
123 123 BINARY_OP(add)
124 124 BINARY_OP(sub)
125 125 BINARY_OP(mul)
126 126 BINARY_OP(div)
127 127 BINARY_OP(and)
128 128 BINARY_OP(or)
129 129 BINARY_OP(xor)
130 130 BINARY_OP(mod)
131 131 BINARY_OP(lshift)
132 132 BINARY_OP(rshift)
133 133
134 134 BINARY_OP_INPLACE(add)
135 135 BINARY_OP_INPLACE(sub)
136 136 BINARY_OP_INPLACE(mul)
137 137 BINARY_OP_INPLACE(div)
138 138 BINARY_OP_INPLACE(and)
139 139 BINARY_OP_INPLACE(or)
140 140 BINARY_OP_INPLACE(xor)
141 141 BINARY_OP_INPLACE(mod)
142 142 BINARY_OP_INPLACE(lshift)
143 143 BINARY_OP_INPLACE(rshift)
144 144
145 145 static void initializeSlots(PythonQtClassWrapper* wrap)
146 146 {
147 147 int typeSlots = wrap->classInfo()->typeSlots();
148 148 if (typeSlots) {
149 149 if (typeSlots & PythonQt::Type_Add) {
150 150 wrap->_base.as_number.nb_add = (binaryfunc)PythonQtInstanceWrapper_add;
151 151 }
152 152 if (typeSlots & PythonQt::Type_Subtract) {
153 153 wrap->_base.as_number.nb_subtract = (binaryfunc)PythonQtInstanceWrapper_sub;
154 154 }
155 155 if (typeSlots & PythonQt::Type_Multiply) {
156 156 wrap->_base.as_number.nb_multiply = (binaryfunc)PythonQtInstanceWrapper_mul;
157 157 }
158 158 if (typeSlots & PythonQt::Type_Divide) {
159 159 #ifndef PY3K
160 160 wrap->_base.as_number.nb_divide = (binaryfunc)PythonQtInstanceWrapper_div;
161 161 #endif
162 162 wrap->_base.as_number.nb_true_divide = (binaryfunc)PythonQtInstanceWrapper_div;
163 163 }
164 164 if (typeSlots & PythonQt::Type_And) {
165 165 wrap->_base.as_number.nb_and = (binaryfunc)PythonQtInstanceWrapper_and;
166 166 }
167 167 if (typeSlots & PythonQt::Type_Or) {
168 168 wrap->_base.as_number.nb_or = (binaryfunc)PythonQtInstanceWrapper_or;
169 169 }
170 170 if (typeSlots & PythonQt::Type_Xor) {
171 171 wrap->_base.as_number.nb_xor = (binaryfunc)PythonQtInstanceWrapper_xor;
172 172 }
173 173 if (typeSlots & PythonQt::Type_Mod) {
174 174 wrap->_base.as_number.nb_remainder = (binaryfunc)PythonQtInstanceWrapper_mod;
175 175 }
176 176 if (typeSlots & PythonQt::Type_LShift) {
177 177 wrap->_base.as_number.nb_lshift = (binaryfunc)PythonQtInstanceWrapper_lshift;
178 178 }
179 179 if (typeSlots & PythonQt::Type_RShift) {
180 180 wrap->_base.as_number.nb_rshift = (binaryfunc)PythonQtInstanceWrapper_rshift;
181 181 }
182 182
183 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 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 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 192 if (typeSlots & PythonQt::Type_InplaceDivide) {
193 193 #ifndef PY3K
194 194 wrap->_base.as_number.nb_inplace_divide = (binaryfunc)PythonQtInstanceWrapper_idiv;
195 195 #endif
196 196 wrap->_base.as_number.nb_inplace_true_divide = (binaryfunc)PythonQtInstanceWrapper_idiv;
197 197 }
198 198 if (typeSlots & PythonQt::Type_InplaceAnd) {
199 199 wrap->_base.as_number.nb_inplace_and = (binaryfunc)PythonQtInstanceWrapper_iand;
200 200 }
201 201 if (typeSlots & PythonQt::Type_InplaceOr) {
202 202 wrap->_base.as_number.nb_inplace_or = (binaryfunc)PythonQtInstanceWrapper_ior;
203 203 }
204 204 if (typeSlots & PythonQt::Type_InplaceXor) {
205 205 wrap->_base.as_number.nb_inplace_xor = (binaryfunc)PythonQtInstanceWrapper_ixor;
206 206 }
207 207 if (typeSlots & PythonQt::Type_InplaceMod) {
208 208 wrap->_base.as_number.nb_inplace_remainder = (binaryfunc)PythonQtInstanceWrapper_imod;
209 209 }
210 210 if (typeSlots & PythonQt::Type_InplaceLShift) {
211 211 wrap->_base.as_number.nb_inplace_lshift = (binaryfunc)PythonQtInstanceWrapper_ilshift;
212 212 }
213 213 if (typeSlots & PythonQt::Type_InplaceRShift) {
214 214 wrap->_base.as_number.nb_inplace_rshift = (binaryfunc)PythonQtInstanceWrapper_irshift;
215 215 }
216 216 if (typeSlots & PythonQt::Type_Invert) {
217 217 wrap->_base.as_number.nb_invert = (unaryfunc)PythonQtInstanceWrapper_invert;
218 218 }
219 219 if (typeSlots & PythonQt::Type_NonZero) {
220 220 #ifdef PY3K
221 221 wrap->_base.as_number.nb_bool = (inquiry)PythonQtInstanceWrapper_nonzero;
222 222 #else
223 223 wrap->_base.as_number.nb_nonzero = (inquiry)PythonQtInstanceWrapper_nonzero;
224 224 #endif
225 225 }
226 226 }
227 227 }
228 228
229 229 static PyObject* PythonQtClassWrapper_alloc(PyTypeObject *self, Py_ssize_t nitems)
230 230 {
231 231 // call the default type alloc
232 232 PyObject* obj = PyType_Type.tp_alloc(self, nitems);
233 233
234 234 // take current class type, if we are called via newPythonQtClassWrapper()
235 235 PythonQtClassWrapper* wrap = (PythonQtClassWrapper*)obj;
236 236 wrap->_classInfo = PythonQt::priv()->currentClassInfoForClassWrapperCreation();
237 237 if (wrap->_classInfo) {
238 238 initializeSlots(wrap);
239 239 }
240 240
241 241 return obj;
242 242 }
243 243
244 244
245 245 static int PythonQtClassWrapper_init(PythonQtClassWrapper* self, PyObject* args, PyObject* kwds)
246 246 {
247 247 // call the default type init
248 248 if (PyType_Type.tp_init((PyObject *)self, args, kwds) < 0) {
249 249 return -1;
250 250 }
251 251
252 252 // if we have no CPP class information, try our base class
253 253 if (!self->classInfo()) {
254 254 PyTypeObject* superType = ((PyTypeObject *)self)->tp_base;
255 255
256 256 // recursively search for PythonQtClassWrapper superclass,
257 257 // this is needed for multiple levels of inheritance in python,
258 258 // e.g.
259 259 // class MyWidgetBase(QWidget):
260 260 // ...
261 261 // class MyWidget(MyWidgetBase):
262 262 // ...
263 263 while( superType && Py_TYPE(superType) != &PythonQtClassWrapper_Type )
264 264 superType = superType->tp_base;
265 265
266 266 if (!superType || (Py_TYPE(superType) != &PythonQtClassWrapper_Type)) {
267 267 PyErr_Format(PyExc_TypeError, "type %s is not derived from PythonQtClassWrapper", ((PyTypeObject*)self)->tp_name);
268 268 return -1;
269 269 }
270 270
271 271 // take the class info from the superType
272 272 self->_classInfo = ((PythonQtClassWrapper*)superType)->classInfo();
273 273 }
274 274
275 275 return 0;
276 276 }
277 277
278 278 static PyObject *PythonQtClassWrapper_classname(PythonQtClassWrapper* type)
279 279 {
280 280 #ifdef PY3K
281 281 return PyUnicode_FromString((QString("Class_") + type->classInfo()->className()).toLatin1().data());
282 282 #else
283 283 return PyString_FromString((QString("Class_") + type->classInfo()->className()).toLatin1().data());
284 284 #endif
285 285 }
286 286
287 287 static PyObject *PythonQtClassWrapper_help(PythonQtClassWrapper* type)
288 288 {
289 289 return PythonQt::self()->helpCalled(type->classInfo());
290 290 }
291 291
292 292 PyObject *PythonQtClassWrapper_delete(PythonQtClassWrapper *type, PyObject *args)
293 293 {
294 294 Q_UNUSED(type);
295 295
296 296 Py_ssize_t argc = PyTuple_Size(args);
297 297 if (argc>0) {
298 298 PyObject* self = PyTuple_GET_ITEM(args, 0);
299 299 if (PyObject_TypeCheck(self, &PythonQtInstanceWrapper_Type)) {
300 300 return PythonQtInstanceWrapper_delete((PythonQtInstanceWrapper*)self);
301 301 }
302 302 }
303 303 return NULL;
304 304 }
305 305
306 306 PyObject *PythonQtClassWrapper_inherits(PythonQtClassWrapper *type, PyObject *args)
307 307 {
308 308 Q_UNUSED(type);
309 309 PythonQtInstanceWrapper* wrapper = NULL;
310 310 char *name = NULL;
311 311 if (!PyArg_ParseTuple(args, "O!s:PythonQtClassWrapper.inherits",&PythonQtInstanceWrapper_Type, &wrapper, &name)) {
312 312 return NULL;
313 313 }
314 314 return PythonQtConv::GetPyBool(wrapper->classInfo()->inherits(name));
315 315 }
316 316
317 317
318 318 static PyMethodDef PythonQtClassWrapper_methods[] = {
319 319 {"className", (PyCFunction)PythonQtClassWrapper_classname, METH_NOARGS,
320 320 "Return the classname of the object"
321 321 },
322 322 {"inherits", (PyCFunction)PythonQtClassWrapper_inherits, METH_VARARGS,
323 323 "Returns if the class inherits or is of given type name"
324 324 },
325 325 {"help", (PyCFunction)PythonQtClassWrapper_help, METH_NOARGS,
326 326 "Shows the help of available methods for this class"
327 327 },
328 328 {"delete", (PyCFunction)PythonQtClassWrapper_delete, METH_VARARGS,
329 329 "Deletes the given C++ object"
330 330 },
331 331 {NULL, NULL, 0 , NULL} /* Sentinel */
332 332 };
333 333
334 334
335 335 static PyObject *PythonQtClassWrapper_getattro(PyObject *obj, PyObject *name)
336 336 {
337 337 const char *attributeName;
338 338 PythonQtClassWrapper *wrapper = (PythonQtClassWrapper *)obj;
339 339
340 340 #ifdef PY3K
341 341 if ((attributeName = PyUnicode_AsUTF8(name)) == NULL) {
342 342 #else
343 343 if ((attributeName = PyString_AsString(name)) == NULL) {
344 344 #endif
345 345 return NULL;
346 346 }
347 347 if (obj == (PyObject*)&PythonQtInstanceWrapper_Type) {
348 348 return NULL;
349 349 }
350 350
351 351 if (qstrcmp(attributeName, "__dict__")==0) {
352 352 PyObject* objectDict = ((PyTypeObject *)wrapper)->tp_dict;
353 353 if (!wrapper->classInfo()) {
354 354 Py_INCREF(objectDict);
355 355 return objectDict;
356 356 }
357 357 PyObject* dict = PyDict_New();
358 358
359 359 QStringList l = wrapper->classInfo()->memberList();
360 360 Q_FOREACH (QString name, l) {
361 361 PyObject* o = PyObject_GetAttrString(obj, name.toLatin1().data());
362 362 if (o) {
363 363 PyDict_SetItemString(dict, name.toLatin1().data(), o);
364 364 Py_DECREF(o);
365 365 } else {
366 366 // it must have been a property or child, which we do not know as a class object...
367 367 PyErr_Clear();
368 368 }
369 369 }
370 370 if (wrapper->classInfo()->constructors()) {
371 371 #ifdef PY3K
372 372 PyObject* initName = PyUnicode_FromString("__init__");
373 373 #else
374 374 PyObject* initName = PyString_FromString("__init__");
375 375 #endif
376 376 PyObject* func = PyType_Type.tp_getattro(obj, initName);
377 377 Py_DECREF(initName);
378 378 PyDict_SetItemString(dict, "__init__", func);
379 379 Py_DECREF(func);
380 380 }
381 381 for (int i = 0; PythonQtClassWrapper_methods[i].ml_name != NULL; i++) {
382 382 PyObject* func = PyCFunction_New(&PythonQtClassWrapper_methods[i], obj);
383 383 PyDict_SetItemString(dict, PythonQtClassWrapper_methods[i].ml_name, func);
384 384 Py_DECREF(func);
385 385 }
386 386
387 387 PyDict_Update(dict, objectDict);
388 388 return dict;
389 389 }
390 390
391 391 // look in Python to support derived Python classes
392 392 PyObject* superAttr = PyType_Type.tp_getattro(obj, name);
393 393 if (superAttr) {
394 394 return superAttr;
395 395 }
396 396 PyErr_Clear();
397 397
398 398 if (wrapper->classInfo()) {
399 399 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
400 400 if (member._type == PythonQtMemberInfo::EnumValue) {
401 401 PyObject* enumValue = member._enumValue;
402 402 Py_INCREF(enumValue);
403 403 return enumValue;
404 404 } else if (member._type == PythonQtMemberInfo::EnumWrapper) {
405 405 PyObject* enumWrapper = member._enumWrapper;
406 406 Py_INCREF(enumWrapper);
407 407 return enumWrapper;
408 408 } else if (member._type == PythonQtMemberInfo::Slot) {
409 409 // we return all slots, even the instance slots, since they are callable as unbound slots with self argument
410 410 return PythonQtSlotFunction_New(member._slot, obj, NULL);
411 411 } else if (member._type == PythonQtMemberInfo::Signal) {
412 412 // we return all signals, even the instance signals, since they are callable as unbound signals with self argument
413 413 return PythonQtSignalFunction_New(member._slot, obj, NULL);
414 414 }
415 415 }
416 416
417 417 // look for the internal methods (className(), help())
418 418 #ifdef PY3K
419 419 PyObject* internalMethod = PyObject_GenericGetAttr(obj, name);
420 420 #else
421 421 PyObject* internalMethod = Py_FindMethod( PythonQtClassWrapper_methods, obj, (char*)attributeName);
422 422 #endif
423 423 if (internalMethod) {
424 424 return internalMethod;
425 425 }
426 426
427 427 QString error = QString(wrapper->classInfo()->className()) + " has no attribute named '" + QString(attributeName) + "'";
428 428 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
429 429 return NULL;
430 430 }
431 431
432 432 static int PythonQtClassWrapper_setattro(PyObject *obj,PyObject *name,PyObject *value)
433 433 {
434 434 return PyType_Type.tp_setattro(obj,name,value);
435 435 }
436 436
437 437 /*
438 438 static PyObject * PythonQtClassWrapper_repr(PyObject * obj)
439 439 {
440 440 PythonQtClassWrapper* wrapper = (PythonQtClassWrapper*)obj;
441 441 if (wrapper->classInfo()->isCPPWrapper()) {
442 442 const QMetaObject* meta = wrapper->classInfo()->metaObject();
443 443 if (!meta) {
444 444 QObject* decorator = wrapper->classInfo()->decorator();
445 445 if (decorator) {
446 446 meta = decorator->metaObject();
447 447 }
448 448 }
449 449 if (meta) {
450 450 return PyString_FromFormat("%s Class (C++ wrapped by %s)", wrapper->classInfo()->className(), meta->className());
451 451 } else {
452 452 return PyString_FromFormat("%s Class (C++ unwrapped)", wrapper->classInfo()->className());
453 453 }
454 454 } else {
455 455 return PyString_FromFormat("%s Class", wrapper->classInfo()->className());
456 456 }
457 457 }
458 458
459 459 */
460 460
461 461 PyTypeObject PythonQtClassWrapper_Type = {
462 462 PyVarObject_HEAD_INIT(NULL, 0)
463 463 "PythonQt.PythonQtClassWrapper", /*tp_name*/
464 464 sizeof(PythonQtClassWrapper), /*tp_basicsize*/
465 465 0, /*tp_itemsize*/
466 466 0, /*tp_dealloc*/
467 467 0, /*tp_print*/
468 468 0, /*tp_getattr*/
469 469 0, /*tp_setattr*/
470 470 0, /*tp_compare*/
471 471 0, //PythonQtClassWrapper_repr, /*tp_repr*/
472 472 0, /*tp_as_number*/
473 473 0, /*tp_as_sequence*/
474 474 0, /*tp_as_mapping*/
475 475 0, /*tp_hash */
476 476 0, /*tp_call*/
477 477 0, /*tp_str*/
478 478 PythonQtClassWrapper_getattro, /*tp_getattro*/
479 479 PythonQtClassWrapper_setattro, /*tp_setattro*/
480 480 0, /*tp_as_buffer*/
481 481 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
482 482 0, /* tp_doc */
483 483 0, /* tp_traverse */
484 484 0, /* tp_clear */
485 485 0, /* tp_richcompare */
486 486 0, /* tp_weaklistoffset */
487 487 0, /* tp_iter */
488 488 0, /* tp_iternext */
489 489 PythonQtClassWrapper_methods, /* tp_methods */
490 490 0, /* tp_members */
491 491 0, /* tp_getset */
492 492 0, /* tp_base */
493 493 0, /* tp_dict */
494 494 0, /* tp_descr_get */
495 495 0, /* tp_descr_set */
496 496 0, /* tp_dictoffset */
497 497 (initproc)PythonQtClassWrapper_init, /* tp_init */
498 498 PythonQtClassWrapper_alloc, /* tp_alloc */
499 499 0, /* tp_new */
500 500 0, /* tp_free */
501 501 };
502 502
503 503 //-------------------------------------------------------
504 504
@@ -1,190 +1,199
1 1 #ifndef _PYTHONQTMETHODINFO_H
2 2 #define _PYTHONQTMETHODINFO_H
3 3
4 4 /*
5 5 *
6 6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 7 *
8 8 * This library is free software; you can redistribute it and/or
9 9 * modify it under the terms of the GNU Lesser General Public
10 10 * License as published by the Free Software Foundation; either
11 11 * version 2.1 of the License, or (at your option) any later version.
12 12 *
13 13 * This library is distributed in the hope that it will be useful,
14 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 16 * Lesser General Public License for more details.
17 17 *
18 18 * Further, this software is distributed without any warranty that it is
19 19 * free of the rightful claim of any third person regarding infringement
20 20 * or the like. Any license provided herein, whether implied or
21 21 * otherwise, applies only to this software file. Patent licenses, if
22 22 * any, provided herein do not apply to combinations of this program with
23 23 * other software, or any other product whatsoever.
24 24 *
25 25 * You should have received a copy of the GNU Lesser General Public
26 26 * License along with this library; if not, write to the Free Software
27 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 28 *
29 29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 30 * 28359 Bremen, Germany or:
31 31 *
32 32 * http://www.mevis.de
33 33 *
34 34 */
35 35
36 36 //----------------------------------------------------------------------------------
37 37 /*!
38 38 // \file PythonQtMethodInfo.h
39 39 // \author Florian Link
40 40 // \author Last changed by $Author: florian $
41 41 // \date 2006-05
42 42 */
43 43 //----------------------------------------------------------------------------------
44 44
45 45 #include "PythonQtSystem.h"
46 46
47 47 #include <QByteArray>
48 48 #include <QHash>
49 49 #include <QList>
50 50 #include <QMetaMethod>
51 51
52 52 class PythonQtClassInfo;
53 53 struct _object;
54 54 typedef struct _object PyObject;
55 55
56 56 //! stores information about a specific signal/slot/method
57 57 class PYTHONQT_EXPORT PythonQtMethodInfo
58 58 {
59 59 public:
60 60 enum ParameterType {
61 61 Unknown = -1,
62 62 Variant = -2
63 63 };
64 64
65 65 //! stores the QVariant id (if available) and the name of the type
66 66 struct ParameterInfo {
67 67 QByteArray name;
68 68 PyObject* enumWrapper; // if it is an enum, a pointer to the enum wrapper
69 69 int typeId; // a mixture from QMetaType and ParameterType
70 70 char pointerCount; // the number of pointers indirections
71 71 bool isConst;
72 72 };
73 73
74 74 PythonQtMethodInfo() {};
75 75 ~PythonQtMethodInfo() {};
76 76 PythonQtMethodInfo(const QMetaMethod& meta, PythonQtClassInfo* classInfo);
77 77 PythonQtMethodInfo(const QByteArray& typeName, const QList<QByteArray>& args);
78 78 PythonQtMethodInfo(const PythonQtMethodInfo& other) {
79 79 _parameters = other._parameters;
80 80 }
81 81
82 82 //! returns the method info of the signature, uses a cache internally to speed up
83 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 84 static const PythonQtMethodInfo* getCachedMethodInfo(const QMetaMethod& method, PythonQtClassInfo* classInfo);
85 85
86 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 87 static const PythonQtMethodInfo* getCachedMethodInfoFromArgumentList(int numArgs, const char** args);
88 88
89 89 //! cleanup the cache
90 90 static void cleanupCachedMethodInfos();
91 91
92 92 //! returns the number of parameters including the return value
93 93 int parameterCount() const { return _parameters.size(); };
94 94
95 95 //! returns the id for the given type (using an internal dictionary)
96 96 static int nameToType(const char* name);
97 97
98 98 //! get the parameter infos
99 99 const QList<ParameterInfo>& parameters() const { return _parameters; }
100 100
101 101 //! add an alias for a typename, e.g. QObjectList and QList<QObject*>.
102 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 110 protected:
105 111 static void fillParameterInfo(ParameterInfo& type, const QByteArray& name, PythonQtClassInfo* classInfo);
106 112
107 113 static QHash<QByteArray, int> _parameterTypeDict;
108 114 static QHash<QByteArray, QByteArray> _parameterNameAliases;
109 115
110 116 //! stores the cached signatures of methods to speedup mapping from Qt to Python types
111 117 static QHash<QByteArray, PythonQtMethodInfo*> _cachedSignatures;
112 118
113 119 QList<ParameterInfo> _parameters;
120
121 //! stores the docstring
122 QString _doc;
114 123 };
115 124
116 125 //! stores information about a slot, including a next pointer to overloaded slots
117 126 class PythonQtSlotInfo : public PythonQtMethodInfo
118 127 {
119 128 public:
120 129 enum Type {
121 130 MemberSlot, InstanceDecorator, ClassDecorator
122 131 };
123 132
124 133 PythonQtSlotInfo(const PythonQtSlotInfo& info):PythonQtMethodInfo() {
125 134 _meta = info._meta;
126 135 _parameters = info._parameters;
127 136 _slotIndex = info._slotIndex;
128 137 _next = NULL;
129 138 _decorator = info._decorator;
130 139 _type = info._type;
131 140 _upcastingOffset = 0;
132 141 }
133 142
134 143 PythonQtSlotInfo(PythonQtClassInfo* classInfo, const QMetaMethod& meta, int slotIndex, QObject* decorator = NULL, Type type = MemberSlot ):PythonQtMethodInfo()
135 144 {
136 145 const PythonQtMethodInfo* info = getCachedMethodInfo(meta, classInfo);
137 146 _meta = meta;
138 147 _parameters = info->parameters();
139 148 _slotIndex = slotIndex;
140 149 _next = NULL;
141 150 _decorator = decorator;
142 151 _type = type;
143 152 _upcastingOffset = 0;
144 153 }
145 154
146 155
147 156 public:
148 157
149 158 void deleteOverloadsAndThis();
150 159
151 160 const QMetaMethod* metaMethod() const { return &_meta; }
152 161
153 162 void setUpcastingOffset(int upcastingOffset) { _upcastingOffset = upcastingOffset; }
154 163
155 164 int upcastingOffset() const { return _upcastingOffset; }
156 165
157 166 //! get the index of the slot (needed for qt_metacall)
158 167 int slotIndex() const { return _slotIndex; }
159 168
160 169 //! get next overloaded slot (which has the same name)
161 170 PythonQtSlotInfo* nextInfo() const { return _next; }
162 171
163 172 //! set the next overloaded slot
164 173 void setNextInfo(PythonQtSlotInfo* next) { _next = next; }
165 174
166 175 //! returns if the slot is a decorator slot
167 176 bool isInstanceDecorator() { return _decorator!=NULL && _type == InstanceDecorator; }
168 177
169 178 //! returns if the slot is a constructor slot
170 179 bool isClassDecorator() { return _decorator!=NULL && _type == ClassDecorator; }
171 180
172 181 QObject* decorator() { return _decorator; }
173 182
174 183 //! get the full signature including return type
175 184 QString fullSignature();
176 185
177 186 //! get the short slot name
178 187 QByteArray slotName();
179 188
180 189 private:
181 190 int _slotIndex;
182 191 PythonQtSlotInfo* _next;
183 192 QObject* _decorator;
184 193 Type _type;
185 194 QMetaMethod _meta;
186 195 int _upcastingOffset;
187 196 };
188 197
189 198
190 199 #endif
@@ -1,731 +1,733
1 1 /*
2 2 *
3 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtSlot.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQt.h"
43 43 #include "PythonQtSlot.h"
44 44 #include "PythonQtInstanceWrapper.h"
45 45 #include "PythonQtClassInfo.h"
46 46 #include "PythonQtMisc.h"
47 47 #include "PythonQtConversion.h"
48 48 #include <iostream>
49 49
50 50 #include <exception>
51 51 #include <stdexcept>
52 52
53 53 #include <QByteArray>
54 54
55 55 #define PYTHONQT_MAX_ARGS 32
56 56
57 57
58 58 bool PythonQtCallSlot(PythonQtClassInfo* classInfo, QObject* objectToCall, PyObject* args, bool strict, PythonQtSlotInfo* info, void* firstArgument, PyObject** pythonReturnValue, void** directReturnValuePointer)
59 59 {
60 60 static unsigned int recursiveEntry = 0;
61 61
62 62 if (directReturnValuePointer) {
63 63 *directReturnValuePointer = NULL;
64 64 }
65 65 // store the current storage position, so that we can get back to this state after a slot is called
66 66 // (do this locally, so that we have all positions on the stack
67 67 PythonQtValueStoragePosition globalValueStoragePos;
68 68 PythonQtValueStoragePosition globalPtrStoragePos;
69 69 PythonQtValueStoragePosition globalVariantStoragePos;
70 70 PythonQtConv::global_valueStorage.getPos(globalValueStoragePos);
71 71 PythonQtConv::global_ptrStorage.getPos(globalPtrStoragePos);
72 72 PythonQtConv::global_variantStorage.getPos(globalVariantStoragePos);
73 73
74 74 recursiveEntry++;
75 75
76 76 // the arguments that are passed to qt_metacall
77 77 void* argList[PYTHONQT_MAX_ARGS];
78 78 PyObject* result = NULL;
79 79 int argc = info->parameterCount();
80 80 const QList<PythonQtSlotInfo::ParameterInfo>& params = info->parameters();
81 81
82 82 const PythonQtSlotInfo::ParameterInfo& returnValueParam = params.at(0);
83 83 // set return argument to NULL
84 84 argList[0] = NULL;
85 85
86 86 bool ok = true;
87 87 bool skipFirst = false;
88 88 if (info->isInstanceDecorator()) {
89 89 skipFirst = true;
90 90
91 91 // for decorators on CPP objects, we take the cpp ptr, for QObjects we take the QObject pointer
92 92 void* arg1 = firstArgument;
93 93 if (!arg1) {
94 94 arg1 = objectToCall;
95 95 }
96 96 if (arg1) {
97 97 // upcast to correct parent class
98 98 arg1 = ((char*)arg1)+info->upcastingOffset();
99 99 }
100 100
101 101 argList[1] = &arg1;
102 102 if (ok) {
103 103 for (int i = 2; i<argc && ok; i++) {
104 104 const PythonQtSlotInfo::ParameterInfo& param = params.at(i);
105 105 argList[i] = PythonQtConv::ConvertPythonToQt(param, PyTuple_GET_ITEM(args, i-2), strict, classInfo);
106 106 if (argList[i]==NULL) {
107 107 ok = false;
108 108 break;
109 109 }
110 110 }
111 111 }
112 112 } else {
113 113 for (int i = 1; i<argc && ok; i++) {
114 114 const PythonQtSlotInfo::ParameterInfo& param = params.at(i);
115 115 argList[i] = PythonQtConv::ConvertPythonToQt(param, PyTuple_GET_ITEM(args, i-1), strict, classInfo);
116 116 if (argList[i]==NULL) {
117 117 ok = false;
118 118 break;
119 119 }
120 120 }
121 121 }
122 122
123 123 if (ok) {
124 124 // parameters are ok, now create the qt return value which is assigned to by metacall
125 125 if (returnValueParam.typeId != QMetaType::Void) {
126 126 // create empty default value for the return value
127 127 if (!directReturnValuePointer) {
128 128 // create empty default value for the return value
129 129 argList[0] = PythonQtConv::CreateQtReturnValue(returnValueParam);
130 130 if (argList[0]==NULL) {
131 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 132 // pass its internal pointer
133 133 PythonQtClassInfo* info = PythonQt::priv()->getClassInfo(returnValueParam.name);
134 134 if (info && info->pythonQtClassWrapper()) {
135 135 PyObject* emptyTuple = PyTuple_New(0);
136 136 // 1) default construct an empty object as python object (owned by PythonQt), by calling the meta class with empty arguments
137 137 result = PyObject_Call((PyObject*)info->pythonQtClassWrapper(), emptyTuple, NULL);
138 138 if (result) {
139 139 argList[0] = ((PythonQtInstanceWrapper*)result)->_wrappedPtr;
140 140 }
141 141 Py_DECREF(emptyTuple);
142 142 }
143 143 }
144 144 } else {
145 145 // we can use our pointer directly!
146 146 argList[0] = directReturnValuePointer;
147 147 }
148 148 }
149 149
150 150
151 151 PythonQt::ProfilingCB* profilingCB = PythonQt::priv()->profilingCB();
152 152 if (profilingCB) {
153 153 const char* className = NULL;
154 154 if (info->decorator()) {
155 155 className = info->decorator()->metaObject()->className();
156 156 } else {
157 157 className = objectToCall->metaObject()->className();
158 158 }
159 159
160 160 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
161 161 profilingCB(PythonQt::Enter, className, info->metaMethod()->methodSignature());
162 162 #else
163 163 profilingCB(PythonQt::Enter, className, info->metaMethod()->signature());
164 164 #endif
165 165 }
166 166
167 167 // invoke the slot via metacall
168 168 bool hadException = false;
169 169 QObject* obj = info->decorator()?info->decorator():objectToCall;
170 170 if (!obj) {
171 171 hadException = true;
172 172 PyErr_SetString(PyExc_RuntimeError, "Trying to call a slot on a deleted QObject!");
173 173 } else {
174 174 try {
175 175 obj->qt_metacall(QMetaObject::InvokeMetaMethod, info->slotIndex(), argList);
176 176 } catch (std::bad_alloc & e) {
177 177 hadException = true;
178 178 QByteArray what("std::bad_alloc: ");
179 179 what += e.what();
180 180 PyErr_SetString(PyExc_MemoryError, what.constData());
181 181 } catch (std::runtime_error & e) {
182 182 hadException = true;
183 183 QByteArray what("std::runtime_error: ");
184 184 what += e.what();
185 185 PyErr_SetString(PyExc_RuntimeError, what.constData());
186 186 } catch (std::logic_error & e) {
187 187 hadException = true;
188 188 QByteArray what("std::logic_error: ");
189 189 what += e.what();
190 190 PyErr_SetString(PyExc_RuntimeError, what.constData());
191 191 } catch (std::exception& e) {
192 192 hadException = true;
193 193 QByteArray what("std::exception: ");
194 194 what += e.what();
195 195 #ifdef PY3K
196 196 PyErr_SetString(PyExc_RuntimeError, what.constData());
197 197 #else
198 198 PyErr_SetString(PyExc_StandardError, what.constData());
199 199 #endif
200 200 }
201 201 }
202 202
203 203 if (profilingCB) {
204 204 profilingCB(PythonQt::Leave, NULL, NULL);
205 205 }
206 206
207 207 // handle the return value (which in most cases still needs to be converted to a Python object)
208 208 if (!hadException) {
209 209 if (argList[0] || returnValueParam.typeId == QMetaType::Void) {
210 210 if (directReturnValuePointer) {
211 211 result = NULL;
212 212 } else {
213 213 // the resulting object maybe present already, because we created it above at 1)...
214 214 if (!result) {
215 215 result = PythonQtConv::ConvertQtValueToPython(returnValueParam, argList[0]);
216 216 }
217 217 }
218 218 } else {
219 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 220 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
221 221 result = NULL;
222 222 }
223 223 } else {
224 224 result = NULL;
225 225 }
226 226 }
227 227 recursiveEntry--;
228 228
229 229 // reset the parameter storage position to the stored pos to "pop" the parameter stack
230 230 PythonQtConv::global_valueStorage.setPos(globalValueStoragePos);
231 231 PythonQtConv::global_ptrStorage.setPos(globalPtrStoragePos);
232 232 PythonQtConv::global_variantStorage.setPos(globalVariantStoragePos);
233 233
234 234 *pythonReturnValue = result;
235 235 // NOTE: it is important to only return here, otherwise the stack will not be popped!!!
236 236 return result || (directReturnValuePointer && *directReturnValuePointer);
237 237 }
238 238
239 239 //-----------------------------------------------------------------------------------
240 240
241 241 static PythonQtSlotFunctionObject *pythonqtslot_free_list = NULL;
242 242
243 243 PyObject *PythonQtSlotFunction_Call(PyObject *func, PyObject *args, PyObject *kw)
244 244 {
245 245 PythonQtSlotFunctionObject* f = (PythonQtSlotFunctionObject*)func;
246 246 return PythonQtMemberFunction_Call(f->m_ml, f->m_self, args, kw);
247 247 }
248 248
249 249 PyObject *PythonQtMemberFunction_Call(PythonQtSlotInfo* info, PyObject* m_self, PyObject *args, PyObject *kw)
250 250 {
251 251 if (PyObject_TypeCheck(m_self, &PythonQtInstanceWrapper_Type)) {
252 252 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*) m_self;
253 253 if (!info->isClassDecorator() && (self->_obj==NULL && self->_wrappedPtr==NULL)) {
254 254 QString error = QString("Trying to call '") + info->slotName() + "' on a destroyed " + self->classInfo()->className() + " object";
255 255 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
256 256 return NULL;
257 257 } else {
258 258 return PythonQtSlotFunction_CallImpl(self->classInfo(), self->_obj, info, args, kw, self->_wrappedPtr);
259 259 }
260 260 } else if (m_self->ob_type == &PythonQtClassWrapper_Type) {
261 261 PythonQtClassWrapper* type = (PythonQtClassWrapper*) m_self;
262 262 if (info->isClassDecorator()) {
263 263 return PythonQtSlotFunction_CallImpl(type->classInfo(), NULL, info, args, kw);
264 264 } else {
265 265 // otherwise, it is an unbound call and we have an instanceDecorator or normal slot...
266 266 Py_ssize_t argc = PyTuple_Size(args);
267 267 if (argc>0) {
268 268 PyObject* firstArg = PyTuple_GET_ITEM(args, 0);
269 269 if (PyObject_TypeCheck(firstArg, (PyTypeObject*)&PythonQtInstanceWrapper_Type)
270 270 && ((PythonQtInstanceWrapper*)firstArg)->classInfo()->inherits(type->classInfo())) {
271 271 PythonQtInstanceWrapper* self = (PythonQtInstanceWrapper*)firstArg;
272 272 if (!info->isClassDecorator() && (self->_obj==NULL && self->_wrappedPtr==NULL)) {
273 273 QString error = QString("Trying to call '") + info->slotName() + "' on a destroyed " + self->classInfo()->className() + " object";
274 274 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
275 275 return NULL;
276 276 }
277 277 // strip the first argument...
278 278 PyObject* newargs = PyTuple_GetSlice(args, 1, argc);
279 279 PyObject* result = PythonQtSlotFunction_CallImpl(self->classInfo(), self->_obj, info, newargs, kw, self->_wrappedPtr);
280 280 Py_DECREF(newargs);
281 281 return result;
282 282 } else {
283 283 // first arg is not of correct type!
284 284 QString error = "slot " + info->fullSignature() + " requires " + type->classInfo()->className() + " instance as first argument, got " + firstArg->ob_type->tp_name;
285 285 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
286 286 return NULL;
287 287 }
288 288 } else {
289 289 // wrong number of args
290 290 QString error = "slot " + info->fullSignature() + " requires " + type->classInfo()->className() + " instance as first argument.";
291 291 PyErr_SetString(PyExc_ValueError, error.toLatin1().data());
292 292 return NULL;
293 293 }
294 294 }
295 295 }
296 296 return NULL;
297 297 }
298 298
299 299 PyObject *PythonQtSlotFunction_CallImpl(PythonQtClassInfo* classInfo, QObject* objectToCall, PythonQtSlotInfo* info, PyObject *args, PyObject * /*kw*/, void* firstArg, void** directReturnValuePointer)
300 300 {
301 301 int argc = args?PyTuple_Size(args):0;
302 302
303 303 #ifdef PYTHONQT_DEBUG
304 304 std::cout << "called " << info->metaMethod()->typeName() << " " << info->metaMethod()->signature() << std::endl;
305 305 #endif
306 306
307 307 PyObject* r = NULL;
308 308 bool ok = false;
309 309 if (directReturnValuePointer) {
310 310 *directReturnValuePointer = NULL;
311 311 }
312 312 if (info->nextInfo()) {
313 313 // overloaded slot call, try on all slots with strict conversion first
314 314 bool strict = true;
315 315 PythonQtSlotInfo* i = info;
316 316 while (i) {
317 317 bool skipFirst = i->isInstanceDecorator();
318 318 if (i->parameterCount()-1-(skipFirst?1:0) == argc) {
319 319 PyErr_Clear();
320 320 ok = PythonQtCallSlot(classInfo, objectToCall, args, strict, i, firstArg, &r, directReturnValuePointer);
321 321 if (PyErr_Occurred() || ok) break;
322 322 }
323 323 i = i->nextInfo();
324 324 if (!i) {
325 325 if (strict) {
326 326 // one more run without being strict
327 327 strict = false;
328 328 i = info;
329 329 }
330 330 }
331 331 }
332 332 if (!ok && !PyErr_Occurred()) {
333 333 QString e = QString("Could not find matching overload for given arguments:\n" + PythonQtConv::PyObjGetString(args) + "\n The following slots are available:\n");
334 334 PythonQtSlotInfo* i = info;
335 335 while (i) {
336 336 e += QString(i->fullSignature()) + "\n";
337 337 i = i->nextInfo();
338 338 }
339 339 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
340 340 }
341 341 } else {
342 342 // simple (non-overloaded) slot call
343 343 bool skipFirst = info->isInstanceDecorator();
344 344 if (info->parameterCount()-1-(skipFirst?1:0) == argc) {
345 345 PyErr_Clear();
346 346 ok = PythonQtCallSlot(classInfo, objectToCall, args, false, info, firstArg, &r, directReturnValuePointer);
347 347 if (!ok && !PyErr_Occurred()) {
348 348 QString e = QString("Called ") + info->fullSignature() + " with wrong arguments: " + PythonQtConv::PyObjGetString(args);
349 349 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
350 350 }
351 351 } else {
352 352 QString e = QString("Called ") + info->fullSignature() + " with wrong number of arguments: " + PythonQtConv::PyObjGetString(args);
353 353 PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
354 354 }
355 355 }
356 356
357 357 return r;
358 358 }
359 359
360 360 PyObject *
361 361 PythonQtSlotFunction_New(PythonQtSlotInfo *ml, PyObject *self, PyObject *module)
362 362 {
363 363 PythonQtSlotFunctionObject *op;
364 364 op = pythonqtslot_free_list;
365 365 if (op != NULL) {
366 366 pythonqtslot_free_list = (PythonQtSlotFunctionObject *)(op->m_self);
367 367 PyObject_INIT(op, &PythonQtSlotFunction_Type);
368 368 }
369 369 else {
370 370 op = PyObject_GC_New(PythonQtSlotFunctionObject, &PythonQtSlotFunction_Type);
371 371 if (op == NULL)
372 372 return NULL;
373 373 }
374 374 op->m_ml = ml;
375 375 Py_XINCREF(self);
376 376 op->m_self = self;
377 377 Py_XINCREF(module);
378 378 op->m_module = module;
379 379 PyObject_GC_Track(op);
380 380 return (PyObject *)op;
381 381 }
382 382
383 383 PythonQtSlotInfo*
384 384 PythonQtSlotFunction_GetSlotInfo(PyObject *op)
385 385 {
386 386 if (!PythonQtSlotFunction_Check(op)) {
387 387 PyErr_Format(PyExc_SystemError, "%s:%d: bad argument to internal function", __FILE__, __LINE__);
388 388 return NULL;
389 389 }
390 390 return ((PythonQtSlotFunctionObject *)op) -> m_ml;
391 391 }
392 392
393 393 PyObject *
394 394 PythonQtSlotFunction_GetSelf(PyObject *op)
395 395 {
396 396 if (!PythonQtSlotFunction_Check(op)) {
397 397 PyErr_Format(PyExc_SystemError, "%s:%d: bad argument to internal function", __FILE__, __LINE__);
398 398 return NULL;
399 399 }
400 400 return ((PythonQtSlotFunctionObject *)op) -> m_self;
401 401 }
402 402
403 403 /* Methods (the standard built-in methods, that is) */
404 404
405 405 static void
406 406 meth_dealloc(PythonQtSlotFunctionObject *m)
407 407 {
408 408 PyObject_GC_UnTrack(m);
409 409 Py_XDECREF(m->m_self);
410 410 Py_XDECREF(m->m_module);
411 411 m->m_self = (PyObject *)pythonqtslot_free_list;
412 412 pythonqtslot_free_list = m;
413 413 }
414 414
415 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 420 Py_INCREF(Py_None);
419 421 return Py_None;
420 422 }
421 423
422 424 static PyObject *
423 425 meth_get__name__(PythonQtSlotFunctionObject *m, void * /*closure*/)
424 426 {
425 427 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
426 428 #ifdef PY3K
427 429 return PyUnicode_FromString(m->m_ml->metaMethod()->methodSignature());
428 430 #else
429 431 return PyString_FromString(m->m_ml->metaMethod()->methodSignature());
430 432 #endif
431 433 #else
432 434 #ifdef PY3K
433 435 return PyUnicode_FromString(m->m_ml->metaMethod()->signature());
434 436 #else
435 437 return PyString_FromString(m->m_ml->metaMethod()->signature());
436 438 #endif
437 439 #endif
438 440 }
439 441
440 442 static int
441 443 meth_traverse(PythonQtSlotFunctionObject *m, visitproc visit, void *arg)
442 444 {
443 445 int err;
444 446 if (m->m_self != NULL) {
445 447 err = visit(m->m_self, arg);
446 448 if (err)
447 449 return err;
448 450 }
449 451 if (m->m_module != NULL) {
450 452 err = visit(m->m_module, arg);
451 453 if (err)
452 454 return err;
453 455 }
454 456 return 0;
455 457 }
456 458
457 459 static PyObject *
458 460 meth_get__self__(PythonQtSlotFunctionObject *m, void * /*closure*/)
459 461 {
460 462 PyObject *self;
461 463 #ifndef PY3K
462 464 if (PyEval_GetRestricted()) {
463 465 PyErr_SetString(PyExc_RuntimeError,
464 466 "method.__self__ not accessible in restricted mode");
465 467 return NULL;
466 468 }
467 469 #endif
468 470 self = m->m_self;
469 471 if (self == NULL)
470 472 self = Py_None;
471 473 Py_INCREF(self);
472 474 return self;
473 475 }
474 476
475 477 static PyGetSetDef meth_getsets [] = {
476 478 {const_cast<char*>("__doc__"), (getter)meth_get__doc__, NULL, NULL},
477 479 {const_cast<char*>("__name__"), (getter)meth_get__name__, NULL, NULL},
478 480 {const_cast<char*>("__self__"), (getter)meth_get__self__, NULL, NULL},
479 481 {NULL, NULL, NULL,NULL},
480 482 };
481 483
482 484 #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 6
483 485 #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
484 486 #endif
485 487
486 488 #define OFF(x) offsetof(PythonQtSlotFunctionObject, x)
487 489
488 490 static PyMemberDef meth_members[] = {
489 491 {const_cast<char*>("__module__"), T_OBJECT, OFF(m_module), PY_WRITE_RESTRICTED},
490 492 {NULL}
491 493 };
492 494
493 495 static PyObject *PythonQtSlotFunction_parameterTypes(PythonQtSlotFunctionObject* type)
494 496 {
495 497 return PythonQtMemberFunction_parameterTypes(type->m_ml);
496 498 }
497 499
498 500 static PyObject *PythonQtSlotFunction_parameterNames(PythonQtSlotFunctionObject* type)
499 501 {
500 502 return PythonQtMemberFunction_parameterNames(type->m_ml);
501 503 }
502 504
503 505 static PyObject *PythonQtSlotFunction_typeName(PythonQtSlotFunctionObject* type)
504 506 {
505 507 return PythonQtMemberFunction_typeName(type->m_ml);
506 508 }
507 509
508 510 PyObject *PythonQtMemberFunction_parameterTypes(PythonQtSlotInfo* theInfo)
509 511 {
510 512 PythonQtSlotInfo* info = theInfo;
511 513 int count = 0;
512 514 while (info) {
513 515 info = info->nextInfo();
514 516 count++;
515 517 }
516 518 info = theInfo;
517 519 PyObject* result = PyTuple_New(count);
518 520 for (int j = 0;j<count;j++) {
519 521 QList<QByteArray> types = info->metaMethod()->parameterTypes();
520 522 PyObject* tuple = PyTuple_New(types.count());
521 523 for (int i = 0; i<types.count();i++) {
522 524 #ifdef PY3K
523 525 PyTuple_SET_ITEM(tuple, i, PyUnicode_FromString(types.at(i).constData()));
524 526 #else
525 527 PyTuple_SET_ITEM(tuple, i, PyString_FromString(types.at(i).constData()));
526 528 #endif
527 529 }
528 530 info = info->nextInfo();
529 531 PyTuple_SET_ITEM(result, j, tuple);
530 532 }
531 533 return result;
532 534 }
533 535
534 536 PyObject *PythonQtMemberFunction_parameterNames(PythonQtSlotInfo* theInfo)
535 537 {
536 538 PythonQtSlotInfo* info = theInfo;
537 539 int count = 0;
538 540 while (info) {
539 541 info = info->nextInfo();
540 542 count++;
541 543 }
542 544 info = theInfo;
543 545 PyObject* result = PyTuple_New(count);
544 546 for (int j = 0;j<count;j++) {
545 547 QList<QByteArray> names = info->metaMethod()->parameterNames();
546 548 PyObject* tuple = PyTuple_New(names.count());
547 549 for (int i = 0; i<names.count();i++) {
548 550 #ifdef PY3K
549 551 PyTuple_SET_ITEM(tuple, i, PyUnicode_FromString(names.at(i).constData()));
550 552 #else
551 553 PyTuple_SET_ITEM(tuple, i, PyString_FromString(names.at(i).constData()));
552 554 #endif
553 555 }
554 556 info = info->nextInfo();
555 557 PyTuple_SET_ITEM(result, j, tuple);
556 558 }
557 559 return result;
558 560 }
559 561
560 562 PyObject *PythonQtMemberFunction_typeName(PythonQtSlotInfo* theInfo)
561 563 {
562 564 PythonQtSlotInfo* info = theInfo;
563 565 int count = 0;
564 566 while (info) {
565 567 info = info->nextInfo();
566 568 count++;
567 569 }
568 570 info = theInfo;
569 571 PyObject* result = PyTuple_New(count);
570 572 for (int j = 0;j<count;j++) {
571 573 QByteArray name = info->metaMethod()->typeName();
572 574 #ifdef PY3K
573 575 PyTuple_SET_ITEM(result, j, PyUnicode_FromString(name.constData()));
574 576 #else
575 577 PyTuple_SET_ITEM(result, j, PyString_FromString(name.constData()));
576 578 #endif
577 579 info = info->nextInfo();
578 580 }
579 581 return result;
580 582 }
581 583
582 584 static PyMethodDef meth_methods[] = {
583 585 {"parameterTypes", (PyCFunction)PythonQtSlotFunction_parameterTypes, METH_NOARGS,
584 586 "Returns a tuple of tuples of the C++ parameter types for all overloads of the slot"
585 587 },
586 588 {"parameterNames", (PyCFunction)PythonQtSlotFunction_parameterNames, METH_NOARGS,
587 589 "Returns a tuple of tuples of the C++ parameter type names (if available), for all overloads of the slot"
588 590 },
589 591 {"typeName", (PyCFunction)PythonQtSlotFunction_typeName, METH_NOARGS,
590 592 "Returns a tuple of the C++ return value types of each slot overload"
591 593 },
592 594 {NULL, NULL, 0 , NULL} /* Sentinel */
593 595 };
594 596
595 597 static PyObject *
596 598 meth_repr(PythonQtSlotFunctionObject *f)
597 599 {
598 600 if (f->m_self->ob_type == &PythonQtClassWrapper_Type) {
599 601 PythonQtClassWrapper* self = (PythonQtClassWrapper*) f->m_self;
600 602 #ifdef PY3K
601 603 return PyUnicode_FromFormat("<unbound qt slot %s of %s type>",
602 604 #else
603 605 return PyString_FromFormat("<unbound qt slot %s of %s type>",
604 606 #endif
605 607 f->m_ml->slotName().data(),
606 608 self->classInfo()->className());
607 609 } else {
608 610 #ifdef PY3K
609 611 return PyUnicode_FromFormat("<qt slot %s of %s instance at %p",
610 612 #else
611 613 return PyString_FromFormat("<qt slot %s of %s instance at %p>",
612 614 #endif
613 615 f->m_ml->slotName().data(),
614 616 f->m_self->ob_type->tp_name,
615 617 f->m_self);
616 618 }
617 619 }
618 620
619 621 static int
620 622 meth_compare(PythonQtSlotFunctionObject *a, PythonQtSlotFunctionObject *b)
621 623 {
622 624 if (a->m_self != b->m_self)
623 625 return (a->m_self < b->m_self) ? -1 : 1;
624 626 if (a->m_ml == b->m_ml)
625 627 return 0;
626 628 #if( QT_VERSION >= QT_VERSION_CHECK(5,0,0) )
627 629 if (strcmp(a->m_ml->metaMethod()->methodSignature(), b->m_ml->metaMethod()->methodSignature()) < 0)
628 630 #else
629 631 if (strcmp(a->m_ml->metaMethod()->signature(), b->m_ml->metaMethod()->signature()) < 0)
630 632 #endif
631 633 return -1;
632 634 else
633 635 return 1;
634 636 }
635 637
636 638 static long
637 639 meth_hash(PythonQtSlotFunctionObject *a)
638 640 {
639 641 long x,y;
640 642 if (a->m_self == NULL)
641 643 x = 0;
642 644 else {
643 645 x = PyObject_Hash(a->m_self);
644 646 if (x == -1)
645 647 return -1;
646 648 }
647 649 y = _Py_HashPointer((void*)(a->m_ml));
648 650 if (y == -1)
649 651 return -1;
650 652 x ^= y;
651 653 if (x == -1)
652 654 x = -2;
653 655 return x;
654 656 }
655 657
656 658 // for python 3.x
657 659 static PyObject*
658 660 meth_richcompare(PythonQtSlotFunctionObject *a, PythonQtSlotFunctionObject *b, int op)
659 661 {
660 662 int x = meth_compare(a, b);
661 663 bool r;
662 664 if (op == Py_LT)
663 665 r = x < 0;
664 666 else if (op == Py_LE)
665 667 r = x < 1;
666 668 else if (op == Py_EQ)
667 669 r = x == 0;
668 670 else if (op == Py_NE)
669 671 r = x != 0;
670 672 else if (op == Py_GE)
671 673 r = x > -1;
672 674 else if (op == Py_GT)
673 675 r = x > 0;
674 676 if (r)
675 677 Py_RETURN_TRUE;
676 678 else
677 679 Py_RETURN_FALSE;
678 680 }
679 681
680 682
681 683 PyTypeObject PythonQtSlotFunction_Type = {
682 684 PyVarObject_HEAD_INIT(&PyType_Type, 0)
683 685 "builtin_qt_slot",
684 686 sizeof(PythonQtSlotFunctionObject),
685 687 0,
686 688 (destructor)meth_dealloc, /* tp_dealloc */
687 689 0, /* tp_print */
688 690 0, /* tp_getattr */
689 691 0, /* tp_setattr */
690 692 #ifdef PY3K
691 693 0,
692 694 #else
693 695 (cmpfunc)meth_compare, /* tp_compare */
694 696 #endif
695 697 (reprfunc)meth_repr, /* tp_repr */
696 698 0, /* tp_as_number */
697 699 0, /* tp_as_sequence */
698 700 0, /* tp_as_mapping */
699 701 (hashfunc)meth_hash, /* tp_hash */
700 702 PythonQtSlotFunction_Call, /* tp_call */
701 703 0, /* tp_str */
702 704 PyObject_GenericGetAttr, /* tp_getattro */
703 705 0, /* tp_setattro */
704 706 0, /* tp_as_buffer */
705 707 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
706 708 0, /* tp_doc */
707 709 (traverseproc)meth_traverse, /* tp_traverse */
708 710 0, /* tp_clear */
709 711 (richcmpfunc)meth_richcompare, /* tp_richcompare */
710 712 0, /* tp_weaklistoffset */
711 713 0, /* tp_iter */
712 714 0, /* tp_iternext */
713 715 meth_methods, /* tp_methods */
714 716 meth_members, /* tp_members */
715 717 meth_getsets, /* tp_getset */
716 718 0, /* tp_base */
717 719 0, /* tp_dict */
718 720 };
719 721
720 722 /* Clear out the free list */
721 723
722 724 void
723 725 PythonQtSlotFunction_Fini(void)
724 726 {
725 727 while (pythonqtslot_free_list) {
726 728 PythonQtSlotFunctionObject *v = pythonqtslot_free_list;
727 729 pythonqtslot_free_list = (PythonQtSlotFunctionObject *)(v->m_self);
728 730 PyObject_GC_Del(v);
729 731 }
730 732 }
731 733
@@ -1,52 +1,36
1 1 # --------- PythonQt profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6
7 7 TARGET = PythonQt
8 8 TEMPLATE = lib
9 9
10 10
11 11 DESTDIR = ../lib
12 12
13 CONFIG += qt dll
13 CONFIG += qt
14 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 25 contains(QT_MAJOR_VERSION, 5) {
17 26 QT += widgets
18 27 }
19 28
20 29 mac {
21 30 OTHER_FILES += ../scripts/osx-fix-dylib.sh
22 31 }
23 32
24 33 include ( ../build/common.prf )
25 34 include ( ../build/python.prf )
26 35
27 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 3 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
4 4 *
5 5 * This library is free software; you can redistribute it and/or
6 6 * modify it under the terms of the GNU Lesser General Public
7 7 * License as published by the Free Software Foundation; either
8 8 * version 2.1 of the License, or (at your option) any later version.
9 9 *
10 10 * This library is distributed in the hope that it will be useful,
11 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 13 * Lesser General Public License for more details.
14 14 *
15 15 * Further, this software is distributed without any warranty that it is
16 16 * free of the rightful claim of any third person regarding infringement
17 17 * or the like. Any license provided herein, whether implied or
18 18 * otherwise, applies only to this software file. Patent licenses, if
19 19 * any, provided herein do not apply to combinations of this program with
20 20 * other software, or any other product whatsoever.
21 21 *
22 22 * You should have received a copy of the GNU Lesser General Public
23 23 * License along with this library; if not, write to the Free Software
24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 25 *
26 26 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
27 27 * 28359 Bremen, Germany or:
28 28 *
29 29 * http://www.mevis.de
30 30 *
31 31 */
32 32
33 33 //----------------------------------------------------------------------------------
34 34 /*!
35 35 // \file PythonQtTests.cpp
36 36 // \author Florian Link
37 37 // \author Last changed by $Author: florian $
38 38 // \date 2006-05
39 39 */
40 40 //----------------------------------------------------------------------------------
41 41
42 42 #include "PythonQtTests.h"
43 43
44 44 void PythonQtTestSlotCalling::initTestCase()
45 45 {
46 46 _helper = new PythonQtTestSlotCallingHelper(this);
47 47 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
48 48 main.evalScript("import PythonQt");
49 49 PythonQt::self()->addObject(main, "obj", _helper);
50 50 }
51 51
52 52 void PythonQtTestSlotCalling::init() {
53 53
54 54 }
55 55
56 56
57 57 void* polymorphic_ClassB_Handler(const void* ptr, const char** className) {
58 58 ClassB* o = (ClassB*)ptr;
59 59 if (o->type()==2) {
60 60 *className = "ClassB";
61 61 return (ClassB*)o;
62 62 }
63 63 if (o->type()==3) {
64 64 *className = "ClassC";
65 65 return (ClassC*)o;
66 66 }
67 67 if (o->type()==4) {
68 68 *className = "ClassD";
69 69 return (ClassD*)o;
70 70 }
71 71 return NULL;
72 72 }
73 73
74 74 void PythonQtTestSlotCalling::testInheritance() {
75 75 PythonQt::self()->registerCPPClass("ClassA",NULL,NULL, PythonQtCreateObject<ClassAWrapper>);
76 76 PythonQt::self()->registerCPPClass("ClassB",NULL,NULL, PythonQtCreateObject<ClassBWrapper>);
77 77 PythonQt::self()->registerCPPClass("ClassC",NULL,NULL, PythonQtCreateObject<ClassCWrapper>);
78 78 PythonQt::self()->addParentClass("ClassC", "ClassA", PythonQtUpcastingOffset<ClassC,ClassA>());
79 79 PythonQt::self()->addParentClass("ClassC", "ClassB", PythonQtUpcastingOffset<ClassC,ClassB>());
80 80 PythonQt::self()->registerClass(&ClassD::staticMetaObject, NULL, PythonQtCreateObject<ClassDWrapper>);
81 81 PythonQt::self()->addParentClass("ClassD", "ClassA", PythonQtUpcastingOffset<ClassD,ClassA>());
82 82 PythonQt::self()->addParentClass("ClassD", "ClassB", PythonQtUpcastingOffset<ClassD,ClassB>());
83 83
84 84 PythonQtObjectPtr classA = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassA");
85 85 PythonQtObjectPtr classB = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassB");
86 86 PythonQtObjectPtr classC = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassC");
87 87 PythonQtObjectPtr classD = PythonQt::self()->getMainModule().getVariable("PythonQt.private.ClassD");
88 88 QVERIFY(classA);
89 89 QVERIFY(classB);
90 90 QVERIFY(classC);
91 91 QVERIFY(classD);
92 92
93 93 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
94 94 QEXPECT_FAIL("", "ClassB can not be converted to ClassA", Continue);
95 95 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
96 96 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
97 97 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassAPtr(a).getX()==1: obj.setPassed();\n"));
98 98
99 99 QEXPECT_FAIL("", "ClassA can not be converted to ClassB", Continue);
100 100 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
101 101 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
102 102 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
103 103 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassBPtr(a).getY()==2: obj.setPassed();\n"));
104 104
105 105 QEXPECT_FAIL("", "ClassA can not be converted to ClassC", Continue);
106 106 QVERIFY(_helper->runScript("a = PythonQt.private.ClassA();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
107 107 QEXPECT_FAIL("", "ClassB can not be converted to ClassC", Continue);
108 108 QVERIFY(_helper->runScript("a = PythonQt.private.ClassB();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
109 109 QVERIFY(_helper->runScript("a = PythonQt.private.ClassC();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
110 110 QEXPECT_FAIL("", "ClassD can not be converted to ClassC", Continue);
111 111 QVERIFY(_helper->runScript("a = PythonQt.private.ClassD();\nif obj.getClassCPtr(a).getX()==1: obj.setPassed();\n"));
112 112
113 113 QVERIFY(_helper->runScript("if type(obj.createClassA())==PythonQt.private.ClassA: obj.setPassed();\n"));
114 114 QVERIFY(_helper->runScript("if type(obj.createClassB())==PythonQt.private.ClassB: obj.setPassed();\n"));
115 115 QVERIFY(_helper->runScript("if type(obj.createClassCAsA())==PythonQt.private.ClassA: obj.setPassed();\n"));
116 116 QVERIFY(_helper->runScript("if type(obj.createClassCAsB())==PythonQt.private.ClassB: obj.setPassed();\n"));
117 117 QVERIFY(_helper->runScript("if type(obj.createClassD())==PythonQt.private.ClassD: obj.setPassed();\n"));
118 118 QVERIFY(_helper->runScript("if type(obj.createClassDAsA())==PythonQt.private.ClassA: obj.setPassed();\n"));
119 119 QVERIFY(_helper->runScript("if type(obj.createClassDAsB())==PythonQt.private.ClassB: obj.setPassed();\n"));
120 120
121 121 PythonQt::self()->addPolymorphicHandler("ClassB", polymorphic_ClassB_Handler);
122 122
123 123 QVERIFY(_helper->runScript("if type(obj.getClassBPtr(obj.createClassB()))==PythonQt.private.ClassB: obj.setPassed();\n"));
124 124 QVERIFY(_helper->runScript("if type(obj.createClassCAsB())==PythonQt.private.ClassC: obj.setPassed();\n"));
125 125 QVERIFY(_helper->runScript("if type(obj.createClassDAsB())==PythonQt.private.ClassD: obj.setPassed();\n"));
126 126
127 127 }
128 128
129 129 void PythonQtTestSlotCalling::testAutoConversion() {
130 130 QVERIFY(_helper->runScript("if obj.setAutoConvertColor(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QColor(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
131 131 QVERIFY(_helper->runScript("if obj.setAutoConvertBrush(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QBrush(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
132 132 QVERIFY(_helper->runScript("if obj.setAutoConvertPen(PythonQt.QtCore.Qt.red)==PythonQt.Qt.QPen(PythonQt.QtCore.Qt.red): obj.setPassed();\n"));
133 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 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 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 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 139 void PythonQtTestSlotCalling::testNoArgSlotCall()
140 140 {
141 141 QVERIFY(_helper->runScript("obj.testNoArg(); obj.setPassed();\n"));
142 142 }
143 143
144 144 void PythonQtTestSlotCalling::testOverloadedCall()
145 145 {
146 146 QVERIFY(_helper->runScript("obj.overload(False); obj.setPassed();\n", 0));
147 147 QVERIFY(_helper->runScript("obj.overload(True); obj.setPassed();\n", 0));
148 148 QVERIFY(_helper->runScript("obj.overload(12.5); obj.setPassed();\n", 1));
149 149 QVERIFY(_helper->runScript("obj.overload(12); obj.setPassed();\n", 2));
150 150 QVERIFY(_helper->runScript("obj.overload('test'); obj.setPassed();\n", 3));
151 151 QVERIFY(_helper->runScript("obj.overload(u'test'); obj.setPassed();\n", 3));
152 152 QVERIFY(_helper->runScript("obj.overload(('test','test2')); obj.setPassed();\n", 4));
153 153 QVERIFY(_helper->runScript("obj.overload(obj); obj.setPassed();\n", 5));
154 154 QVERIFY(_helper->runScript("obj.overload(12,13); obj.setPassed();\n", 6));
155 155 }
156 156
157 157 void PythonQtTestSlotCalling::testPyObjectSlotCall()
158 158 {
159 159 QVERIFY(_helper->runScript("if obj.getPyObject(PythonQt)==PythonQt: obj.setPassed();\n"));
160 160 QVERIFY(_helper->runScript("if obj.getPyObject('Hello')=='Hello': obj.setPassed();\n"));
161 161 QVERIFY(_helper->runScript("if obj.getPyObjectFromVariant(PythonQt)==PythonQt: obj.setPassed();\n"));
162 162 QVERIFY(_helper->runScript("if obj.getPyObjectFromVariant2(PythonQt)==PythonQt: obj.setPassed();\n"));
163 163 // QVERIFY(_helper->runScript("if obj.getPyObjectFromPtr(PythonQt)==PythonQt: obj.setPassed();\n"));
164 164 }
165 165
166 166 void PythonQtTestSlotCalling::testCPPSlotCalls()
167 167 {
168 168 // test QColor compare operation
169 169 QVERIFY(_helper->runScript("if PythonQt.QtGui.QColor(1,2,3)==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();obj.testNoArg()\n"));
170 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 172 // test passing/returning QColors
173 173 QVERIFY(_helper->runScript("if obj.getQColor1(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
174 174 QVERIFY(_helper->runScript("if obj.getQColor2(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
175 175 QVERIFY(_helper->runScript("if obj.getQColor3(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
176 176 QVERIFY(_helper->runScript("if obj.getQColor4(PythonQt.QtGui.QColor(1,2,3))==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
177 177 QVERIFY(_helper->runScript("if obj.getQColor5()==PythonQt.QtGui.QColor(1,2,3): obj.setPassed();\n"));
178 178 }
179 179
180 180 void PythonQtTestSlotCalling::testPODSlotCalls()
181 181 {
182 182 QVERIFY(_helper->runScript("if obj.getBool(False)==False: obj.setPassed();\n"));
183 183 QVERIFY(_helper->runScript("if obj.getBool(True)==True: obj.setPassed();\n"));
184 184 QVERIFY(_helper->runScript("if obj.getInt(-42)==-42: obj.setPassed();\n"));
185 185 QVERIFY(_helper->runScript("if obj.getUInt(42)==42: obj.setPassed();\n"));
186 186 QVERIFY(_helper->runScript("if obj.getShort(-43)==-43: obj.setPassed();\n"));
187 187 QVERIFY(_helper->runScript("if obj.getUShort(43)==43: obj.setPassed();\n"));
188 188 QVERIFY(_helper->runScript("if obj.getChar(-12)==-12: obj.setPassed();\n"));
189 189 QVERIFY(_helper->runScript("if obj.getUChar(12)==12: obj.setPassed();\n"));
190 190 QVERIFY(_helper->runScript("if obj.getLong(-256*256*256)==-256*256*256: obj.setPassed();\n"));
191 191 QVERIFY(_helper->runScript("if obj.getULong(256*256*256)==256*256*256: obj.setPassed();\n"));
192 192 QVERIFY(_helper->runScript("if obj.getLongLong(-42)==-42: obj.setPassed();\n"));
193 193 QVERIFY(_helper->runScript("if obj.getULongLong(42)==42: obj.setPassed();\n"));
194 194 QVERIFY(_helper->runScript("if obj.getQChar(4096)==4096: obj.setPassed();\n"));
195 195 QVERIFY(_helper->runScript("if obj.getDouble(47.12)==47.12: obj.setPassed();\n"));
196 196 QVERIFY(_helper->runScript("if abs(obj.getFloat(47.11)-47.11)<0.01: obj.setPassed();\n"));
197 197 QVERIFY(_helper->runScript("if obj.getQString('testStr')=='testStr': obj.setPassed();\n"));
198 198 QVERIFY(_helper->runScript("if obj.getQString('')=='': obj.setPassed();\n"));
199 199 QVERIFY(_helper->runScript("if obj.getQStringList(('test','test2'))==('test','test2'): obj.setPassed();\n"));
200 200 }
201 201
202 202 void PythonQtTestSlotCalling::testQVariantSlotCalls()
203 203 {
204 204 QVERIFY(_helper->runScript("if obj.getQVariant(-42)==-42: obj.setPassed();\n"));
205 205 QVERIFY(_helper->runScript("if obj.getQVariant('testStr')=='testStr': obj.setPassed();\n"));
206 206 QVERIFY(_helper->runScript("if obj.getQVariant(('test','test2'))==('test','test2'): obj.setPassed();\n"));
207 207 QVERIFY(_helper->runScript("if obj.getQVariant(('test',12, 47.11))==('test',12, 47.11): obj.setPassed();\n"));
208 208 QVERIFY(_helper->runScript("if obj.getQVariant({'test':'bla','test2':47.11})=={'test':'bla','test2':47.11}: obj.setPassed();\n"));
209 209 QEXPECT_FAIL("", "Testing to pass a map and compare with a different map", Continue);
210 210 QVERIFY(_helper->runScript("if obj.getQVariant({'test':'bla2','test2':47.11})=={'test':'bla','test2':47.11}: obj.setPassed();\n"));
211 211 QVERIFY(_helper->runScript("if obj.getQVariant(obj)==obj: obj.setPassed();\n"));
212 212 }
213 213
214 214 void PythonQtTestSlotCalling::testObjectSlotCalls()
215 215 {
216 216 QVERIFY(_helper->runScript("if obj.getQObject(obj)==obj: obj.setPassed();\n"));
217 217 QVERIFY(_helper->runScript("if obj.getTestObject(obj)==obj: obj.setPassed();\n"));
218 218 QVERIFY(_helper->runScript("if obj.getNewObject().className()=='PythonQtTestSlotCallingHelper': obj.setPassed();\n"));
219 219 QEXPECT_FAIL("", "Testing to pass a QObject when another object was expected", Continue);
220 220 QVERIFY(_helper->runScript("if obj.getQWidget(obj)==obj: obj.setPassed();\n"));
221 221 }
222 222
223 223 void PythonQtTestSlotCalling::testCppFactory()
224 224 {
225 225 PythonQtTestCppFactory* f = new PythonQtTestCppFactory;
226 226 PythonQt::self()->addInstanceDecorators(new PQCppObjectDecorator);
227 227 // do not register, since we want to know if that works as well
228 228 //qRegisterMetaType<PQCppObjectNoWrap>("PQCppObjectNoWrap");
229 229 PythonQt::self()->addDecorators(new PQCppObjectNoWrapDecorator);
230 230
231 231 PythonQt::self()->addWrapperFactory(f);
232 232 QVERIFY(_helper->runScript("if obj.createPQCppObject(12).getHeight()==12: obj.setPassed();\n"));
233 233 QVERIFY(_helper->runScript("if obj.createPQCppObject(12).getH()==12: obj.setPassed();\n"));
234 234 QVERIFY(_helper->runScript("pq1 = obj.createPQCppObject(12);\n"
235 235 "pq2 = obj.createPQCppObject(13);\n"
236 236 "pq3 = obj.getPQCppObject(pq1);\n"
237 237 "pq4 = obj.getPQCppObject(pq2);\n"
238 238 "if pq3.getHeight()==12 and pq4.getHeight()==13: obj.setPassed();\n"
239 239 ));
240 240
241 241 QVERIFY(_helper->runScript("if obj.createPQCppObjectNoWrap(12).getH()==12: obj.setPassed();\n"));
242 242
243 243 QVERIFY(_helper->runScript("if obj.getPQCppObjectNoWrapAsValue().getH()==47: obj.setPassed();\n"));
244 244
245 245 qRegisterMetaType<PQUnknownButRegisteredValueObject>("PQUnknownButRegisteredValueObject");
246 246 QVERIFY(_helper->runScript("a = obj.getUnknownButRegisteredValueObjectAsPtr();print (a);\nif a!=None: obj.setPassed();\n"));
247 247 QVERIFY(_helper->runScript("a = obj.getUnknownButRegisteredValueObjectAsValue();print (a);\nif a!=None: obj.setPassed();\n"));
248 248 QVERIFY(_helper->runScript("a = obj.getUnknownValueObjectAsPtr();print (a);\nif a!=None: obj.setPassed();\n"));
249 249 QEXPECT_FAIL("", "Testing by value return without the object being registered as QMetaType or having registered a default constructor decorator", Continue);
250 250 QVERIFY(_helper->runScript("a = obj.getUnknownValueObjectAsValue();print (a);\nif a!=None: obj.setPassed();\n"));
251 251
252 252 // expect to get strict call to double overload
253 253 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObjectNoWrap\na = PQCppObjectNoWrap(22.2)\nif a.getH()==2: obj.setPassed();\n"));
254 254 // expect to get un-strict call to double overload
255 255 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObjectNoWrap\na = PQCppObjectNoWrap(22)\nif a.getH()==2: obj.setPassed();\n"));
256 256 // expect to get strict call to copy constructor overload
257 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 259 // test decorated enums
260 260 // already registered by signals test
261 261 //PythonQt::self()->registerCPPClass("PQCppObject2",NULL,NULL, PythonQtCreateObject<PQCppObject2Decorator>);
262 262
263 263 // local enum (decorated)
264 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 265 // enum with namespace (decorated)
266 266 QVERIFY(_helper->runScript("obj.testNoArg()\nfrom PythonQt.private import PQCppObject2\na = PQCppObject2()\nif a.testEnumFlag2(PQCppObject2.TestEnumValue2)==PQCppObject2.TestEnumValue2: obj.setPassed();\n"));
267 267 // with int overload to check overloading
268 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 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 277 return flag;
278 278 }
279 279
280 280 // with int overload
281 PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* obj, int flag) {
281 PQCppObject2Decorator::TestEnumFlag PQCppObject2Decorator::testEnumFlag3(PQCppObject2* /*obj*/, int /*flag*/) {
282 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 285 return flag;
286 286 }
287 287
288 288 void PythonQtTestSlotCalling::testMultiArgsSlotCall()
289 289 {
290 290 QVERIFY(_helper->runScript("if obj.getMultiArgs(12,47.11,'test')==(12,47.11,'test'): obj.setPassed();\n"));
291 291 }
292 292
293 293 bool PythonQtTestSlotCallingHelper::runScript(const char* script, int expectedOverload)
294 294 {
295 295 _called = false;
296 296 _passed = false;
297 297 _calledOverload = -1;
298 298 PyRun_SimpleString(script);
299 299 return _called && _passed && _calledOverload==expectedOverload;
300 300 }
301 301
302 302
303 303 void PythonQtTestSignalHandler::initTestCase()
304 304 {
305 305 _helper = new PythonQtTestSignalHandlerHelper(this);
306 306 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
307 307 PythonQt::self()->addObject(main, "obj", _helper);
308 308 }
309 309
310 310 void PythonQtTestSignalHandler::testSignalHandler()
311 311 {
312 312 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
313 313 PyRun_SimpleString("def testIntSignal(a):\n if a==12: obj.setPassed();\n");
314 314 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(intSignal(int)), main, "testIntSignal"));
315 315 QVERIFY(_helper->emitIntSignal(12));
316 316
317 317 PyRun_SimpleString("def testFloatSignal(a):\n if a==12: obj.setPassed();\n");
318 318 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(floatSignal(float)), main, "testFloatSignal"));
319 319 QVERIFY(_helper->emitFloatSignal(12));
320 320
321 321 // test decorated enums
322 322 PythonQt::self()->registerCPPClass("PQCppObject2",NULL,NULL, PythonQtCreateObject<PQCppObject2Decorator>);
323 323
324 324 PyRun_SimpleString("def testEnumSignal(a):\n if a==1: obj.setPassed();\n");
325 325 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(enumSignal(PQCppObject2::TestEnumFlag)), main, "testEnumSignal"));
326 326 QVERIFY(_helper->emitEnumSignal(PQCppObject2::TestEnumValue2));
327 327
328 328 PyRun_SimpleString("def testVariantSignal(a):\n if a==obj.expectedVariant(): obj.setPassed();\n");
329 329 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(variantSignal(QVariant)), main, "testVariantSignal"));
330 330 _helper->setExpectedVariant(QString("Test"));
331 331 QVERIFY(_helper->emitVariantSignal(QString("Test")));
332 332 _helper->setExpectedVariant(12);
333 333 QVERIFY(_helper->emitVariantSignal(12));
334 334 _helper->setExpectedVariant(QStringList() << "test1" << "test2");
335 335 QVERIFY(_helper->emitVariantSignal(QStringList() << "test1" << "test2"));
336 336 _helper->setExpectedVariant(qVariantFromValue((QObject*)_helper));
337 337 QVERIFY(_helper->emitVariantSignal(qVariantFromValue((QObject*)_helper)));
338 338
339 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 340 // intentionally not normalized signal:
341 341 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(complexSignal( int, float , const QStringList , QObject*)), main, "testComplexSignal"));
342 342 QVERIFY(_helper->emitComplexSignal(12,13,QStringList() << "test1" << "test2", _helper));
343 343
344 344 // try removing the handler
345 345 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(complexSignal( int, float , const QStringList , QObject*)), main, "testComplexSignal"));
346 346 // and emit the signal, which should fail because the handler was removed
347 347 QVERIFY(!_helper->emitComplexSignal(12,13,QStringList() << "test1" << "test2", _helper));
348 348
349 349 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(intSignal(int)), main, "testIntSignal"));
350 350 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(floatSignal(float)), main, "testFloatSignal"));
351 351 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(variantSignal(QVariant)), main, "testVariantSignal"));
352 352 QVERIFY(PythonQt::self()->removeSignalHandler(_helper, SIGNAL(enumSignal(PQCppObject2::TestEnumFlag)), main, "testEnumSignal"));
353 353
354 354 }
355 355
356 356 void PythonQtTestSignalHandler::testRecursiveSignalHandler()
357 357 {
358 358 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
359 359 PyRun_SimpleString("def testSignal1(a):\n obj.emitSignal2(a);\n");
360 360 PyRun_SimpleString("def testSignal2(a):\n obj.emitSignal3(float(a));\n");
361 361 PyRun_SimpleString("def testSignal3(a):\n if a==12: obj.setPassed();\n");
362 362 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal1(int)), main, "testSignal1"));
363 363 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal2(const QString&)), main, "testSignal2"));
364 364 QVERIFY(PythonQt::self()->addSignalHandler(_helper, SIGNAL(signal3(float)), main, "testSignal3"));
365 365 QVERIFY(_helper->emitSignal1(12));
366 366 }
367 367
368 368
369 369 void PythonQtTestApi::initTestCase()
370 370 {
371 371 _helper = new PythonQtTestApiHelper();
372 372 _main = PythonQt::self()->getMainModule();
373 373 _main.evalScript("import PythonQt");
374 374 _main.addObject("obj", _helper);
375 375 }
376 376
377 377 void PythonQtTestApi::testProperties()
378 378 {
379 379 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
380 380 // check for name alias (for backward comp to Qt3)
381 381 main.evalScript("obj.name = 'hello'");
382 382 QVERIFY(QString("hello") == main.getVariable("obj.name").toString());
383 383
384 384 main.evalScript("obj.objectName = 'hello2'");
385 385 QVERIFY(QString("hello2") == main.getVariable("obj.objectName").toString());
386 386
387 387 }
388 388
389 389 void PythonQtTestApi::testDynamicProperties()
390 390 {
391 391 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
392 392
393 393 // this fails and should fail, but how could that be tested?
394 394 // main.evalScript("obj.testProp = 1");
395 395
396 396 // create a new dynamic property
397 397 main.evalScript("obj.setProperty('testProp','testValue')");
398 398
399 399 // read the property
400 400 QVERIFY(QString("testValue") == main.getVariable("obj.testProp").toString());
401 401 // modify and read again
402 402 main.evalScript("obj.testProp = 12");
403 403 QVERIFY(12 == main.getVariable("obj.testProp").toInt());
404 404
405 405 // check if dynamic property is in dict
406 406 QVERIFY(12 == main.evalScript("obj.__dict__['testProp']", Py_eval_input).toInt());
407 407
408 408 // check if dynamic property is in introspection
409 409 QStringList l = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), "obj", PythonQt::Anything);
410 410 QVERIFY(l.contains("testProp"));
411 411
412 412 // check with None, previous value expected
413 413 main.evalScript("obj.testProp = None");
414 414 QVERIFY(12 == main.getVariable("obj.testProp").toInt());
415 415
416 416 // remove the dynamic property
417 417 main.evalScript("obj.setProperty('testProp', None)");
418 418
419 419 // check if dynamic property is really gone
420 420 QStringList l2 = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), "obj", PythonQt::Anything);
421 421 QVERIFY(!l2.contains("testProp"));
422 422
423 423 }
424 424
425 425
426 426 bool PythonQtTestApiHelper::call(const QString& function, const QVariantList& args, const QVariant& expectedResult) {
427 427 _passed = false;
428 428 QVariant r = PythonQt::self()->call(PythonQt::self()->getMainModule(), function, args);
429 429 return _passed && expectedResult==r;
430 430 }
431 431
432 432 void PythonQtTestApi::testCall()
433 433 {
434 434 PythonQtObjectPtr main = PythonQt::self()->getMainModule();
435 435
436 436 QVERIFY(qvariant_cast<QObject*>(PythonQt::self()->getVariable(main, "obj"))==_helper);
437 437
438 438 PyRun_SimpleString("def testCallNoArgs():\n obj.setPassed();\n");
439 439 QVERIFY(_helper->call("testCallNoArgs", QVariantList(), QVariant()));
440 440
441 441 PyRun_SimpleString("def testCall1(a):\n if a=='test': obj.setPassed();\n return 'test2';\n");
442 442 QVERIFY(_helper->call("testCall1", QVariantList() << QVariant("test"), QVariant(QString("test2"))));
443 443
444 444 PyRun_SimpleString("def testCall2(a, b):\n if a=='test' and b==obj: obj.setPassed();\n return obj;\n");
445 445 QVariant r = PythonQt::self()->call(PythonQt::self()->getMainModule(), "testCall2", QVariantList() << QVariant("test") << qVariantFromValue((QObject*)_helper));
446 446 QObject* p = qvariant_cast<QObject*>(r);
447 447 QVERIFY(p==_helper);
448 448 }
449 449
450 450 void PythonQtTestApi::testVariables()
451 451 {
452 452 PythonQt::self()->addObject(PythonQt::self()->getMainModule(), "someObject", _helper);
453 453 QVariant v = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject");
454 454 QObject* p = qvariant_cast<QObject*>(v);
455 455 QVERIFY(p==_helper);
456 456 // test for unset variable
457 457 QVariant v2 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject2");
458 458 QVERIFY(v2==QVariant());
459 459
460 460 PythonQt::self()->addVariable(PythonQt::self()->getMainModule(), "someValue", QStringList() << "test1" << "test2");
461 461 QVariant v3 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someValue");
462 462 QVERIFY(v3 == QVariant(QStringList() << "test1" << "test2"));
463 463
464 464 QStringList l = PythonQt::self()->introspection(PythonQt::self()->getMainModule(), QString::null, PythonQt::Variable);
465 465 QSet<QString> s;
466 466 // check that at least these three variables are set
467 467 s << "obj" << "someObject" << "someValue";
468 468 foreach (QString value, s) {
469 469 QVERIFY(l.indexOf(value)!=-1);
470 470 }
471 471
472 472 // insert a second time!
473 473 PythonQt::self()->addObject(PythonQt::self()->getMainModule(), "someObject", _helper);
474 474 // and remove
475 475 PythonQt::self()->removeVariable(PythonQt::self()->getMainModule(), "someObject");
476 476 // we expect to find no variable
477 477 QVariant v4 = PythonQt::self()->getVariable(PythonQt::self()->getMainModule(), "someObject");
478 478 QVERIFY(v4==QVariant());
479 479 }
480 480
481 481 void PythonQtTestApi::testImporter()
482 482 {
483 483 PythonQt::self()->setImporter(_helper);
484 484 PythonQt::self()->overwriteSysPath(QStringList() << "c:\\test");
485 485 PyRun_SimpleString("import bla\n");
486 486 }
487 487
488 488 void PythonQtTestApi::testQtNamespace()
489 489 {
490 490 QVERIFY(_main.getVariable("PythonQt.QtCore.Qt.red").toInt()==Qt::red);
491 491 QVERIFY(_main.getVariable("PythonQt.QtCore.Qt.FlatCap").toInt()==Qt::FlatCap);
492 492 #if( QT_VERSION < QT_VERSION_CHECK(5,0,0) )
493 493 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.escape")));
494 494 #endif
495 495 // check for an enum type wrapper
496 496 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.AlignmentFlag")));
497 497 // check for a flags type wrapper
498 498 QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.Alignment")));
499 499 }
500 500
501 501 void PythonQtTestApi::testConnects()
502 502 {
503 503 // QVERIFY((qvariant_vast<QColor>(_main.evalScript("PythonQt.Qt.QColor(PythonQt.Qt.Qt.red)" ,Py_eval_input)) == QColor(Qt::red));
504 504 //TODO: add signal/slot connect both with QObject.connect and connect
505 505 }
506 506
507 507 void PythonQtTestApi::testQColorDecorators()
508 508 {
509 509 PythonQtObjectPtr colorClass = _main.getVariable("PythonQt.QtGui.QColor");
510 510 QVERIFY(colorClass);
511 511 // verify that the class is in the correct module
512 512 QVERIFY(colorClass.getVariable("__module__") == "PythonQt.QtGui");
513 513 // test on Qt module as well:
514 514 colorClass = _main.getVariable("PythonQt.Qt.QColor");
515 515 QVERIFY(colorClass);
516 516 // constructors
517 517 QVERIFY(qvariant_cast<QColor>(colorClass.call(QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
518 518 QVERIFY(qvariant_cast<QColor>(colorClass.call()) == QColor());
519 519 QEXPECT_FAIL("", "Testing non-existing constructor", Continue);
520 520 QVERIFY(colorClass.call(QVariantList() << 1 << 2) != QVariant());
521 521
522 522 // check that enum overload is taken over int
523 523 QVERIFY(qvariant_cast<QColor>(_main.evalScript("PythonQt.Qt.QColor(PythonQt.Qt.Qt.red)" ,Py_eval_input)) == QColor(Qt::red));
524 524 // check that int overload is taken over enum
525 525 QVERIFY(qvariant_cast<QColor>(_main.evalScript("PythonQt.Qt.QColor(0x112233)" ,Py_eval_input)) == QColor(0x112233));
526 526
527 527 // check for decorated Cmyk enum value
528 528 QVERIFY(colorClass.getVariable("Cmyk").toInt() == QColor::Cmyk);
529 529 PythonQtObjectPtr staticMethod = colorClass.getVariable("fromRgb");
530 530 QVERIFY(staticMethod);
531 531 // direct call of static method via class
532 532 QVERIFY(qvariant_cast<QColor>(colorClass.call("fromRgb", QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
533 533 // direct call of static method
534 534 QVERIFY(qvariant_cast<QColor>(staticMethod.call(QVariantList() << 1 << 2 << 3)) == QColor(1,2,3));
535 535 PythonQtObjectPtr publicMethod = colorClass.getVariable("red");
536 536 QVERIFY(publicMethod);
537 537 // call with passing self in:
538 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 543 QByteArray b;
544 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 549 QByteArray b;
550 550 ok = true;
551 551 return b;
552 552 }
553 553
554 bool PythonQtTestApiHelper::exists(const QString& filename)
554 bool PythonQtTestApiHelper::exists(const QString& /*filename*/)
555 555 {
556 556 return true;
557 557 }
558 558
559 QDateTime PythonQtTestApiHelper::lastModifiedDate(const QString& filename) {
559 QDateTime PythonQtTestApiHelper::lastModifiedDate(const QString& /*filename*/) {
560 560 return QDateTime::currentDateTime();
561 561 }
562 562
563 563
564 564 void PythonQtTestApi::testRedirect()
565 565 {
566 566 connect(PythonQt::self(), SIGNAL(pythonStdOut(const QString&)), _helper, SLOT(stdOut(const QString&)));
567 567 connect(PythonQt::self(), SIGNAL(pythonStdErr(const QString&)), _helper, SLOT(stdErr(const QString&)));
568 568 PyRun_SimpleString("print ('test')\n");
569 569 }
570 570
571 571 void PythonQtTestApiHelper::stdOut(const QString& s)
572 572 {
573 573 outBuf.append(s);
574 574 QStringList x = outBuf.split("\n");
575 575 outBuf = x.takeLast();
576 576 foreach(QString s, x)
577 577 qDebug() << s;
578 578 }
579 579
580 580 void PythonQtTestApiHelper::stdErr(const QString& s)
581 581 {
582 582 errBuf.append(s);
583 583 QStringList x = errBuf.split("\n");
584 584 errBuf = x.takeLast();
585 585 foreach(QString s, x)
586 586 qDebug() << s;
587 587 }
588 588
589 589 QObject* PythonQtTestCppFactory::create(const QByteArray& name, void *ptr)
590 590 {
591 591 if (name == "PQCppObject") {
592 592 return new PQCppObjectWrapper(ptr);
593 593 }
594 594 return NULL;
595 595 }
@@ -1,517 +1,517
1 1 #ifndef _PYTHONQTTESTS_H
2 2 #define _PYTHONQTTESTS_H
3 3
4 4 /*
5 5 *
6 6 * Copyright (C) 2010 MeVis Medical Solutions AG All Rights Reserved.
7 7 *
8 8 * This library is free software; you can redistribute it and/or
9 9 * modify it under the terms of the GNU Lesser General Public
10 10 * License as published by the Free Software Foundation; either
11 11 * version 2.1 of the License, or (at your option) any later version.
12 12 *
13 13 * This library is distributed in the hope that it will be useful,
14 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 16 * Lesser General Public License for more details.
17 17 *
18 18 * Further, this software is distributed without any warranty that it is
19 19 * free of the rightful claim of any third person regarding infringement
20 20 * or the like. Any license provided herein, whether implied or
21 21 * otherwise, applies only to this software file. Patent licenses, if
22 22 * any, provided herein do not apply to combinations of this program with
23 23 * other software, or any other product whatsoever.
24 24 *
25 25 * You should have received a copy of the GNU Lesser General Public
26 26 * License along with this library; if not, write to the Free Software
27 27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 28 *
29 29 * Contact information: MeVis Medical Solutions AG, Universitaetsallee 29,
30 30 * 28359 Bremen, Germany or:
31 31 *
32 32 * http://www.mevis.de
33 33 *
34 34 */
35 35
36 36 //----------------------------------------------------------------------------------
37 37 /*!
38 38 // \file PythonQtTests.h
39 39 // \author Florian Link
40 40 // \author Last changed by $Author: florian $
41 41 // \date 2006-05
42 42 */
43 43 //----------------------------------------------------------------------------------
44 44
45 45 #include "PythonQt.h"
46 46 #include <QtTest/QtTest>
47 47 #include <QVariant>
48 48 #include "PythonQtImportFileInterface.h"
49 49 #include "PythonQtCppWrapperFactory.h"
50 50
51 51 #include <QPen>
52 52 #include <QColor>
53 53 #include <QBrush>
54 54 #include <QCursor>
55 55
56 56 class PythonQtTestSlotCallingHelper;
57 57 class PythonQtTestApiHelper;
58 58 class QWidget;
59 59
60 60 //! test the PythonQt api
61 61 class PythonQtTestApi : public QObject
62 62 {
63 63 Q_OBJECT
64 64
65 65 private slots:
66 66 void initTestCase();
67 67 void testCall();
68 68 void testVariables();
69 69 void testRedirect();
70 70 void testImporter();
71 71 void testQColorDecorators();
72 72 void testQtNamespace();
73 73 void testConnects();
74 74
75 75 void testProperties();
76 76 void testDynamicProperties();
77 77
78 78 private:
79 79 PythonQtTestApiHelper* _helper;
80 80 PythonQtObjectPtr _main;
81 81
82 82 };
83 83
84 84 class ClassA {
85 85 public:
86 86 ClassA() { x = 1; }
87 87 int x;
88 88 };
89 89
90 90 class ClassB {
91 91 public:
92 92 ClassB() { y = 2; }
93 93 int y;
94 94
95 95 virtual int type() { return 2; }
96 96 };
97 97
98 98 class ClassC : public ClassA, public ClassB {
99 99 public:
100 100 ClassC() { z = 3; }
101 101 int z;
102 102
103 103 virtual int type() { return 3; }
104 104 };
105 105
106 106 class ClassD : public QObject, public ClassA, public ClassB {
107 107 Q_OBJECT
108 108 public:
109 109 ClassD() { d = 4; }
110 110 public slots:
111 111 int getD() { return d; }
112 112 private:
113 113 int d;
114 114
115 115 virtual int type() { return 4; }
116 116 };
117 117
118 118 class ClassAWrapper : public QObject {
119 119 Q_OBJECT
120 120 public slots:
121 121 ClassA* new_ClassA() { return new ClassA; }
122 122 int getX(ClassA* o) { return o->x; }
123 123 };
124 124
125 125 class ClassBWrapper : public QObject {
126 126 Q_OBJECT
127 127 public slots:
128 128 ClassB* new_ClassB() { return new ClassB; }
129 129 int getY(ClassB* o) { return o->y; }
130 130 };
131 131
132 132 class ClassCWrapper : public QObject {
133 133 Q_OBJECT
134 134 public slots:
135 135 ClassC* new_ClassC() { return new ClassC; }
136 136 int getZ(ClassC* o) { return o->z; }
137 137 };
138 138
139 139 class ClassDWrapper : public QObject {
140 140 Q_OBJECT
141 141 public slots:
142 142 ClassD* new_ClassD() { return new ClassD; }
143 143 };
144 144
145 145
146 146 //! test the PythonQt api (helper)
147 147 class PythonQtTestApiHelper : public QObject , public PythonQtImportFileInterface
148 148 {
149 149 Q_OBJECT
150 150 public:
151 151 PythonQtTestApiHelper() {
152 152 };
153 153
154 154 bool call(const QString& function, const QVariantList& args, const QVariant& expectedResult);
155 155
156 156 virtual QByteArray readFileAsBytes(const QString& filename);
157 157
158 158 virtual QByteArray readSourceFile(const QString& filename, bool& ok);
159 159
160 160 virtual bool exists(const QString& filename);
161 161
162 162 virtual QDateTime lastModifiedDate(const QString& filename);
163 163
164 164 public slots:
165 165
166 166 //! call to set that the test has passed (from Python!)
167 167 void setPassed() { _passed = true; }
168 168
169 169 void stdOut(const QString&);
170 170 void stdErr(const QString&);
171 171
172 172 private:
173 173 QString outBuf;
174 174 QString errBuf;
175 175 bool _passed;
176 176 };
177 177
178 178
179 179 // test implementation of the wrapper factory
180 180 class PythonQtTestCppFactory : public PythonQtCppWrapperFactory
181 181 {
182 182 public:
183 183 virtual QObject* create(const QByteArray& name, void *ptr);
184 184 };
185 185
186 186 //! an cpp object to be wrapped
187 187 class PQCppObject {
188 188
189 189 public:
190 190 PQCppObject(int h) { _height = h; }
191 191
192 192 int getHeight() { return _height; }
193 193 void setHeight(int h) { _height = h; }
194 194
195 195 private:
196 196 int _height;
197 197 };
198 198
199 199 //! an qobject that wraps the existing cpp object
200 200 class PQCppObjectWrapper : public QObject {
201 201 Q_OBJECT
202 202 public:
203 203 PQCppObjectWrapper(void* ptr) {
204 204 _ptr = (PQCppObject*)ptr;
205 205 }
206 206
207 207 public slots:
208 208 int getHeight() { return _ptr->getHeight(); }
209 209 void setHeight(int h) { _ptr->setHeight(h); }
210 210
211 211 private:
212 212 PQCppObject* _ptr;
213 213 };
214 214
215 215 class PQCppObjectDecorator : public QObject {
216 216 Q_OBJECT
217 217 public slots:
218 218 int getH(PQCppObject* obj) { return obj->getHeight(); }
219 219
220 220 };
221 221
222 222 //! an cpp object to be wrapped by decorators only
223 223 class PQCppObjectNoWrap {
224 224
225 225 public:
226 226 PQCppObjectNoWrap() { _height = 0; }
227 227 PQCppObjectNoWrap(int h) { _height = h; }
228 228
229 229 int getHeight() { return _height; }
230 230 void setHeight(int h) { _height = h; }
231 231
232 232 private:
233 233 int _height;
234 234 };
235 235
236 236 class PQCppObjectNoWrapDecorator : public QObject {
237 237 Q_OBJECT
238 238
239 239 public slots:
240 240 PQCppObjectNoWrap* new_PQCppObjectNoWrap() {
241 241 return new PQCppObjectNoWrap(0);
242 242 }
243 PQCppObjectNoWrap* new_PQCppObjectNoWrap(const PQCppObjectNoWrap& other) {
243 PQCppObjectNoWrap* new_PQCppObjectNoWrap(const PQCppObjectNoWrap& /*other*/) {
244 244 return new PQCppObjectNoWrap(1);
245 245 }
246 PQCppObjectNoWrap* new_PQCppObjectNoWrap(double value) {
246 PQCppObjectNoWrap* new_PQCppObjectNoWrap(double /*value*/) {
247 247 return new PQCppObjectNoWrap(2);
248 248 }
249 249
250 250 int getH(PQCppObjectNoWrap* obj) { return obj->getHeight(); }
251 251
252 252 };
253 253
254 254
255 255 //! an cpp object that is to be wrapped by decorators only
256 256 class PQCppObject2 {
257 257
258 258 public:
259 259 enum TestEnumFlag {
260 260 TestEnumValue1 = 0,
261 261 TestEnumValue2 = 1
262 262 };
263 263
264 264 PQCppObject2() {}
265 265
266 266 };
267 267
268 268 class PQCppObject2Decorator : public QObject {
269 269 Q_OBJECT
270 270
271 271 public:
272 272 Q_ENUMS(TestEnumFlag)
273 273 Q_FLAGS(TestEnum)
274 274
275 275 enum TestEnumFlag {
276 276 TestEnumValue1 = 0,
277 277 TestEnumValue2 = 1
278 278 };
279 279
280 280 Q_DECLARE_FLAGS(TestEnum, TestEnumFlag)
281 281
282 282 public slots:
283 283 PQCppObject2* new_PQCppObject2() {
284 284 return new PQCppObject2();
285 285 }
286 286
287 287 TestEnumFlag testEnumFlag1(PQCppObject2* obj, TestEnumFlag flag);
288 288
289 289 PQCppObject2::TestEnumFlag testEnumFlag2(PQCppObject2* obj, PQCppObject2::TestEnumFlag flag);
290 290
291 291 // with int overload
292 292 TestEnumFlag testEnumFlag3(PQCppObject2* obj, int flag);
293 293 TestEnumFlag testEnumFlag3(PQCppObject2* obj, TestEnumFlag flag);
294 294
295 295 };
296 296
297 297 class PQUnknownValueObject
298 298 {
299 299 public:
300 300 PQUnknownValueObject() {};
301 301 };
302 302
303 303 class PQUnknownButRegisteredValueObject
304 304 {
305 305 public:
306 306 PQUnknownButRegisteredValueObject() {};
307 307 };
308 308
309 309 //! test the calling of slots
310 310 class PythonQtTestSlotCalling : public QObject
311 311 {
312 312 Q_OBJECT
313 313
314 314 private slots:
315 315 void initTestCase();
316 316 void init();
317 317
318 318 void testNoArgSlotCall();
319 319 void testPODSlotCalls();
320 320 void testCPPSlotCalls();
321 321 void testQVariantSlotCalls();
322 322 void testObjectSlotCalls();
323 323 void testMultiArgsSlotCall();
324 324 void testPyObjectSlotCall();
325 325 void testOverloadedCall();
326 326 void testCppFactory();
327 327 void testInheritance();
328 328 void testAutoConversion();
329 329
330 330 private:
331 331 PythonQtTestSlotCallingHelper* _helper;
332 332
333 333 };
334 334
335 335 //! helper class for slot calling test
336 336 class PythonQtTestSlotCallingHelper : public QObject
337 337 {
338 338 Q_OBJECT
339 339 public:
340 340 PythonQtTestSlotCallingHelper(PythonQtTestSlotCalling* test) {
341 341 _test = test;
342 342 };
343 343
344 344 bool runScript(const char* script, int expectedOverload = -1);
345 345
346 346 public slots:
347 347
348 348 //! call to set that the test has passed (from Python!)
349 349 void setPassed() { _passed = true; }
350 350
351 351 //! no arguments, no return value:
352 352 void testNoArg() { _called = true; }
353 353
354 354 //! overload test!
355 void overload(bool a) { _calledOverload = 0; _called = true; }
356 void overload(float a) { _calledOverload = 1; _called = true;}
357 void overload(int a) { _calledOverload = 2; _called = true;}
358 void overload(const QString& str) { _calledOverload = 3; _called = true;}
359 void overload(const QStringList& str) { _calledOverload = 4; _called = true;}
360 void overload(QObject* str) { _calledOverload = 5; _called = true;}
361 void overload(float a, int b) { _calledOverload = 6; _called = true;}
355 void overload(bool) { _calledOverload = 0; _called = true; }
356 void overload(float) { _calledOverload = 1; _called = true;}
357 void overload(int) { _calledOverload = 2; _called = true;}
358 void overload(const QString&) { _calledOverload = 3; _called = true;}
359 void overload(const QStringList&) { _calledOverload = 4; _called = true;}
360 void overload(QObject*) { _calledOverload = 5; _called = true;}
361 void overload(float, int) { _calledOverload = 6; _called = true;}
362 362
363 363 //! POD values:
364 364 int getInt(int a) { _called = true; return a; }
365 365 unsigned int getUInt(unsigned int a) { _called = true; return a; }
366 366 bool getBool(bool a) { _called = true; return a; }
367 367 char getChar(char a) { _called = true; return a; }
368 368 unsigned char getUChar(unsigned char a) { _called = true; return a; }
369 369 long getLong(long a) { _called = true; return a; }
370 370 unsigned long getULong(unsigned long a) { _called = true; return a; }
371 371 short getShort(short a) { _called = true; return a; }
372 372 unsigned short getUShort(unsigned short a) { _called = true; return a; }
373 373 QChar getQChar(QChar a) { _called = true; return a; }
374 374 qint64 getLongLong(qint64 a) { _called = true; return a; }
375 375 quint64 getULongLong(quint64 a) { _called = true; return a; }
376 376 double getDouble(double d) { _called = true; return d; }
377 377 float getFloat(float d) { _called = true; return d; }
378 378
379 379 //! important qt types:
380 380 QString getQString(const QString& s) { _called = true; return s; }
381 381 QStringList getQStringList(const QStringList& l) { _called = true; return l; }
382 382 QVariant getQVariant(const QVariant& var) { _called = true; return var; }
383 383
384 384 // QColor as representative for C++ value classes
385 385 QColor getQColor1(const QColor& var) { _called = true; return var; }
386 386 QColor getQColor2(QColor& var) { _called = true; return var; }
387 387 QColor getQColor3(QColor* col) { _called = true; return *col; }
388 388 QColor getQColor4(const QVariant& color) { _called = true; return color.value<QColor>(); }
389 389 QColor* getQColor5() { _called = true; static QColor c(1,2,3); return &c; }
390 390
391 391 PyObject* getPyObject(PyObject* obj) { _called = true; return obj; }
392 392 PyObject* getPyObjectFromVariant(const QVariant& val) { _called = true; return PythonQtObjectPtr(val); }
393 393 QVariant getPyObjectFromVariant2(const QVariant& val) { _called = true; return val; }
394 394 // this does not yet work but is not required to work:
395 395 //PyObject* getPyObjectFromPtr(const PythonQtObjectPtr& val) { _called = true; return val; };
396 396
397 397 //! testing pointer passing
398 398 PythonQtTestSlotCallingHelper* getTestObject(PythonQtTestSlotCallingHelper* obj) { _called = true; return obj; }
399 399 //! testing inheritance checking
400 400 QObject* getQObject(QObject* obj) { _called = true; return obj; }
401 401 QWidget* getQWidget(QWidget* obj) { _called = true; return obj; }
402 402 //! testing if an object that was not wrapped is wrapped earlier is wrapped correctly
403 403 QObject* getNewObject() { _called = true; return new PythonQtTestSlotCallingHelper(NULL); }
404 404
405 405 QVariantList getMultiArgs(int a, double b, const QString& str) { _called = true; return (QVariantList() << a << b << str); }
406 406
407 407 //! cpp wrapper factory test
408 408 PQCppObject* createPQCppObject(int h) { _called = true; return new PQCppObject(h); }
409 409
410 410 //! cpp wrapper factory test
411 411 PQCppObject* getPQCppObject(PQCppObject* p) { _called = true; return p; }
412 412
413 413 //! cpp wrapper factory test
414 414 PQCppObjectNoWrap* createPQCppObjectNoWrap(int h) { _called = true; return new PQCppObjectNoWrap(h); }
415 415
416 416 //! cpp wrapper factory test
417 417 PQCppObjectNoWrap* getPQCppObjectNoWrap(PQCppObjectNoWrap* p) { _called = true; return p; }
418 418
419 419 //! get a return by value PQCppObjectNoWrap
420 420 PQCppObjectNoWrap getPQCppObjectNoWrapAsValue() { _called = true; return PQCppObjectNoWrap(47); }
421 421
422 422 PQUnknownButRegisteredValueObject getUnknownButRegisteredValueObjectAsValue() { _called = true; return PQUnknownButRegisteredValueObject(); }
423 423 PQUnknownValueObject getUnknownValueObjectAsValue() { _called = true; return PQUnknownValueObject(); }
424 424
425 425 PQUnknownButRegisteredValueObject* getUnknownButRegisteredValueObjectAsPtr() { _called = true; return new PQUnknownButRegisteredValueObject(); }
426 426 PQUnknownValueObject* getUnknownValueObjectAsPtr() { _called = true; return new PQUnknownValueObject(); }
427 427
428 428 ClassA* getClassAPtr(ClassA* o) { _called = true; return o; }
429 429 ClassB* getClassBPtr(ClassB* o) { _called = true; return o; }
430 430 ClassC* getClassCPtr(ClassC* o) { _called = true; return o; }
431 431 ClassD* getClassDPtr(ClassD* o) { _called = true; return o; }
432 432
433 433 ClassA* createClassA() { _called = true; return new ClassA; }
434 434 ClassB* createClassB() { _called = true; return new ClassB; }
435 435 ClassC* createClassC() { _called = true; return new ClassC; }
436 436 ClassD* createClassD() { _called = true; return new ClassD; }
437 437 ClassA* createClassCAsA() { _called = true; return new ClassC; }
438 438 ClassB* createClassCAsB() { _called = true; return new ClassC; }
439 439 ClassA* createClassDAsA() { _called = true; return new ClassD; }
440 440 ClassB* createClassDAsB() { _called = true; return new ClassD; }
441 441
442 442 QColor setAutoConvertColor(const QColor& color) { _called = true; return color; };
443 443 QBrush setAutoConvertBrush(const QBrush& brush) { _called = true; return brush; };
444 444 QPen setAutoConvertPen(const QPen& pen) { _called = true; return pen; };
445 445 QCursor setAutoConvertCursor(const QCursor& cursor) { _called = true; return cursor; };
446 446
447 447 private:
448 448 bool _passed;
449 449 bool _called;
450 450 int _calledOverload;
451 451 PythonQtTestSlotCalling* _test;
452 452 };
453 453
454 454 class PythonQtTestSignalHandlerHelper;
455 455
456 456 //! test the connection of signals to python
457 457 class PythonQtTestSignalHandler : public QObject
458 458 {
459 459 Q_OBJECT
460 460
461 461 private slots:
462 462 void initTestCase();
463 463
464 464 void testSignalHandler();
465 465 void testRecursiveSignalHandler();
466 466
467 467 private:
468 468 PythonQtTestSignalHandlerHelper* _helper;
469 469
470 470 };
471 471
472 472 //! helper class for signal testing
473 473 class PythonQtTestSignalHandlerHelper : public QObject
474 474 {
475 475 Q_OBJECT
476 476
477 477 public:
478 478 PythonQtTestSignalHandlerHelper(PythonQtTestSignalHandler* test) {
479 479 _test = test;
480 480 };
481 481
482 482 public slots:
483 483 void setPassed() { _passed = true; }
484 484
485 485 bool emitIntSignal(int a) { _passed = false; emit intSignal(a); return _passed; };
486 486 bool emitFloatSignal(float a) { _passed = false; emit floatSignal(a); return _passed; };
487 487 bool emitEnumSignal(PQCppObject2::TestEnumFlag flag) { _passed = false; emit enumSignal(flag); return _passed; };
488 488
489 489 bool emitVariantSignal(const QVariant& v) { _passed = false; emit variantSignal(v); return _passed; };
490 490 QVariant expectedVariant() { return _v; }
491 491 void setExpectedVariant(const QVariant& v) { _v = v; }
492 492
493 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 495 bool emitSignal1(int a) { _passed = false; emit signal1(a); return _passed; };
496 496 bool emitSignal2(const QString& s) { _passed = false; emit signal2(s); return _passed; };
497 497 bool emitSignal3(float a) { _passed = false; emit signal3(a); return _passed; };
498 498
499 499 signals:
500 500 void intSignal(int);
501 501 void floatSignal(float);
502 502 void variantSignal(const QVariant& v);
503 503 void complexSignal(int a, float b, const QStringList& l, QObject* obj);
504 504 void enumSignal(PQCppObject2::TestEnumFlag flag);
505 505
506 506 void signal1(int);
507 507 void signal2(const QString&);
508 508 void signal3(float);
509 509
510 510 private:
511 511 bool _passed;
512 512 QVariant _v;
513 513
514 514 PythonQtTestSignalHandler* _test;
515 515 };
516 516
517 517 #endif
@@ -1,23 +1,39
1 1 # --------- PythonQtTest profile -------------------
2 2 # Last changed by $Author: florian $
3 3 # $Id: PythonQt.pro 35381 2006-03-16 13:05:52Z florian $
4 4 # $Source$
5 5 # --------------------------------------------------
6 6 TARGET = PythonQtTest
7 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 20 contains(QT_MAJOR_VERSION, 5) {
10 QT += testlib widgets
11 } else {
12 CONFIG += qtestlib
21 QT += widgets
13 22 }
14 23
15 include ( ../build/common.prf )
16 include ( ../build/PythonQt.prf )
17
18 24 HEADERS += \
19 25 PythonQtTests.h
20 26
21 27 SOURCES += \
22 28 PythonQtTestMain.cpp \
23 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