Hi!
This is driving me mad:
[[[
Python 2.4.1 (#7, Aug 3 2005, 14:55:58)
[GCC 3.3.1 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from qt import *
import sys
app = QApplication(sys.argv)
class ConnBox(Q):
def __init__(self, *args):
apply(Q,(self,)+args)
self.arg = None
def slotSArgToStr(self, arg):
self.arg = str(arg)
def slotSArg(self, arg):
self.arg = arg
le = QLineEdit(None)
cb = ConnBox()
Q(
le, SIGNAL('textChanged(const QString&)'),
cb.slotSArgToStr)
True
le.setText('foo')
print cb.arg
foo
Q(
le, SIGNAL('textChanged(const QString&)'),
cb.slotSArgToStr)
True
Q(
le, SIGNAL('textChanged(const QString&)'),
cb.slotSArg)
True
le.setText('bar')
cb.arg
<qt.QString object at 0x402adfac>
print cb.arg
Process Python segmentation fault
]]]
What is the problem here? Why can't I store a QString like a
Python-string? Can anyone explain?
TIA and best wishes, Marco
PyKDE mailing list PyKDE (AT) mats (DOT) imk.fraunhofer.de