Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #pragma once
  2. #include <QGraphicsScene>
  3. #include <QGraphicsView>
  4. #include <QPainter>
  5. #include <QGraphicsItem>
  6. #include <QGraphicsSceneMouseEvent>
  7. class MyShape : public  QGraphicsItem
  8. {
  9.   static int num;
  10.   static int counter;
  11.   QRectF SecretRect;
  12. public:
  13.   MyShape(QString &type, QRectF &Rect);
  14.   ~MyShape();
  15.  
  16.   QRectF MyShape::boundingRect() const;
  17.   QString TypeOfShape;
  18.  
  19.  
  20.   void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
  21.  
  22.  
  23. protected:
  24.   void mousePressEvent(QGraphicsSceneMouseEvent *event);
  25.   void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
  26. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement