Re: [PyQt] GraphicsItem, QObject Inheritance problem

2009-10-01 Thread Phil Thompson
On Wed, 30 Sep 2009 17:43:03 -0700 (PDT), Jason H wrote: > I am working on a hacked PyQt to play with the new animation features. So > this isn't entirely kosher, however. > > I have the following: > class AffineItem(QGraphicsItem): > def __init__(self, ..., parent): > QGraphicsIt

Re: [PyQt] GraphicsItem, QObject Inheritance problem

2009-10-01 Thread Brian Kelley
What you can do, however, is to make a QObject delegate like: class WrappedAffineItem(AffineItem): def __init__(self ...): self.qobject = QObject(self) AffineItem.__init__(self, ..., parent) self.qobject.connect(self.qobject,

[PyQt] PyQt4 build problem : 'qHash' was not declared in this scope

2009-10-01 Thread Thibault Bartolone
Hello everyone. I'm trying to install a software that needs pyQt4 to function (GNS3, Cisco router emulator). I'm running Linux CentOS 5.2 on a i386 type processor. I based the compilation process on this page For that, I've successfully installed the following : python python-devel xorg-x11-pro

Re: [PyQt] GraphicsItem, QObject Inheritance problem

2009-10-01 Thread Jason H
Thanks Brian, but I don't understand that. If it is derived from a non-object, how does the connect work? I went with the reverse approach: class ObjWrapper(QObject): def __init__(self, item): QObject.__init__(self) self.item=item ... then provide the properties, signals/slot

Re: [PyQt] Need a recipe for building [solved]

2009-10-01 Thread Brian Brown
One last thing, after building successfully, I would receive the following error when trying to use PyQt: /Library/Python/2.6/site-packages/PyQt4/QtCore.so: mach-o, but wrong architecture I'd read that this had to do with Python defaulting to running in 64- bit mode, so I tried building s

Re: [PyQt] GraphicsItem, QObject Inheritance problem

2009-10-01 Thread Brian Kelley
All you need to connect signals and slots is a qobject. You can create any qobject for this task. Here is a concrete example, actually using a QGraphicsItem. This makes an Image button that emits a signal "clicked()" and move the graphics to mimic a button press: class ImageButton(QtGui.QGra

Re: [PyQt] PyQt4 build problem : 'qHash' was not declared in this scope

2009-10-01 Thread Phil Thompson
On Thu, 1 Oct 2009 06:42:23 -0700 (PDT), Thibault Bartolone wrote: > Hello everyone. I'm trying to install a software that needs pyQt4 to > function (GNS3, Cisco router emulator). > > I'm running Linux CentOS 5.2 on a i386 type processor. I based the > compilation process on this page > > For th

[PyQt] Another connect problem

2009-10-01 Thread Thomas Olsen
Hi This is actually PyKDE4 related but the list seems to be dead. I am trying to connect a KIO.TransferJob[1] to a method in my class but must be doing something wrong. A very stripped down version of my class looks like this: from PyKDE4.kdecore import * from PyKDE4.kio import * class MyClas

Re: [PyQt] GraphicsItem, QObject Inheritance problem

2009-10-01 Thread Jason H
I think you and I are very close to a nice work-around. I see you're providing a object as a property, and connecting to that. What I think should be possible, is to provide a QObject derived class (on the outside), then using __getattr__(self, name), __setattr__(self, name, value), and maybe _

Re: [PyQt] Another connect problem

2009-10-01 Thread Jason H
job is not a member of the class (self.job) so it gets destroyed. - Original Message From: Thomas Olsen To: pyqt@riverbankcomputing.com Sent: Thursday, October 1, 2009 2:09:21 PM Subject: [PyQt] Another connect problem Hi This is actually PyKDE4 related but the list seems to be dead

Re: [PyQt] Another connect problem

2009-10-01 Thread Thomas Olsen
On Thursday 01 October 2009 20:22:00 Jason H wrote: > job is not a member of the class (self.job) so it gets destroyed. > So should it be: def job_recieved(self, data): print "Data recieved: " + data I was looking at the example: #include #include #include #include #include

Re: [PyQt] Another connect problem

2009-10-01 Thread Jason H
The C++ code uses new to create an object on the heap, which you must delete later In python if nothing references the object, it is destroyed. So as soon as __init__ is done, job goes *poof* You need to maintain a reference to it by using self.job = ... so that way the class keeps the job insta

Re: [PyQt] PyQt4 build problem : 'qHash' was not declared in this scope

2009-10-01 Thread Hans-Peter Jansen
Am Donnerstag 01 Oktober 2009 schrieb Phil Thompson: > On Thu, 1 Oct 2009 06:42:23 -0700 (PDT), Thibault Bartolone > > wrote: > > Hello everyone. I'm trying to install a software that needs pyQt4 to > > function (GNS3, Cisco router emulator). > > > > I'm running Linux CentOS 5.2 on a i386 type pro

Re: [PyQt] Another connect problem

2009-10-01 Thread Thomas Olsen
On Thursday 01 October 2009 20:56:17 Jason H wrote: > The C++ code uses new to create an object on the heap, which you must > delete later In python if nothing references the object, it is destroyed. > So as soon as __init__ is done, job goes *poof* You need to maintain a > reference to it by us

Re: [PyQt] PyQt4 build problem : 'qHash' was not declared in this scope

2009-10-01 Thread Thibault Bartolone
Thank you so much it works fine. I added the part you said once in qurl.sip and twice in qdatetime.sip. Question : is it a bug ? Or something missing on my computer ? Thank you again. --- En date de : Jeu 1.10.09, Phil Thompson a écrit : De: Phil Thompson Objet: Re: [PyQt] PyQt4 build probl

Re: [PyQt] PyQt4 build problem : 'qHash' was not declared in this scope

2009-10-01 Thread Phil Thompson
On Thu, 1 Oct 2009 14:25:10 -0700 (PDT), Thibault Bartolone wrote: > Thank you so much it works fine. > > I added the part you said once in qurl.sip and twice in qdatetime.sip. > > Question : is it a bug ? Or something missing on my computer ? A bug, but I've never seen it with the standard Qt

Re: [PyQt] Another connect problem

2009-10-01 Thread David Boddie
On Thu Oct 1 20:38:00 BST 2009, Thomas Olsen wrote: > On Thursday 01 October 2009 20:56:17 Jason H wrote: > > The C++ code uses new to create an object on the heap, which you must > > delete later In python if nothing references the object, it is > > destroyed. So as soon as __init__ is done, job

Re: [PyQt] Another connect problem

2009-10-01 Thread Thomas Olsen
On 1/10-2009 23:28 David Boddie wrote: > On Thu Oct 1 20:38:00 BST 2009, Thomas Olsen wrote: > > On Thursday 01 October 2009 20:56:17 Jason H wrote: > > > The C++ code uses new to create an object on the heap, which you must > > > delete later In python if nothing references the object, it is > >

Re: [PyQt] Another connect problem

2009-10-01 Thread David Boddie
On Thu Oct 1 22:46:39 BST 2009, Thomas Olsen wrote: > I use the style you've quoted above and the call return "True". Tried to > read the documentation for the new-style syntax but I couldn't really grasp > how to use it without a working example. Maybe something like this will work: job.data.

[PyQt] phonon total time question

2009-10-01 Thread laurlaur
Hi, I tried using in my application the method totalTime() of the Phonon module. I start playing the mp3 file and after that call media object .totalTime(). The problem is that I mainly receive the value corresponding for the previous file played. In case the current one is the only one at the fir

Re: [PyQt] Another connect problem

2009-10-01 Thread Thomas Olsen
On 1/10-2009 23:51 David Boddie wrote: > job.data.connect(self.job_received) > Thanks! It works. It really is true that the new syntax is more python like. The documentation was so explicit that I didn't understand it :-) The only problem now is that the method doesn't actually get any data.

[PyQt] QLibraryInfo and images

2009-10-01 Thread Scott Frankel
Hi, Can a qt.conf file be used to specify an images directory using the QLibraryInfo.LibraryLocation enum? I wonder if I'm barking up the right tree. My app displays images that have been compiled as resources (.png, .tif, or .jpg) without issue on Fedora and Windows. But it doesn't di