QPainter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • luca72

    #1

    QPainter

    Hello
    using qt3 i do the follow for paint some line in a frame

    gr = QPainter(self.f rame3)
    gr drawLine(30,10, 30,490)
    and the line is draw.

    Whit qt4 :
    gr = QtGui.QPainter( self.frame3)
    #gr.setPen(QtGu i.QPen(QtCore.Q t.black, 1, QtCore.Qt.Solid Line))
    gr.drawLine(30, 10,30,490)
    and nothing is draw but i have no error

    The frame is the same with the same dimension and relative dimension.

    where is the error?

    Regards

    Luca

  • Phil Thompson

    #2
    Re: QPainter

    On Wednesday 20 June 2007 4:44 pm, luca72 wrote:
    Hello
    using qt3 i do the follow for paint some line in a frame
    >
    gr = QPainter(self.f rame3)
    gr drawLine(30,10, 30,490)
    and the line is draw.
    >
    Whit qt4 :
    gr = QtGui.QPainter( self.frame3)
    #gr.setPen(QtGu i.QPen(QtCore.Q t.black, 1, QtCore.Qt.Solid Line))
    gr.drawLine(30, 10,30,490)
    and nothing is draw but i have no error
    >
    The frame is the same with the same dimension and relative dimension.
    >
    where is the error?
    Impossible to tell with so little information. One guess is that Qt4 requires
    you to paint from a reimplementatio n of paintEvent().

    Post a small but complete example to the PyQt mailing list.

    Phil

    Comment

    Working...