[PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-13 Thread Mathias . Born
Hi, I have a C++ class "Project", which I expose to Python via sip. In Python, I sub-class: class Derived(Project): ... In addition, there is a Python factory function which creates an instance of "Derived" and returns it: def f(): return Derived(...) I call this function from within

Re: [PyQt] How to process QDBusPendingCallWatcher results?

2012-08-13 Thread Evade Flow
Oh, right---remove the decorator itself, not the decorator argument. Then it works just fine, too. And I see what you mean about it being a bit better to specify QDBusPendingCall instead of QDBusPendingCallWatcher if leaving the decorator in place. Thanks again! On Mon, Aug 13, 2012 at 12:52 PM,

Re: [PyQt] How to process QDBusPendingCallWatcher results?

2012-08-13 Thread Phil Thompson
On Mon, 13 Aug 2012 11:46:19 -0400, Evade Flow wrote: > I noticed that, too, and was a little surprised it worked anyway. The pyqtSlot() call is being ignored. > But > shouldn't it be: > > @QtCore.pyqtSlot(QtDBus.QDBusPendingCallWatcher) > def callFinishedSlot(self, call): That would w

[PyQt] simpletreemodel example still throwing an error on exit

2012-08-13 Thread Brian Knudson
Hello, From the mail archives in March 2010, I see that simpletreemodel was throwing an error on exit. Phil responded saying that things were being destroyed in the wrong order on exit & that there would be a fix put into that night's snapshot. I don't believe the change ever made it into t

Re: [PyQt] How to process QDBusPendingCallWatcher results?

2012-08-13 Thread Evade Flow
I noticed that, too, and was a little surprised it worked anyway. But shouldn't it be: @QtCore.pyqtSlot(QtDBus.QDBusPendingCallWatcher) def callFinishedSlot(self, call): When I remove it completely, I get: TypeError: callFinishedSlot() takes exactly 2 arguments (1 given) On Mon, A

Re: [PyQt] How to process QDBusPendingCallWatcher results?

2012-08-13 Thread Phil Thompson
On Mon, 13 Aug 2012 11:13:36 -0400, Evade Flow wrote: >> Sorry, my mistake - QDBusPendingReply, not QPyDBusPendingReply... > > Ah, okay---yeah, that works great, thanks! I had a couple minor typos in > my example. Appending a complete, working version below, in case it's > helpful to someone else

Re: [PyQt] How to process QDBusPendingCallWatcher results?

2012-08-13 Thread Evade Flow
> Sorry, my mistake - QDBusPendingReply, not QPyDBusPendingReply... Ah, okay---yeah, that works great, thanks! I had a couple minor typos in my example. Appending a complete, working version below, in case it's helpful to someone else (possibly a future version of me! :-}) It should work on most c

Re: [PyQt] setapi and itemChange , setParentItem related bug.

2012-08-13 Thread Ryan Kim
Work like a miracle! This is just what I needed. You saved my week! Thank you! -- View this message in context: http://python.6.n6.nabble.com/setapi-and-itemChange-setParentItem-related-bug-tp4984797p4984916.html Sent from the PyQt mailing list archive at Nabble.com. __

Re: [PyQt] setapi and itemChange , setParentItem related bug.

2012-08-13 Thread Phil Thompson
On Sun, 12 Aug 2012 10:03:03 -0700 (PDT), Ryan Kim wrote: > Hi. > > When I set sip.setapi('QVariant', 2) and reimplement itemChange function > of > > QGraphicsItem, setParentItem doesn't work. > > I read this issue has been dealt with on this mailing list, but I guess > It's > still there.

Re: [PyQt] How to process QDBusPendingCallWatcher results?

2012-08-13 Thread Phil Thompson
On Mon, 13 Aug 2012 09:41:44 -0400, Evade Flow wrote: >> Try this... >> >> def callFinishedSlot(self, call): >> reply = QtDBus.QPyDBusPendingReply(call) > > Thanks, Phil. It doesn't work for me yet, I'm getting: > call > reply = QtDBus.QPyDBusPendingReply(call) > Traceback

Re: [PyQt] How to process QDBusPendingCallWatcher results?

2012-08-13 Thread Evade Flow
> Try this... > > def callFinishedSlot(self, call): > reply = QtDBus.QPyDBusPendingReply(call) Thanks, Phil. It doesn't work for me yet, I'm getting: >>> call >>> reply = QtDBus.QPyDBusPendingReply(call) Traceback (most recent call last): File "", line 1, in builtins.AttributeErro

Re: [PyQt] How to process QDBusPendingCallWatcher results?

2012-08-13 Thread Phil Thompson
On Sun, 12 Aug 2012 23:31:54 -0400, Evade Flow wrote: > I'm working on an app that needs to invoke methods in > various D-Bus services asynchronously, so I wrote this small program to > test the basic machinery: > > >from PyQt4 import QtCore, QtDBus > >class DeviceInterface(QtDBus.QDBus