Re: [PyQt] Re: how to show interactive Picture

2009-02-10 Thread Mads Ipsen
- Original Besked Fra: Markus Feldmann feldmann_mar...@gmx.de Til: pyqt@riverbankcomputing.com pyqt@riverbankcomputing.com Emne: [PyQt] Re: how to show interactive Picture Dato: 09/02/09 23:58 Mads Ipsen schrieb: gt; Could is be that you try to paint before the window is shown

[PyQt] Re: how to show interactive Picture

2009-02-10 Thread Markus Feldmann
Mads Ipsen schrieb: - Original Besked Fra: Markus Feldmann feldmann_mar...@gmx.de Til: pyqt@riverbankcomputing.com pyqt@riverbankcomputing.com Emne: [PyQt] Re: how to show interactive Picture Dato: 09/02/09 23:58 Mads Ipsen schrieb: gt; Could is be that you try to paint before

[PyQt] Re: how to show interactive Picture

2009-02-10 Thread Markus Feldmann
I got the follwing Messages: QPainter::begin: Widget painting can only begin as a result of a paintEvent QPainter::save: Painter not active QPainter::restore: Unbalanced save/restore QPainter::end: Painter not active, aborted I can't find the soultion. Please help.

[PyQt] Re: how to show interactive Picture

2009-02-10 Thread Markus Feldmann
David Boddie schrieb: On Tue Feb 10 15:02:13 GMT 2009, Markus Feldmann wrote: I think my Problem is that i have to send an envent? Yes, you need to make a paint event happen. You can do this by calling the update() method on the widget you want to be updated. As you wrote i changed some of

[PyQt] Re: how to show interactive Picture

2009-02-10 Thread Markus Feldmann
I changed the class Qwidget -- QSrollArea and got the same Problem as i have. So i think that i can not paint in a scrollarea ??? ### import sys from PyQt4 import QtCore, QtGui import basicdrawing_rc class

[PyQt] Re: how to show interactive Picture

2009-02-10 Thread Markus Feldmann
I go it. :-) I am not sure, but maybe i have to set a Widget in the ScrollArea, and in this Widget i may paint? Here is my Code: ## mport sys from PyQt4.QtGui import QMainWindow, QDockWidget, QPainter, QAction, QScrollArea

Re: [PyQt] Re: how to show interactive Picture

2009-02-10 Thread David Boddie
On Tue, 10 Feb 2009 22:42:24 +0100, Markus Feldmann wrote: I go it. :-) :-) I am not sure, but maybe i have to set a Widget in the ScrollArea, and in this Widget i may paint? That's the idea, yes. Here is my Code: [...] class ScrollArea(QScrollArea):      def __init__(self,

Re: [PyQt] Re: how to show interactive Picture

2009-02-10 Thread David Boddie
On Tue Feb 10 18:15:52 GMT 2009, Markus Feldmann wrote: To compare i post the example. There are some commands in the example i didn't understand. I do some notes in the Code !!! import sys from PyQt4 import QtCore, QtGui import basicdrawing_rc Note that you need to have this module to

[PyQt] Re: how to show interactive Picture

2009-02-10 Thread Markus Feldmann
David Boddie schrieb: Here, because you are using a QLabel to show the image, it should automatically appear correctly in the QScrollArea. (Aside: If you create your own custom widget (by subclassing QWidget), you have to reimplement the sizeHint() method as well as the paintEvent() method to

[PyQt] Re: how to show interactive Picture

2009-02-10 Thread Markus Feldmann
David Boddie schrieb: import basicdrawing_rc Note that you need to have this module to be able to show the image used by the example. It is created by running pyrcc4 in the basicdrawing directory like this: pyrcc4 -o basicdrawing_rc.py basicdrawing.qrc This causes all the resources

Re: [PyQt] Re: how to show interactive Picture

2009-02-10 Thread David Boddie
On Tue Feb 10 23:04:55 GMT 2009, Markus Feldmann wrote: David Boddie schrieb: Here, because you are using a QLabel to show the image, it should automatically appear correctly in the QScrollArea. (Aside: If you create your own custom widget (by subclassing QWidget), you have to

Re: [PyQt] Re: how to show interactive Picture

2009-02-10 Thread David Boddie
On Wed, 11 Feb 2009 00:24:47 +0100, Markus Feldmann wrote: Here's what might be causing the image not to appear. If, for some reason, the basicdrawing_rc.py file was created without the image data, this will fail, leaving you with a null pixmap. I understand, but my Programm does not have

[PyQt] Re: how to show interactive Picture

2009-02-10 Thread Markus Feldmann
David Boddie schrieb: It's not necessary to understand how to use resources initially, but you will find them useful when you start wanting to run the program from within different directories. This is a really important thing, but maybe i can bypass this with some python commands. :-) As i

[PyQt] Re: how to show interactive Picture

2009-02-09 Thread Markus Feldmann
Mads Ipsen schrieb: Could is be that you try to paint before the window is shown? You need to call show() before you can start painting. The following snippet generates an error similar to yours: Hi, This is not all of my Code. So there is a show() in my main source code. This Source Code