1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
o Compiler Error: CC -DHAVE_CONFIG_H -I. -I. -I..
-I/users/toollib/include/python3.10 -I/users/pytqt/install/sip-tqt/include
-I/users/pytqt/install/tqt3/include -I/usr/openwin/include
-c tqtcmodule.cpp -KPIC -DPIC -o tqtcmodule.o
"siptqtProxytqt.h", line 113: Error: Multiple declaration for
sipProxytqt::proxySlot(int).
"tqtcmodule.cpp", line 5393: Error: sipProxytqt::proxySlot(int) already had a
body defined.
This occurs because the Sun Workshop C++ 4.2 compiler (and the Sun Forte
C++ 6.x compiler with -compat) can not distinguish between 'bool' and 'int'
types in overloaded method signatures and issues a compiler error.
In this case bool is declared in tqt/include/tqglobal.h as
'typedef int bool;'. To workaround this '#if 0' out the the declaration
and body of 'proxySlot(bool)' in PyTQt/tqt/siptqtProxytqt.h and
PyTQt/tqt/tqtcmodule.cpp. This resolves the compiler error but breaks
any 'sig(bool)' type signals. To workaround this, save the
PyTQt/tqt/siptqtProxytqt.moc generated after fixing the compiler error and
add the following bits of code:
...
static const TQUParameter param_slot_42[] = {
{ 0, &static_QUType_bool, 0, TQUParameter::In }
};
static const TQUMethod slot_42 = {"proxySlot", 1, param_slot_42 };
static const TQMetaData slot_tbl[] = {
...
{ "proxySlot(bool)", &slot_42, TQMetaData::Public }
};
metaObj = TQMetaObject::new_metaobject(
"sipProxytqt", parentObject,
slot_tbl, 43,
...
case 42: proxySlot(static_QUType_bool.get(_o+1)); break;
You will need to comment out the line in PyTQt/tqt/Makefile that re-generates
PyTQt/tqt/siptqtProxytqt.moc with moc to avoid the above changes from being
overwritten.
In order to test that everything has been done correctly, create a
toggle button and connect it's 'toggled(bool)' signal to a python slot,
if it works, your done!
|