KDE

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Segfault when accessing a QString after emission

    0 answers - 1232 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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

Re: Segfault when accessing a QString after emission


max 4000 letters.
Your nickname that display:
In order to stop the spam: 6 + 5 =
QUESTION ON "KDE"

EMSDN.COM