Hi all :)<br><br>I am trying to draw a cross in a label with coordinates.<br><br>I&#39;ve think (surely false ;) ) make a a widget, place it on coodinates and paint it with my cross Image.<br><br>here is this code : <br>class point(
QtGui.QWidget):<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __init__(self, x, y, parent):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;parti&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QtGui.QWidget.__init__(self, parent)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.x = x<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.y = y<br>&nbsp;&nbsp;&nbsp; def paintEvent(self, event):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;parti_&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; painter = QtGui.QPainter(self)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &quot;painter_ok&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; painter.setPen(QtCore.Qt.black)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; painter.drawImage(QtCore.QPoint(self.x
,self.y), QtGui.QImage(&quot;croix.png&quot;))<br clear="all"><br><br>I call my widget with : point_draw = point(x,y,self.ui.label_where_to_draw_my_widget)<br><br>When I do this, I could see my paintEvent is launched (print &quot;parti_&quot;) but nothings happens on my label.
<br><br>Why ?<br><br>Thanks.<br><br>JB<br><br>-- <br><a href="http://astrolix.org">http://astrolix.org</a><br>association des linuxiens astronomes