Guest User

Untitled

a guest
Jun 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. >>> picture = QPicture()
  2. >>> painter = QPainter(picture)
  3. >>> picture.boundingRect()
  4. QRect(0,0,0,0)
  5. >>> painter.drawRect(20,20,50,50)
  6. >>> picture.boundingRect()
  7. QRect(20,20,50,50)
  8.  
  9. >>> picture = QPicture()
  10. >>> painter = QPainter(picture)
  11. >>> picture.boundingRect()
  12. QRect(0,0,0,0)
  13. >>> painter.drawText(10,10, "Hello, World!")
  14. >>> picture.boundingRect()
  15. QRect(0,0,0,0)
  16.  
  17. pic = Qt.QPicture()
  18. p = QtGui.QPainter(pic)
  19. brect = p.drawText(10,10,200,200, QtCore.Qt.AlignCenter, "blah")
  20. p.end()
  21. print brect
  22. print pic.boundingRect()
Add Comment
Please, Sign In to add comment