hi, all
my application is graphics/view module.
when I click my element toolbar which activate the element insert action, I want to create
the element thumbnail which moves follow the mouse ,when released , create the element at the release position. I try the Drag/Drop method, which not worked well ,and then I try to reimplement the mousemovement ,
when the element action toggled
// when the element add action toggled ,I set the m_pasteHereAction ture.
if(this->m_pasteHereAction)
{
painter.drawRect(e->pos().x(),e->pos().y(), 200,100);
}
// when the element add action toggled ,I set the m_pasteHereAction ture.
void DiagramView::mouseMoveEvent(QMouseEvent *e)
if(this->m_pasteHereAction)
{
QPainter painter(this);
painter.drawRect(e->pos().x(),e->pos().y(), 200,100);
}
To copy to clipboard, switch view to plain text mode
it is not work,any helps ,thanks very much !
Bookmarks