MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->graphicsView->setScene(scene);
scene->installEventFilter(this);
//In the Switch cases Im calling for Mouse press, move and release events. Then update() func in move and release cases. The same graphicview co-ordinates are stored in Static variable, accesed same in the Paintevent.
{
qDebug("Entering the paint");
QPen myPen
(Qt
::blue,
3,Qt
::SolidLine);
painter.setPen(myPen);
QRectF r1
(s_count_x,s_count_y,
(s_count_x1
-s_count_x
),
(s_count_y1
-s_count_y
));
scene->addRect(r1,myPen);