Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. void BackgroundLayer::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
  2. {
  3. painter->drawImage( QRectF(dx1, dy1, dx2-dx1, dy2-dy1), shownImage, QRectF(sx1, sy1, sx2-sx1, sy2-sy1) );
  4. }
  5.  
  6. void ForegroundLayer::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
  7. {
  8. QPen pen(Qt::red, 3, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
  9. painter->setPen(pen);
  10. painter->drawLine(p1, p2);
  11. }
  12.  
  13. Rectangle {
  14. width: 1920
  15. height: 1080
  16.  
  17. BackgroundLayer{
  18. id: background_layer
  19. anchors.fill: parent
  20. }
  21.  
  22. ForegroundLayer {
  23. id: foreground_layer
  24. anchors.fill: parent
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement