PDA

View Full Version : Drawing in GraphicsView



er.soodneha
24th April 2010, 22:28
Hi ,
I am new to GraphicsView Programming, I want to draw a line with mouse move while its left mouse
button pressed as in paint brush application . After drawing the line we sould be able to move the line
from one pos. to another pos. with the help of mouse move while it's left mouse button pressed on the line .
Please give the simple example code so that i can better understand the logic behind it and can modify according
to my needs .

Thanx in advance .

wysota
26th April 2010, 01:00
I suggest you first try something yourself and only then should you fail, come here, show us your code and we will help you correct it. There is a lot of example code bundled with Qt, you will surely find something to base your code on. Right now I can only advise to take a closer look at QGraphicsLineItem,QGraphicsScene::mousePressEvent( ) and QGraphicsScene::mouseReleaseEvent().