22 void Widget::startDrag()
26 pDrag->exec(Qt::CopyAction);
32 if (pe->button() == Qt::LeftButton) {
33 m_ptDragPos = pe->pos();
35 QWidget::mousePressEvent(pe);
41 if (pe->buttons() & Qt::LeftButton) {
42 int distance = (pe->pos() - m_ptDragPos).manhattanLength();
43 if (distance > QApplication::startDragDistance()) {
47 QWidget::mouseMoveEvent(pe);
54 pe->acceptProposedAction();
64 QWidget* pwgt = pmmd->
widget();
65 QString str(
"Widget is dropped\n ObjectName:%1");
66 setText(str.arg(pwgt->objectName()));