[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Robot example
From: Paul Giannaros <ceruleanblaze () gmail ! com>
Date: 2007-05-20 16:58:08
Message-ID: 200705201758.08455.ceruleanblaze () gmail ! com
[Download RAW message or body]
On Sunday 20 May 2007 17:46:46 Lieven Buts wrote:
> Greetings all,
>
> in order to learn about PyQt I have been trying to port
> the "drag-and-drop robot" example from the Qt 4.2 distribution
> to Python. My current version can be found at
> http://ultr23.vub.ac.be/~lieven/pyqt/dragdroprobot-1.py
> and
> http://ultr23.vub.ac.be/~lieven/pyqt/head.png
>
> There are a number of issues that I haven't solved yet, and
> they are marked in the comments in the code.
>
> The most important ones are:
>
> 1) The QVariant system to pass color and image objects
> through the drag-and-drop mechanism. I can convert a QColor
> or QImage object to a QVariant, but I don't see the way
> to do the opposite (NOTES 1 and 3).
>
> 2) The C++ code uses
> "if (... || (qgraphicsitem_cast<RobotHead *>(this)) && ..."
> to test if a RobotPart object is an instance of the RobotHead subclass
> or not. I have cobbled some Python together to do the same test
> based on the __class__ attribute (NOTE 5), but it's not very elegant.
Use `isinstance(myObject, RobotHead)` instead
>
> 3) The animation does not work, and when the program exits, it
> prints the message "QObject::startTimer: QTimer can only be used with
> threads started with QThread". I guess it is necessary to explicitly
> create a QThread in Python, but my attempts so far have not succeeded.
>
I get the same message some time. It's QCanvasView related. It may be a PyQt
bug -- it hasn't caused any problems for me, though -- my animations tend to
work. I'd be interested if anyone has a fix!
> I'll continue looking into all these issues, but any suggestions
> would be very welcome.
>
> Cheers,
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic