#include <QtGui>
#include "QThread"
//------------------------------------------------graphics scene-------------//
class PaintWidget:public QGraphicsScene
{
//Q_OBJECT
public:
PaintWidget(QWidget *parent = 0);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
};
PaintWidget::PaintWidget(QWidget *parent)
:QGraphicsScene(parent)//,currShapeCode(Shape::Line),currItem(NULL)
{
}
void PaintWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
int a,b;
QPointF qp = event->scenePos();
a = qp.x();
b = qp.y();
QGraphicsScene::mousePressEvent(event);
}
void PaintWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
QGraphicsScene::mouseMoveEvent(event);
}
void PaintWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
QGraphicsScene::mouseReleaseEvent(event);
}
//main
PaintWidget *pw = new PaintWidget;
myMainWindow.LoadGraphicsView->setScene(pw);