phil at riverbankcomputing.com
Sun Apr 29 15:47:17 BST 2012
On Sat, 28 Apr 2012 00:57:47 +0300, "Ville M. Vainio" <vivainio at gmail.com>
> I have a qml file invoking methods on a QObject subclass. I have used
> @pyqtSlot decorator to expose the methods as slots.
> I can see that the methods are run; however, the return values seem to
> be discarded.
> Code for the QObject subclass (that I expose with setContextProperty)
> is like this:
> from PyQt4 import QtCore
> from PyQt4.QtCore import QObject,pyqtSlot
> class NodeWrapper(QObject):
> def __init__(self, c,v):
> self.c = c
> self.v = v
> def get_b(self):
> return 2
> #return self.v.b
> def get_h(self):
> return self.v.h
> def children(self):
> #self.all = all = [NodeWrapper(self.c, chi) for chi in
> all = "hello"
> print "Will ret",all
> return all
> I have tried passing return value in the decorator (return=int...).
> Any clues where to look?
Have you got a complete test that demonstrates the problem?
More information about the PyQt