Hello, All !
I want to draw QtCanvasEllipse object on QtCanvas, I do
...
QtCanvasEllipse *ellipse = new QtCanvasEllipse ( 100, 100, view->canvas() );
ellipse->move ( event->pos().x(), event->pos().y() );
ellipse
->setPen
( QPen( Qt
::DashDotLine ) );
ellipse->setZ ( 10000 );
ellipse->show ( );
view->canvas()->setChanged ( view->viewport()->rect() );
view->canvas()->update();
...
...
QtCanvasEllipse *ellipse = new QtCanvasEllipse ( 100, 100, view->canvas() );
ellipse->move ( event->pos().x(), event->pos().y() );
ellipse->setPen ( QPen( Qt::DashDotLine ) );
ellipse->setZ ( 10000 );
ellipse->show ( );
view->canvas()->setChanged ( view->viewport()->rect() );
view->canvas()->update();
...
To copy to clipboard, switch view to plain text mode
but nothing drawing. I think that I move ellipse to position far from canvas. Which way I have to draw ellipse with mouse press event center ?
Bookmarks