void mousePressEvent(QMouseEvent *e); void mouseMoveEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); QPoint last;
void AddDialog::mousePressEvent(QMouseEvent *e) { last = e->globalPos(); } void AddDialog::mouseMoveEvent(QMouseEvent *e) { int dx = e->globalX()-last.x(); int dy = e->globalY()-last.y(); last = e->globalPos(); move(x()+dx,y()+dy); } void AddDialog::mouseReleaseEvent(QMouseEvent *e) { int dx = e->globalX()-last.x(); int dy = e->globalY()-last.y(); last = e->globalPos(); move(x()+dx,y()+dy); }