QPainter

L

luca72

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

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

Whit qt4 :
gr = QtGui.QPainter(self.frame3)
#gr.setPen(QtGui.QPen(QtCore.Qt.black, 1, QtCore.Qt.SolidLine))
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
 
P

Phil Thompson

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

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

Whit qt4 :
gr = QtGui.QPainter(self.frame3)
#gr.setPen(QtGui.QPen(QtCore.Qt.black, 1, QtCore.Qt.SolidLine))
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 reimplementation of paintEvent().

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

Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top