Compare commits
438 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f3f52a960 | ||
|
|
7220804be6 | ||
|
|
7f611d1c53 | ||
|
|
aa9e8ca7ef | ||
|
|
db40ec67b1 | ||
|
|
2b1df1698c | ||
|
|
07229012b7 | ||
|
|
933669eeb7 | ||
|
|
1be25c54bb | ||
|
|
ee602e80f1 | ||
|
|
82f4f13d27 | ||
|
|
35b252ab2b | ||
|
|
ba2510c52a | ||
|
|
45bf56e831 | ||
|
|
a698807fd0 | ||
|
|
e48aa92103 | ||
|
|
82612584c6 | ||
|
|
99b07e3221 | ||
|
|
00b1216fb9 | ||
|
|
21dc823972 | ||
|
|
2b78766cdc | ||
|
|
80c1011721 | ||
|
|
0d2705eb11 | ||
|
|
0b1eea7116 | ||
|
|
8127218741 | ||
|
|
046bccece9 | ||
|
|
bec5ca48fd | ||
|
|
75154e2f2f | ||
|
|
606a90d406 | ||
|
|
9408505a24 | ||
|
|
2e985afb3a | ||
|
|
35630f32ff | ||
|
|
30444ccab7 | ||
|
|
2aeac5e05b | ||
|
|
774223adbd | ||
|
|
959aa385f5 | ||
|
|
05431cbfc0 | ||
|
|
1abf8c6149 | ||
|
|
04be2b1ca2 | ||
|
|
fe06dba43c | ||
|
|
cef6db9548 | ||
|
|
b112512793 | ||
|
|
6e16fd86f4 | ||
|
|
40277720ae | ||
|
|
b9fd78a65f | ||
|
|
d5fd41d8ee | ||
|
|
a3628e8752 | ||
|
|
eb133c76b8 | ||
|
|
a859097f56 | ||
|
|
3546a3674f | ||
|
|
75d27311e5 | ||
|
|
ba448baf4d | ||
|
|
e1a137d33e | ||
|
|
82fc89093c | ||
|
|
29cd3b1351 | ||
|
|
5860f786a0 | ||
|
|
5ae1e6460b | ||
|
|
bf4e4cdb89 | ||
|
|
5a408b2b9d | ||
|
|
a8b02e046b | ||
|
|
7780ccddc1 | ||
|
|
ac377b7fbd | ||
|
|
63c4cb9f9e | ||
|
|
70a776c6ff | ||
|
|
f4128e89ed | ||
|
|
b552641feb | ||
|
|
c08b1ba563 | ||
|
|
0c4fbcf5ad | ||
|
|
4d90463624 | ||
|
|
a5249a70e1 | ||
|
|
3669f32af8 | ||
|
|
78e120ec02 | ||
|
|
fc331f37e3 | ||
|
|
99c62a3a09 | ||
|
|
18e0ece1c9 | ||
|
|
54e97b8e14 | ||
|
|
450d1a98a5 | ||
|
|
7fb34b3685 | ||
|
|
8ca58af304 | ||
|
|
6e95894d10 | ||
|
|
2d5207b32c | ||
|
|
206474a5a3 | ||
|
|
964eb13adf | ||
|
|
29c263eeb8 | ||
|
|
f70ff13351 | ||
|
|
a31fb14a1f | ||
|
|
84b4f2da0a | ||
|
|
99ca556810 | ||
|
|
0dd57ef4a5 | ||
|
|
645c80134f | ||
|
|
06051ca647 | ||
|
|
3590ad14d5 | ||
|
|
95dd5c0861 | ||
|
|
34f0fe99da | ||
|
|
4175398b07 | ||
|
|
9b793705fe | ||
|
|
f5669ba342 | ||
|
|
a0d7bab4be | ||
|
|
393ddb46fa | ||
|
|
13d505c9c0 | ||
|
|
9ebe4ba6af | ||
|
|
e9c7505375 | ||
|
|
ee7b26545b | ||
|
|
49ba9c9cd5 | ||
|
|
af37aaf259 | ||
|
|
011db01f65 | ||
|
|
1cc2ccbcd8 | ||
|
|
2130c2dce5 | ||
|
|
d34e154190 | ||
|
|
3b4499891c | ||
|
|
fa34fa2720 | ||
|
|
b32b614d1b | ||
|
|
a68d4b04f3 | ||
|
|
955316b5ca | ||
|
|
75bcc4dbdd | ||
|
|
aa8c4f6b2e | ||
|
|
1ccb6de499 | ||
|
|
8d9bf59fb1 | ||
|
|
2179e02862 | ||
|
|
afc0bb1fee | ||
|
|
de6a90bdcb | ||
|
|
1f013e75e3 | ||
|
|
5349174a3c | ||
|
|
cbdafab9e7 | ||
|
|
3d3dc46531 | ||
|
|
eb6145b96b | ||
|
|
101671f474 | ||
|
|
d7185772bc | ||
|
|
0c63e37820 | ||
|
|
6b3a7f904f | ||
|
|
7d35681fce | ||
|
|
a07d192625 | ||
|
|
cd1dbb0b9d | ||
|
|
1efb6aeacc | ||
|
|
db9547be72 | ||
|
|
c36b1ff7e7 | ||
|
|
df742a5905 | ||
|
|
709420df8e | ||
|
|
6700ddb9cb | ||
|
|
3fb374e271 | ||
|
|
e6b3d26d74 | ||
|
|
6cd49a79f6 | ||
|
|
8807a885e6 | ||
|
|
406293f5aa | ||
|
|
04a2f23988 | ||
|
|
13f6d71f20 | ||
|
|
a5b785fff4 | ||
|
|
1374006206 | ||
|
|
a230b243d0 | ||
|
|
2400157808 | ||
|
|
e24401e586 | ||
|
|
1d842f57a2 | ||
|
|
39c32e3712 | ||
|
|
30c19e9c41 | ||
|
|
8408da40ca | ||
|
|
96750087d9 | ||
|
|
59ab3c3049 | ||
|
|
46fc033929 | ||
|
|
a0b43fbc23 | ||
|
|
94310a7b19 | ||
|
|
d71a6a8c3a | ||
|
|
a5e20dfd75 | ||
|
|
3e69981b4b | ||
|
|
c269e0db00 | ||
|
|
1c0279fa25 | ||
|
|
1e149f3de4 | ||
|
|
741bc56e4b | ||
|
|
c8a11c179a | ||
|
|
d0ad9d27aa | ||
|
|
6da3e78014 | ||
|
|
7abf74adb9 | ||
|
|
9f73d5ecf1 | ||
|
|
e7413828a1 | ||
|
|
a0c72f28c6 | ||
|
|
f3961387a9 | ||
|
|
85f65194ef | ||
|
|
3b9481c24c | ||
|
|
40718156a6 | ||
|
|
51e9dfc428 | ||
|
|
8e7845be18 | ||
|
|
2c6a44feee | ||
|
|
a513d831cd | ||
|
|
8e0e7ef0b6 | ||
|
|
62448f99e7 | ||
|
|
ee17f8c970 | ||
|
|
d984cf24cc | ||
|
|
e39188d636 | ||
|
|
bbba1cc470 | ||
|
|
9ffb2ef542 | ||
|
|
4239b56710 | ||
|
|
f8bc57c61c | ||
|
|
9024884495 | ||
|
|
c50d08e4c8 | ||
|
|
3cd2cad128 | ||
|
|
6f8f728241 | ||
|
|
f645a79f03 | ||
|
|
2f4a1f634c | ||
|
|
e07b306bb4 | ||
|
|
7849b4262f | ||
|
|
4749d14642 | ||
|
|
26ae1259a9 | ||
|
|
78ca4c0749 | ||
|
|
02f9ca5417 | ||
|
|
189717cdb1 | ||
|
|
2bd54857ed | ||
|
|
8ce3644a13 | ||
|
|
13d9f714c5 | ||
|
|
a6f0d0cb52 | ||
|
|
fb3bae60f4 | ||
|
|
880e6a28b6 | ||
|
|
b1a1f61c64 | ||
|
|
9a7733ef8c | ||
|
|
a571d9bd98 | ||
|
|
008798b0e3 | ||
|
|
25026120a1 | ||
|
|
4c149aef4e | ||
|
|
957fa171a9 | ||
|
|
f0e364ff28 | ||
|
|
73f21eb1bb | ||
|
|
bd43c1e0b2 | ||
|
|
04a26bd3bb | ||
|
|
ca81d9a32c | ||
|
|
094de67591 | ||
|
|
b94f5359b0 | ||
|
|
97a16f10ab | ||
|
|
eedc03ebb5 | ||
|
|
17f2d83e0e | ||
|
|
2ed86dc435 | ||
|
|
8ac29700ce | ||
|
|
ee92e460f1 | ||
|
|
35168cb86a | ||
|
|
daffd9831a | ||
|
|
9c21263251 | ||
|
|
f804d84297 | ||
|
|
361c887da0 | ||
|
|
75f799872b | ||
|
|
1ab21c4b28 | ||
|
|
98ede2df71 | ||
|
|
d9482626e6 | ||
|
|
dd8de65f73 | ||
|
|
2efb33d2fc | ||
|
|
5ef2f26ec2 | ||
|
|
4305a54b42 | ||
|
|
e0cf4b000d | ||
|
|
adfaf21063 | ||
|
|
691841f829 | ||
|
|
47957530f9 | ||
|
|
a7cebb5917 | ||
|
|
0ad9c484df | ||
|
|
0298a34289 | ||
|
|
7b4d24f094 | ||
|
|
7d80ac8e29 | ||
|
|
26d6f4a39e | ||
|
|
42e149598e | ||
|
|
8eb529bda3 | ||
|
|
c3d180fdc2 | ||
|
|
b9dd824866 | ||
|
|
42c9f80b06 | ||
|
|
bda10df1da | ||
|
|
7909d294f5 | ||
|
|
f25d227d6e | ||
|
|
7fd8eba136 | ||
|
|
95d546696e | ||
|
|
2248c1b944 | ||
|
|
8fa461559c | ||
|
|
06755f06ba | ||
|
|
5a87a51c11 | ||
|
|
323b37beda | ||
|
|
0fe1c15cbf | ||
|
|
88c38236d4 | ||
|
|
8e4b414844 | ||
|
|
9b3d0b2ef2 | ||
|
|
8a50e91e6f | ||
|
|
90178e21dd | ||
|
|
6b1f0b8ca7 | ||
|
|
4e79ce7b25 | ||
|
|
ac325f24e4 | ||
|
|
d44aa5c310 | ||
|
|
2f6af8142d | ||
|
|
233c0333e6 | ||
|
|
ac767473a2 | ||
|
|
8ab8950ccc | ||
|
|
8d1e058fa1 | ||
|
|
a4ab1c7e99 | ||
|
|
2d65e48fa8 | ||
|
|
f5d4b6e678 | ||
|
|
ee80967d24 | ||
|
|
7b4968abab | ||
|
|
b52148fd85 | ||
|
|
fa118ae670 | ||
|
|
709895f2fb | ||
|
|
295b965d3c | ||
|
|
d7269670ee | ||
|
|
c19ab39cbf | ||
|
|
1b1a83dc30 | ||
|
|
87977cc320 | ||
|
|
3270dde028 | ||
|
|
a44fcc6dba | ||
|
|
43a8f4089e | ||
|
|
f2c537eeaa | ||
|
|
9ca80b5d3a | ||
|
|
e17795d35b | ||
|
|
2a43919024 | ||
|
|
4af09f10ad | ||
|
|
3c3caf154e | ||
|
|
5112a89ca9 | ||
|
|
1a65a287fb | ||
|
|
1f6e877f8d | ||
|
|
629c0c383b | ||
|
|
c5fffa6f24 | ||
|
|
286f9c6d09 | ||
|
|
9a4c439d7f | ||
|
|
a4d7d8f80d | ||
|
|
1cce4bafd3 | ||
|
|
08a0298fe0 | ||
|
|
9284703855 | ||
|
|
bcba2a3b32 | ||
|
|
b9679215b8 | ||
|
|
7f533799d4 | ||
|
|
f7a2ab3d66 | ||
|
|
6a83c87283 | ||
|
|
1a3418c8d1 | ||
|
|
3b026ad4c9 | ||
|
|
50e6f7671d | ||
|
|
499051fd2a | ||
|
|
fb6186d270 | ||
|
|
0d9a584a1c | ||
|
|
530a3d23c5 | ||
|
|
8243565f81 | ||
|
|
867c2bd259 | ||
|
|
ae02222d57 | ||
|
|
a78108efe3 | ||
|
|
7e1b76e054 | ||
|
|
b5331e5c56 | ||
|
|
c8111dc99a | ||
|
|
85947c03d9 | ||
|
|
b8fcead629 | ||
|
|
ed0d9cf820 | ||
|
|
814bc522ce | ||
|
|
fb9fdba329 | ||
|
|
0f6a504dfb | ||
|
|
efdedcdd01 | ||
|
|
4d014eaa80 | ||
|
|
a1cf8f03b2 | ||
|
|
5151af6de1 | ||
|
|
d3894ed861 | ||
|
|
932d9bced9 | ||
|
|
fb9c1a97fe | ||
|
|
753d2bd1f6 | ||
|
|
53e649629b | ||
|
|
6383832408 | ||
|
|
ed1c0014f9 | ||
|
|
32681f7b70 | ||
|
|
15dd2e07ed | ||
|
|
3774752f0c | ||
|
|
269e8450dc | ||
|
|
374e2fcf88 | ||
|
|
da1759fe98 | ||
|
|
39a5a09145 | ||
|
|
ea83c5e554 | ||
|
|
f9587fcad2 | ||
|
|
27b53151bf | ||
|
|
eb0d211417 | ||
|
|
a38db0fe03 | ||
|
|
d0d4ba1564 | ||
|
|
249a87808a | ||
|
|
bc9ddff514 | ||
|
|
9d6d30cb6a | ||
|
|
7810dcd829 | ||
|
|
e8c0ba238a | ||
|
|
4b6cc4d478 | ||
|
|
db4d324497 | ||
|
|
7144634e35 | ||
|
|
25264046e8 | ||
|
|
ecbc9ebcfa | ||
|
|
fa89170f62 | ||
|
|
a74d92adce | ||
|
|
656be4ec98 | ||
|
|
6cf55675dc | ||
|
|
fc471bed0f | ||
|
|
401f394179 | ||
|
|
af0860ba4a | ||
|
|
c4185280ba | ||
|
|
4b0eaa7796 | ||
|
|
67b868ccb9 | ||
|
|
48b25047c9 | ||
|
|
04ac69ce52 | ||
|
|
ab19244c22 | ||
|
|
37fb36e1ff | ||
|
|
bb39c847d3 | ||
|
|
14a5405837 | ||
|
|
fbc06244e0 | ||
|
|
116a0b159f | ||
|
|
00bfc9ba7b | ||
|
|
d2d9f6bac9 | ||
|
|
499ef3bbb4 | ||
|
|
8545117cff | ||
|
|
c634b05def | ||
|
|
dd1184ac4d | ||
|
|
3b61f88a1f | ||
|
|
53e472c5ef | ||
|
|
ca914c9f63 | ||
|
|
9a4738457d | ||
|
|
d3e5c54d8a | ||
|
|
97740beab9 | ||
|
|
634cde193e | ||
|
|
c53ec3c17e | ||
|
|
539b906eb2 | ||
|
|
fd9c8c8d76 | ||
|
|
ffc853c88b | ||
|
|
44d4d96ec3 | ||
|
|
46bbefb1cc | ||
|
|
e3796fa3e7 | ||
|
|
6b720050ef | ||
|
|
4630f41f6a | ||
|
|
154560c9c5 | ||
|
|
e62b0364f1 | ||
|
|
9b2bf0a267 | ||
|
|
643742cbcf | ||
|
|
dc732da7a8 | ||
|
|
1422aed616 | ||
|
|
1464dc1022 | ||
|
|
b548a6f173 | ||
|
|
0a5e353ad0 | ||
|
|
ed1c4c72b9 | ||
|
|
2d595e22b0 | ||
|
|
ec0aeb6fce | ||
|
|
12bc3f5c12 | ||
|
|
35ab7bf679 | ||
|
|
a612c9ee58 | ||
|
|
afe4fcf695 | ||
|
|
d51aacabd1 | ||
|
|
7ee87cc8f2 | ||
|
|
59b4f2b59d | ||
|
|
e20a97a480 | ||
|
|
9e26b5f39d | ||
|
|
113b8efdaf | ||
|
|
0d60daf1e1 |
823 changed files with 20783 additions and 24978 deletions
|
|
@ -5,9 +5,10 @@ project(pysidebindings)
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Macros/
|
||||
${CMAKE_MODULE_PATH})
|
||||
find_package(GeneratorRunner 0.6.3 REQUIRED)
|
||||
find_package(Shiboken 1.0.0 REQUIRED)
|
||||
find_package(GeneratorRunner 0.6.11 REQUIRED)
|
||||
find_package(Shiboken 1.0.4 REQUIRED)
|
||||
find_package(Qt4 4.5.0 REQUIRED)
|
||||
find_file(GL_H "gl.h" PATH_SUFFIXES "GL")
|
||||
include(FindQt4Extra)
|
||||
|
||||
set(XVFB_EXEC "")
|
||||
|
|
@ -15,11 +16,12 @@ option(USE_XVFB "Uses xvfb-run with the unit tests to avoid QtGui tests popping
|
|||
if(USE_XVFB)
|
||||
find_program(XVFB_RUN NAMES xvfb-run)
|
||||
if (NOT ${XVFB_RUN} MATCHES "XVFB_RUN-NOTFOUND")
|
||||
set(XVFB_EXEC ${XVFB_RUN})
|
||||
set(XVFB_EXEC ${XVFB_RUN} -a)
|
||||
message(STATUS "Using xvfb-run to perform QtGui tests.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(BUILD_TESTS "Build tests." TRUE)
|
||||
option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE)
|
||||
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
|
||||
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
|
||||
|
|
@ -55,14 +57,23 @@ else()
|
|||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
set(CMAKE_BUILD_TYPE ${SHIBOKEN_BUILD_TYPE})
|
||||
endif()
|
||||
|
||||
set(BINDING_NAME PySide)
|
||||
set(BINDING_API_MAJOR_VERSION "1")
|
||||
set(BINDING_API_MINOR_VERSION "0")
|
||||
set(BINDING_API_MICRO_VERSION "0")
|
||||
set(BINDING_API_MICRO_VERSION "4")
|
||||
set(BINDING_API_RELEASE_LEVEL "final") # alpha, beta, rc, or final
|
||||
set(BINDING_API_SERIAL 1) # leave as 0 when release level is final
|
||||
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE)
|
||||
if (BINDING_API_RELEASE_LEVEL STREQUAL "final")
|
||||
set(BINDING_API_VERSION_FULL "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}"
|
||||
CACHE STRING "PySide version [full]" FORCE)
|
||||
else()
|
||||
set(BINDING_API_VERSION_FULL "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}~${BINDING_API_RELEASE_LEVEL}${BINDING_API_SERIAL}"
|
||||
CACHE STRING "PySide version [full]" FORCE)
|
||||
endif()
|
||||
set(PYSIDE_QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" CACHE STRING "Qt version used to compile PySide" FORCE)
|
||||
if(ENABLE_VERSION_SUFFIX)
|
||||
set(pyside_SUFFIX "-${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}")
|
||||
|
|
@ -106,11 +117,7 @@ else()
|
|||
endif()
|
||||
|
||||
# Define supported Qt Version
|
||||
if(${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} GREATER 6)
|
||||
set(SUPPORTED_QT_VERSION 4.7)
|
||||
else()
|
||||
set(SUPPORTED_QT_VERSION 4.6)
|
||||
endif()
|
||||
set(SUPPORTED_QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}")
|
||||
|
||||
set(BINDING_VERSION ${BINDING_API_VERSION}.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR})
|
||||
|
||||
|
|
@ -122,7 +129,7 @@ add_custom_target(uninstall "${CMAKE_COMMAND}"
|
|||
-P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
|
||||
|
||||
set(ARCHIVE_NAME pyside-qt${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}+${BINDING_API_VERSION})
|
||||
set(ARCHIVE_NAME pyside-qt${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}+${BINDING_API_VERSION_FULL})
|
||||
add_custom_target(dist
|
||||
COMMAND mkdir -p "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}" &&
|
||||
git log > "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}/ChangeLog" &&
|
||||
|
|
@ -145,9 +152,14 @@ if (NOT SITE_PACKAGE)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
|
||||
|
||||
enable_testing()
|
||||
set(GENERATOR_EXTRA_FLAGS --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero)
|
||||
if(WIN32 OR DEFINED AVOID_PROTECTED_HACK)
|
||||
message(STATUS "PySide will be generated avoiding the protected hack!")
|
||||
set(GENERATOR_EXTRA_FLAGS ${GENERATOR_EXTRA_FLAGS} --avoid-protected-hack)
|
||||
add_definitions(-DAVOID_PROTECTED_HACK)
|
||||
else()
|
||||
message(STATUS "PySide will be generated using the protected hack!")
|
||||
endif()
|
||||
|
||||
add_subdirectory(libpyside)
|
||||
if(QT_QTUITOOLS_FOUND AND QT_QTDESIGNER_FOUND)
|
||||
|
|
@ -155,7 +167,10 @@ if(QT_QTUITOOLS_FOUND AND QT_QTDESIGNER_FOUND)
|
|||
endif()
|
||||
# project directories
|
||||
add_subdirectory(PySide)
|
||||
add_subdirectory(tests)
|
||||
if (BUILD_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif ()
|
||||
|
||||
find_program(DOT_EXEC dot)
|
||||
if (QT_SRC_DIR AND DOT_EXEC)
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
project(pyside)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "${CMAKE_CURRENT_BINARY_DIR}/private.py"
|
||||
DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}${pyside_SUFFIX}")
|
||||
|
||||
include(PySideModules)
|
||||
|
||||
# Configure include based on platform
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/global.h.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/global.h" @ONLY)
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/pyside_global.h" @ONLY)
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/__init__.py" @ONLY)
|
||||
|
|
@ -23,7 +21,9 @@ HAS_QT_MODULE(QT_QTXML_FOUND QtXml)
|
|||
HAS_QT_MODULE(QT_QTTEST_FOUND QtTest)
|
||||
HAS_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)
|
||||
HAS_QT_MODULE(QT_QTSQL_FOUND QtSql)
|
||||
HAS_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
|
||||
if(QT_QTDESIGNER_FOUND)
|
||||
HAS_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
|
||||
endif()
|
||||
HAS_QT_MODULE(QT_QTHELP_FOUND QtHelp)
|
||||
HAS_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)
|
||||
HAS_QT_MODULE(QT_QTMAEMO5_FOUND QtMaemo5)
|
||||
|
|
@ -34,6 +34,10 @@ HAS_QT_MODULE(QT_PHONON_FOUND phonon)
|
|||
HAS_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)
|
||||
|
||||
# install
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "${CMAKE_CURRENT_BINARY_DIR}/private.py"
|
||||
DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}${pyside_SUFFIX}")
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_templates.xml
|
||||
DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pyside_global.h
|
||||
DESTINATION include/${BINDING_NAME}${pyside_SUFFIX})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
project(QtCore)
|
||||
|
||||
set(QtCore_gluecode "${CMAKE_CURRENT_SOURCE_DIR}/glue/qeasingcurve_glue.cpp")
|
||||
|
||||
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
|
||||
set (QtCore_46_SRC )
|
||||
else()
|
||||
|
|
@ -34,7 +36,16 @@ else()
|
|||
)
|
||||
endif()
|
||||
|
||||
|
||||
if(ENABLE_WIN)
|
||||
set(QtCore_typesystem "typesystem_core_win.xml")
|
||||
set(QtCore_extra_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/msg_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/point_wrapper.cpp
|
||||
)
|
||||
else()
|
||||
set(QtCore_typesystem "typesystem_core.xml")
|
||||
set(QtCore_extra_SRC "")
|
||||
endif()
|
||||
|
||||
set(QtCore_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qabstracteventdispatcher_wrapper.cpp
|
||||
|
|
@ -60,7 +71,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qdiriterator_wrapper.cpp
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qdynamicpropertychangeevent_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qevent_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qeventloop_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtCore/qfactoryinterface_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfactoryinterface_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfile_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfileinfo_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qfilesystemwatcher_wrapper.cpp
|
||||
|
|
@ -135,6 +146,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamreader_wrapper.cpp
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtCore/qxmlstreamwriter_wrapper.cpp
|
||||
${QtCore_46_SRC}
|
||||
${QtCore_47_SRC}
|
||||
${QtCore_extra_SRC}
|
||||
)
|
||||
|
||||
set(QtCore_typesystem_path "")
|
||||
|
|
@ -155,4 +167,5 @@ create_pyside_module(QtCore
|
|||
""
|
||||
QtCore_typesystem_path
|
||||
QtCore_SRC
|
||||
"")
|
||||
QtCore_gluecode
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${QtCore_typesystem})
|
||||
|
|
|
|||
32
PySide/QtCore/glue/hwnd_conversions.h
Normal file
32
PySide/QtCore/glue/hwnd_conversions.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
namespace Shiboken {
|
||||
template <>
|
||||
struct Converter<HWND__>
|
||||
{
|
||||
static bool checkType(PyObject* pyObj)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isConvertible(PyObject* pyobj)
|
||||
{
|
||||
return PyCObject_Check(pyobj);
|
||||
}
|
||||
|
||||
static inline PyObject* toPython(void* cppobj)
|
||||
{
|
||||
// not supported
|
||||
Q_ASSERT(true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject* toPython(HWND__ cppobj)
|
||||
{
|
||||
return PyCObject_FromVoidPtr(&cppobj, 0);
|
||||
}
|
||||
|
||||
static HWND__ toCpp(PyObject* pyobj)
|
||||
{
|
||||
return *((HWND__*) PyCObject_AsVoidPtr(pyobj));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -2,43 +2,23 @@
|
|||
static int QCoreApplicationArgCount;
|
||||
static char** QCoreApplicationArgValues;
|
||||
|
||||
int Sbk_QCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
|
||||
void QCoreApplication_constructor(PyObject* self, PyObject* args, QCoreApplicationWrapper** cptr)
|
||||
{
|
||||
if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
|
||||
return -1;
|
||||
|
||||
|
||||
if (QCoreApplication::instance()) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "A QCoreApplication instance already exists.");
|
||||
return -1;
|
||||
return;
|
||||
}
|
||||
|
||||
int numArgs = PyTuple_GET_SIZE(args);
|
||||
if (numArgs != 1) {
|
||||
if (numArgs != 1
|
||||
|| !Shiboken::sequenceToArgcArgv(PyTuple_GET_ITEM(args, 0), &QCoreApplicationArgCount, &QCoreApplicationArgValues, "PySideApp")) {
|
||||
PyErr_BadArgument();
|
||||
return -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Shiboken::sequenceToArgcArgv(PyTuple_GET_ITEM(args, 0), &QCoreApplicationArgCount, &QCoreApplicationArgValues, "PySideApp")) {
|
||||
PyErr_BadArgument();
|
||||
return -1;
|
||||
}
|
||||
|
||||
SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self);
|
||||
QCoreApplicationWrapper* cptr = new QCoreApplicationWrapper(QCoreApplicationArgCount, QCoreApplicationArgValues);
|
||||
Shiboken::Object::setCppPointer(sbkSelf,
|
||||
Shiboken::SbkType<QCoreApplication>(),
|
||||
cptr);
|
||||
|
||||
Shiboken::Object::setValidCpp(sbkSelf, true);
|
||||
Shiboken::Object::setHasCppWrapper(sbkSelf, true);
|
||||
Shiboken::Object::releaseOwnership(sbkSelf);
|
||||
|
||||
Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);
|
||||
PySide::Signal::updateSourceObject(self);
|
||||
cptr->metaObject();
|
||||
*cptr = new QCoreApplicationWrapper(QCoreApplicationArgCount, QCoreApplicationArgValues);
|
||||
|
||||
Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));
|
||||
PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);
|
||||
Py_INCREF(self);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
120
PySide/QtCore/glue/qeasingcurve_glue.cpp
Normal file
120
PySide/QtCore/glue/qeasingcurve_glue.cpp
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
#include <Python.h>
|
||||
#include <shiboken.h>
|
||||
#include <pysideweakref.h>
|
||||
#include <QEasingCurve>
|
||||
|
||||
#include "glue/qeasingcurve_glue.h"
|
||||
|
||||
#define __ECF_ATT_NAME__ "__ecf__"
|
||||
#define MAX_CUSTOM_FUNCTIONS 10
|
||||
|
||||
static void deleteData(void* data);
|
||||
|
||||
struct CustomFunctionsData
|
||||
{
|
||||
static CustomFunctionsData m_list[MAX_CUSTOM_FUNCTIONS];
|
||||
|
||||
PySideEasingCurveFunctor* m_obj;
|
||||
QEasingCurve::EasingFunction m_func;
|
||||
};
|
||||
|
||||
CustomFunctionsData CustomFunctionsData::m_list[MAX_CUSTOM_FUNCTIONS];
|
||||
|
||||
template<int N>
|
||||
struct CustomFunctions
|
||||
{
|
||||
static void init()
|
||||
{
|
||||
CustomFunctionsData data;
|
||||
data.m_obj = 0;
|
||||
data.m_func = &CustomFunctions<N>::callback;
|
||||
CustomFunctionsData::m_list[N] = data;
|
||||
|
||||
CustomFunctions<N-1>::init();
|
||||
}
|
||||
|
||||
static qreal callback(qreal v)
|
||||
{
|
||||
return (*CustomFunctionsData::m_list[N].m_obj)(v);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct CustomFunctions<0>
|
||||
{
|
||||
static void init()
|
||||
{
|
||||
CustomFunctionsData data;
|
||||
data.m_obj = 0;
|
||||
data.m_func = &CustomFunctions<0>::callback;
|
||||
CustomFunctionsData::m_list[0] = data;
|
||||
}
|
||||
|
||||
static qreal callback(qreal v)
|
||||
{
|
||||
return (*CustomFunctionsData::m_list[0].m_obj)(v);
|
||||
}
|
||||
};
|
||||
|
||||
void deleteData(void* data)
|
||||
{
|
||||
delete (PySideEasingCurveFunctor*)(data);
|
||||
}
|
||||
|
||||
void PySideEasingCurveFunctor::init()
|
||||
{
|
||||
CustomFunctions<MAX_CUSTOM_FUNCTIONS-1>::init();
|
||||
}
|
||||
|
||||
QEasingCurve::EasingFunction PySideEasingCurveFunctor::createCustomFuntion(PyObject* parent, PyObject* pyFunc)
|
||||
{
|
||||
for(int i=0; i < MAX_CUSTOM_FUNCTIONS; i++) {
|
||||
CustomFunctionsData& data = CustomFunctionsData::m_list[i];
|
||||
if (data.m_obj == 0) {
|
||||
data.m_obj = new PySideEasingCurveFunctor(i, parent, pyFunc);
|
||||
return data.m_func;
|
||||
}
|
||||
}
|
||||
//PyErr_Format(PyExc_RuntimeError, "PySide only supports %d custom functions simultaneously.", MAX_CUSTOM_FUNCTIONS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
PySideEasingCurveFunctor::~PySideEasingCurveFunctor()
|
||||
{
|
||||
|
||||
CustomFunctionsData::m_list[m_index].m_obj = 0;
|
||||
PyObject_SetAttrString(m_parent, __ECF_ATT_NAME__, Py_None);
|
||||
}
|
||||
|
||||
qreal PySideEasingCurveFunctor::operator()(qreal progress)
|
||||
{
|
||||
Shiboken::GilState state;
|
||||
PyObject* args = Py_BuildValue("(f)", progress);
|
||||
PyObject* result = PyObject_CallObject(m_func, args);
|
||||
qreal cppResult = 0.0;
|
||||
if (result) {
|
||||
cppResult = Shiboken::Converter<qreal>::toCpp(result);
|
||||
Py_DECREF(result);
|
||||
}
|
||||
Py_DECREF(args);
|
||||
return cppResult;
|
||||
}
|
||||
|
||||
PyObject* PySideEasingCurveFunctor::callable()
|
||||
{
|
||||
Py_INCREF(m_func);
|
||||
return m_func;
|
||||
}
|
||||
|
||||
PyObject* PySideEasingCurveFunctor::callable(PyObject* parent)
|
||||
{
|
||||
return PyObject_GetAttrString(parent, __ECF_ATT_NAME__);
|
||||
}
|
||||
|
||||
PySideEasingCurveFunctor::PySideEasingCurveFunctor(int index, PyObject* parent, PyObject* pyFunc)
|
||||
: m_parent(parent), m_func(pyFunc), m_index(index)
|
||||
{
|
||||
PyObject_SetAttrString(m_parent, __ECF_ATT_NAME__, m_func);
|
||||
PySide::WeakRef::create(m_parent, deleteData, this);
|
||||
}
|
||||
|
||||
27
PySide/QtCore/glue/qeasingcurve_glue.h
Normal file
27
PySide/QtCore/glue/qeasingcurve_glue.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef __QEASINGCURVE_GLUE__
|
||||
#define __QEASINGCURVE_GLUE__
|
||||
|
||||
#include <Python.h>
|
||||
#include <QEasingCurve>
|
||||
|
||||
class PySideEasingCurveFunctor
|
||||
{
|
||||
public:
|
||||
static void init();
|
||||
static QEasingCurve::EasingFunction createCustomFuntion(PyObject* parent, PyObject* pyFunc);
|
||||
|
||||
qreal operator()(qreal progress);
|
||||
|
||||
PyObject* callable(); //Return New reference
|
||||
static PyObject* callable(PyObject* parent); //Return New reference
|
||||
|
||||
~PySideEasingCurveFunctor();
|
||||
private:
|
||||
PyObject* m_parent;
|
||||
PyObject* m_func;
|
||||
int m_index;
|
||||
|
||||
PySideEasingCurveFunctor(int index, PyObject* parent, PyObject *pyFunc);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,9 +1,21 @@
|
|||
static bool isDecorator(PyObject* method, PyObject* self)
|
||||
{
|
||||
Shiboken::AutoDecRef methodName(PyObject_GetAttrString(method, "__name__"));
|
||||
if (!PyObject_HasAttr(self, methodName))
|
||||
return true;
|
||||
Shiboken::AutoDecRef otherMethod(PyObject_GetAttr(self, methodName));
|
||||
return reinterpret_cast<PyMethodObject*>(otherMethod.object())->im_func != \
|
||||
reinterpret_cast<PyMethodObject*>(method)->im_func;
|
||||
}
|
||||
|
||||
static bool getReceiver(PyObject* callback, QObject** receiver, PyObject** self)
|
||||
{
|
||||
bool forceGlobalReceiver = false;
|
||||
if (PyMethod_Check(callback)) {
|
||||
*self = PyMethod_GET_SELF(callback);
|
||||
if (Shiboken::Converter<QObject*>::checkType(*self))
|
||||
*receiver = Shiboken::Converter<QObject*>::toCpp(*self);
|
||||
forceGlobalReceiver = isDecorator(callback, *self);
|
||||
} else if (PyCFunction_Check(callback)) {
|
||||
*self = PyCFunction_GET_SELF(callback);
|
||||
if (*self && Shiboken::Converter<QObject*>::checkType(*self))
|
||||
|
|
@ -14,7 +26,7 @@ static bool getReceiver(PyObject* callback, QObject** receiver, PyObject** self)
|
|||
*self = 0;
|
||||
}
|
||||
|
||||
bool usingGlobalReceiver = !*receiver;
|
||||
bool usingGlobalReceiver = !*receiver || forceGlobalReceiver;
|
||||
if (usingGlobalReceiver) {
|
||||
PySide::SignalManager& signalManager = PySide::SignalManager::instance();
|
||||
*receiver = signalManager.globalReceiver();
|
||||
|
|
|
|||
|
|
@ -17,14 +17,23 @@ static QObject* _findChildHelper(const QObject* parent, const QString& name, PyT
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void _findChildrenHelper(const QObject* parent, const QString& name, PyTypeObject* desiredType, PyObject* result)
|
||||
static inline bool _findChildrenComparator(const QObject*& child, const QRegExp& name)
|
||||
{
|
||||
foreach(QObject* child, parent->children()) {
|
||||
return name.indexIn(child->objectName()) != -1;
|
||||
}
|
||||
|
||||
static inline bool _findChildrenComparator(const QObject*& child, const QString& name)
|
||||
{
|
||||
return name.isNull() || name == child->objectName();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static void _findChildrenHelper(const QObject* parent, const T& name, PyTypeObject* desiredType, PyObject* result)
|
||||
{
|
||||
foreach(const QObject* child, parent->children()) {
|
||||
Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));
|
||||
if (PyType_IsSubtype(pyChild->ob_type, desiredType)
|
||||
&& (name.isNull() || name == child->objectName())) {
|
||||
if (PyType_IsSubtype(pyChild->ob_type, desiredType) && _findChildrenComparator(child, name))
|
||||
PyList_Append(result, pyChild);
|
||||
}
|
||||
_findChildrenHelper(child, name, desiredType, result);
|
||||
}
|
||||
}
|
||||
34
PySide/QtCore/qbytearray_conversions.h
Normal file
34
PySide/QtCore/qbytearray_conversions.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
namespace Shiboken {
|
||||
|
||||
inline bool Converter<QByteArray>::checkType(PyObject* pyObj)
|
||||
{
|
||||
return ValueTypeConverter<QByteArray>::checkType(pyObj);
|
||||
}
|
||||
|
||||
inline bool Converter<QByteArray>::isConvertible(PyObject* pyObj)
|
||||
{
|
||||
if (ValueTypeConverter<QByteArray>::isConvertible(pyObj))
|
||||
return true;
|
||||
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QByteArray >());
|
||||
return Shiboken::Converter<const char *>::checkType(pyObj)
|
||||
|| (ObjectType::isExternalConvertible(shiboType, pyObj));
|
||||
}
|
||||
|
||||
inline QByteArray Converter<QByteArray>::toCpp(PyObject* pyObj)
|
||||
{
|
||||
if (pyObj == Py_None)
|
||||
return 0;
|
||||
else if (PyObject_TypeCheck(pyObj, SbkType<QByteArray>()))
|
||||
return *Converter<QByteArray*>::toCpp(pyObj);
|
||||
else if (PyString_Check(pyObj))
|
||||
return QByteArray(PyString_AS_STRING(pyObj), PyString_GET_SIZE(pyObj));
|
||||
else
|
||||
return ValueTypeConverter<QByteArray>::toCpp(pyObj);
|
||||
}
|
||||
|
||||
inline PyObject* Converter<QByteArray>::toPython(const ::QByteArray& cppObj)
|
||||
{
|
||||
return ValueTypeConverter<QByteArray>::toPython(cppObj);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,35 +1,45 @@
|
|||
namespace Shiboken {
|
||||
template <>
|
||||
struct PythonConverter<QDate>
|
||||
|
||||
inline bool Converter<QDate>::checkType(PyObject* pyObj)
|
||||
{
|
||||
static bool isPythonConvertible(PyObject* pyObj)
|
||||
{
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
return pyObj && PyDate_Check(pyObj);
|
||||
}
|
||||
|
||||
static QDate* transformFromPython(PyObject* obj)
|
||||
{
|
||||
if (isPythonConvertible(obj)) {
|
||||
int day = PyDateTime_GET_DAY(obj);
|
||||
int month = PyDateTime_GET_MONTH(obj);
|
||||
int year = PyDateTime_GET_YEAR(obj);
|
||||
return new QDate(year, month, day);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject* transformToPython(QDate* d)
|
||||
{
|
||||
if (d) {
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
return PyDate_FromDate(d->year(), d->month(), d->day());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
return ValueTypeConverter<QDate>::checkType(pyObj);
|
||||
}
|
||||
|
||||
inline PyObject* Converter<QDate>::toPython(const ::QDate& cppObj)
|
||||
{
|
||||
return ValueTypeConverter<QDate>::toPython(cppObj);
|
||||
}
|
||||
|
||||
inline bool Converter<QDate>::isConvertible(PyObject* pyObj)
|
||||
{
|
||||
if (ValueTypeConverter<QDate>::isConvertible(pyObj))
|
||||
return true;
|
||||
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QDate >());
|
||||
return PyDate_Check(pyObj) || ObjectType::isExternalConvertible(shiboType, pyObj);
|
||||
}
|
||||
|
||||
inline QDate Converter<QDate>::toCpp(PyObject* pyObj)
|
||||
{
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
if (pyObj == Py_None) {
|
||||
return QDate();
|
||||
} else if (PyObject_TypeCheck(pyObj, SbkType<QDate>())) {
|
||||
return *Converter<QDate*>::toCpp(pyObj);
|
||||
} else if (PyDate_Check(pyObj)) {
|
||||
int day = PyDateTime_GET_DAY(pyObj);
|
||||
int month = PyDateTime_GET_MONTH(pyObj);
|
||||
int year = PyDateTime_GET_YEAR(pyObj);
|
||||
return QDate(year, month, day);
|
||||
} else {
|
||||
return ValueTypeConverter<QDate>::toCpp(pyObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,41 +1,49 @@
|
|||
namespace Shiboken {
|
||||
template <>
|
||||
struct PythonConverter<QDateTime>
|
||||
|
||||
inline bool Converter<QDateTime>::checkType(PyObject* pyObj)
|
||||
{
|
||||
static bool isPythonConvertible(PyObject* pyObj)
|
||||
{
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
return pyObj && PyDateTime_Check(pyObj);
|
||||
}
|
||||
|
||||
static QDateTime* transformFromPython(PyObject* obj)
|
||||
{
|
||||
if (isPythonConvertible(obj)) {
|
||||
int day = PyDateTime_GET_DAY(obj);
|
||||
int month = PyDateTime_GET_MONTH(obj);
|
||||
int year = PyDateTime_GET_YEAR(obj);
|
||||
int hour = PyDateTime_DATE_GET_HOUR(obj);
|
||||
int min = PyDateTime_DATE_GET_MINUTE(obj);
|
||||
int sec = PyDateTime_DATE_GET_SECOND(obj);
|
||||
int msec = PyDateTime_DATE_GET_MICROSECOND(obj);
|
||||
return new QDateTime(QDate(year, month, day), QTime(hour, min, sec, msec));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject* transformToPython(QDateTime* d)
|
||||
{
|
||||
if (d) {
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
QDate date = d->date();
|
||||
QTime time = d->time();
|
||||
return PyDateTime_FromDateAndTime(date.year(), date.month(), date.day(), time.hour(), time.minute(), time.second(), time.msec());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
return ValueTypeConverter<QDateTime>::checkType(pyObj);
|
||||
}
|
||||
|
||||
inline PyObject* Converter<QDateTime>::toPython(const ::QDateTime& cppObj)
|
||||
{
|
||||
return ValueTypeConverter<QDateTime>::toPython(cppObj);
|
||||
}
|
||||
|
||||
inline bool Converter<QDateTime>::isConvertible(PyObject* pyObj)
|
||||
{
|
||||
if (ValueTypeConverter<QDateTime>::isConvertible(pyObj))
|
||||
return true;
|
||||
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QDateTime >());
|
||||
return PyDateTime_Check(pyObj) || ObjectType::isExternalConvertible(shiboType, pyObj);
|
||||
}
|
||||
|
||||
|
||||
inline QDateTime Converter<QDateTime>::toCpp(PyObject* pyObj)
|
||||
{
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
if (pyObj == Py_None) {
|
||||
return QDateTime();
|
||||
} else if (PyObject_TypeCheck(pyObj, SbkType<QDateTime>())) {
|
||||
return *Converter<QDateTime*>::toCpp(pyObj);
|
||||
} else if (PyDateTime_Check(pyObj)) {
|
||||
int day = PyDateTime_GET_DAY(pyObj);
|
||||
int month = PyDateTime_GET_MONTH(pyObj);
|
||||
int year = PyDateTime_GET_YEAR(pyObj);
|
||||
int hour = PyDateTime_DATE_GET_HOUR(pyObj);
|
||||
int min = PyDateTime_DATE_GET_MINUTE(pyObj);
|
||||
int sec = PyDateTime_DATE_GET_SECOND(pyObj);
|
||||
int usec = PyDateTime_DATE_GET_MICROSECOND(pyObj);
|
||||
return QDateTime(QDate(year, month, day), QTime(hour, min, sec, usec/1000));
|
||||
} else {
|
||||
return ValueTypeConverter<QDateTime>::toCpp(pyObj);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,36 +1,45 @@
|
|||
namespace Shiboken {
|
||||
template <>
|
||||
struct PythonConverter<QTime>
|
||||
|
||||
inline bool Converter<QTime>::checkType(PyObject* pyObj)
|
||||
{
|
||||
static bool isPythonConvertible(PyObject* pyObj)
|
||||
{
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
return pyObj && PyTime_Check(pyObj);
|
||||
}
|
||||
|
||||
static QTime* transformFromPython(PyObject* obj)
|
||||
{
|
||||
if (isPythonConvertible(obj)) {
|
||||
int hour = PyDateTime_TIME_GET_HOUR(obj);
|
||||
int min = PyDateTime_TIME_GET_MINUTE(obj);
|
||||
int sec = PyDateTime_TIME_GET_SECOND(obj);
|
||||
int msec = PyDateTime_TIME_GET_MICROSECOND(obj);
|
||||
return new QTime(hour, min, sec, msec);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyObject* transformToPython(QTime* d)
|
||||
{
|
||||
if (d) {
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
return PyTime_FromTime(d->hour(), d->minute(), d->second(), d->msec());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
return ValueTypeConverter<QTime>::checkType(pyObj);
|
||||
}
|
||||
|
||||
inline PyObject* Converter<QTime>::toPython(const ::QTime& cppObj)
|
||||
{
|
||||
return ValueTypeConverter<QTime>::toPython(cppObj);
|
||||
}
|
||||
|
||||
inline bool Converter<QTime>::isConvertible(PyObject* pyObj)
|
||||
{
|
||||
if (ValueTypeConverter<QTime>::isConvertible(pyObj))
|
||||
return true;
|
||||
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QTime >());
|
||||
return PyTime_Check(pyObj) || ObjectType::isExternalConvertible(shiboType, pyObj);
|
||||
}
|
||||
|
||||
inline QTime Converter<QTime>::toCpp(PyObject* pyObj)
|
||||
{
|
||||
if (!PyDateTimeAPI)
|
||||
PyDateTime_IMPORT;
|
||||
|
||||
if (pyObj == Py_None) {
|
||||
return QTime();
|
||||
} else if (PyObject_TypeCheck(pyObj, SbkType<QTime>())) {
|
||||
return *Converter<QTime*>::toCpp(pyObj);
|
||||
} else if (PyTime_Check(pyObj)) {
|
||||
int hour = PyDateTime_TIME_GET_HOUR(pyObj);
|
||||
int min = PyDateTime_TIME_GET_MINUTE(pyObj);
|
||||
int sec = PyDateTime_TIME_GET_SECOND(pyObj);
|
||||
int usec = PyDateTime_TIME_GET_MICROSECOND(pyObj);
|
||||
return QTime(hour, min, sec, usec/1000);
|
||||
} else {
|
||||
return ValueTypeConverter<QTime>::toCpp(pyObj);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,26 +14,28 @@ struct Converter<QVariant>
|
|||
return true;
|
||||
}
|
||||
|
||||
static QByteArray resolveMetaType(PyTypeObject* type, int &typeId)
|
||||
static const char* resolveMetaType(PyTypeObject* type, int* typeId)
|
||||
{
|
||||
if (PyObject_TypeCheck(type, &SbkObjectType_Type)) {
|
||||
SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(type);
|
||||
QByteArray typeName(Shiboken::ObjectType::getOriginalName(sbkType));
|
||||
bool valueType = !typeName.endsWith("*");
|
||||
const char* typeName = Shiboken::ObjectType::getOriginalName(sbkType);
|
||||
if (!typeName)
|
||||
return 0;
|
||||
bool valueType = '*' != typeName[qstrlen(typeName) - 1];
|
||||
|
||||
// Do not convert user type of value
|
||||
if (valueType && Shiboken::ObjectType::isUserType(type))
|
||||
return QByteArray();
|
||||
return 0;
|
||||
|
||||
int obTypeId = QMetaType::type(typeName);
|
||||
if (obTypeId) {
|
||||
typeId = obTypeId;
|
||||
return QByteArray(typeName);
|
||||
*typeId = obTypeId;
|
||||
return typeName;
|
||||
}
|
||||
|
||||
// Do not resolve types to value type
|
||||
if (valueType)
|
||||
return QByteArray();
|
||||
return 0;
|
||||
|
||||
// find in base types
|
||||
if (type->tp_base) {
|
||||
|
|
@ -41,14 +43,14 @@ struct Converter<QVariant>
|
|||
} else if (type->tp_bases) {
|
||||
int size = PyTuple_GET_SIZE(type->tp_bases);
|
||||
for(int i=0; i < size; i++){
|
||||
QByteArray derivedName = resolveMetaType(reinterpret_cast<PyTypeObject*>(PyTuple_GET_ITEM(type->tp_bases, i)), typeId);
|
||||
if (!derivedName.isEmpty())
|
||||
const char* derivedName = resolveMetaType(reinterpret_cast<PyTypeObject*>(PyTuple_GET_ITEM(type->tp_bases, i)), typeId);
|
||||
if (derivedName)
|
||||
return derivedName;
|
||||
}
|
||||
}
|
||||
}
|
||||
typeId = 0;
|
||||
return QByteArray();
|
||||
*typeId = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static QVariant toCpp(PyObject* pyObj)
|
||||
|
|
@ -80,34 +82,30 @@ struct Converter<QVariant>
|
|||
} else if (Shiboken::isShibokenEnum(pyObj)) {
|
||||
// QVariant(enum)
|
||||
return QVariant(Converter<int>::toCpp(pyObj));
|
||||
} else if (PyDict_Check(pyObj)) {
|
||||
return convertToVariantMap(pyObj);
|
||||
} else if (Shiboken::Object::checkType(pyObj)) {
|
||||
// a class supported by QVariant?
|
||||
int typeCode;
|
||||
const char* typeName = resolveMetaType(pyObj->ob_type, &typeCode);
|
||||
if (typeCode && typeName) {
|
||||
Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(typeName);
|
||||
QVariant var(typeCode, (void*)0);
|
||||
void* args[] = { var.data() };
|
||||
tr->toCpp(pyObj, args);
|
||||
return var;
|
||||
}
|
||||
}
|
||||
|
||||
//sequence and dictornay
|
||||
if (PyDict_Check(pyObj)) {
|
||||
QVariant ret = convertToVariantMap(pyObj);
|
||||
if (ret.isValid())
|
||||
return ret;
|
||||
} else if (PySequence_Check(pyObj)) {
|
||||
return convertToVariantList(pyObj);
|
||||
} else {
|
||||
// a class supported by QVariant?
|
||||
if (Shiboken::Object::checkType(pyObj)) {
|
||||
SbkObjectType* objType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type);
|
||||
int typeCode = 0;
|
||||
QByteArray typeName = resolveMetaType(reinterpret_cast<PyTypeObject*>(objType), typeCode);
|
||||
if (typeCode) {
|
||||
Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(typeName);
|
||||
void* data = 0;
|
||||
data = tr->toCpp(pyObj, &data, true);
|
||||
if (typeName.endsWith("*")) {
|
||||
QVariant var(typeCode, &data);
|
||||
tr->deleteObject(data);
|
||||
return var;
|
||||
} else {
|
||||
QVariant var(typeCode, data);
|
||||
tr->deleteObject(data);
|
||||
return var;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Is a shiboken type not known by Qt
|
||||
return QVariant::fromValue<PySide::PyObjectWrapper>(pyObj);
|
||||
}
|
||||
|
||||
// Is a shiboken type not known by Qt
|
||||
return QVariant::fromValue<PySide::PyObjectWrapper>(pyObj);
|
||||
}
|
||||
|
||||
static PyObject* toPython(void* cppObj)
|
||||
|
|
@ -140,28 +138,25 @@ struct Converter<QVariant>
|
|||
return QVariant();
|
||||
|
||||
Shiboken::AutoDecRef element(PySequence_GetItem(list, 0));
|
||||
int typeId = 0;
|
||||
QByteArray typeName = resolveMetaType(element.cast<PyTypeObject*>(), typeId);
|
||||
if (!typeName.isEmpty()) {
|
||||
QByteArray listTypeName = QByteArray("QList<"+typeName+">");
|
||||
int typeId;
|
||||
const char* typeName = resolveMetaType(element.cast<PyTypeObject*>(), &typeId);
|
||||
if (typeName) {
|
||||
QByteArray listTypeName("QList<");
|
||||
listTypeName += typeName;
|
||||
listTypeName += '>';
|
||||
typeId = QMetaType::type(listTypeName);
|
||||
if (typeId > 0) {
|
||||
Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(listTypeName);
|
||||
if (!tr) {
|
||||
qWarning() << "TypeResolver for :" << listTypeName << "not registered.";
|
||||
return QVariant();
|
||||
} else {
|
||||
void *data = 0;
|
||||
data = tr->toCpp(list, &data, true);
|
||||
QVariant var(typeId, data);
|
||||
tr->deleteObject(data);
|
||||
QVariant var(typeId, (void*)0);
|
||||
void* args[] = { var.data(), 0 };
|
||||
tr->toCpp(list, args);
|
||||
return var;
|
||||
}
|
||||
} else {
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +172,7 @@ struct Converter<QVariant>
|
|||
ret.insert(Converter<QString>::toCpp(key), toCpp(value));
|
||||
return QVariant(ret);
|
||||
} else {
|
||||
return toCpp(map);
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
35
PySide/QtCore/typesystem_core_win.xml
Normal file
35
PySide/QtCore/typesystem_core_win.xml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
This file is part of PySide project.
|
||||
Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
Contact: PySide team <contact@pyside.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
-->
|
||||
<typesystem package="PySide.QtCore">
|
||||
<primitive-type name="HWND__">
|
||||
<conversion-rule file="glue/hwnd_conversions.h"/>
|
||||
</primitive-type>
|
||||
<value-type name="POINT">
|
||||
<include file-name="wtypes.h" location="global"/>
|
||||
</value-type>
|
||||
<value-type name="MSG">
|
||||
<include file-name="wtypes.h" location="global"/>
|
||||
</value-type>
|
||||
<suppress-warning text="class 'MSG' inherits from unknown base class 'tagMSG'"/>
|
||||
<suppress-warning text="class not found for setup inheritance 'tagMSG'"/>
|
||||
<load-typesystem name="typesystem_core.xml" generate="yes"/>
|
||||
</typesystem>
|
||||
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
project(QtDeclarative)
|
||||
|
||||
set(QtDeclarative_registerType "${CMAKE_CURRENT_SOURCE_DIR}/pysideqmlregistertype.cpp")
|
||||
|
||||
set(QtDeclarative_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativecomponent_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtDeclarative/qdeclarativecontext_wrapper.cpp
|
||||
|
|
@ -56,5 +58,5 @@ create_pyside_module(QtDeclarative
|
|||
QtDeclarative_deps
|
||||
QtDeclarative_typesystem_path
|
||||
QtDeclarative_SRC
|
||||
"")
|
||||
QtDeclarative_registerType)
|
||||
|
||||
|
|
|
|||
339
PySide/QtDeclarative/pysideqmlregistertype.cpp
Normal file
339
PySide/QtDeclarative/pysideqmlregistertype.cpp
Normal file
|
|
@ -0,0 +1,339 @@
|
|||
/*
|
||||
* This file is part of the Shiboken Python Bindings Generator project.
|
||||
*
|
||||
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
*
|
||||
* Contact: PySide team <contact@pyside.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "pysideqmlregistertype.h"
|
||||
// Qt
|
||||
#include <QObject>
|
||||
#include <QDeclarativeEngine>
|
||||
#include <QMutex>
|
||||
// shiboken
|
||||
#include <typeresolver.h>
|
||||
#include <gilstate.h>
|
||||
#include <sbkdbg.h>
|
||||
// pyside
|
||||
#include <pyside.h>
|
||||
#include <dynamicqmetaobject.h>
|
||||
#include <pysideproperty.h>
|
||||
|
||||
// auto generated headers
|
||||
#include "qdeclarativeitem_wrapper.h"
|
||||
#include "pyside_qtcore_python.h"
|
||||
#include "pyside_qtdeclarative_python.h"
|
||||
|
||||
#ifndef PYSIDE_MAX_QML_TYPES
|
||||
// Maximum number of different types the user cna export to QML using qmlRegisterType.
|
||||
#define PYSIDE_MAX_QML_TYPES 50
|
||||
#endif
|
||||
|
||||
// Forward declarations
|
||||
static void propListMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Call call, void** args);
|
||||
|
||||
|
||||
// All registered python types
|
||||
static PyObject* pyTypes[PYSIDE_MAX_QML_TYPES];
|
||||
static void (*createFuncs[PYSIDE_MAX_QML_TYPES])(void*);
|
||||
|
||||
/// QDeclarativeItem will create objects using placement new then this pointer is non-null.
|
||||
void* PySide::nextQmlElementMemoryAddr = 0;
|
||||
// Mutex used to avoid race condition on PySide::nextQmlElementMemoryAddr
|
||||
static QMutex nextQmlElementMutex;
|
||||
|
||||
template<int N>
|
||||
struct ElementFactoryBase
|
||||
{
|
||||
static void createInto(void* memory)
|
||||
{
|
||||
QMutexLocker locker(&nextQmlElementMutex);
|
||||
PySide::nextQmlElementMemoryAddr = memory;
|
||||
Shiboken::GilState state;
|
||||
PyObject* obj = PyObject_CallObject(pyTypes[N], 0);
|
||||
if (!obj || PyErr_Occurred())
|
||||
PyErr_Print();
|
||||
PySide::nextQmlElementMemoryAddr = 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<int N>
|
||||
struct ElementFactory : ElementFactoryBase<N>
|
||||
{
|
||||
static void init()
|
||||
{
|
||||
createFuncs[N] = &ElementFactoryBase<N>::createInto;
|
||||
ElementFactory<N-1>::init();
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct ElementFactory<0> : ElementFactoryBase<0>
|
||||
{
|
||||
static void init()
|
||||
{
|
||||
createFuncs[0] = &ElementFactoryBase<0>::createInto;
|
||||
}
|
||||
};
|
||||
|
||||
int PySide::qmlRegisterType(PyObject* pyObj, const char* uri, int versionMajor, int versionMinor, const char* qmlName)
|
||||
{
|
||||
using namespace Shiboken;
|
||||
|
||||
static PyTypeObject* declarativeItemType = TypeResolver::get("QDeclarativeItem*")->pythonType();
|
||||
assert(declarativeItemType);
|
||||
static int nextType = 0;
|
||||
|
||||
if (nextType >= PYSIDE_MAX_QML_TYPES) {
|
||||
PyErr_Format(PyExc_TypeError, "QML doesn't really like language bindings, so you can only export %d types to QML.", PYSIDE_MAX_QML_TYPES);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!PySequence_Contains(((PyTypeObject*)pyObj)->tp_mro, (PyObject*)declarativeItemType)) {
|
||||
PyErr_Format(PyExc_TypeError, "A type inherited from %s expected, got %s.", declarativeItemType->tp_name, ((PyTypeObject*)pyObj)->tp_name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
QMetaObject* metaObject = reinterpret_cast<QMetaObject*>(ObjectType::getTypeUserData(reinterpret_cast<SbkObjectType*>(pyObj)));
|
||||
Q_ASSERT(metaObject);
|
||||
|
||||
// All ready... now the ugly code begins... :-)
|
||||
pyTypes[nextType] = pyObj;
|
||||
|
||||
// Init proxy object static meta object
|
||||
QDeclarativePrivate::RegisterType type;
|
||||
type.version = 0;
|
||||
type.typeId = qMetaTypeId<QDeclarativeItem*>();
|
||||
type.listId = qMetaTypeId<QDeclarativeListProperty<QDeclarativeItem> >();
|
||||
type.objectSize = sizeof(QDeclarativeItemWrapper);
|
||||
type.create = createFuncs[nextType];
|
||||
type.uri = uri;
|
||||
type.versionMajor = versionMajor;
|
||||
type.versionMinor = versionMinor;
|
||||
type.elementName = qmlName;
|
||||
type.metaObject = metaObject;
|
||||
|
||||
type.attachedPropertiesFunction = QDeclarativePrivate::attachedPropertiesFunc<QDeclarativeItem>();
|
||||
type.attachedPropertiesMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<QDeclarativeItem>();
|
||||
|
||||
type.parserStatusCast = QDeclarativePrivate::StaticCastSelector<QDeclarativeItem,QDeclarativeParserStatus>::cast();
|
||||
type.valueSourceCast = QDeclarativePrivate::StaticCastSelector<QDeclarativeItem,QDeclarativePropertyValueSource>::cast();
|
||||
type.valueInterceptorCast = QDeclarativePrivate::StaticCastSelector<QDeclarativeItem,QDeclarativePropertyValueInterceptor>::cast();
|
||||
|
||||
type.extensionObjectCreate = 0;
|
||||
type.extensionMetaObject = 0;
|
||||
type.customParser = 0;
|
||||
|
||||
int qmlTypeId = QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
|
||||
++nextType;
|
||||
return qmlTypeId;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// This is the user data we store in the property.
|
||||
struct DeclarativeListProperty
|
||||
{
|
||||
PyTypeObject* type;
|
||||
PyObject* append;
|
||||
PyObject* at;
|
||||
PyObject* clear;
|
||||
PyObject* count;
|
||||
};
|
||||
|
||||
static int propListTpInit(PyObject* self, PyObject* args, PyObject* kwds)
|
||||
{
|
||||
static const char *kwlist[] = {"type", "append", "at", "clear", "count", 0};
|
||||
PySideProperty* pySelf = reinterpret_cast<PySideProperty*>(self);
|
||||
DeclarativeListProperty* data = new DeclarativeListProperty;
|
||||
memset(data, 0, sizeof(DeclarativeListProperty));
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds,
|
||||
"OO|OOO:QtDeclarative.ListProperty", (char**) kwlist,
|
||||
&data->type,
|
||||
&data->append,
|
||||
&data->at,
|
||||
&data->clear,
|
||||
&data->count)) {
|
||||
return 0;
|
||||
}
|
||||
PySide::Property::setMetaCallHandler(pySelf, &propListMetaCall);
|
||||
PySide::Property::setTypeName(pySelf, "QDeclarativeListProperty<QDeclarativeItem>");
|
||||
PySide::Property::setUserData(pySelf, data);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void propListTpFree(void* self)
|
||||
{
|
||||
PySideProperty* pySelf = reinterpret_cast<PySideProperty*>(self);
|
||||
delete reinterpret_cast<DeclarativeListProperty*>(PySide::Property::userData(pySelf));
|
||||
// calls base type constructor
|
||||
pySelf->ob_type->tp_base->tp_free(self);
|
||||
}
|
||||
|
||||
PyTypeObject PropertyListType = {
|
||||
PyObject_HEAD_INIT(0)
|
||||
0, /*ob_size*/
|
||||
"ListProperty", /*tp_name*/
|
||||
sizeof(PySideProperty), /*tp_basicsize*/
|
||||
0, /*tp_itemsize*/
|
||||
0, /*tp_dealloc*/
|
||||
0, /*tp_print*/
|
||||
0, /*tp_getattr*/
|
||||
0, /*tp_setattr*/
|
||||
0, /*tp_compare*/
|
||||
0, /*tp_repr*/
|
||||
0, /*tp_as_number*/
|
||||
0, /*tp_as_sequence*/
|
||||
0, /*tp_as_mapping*/
|
||||
0, /*tp_hash */
|
||||
0, /*tp_call*/
|
||||
0, /*tp_str*/
|
||||
0, /*tp_getattro*/
|
||||
0, /*tp_setattro*/
|
||||
0, /*tp_as_buffer*/
|
||||
Py_TPFLAGS_DEFAULT, /*tp_flags*/
|
||||
0, /*tp_doc */
|
||||
0, /*tp_traverse */
|
||||
0, /*tp_clear */
|
||||
0, /*tp_richcompare */
|
||||
0, /*tp_weaklistoffset */
|
||||
0, /*tp_iter */
|
||||
0, /*tp_iternext */
|
||||
0, /*tp_methods */
|
||||
0, /*tp_members */
|
||||
0, /*tp_getset */
|
||||
&PySidePropertyType, /*tp_base */
|
||||
0, /*tp_dict */
|
||||
0, /*tp_descr_get */
|
||||
0, /*tp_descr_set */
|
||||
0, /*tp_dictoffset */
|
||||
propListTpInit, /*tp_init */
|
||||
0, /*tp_alloc */
|
||||
0, /*tp_new */
|
||||
propListTpFree, /*tp_free */
|
||||
0, /*tp_is_gc */
|
||||
0, /*tp_bases */
|
||||
0, /*tp_mro */
|
||||
0, /*tp_cache */
|
||||
0, /*tp_subclasses */
|
||||
0, /*tp_weaklist */
|
||||
0, /*tp_del */
|
||||
};
|
||||
|
||||
} // extern "C"
|
||||
|
||||
// Implementation of QDeclarativeListProperty<T>::AppendFunction callback
|
||||
void propListAppender(QDeclarativeListProperty<QDeclarativeItem>* propList, QDeclarativeItem* item)
|
||||
{
|
||||
Shiboken::GilState state;
|
||||
Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object, item));
|
||||
|
||||
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
|
||||
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->append, args));
|
||||
|
||||
if (PyErr_Occurred())
|
||||
PyErr_Print();
|
||||
}
|
||||
|
||||
// Implementation of QDeclarativeListProperty<T>::CountFunction callback
|
||||
int propListCount(QDeclarativeListProperty<QDeclarativeItem>* propList)
|
||||
{
|
||||
Shiboken::GilState state;
|
||||
Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object));
|
||||
|
||||
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
|
||||
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->count, args));
|
||||
|
||||
// Check return type
|
||||
if (PyErr_Occurred())
|
||||
PyErr_Print();
|
||||
else if (Shiboken::Converter<int>::isConvertible(retVal))
|
||||
return Shiboken::Converter<int>::toCpp(retVal);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Implementation of QDeclarativeListProperty<T>::AtFunction callback
|
||||
QDeclarativeItem* propListAt(QDeclarativeListProperty<QDeclarativeItem>* propList, int index)
|
||||
{
|
||||
Shiboken::GilState state;
|
||||
Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object, index));
|
||||
|
||||
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
|
||||
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->at, args));
|
||||
|
||||
if (PyErr_Occurred())
|
||||
PyErr_Print();
|
||||
else if (PyType_IsSubtype(Py_TYPE(retVal), data->type))
|
||||
return Shiboken::Converter<QDeclarativeItem*>::toCpp(retVal);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Implementation of QDeclarativeListProperty<T>::ClearFunction callback
|
||||
void propListClear(QDeclarativeListProperty<QDeclarativeItem>* propList)
|
||||
{
|
||||
Shiboken::GilState state;
|
||||
Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object));
|
||||
|
||||
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
|
||||
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->clear, args));
|
||||
|
||||
if (PyErr_Occurred())
|
||||
PyErr_Print();
|
||||
}
|
||||
|
||||
// qt_metacall specialization for ListProperties
|
||||
static void propListMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Call call, void** args)
|
||||
{
|
||||
if (call != QMetaObject::ReadProperty)
|
||||
return;
|
||||
|
||||
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(PySide::Property::userData(pp));
|
||||
QDeclarativeListProperty<QDeclarativeItem> declProp(Shiboken::Converter<QObject*>::toCpp(self), data, &propListAppender);
|
||||
|
||||
if (data->count)
|
||||
declProp.count = &propListCount;
|
||||
if (data->at)
|
||||
declProp.at = &propListAt;
|
||||
if (data->clear)
|
||||
declProp.clear = &propListClear;
|
||||
|
||||
// Copy the data to the memory location requested by the meta call
|
||||
void* v = args[0];
|
||||
*reinterpret_cast<QDeclarativeListProperty<QDeclarativeItem>*>(v) = declProp;
|
||||
}
|
||||
|
||||
|
||||
void PySide::initQmlSupport(PyObject* module)
|
||||
{
|
||||
ElementFactory<PYSIDE_MAX_QML_TYPES - 1>::init();
|
||||
|
||||
// Export DeclarativeListProperty type
|
||||
if (PyType_Ready(&PropertyListType) < 0)
|
||||
return;
|
||||
|
||||
Py_INCREF((PyObject*)&PropertyListType);
|
||||
PyModule_AddObject(module, PropertyListType.tp_name, (PyObject*)&PropertyListType);
|
||||
|
||||
}
|
||||
|
||||
|
||||
57
PySide/QtDeclarative/pysideqmlregistertype.h
Normal file
57
PySide/QtDeclarative/pysideqmlregistertype.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* This file is part of the Shiboken Python Bindings Generator project.
|
||||
*
|
||||
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
*
|
||||
* Contact: PySide team <contact@pyside.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef PYSIDEQMLREGISTERTYPE_H
|
||||
#define PYSIDEQMLREGISTERTYPE_H
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
struct SbkObjectType;
|
||||
|
||||
namespace PySide
|
||||
{
|
||||
|
||||
extern void* nextQmlElementMemoryAddr;
|
||||
|
||||
/**
|
||||
* Init the QML support doign things like registering QtDeclarative.ListProperty and create the necessary stuff for
|
||||
* qmlRegisterType.
|
||||
*
|
||||
* \param module QtDeclarative python module
|
||||
*/
|
||||
void initQmlSupport(PyObject* module);
|
||||
|
||||
/**
|
||||
* PySide implementation of qmlRegisterType<T> function.
|
||||
*
|
||||
* \param pyObj Python type to be registered.
|
||||
* \param uri QML element uri.
|
||||
* \param versionMajor QML component major version.
|
||||
* \param versionMinor QML component minor version.
|
||||
* \param qmlName QML element name
|
||||
* \return the metatype id of the registered type.
|
||||
*/
|
||||
int qmlRegisterType(PyObject* pyObj, const char* uri, int versionMajor, int versionMinor, const char* qmlName);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -23,30 +23,69 @@
|
|||
<load-typesystem name="typesystem_network.xml" generate="no"/>
|
||||
<load-typesystem name="typesystem_gui.xml" generate="no"/>
|
||||
|
||||
<add-function signature="qmlRegisterType(PyTypeObject, const char*, int, int, const char*)" return-type="int">
|
||||
<inject-documentation format="target" mode="append">
|
||||
This function registers the Python type in the QML system with the name qmlName, in the library imported from uri having the version number composed from versionMajor and versionMinor.
|
||||
Returns the QML type id.
|
||||
|
||||
For example, this registers a Python class MySliderItem as a QML type named Slider for version 1.0 of a module called "com.mycompany.qmlcomponents":
|
||||
|
||||
::
|
||||
|
||||
qmlRegisterType(MySliderItem, "com.mycompany.qmlcomponents", 1, 0, "Slider")
|
||||
|
||||
Once this is registered, the type can be used in QML by importing the specified module name and version number:
|
||||
|
||||
::
|
||||
|
||||
import com.mycompany.qmlcomponents 1.0
|
||||
|
||||
Slider { ... }
|
||||
|
||||
Note that it's perfectly reasonable for a library to register types to older versions than the actual version of the library. Indeed, it is normal for the new library to allow QML written to previous versions to continue to work, even if more advanced versions of some of its types are available.
|
||||
</inject-documentation>
|
||||
|
||||
<inject-code class="target">
|
||||
%PYARG_0 = %CONVERTTOPYTHON[int](PySide::qmlRegisterType(%1, %2, %3, %4, %5));
|
||||
</inject-code>
|
||||
</add-function>
|
||||
|
||||
<enum-type identified-by-value="QML_HAS_ATTACHED_PROPERTIES" since="4.7">
|
||||
<extra-includes>
|
||||
<include file-name="QtDeclarative" location="global"/>
|
||||
<!-- FIXME The include tag doesn't work on modules -->
|
||||
<include file-name="pysideqmlregistertype.h" location="local"/>
|
||||
</extra-includes>
|
||||
</enum-type>
|
||||
|
||||
<inject-code>
|
||||
<inject-code class="target" position="end">
|
||||
Shiboken::TypeResolver::createValueTypeResolver< QList<QObject*> >("QList<QObject*>");
|
||||
PySide::initQmlSupport(module);
|
||||
</inject-code>
|
||||
|
||||
<object-type name="QDeclarativeExtensionInterface"/>
|
||||
<object-type name="QDeclarativeComponent">
|
||||
<enum-type name="Status"/>
|
||||
<!-- This ctor isn't part of Qt public API -->
|
||||
<modify-function signature="QDeclarativeComponent(QObject*)" remove="all" />
|
||||
</object-type>
|
||||
<object-type name="QDeclarativeContext">
|
||||
<modify-function signature="setContextProperty(const QString &, QObject*)">
|
||||
<modify-argument index="2">
|
||||
<reference-count action="add"/>
|
||||
</modify-argument>
|
||||
<inject-code class="target" position="end">
|
||||
QByteArray key("%FUNCTION_NAME_");
|
||||
key.append(%1.toLocal8Bit());
|
||||
Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), key.constData(), %PYARG_2);
|
||||
</inject-code>
|
||||
</modify-function>
|
||||
</object-type>
|
||||
|
||||
<object-type name="QDeclarativeEngine">
|
||||
<enum-type name="ObjectOwnership" />
|
||||
<modify-function signature="QDeclarativeEngine(QObject*)">
|
||||
<modify-argument index="1">
|
||||
<rename to="parent" /> <!-- Qt names this just p -->
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="setNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory*)">
|
||||
<modify-argument index="1">
|
||||
<parent index="this" action="add" />
|
||||
|
|
@ -59,8 +98,19 @@
|
|||
<object-type name="QDeclarativeImageProvider">
|
||||
<enum-type name="ImageType" />
|
||||
</object-type>
|
||||
<object-type name="QDeclarativeItem">
|
||||
<object-type name="QDeclarativeItem" polymorphic-id-expression="qgraphicsitem_cast<QDeclarativeItem*>(%1)">
|
||||
<extra-includes>
|
||||
<include file-name="pysideqmlregistertype.h" location="local"/>
|
||||
</extra-includes>
|
||||
<enum-type name="TransformOrigin" />
|
||||
<modify-function signature="QDeclarativeItem(QDeclarativeItem*)">
|
||||
<inject-code class="target">
|
||||
if (PySide::nextQmlElementMemoryAddr)
|
||||
%0 = new (PySide::nextQmlElementMemoryAddr) ::QDeclarativePrivate::QDeclarativeElement<%TYPE>();
|
||||
else
|
||||
%0 = new %TYPE(%1);
|
||||
</inject-code>
|
||||
</modify-function>
|
||||
</object-type>
|
||||
|
||||
<value-type name="QDeclarativeListReference" />
|
||||
|
|
@ -78,7 +128,20 @@
|
|||
<enum-type name="Type" />
|
||||
</value-type>
|
||||
|
||||
<object-type name="QDeclarativePropertyMap" />
|
||||
<object-type name="QDeclarativePropertyMap">
|
||||
<modify-documentation xpath="description/code[1]"><code># create our data
|
||||
ownerData = QDeclarativePropertyMap()
|
||||
ownerData.insert("name", "John Smith")
|
||||
ownerData.insert("phone", "555-5555")
|
||||
|
||||
# expose it to the UI layer
|
||||
view = QDeclarativeView()
|
||||
ctxt = view.rootContext()
|
||||
ctxt.setContextProperty("owner", ownerData)
|
||||
|
||||
view.setSource(QUrl.fromLocalFile("main.qml"))
|
||||
view.show()</code></modify-documentation>
|
||||
</object-type>
|
||||
<object-type name="QDeclarativePropertyValueSource" />
|
||||
<value-type name="QDeclarativeScriptString" />
|
||||
<object-type name="QDeclarativeView">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ if(ENABLE_X11)
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11info_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11embedcontainer_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qx11embedwidget_wrapper.cpp
|
||||
)
|
||||
)
|
||||
|
||||
if(Q_WS_MAEMO_5)
|
||||
set(SPECIFIC_OS_FILES
|
||||
|
|
@ -17,7 +17,7 @@ endif()
|
|||
|
||||
|
||||
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
|
||||
set (QtGui_46_SRC )
|
||||
set(QtGui_46_SRC "")
|
||||
else()
|
||||
set(QtGui_46_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qmatrix2x2_wrapper.cpp
|
||||
|
|
@ -60,6 +60,23 @@ else()
|
|||
)
|
||||
endif ()
|
||||
|
||||
set(QtGui_OPTIONAL_SRC )
|
||||
set(QtGui_DROPPED_ENTRIES )
|
||||
check_qt_class(QtGui QAbstractPageSetupDialog QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QAbstractPrintDialog QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QGtkStyle QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QPageSetupDialog QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QPrintDialog QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QPrintEngine QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QPrintPreviewDialog QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QPrintPreviewWidget QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QPrinter QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QPrinterInfo QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QSessionManager QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QSizeGrip QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QSystemTrayIcon QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
check_qt_class(QtGui QMacStyle QtGui_OPTIONAL_SRC QtGui_DROPPED_ENTRIES)
|
||||
|
||||
qt4_wrap_cpp(QPYTEXTOBJECT_MOC "${pyside_SOURCE_DIR}/qpytextobject.h")
|
||||
|
||||
set(QtGui_SRC
|
||||
|
|
@ -225,6 +242,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpen_wrapper.cpp
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpictureio_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpicture_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpixmapcache_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpixmapcache_key_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qpixmap_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qplaintextdocumentlayout_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qplaintextedit_wrapper.cpp
|
||||
|
|
@ -378,28 +396,14 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qwizard_wrapper.cpp
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/qworkspace_wrapper.cpp
|
||||
|
||||
${SPECIFIC_OS_FILES}
|
||||
${QPYTEXTOBJECT_MOC}
|
||||
${QtGui_46_SRC}
|
||||
${QtGui_OPTIONAL_SRC}
|
||||
)
|
||||
|
||||
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/typesystem_gui.xml.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml" @ONLY)
|
||||
|
||||
check_qt_class(QtGui QGtkStyle QtGui_SRC)
|
||||
check_qt_class(QtGui QSessionManager QtGui_SRC)
|
||||
check_qt_class(QtGui QSizeGrip QtGui_SRC)
|
||||
check_qt_class(QtGui QSystemTrayIcon QtGui_SRC)
|
||||
|
||||
check_qt_class(QtGui QAbstractPageSetupDialog QtGui_SRC)
|
||||
check_qt_class(QtGui QAbstractPrintDialog QtGui_SRC)
|
||||
check_qt_class(QtGui QPageSetupDialog QtGui_SRC)
|
||||
check_qt_class(QtGui QPrintDialog QtGui_SRC)
|
||||
check_qt_class(QtGui QPrintPreviewWidget QtGui_SRC)
|
||||
check_qt_class(QtGui QPrintPreviewDialog QtGui_SRC)
|
||||
check_qt_class(QtGui QPrinter QtGui_SRC)
|
||||
check_qt_class(QtGui QPrinterInfo QtGui_SRC)
|
||||
check_qt_class(QtGui QPrintEngine QtGui_SRC)
|
||||
|
||||
set(QtGui_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}")
|
||||
set(QtGui_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtGui/
|
||||
|
|
@ -421,8 +425,7 @@ create_pyside_module(QtGui
|
|||
QtGui_deps
|
||||
QtGui_typesystem_path
|
||||
QtGui_SRC
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml"
|
||||
QPYTEXTOBJECT_MOC)
|
||||
|
||||
""
|
||||
${CMAKE_CURRENT_BINARY_DIR}/typesystem_gui.xml)
|
||||
|
||||
install(FILES ${pyside_SOURCE_DIR}/qpytextobject.h DESTINATION include/PySide/QtGui/)
|
||||
|
|
|
|||
|
|
@ -5,39 +5,18 @@ static int QApplicationArgCount;
|
|||
static char** QApplicationArgValues;
|
||||
static const char QAPP_MACRO[] = "qApp";
|
||||
|
||||
int Sbk_QApplication_Init(PyObject* self, PyObject* args, PyObject*)
|
||||
bool QApplicationConstructorStart(PyObject* argv)
|
||||
{
|
||||
if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication>()))
|
||||
return -1;
|
||||
|
||||
if (QApplication::instance()) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "A QApplication instance already exists.");
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
int numArgs = PyTuple_GET_SIZE(args);
|
||||
if (numArgs != 1) {
|
||||
PyErr_BadArgument();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!Shiboken::sequenceToArgcArgv(PyTuple_GET_ITEM(args, 0), &QApplicationArgCount, &QApplicationArgValues, "PySideApp")) {
|
||||
PyErr_BadArgument();
|
||||
return -1;
|
||||
}
|
||||
|
||||
SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self);
|
||||
QApplicationWrapper* cptr = new QApplicationWrapper(QApplicationArgCount, QApplicationArgValues);
|
||||
Shiboken::Object::setCppPointer(sbkSelf,
|
||||
Shiboken::SbkType<QApplication>(),
|
||||
cptr);
|
||||
Shiboken::Object::setValidCpp(sbkSelf, true);
|
||||
Shiboken::Object::setHasCppWrapper(sbkSelf, true);
|
||||
Shiboken::Object::releaseOwnership(sbkSelf);
|
||||
Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);
|
||||
PySide::Signal::updateSourceObject(self);
|
||||
cptr->metaObject();
|
||||
return Shiboken::sequenceToArgcArgv(argv, &QApplicationArgCount, &QApplicationArgValues, "PySideApp");
|
||||
}
|
||||
|
||||
void QApplicationConstructorEnd(PyObject* self)
|
||||
{
|
||||
// Verify if qApp is in main module
|
||||
PyObject* globalsDict = PyEval_GetGlobals();
|
||||
if (globalsDict) {
|
||||
|
|
@ -49,5 +28,23 @@ int Sbk_QApplication_Init(PyObject* self, PyObject* args, PyObject*)
|
|||
PyObject_SetAttrString(moduleQtGui, QAPP_MACRO, self);
|
||||
PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);
|
||||
Py_INCREF(self);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void QApplicationConstructor(PyObject* self, PyObject* argv, QApplicationWrapper** cptr)
|
||||
{
|
||||
if (QApplicationConstructorStart(argv)) {
|
||||
*cptr = new QApplicationWrapper(QApplicationArgCount, QApplicationArgValues);
|
||||
Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));
|
||||
QApplicationConstructorEnd(self);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static void QApplicationConstructor(PyObject* self, PyObject* argv, T extraArg, QApplicationWrapper** cptr)
|
||||
{
|
||||
if (QApplicationConstructorStart(argv)) {
|
||||
*cptr = new QApplicationWrapper(QApplicationArgCount, QApplicationArgValues, extraArg);
|
||||
Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));
|
||||
QApplicationConstructorEnd(self);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ inline void addLayoutOwnership(QLayout* layout, QLayout* other)
|
|||
|
||||
for (int i=0, i_max=other->count(); i < i_max; i++) {
|
||||
QLayoutItem* item = other->itemAt(i);
|
||||
if (PyErr_Occurred())
|
||||
if (PyErr_Occurred() || !item)
|
||||
return;
|
||||
|
||||
addLayoutOwnership(layout, item);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
// Init qApp macro to None.
|
||||
Py_INCREF(Py_None);
|
||||
PyModule_AddObject(module, "qApp", Py_None);
|
||||
if (qApp) {
|
||||
PyObject* pyApp = Shiboken::Converter<QApplication*>::toPython(qApp);
|
||||
Py_INCREF(pyApp);
|
||||
PyModule_AddObject(module, "qApp", pyApp);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
PyModule_AddObject(module, "qApp", Py_None);
|
||||
}
|
||||
moduleQtGui = module;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ static inline void qwidgetReparentLayout(QWidget *parent, QLayout *layout)
|
|||
|
||||
for (int i=0; i < layout->count(); i++) {
|
||||
QLayoutItem* item = layout->itemAt(i);
|
||||
if (PyErr_Occurred())
|
||||
if (PyErr_Occurred() || !item)
|
||||
return;
|
||||
|
||||
QWidget* w = item->widget();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -23,6 +23,10 @@
|
|||
<rejection class="*" function-name="macMenu"/>
|
||||
|
||||
<primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject"/>
|
||||
<object-type name="QMacStyle" >
|
||||
<enum-type name="FocusRectPolicy"/>
|
||||
<enum-type name="WidgetSizePolicy"/>
|
||||
</object-type>
|
||||
|
||||
<suppress-warning text="enum 'QPixmap::ShareMode' does not have a type entry or is not an enum" />
|
||||
<suppress-warning text="enum 'QSysInfo::Endian' is specified in typesystem, but not declared" />
|
||||
|
|
|
|||
|
|
@ -23,8 +23,10 @@
|
|||
<rejection class="" function-name="qt_x11_getX11InfoForWindow"/>
|
||||
<rejection class="QX11Info" field-name="x11data"/>
|
||||
<value-type name="QX11Info">
|
||||
<!-- ### Both methods return void pointers, for which particular cases no handling was discussed. -->
|
||||
<modify-function signature="visual()const" remove="all"/>
|
||||
<modify-function signature="appVisual(int)" remove="all"/>
|
||||
<!-- ### -->
|
||||
</value-type>
|
||||
<object-type name="QX11EmbedContainer">
|
||||
<enum-type name="Error"/>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qmaemo5valuebutton_wrapper.
|
|||
${CMAKE_CURRENT_BINARY_DIR}/${BINDING_NAME}/QtMaemo5/qtmaemo5_module_wrapper.cpp
|
||||
)
|
||||
|
||||
set(QtMaemo5_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}")
|
||||
set(QtMaemo5_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
|
||||
|
||||
# QT_QTMAEMO5_* variables are not defined by CMake
|
||||
if(NOT QT_QTMAEMO5_INCLUDE_DIR)
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<object-type name="QMaemo5InformationBox">
|
||||
<modify-function signature="setWidget(QWidget*)">
|
||||
<modify-argument index="1">
|
||||
<reference-count action="add"/>
|
||||
<reference-count action="set"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="paintEvent(QPaintEvent*)">
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
<object-type name="QMaemo5ListPickSelector">
|
||||
<modify-function signature="setModel(QAbstractItemModel*)">
|
||||
<modify-argument index="1">
|
||||
<reference-count action="add"/>
|
||||
<reference-count action="set"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,15 @@ else()
|
|||
set(QtNetwork_47_SRC )
|
||||
endif ()
|
||||
|
||||
set(QtNetwork_OPTIONAL_SRC )
|
||||
set(QtNetwork_DROPPED_ENTRIES )
|
||||
check_qt_class(QtNetwork QSslCertificate QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
|
||||
check_qt_class(QtNetwork QSslCipher QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
|
||||
check_qt_class(QtNetwork QSslConfiguration QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
|
||||
check_qt_class(QtNetwork QSslError QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
|
||||
check_qt_class(QtNetwork QSslKey QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
|
||||
check_qt_class(QtNetwork QSslSocket QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES)
|
||||
|
||||
set(QtNetwork_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qabstractnetworkcache_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qabstractsocket_wrapper.cpp
|
||||
|
|
@ -32,6 +41,8 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkcookiejar_wrapper.cpp
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkdiskcache_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkinterface_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkproxy_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkproxyfactory_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkproxyquery_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkreply_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qnetworkrequest_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qssl_wrapper.cpp
|
||||
|
|
@ -42,14 +53,9 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qudpsocket_wrapper.cpp
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/qurlinfo_wrapper.cpp
|
||||
|
||||
${QtNetwork_47_SRC}
|
||||
${QtNetwork_OPTIONAL_SRC}
|
||||
)
|
||||
|
||||
check_qt_class(QtNetwork QSslCipher QtNetwork_SRC)
|
||||
check_qt_class(QtNetwork QSslConfiguration QtNetwork_SRC)
|
||||
check_qt_class(QtNetwork QSslError QtNetwork_SRC)
|
||||
check_qt_class(QtNetwork QSslKey QtNetwork_SRC)
|
||||
check_qt_class(QtNetwork QSslSocket QtNetwork_SRC)
|
||||
|
||||
set(QtNetwork_typesystem_path "${QtCore_SOURCE_DIR}")
|
||||
set(QtNetwork_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtNetwork/
|
||||
|
|
@ -72,4 +78,6 @@ create_pyside_module(QtNetwork
|
|||
QtNetwork_deps
|
||||
QtNetwork_typesystem_path
|
||||
QtNetwork_SRC
|
||||
"")
|
||||
""
|
||||
""
|
||||
QtNetwork_DROPPED_ENTRIES)
|
||||
|
|
|
|||
|
|
@ -33,12 +33,11 @@
|
|||
</namespace-type>
|
||||
|
||||
<rejection class="QIPv6Address" field-name="c"/>
|
||||
<rejection class="QSslCertificate"/>
|
||||
|
||||
<object-type name="QAbstractSocket">
|
||||
<enum-type name="NetworkLayerProtocol"/>
|
||||
<enum-type name="SocketError"/>
|
||||
<enum-type name="SocketOption"/>
|
||||
<enum-type name="SocketOption" since="4.6"/>
|
||||
<enum-type name="SocketState"/>
|
||||
<enum-type name="SocketType"/>
|
||||
<modify-function signature="connectToHost(const QString&, quint16, QFlags<QIODevice::OpenModeFlag>)" allow-thread="yes" />
|
||||
|
|
@ -93,7 +92,6 @@
|
|||
<include file-name="autoarraypointer.h" location="global"/>
|
||||
</extra-includes>
|
||||
|
||||
<modify-function signature="closeConnection()" remove="all"/>
|
||||
<modify-function signature="readAll()" allow-thread="yes"/>
|
||||
<modify-function signature="read(char*, qint64)" allow-thread="yes">
|
||||
<modify-argument index="return">
|
||||
|
|
@ -106,6 +104,9 @@
|
|||
<insert-template name="read_wrapper"/>
|
||||
</inject-code>
|
||||
</modify-function>
|
||||
<!-- ### Obsolete methods -->
|
||||
<modify-function signature="closeConnection()" remove="all"/>
|
||||
<!-- ### -->
|
||||
</object-type>
|
||||
<object-type name="QTcpServer">
|
||||
<modify-function signature="waitForNewConnection(int,bool*)" allow-thread="yes">
|
||||
|
|
@ -127,7 +128,7 @@
|
|||
</object-type>
|
||||
<object-type name="QTcpSocket"/>
|
||||
<object-type name="QUdpSocket">
|
||||
<enum-type name="BindFlag" flags="QUdpSocket::BindMode"/>
|
||||
<enum-type name="BindFlag" flags="BindMode"/>
|
||||
<extra-includes>
|
||||
<include file-name="autoarraypointer.h" location="global"/>
|
||||
</extra-includes>
|
||||
|
|
@ -149,13 +150,13 @@
|
|||
</modify-argument>
|
||||
<inject-code class="target" position="beginning" file="glue/qudpsocket_read_datagram_glue.cpp"/>
|
||||
</modify-function>
|
||||
<modify-function signature="writeDatagram(const char*,qint64,const QHostAddress&,quint16)" remove="all"/>
|
||||
<modify-function signature="writeDatagram(const QByteArray&, const QHostAddress&, quint16)" allow-thread="yes"/>
|
||||
<!-- ### writeDatagram(QByteArray, ...) does the trick -->
|
||||
<modify-function signature="writeDatagram(const char*,qint64,const QHostAddress&,quint16)" remove="all"/>
|
||||
<!-- ### -->
|
||||
</object-type>
|
||||
|
||||
<object-type name="QHttpHeader">
|
||||
<modify-function signature="QHttpHeader(QHttpHeader)" remove="all"/>
|
||||
</object-type>
|
||||
<object-type name="QHttpHeader" />
|
||||
<object-type name="QLocalServer">
|
||||
<modify-function signature="waitForNewConnection(int,bool*)" allow-thread="yes">
|
||||
<!-- FIXME -->
|
||||
|
|
@ -190,7 +191,7 @@
|
|||
<modify-function signature="post(const QNetworkRequest &, const QByteArray &)" allow-thread="yes"/>
|
||||
<modify-function signature="put(const QNetworkRequest &, QIODevice *)" allow-thread="yes"/>
|
||||
<modify-function signature="put(const QNetworkRequest &, const QByteArray &)" allow-thread="yes"/>
|
||||
<modify-function signature="sendCustomRequest(const QNetworkRequest &, const QByteArray &, QIODevice *)" allow-thread="yes"/>
|
||||
<modify-function signature="sendCustomRequest(const QNetworkRequest &, const QByteArray &, QIODevice *)" allow-thread="yes" since="4.7" />
|
||||
<modify-function signature="setCookieJar(QNetworkCookieJar*)">
|
||||
<modify-argument index="1">
|
||||
<define-ownership class="target" owner="c++"/>
|
||||
|
|
@ -204,7 +205,9 @@
|
|||
|
||||
<value-type name="QHostAddress" hash-function="qHash">
|
||||
<enum-type name="SpecialAddress"/>
|
||||
<!-- ### QHostAddress(QIPv6Address) does this -->
|
||||
<modify-function signature="QHostAddress(quint8*)" remove="all" />
|
||||
<!-- ### -->
|
||||
</value-type>
|
||||
|
||||
<value-type name="QHostInfo">
|
||||
|
|
@ -219,21 +222,62 @@
|
|||
<value-type name="QNetworkAddressEntry" />
|
||||
|
||||
<value-type name="QNetworkInterface">
|
||||
<enum-type name="InterfaceFlag" flags="QNetworkInterface::InterfaceFlags"/>
|
||||
<enum-type name="InterfaceFlag" flags="InterfaceFlags"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QNetworkProxy">
|
||||
<enum-type name="Capability"/>
|
||||
<enum-type name="Capability" flags="Capabilities" />
|
||||
<enum-type name="ProxyType"/>
|
||||
</value-type>
|
||||
|
||||
<object-type name="QNetworkProxyFactory" />
|
||||
<value-type name="QNetworkProxyQuery">
|
||||
<enum-type name="QueryType" />
|
||||
</value-type>
|
||||
|
||||
<value-type name="QUrlInfo">
|
||||
<enum-type name="PermissionSpec"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QIPv6Address">
|
||||
<modify-function signature="operator[](int)const" remove="all" />
|
||||
<modify-function signature="operator[](int)" remove="all" />
|
||||
<add-function signature="__len__">
|
||||
<inject-code class="target" position="beginning">
|
||||
return 16;
|
||||
</inject-code>
|
||||
</add-function>
|
||||
<add-function signature="__getitem__">
|
||||
<inject-code class="target" position="beginning">
|
||||
if (_i >= 16) {
|
||||
PyErr_SetString(PyExc_IndexError, "index out of bounds");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (_i < 0)
|
||||
_i = 16 - qAbs(_i);
|
||||
|
||||
return %CONVERTTOPYTHON[uint](%CPPSELF->c[_i]);
|
||||
</inject-code>
|
||||
</add-function>
|
||||
<add-function signature="__len__">
|
||||
<inject-code class="target" position="beginning">
|
||||
return 16;
|
||||
</inject-code>
|
||||
</add-function>
|
||||
<add-function signature="__setitem__">
|
||||
<inject-code class="target" position="beginning">
|
||||
if (_i >= 16) {
|
||||
PyErr_SetString(PyExc_IndexError, "index out of bounds");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (_i < 0)
|
||||
_i = 16 - qAbs(_i);
|
||||
|
||||
%CPPSELF->c[_i] = %CONVERTTOCPP[quint8](_value);
|
||||
|
||||
return 0;
|
||||
</inject-code>
|
||||
</add-function>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QAuthenticator" />
|
||||
|
|
@ -251,37 +295,20 @@
|
|||
<enum-type name="KnownHeaders"/>
|
||||
</value-type>
|
||||
|
||||
|
||||
<value-type name="QSslCipher"/>
|
||||
<value-type name="QSslError">
|
||||
<enum-type name="SslError"/>
|
||||
</value-type>
|
||||
<value-type name="QSslKey"/>
|
||||
|
||||
<!-- TODO QSslCertificate requires QMultiMap which isn't implemented yet
|
||||
<value-type name="QSslCertificate"/>
|
||||
-->
|
||||
<enum-type name="QSslCertificate::SubjectInfo"/>
|
||||
|
||||
<value-type name="QSslConfiguration"/>
|
||||
|
||||
<object-type name="QSslSocket">
|
||||
<enum-type name="SslMode"/>
|
||||
<enum-type name="PeerVerifyMode"/>
|
||||
<modify-function signature="connectToHostEncrypted(const QString&, quint16, QFlags<QIODevice::OpenModeFlag>)" allow-thread="yes" />
|
||||
<modify-function signature="waitForEncrypted(int)" allow-thread="yes" />
|
||||
</object-type>
|
||||
|
||||
|
||||
<!-- Qt 4.7 -->
|
||||
<value-type name="QNetworkConfiguration" since="4.7">
|
||||
<enum-type name="BearerType" />
|
||||
<enum-type name="Purpose" since="4.7"/>
|
||||
<enum-type name="StateFlag" flags="QNetworkConfiguration::StateFlags" since="4.7"/>
|
||||
<enum-type name="StateFlag" flags="StateFlags" since="4.7"/>
|
||||
<enum-type name="Type" since="4.7"/>
|
||||
</value-type>
|
||||
<object-type name="QNetworkConfigurationManager" since="4.7">
|
||||
<enum-type name="Capability" flags="QNetworkConfigurationManager::Capabilities" since="4.7"/>
|
||||
<enum-type name="Capability" flags="Capabilities" since="4.7"/>
|
||||
</object-type>
|
||||
<object-type name="QNetworkSession" since="4.7">
|
||||
<enum-type name="SessionError" since="4.7"/>
|
||||
|
|
@ -293,4 +320,23 @@
|
|||
<value-type name="QNetworkCacheMetaData"/>
|
||||
|
||||
<suppress-warning text="Shadowing: QAbstractSocket::*"/>
|
||||
|
||||
|
||||
<!-- The following entries may be present in the system or not. Keep this section organized. -->
|
||||
<value-type name="QSslCertificate"/>
|
||||
<value-type name="QSslCipher"/>
|
||||
<value-type name="QSslConfiguration"/>
|
||||
<value-type name="QSslError">
|
||||
<enum-type name="SslError"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QSslKey"/>
|
||||
<object-type name="QSslSocket">
|
||||
<enum-type name="SslMode"/>
|
||||
<enum-type name="PeerVerifyMode"/>
|
||||
<modify-function signature="connectToHostEncrypted(const QString&, quint16, QFlags<QIODevice::OpenModeFlag>)" allow-thread="yes" />
|
||||
<modify-function signature="waitForEncrypted(int)" allow-thread="yes" />
|
||||
</object-type>
|
||||
<!-- The above entries may be present in the system or not. Keep this section organized. -->
|
||||
</typesystem>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,11 +22,10 @@
|
|||
<load-typesystem name="typesystem_gui.xml" generate="no" />
|
||||
|
||||
<rejection class="QGLColormap::QGLColormapData"/>
|
||||
<rejection class="QGLWidget" function-name="setMouseTracking"/>
|
||||
<rejection class="QGLContext" field-name="currentCtx"/>
|
||||
|
||||
<namespace-type name="QGL">
|
||||
<enum-type name="FormatOption" flags="QGL::FormatOptions" force-integer="yes"/>
|
||||
<enum-type name="FormatOption" flags="FormatOptions" force-integer="yes"/>
|
||||
<extra-includes>
|
||||
<include file-name="qgl.h" location="global"/>
|
||||
</extra-includes>
|
||||
|
|
@ -40,11 +39,12 @@
|
|||
|
||||
<value-type name="QGLFormat">
|
||||
<enum-type name="OpenGLContextProfile" since="4.7"/>
|
||||
<enum-type name="OpenGLVersionFlag" flags="QGLFormat::OpenGLVersionFlags"/>
|
||||
<enum-type name="OpenGLVersionFlag" flags="OpenGLVersionFlags"/>
|
||||
</value-type>
|
||||
|
||||
<rejection class="QGLContext" field-name="currentCtx" />
|
||||
<object-type name="QGLContext">
|
||||
<enum-type name="BindOption" flags="QGLContext::BindOptions"/>
|
||||
<enum-type name="BindOption" flags="BindOptions" since="4.6"/>
|
||||
<modify-function signature="chooseContext(const QGLContext*)">
|
||||
<modify-argument index="1" invalidate-after-use="yes"/>
|
||||
</modify-function>
|
||||
|
|
@ -52,16 +52,10 @@
|
|||
<modify-argument index="1" invalidate-after-use="yes"/>
|
||||
</modify-function>
|
||||
|
||||
<modify-function signature="getProcAddress(QString)const">
|
||||
<remove/>
|
||||
</modify-function>
|
||||
<modify-field name="currentCtx" read="false" write="false"/>
|
||||
<modify-function signature="setDevice(QPaintDevice*)">
|
||||
<remove/>
|
||||
</modify-function>
|
||||
<!-- ### Obsolete functions and ctors -->
|
||||
<modify-function signature="generateFontDisplayLists(QFont, int)" remove="all"/>
|
||||
<modify-function signature="tryVisual(const QGLFormat&, int)" remove="all"/>
|
||||
<modify-function signature="chooseVisual()" remove="all"/>
|
||||
<modify-function signature="QGLContext(const QGLFormat&, QPaintDevice*)" remove="all" />
|
||||
<!-- ### -->
|
||||
</object-type>
|
||||
<object-type name="QGLFramebufferObject">
|
||||
<enum-type name="Attachment"/>
|
||||
|
|
@ -84,24 +78,28 @@
|
|||
<parent index="2" action="add"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<!--- Obsolete -->
|
||||
<!-- ### Not part of Qt public API -->
|
||||
<modify-function signature="setContext(QGLContext*,const QGLContext*,bool)" remove="all" />
|
||||
<!-- ### -->
|
||||
<!--- ### Obsolete functions -->
|
||||
<modify-function signature="fontDisplayListBase(QFont, int)" remove="all"/>
|
||||
<modify-function signature="setFormat(QGLFormat)" remove="all"/>
|
||||
<!-- ### -->
|
||||
</object-type>
|
||||
|
||||
<value-type name="QGLFramebufferObjectFormat"/>
|
||||
<object-type name="QGLShader">
|
||||
<enum-type name="ShaderTypeBit" flags="QGLShader::ShaderType"/>
|
||||
<value-type name="QGLFramebufferObjectFormat" since="4.6"/>
|
||||
<object-type name="QGLShader" since="4.6">
|
||||
<enum-type name="ShaderTypeBit" flags="ShaderType"/>
|
||||
</object-type>
|
||||
<object-type name="QGLShaderProgram">
|
||||
<!-- use QMatrixZxY overloads -->
|
||||
<object-type name="QGLShaderProgram" since="4.6">
|
||||
<!-- ### Use QMatrixZxY overloads -->
|
||||
<modify-function signature="setUniformValue(int, Array)" remove="all" />
|
||||
<modify-function signature="setUniformValue(const char*, Array)" remove="all" />
|
||||
<modify-function signature="setAttributeValue(int,const float*,int,int)" remove="all" />
|
||||
<modify-function signature="setAttributeValue(const char*,const float*,int,int)" remove="all" />
|
||||
<modify-function signature="setAttributeArray(int, uint, const void*, int, int)" remove="all" since="4.7" />
|
||||
<modify-function signature="setAttributeArray(const char*, uint, const void*, int, int)" remove="all" since="4.7" />
|
||||
<!-- ### -->
|
||||
</object-type>
|
||||
|
||||
<!-- Qt 4.7 -->
|
||||
|
|
@ -124,12 +122,18 @@
|
|||
</inject-code>
|
||||
</modify-function>
|
||||
<modify-function signature="map(QGLBuffer::Access)">
|
||||
<inject-code class="target" position="beginning">
|
||||
void *data = %CPPSELF.map(%1);
|
||||
QByteArray ret;
|
||||
if (data)
|
||||
ret.append((const char*)data, %CPPSELF.size());
|
||||
%PYARG_0 = %CONVERTTOPYTHON[QByteArray](ret);
|
||||
<inject-code>
|
||||
Py_ssize_t dataSize = %CPPSELF.size();
|
||||
void* data = %CPPSELF.map(%1);
|
||||
|
||||
if (!data) {
|
||||
Py_INCREF(Py_None);
|
||||
%PYARG_0 = Py_None;
|
||||
} else if (%1 == QGLBuffer::ReadOnly) {
|
||||
%PYARG_0 = Shiboken::Buffer::newObject(data, dataSize, Shiboken::Buffer::ReadOnly);
|
||||
} else {
|
||||
%PYARG_0 = Shiboken::Buffer::newObject(data, dataSize, Shiboken::Buffer::ReadWrite);
|
||||
}
|
||||
</inject-code>
|
||||
</modify-function>
|
||||
<modify-function signature="read(int, void*, int)">
|
||||
|
|
|
|||
|
|
@ -38,16 +38,16 @@
|
|||
<enum-type name="Extension"/>
|
||||
</object-type>
|
||||
<object-type name="QScriptEngine">
|
||||
<enum-type name="QObjectWrapOption" flags="QScriptEngine::QObjectWrapOptions"/>
|
||||
<enum-type name="QObjectWrapOption" flags="QObjectWrapOptions"/>
|
||||
<enum-type name="ValueOwnership"/>
|
||||
</object-type>
|
||||
<object-type name="QScriptExtensionInterface"/>
|
||||
<object-type name="QScriptExtensionPlugin"/>
|
||||
<value-type name="QScriptProgram"/>
|
||||
<value-type name="QScriptProgram" since="4.7"/>
|
||||
<value-type name="QScriptString"/>
|
||||
<value-type name="QScriptValue">
|
||||
<enum-type name="PropertyFlag" flags="QScriptValue::PropertyFlags"/>
|
||||
<enum-type name="ResolveFlag" flags="QScriptValue::ResolveFlags"/>
|
||||
<enum-type name="PropertyFlag" flags="PropertyFlags"/>
|
||||
<enum-type name="ResolveFlag" flags="ResolveFlags"/>
|
||||
<enum-type name="SpecialValue"/>
|
||||
</value-type>
|
||||
<object-type name="QScriptValueIterator"/>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<object-type name="QScriptEngineDebugger">
|
||||
<enum-type name="DebuggerAction"/>
|
||||
<enum-type name="DebuggerState"/>
|
||||
<enum-type name="DebuggerState" since="4.6"/>
|
||||
<enum-type name="DebuggerWidget"/>
|
||||
<extra-includes>
|
||||
<include file-name="QScriptEngine" location="global"/>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
<namespace-type name="QSql">
|
||||
<enum-type name="Location"/>
|
||||
<enum-type name="ParamTypeFlag" flags="QSql::ParamType"/>
|
||||
<enum-type name="ParamTypeFlag" flags="ParamType"/>
|
||||
<enum-type name="TableType"/>
|
||||
<enum-type name="NumericalPrecisionPolicy"/>
|
||||
<extra-includes>
|
||||
|
|
@ -113,7 +113,9 @@
|
|||
<modify-function signature="commitTransaction()" allow-thread="yes" />
|
||||
<modify-function signature="rollbackTransaction()" allow-thread="yes" />
|
||||
<modify-function signature="open(const QString &, const QString&, const QString&, const QString&, int, const QString&)" allow-thread="yes" />
|
||||
<!-- ### This is too low level for Python, and pointer would be useless for the Python programmer -->
|
||||
<modify-function signature="handle() const" remove="all"/>
|
||||
<!-- ### -->
|
||||
</object-type>
|
||||
|
||||
<object-type name="QSqlQueryModel">
|
||||
|
|
@ -143,7 +145,9 @@
|
|||
<include file-name="QStringList" location="global"/>
|
||||
<include file-name="QSize" location="global"/>
|
||||
</extra-includes>
|
||||
<!-- ### This isn't part of Qt public API -->
|
||||
<modify-function signature="virtual_hook(int,void*)" remove="all" />
|
||||
<!-- ### -->
|
||||
<modify-function signature="exec()" rename="exec_" allow-thread="yes" />
|
||||
<modify-function signature="fetchLast()" allow-thread="yes" />
|
||||
<modify-function signature="fetchFirst()" allow-thread="yes" />
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<object-type name="QSvgGenerator">
|
||||
<modify-function signature="setOutputDevice(QIODevice*)">
|
||||
<modify-argument index="1">
|
||||
<reference-count action="add"/>
|
||||
<reference-count action="set"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,17 @@
|
|||
project(QtTest)
|
||||
|
||||
if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 6)
|
||||
set(QtTest_46_SRC "")
|
||||
else()
|
||||
set(QtTest_46_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_pysideqtoucheventsequence_wrapper.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set(QtTest_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qtest_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtTest/qttest_module_wrapper.cpp
|
||||
${QtTest_46_SRC}
|
||||
)
|
||||
|
||||
set(QtTest_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
|
||||
|
|
|
|||
|
|
@ -51,11 +51,12 @@
|
|||
<rejection class="QTest" function-name="toString<ushort>"/>
|
||||
|
||||
<rejection class="QTest" function-name="compare_helper"/>
|
||||
<rejection class="QTest" function-name="touchEvent"/>
|
||||
|
||||
<namespace-type name="QTest">
|
||||
<enum-type name="AttributeIndex"/>
|
||||
<enum-type name="AttributeIndex" since="4.6"/>
|
||||
<enum-type name="KeyAction"/>
|
||||
<enum-type name="LogElementType"/>
|
||||
<enum-type name="LogElementType" since="4.6"/>
|
||||
<enum-type name="MouseAction"/>
|
||||
<enum-type name="QBenchmarkMetric" since="4.7"/>
|
||||
<enum-type name="SkipMode"/>
|
||||
|
|
@ -64,10 +65,36 @@
|
|||
<include file-name="QtTest" location="global"/>
|
||||
</extra-includes>
|
||||
<!--<modify-function signature="qCompare<char>(char">-->
|
||||
<rejection class="QTouchEventSequence"/>
|
||||
<object-type name="PySideQTouchEventSequence" target-lang-name="QTouchEventSequence" since="4.6" >
|
||||
<modify-function signature="press(int, const QPoint&, QWidget*)">
|
||||
<modify-argument index="return">
|
||||
<define-ownership class="target" owner="default"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="move(int, const QPoint&, QWidget*)">
|
||||
<modify-argument index="return">
|
||||
<define-ownership class="target" owner="default"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="release(int, const QPoint&, QWidget*)">
|
||||
<modify-argument index="return">
|
||||
<define-ownership class="target" owner="default"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="stationary(int)">
|
||||
<modify-argument index="return">
|
||||
<define-ownership class="target" owner="default"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
</object-type>
|
||||
<modify-function signature="generateTouchEvent(QWidget*, QTouchEvent::DeviceType)" rename="touchEvent" since="4.6">
|
||||
<modify-argument index="return">
|
||||
<define-ownership class="target" owner="target"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
</namespace-type>
|
||||
|
||||
<rejection class="QTouchEventSequence"/>
|
||||
|
||||
<rejection class="QSignalSpy"/>
|
||||
<rejection class="QTestEventList"/>
|
||||
</typesystem>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,40 @@
|
|||
Q_IMPORT_PLUGIN(uiplugin);
|
||||
</inject-code>
|
||||
<add-function signature="registerCustomWidget(PyObject*)" return-type="void">
|
||||
<modify-argument index="1">
|
||||
<rename to="customWidgetType" />
|
||||
</modify-argument>
|
||||
<inject-documentation format="target" mode="append">
|
||||
Registers a Python created custom widget to QUiLoader, so it can be recognized when
|
||||
loading a `.ui` file. The custom widget type is passed via the ``customWidgetType`` argument.
|
||||
This is needed when you want to override a virtual method of some widget in the interface,
|
||||
since duck punching will not work with widgets created by QUiLoader based on the contents
|
||||
of the `.ui` file.
|
||||
|
||||
(Remember that `duck punching virtual methods is an invitation for your own demise!
|
||||
<http://www.pyside.org/docs/shiboken/wordsofadvice.html#duck-punching-and-virtual-methods>`_)
|
||||
|
||||
Let's see an obvious example. If you want to create a new widget it's probable you'll end up
|
||||
overriding :class:`~PySide.QtGui.QWidget`'s :meth:`~PySide.QtGui.QWidget.paintEvent` method.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Circle(QWidget):
|
||||
def paintEvent(self, event):
|
||||
painter = QPainter(self)
|
||||
painter.setPen(self.pen)
|
||||
painter.setBrush(QBrush(self.color))
|
||||
painter.drawEllipse(event.rect().center(), 20, 20)
|
||||
|
||||
# ...
|
||||
|
||||
loader = QUiLoader()
|
||||
loader.registerCustomWidget(Circle)
|
||||
circle = loader.load('circle.ui')
|
||||
circle.show()
|
||||
|
||||
# ...
|
||||
</inject-documentation>
|
||||
<inject-code class="target" position="beginning">
|
||||
registerCustomWidget(%PYARG_1);
|
||||
%CPPSELF.addPluginPath(""); // force reload widgets
|
||||
|
|
@ -71,7 +105,7 @@
|
|||
<parent index="2" action="add"/>
|
||||
</modify-argument>
|
||||
<inject-code>
|
||||
//Avoid calling the original function: %CPPSELF.load
|
||||
// Avoid calling the original function: %CPPSELF.%FUNCTION_NAME()
|
||||
%PYARG_0 = quiloader_load_ui_from_device(%CPPSELF, %1, %2);
|
||||
</inject-code>
|
||||
</modify-function>
|
||||
|
|
@ -89,7 +123,7 @@
|
|||
<parent index="2" action="add"/>
|
||||
</modify-argument>
|
||||
<inject-code>
|
||||
//Avoid calling the original function: %CPPSELF.load
|
||||
// Avoid calling the original function: %CPPSELF.%FUNCTION_NAME()
|
||||
%PYARG_0 = quiloader_load_ui(%CPPSELF, %1, %2);
|
||||
</inject-code>
|
||||
</add-function>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ else ()
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebelement_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebelementcollection_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebinspector_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_errorpageextensionoption_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_errorpageextensionreturn_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qgraphicswebview_wrapper.cpp
|
||||
)
|
||||
endif ()
|
||||
|
|
@ -20,6 +22,10 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebhistoryitem_wrapper.cpp
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebhistory_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebhittestresult_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_choosemultiplefilesextensionoption_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_choosemultiplefilesextensionreturn_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_extensionoption_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpage_extensionreturn_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpluginfactory_mimetype_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpluginfactory_plugin_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtWebKit/qwebpluginfactory_wrapper.cpp
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<object-type name="QWebView">
|
||||
<modify-function signature="setPage(QWebPage*)">
|
||||
<modify-argument index="1">
|
||||
<reference-count action="add"/>
|
||||
<reference-count action="set"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="page() const">
|
||||
|
|
@ -47,14 +47,26 @@
|
|||
<modify-function signature="print(QPrinter*)const" rename="print_" />
|
||||
</object-type>
|
||||
<object-type name="QWebFrame">
|
||||
<enum-type name="RenderLayer"/>
|
||||
<enum-type name="RenderLayer" since="4.6"/>
|
||||
<modify-function signature="addToJavaScriptWindowObject(QString,QObject*)">
|
||||
<modify-argument index="2">
|
||||
<parent index="this" action="add"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<!-- TODO QMultiMap isn't implemented yet -->
|
||||
<modify-function signature="metaData()const" remove="all" />
|
||||
<modify-function signature="print(QPrinter*)const" rename="print_" />
|
||||
<modify-function signature="metaData()const">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="PyObject" />
|
||||
</modify-argument>
|
||||
<inject-code position="end">
|
||||
<insert-template name="convertFromMultiMap">
|
||||
<replace from="%MAP_NAME" to="%0"/>
|
||||
<replace from="%RETURN_NAME" to="%PYARG_0"/>
|
||||
<replace from="%KEY_TYPE" to="QString"/>
|
||||
<replace from="%VALUE_TYPE" to="QString"/>
|
||||
</insert-template>
|
||||
</inject-code>
|
||||
</modify-function>
|
||||
</object-type>
|
||||
|
||||
<object-type name="QWebSettings">
|
||||
|
|
@ -64,16 +76,70 @@
|
|||
<enum-type name="WebGraphic"/>
|
||||
</object-type>
|
||||
<object-type name="QWebPage">
|
||||
<enum-type name="ErrorDomain"/>
|
||||
<enum-type name="FindFlag" flags="QWebPage::FindFlags"/>
|
||||
<enum-type name="FindFlag" flags="FindFlags"/>
|
||||
<enum-type name="LinkDelegationPolicy"/>
|
||||
<enum-type name="NavigationType"/>
|
||||
<enum-type name="WebAction"/>
|
||||
<enum-type name="WebWindowType"/>
|
||||
<!-- Qt 4.6 -->
|
||||
<enum-type name="ErrorDomain"/>
|
||||
<enum-type name="ErrorDomain" since="4.6"/>
|
||||
<enum-type name="Extension"/>
|
||||
|
||||
<value-type name="ChooseMultipleFilesExtensionOption" />
|
||||
<value-type name="ChooseMultipleFilesExtensionReturn" />
|
||||
<value-type name="ErrorPageExtensionOption" since="4.6" />
|
||||
<value-type name="ErrorPageExtensionReturn" since="4.6" />
|
||||
<value-type name="ExtensionOption" />
|
||||
<value-type name="ExtensionReturn" />
|
||||
|
||||
<modify-function signature="extension(QWebPage::Extension, const QWebPage::ExtensionOption*, QWebPage::ExtensionReturn*)">
|
||||
<modify-argument index="2" invalidate-after-use="yes">
|
||||
<conversion-rule class="target">
|
||||
PyObject* %out = 0;
|
||||
// Cast the parameters according to the extension type
|
||||
if (extension == QWebPage::ChooseMultipleFilesExtension)
|
||||
%out = %CONVERTTOPYTHON[ChooseMultipleFilesExtensionOption*](reinterpret_cast<const ChooseMultipleFilesExtensionOption*>(option));
|
||||
#if QT_VERSION >= 0x040600
|
||||
else if (extension == QWebPage::ErrorPageExtension)
|
||||
%out = %CONVERTTOPYTHON[ErrorPageExtensionOption*](reinterpret_cast<const ErrorPageExtensionOption*>(option));
|
||||
#endif
|
||||
</conversion-rule>
|
||||
</modify-argument>
|
||||
<modify-argument index="3" invalidate-after-use="yes">
|
||||
<conversion-rule class="target">
|
||||
PyObject* %out = 0;
|
||||
// Cast the parameters according to the extension type
|
||||
if (extension == QWebPage::ChooseMultipleFilesExtension)
|
||||
%out = %CONVERTTOPYTHON[ChooseMultipleFilesExtensionReturn*](reinterpret_cast<const ChooseMultipleFilesExtensionReturn*>(output));
|
||||
#if QT_VERSION >= 0x040600
|
||||
else if (extension == QWebPage::ErrorPageExtension)
|
||||
%out = %CONVERTTOPYTHON[ErrorPageExtensionReturn*](reinterpret_cast<const ErrorPageExtensionReturn*>(output));
|
||||
#endif
|
||||
</conversion-rule>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
|
||||
<modify-function signature="setNetworkAccessManager(QNetworkAccessManager*)">
|
||||
<modify-argument index="1">
|
||||
<reference-count action="set"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="networkAccessManager()const">
|
||||
<modify-argument index="return">
|
||||
<reference-count action="set" variable-name="setNetworkAccessManager(QNetworkAccessManager*)1" />
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="view()const">
|
||||
<modify-argument index="return">
|
||||
<define-ownership owner="default"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="pluginFactory()const">
|
||||
<modify-argument index="return">
|
||||
<define-ownership owner="default"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
|
||||
<modify-function signature="javaScriptPrompt(QWebFrame*,const QString &,const QString &,QString*)">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="PyObject"/>
|
||||
|
|
@ -104,10 +170,25 @@
|
|||
<value-type name="QWebSecurityOrigin"/>
|
||||
|
||||
<!-- Qt 4.6 -->
|
||||
<object-type name="QGraphicsWebView"/>
|
||||
<object-type name="QWebInspector"/>
|
||||
<value-type name="QWebElement">
|
||||
<object-type name="QGraphicsWebView" since="4.6"/>
|
||||
<object-type name="QWebInspector" since="4.6"/>
|
||||
<value-type name="QWebElement" since="4.6">
|
||||
<enum-type name="StyleResolveStrategy"/>
|
||||
</value-type>
|
||||
<value-type name="QWebElementCollection"/>
|
||||
<value-type name="QWebElementCollection" since="4.6">
|
||||
<add-function signature="__len__">
|
||||
<inject-code>
|
||||
return %CPPSELF.count();
|
||||
</inject-code>
|
||||
</add-function>
|
||||
<add-function signature="__getitem__">
|
||||
<inject-code>
|
||||
if (_i < 0 || _i >= %CPPSELF.count()) {
|
||||
PyErr_SetString(PyExc_IndexError, "index out of bounds");
|
||||
return 0;
|
||||
}
|
||||
return %CONVERTTOPYTHON[QWebElement](%CPPSELF.at(_i));
|
||||
</inject-code>
|
||||
</add-function>
|
||||
</value-type>
|
||||
</typesystem>
|
||||
|
|
|
|||
|
|
@ -27,33 +27,23 @@
|
|||
<rejection class="QXmlInputSource" field-name="EndOfData"/>
|
||||
<rejection class="QXmlInputSource" field-name="EndOfDocument"/>
|
||||
|
||||
<value-type name="QDomAttr">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomCDATASection">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomCharacterData">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomComment">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
<value-type name="QDomAttr" />
|
||||
<value-type name="QDomCDATASection" />
|
||||
<value-type name="QDomCharacterData" />
|
||||
<value-type name="QDomComment" />
|
||||
|
||||
<template name="qdomdocument_setcontent">
|
||||
QString _errorMsg_;
|
||||
int _errorLine_ = 0;
|
||||
int _errorColumn_ = 0;
|
||||
|
||||
%BEGIN_ALLOW_THREADS
|
||||
bool _ret_ = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &_errorMsg_, &_errorLine_, &_errorColumn_);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(_ret_, _errorMsg_, _errorLine_, _errorColumn_);
|
||||
</template>
|
||||
|
||||
<value-type name="QDomDocument">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
|
||||
<!-- will be replaced in inject code -->
|
||||
<modify-function signature="setContent(const QByteArray&, bool, QString*, int*, int*)">
|
||||
<modify-argument index="3">
|
||||
|
|
@ -217,22 +207,10 @@
|
|||
</modify-function>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomDocumentFragment">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomDocumentType">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomEntity">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomEntityReference">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomDocumentFragment" />
|
||||
<value-type name="QDomDocumentType" />
|
||||
<value-type name="QDomEntity" />
|
||||
<value-type name="QDomEntityReference" />
|
||||
<value-type name="QDomImplementation">
|
||||
<enum-type name="InvalidDataPolicy"/>
|
||||
</value-type>
|
||||
|
|
@ -247,30 +225,13 @@
|
|||
</value-type>
|
||||
|
||||
<value-type name="QDomNodeList" />
|
||||
<value-type name="QDomNotation" />
|
||||
<value-type name="QDomProcessingInstruction" />
|
||||
|
||||
<value-type name="QDomNotation">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomProcessingInstruction">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
|
||||
<value-type name="QDomText">
|
||||
<modify-function signature="nodeType()const" remove="all"/>
|
||||
</value-type>
|
||||
<value-type name="QDomText" />
|
||||
|
||||
<object-type name="QXmlParseException"/>
|
||||
|
||||
<!-- These are defined in QtCore
|
||||
<value-type name="QXmlStreamAttribute"/>
|
||||
<value-type name="QXmlStreamAttributes"/>
|
||||
|
||||
<value-type name="QXmlStreamNamespaceDeclaration"/>
|
||||
<value-type name="QXmlStreamNotationDeclaration"/>
|
||||
<value-type name="QXmlStreamEntityDeclaration"/>
|
||||
-->
|
||||
|
||||
<value-type name="QXmlAttributes"/>
|
||||
|
||||
<object-type name="QXmlNamespaceSupport"/>
|
||||
|
|
@ -309,7 +270,11 @@
|
|||
</modify-argument>
|
||||
<inject-code class="target" position="end">
|
||||
QXmlInputSource* _qxmlinputsource_arg_ = 0;
|
||||
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
|
||||
%END_ALLOW_THREADS
|
||||
|
||||
%PYARG_0 = Shiboken::makeTuple(%0, _qxmlinputsource_arg_);
|
||||
</inject-code>
|
||||
</modify-function>
|
||||
|
|
@ -332,7 +297,9 @@
|
|||
</modify-argument>
|
||||
<inject-code class="target" position="end">
|
||||
QXmlInputSource* _qxmlinputsource_arg_ = 0;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE %0 = %CPPSELF.%TYPE::%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(%0, _qxmlinputsource_arg_);
|
||||
</inject-code>
|
||||
</modify-function>
|
||||
|
|
@ -340,16 +307,6 @@
|
|||
<object-type name="QXmlInputSource"/>
|
||||
<object-type name="QXmlLocator"/>
|
||||
|
||||
<!-- These are defined already in QtCore
|
||||
<object-type name="QXmlStreamReader">
|
||||
<enum-type name="Error" />
|
||||
<enum-type name="TokenType" />
|
||||
</object-type>
|
||||
|
||||
<object-type name="QXmlStreamWriter">
|
||||
</object-type>
|
||||
-->
|
||||
|
||||
<object-type name="QXmlReader">
|
||||
<modify-function signature="parse(const QXmlInputSource*)">
|
||||
<modify-argument index="1" invalidate-after-use="yes"/>
|
||||
|
|
@ -452,9 +409,5 @@
|
|||
</inject-code>
|
||||
</modify-function>
|
||||
</object-type>
|
||||
|
||||
<suppress-warning text="Shadowing: QDomNode::attributes() const and QDomElement::attributes() const"/>
|
||||
<suppress-warning text="Shadowing: QDomNode::nodeType() const and QDomElement::nodeType() const"/>
|
||||
|
||||
</typesystem>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
<typesystem package="PySide.QtXmlPatterns">
|
||||
<load-typesystem name="typesystem_core.xml" generate="no"/>
|
||||
|
||||
<object-type name="QXmlSchema"/> <!-- Qt scoped pointer does not allow declare this as value type -->
|
||||
<object-type name="QXmlSchemaValidator">
|
||||
<object-type name="QXmlSchema" since="4.6" /> <!-- Qt scoped pointer does not allow declare this as value type -->
|
||||
<object-type name="QXmlSchemaValidator" since="4.6">
|
||||
<modify-function signature="schema() const">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="QXmlSchema*"/>
|
||||
|
|
@ -44,6 +44,7 @@
|
|||
<object-type name="QXmlFormatter" />
|
||||
<value-type name="QXmlItem" />
|
||||
<value-type name="QXmlName">
|
||||
<!-- ### These methods aren't part of Qt public API -->
|
||||
<modify-function signature="QXmlName(short, short, short)" remove="all" />
|
||||
<modify-function signature="setNamespaceURI(short)" remove="all" />
|
||||
<modify-function signature="localName()const" remove="all" />
|
||||
|
|
@ -55,14 +56,19 @@
|
|||
<modify-function signature="setPrefix(short)" remove="all" />
|
||||
<modify-function signature="setLocalName(short)" remove="all" />
|
||||
<modify-function signature="code()const" remove="all" />
|
||||
<!-- ### -->
|
||||
</value-type>
|
||||
<value-type name="QXmlNamePool" />
|
||||
|
||||
<rejection class="QXmlNodeModelIndex" function-name="type" />
|
||||
<rejection class="QXmlNodeModelIndex" function-name="sequencedTypedValue" />
|
||||
<rejection class="QXmlNodeModelIndex" function-name="iterate" />
|
||||
<!-- ### This enum isn't part of Qt public API -->
|
||||
<suppress-warning text="enum 'QXmlNodeModelIndex::Axis' does not have a type entry or is not an enum"/>
|
||||
<value-type name="QXmlNodeModelIndex">
|
||||
<enum-type name="Axis"/>
|
||||
<enum-type name="DocumentOrder" />
|
||||
<enum-type name="NodeKind" />
|
||||
<modify-function signature="internalPointer()const" remove="all" />
|
||||
<!-- Qt internal methods -->
|
||||
<!-- ### Qt internal methods -->
|
||||
<modify-function signature="name()const" remove="all" />
|
||||
<modify-function signature="root()const" remove="all" />
|
||||
<modify-function signature="documentUri()const" remove="all" />
|
||||
|
|
@ -76,6 +82,7 @@
|
|||
<modify-function signature="stringValue()const" remove="all" />
|
||||
<modify-function signature="is(const QXmlNodeModelIndex &)const" remove="all" />
|
||||
<modify-function signature="reset()" remove="all" />
|
||||
<!-- ### -->
|
||||
</value-type>
|
||||
|
||||
<value-type name="QXmlQuery">
|
||||
|
|
@ -84,7 +91,6 @@
|
|||
<object-type name="QXmlResultItems" />
|
||||
<object-type name="QXmlSerializer" />
|
||||
|
||||
|
||||
<suppress-warning text="unhandled enum value: ForwardAxis in QXmlNodeModelIndex::Axis"/>
|
||||
<suppress-warning text="unhandled enum value: ReverseAxis in QXmlNodeModelIndex::Axis"/>
|
||||
<suppress-warning text="class 'QAbstractXmlNodeModel' inherits from unknown base class 'QSharedData'"/>
|
||||
<suppress-warning text="class not found for setup inheritance 'QSharedData'"/>
|
||||
</typesystem>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
__all__ = ['QtCore', 'QtGui', 'QtNetwork', 'QtOpenGL', 'QtSql', 'QtSvg', 'QtTest', 'QtWebKit', 'QtScript']
|
||||
import private
|
||||
|
||||
__version__ = "@BINDING_API_VERSION@"
|
||||
__version_info__ = (@BINDING_API_MAJOR_VERSION@, @BINDING_API_MINOR_VERSION@, @BINDING_API_MICRO_VERSION@)
|
||||
__version__ = "@BINDING_API_VERSION_FULL@"
|
||||
__version_info__ = (@BINDING_API_MAJOR_VERSION@, @BINDING_API_MINOR_VERSION@, @BINDING_API_MICRO_VERSION@, "@BINDING_API_RELEASE_LEVEL@", @BINDING_API_SERIAL@)
|
||||
|
|
|
|||
1198
PySide/global.h.in
1198
PySide/global.h.in
File diff suppressed because it is too large
Load diff
|
|
@ -5,6 +5,10 @@ if (NOT QT_PHONON_INCLUDE_DIR AND CMAKE_HOST_APPLE)
|
|||
set(QT_PHONON_INCLUDE_DIR "${QT_LIBRARY_DIR}/phonon.framework/Headers")
|
||||
endif ()
|
||||
|
||||
set(phonon_OPTIONAL_SRC )
|
||||
set(phonon_DROPPED_ENTRIES )
|
||||
check_qt_class(phonon VideoCaptureDevice phonon_OPTIONAL_SRC phonon_DROPPED_ENTRIES Phonon ObjectDescription)
|
||||
|
||||
set(phonon_SRC
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_abstractaudiooutput_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_abstractmediastream_wrapper.cpp
|
||||
|
|
@ -42,10 +46,9 @@ ${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumefaderinterface_wrapper.cp
|
|||
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_volumeslider_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_wrapper.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/PySide/phonon/phonon_backendcapabilities_notifierwrapper_wrapper.cpp
|
||||
${phonon_OPTIONAL_SRC}
|
||||
)
|
||||
|
||||
check_qt_class("phonon" "VideoCaptureDevice" phonon_SRC "Phonon" "ObjectDescription")
|
||||
|
||||
set(phonon_typesystem_path "${QtCore_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${phonon_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}")
|
||||
set(phonon_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${QT_QTCORE_INCLUDE_DIR}
|
||||
|
|
@ -70,4 +73,6 @@ create_pyside_module(phonon
|
|||
phonon_deps
|
||||
phonon_typesystem_path
|
||||
phonon_SRC
|
||||
"")
|
||||
""
|
||||
""
|
||||
phonon_DROPPED_ENTRIES)
|
||||
|
|
|
|||
|
|
@ -78,20 +78,22 @@
|
|||
<include file-name="backendcapabilities.h" location="global"/>
|
||||
<include file-name="pyside_phonon.h" location="local"/>
|
||||
|
||||
<!-- ### This isn't part of Qt public API -->
|
||||
<modify-function signature="notifier()" remove="all"/>
|
||||
<modify-function signature="Phonon::BackendCapabilities::NotifierWrapper(Phonon::BackendCapabilities::Notifier*)">
|
||||
<access modifier="private"/>
|
||||
</modify-function>
|
||||
</modify-function>
|
||||
<!-- ### -->
|
||||
<inject-code class="target" position="end">
|
||||
PySideSignal* signal_item;
|
||||
|
||||
signal_item = PySide::Signal::newObject("capabilitiesChanged", "void", NULL);
|
||||
PyDict_SetItemString(Sbk_Phonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "capabilitiesChanged", (PyObject*)signal_item);
|
||||
Py_DECREF(signal_item);
|
||||
Py_DECREF((PyObject*)signal_item);
|
||||
|
||||
signal_item = PySide::Signal::newObject("availableAudioOutputDevicesChanged", "void", NULL);
|
||||
PyDict_SetItemString( Sbk_Phonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "availableAudioOutputDevicesChanged", (PyObject*)signal_item);
|
||||
Py_DECREF(signal_item);
|
||||
Py_DECREF((PyObject*)signal_item);
|
||||
</inject-code>
|
||||
</object-type>
|
||||
</namespace-type>
|
||||
|
|
@ -102,6 +104,7 @@
|
|||
<enum-type name="MetaData"/>
|
||||
<enum-type name="ObjectDescriptionType"/>
|
||||
<enum-type name="State"/>
|
||||
<enum-type name="CaptureCategory"/>
|
||||
|
||||
<object-type name="AbstractVideoOutput"/>
|
||||
<object-type name="AddonInterface">
|
||||
|
|
@ -126,22 +129,20 @@
|
|||
<object-type name="VolumeFaderInterface"/>
|
||||
|
||||
<value-type name="EffectParameter">
|
||||
<enum-type name="Hint" flags="Phonon::EffectParameter::Hints"/>
|
||||
<modify-function signature="EffectParameter()" remove="all"/> <!-- internal -->
|
||||
<modify-function signature="operator<(const Phonon::EffectParameter &)const" remove="all"/> <!-- internal -->
|
||||
<modify-function signature="operator>(const Phonon::EffectParameter &)const" remove="all"/> <!-- internal -->
|
||||
<modify-function signature="id()const" remove="all"/> <!-- internal -->
|
||||
<modify-function signature="operator=(Phonon::EffectParameter)" remove="all"/> <!-- Covered by copy constructor -->
|
||||
<modify-function signature="EffectParameter(Phonon::EffectParameter)" remove="all"/>
|
||||
<enum-type name="Hint" flags="Hints"/>
|
||||
<!-- ### Internal methods and ctors -->
|
||||
<modify-function signature="EffectParameter()" remove="all"/>
|
||||
<modify-function signature="operator<(const Phonon::EffectParameter &)const" remove="all"/>
|
||||
<modify-function signature="operator>(const Phonon::EffectParameter &)const" remove="all"/>
|
||||
<modify-function signature="id()const" remove="all"/>
|
||||
<modify-function signature="operator==(Phonon::EffectParameter)const" remove="all"/>
|
||||
<!-- ### -->
|
||||
</value-type>
|
||||
<value-type name="MediaSource">
|
||||
<enum-type name="Type"/>
|
||||
<modify-function signature="operator=(Phonon::MediaSource)" remove="all"/> <!-- Covered by copy constructor -->
|
||||
</value-type>
|
||||
<value-type name="Path">
|
||||
<modify-function signature="disconnect()" rename="disconnectPath"/>
|
||||
<modify-function signature="operator=(Phonon::Path)" remove="all"/> <!-- Covered by copy constructor -->
|
||||
<modify-function signature="insertEffect(Phonon::EffectDescription,Phonon::Effect*)">
|
||||
<modify-argument index="1">
|
||||
<parent index="this" action="add"/>
|
||||
|
|
@ -170,37 +171,90 @@
|
|||
</value-type>
|
||||
<value-type name="ObjectDescription" generate="no"/>
|
||||
<value-type name="EffectDescription">
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="fromIndex(int)" remove="all"/>
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::EffectDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::EffectDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="fromIndex(int)">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="EffectDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
</value-type>
|
||||
<value-type name="AudioOutputDevice">
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="fromIndex(int)" remove="all"/>
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::AudioOutputDevice"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::AudioOutputDevice"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="fromIndex(int)">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="AudioOutputDevice"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
</value-type>
|
||||
<value-type name="AudioCaptureDevice">
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="fromIndex(int)" remove="all"/>
|
||||
</value-type>
|
||||
<value-type name="VideoCaptureDevice">
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="fromIndex(int)" remove="all"/>
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::AudioCaptureDevice"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::AudioCaptureDevice"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="fromIndex(int)">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="AudioCaptureDevice"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
</value-type>
|
||||
<value-type name="AudioChannelDescription">
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="fromIndex(int)" remove="all"/>
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::AudioChannelDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::AudioChannelDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="fromIndex(int)">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="AudioChannelDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
</value-type>
|
||||
<value-type name="SubtitleDescription">
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const" remove="all"/>
|
||||
<modify-function signature="fromIndex(int)" remove="all"/>
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::SubtitleDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::SubtitleDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="fromIndex(int)">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="SubtitleDescription"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
</value-type>
|
||||
|
||||
|
||||
<object-type name="ObjectDescriptionModel" generate="no"/>
|
||||
<object-type name="EffectDescriptionModel" />
|
||||
<object-type name="AudioOutputDeviceModel" />
|
||||
|
|
@ -211,7 +265,8 @@
|
|||
<object-type name="Effect"/>
|
||||
<object-type name="EffectWidget"/>
|
||||
<object-type name="MediaController">
|
||||
<enum-type name="Feature" flags="Phonon::MediaController::Features"/>
|
||||
<enum-type name="Feature" flags="Features"/>
|
||||
<enum-type name="NavigationMenu"/>
|
||||
</object-type>
|
||||
<object-type name="MediaObject" />
|
||||
<object-type name="SeekSlider">
|
||||
|
|
@ -236,6 +291,25 @@
|
|||
</modify-argument>
|
||||
</modify-function>
|
||||
</object-type>
|
||||
</namespace-type>
|
||||
|
||||
<!-- ### The following entries may be present in the system or not. Keep this section organized. -->
|
||||
<value-type name="VideoCaptureDevice">
|
||||
<modify-function signature="operator==(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::VideoCaptureDevice" />
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="operator!=(Phonon::ObjectDescription)const">
|
||||
<modify-argument index="1">
|
||||
<replace-type modified-type="Phonon::VideoCaptureDevice"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
<modify-function signature="fromIndex(int)">
|
||||
<modify-argument index="return">
|
||||
<replace-type modified-type="VideoCaptureDevice"/>
|
||||
</modify-argument>
|
||||
</modify-function>
|
||||
</value-type>
|
||||
<!-- ### -->
|
||||
</namespace-type>
|
||||
</typesystem>
|
||||
|
|
|
|||
147
PySide/pysideqtesttouch.h
Normal file
147
PySide/pysideqtesttouch.h
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtTest module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef PYSIDEQTESTTOUCH_H
|
||||
#define PYSIDEQTESTTOUCH_H
|
||||
|
||||
#include <QtTest/qtest_global.h>
|
||||
#include <QtTest/qtestassert.h>
|
||||
#include <QtTest/qtestsystem.h>
|
||||
#include <QtTest/qtestspontaneevent.h>
|
||||
#include <QtTest/qtesttouch.h>
|
||||
|
||||
#include <QtCore/qmap.h>
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QtGui/qwidget.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QTest
|
||||
{
|
||||
|
||||
class PySideQTouchEventSequence
|
||||
{
|
||||
public:
|
||||
~PySideQTouchEventSequence()
|
||||
{
|
||||
commit();
|
||||
}
|
||||
|
||||
PySideQTouchEventSequence* press(int touchId, const QPoint &pt, QWidget *widget = 0)
|
||||
{
|
||||
QTouchEvent::TouchPoint &p = point(touchId);
|
||||
p.setScreenPos(mapToScreen(widget, pt));
|
||||
p.setState(Qt::TouchPointPressed);
|
||||
return this;
|
||||
}
|
||||
|
||||
PySideQTouchEventSequence* move(int touchId, const QPoint &pt, QWidget *widget = 0)
|
||||
{
|
||||
QTouchEvent::TouchPoint &p = point(touchId);
|
||||
p.setScreenPos(mapToScreen(widget, pt));
|
||||
p.setState(Qt::TouchPointMoved);
|
||||
return this;
|
||||
}
|
||||
|
||||
PySideQTouchEventSequence* release(int touchId, const QPoint &pt, QWidget *widget = 0)
|
||||
{
|
||||
QTouchEvent::TouchPoint &p = point(touchId);
|
||||
p.setScreenPos(mapToScreen(widget, pt));
|
||||
p.setState(Qt::TouchPointReleased);
|
||||
return this;
|
||||
}
|
||||
|
||||
PySideQTouchEventSequence* stationary(int touchId)
|
||||
{
|
||||
QTouchEvent::TouchPoint &p = point(touchId);
|
||||
p.setState(Qt::TouchPointStationary);
|
||||
return this;
|
||||
}
|
||||
|
||||
void commit()
|
||||
{
|
||||
qt_translateRawTouchEvent(targetWidget, deviceType, points.values());
|
||||
targetWidget = 0;
|
||||
points.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
PySideQTouchEventSequence(QWidget *widget, QTouchEvent::DeviceType aDeviceType)
|
||||
: targetWidget(widget), deviceType(aDeviceType)
|
||||
{
|
||||
}
|
||||
|
||||
PySideQTouchEventSequence(const PySideQTouchEventSequence &v);
|
||||
|
||||
void operator=(const PySideQTouchEventSequence&);
|
||||
|
||||
QTouchEvent::TouchPoint &point(int touchId)
|
||||
{
|
||||
if (!points.contains(touchId))
|
||||
points[touchId] = QTouchEvent::TouchPoint(touchId);
|
||||
return points[touchId];
|
||||
}
|
||||
|
||||
QPoint mapToScreen(QWidget *widget, const QPoint &pt)
|
||||
{
|
||||
if (widget)
|
||||
return widget->mapToGlobal(pt);
|
||||
return targetWidget ? targetWidget->mapToGlobal(pt) : pt;
|
||||
}
|
||||
|
||||
QMap<int, QTouchEvent::TouchPoint> points;
|
||||
QWidget *targetWidget;
|
||||
QTouchEvent::DeviceType deviceType;
|
||||
friend PySideQTouchEventSequence* generateTouchEvent(QWidget *, QTouchEvent::DeviceType);
|
||||
};
|
||||
|
||||
inline
|
||||
PySideQTouchEventSequence* generateTouchEvent(QWidget *widget = 0,
|
||||
QTouchEvent::DeviceType deviceType = QTouchEvent::TouchScreen)
|
||||
{
|
||||
return new PySideQTouchEventSequence(widget, deviceType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // PYSIDEQTESTTOUCH_H
|
||||
27
PySide/pysidewtypes.h
Normal file
27
PySide/pysidewtypes.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef __PYSIDEWTYPES__
|
||||
#define __PYSIDEWTYPES__
|
||||
|
||||
typedef struct HWND__ *HWND;
|
||||
typedef unsigned UINT;
|
||||
typedef long LONG;
|
||||
typedef unsigned long DWORD;
|
||||
typedef UINT WPARAM;
|
||||
typedef LONG LPARAM;
|
||||
|
||||
struct POINT
|
||||
{
|
||||
LONG x;
|
||||
LONG y;
|
||||
};
|
||||
|
||||
struct MSG
|
||||
{
|
||||
HWND hwnd;
|
||||
UINT message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
DWORD time;
|
||||
POINT pt;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -31,47 +31,65 @@
|
|||
<!-- Templates to fix bool* parameters -->
|
||||
<template name="fix_bool*">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&ok_);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="fix_args,bool*">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &ok_);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="fix_arg,bool*,arg">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, &ok_, %3);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="fix_bool*,arg">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&ok_, %2);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="fix_bool*,arg,arg">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&ok_, %2, %3);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="fix_bool*,arg,arg,arg">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&ok_, %2, %3, %4);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="fix_arg,arg,arg,arg,arg,arg,arg,bool*,arg">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, &ok_, %9);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="fix_arg,arg,arg,arg,arg,arg,bool*,arg">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, &ok_, %8);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="fix_arg,arg,arg,arg,arg,bool*,arg">
|
||||
bool ok_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, &ok_, %7);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, ok_);
|
||||
</template>
|
||||
<template name="get_slice">
|
||||
|
|
@ -102,36 +120,66 @@
|
|||
|
||||
<template name="fix_args,QRectF*">
|
||||
QRectF rect_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &rect_);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = %CONVERTTOPYTHON[QRectF](rect_);
|
||||
</template>
|
||||
|
||||
<template name="fix_args,QRect*">
|
||||
QRect rect_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &rect_);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = %CONVERTTOPYTHON[QRect](rect_);
|
||||
</template>
|
||||
|
||||
<template name="fix_char*">
|
||||
char val_;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&val_);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, val_);
|
||||
</template>
|
||||
|
||||
<template name="fix_int*,int*,int*,int*">
|
||||
int a, b, c, d;
|
||||
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
||||
<template name="fix_number*,number*,number*,number*">
|
||||
$TYPE a, b, c, d;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%CPPSELF->::%TYPE::%FUNCTION_NAME(&a, &b, &c, &d);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||
</template>
|
||||
<template name="fix_qreal*,qreal*,qreal*,qreal*">
|
||||
qreal a, b, c, d;
|
||||
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
||||
|
||||
<template name="fix_number*,number*,number*,number*,args">
|
||||
$TYPE a, b, c, d;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%CPPSELF->::%TYPE::%FUNCTION_NAME(&a, &b, &c, &d, %ARGUMENT_NAMES);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||
</template>
|
||||
|
||||
<template name="fix_native_return_number*,number*,number*,number*">
|
||||
PyObject* _obj = %PYARG_0.object();
|
||||
if (!PySequence_Check(_obj)
|
||||
|| PySequence_Fast_GET_SIZE(_obj) != 4
|
||||
|| !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 0))
|
||||
|| !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 1))
|
||||
|| !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 2))
|
||||
|| !SbkNumber_Check(PySequence_Fast_GET_ITEM(_obj, 3))) {
|
||||
PyErr_SetString(PyExc_TypeError, "Sequence of 4 numbers expected");
|
||||
} else {
|
||||
*%1 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 0));
|
||||
*%2 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 1));
|
||||
*%3 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 2));
|
||||
*%4 = %CONVERTTOCPP[$TYPE](PySequence_Fast_GET_ITEM(_obj, 3));
|
||||
}
|
||||
</template>
|
||||
|
||||
<template name="fix_int*,int*,int*,int*,int*">
|
||||
int a, b, c, d, e;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d, &e);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(a, b, c, d, e);
|
||||
</template>
|
||||
<template name="fix_qreal*,qreal*,qreal*,qreal*,qreal*">
|
||||
|
|
@ -150,10 +198,20 @@
|
|||
<template name="fix_return_args,int*">
|
||||
RETURNTYPE _ret;
|
||||
int _arg;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
_ret = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &_arg);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(_ret, _arg);
|
||||
</template>
|
||||
|
||||
<template name="fix_args,number*,number*">
|
||||
$TYPE a, b;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES, &a, &b);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(a, b);
|
||||
</template>
|
||||
|
||||
<template name="fix_virtual_method_return_value_and_bool*">
|
||||
Shiboken::AutoDecRef _py_ret_(PySequence_GetItem(%PYARG_0, 0));
|
||||
Shiboken::AutoDecRef _py_ok_(PySequence_GetItem(%PYARG_0, 1));
|
||||
|
|
@ -164,7 +222,9 @@
|
|||
<template name="fix_arg,int*,int*">
|
||||
%RETURN_TYPE _ret;
|
||||
int a, b;
|
||||
%BEGIN_ALLOW_THREADS
|
||||
_ret = %CPPSELF.%FUNCTION_NAME(%1, &a, &b);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(_ret, a, b);
|
||||
</template>
|
||||
|
||||
|
|
@ -173,25 +233,55 @@
|
|||
</template>
|
||||
|
||||
<template name="return_tuple_QValidator_QString_int">
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %RETURN_TYPE(%CPPSELF.%FUNCTION_NAME(%1, %2));
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, %1, %2);
|
||||
</template>
|
||||
|
||||
<template name="return_for_QFileDialog">
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5);
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, %4);
|
||||
%BEGIN_ALLOW_THREADS
|
||||
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, &%5, %6);
|
||||
%END_ALLOW_THREADS
|
||||
%PYARG_0 = Shiboken::makeTuple(retval_, %5);
|
||||
</template>
|
||||
<template name="set_qapp_parent_for_orphan">
|
||||
SbkObject* _pySelf = reinterpret_cast<SbkObject*>(%PYARG_0);
|
||||
if (!Shiboken::Object::hasParentInfo(_pySelf))
|
||||
Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
|
||||
</template>
|
||||
<!-- templates for __repr__ -->
|
||||
<template name="repr_code">
|
||||
QString format = QString().sprintf("%s(%REPR_FORMAT)", ((PyObject*)%PYSELF)->ob_type->tp_name, %REPR_ARGS);
|
||||
%PYARG_0 = PyString_FromString(qPrintable(format));
|
||||
</template>
|
||||
<template name="repr_code_matrix">
|
||||
QString format= QString("%1((").arg(((PyObject*)%PYSELF)->ob_type->tp_name);
|
||||
|
||||
QList< %MATRIX_TYPE > cppArgs;
|
||||
%MATRIX_TYPE data[%MATRIX_SIZE];
|
||||
%CPPSELF.copyDataTo(data);
|
||||
int matrixSize = %MATRIX_SIZE;
|
||||
for(int size=0; size < matrixSize; size++) {
|
||||
if (size > 0)
|
||||
format += ", ";
|
||||
format += QString::number(data[size]);
|
||||
}
|
||||
format += "))";
|
||||
|
||||
%PYARG_0 = PyString_FromString(qPrintable(format));
|
||||
</template>
|
||||
|
||||
<template name="return_internal_pointer">
|
||||
%PYARG_0 = reinterpret_cast<PyObject*>(%CPPSELF.%FUNCTION_NAME());
|
||||
if (!%PYARG_0)
|
||||
%PYARG_0 = Py_None;
|
||||
Py_INCREF(%PYARG_0);
|
||||
</template>
|
||||
|
||||
<!-- templates for __reduce__ -->
|
||||
<template name="reduce_code">
|
||||
PyObject *type = PyObject_Type(%PYSELF);
|
||||
PyObject *args = NULL;
|
||||
args = Py_BuildValue("%REDUCE_FORMAT", %REDUCE_ARGS);
|
||||
%PYARG_0 = Py_BuildValue("(NN)", type, args);
|
||||
%PYARG_0 = Py_BuildValue("(N(%REDUCE_FORMAT))", PyObject_Type(%PYSELF), %REDUCE_ARGS);
|
||||
</template>
|
||||
<template name="reduce_code_matrix">
|
||||
QList< %MATRIX_TYPE > cppArgs;
|
||||
|
|
@ -209,7 +299,7 @@
|
|||
<!-- Matrix Aux functions -->
|
||||
<template name="matrix_constructor">
|
||||
if (PySequence_Size(%PYARG_1) == %SIZE) {
|
||||
Shiboken::AutoDecRef fast(PySequence_Fast(%PYARG_1, "Fail to parse sequnce on %TYPE constructor."));
|
||||
Shiboken::AutoDecRef fast(PySequence_Fast(%PYARG_1, "Failed to parse sequence on %TYPE constructor."));
|
||||
qreal values[%SIZE];
|
||||
for(int i=0; i < %SIZE; i++) {
|
||||
PyObject *pv = PySequence_Fast_GET_ITEM(fast.object(), i);
|
||||
|
|
@ -238,5 +328,44 @@
|
|||
return %CONVERTTOPYTHON[%TRANSPOSED_TYPE](%CPPSELF.transposed());
|
||||
</template>
|
||||
|
||||
<!-- Replace '#' for the argument number you want. -->
|
||||
<template name="return_argument">
|
||||
Py_INCREF(%PYARG_#);
|
||||
%PYARG_0 = %PYARG_#;
|
||||
</template>
|
||||
|
||||
<!-- Iterator -->
|
||||
<template name="__iter__">
|
||||
Py_INCREF(%PYSELF);
|
||||
%PYARG_0 = %PYSELF;
|
||||
</template>
|
||||
|
||||
<template name="__iter_parent__">
|
||||
%PYARG_0 = %CONVERTTOPYTHON[%CPPSELF_TYPE](%CPPSELF.begin());
|
||||
</template>
|
||||
|
||||
<template name="__next__">
|
||||
if (!%CPPSELF.atEnd())
|
||||
%PYARG_0 = %CONVERTTOPYTHON[%CPPSELF_TYPE]((*%CPPSELF)++);
|
||||
</template>
|
||||
|
||||
<template name="convertFromMultiMap">
|
||||
%RETURN_NAME = PyDict_New();
|
||||
foreach(%KEY_TYPE _key, %MAP_NAME.keys()) {
|
||||
Shiboken::AutoDecRef _pyValueList(PyList_New(0));
|
||||
foreach(%VALUE_TYPE _value, %MAP_NAME.values(_key)) {
|
||||
Shiboken::AutoDecRef _pyValue(%CONVERTTOPYTHON[%VALUE_TYPE](_value));
|
||||
PyList_Append(_pyValueList, _pyValue);
|
||||
}
|
||||
|
||||
Shiboken::AutoDecRef _pyKey(%CONVERTTOPYTHON[%KEY_TYPE](_key));
|
||||
PyDict_SetItem(%RETURN_NAME, _pyKey, _pyValueList);
|
||||
}
|
||||
</template>
|
||||
|
||||
<template name="to_tuple">
|
||||
%PYARG_0 = Py_BuildValue("%TT_FORMAT", %TT_ARGS);
|
||||
</template>
|
||||
|
||||
</typesystem>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources typesystem_name)
|
||||
macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources module_static_sources)
|
||||
string(TOLOWER ${module_name} _module)
|
||||
string(REGEX REPLACE ^qt "" _module ${_module})
|
||||
|
||||
if(${ARGC} GREATER 7)
|
||||
set (typesystem_name ${ARGV7})
|
||||
else()
|
||||
set (typesystem_name "")
|
||||
endif()
|
||||
if(${ARGC} GREATER 8)
|
||||
string(REPLACE ";" "\\;" dropped_entries "${${ARGV8}}")
|
||||
else()
|
||||
set (dropped_entries "")
|
||||
endif()
|
||||
|
||||
if (NOT EXISTS ${typesystem_name})
|
||||
set(typesystem_path ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_${_module}.xml)
|
||||
else()
|
||||
|
|
@ -9,18 +21,19 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
|
|||
|
||||
add_custom_command(OUTPUT ${${module_sources}}
|
||||
COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS}
|
||||
${CMAKE_BINARY_DIR}/PySide/global.h
|
||||
${pyside_BINARY_DIR}/pyside_global.h
|
||||
--include-paths=${pyside_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}
|
||||
--typesystem-paths=${pyside_SOURCE_DIR}${PATH_SEP}${${module_typesystem_path}}
|
||||
--output-directory=${CMAKE_CURRENT_BINARY_DIR}
|
||||
--license-file=${CMAKE_CURRENT_SOURCE_DIR}/../licensecomment.txt
|
||||
${typesystem_path}
|
||||
--api-version=${SUPPORTED_QT_VERSION}
|
||||
--drop-type-entries="${dropped_entries}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "Running generator for ${module_name}...")
|
||||
|
||||
include_directories(${module_name} ${${module_include_dir}} ${pyside_SOURCE_DIR})
|
||||
add_library(${module_name} MODULE ${${module_sources}} ${${ARGN}})
|
||||
add_library(${module_name} MODULE ${${module_sources}} ${${module_static_sources}})
|
||||
set_target_properties(${module_name} PROPERTIES PREFIX "" LIBRARY_OUTPUT_DIRECTORY ${pyside_BINARY_DIR})
|
||||
if(WIN32)
|
||||
set_target_properties(${module_name} PROPERTIES SUFFIX ".pyd")
|
||||
|
|
@ -43,29 +56,31 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
|
|||
install(FILES ${typesystem_files} DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
|
||||
endmacro()
|
||||
|
||||
#macro(check_qt_class_with_namespace module namespace class global_sources [namespace])
|
||||
macro(check_qt_class module class global_sources)
|
||||
if (${ARGC} GREATER 3)
|
||||
set (namespace ${ARGV3})
|
||||
#macro(check_qt_class_with_namespace module namespace class optional_source_files dropped_entries [namespace] [module])
|
||||
macro(check_qt_class module class optional_source_files dropped_entries)
|
||||
if (${ARGC} GREATER 4)
|
||||
set (namespace ${ARGV4})
|
||||
string(TOLOWER ${namespace} _namespace)
|
||||
else ()
|
||||
set (namespace "")
|
||||
endif ()
|
||||
if (${ARGC} GREATER 4)
|
||||
set (include_file ${ARGV4})
|
||||
if (${ARGC} GREATER 5)
|
||||
set (include_file ${ARGV5})
|
||||
else ()
|
||||
set (include_file ${module})
|
||||
set (include_file ${class})
|
||||
endif ()
|
||||
string(TOLOWER ${class} _class)
|
||||
string(TOUPPER ${module} _module)
|
||||
if (${namespace})
|
||||
if (_namespace)
|
||||
set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module}/${_namespace}_${_class}_wrapper.cpp)
|
||||
else ()
|
||||
set(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module}/${_class}_wrapper.cpp)
|
||||
endif ()
|
||||
if (DEFINED PYSIDE_${class})
|
||||
if (PYSIDE_${class})
|
||||
list(APPEND ${global_sources} ${_cppfile})
|
||||
list(APPEND ${optional_source_files} ${_cppfile})
|
||||
else()
|
||||
list(APPEND ${dropped_entries} PySide.${module}.${class})
|
||||
endif()
|
||||
else()
|
||||
if (NOT ${namespace} STREQUAL "" )
|
||||
|
|
@ -76,9 +91,8 @@ macro(check_qt_class module class global_sources)
|
|||
set(SRC_FILE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test${class}.cxx)
|
||||
file(WRITE ${SRC_FILE}
|
||||
"#include <${include_file}>\n"
|
||||
"#include <typeinfo>\n"
|
||||
"${NAMESPACE_USE}\n"
|
||||
"int main() { typeid(${class}); }\n"
|
||||
"${NAMESPACE_USE}\n"
|
||||
"int main() { sizeof(${class}); }\n"
|
||||
)
|
||||
try_compile(Q_WORKS ${CMAKE_BINARY_DIR}
|
||||
${SRC_FILE}
|
||||
|
|
@ -92,9 +106,10 @@ macro(check_qt_class module class global_sources)
|
|||
set("PYSIDE_${class}" ${Q_WORKS} CACHE STRING "Has ${class} class been found?")
|
||||
if(Q_WORKS)
|
||||
message(STATUS "Checking for ${class} in ${module} -- found")
|
||||
list(APPEND ${global_sources} ${_cppfile})
|
||||
list(APPEND ${optional_source_files} ${_cppfile})
|
||||
else()
|
||||
message(STATUS "Checking for ${class} in ${module} -- not found")
|
||||
list(APPEND ${dropped_entries} PySide.${module}.${class})
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ configure_file("conf.py.in" "rst/conf.py" @ONLY)
|
|||
configure_file(typesystem_doc.xml.in typesystem_doc.xml @ONLY)
|
||||
|
||||
add_custom_target("docrsts"
|
||||
COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=qtdoc
|
||||
${pyside_BINARY_DIR}/global.h
|
||||
COMMAND ${GENERATORRUNNER_BINARY} --generator-set=qtdoc
|
||||
${pyside_BINARY_DIR}/pyside_global.h
|
||||
--include-paths="${QT_INCLUDE_DIR}${PATH_SEP}${pyside_SOURCE_DIR}"
|
||||
--api-version=${SUPPORTED_QT_VERSION}
|
||||
--typesystem-paths="${pyside_SOURCE_DIR}${PATH_SEP}${QtCore_SOURCE_DIR}${PATH_SEP}${QtDeclarative_SOURCE_DIR}${PATH_SEP}${QtGui_SOURCE_DIR}${PATH_SEP}${QtGui_BINARY_DIR}${PATH_SEP}${QtHelp_SOURCE_DIR}${PATH_SEP}${QtMaemo5_SOURCE_DIR}${PATH_SEP}${QtMultimedia_SOURCE_DIR}${PATH_SEP}${QtNetwork_SOURCE_DIR}${PATH_SEP}${QtOpenGL_SOURCE_DIR}${PATH_SEP}${QtScript_SOURCE_DIR}${PATH_SEP}${QtScriptTools_SOURCE_DIR}${PATH_SEP}${QtSql_SOURCE_DIR}${PATH_SEP}${QtSvg_SOURCE_DIR}${PATH_SEP}${QtTest_SOURCE_DIR}${PATH_SEP}${QtUiTools_SOURCE_DIR}${PATH_SEP}${QtWebKit_SOURCE_DIR}${PATH_SEP}${QtXml_SOURCE_DIR}${PATH_SEP}${QtXmlPatterns_SOURCE_DIR}${PATH_SEP}${phonon_SOURCE_DIR}"
|
||||
|
|
@ -27,7 +27,8 @@ add_custom_target("docrsts"
|
|||
--documentation-only
|
||||
--documentation-data-dir=${DOC_DATA_DIR}
|
||||
--output-directory=${CMAKE_CURRENT_BINARY_DIR}/rst
|
||||
--documentation-code-snippets-dir=${CMAKE_CURRENT_SOURCE_DIR}/codesnippets
|
||||
--documentation-code-snippets-dir=${CMAKE_CURRENT_SOURCE_DIR}/codesnippets${PATH_SEP}${CMAKE_CURRENT_SOURCE_DIR}/codesnippets/examples
|
||||
--documentation-extra-sections-dir=${CMAKE_CURRENT_SOURCE_DIR}/extras
|
||||
${CMAKE_CURRENT_BINARY_DIR}/typesystem_doc.xml
|
||||
WORKING_DIRECTORY ${${module}_SOURCE_DIR}
|
||||
COMMENT "Running generator to generate documentation..."
|
||||
|
|
|
|||
12
doc/_templates/index.html
vendored
12
doc/_templates/index.html
vendored
|
|
@ -12,7 +12,12 @@
|
|||
<p>PySide is built using the <a href="http://www.pyside.org/docs/shiboken">Shiboken</a> binding generator.</p>
|
||||
|
||||
<h2>Modules</h2>
|
||||
<table class="contentstable" align="center" style="margin-left: 30px"><tr>
|
||||
|
||||
<div class="admonition warning">
|
||||
<strong>Note:</strong> The PySide class reference documentation is automatically generated from the original Qt documentation for C++, some parts were tuned to fit the Python world, however is not possible to rewrite all Qt docs as it would require a really huge effort, so if the documentation says you can use 0 on an QObject argument, interpret it as None.
|
||||
</div>
|
||||
|
||||
<table class="contentstable" align="center" ><tr>
|
||||
<td width="50%">
|
||||
<p class="biglink"><a class="biglink" href="{{ pathto("PySide/QtCore/index") }}">QtCore</a><br/>
|
||||
<span class="linkdescr">core non-GUI functionality</span></p>
|
||||
|
|
@ -49,5 +54,10 @@
|
|||
content in Qt applications</span></p>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<h2>Tutorials and examples</h2>
|
||||
|
||||
<p>A collection of <a href="{{ pathto("tutorials/index") }}">tutorials</a> and "walkthrough" guides are provided with PySide to help new users get started with PySide development. These documents were ported from C++ to Python and cover a range of topics, from basic use of widgets to step-by-step <a href="{{ pathto("tutorials/index") }}">tutorials</a> that show how an application is put together.</p>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
2
doc/_themes/pysidedocs/layout.html
vendored
2
doc/_themes/pysidedocs/layout.html
vendored
|
|
@ -77,7 +77,7 @@
|
|||
<div id="container">
|
||||
<div id="header">
|
||||
<div id="header_container">
|
||||
<div id="logo"></div>
|
||||
<div id="logo"><a href="http://www.pyside.org"><img alt="PySide" src="{{ pathto('_static/pysidelogo.png', 1) }}" width="199" height="102" /></a></div>
|
||||
<ul id="relbar">
|
||||
{%- for rellink in rellinks %}
|
||||
<li class="right">
|
||||
|
|
|
|||
51
doc/_themes/pysidedocs/static/doctools.js
vendored
51
doc/_themes/pysidedocs/static/doctools.js
vendored
|
|
@ -1,16 +1,31 @@
|
|||
/// XXX: make it cross browser
|
||||
/*
|
||||
* doctools.js
|
||||
* ~~~~~~~~~~~
|
||||
*
|
||||
* Sphinx JavaScript utilties for all documentation.
|
||||
*
|
||||
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* select a different prefix for underscore
|
||||
*/
|
||||
$u = _.noConflict();
|
||||
|
||||
/**
|
||||
* make the code below compatible with browsers without
|
||||
* an installed firebug like debugger
|
||||
*/
|
||||
if (!window.console || !console.firebug) {
|
||||
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
|
||||
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
|
||||
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
|
||||
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
|
||||
"profile", "profileEnd"];
|
||||
window.console = {};
|
||||
for (var i = 0; i < names.length; ++i)
|
||||
window.console[names[i]] = function() {}
|
||||
window.console[names[i]] = function() {};
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* small helper function to urldecode strings
|
||||
|
|
@ -44,7 +59,7 @@ jQuery.getQueryParameters = function(s) {
|
|||
result[key] = [value];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* small function to check if an array contains
|
||||
|
|
@ -56,7 +71,7 @@ jQuery.contains = function(arr, item) {
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* highlight a given string on a jquery object by wrapping it in
|
||||
|
|
@ -67,7 +82,7 @@ jQuery.fn.highlightText = function(text, className) {
|
|||
if (node.nodeType == 3) {
|
||||
var val = node.nodeValue;
|
||||
var pos = val.toLowerCase().indexOf(text);
|
||||
if (pos >= 0 && !jQuery.className.has(node.parentNode, className)) {
|
||||
if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
|
||||
var span = document.createElement("span");
|
||||
span.className = className;
|
||||
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
||||
|
|
@ -79,14 +94,14 @@ jQuery.fn.highlightText = function(text, className) {
|
|||
}
|
||||
else if (!jQuery(node).is("button, select, textarea")) {
|
||||
jQuery.each(node.childNodes, function() {
|
||||
highlight(this)
|
||||
highlight(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
return this.each(function() {
|
||||
highlight(this);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Small JavaScript module for the documentation.
|
||||
|
|
@ -96,7 +111,7 @@ var Documentation = {
|
|||
init : function() {
|
||||
this.fixFirefoxAnchorBug();
|
||||
this.highlightSearchWords();
|
||||
this.initModIndex();
|
||||
this.initIndexTable();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -107,7 +122,7 @@ var Documentation = {
|
|||
LOCALE : 'unknown',
|
||||
|
||||
// gettext and ngettext don't access this so that the functions
|
||||
// can savely bound to a different name (_ = Documentation.gettext)
|
||||
// can safely bound to a different name (_ = Documentation.gettext)
|
||||
gettext : function(string) {
|
||||
var translated = Documentation.TRANSLATIONS[string];
|
||||
if (typeof translated == 'undefined')
|
||||
|
|
@ -167,7 +182,7 @@ var Documentation = {
|
|||
var body = $('div.body');
|
||||
window.setTimeout(function() {
|
||||
$.each(terms, function() {
|
||||
body.highlightText(this.toLowerCase(), 'highlight');
|
||||
body.highlightText(this.toLowerCase(), 'highlighted');
|
||||
});
|
||||
}, 10);
|
||||
$('<li class="highlight-link"><a href="javascript:Documentation.' +
|
||||
|
|
@ -177,19 +192,19 @@ var Documentation = {
|
|||
},
|
||||
|
||||
/**
|
||||
* init the modindex toggle buttons
|
||||
* init the domain index toggle buttons
|
||||
*/
|
||||
initModIndex : function() {
|
||||
initIndexTable : function() {
|
||||
var togglers = $('img.toggler').click(function() {
|
||||
var src = $(this).attr('src');
|
||||
var idnum = $(this).attr('id').substr(7);
|
||||
console.log($('tr.cg-' + idnum).toggle());
|
||||
$('tr.cg-' + idnum).toggle();
|
||||
if (src.substr(-9) == 'minus.png')
|
||||
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
|
||||
else
|
||||
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
|
||||
}).css('display', '');
|
||||
if (DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX) {
|
||||
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
|
||||
togglers.click();
|
||||
}
|
||||
},
|
||||
|
|
@ -199,7 +214,7 @@ var Documentation = {
|
|||
*/
|
||||
hideSearchWords : function() {
|
||||
$('.sidebar .this-page-menu li.highlight-link').fadeOut(300);
|
||||
$('span.highlight').removeClass('highlight');
|
||||
$('span.highlighted').removeClass('highlighted');
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
180
doc/_themes/pysidedocs/static/jquery.js
vendored
180
doc/_themes/pysidedocs/static/jquery.js
vendored
File diff suppressed because one or more lines are too long
24
doc/_themes/pysidedocs/static/pysidedocs.css
vendored
24
doc/_themes/pysidedocs/static/pysidedocs.css
vendored
|
|
@ -136,8 +136,24 @@ pre * {
|
|||
font: 100% monospace;
|
||||
}
|
||||
|
||||
.pre {
|
||||
font: 100% monospace;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.headerlink {
|
||||
display: none;
|
||||
font-size: 100%;
|
||||
color: inherit;
|
||||
float: right;
|
||||
visibility: Hidden
|
||||
}
|
||||
|
||||
h1 .headerlink {
|
||||
padding-right: 50px;
|
||||
}
|
||||
|
||||
h1:hover .headerlink, h2:hover .headerlink, h3:hover .headerlink {
|
||||
visibility: Visible;
|
||||
}
|
||||
|
||||
a, a:visited {
|
||||
|
|
@ -263,10 +279,8 @@ hr {
|
|||
}
|
||||
|
||||
#logo {
|
||||
background-image: url(pysidelogo.png);
|
||||
background-repeat: no-repeat;
|
||||
/* background-position: 0px 4px; */
|
||||
height: 112px;
|
||||
text-align: left;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#search_box {
|
||||
|
|
|
|||
117
doc/_themes/pysidedocs/static/searchtools.js
vendored
117
doc/_themes/pysidedocs/static/searchtools.js
vendored
|
|
@ -1,3 +1,14 @@
|
|||
/*
|
||||
* searchtools.js
|
||||
* ~~~~~~~~~~~~~~
|
||||
*
|
||||
* Sphinx JavaScript utilties for the full-text search.
|
||||
*
|
||||
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* helper function to return a node containing the
|
||||
* search summary for a given text. keywords is a list
|
||||
|
|
@ -20,7 +31,7 @@ jQuery.makeSearchSummary = function(text, keywords, hlwords) {
|
|||
((start + 240 - text.length) ? '...' : '');
|
||||
var rv = $('<div class="context"></div>').text(excerpt);
|
||||
$.each(hlwords, function() {
|
||||
rv = rv.highlightText(this, 'highlight');
|
||||
rv = rv.highlightText(this, 'highlighted');
|
||||
});
|
||||
return rv;
|
||||
}
|
||||
|
|
@ -226,9 +237,11 @@ var Search = {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the index
|
||||
*/
|
||||
loadIndex : function(url) {
|
||||
$.ajax({type: "GET", url: url, data: null, success: null,
|
||||
dataType: "script", cache: true});
|
||||
},
|
||||
|
||||
setIndex : function(index) {
|
||||
var q;
|
||||
this._index = index;
|
||||
|
|
@ -287,8 +300,13 @@ var Search = {
|
|||
},
|
||||
|
||||
query : function(query) {
|
||||
// stem the searchterms and add them to the
|
||||
// correct list
|
||||
var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in',
|
||||
'if', 'for', 'no', 'there', 'their', 'was', 'is',
|
||||
'be', 'to', 'that', 'but', 'they', 'not', 'such',
|
||||
'with', 'by', 'a', 'on', 'these', 'of', 'will',
|
||||
'this', 'near', 'the', 'or', 'at'];
|
||||
|
||||
// stem the searchterms and add them to the correct list
|
||||
var stemmer = new PorterStemmer();
|
||||
var searchterms = [];
|
||||
var excluded = [];
|
||||
|
|
@ -296,6 +314,11 @@ var Search = {
|
|||
var tmp = query.split(/\s+/);
|
||||
var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null;
|
||||
for (var i = 0; i < tmp.length; i++) {
|
||||
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
|
||||
tmp[i] == "") {
|
||||
// skip this "word"
|
||||
continue;
|
||||
}
|
||||
// stem the word
|
||||
var word = stemmer.stemWord(tmp[i]).toLowerCase();
|
||||
// select the correct list
|
||||
|
|
@ -313,39 +336,42 @@ var Search = {
|
|||
};
|
||||
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
|
||||
|
||||
console.debug('SEARCH: searching for:');
|
||||
console.info('required: ', searchterms);
|
||||
console.info('excluded: ', excluded);
|
||||
// console.debug('SEARCH: searching for:');
|
||||
// console.info('required: ', searchterms);
|
||||
// console.info('excluded: ', excluded);
|
||||
|
||||
// prepare search
|
||||
var filenames = this._index.filenames;
|
||||
var titles = this._index.titles;
|
||||
var terms = this._index.terms;
|
||||
var descrefs = this._index.descrefs;
|
||||
var modules = this._index.modules;
|
||||
var desctypes = this._index.desctypes;
|
||||
var objects = this._index.objects;
|
||||
var objtypes = this._index.objtypes;
|
||||
var objnames = this._index.objnames;
|
||||
var fileMap = {};
|
||||
var files = null;
|
||||
// different result priorities
|
||||
var importantResults = [];
|
||||
var objectResults = [];
|
||||
var regularResults = [];
|
||||
var unimportantResults = [];
|
||||
$('#search-progress').empty();
|
||||
|
||||
// lookup as object
|
||||
if (object != null) {
|
||||
for (var module in modules) {
|
||||
if (module.indexOf(object) > -1) {
|
||||
fn = modules[module];
|
||||
descr = _('module, in ') + titles[fn];
|
||||
objectResults.push([filenames[fn], module, '#module-'+module, descr]);
|
||||
}
|
||||
}
|
||||
for (var prefix in descrefs) {
|
||||
for (var name in descrefs[prefix]) {
|
||||
for (var prefix in objects) {
|
||||
for (var name in objects[prefix]) {
|
||||
var fullname = (prefix ? prefix + '.' : '') + name;
|
||||
if (fullname.toLowerCase().indexOf(object) > -1) {
|
||||
match = descrefs[prefix][name];
|
||||
descr = desctypes[match[1]] + _(', in ') + titles[match[0]];
|
||||
objectResults.push([filenames[match[0]], fullname, '#'+fullname, descr]);
|
||||
match = objects[prefix][name];
|
||||
descr = objnames[match[1]] + _(', in ') + titles[match[0]];
|
||||
// XXX the generated anchors are not generally correct
|
||||
// XXX there may be custom prefixes
|
||||
result = [filenames[match[0]], fullname, '#'+fullname, descr];
|
||||
switch (match[2]) {
|
||||
case 1: objectResults.push(result); break;
|
||||
case 0: importantResults.push(result); break;
|
||||
case 2: unimportantResults.push(result); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -356,6 +382,14 @@ var Search = {
|
|||
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
|
||||
});
|
||||
|
||||
importantResults.sort(function(a, b) {
|
||||
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
|
||||
});
|
||||
|
||||
unimportantResults.sort(function(a, b) {
|
||||
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
|
||||
});
|
||||
|
||||
|
||||
// perform the search on the required terms
|
||||
for (var i = 0; i < searchterms.length; i++) {
|
||||
|
|
@ -411,8 +445,9 @@ var Search = {
|
|||
return (left > right) ? -1 : ((left < right) ? 1 : 0);
|
||||
});
|
||||
|
||||
// combine both
|
||||
var results = regularResults.concat(objectResults);
|
||||
// combine all results
|
||||
var results = unimportantResults.concat(regularResults)
|
||||
.concat(objectResults).concat(importantResults);
|
||||
|
||||
// print the results
|
||||
var resultCount = results.length;
|
||||
|
|
@ -421,10 +456,23 @@ var Search = {
|
|||
if (results.length) {
|
||||
var item = results.pop();
|
||||
var listItem = $('<li style="display:none"></li>');
|
||||
listItem.append($('<a/>').attr(
|
||||
'href',
|
||||
item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
|
||||
highlightstring + item[2]).html(item[1]));
|
||||
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') {
|
||||
// dirhtml builder
|
||||
var dirname = item[0] + '/';
|
||||
if (dirname.match(/\/index\/$/)) {
|
||||
dirname = dirname.substring(0, dirname.length-6);
|
||||
} else if (dirname == 'index/') {
|
||||
dirname = '';
|
||||
}
|
||||
listItem.append($('<a/>').attr('href',
|
||||
DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
|
||||
highlightstring + item[2]).html(item[1]));
|
||||
} else {
|
||||
// normal html builders
|
||||
listItem.append($('<a/>').attr('href',
|
||||
item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
|
||||
highlightstring + item[2]).html(item[1]));
|
||||
}
|
||||
if (item[3]) {
|
||||
listItem.append($('<span> (' + item[3] + ')</span>'));
|
||||
Search.output.append(listItem);
|
||||
|
|
@ -432,9 +480,12 @@ var Search = {
|
|||
displayNextItem();
|
||||
});
|
||||
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
|
||||
$.get('_sources/' + item[0] + '.txt', function(data) {
|
||||
listItem.append($.makeSearchSummary(data, searchterms, hlterms));
|
||||
Search.output.append(listItem);
|
||||
$.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' +
|
||||
item[0] + '.txt', function(data) {
|
||||
if (data != '') {
|
||||
listItem.append($.makeSearchSummary(data, searchterms, hlterms));
|
||||
Search.output.append(listItem);
|
||||
}
|
||||
listItem.slideDown(5, function() {
|
||||
displayNextItem();
|
||||
});
|
||||
|
|
|
|||
16
doc/_themes/pysidedocs/static/underscore.js
vendored
Normal file
16
doc/_themes/pysidedocs/static/underscore.js
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d,
|
||||
a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c);
|
||||
var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c,
|
||||
d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck=
|
||||
function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a,
|
||||
function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a,
|
||||
0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d,
|
||||
e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d=
|
||||
a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)});
|
||||
return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length);
|
||||
var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false;
|
||||
if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length==
|
||||
0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&&
|
||||
a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g,
|
||||
" ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments);
|
||||
o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})();
|
||||
55
doc/codesnippets/doc/src/snippets/audio/main.cpp
Normal file
55
doc/codesnippets/doc/src/snippets/audio/main.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
class Window2 (QWidget):
|
||||
//![0]
|
||||
@Slot(QAudio.State)
|
||||
def stateChanged(self, newState):
|
||||
if newState == QAudio.StopState:
|
||||
if self.input.error() != QAudio.NoError:
|
||||
# Error handling
|
||||
//![0]
|
||||
|
||||
class Window (QWidget):
|
||||
def __init__(self):
|
||||
QWidget.__init__(self)
|
||||
self.output = QAudioOutput()
|
||||
self.output.stateChanged[QAudio.State].connect(self.stateChanged)
|
||||
|
||||
def setupFormat(self):
|
||||
//![1]
|
||||
format = QAudioFormat()
|
||||
format.setFrequency(44100)
|
||||
//![1]
|
||||
format.setChannels(2)
|
||||
format.setSampleSize(16)
|
||||
format.setCodec("audio/pcm")
|
||||
format.setByteOrder(QAudioFormat.LittleEndian)
|
||||
//![2]
|
||||
format.setSampleType(QAudioFormat.SignedInt)
|
||||
|
||||
info = QAudioDeviceInfo(QAudioDeviceInfo.defaultOutputDevice())
|
||||
|
||||
if not info.isFormatSupported(format):
|
||||
format = info.nearestFormat(format)
|
||||
//![2]
|
||||
|
||||
//![3]
|
||||
@Slot(QAudio.State)
|
||||
def stateChanged(self, newState):
|
||||
if newState == QAudio.StopState:
|
||||
if self.output.error() != QAudio.NoError:
|
||||
# Perform error handling
|
||||
else:
|
||||
# Normal stop
|
||||
//![3]
|
||||
|
||||
# Handle
|
||||
elif newState == QAudio.ActiveState:
|
||||
# Handle active state...
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
window = Window()
|
||||
window.show()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
SOURCES += brush.cpp
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
######################################################################
|
||||
# Automatically generated by qmake (2.00a) Wed Dec 14 11:46:57 2005
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
|
||||
# Input
|
||||
HEADERS += renderarea.h stylewidget.h
|
||||
SOURCES += main.cpp renderarea.cpp stylewidget.cpp
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
######################################################################
|
||||
# Automatically generated by qmake (1.08a) Tue Jan 4 13:19:41 2005
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
CONFIG -= moc
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
|
||||
# Input
|
||||
SOURCES += buffer.cpp
|
||||
CONFIG += qt warn_on debug create_prl link_prl
|
||||
OBJECTS_DIR=.obj/debug-shared
|
||||
MOC_DIR=.moc/debug-shared
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
HEADERS = clipwindow.h
|
||||
SOURCES = clipwindow.cpp \
|
||||
main.cpp
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
//! [0]
|
||||
#include <QtScriptTools>
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
QT += scripttools
|
||||
//! [1]
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
//! [0]
|
||||
Outlook::Application *outlook = new Outlook::Application;
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
Outlook::_NameSpace *session = outlook->Session();
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
Outlook::NameSpace *session = outlook->Session();
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
Outlook::_NameSpace *tmp = outlook->Session();
|
||||
Outlook::NameSpace *session = new Outlook::NameSpace(tmp);
|
||||
delete tmp; // or any other use of tmp: segfault
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
Outlook::NameSpace *session = new Outlook::NameSpace(outlook->Session());
|
||||
//! [4]
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
//! [0]
|
||||
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
RC_FILE = myapp.rc
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
ICON = myapp.icns
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
kde-config --path icon
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
gnome-config --datadir
|
||||
//! [4]
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
//! [0]
|
||||
assistant -collectionFile file
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<QHelpCollectionProject version="1.0">
|
||||
<assistant>
|
||||
<title>My Application Help</title>
|
||||
<startPage>qthelp://com.mycompany.1_0_0/doc/index.html</startPage>
|
||||
<currentFilter>myfilter</currentFilter>
|
||||
<applicationIcon>application.png</applicationIcon>
|
||||
<enableFilterFunctionality>false</enableFilterFunctionality>
|
||||
<enableDocumentationManager>false</enableDocumentationManager>
|
||||
<enableAddressBar visible="true">true</enableAddressBar>
|
||||
<cacheDirectory>mycompany/myapplication</cacheDirectory>
|
||||
<aboutMenuText>
|
||||
<text>About My Application</text>
|
||||
<text language="de">Über meine Applikation...</text>
|
||||
</aboutMenuText>
|
||||
<aboutDialog>
|
||||
<file>about.txt</file>
|
||||
<file language="de">ueber.txt</file>
|
||||
<icon>about.png</icon>
|
||||
</aboutDialog>
|
||||
</assistant>
|
||||
<docFiles>
|
||||
<generate>
|
||||
<file>
|
||||
<input>myapplication-manual.qhp</input>
|
||||
<output>myapplication-manual.qch</output>
|
||||
</file>
|
||||
</generate>
|
||||
<register>
|
||||
<file>myapplication-manual.qch</file>
|
||||
</register>
|
||||
</docFiles>
|
||||
</QHelpCollectionProject>
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
QProcess *process = new QProcess;
|
||||
QStringList args;
|
||||
args << QLatin1String("-collectionFile")
|
||||
<< QLatin1String("mycollection.qhc")
|
||||
<< QLatin1String("-enableRemoteControl");
|
||||
process->start(QLatin1String("assistant"), args);
|
||||
if (!process->waitForStarted())
|
||||
return;
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
QByteArray ba;
|
||||
ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html");
|
||||
ba.append('\0');
|
||||
process->write(ba);
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
QByteArray ba;
|
||||
ba.append("hide bookmarks;");
|
||||
ba.append("hide index;");
|
||||
ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html");
|
||||
ba.append('\0');
|
||||
process->write(ba);
|
||||
//! [4]
|
||||
|
||||
//! [5]
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<QHelpCollectionProject version="1.0">
|
||||
...
|
||||
<docFiles>
|
||||
<register>
|
||||
<file>myapplication-manual.qch</file>
|
||||
<file>another-manual.qch</file>
|
||||
</register>
|
||||
</docFiles>
|
||||
</QHelpCollectionProject>
|
||||
//! [5]
|
||||
|
||||
//! [6]
|
||||
assistant -collectionFile mycollection.qhc -register myapplication-manual.qch
|
||||
//! [6]
|
||||
|
||||
//! [7]
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<QHelpCollectionProject version="1.0">
|
||||
<assistant>
|
||||
<title>My Application Help</title>
|
||||
<cacheDirectory>mycompany/myapplication</cacheDirectory>
|
||||
...
|
||||
</assistant>
|
||||
</QHelpCollectionProject>
|
||||
//! [7]
|
||||
|
||||
//! [8]
|
||||
assistant -collectionFile mycollection.qhc
|
||||
//! [8]
|
||||
|
||||
//! [9]
|
||||
%QDesktopServices::DataLocation%/mycompany/myapplication/mycollection.qhc
|
||||
//! [9]
|
||||
|
||||
//! [10]
|
||||
qcollectiongenerator mycollection.qhcp -o mycollection.qhc
|
||||
//! [10]
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
//! [0]
|
||||
if (*ptr == expected) {
|
||||
*ptr = newval;
|
||||
return !0;
|
||||
}
|
||||
return 0;
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
if (*ptr == expected) {
|
||||
*ptr = newval;
|
||||
return !0;
|
||||
}
|
||||
return 0;
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
++(*ptr);
|
||||
return *ptr ? !0 : 0;
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
return ++(*ptr);
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
++(*ptr);
|
||||
return !(ControlRegister & ZeroFlag);
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
--(*ptr);
|
||||
return *ptr ? : 0;
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
return --(*ptr);
|
||||
//! [6]
|
||||
|
||||
|
||||
//! [7]
|
||||
--(*ptr);
|
||||
return !(ControlRegister & ZeroFlag);
|
||||
//! [7]
|
||||
|
||||
|
||||
//! [8]
|
||||
tmp = *ptr;
|
||||
*ptr = newval;
|
||||
return tmp;
|
||||
//! [8]
|
||||
|
||||
|
||||
//! [9]
|
||||
tmp = *ptr;
|
||||
*ptr = newval;
|
||||
return tmp;
|
||||
//! [9]
|
||||
|
||||
|
||||
//! [10]
|
||||
tmp = *ptr;
|
||||
*ptr += value;
|
||||
return tmp;
|
||||
//! [10]
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
//! [0]
|
||||
QTDIR=C:\Progra~1\Qt
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
/usr/vacpp/bin/makeC++SharedLib -o shr1.o cplussource1.o
|
||||
//! [1]
|
||||
|
|
@ -1,235 +0,0 @@
|
|||
//! [0]
|
||||
class Employee
|
||||
{
|
||||
public:
|
||||
Employee() {}
|
||||
Employee(const Employee &other);
|
||||
|
||||
Employee &operator=(const Employee &other);
|
||||
|
||||
private:
|
||||
QString myName;
|
||||
QDate myDateOfBirth;
|
||||
};
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
QList<QString> list;
|
||||
list << "A" << "B" << "C" << "D";
|
||||
|
||||
QListIterator<QString> i(list);
|
||||
while (i.hasNext())
|
||||
qDebug() << i.next();
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
QListIterator<QString> i(list);
|
||||
i.toBack();
|
||||
while (i.hasPrevious())
|
||||
qDebug() << i.previous();
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
QMutableListIterator<int> i(list);
|
||||
while (i.hasNext()) {
|
||||
if (i.next() % 2 != 0)
|
||||
i.remove();
|
||||
}
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
QMutableListIterator<int> i(list);
|
||||
i.toBack();
|
||||
while (i.hasPrevious()) {
|
||||
if (i.previous() % 2 != 0)
|
||||
i.remove();
|
||||
}
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
QMutableListIterator<int> i(list);
|
||||
while (i.hasNext()) {
|
||||
if (i.next() > 128)
|
||||
i.setValue(128);
|
||||
}
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
QMutableListIterator<int> i(list);
|
||||
while (i.hasNext())
|
||||
i.next() *= 2;
|
||||
//! [6]
|
||||
|
||||
|
||||
//! [7]
|
||||
QMap<QString, QString> map;
|
||||
map.insert("Paris", "France");
|
||||
map.insert("Guatemala City", "Guatemala");
|
||||
map.insert("Mexico City", "Mexico");
|
||||
map.insert("Moscow", "Russia");
|
||||
...
|
||||
|
||||
QMutableMapIterator<QString, QString> i(map);
|
||||
while (i.hasNext()) {
|
||||
if (i.next().key().endsWith("City"))
|
||||
i.remove();
|
||||
}
|
||||
//! [7]
|
||||
|
||||
|
||||
//! [8]
|
||||
QMap<int, QWidget *> map;
|
||||
QHash<int, QWidget *> hash;
|
||||
|
||||
QMapIterator<int, QWidget *> i(map);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
hash.insert(i.key(), i.value());
|
||||
}
|
||||
//! [8]
|
||||
|
||||
|
||||
//! [9]
|
||||
QMutableMapIterator<int, QWidget *> i(map);
|
||||
while (i.findNext(widget))
|
||||
i.remove();
|
||||
//! [9]
|
||||
|
||||
|
||||
//! [10]
|
||||
QList<QString> list;
|
||||
list << "A" << "B" << "C" << "D";
|
||||
|
||||
QList<QString>::iterator i;
|
||||
for (i = list.begin(); i != list.end(); ++i)
|
||||
*i = (*i).toLower();
|
||||
//! [10]
|
||||
|
||||
|
||||
//! [11]
|
||||
QList<QString> list;
|
||||
list << "A" << "B" << "C" << "D";
|
||||
|
||||
QList<QString>::iterator i = list.end();
|
||||
while (i != list.begin()) {
|
||||
--i;
|
||||
*i = (*i).toLower();
|
||||
}
|
||||
//! [11]
|
||||
|
||||
|
||||
//! [12]
|
||||
QList<QString>::const_iterator i;
|
||||
for (i = list.constBegin(); i != list.constEnd(); ++i)
|
||||
qDebug() << *i;
|
||||
//! [12]
|
||||
|
||||
|
||||
//! [13]
|
||||
QMap<int, int> map;
|
||||
...
|
||||
QMap<int, int>::const_iterator i;
|
||||
for (i = map.constBegin(); i != map.constEnd(); ++i)
|
||||
qDebug() << i.key() << ":" << i.value();
|
||||
//! [13]
|
||||
|
||||
|
||||
//! [14]
|
||||
// RIGHT
|
||||
const QList<int> sizes = splitter->sizes();
|
||||
QList<int>::const_iterator i;
|
||||
for (i = sizes.begin(); i != sizes.end(); ++i)
|
||||
...
|
||||
|
||||
// WRONG
|
||||
QList<int>::const_iterator i;
|
||||
for (i = splitter->sizes().begin();
|
||||
i != splitter->sizes().end(); ++i)
|
||||
...
|
||||
//! [14]
|
||||
|
||||
|
||||
//! [15]
|
||||
QLinkedList<QString> list;
|
||||
...
|
||||
QString str;
|
||||
foreach (str, list)
|
||||
qDebug() << str;
|
||||
//! [15]
|
||||
|
||||
|
||||
//! [16]
|
||||
QLinkedList<QString> list;
|
||||
...
|
||||
QLinkedListIterator<QString> i(list);
|
||||
while (i.hasNext())
|
||||
qDebug() << i.next();
|
||||
//! [16]
|
||||
|
||||
|
||||
//! [17]
|
||||
QLinkedList<QString> list;
|
||||
...
|
||||
foreach (QString str, list)
|
||||
qDebug() << str;
|
||||
//! [17]
|
||||
|
||||
|
||||
//! [18]
|
||||
QLinkedList<QString> list;
|
||||
...
|
||||
foreach (QString str, list) {
|
||||
if (str.isEmpty())
|
||||
break;
|
||||
qDebug() << str;
|
||||
}
|
||||
//! [18]
|
||||
|
||||
|
||||
//! [19]
|
||||
QMap<QString, int> map;
|
||||
...
|
||||
foreach (QString str, map.keys())
|
||||
qDebug() << str << ":" << map.value(str);
|
||||
//! [19]
|
||||
|
||||
|
||||
//! [20]
|
||||
QMultiMap<QString, int> map;
|
||||
...
|
||||
foreach (QString str, map.uniqueKeys()) {
|
||||
foreach (int i, map.values(str))
|
||||
qDebug() << str << ":" << i;
|
||||
}
|
||||
//! [20]
|
||||
|
||||
|
||||
//! [21]
|
||||
forever {
|
||||
...
|
||||
}
|
||||
//! [21]
|
||||
|
||||
|
||||
//! [22]
|
||||
CONFIG += no_keywords
|
||||
//! [22]
|
||||
|
||||
|
||||
//! [23]
|
||||
QString onlyLetters(const QString &in)
|
||||
{
|
||||
QString out;
|
||||
for (int j = 0; j < in.size(); ++j) {
|
||||
if (in[j].isLetter())
|
||||
out += in[j];
|
||||
}
|
||||
return out;
|
||||
}
|
||||
//! [23]
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
//! [0]
|
||||
QPainter painter(this);
|
||||
|
||||
painter.setPen(Qt::darkGreen);
|
||||
painter.drawRect(1, 2, 6, 4);
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
QPainter painter(this);
|
||||
|
||||
painter.setPen(Qt::darkGreen);
|
||||
painter.drawLine(2, 7, 6, 1);
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(
|
||||
QPainter::Antialiasing);
|
||||
painter.setPen(Qt::darkGreen);
|
||||
painter.drawRect(1, 2, 6, 4);
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(
|
||||
QPainter::Antialiasing);
|
||||
painter.setPen(Qt::darkGreen);
|
||||
painter.drawLine(2, 7, 6, 1);
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
QPainter painter(this);
|
||||
painter.setWindow(QRect(-50, -50, 100, 100));
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
int side = qMin(width(), height())
|
||||
int x = (width() - side / 2);
|
||||
int y = (height() - side / 2);
|
||||
|
||||
painter.setViewport(x, y, side, side);
|
||||
//! [5]
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
//! [0]
|
||||
qDebug() << "Widget" << widget << "at position" << widget->pos();
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
char *alloc(int size)
|
||||
{
|
||||
Q_ASSERT(size > 0);
|
||||
char *ptr = new char[size];
|
||||
Q_CHECK_PTR(ptr);
|
||||
return ptr;
|
||||
}
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
char *alloc(int size)
|
||||
{
|
||||
char *ptr;
|
||||
Q_CHECK_PTR(ptr = new char[size]); // WRONG
|
||||
return ptr;
|
||||
}
|
||||
//! [2]
|
||||
|
|
@ -1,414 +0,0 @@
|
|||
//! [0]
|
||||
cd /path/to/Qt
|
||||
./configure -static -prefix /path/to/Qt <other parameters>
|
||||
make sub-src
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
cd /path/to/Qt/examples/tools/plugandpaint
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
make clean
|
||||
PATH=/path/to/Qt/bin:$PATH
|
||||
export PATH
|
||||
qmake -config release
|
||||
make
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
ldd ./application
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
cd /path/to/Qt/examples/tools/plugandpaint
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
make clean
|
||||
qmake -config release
|
||||
make
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
cd ../plugandpaintplugins
|
||||
make clean
|
||||
qmake -config release
|
||||
make
|
||||
//! [6]
|
||||
|
||||
|
||||
//! [7]
|
||||
#!/bin/sh
|
||||
appname=`basename $0 | sed s,\.sh$,,`
|
||||
|
||||
dirname=`dirname $0`
|
||||
tmp="${dirname#?}"
|
||||
|
||||
if [ "${dirname%$tmp}" != "/" ]; then
|
||||
dirname=$PWD/$dirname
|
||||
fi
|
||||
LD_LIBRARY_PATH=$dirname
|
||||
export LD_LIBRARY_PATH
|
||||
$dirname/$appname $*
|
||||
//! [7]
|
||||
|
||||
|
||||
//! [8]
|
||||
DESTDIR = /path/to/Qt/plugandpaint/plugins
|
||||
//! [8]
|
||||
|
||||
|
||||
//! [9]
|
||||
qApp->addLibraryPath("/some/other/path");
|
||||
//! [9]
|
||||
|
||||
|
||||
//! [10]
|
||||
ldd ./application
|
||||
//! [10]
|
||||
|
||||
|
||||
//! [11]
|
||||
cd C:\path\to\Qt
|
||||
configure -static <any other options you need>
|
||||
//! [11]
|
||||
|
||||
|
||||
//! [12]
|
||||
nmake sub-src
|
||||
//! [12]
|
||||
|
||||
|
||||
//! [13]
|
||||
cd examples\tools\plugandpaint
|
||||
//! [13]
|
||||
|
||||
|
||||
//! [14]
|
||||
nmake clean
|
||||
qmake -config release
|
||||
nmake
|
||||
//! [14]
|
||||
|
||||
|
||||
//! [15]
|
||||
cd examples\tools\plugandpaint
|
||||
//! [15]
|
||||
|
||||
|
||||
//! [16]
|
||||
nmake clean
|
||||
qmake -config release
|
||||
nmake
|
||||
//! [16]
|
||||
|
||||
|
||||
//! [17]
|
||||
cd ..\plugandpaintplugins
|
||||
nmake clean
|
||||
qmake -config release
|
||||
nmake
|
||||
//! [17]
|
||||
|
||||
|
||||
//! [18]
|
||||
plugins\pnp_basictools.dll
|
||||
plugins\pnp_extrafilters.dll
|
||||
//! [18]
|
||||
|
||||
|
||||
//! [19]
|
||||
qApp->addLibraryPath("C:\some\other\path");
|
||||
//! [19]
|
||||
|
||||
|
||||
//! [20]
|
||||
embed_manifest_dll
|
||||
embed_manifest_exe
|
||||
//! [20]
|
||||
|
||||
|
||||
//! [21]
|
||||
CONFIG += embed_manifest_exe
|
||||
//! [21]
|
||||
|
||||
|
||||
//! [22]
|
||||
<Visual Studio Install Path>\VC\redist\<Architecture>\Microsoft.VC80.CRT
|
||||
//! [22]
|
||||
|
||||
|
||||
//! [23]
|
||||
CONFIG-=embed_manifest_dll
|
||||
//! [23]
|
||||
|
||||
|
||||
//! [24]
|
||||
depends <application executable>
|
||||
//! [24]
|
||||
|
||||
|
||||
//! [25]
|
||||
C:<path to Qt>\plugins
|
||||
//! [25]
|
||||
|
||||
|
||||
//! [26]
|
||||
CONFIG-=app_bundle
|
||||
//! [26]
|
||||
|
||||
|
||||
//! [27]
|
||||
cd /path/to/Qt
|
||||
./configure -static <other parameters>
|
||||
make sub-src
|
||||
//! [27]
|
||||
|
||||
|
||||
//! [28]
|
||||
cd /path/to/Qt/examples/tools/plugandpaint
|
||||
//! [28]
|
||||
|
||||
|
||||
//! [29]
|
||||
make clean
|
||||
qmake -config release
|
||||
make
|
||||
//! [29]
|
||||
|
||||
|
||||
//! [30]
|
||||
otool -L plugandpaint.app/Contents/MacOs/plugandpaint
|
||||
//! [30]
|
||||
|
||||
|
||||
//! [31]
|
||||
plugandpaint.app/Contents/MacOS/plugandpaint:
|
||||
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
|
||||
(compatibility version 2.0.0, current version 128.0.0)
|
||||
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
|
||||
(compatibility version 1.0.0, current version 10.0.0)
|
||||
/usr/lib/libz.1.dylib
|
||||
(compatibility version 1.0.0, current version 1.2.3)
|
||||
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
|
||||
(compatibility version 1.0.0, current version 22.0.0)
|
||||
/usr/lib/libstdc++.6.dylib
|
||||
(compatibility version 7.0.0, current version 7.3.0)
|
||||
/usr/lib/libgcc_s.1.dylib
|
||||
(compatibility version 1.0.0, current version 1.0.0)
|
||||
/usr/lib/libmx.A.dylib
|
||||
(compatibility version 1.0.0, current version 92.0.0)
|
||||
/usr/lib/libSystem.B.dylib
|
||||
(compatibility version 1.0.0, current version 88.0.0)
|
||||
//! [31]
|
||||
|
||||
|
||||
//! [32]
|
||||
-lQtGui
|
||||
//! [32]
|
||||
|
||||
|
||||
//! [33]
|
||||
/where/static/qt/lib/is/libQtGui.a
|
||||
//! [33]
|
||||
|
||||
|
||||
//! [34]
|
||||
cd /path/to/Qt/examples/tools/plugandpaint
|
||||
//! [34]
|
||||
|
||||
|
||||
//! [35]
|
||||
make clean
|
||||
qmake -config release
|
||||
make
|
||||
//! [35]
|
||||
|
||||
|
||||
//! [36]
|
||||
cd ../plugandpaintplugins
|
||||
make clean
|
||||
qmake -config release
|
||||
make
|
||||
//! [36]
|
||||
|
||||
|
||||
//! [37]
|
||||
otool -L QtGui.framework/QtGui
|
||||
//! [37]
|
||||
|
||||
|
||||
//! [38]
|
||||
QtGui.framework/QtGui:
|
||||
/path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
|
||||
(compatibility version 4.0.0, current version 4.0.1)
|
||||
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
|
||||
(compatibility version 2.0.0, current version 128.0.0)
|
||||
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
|
||||
(compatibility version 1.0.0, current version 10.0.0)
|
||||
/path/to/Qt/QtCore.framework/Versions/4.0/QtCore
|
||||
(compatibility version 4.0.0, current version 4.0.1)
|
||||
/usr/lib/libz.1.dylib
|
||||
(compatibility version 1.0.0, current version 1.2.3)
|
||||
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
|
||||
(compatibility version 1.0.0, current version 22.0.0)
|
||||
/usr/lib/libstdc++.6.dylib
|
||||
(compatibility version 7.0.0, current version 7.3.0)
|
||||
/usr/lib/libgcc_s.1.dylib
|
||||
(compatibility version 1.0.0, current version 1.0.0)
|
||||
/usr/lib/libmx.A.dylib
|
||||
(compatibility version 1.0.0, current version 92.0.0)
|
||||
/usr/lib/libSystem.B.dylib
|
||||
(compatibility version 1.0.0, current version 88.0.0)
|
||||
//! [38]
|
||||
|
||||
|
||||
//! [39]
|
||||
mkdir plugandpaint.app/Contents/Frameworks
|
||||
cp -R /path/to/Qt/lib/QtCore.framework
|
||||
plugandpaint.app/Contents/Frameworks
|
||||
cp -R /path/to/Qt/lib/QtGui.framework
|
||||
plugandpaint.app/Contents/Frameworks
|
||||
//! [39]
|
||||
|
||||
|
||||
//! [40]
|
||||
install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
||||
plugandpaint.app/Contents/Frameworks/QtCore.framework/Versions/4.0/QtCore
|
||||
install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
|
||||
plugandpaint.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui
|
||||
//! [40]
|
||||
|
||||
|
||||
//! [41]
|
||||
install_name_tool -change path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
||||
@executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
||||
plugandpaint.app/Contents/MacOs/plugandpaint
|
||||
install_name_tool -change path/to/qt/lib/QtGui.framework/Versions/4.0/QtGui
|
||||
@executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
|
||||
plugandpaint.app/Contents/MacOs/plugandpaint
|
||||
//! [41]
|
||||
|
||||
|
||||
//! [42]
|
||||
install_name_tool -change path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
||||
@executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
||||
plugandpaint.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui
|
||||
//! [42]
|
||||
|
||||
|
||||
//! [43]
|
||||
mv plugins plugandpaint.app/Contents
|
||||
//! [43]
|
||||
|
||||
|
||||
//! [44]
|
||||
libpnp_basictools.dylib:
|
||||
libpnp_basictools.dylib
|
||||
(compatibility version 0.0.0, current version 0.0.0)
|
||||
/path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
|
||||
(compatibility version 4.0.0, current version 4.0.1)
|
||||
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
|
||||
(compatibility version 2.0.0, current version 128.0.0)
|
||||
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
|
||||
(compatibility version 1.0.0, current version 10.0.0)
|
||||
/path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
||||
(compatibility version 4.0.0, current version 4.0.1)
|
||||
/usr/lib/libz.1.dylib
|
||||
(compatibility version 1.0.0, current version 1.2.3)
|
||||
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
|
||||
(compatibility version 1.0.0, current version 22.0.0)
|
||||
/usr/lib/libstdc++.6.dylib
|
||||
(compatibility version 7.0.0, current version 7.3.0)
|
||||
/usr/lib/libgcc_s.1.dylib
|
||||
(compatibility version 1.0.0, current version 1.0.0)
|
||||
/usr/lib/libmx.A.dylib
|
||||
(compatibility version 1.0.0, current version 92.0.0)
|
||||
/usr/lib/libSystem.B.dylib
|
||||
(compatibility version 1.0.0, current version 88.0.0)
|
||||
//! [44]
|
||||
|
||||
|
||||
//! [45]
|
||||
install_name_tool -change /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
||||
@executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
||||
plugandpaint.app/Contents/plugins/libpnp_basictools.dylib
|
||||
install_name_tool -change /path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
|
||||
@executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
|
||||
plugandpaint.app/Contents/plugins/libpnp_basictools.dylib
|
||||
//! [45]
|
||||
|
||||
|
||||
//! [46]
|
||||
#elif defined(Q_OS_MAC)
|
||||
if (pluginsDir.dirName() == "MacOS") {
|
||||
pluginsDir.cdUp();
|
||||
}
|
||||
#endif
|
||||
//! [46]
|
||||
|
||||
|
||||
//! [47]
|
||||
cp -R /path/to/Qt/plugins/imageformats
|
||||
pluginandpaint.app/Contents/plugins
|
||||
//! [47]
|
||||
|
||||
|
||||
//! [48]
|
||||
install_name_tool -change /path/to/Qt/lib/QtGui.framework/Versions/4.0/QtGui
|
||||
@executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui
|
||||
plugandpaint.app/Contents/plugins/imageformats/libqjpeg.dylib
|
||||
install_name_tool -change /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
|
||||
@executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
|
||||
plugandpaint.app/Contents/plugins/imageformats/libqjpeg.dylib
|
||||
//! [48]
|
||||
|
||||
|
||||
//! [49]
|
||||
QDir dir(QApplication::applicationDirPath());
|
||||
dir.cdUp();
|
||||
dir.cd("plugins");
|
||||
QApplication::setLibraryPaths(QStringList(dir.absolutePath()));
|
||||
//! [49]
|
||||
|
||||
|
||||
//! [50]
|
||||
otool -L MyApp.app/Contents/MacOS/MyApp
|
||||
//! [50]
|
||||
|
||||
|
||||
//! [51]
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
|
||||
//! [51]
|
||||
|
||||
//! [51a]
|
||||
install_name_tool -change /System/Library/Frameworks/CoreVideo.framework/
|
||||
Versions/A/CoreVideo /System/Library/Frameworks/QuartzCore.framework/
|
||||
Versions/A/QuartzCore libphonon_qt7.dylib
|
||||
//! [51a]
|
||||
|
||||
//! [51b]
|
||||
./CONFIGURE - SDK MacOSX10.4u.sdk
|
||||
//! [51b]
|
||||
|
||||
//! [52]
|
||||
./configure (other arguments) -universal -sdk /Developer/SDKs/MacOSX10.4u.sdk
|
||||
//! [52]
|
||||
|
||||
|
||||
//! [53]
|
||||
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
|
||||
CONFIG+=x86 ppc
|
||||
//! [53]
|
||||
|
||||
|
||||
//! [54]
|
||||
qApp->addLibraryPath("C:/customPath/plugins");
|
||||
//! [54]
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
//! [0]
|
||||
CONFIG += uitools
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
#include <QtUiTools>
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
void on_<object name>_<signal name>(<signal parameters>);
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
CONFIG += release
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
||||
INSTALLS += target
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
QT += script
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
widget.text = 'Hi - I was built ' + new Date().toString();
|
||||
//! [6]
|
||||
|
||||
|
||||
//! [7]
|
||||
class MyExtension: public QObject,
|
||||
public QdesignerContainerExtension
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACE(QDesignerContainerExtension)
|
||||
|
||||
...
|
||||
}
|
||||
//! [7]
|
||||
|
||||
|
||||
//! [8]
|
||||
QObject *ANewExtensionFactory::createExtension(QObject *object,
|
||||
const QString &iid, QObject *parent) const
|
||||
{
|
||||
if (iid != Q_TYPEID(QDesignerContainerExtension))
|
||||
return 0;
|
||||
|
||||
if (MyCustomWidget *widget = qobject_cast<MyCustomWidget*>
|
||||
(object))
|
||||
return new MyContainerExtension(widget, parent);
|
||||
|
||||
return 0;
|
||||
}
|
||||
//! [8]
|
||||
|
||||
|
||||
//! [9]
|
||||
QObject *AGeneralExtensionFactory::createExtension(QObject *object,
|
||||
const QString &iid, QObject *parent) const
|
||||
{
|
||||
MyCustomWidget *widget = qobject_cast<MyCustomWidget*>(object);
|
||||
|
||||
if (widget && (iid == Q_TYPEID(QDesignerTaskMenuExtension))) {
|
||||
return new MyTaskMenuExtension(widget, parent);
|
||||
|
||||
} else if (widget && (iid == Q_TYPEID(QDesignerContainerExtension))) {
|
||||
return new MyContainerExtension(widget, parent);
|
||||
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//! [9]
|
||||
|
||||
|
||||
//! [10]
|
||||
void MyPlugin::initialize(QDesignerFormEditorInterface *formEditor)
|
||||
{
|
||||
if (initialized)
|
||||
return;
|
||||
|
||||
QExtensionManager *manager = formEditor->extensionManager();
|
||||
Q_ASSERT(manager != 0);
|
||||
|
||||
manager->registerExtensions(new MyExtensionFactory(manager),
|
||||
Q_TYPEID(QDesignerTaskMenuExtension));
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
//! [10]
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
//! [0]
|
||||
void MyQt3Widget::customStartDragFunction()
|
||||
{
|
||||
QDragObject *d = new QTextDrag( myHighlightedText(), this );
|
||||
d->dragCopy();
|
||||
// do NOT delete d.
|
||||
}
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
void MyQt3Widget::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
event->accept(
|
||||
QTextDrag::canDecode(event) ||
|
||||
QImageDrag::canDecode(event)
|
||||
);
|
||||
}
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
void MyQt3Widget::dropEvent(QDropEvent* event)
|
||||
{
|
||||
QImage image;
|
||||
QString text;
|
||||
|
||||
if ( QImageDrag::decode(event, image) ) {
|
||||
insertImageAt(image, event->pos());
|
||||
} else if ( QTextDrag::decode(event, text) ) {
|
||||
insertTextAt(text, event->pos());
|
||||
}
|
||||
}
|
||||
//! [2]
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
//! [0]
|
||||
./configure -help
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
configure -qt-kbd-s15000
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
export QWS_KEYBOARD=<driver>[:<driver specific options>]
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
export QWS_KEYBOARD="<driver>[:<driver specific options>]
|
||||
<driver>[:<driver specific options>]
|
||||
<driver>[:<driver specific options>]"
|
||||
//! [3]
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
//! [0]
|
||||
export PATH=path/to/cross/compiler:$PATH
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
./configure -embedded arm -xplatform qws/linux-arm-g++ <other options>
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
cp path/to/QtEmbedded/mkspecs/qws/linux-mips-g++/...
|
||||
path/to/QtEmbedded/mkspecs/qws/linux-myarchitecture-g++/...
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
cd path/to/QtEmbedded
|
||||
./configure -embedded <architecture> -qt-kbd-<keyboarddriver>
|
||||
-qt-mouse-<mousedriver> -qt-gfx-<screendriver>
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
cd path/to/QtEmbedded
|
||||
./configure <other options>
|
||||
-L /path/to/libjpeg/libraries -I /path/to/libjpeg/headers
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
cd path/to/myApplication
|
||||
qmake -project
|
||||
qmake
|
||||
make
|
||||
//! [5]
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
//! [0]
|
||||
export QWS_DISPLAY=<driver>[:<driver specific options>]...
|
||||
[:<display num>]
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
export QWS_SIZE=<width>x<height>
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
export QWS_MOUSE_PROTO=<driver>[:<driver specific options>]
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
export QWS_MOUSE_PROTO="<driver>[:<driver specific options>]
|
||||
<driver>[:<driver specific options>]
|
||||
<driver>[:<driver specific options>]"
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
export QWS_MOUSE_PROTO="Vr41xx:press=500:/dev/misc/ts"
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
export QWS_KEYBOARD=<driver>[:<driver specific options>]
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
export QWS_KEYBOARD="<driver>[:<driver specific options>]
|
||||
<driver>[:<driver specific options>]
|
||||
<driver>[:<driver specific options>]"
|
||||
//! [6]
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
//! [0]
|
||||
configure.exe -D QT_NO_THREAD
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
./configure -no-feature-thread
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
configure.exe -qconfig myfile
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
./configure -qconfig myfile
|
||||
//! [3]
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
//! [0]
|
||||
name file renderer italic weight size flags
|
||||
//! [0]
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
//! [0]
|
||||
cd <anywhere>
|
||||
gunzip qt-embedded-linux-commercial-src-4.5.2.tar.gz
|
||||
tar xf qt-embedded-linux-commercial-src-4.5.2.tar
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
~/qt-embedded-linux-commercial-src-4.5.2
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
cd ~/qt-embedded-linux-commercial-src-4.5.2
|
||||
./configure -embedded [architecture]
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
make
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
su -c "make install"
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
PATH=/usr/local/Trolltech/QtEmbedded-4.5.2/bin:$PATH
|
||||
export PATH
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
setenv PATH /usr/local/Trolltech/QtEmbedded-4.5.2/bin:$PATH
|
||||
//! [6]
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
//! [0]
|
||||
./configure -static
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
void *operator new[](size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void *operator new(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void operator delete[](void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void *ptr, size_t)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void operator delete(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void operator delete(void *ptr, size_t)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
//! [1]
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
//! [0]
|
||||
<qtopia-root-dir>/qtopiacore/qt/configure -embedded -help |grep -a1 mouse
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
./configure -extra-qtopiacore-config -qt-mouse-tslib
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
./configure -help
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
configure -qt-mouse-tslib
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
export QWS_MOUSE_PROTO=<driver>[:<driver specific options>]
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
export QWS_MOUSE_PROTO="<driver>[:<driver specific options>]
|
||||
<driver>[:<driver specific options>]
|
||||
<driver>[:<driver specific options>]"
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
export QWS_MOUSE_PROTO="Vr41xx:press=500:/dev/misc/ts"
|
||||
//! [6]
|
||||
|
||||
|
||||
//! [7]
|
||||
./configure -L <path to tslib library> -I <path to tslib headers>
|
||||
//! [7]
|
||||
|
||||
|
||||
//! [8]
|
||||
module_raw input
|
||||
module linear
|
||||
//! [8]
|
||||
|
||||
|
||||
//! [9]
|
||||
QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0
|
||||
//! [9]
|
||||
|
||||
|
||||
//! [10]
|
||||
cat /dev/input/mouse0 | hexdump
|
||||
//! [10]
|
||||
|
||||
|
||||
//! [11]
|
||||
QWS_MOUSE_PROTO=IntelliMouse:/dev/input/mouse0
|
||||
//! [11]
|
||||
|
||||
|
||||
//! [12]
|
||||
chmod a+rw /dev/input/mouse0
|
||||
//! [12]
|
||||
|
||||
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
//! [0]
|
||||
cd path/to/QtEmbedded
|
||||
./configure -qvfb
|
||||
make
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
cd path/to/Qt/tools/qvfb
|
||||
make
|
||||
./qvfb
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
cd path/to/Qt/tools/qvfb/ClamshellPhone.skin/
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
[SkinFile]
|
||||
Up=ClamshellPhone1-5.png
|
||||
Down=ClamshellPhone1-5-pressed.png
|
||||
Closed=ClamshellPhone1-5-closed.png
|
||||
Screen=72 84 176 208
|
||||
Areas=22
|
||||
|
||||
"Power" 0x0100000a 205 563 249 586
|
||||
"1" 0x0031 62 414 119 438
|
||||
"2" 0x0032 130 414 189 438
|
||||
"3" 0x0033 198 413 257 438
|
||||
"4" 0x0034 54 444 117 470
|
||||
"5" 0x0035 128 444 189 471
|
||||
"6" 0x0036 202 444 264 471
|
||||
"7" 0x0037 47 477 113 507
|
||||
"8" 0x0038 126 477 190 507
|
||||
"9" 0x0039 205 478 270 509
|
||||
"*" 0x002a 39 515 110 552
|
||||
"0" 0x0030 122 515 195 553
|
||||
"#" 0x0023 207 516 280 553
|
||||
"Context1" 0x01100000 137 360 108 383 123 410 90 409 60 387 63 378
|
||||
100 362
|
||||
"Back" 0x01000061 184 361 206 376 213 387 197 410 226 410 256 392
|
||||
258 381 244 369
|
||||
"Backspace" 0x01000003 68 563 113 587
|
||||
"Select" 0x01010000 160 391 172 390 181 386 184 381 180 377 173
|
||||
373 165 372 155 372 145 375 138 378 136
|
||||
382 138 387 147 390
|
||||
"Left" 0x1000012 141 390 136 385 136 381 143 375 132 371 120
|
||||
380 121 393 129 401
|
||||
"Down" 0x1000015 143 389 130 402 162 412 191 404 175 390
|
||||
"Right" 0x1000014 186 370 176 375 184 382 182 387 175 390 190 404
|
||||
201 396 202 375
|
||||
"Up" 0x1000013 133 370 143 374 176 374 185 370 169 362 149 362
|
||||
"Flip" 0x01100006 98 325 225 353
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
cd path/to/QtEmbedded/examples/widgets/analogclock
|
||||
make
|
||||
./analogclock -qws
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
cd path/to/QtEmbedded/examples/widgets/analogclock
|
||||
make
|
||||
./analogclock -qws -display QVFb:0
|
||||
//! [5]
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
//! [0]
|
||||
cd path/to/QtEmbedded/demos/textedit
|
||||
./textedit -qws
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
./myfirstserverapplication -qws -display "transformed:rot90:1"
|
||||
./mysecondserverapplication -qws -display "QVFb:2"
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
./myclientapplication -display "QVFb:2"
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
./myserverapplication -qws -display "Multi: QVFb:0
|
||||
QVFb:1:offset=0,0 VNC:offset=640,0 :2"
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
./myapplication -fn helvetica
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
./myapplication -bg blue
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
./myapplication -btn green
|
||||
//! [6]
|
||||
|
||||
|
||||
//! [7]
|
||||
./myapplication -fg 'dark blue'
|
||||
//! [7]
|
||||
|
||||
|
||||
//! [8]
|
||||
./myapplication -name texteditapplication
|
||||
//! [8]
|
||||
|
||||
|
||||
//! [9]
|
||||
./myapplication -title 'Text Edit'
|
||||
//! [9]
|
||||
|
||||
|
||||
//! [10]
|
||||
./myapplication -geometry 300x200+50+50
|
||||
//! [10]
|
||||
|
||||
|
||||
//! [11]
|
||||
./myapplication -decoration windows
|
||||
//! [11]
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
//! [0]
|
||||
cd path/to/QtEmbedded
|
||||
./configure -qt-gfx-vnc
|
||||
make
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
cd path/to/QtEmbedded/examples/widgets/analogclock
|
||||
./analogclock -qws -display VNC:0
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
vncviewer localhost:0
|
||||
//! [2]
|
||||
|
||||
//! [Starting server]
|
||||
analogclock -qws -display VNC:0
|
||||
//! [Starting server]
|
||||
//! [Starting clients]
|
||||
calculator -display VNC:0
|
||||
scribble -display VNC:0
|
||||
imageviewer -display VNC:0
|
||||
//! [Starting clients]
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
//! [0]
|
||||
Private Application As comappLib.Application
|
||||
Private MyApp As Boolean
|
||||
|
||||
Private Sub UpdateList()
|
||||
DocumentList.Clear
|
||||
DocumentsCount.Caption = Application.documents.Count
|
||||
For Index = 0 To Application.documents.Count - 1
|
||||
DocumentList.AddItem (Application.documents.Item(Index).Title)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub Form_Load()
|
||||
On Error GoTo CreateNew
|
||||
Set Application = GetObject(, "comapp.Application")
|
||||
MyApp = False
|
||||
GoTo Initialized
|
||||
CreateNew:
|
||||
On Error GoTo InitializeFailed
|
||||
Set Application = New Application
|
||||
Application.Visible = True
|
||||
MyApp = True
|
||||
Initialized:
|
||||
Caption = Application.id
|
||||
UpdateList
|
||||
InitializeFailed:
|
||||
End Sub
|
||||
|
||||
Private Sub Form_Unload(Cancel As Integer)
|
||||
If MyApp Then
|
||||
Application.quit
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub NewDocument_Click()
|
||||
Application.documents.addDocument
|
||||
UpdateList
|
||||
End Sub
|
||||
//! [0]
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
//! [0]
|
||||
' VB is case insensitive, but our C++ controls are not.
|
||||
' Me.resetButton.enabled = True
|
||||
//! [0]
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
//! [0]
|
||||
<object ID="QMenus" CLASSID="CLSID:4dc3f340-a6f7-44e4-a79b-3e9217695fbd"
|
||||
CODEBASE="http://qtsoftware.com/demos/menusax.cab">
|
||||
[Object not available! Did you forget to build and register the server?]
|
||||
</object>
|
||||
//! [0]
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
//! [0]
|
||||
myApplication -qws -display ahigl
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
myApplication -qws -display ahigl
|
||||
//! [1]
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
//! [0]
|
||||
application -style=windows
|
||||
application -style=motif
|
||||
application -style=cde
|
||||
//! [0]
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
//! [0]
|
||||
qApp->translate("ArrowPad", x)
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
lrelease arrowpad.pro
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
export LANG=fr
|
||||
setenv LANG fr
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
set LANG=fr
|
||||
//! [3]
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
//! [0]
|
||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
||||
INSTALLS += target
|
||||
//! [0]
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
//! [0]
|
||||
target.path = $$[QT_INSTALL_PLUGINS]/designer
|
||||
INSTALLS += target
|
||||
//! [0]
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
//! [0]
|
||||
foreach(variable, container)
|
||||
//! [0]
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
//! [0]
|
||||
QVariant a = model->index(0, 0, QModelIndex()).data();
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
QVariant b = model->index(1, 0, QModelIndex()).data();
|
||||
//! [1]
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
//! [0]
|
||||
lupdate -verbose hellotr.pro
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
<!DOCTYPE TS><TS>
|
||||
<context>
|
||||
<name>QPushButton</name>
|
||||
<message>
|
||||
<source>Hello world!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
linguist hellotr_la.ts
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
<translation type='unfinished'></translation>
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
<translation>Orbis, te saluto!</translation>
|
||||
//! [4]
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
//! [0]
|
||||
if (!condition)
|
||||
qFatal("ASSERT: "condition" in file ...");
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
qmake "CONFIG += debug" icons.pro
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
qmake "CONFIG += release" icons.pro
|
||||
//! [2]
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue