void TabBar::mouseMoveEvent(QMouseEvent *event) { if(!(event->buttons() & Qt::LeftButton)) return; if((event->pos() - drag_pos).manhattanLength() < DRAG_OFFSET) return; fn_begin; event->accept(); QDrag *drag = new QDrag(this); /*DEBUG*/ drag->setObjectName("drag"); connect(drag, SIGNAL(destroyed()), twutil, SLOT(dumpDestroyed())); QMimeData *mimedata = new QMimeData(); QWidget *widget = currentWidget(); mimedata->setData("action", "window_drag"); drag->setMimeData(mimedata); QPixmap pixmap = QPixmap::grabWidget(widget).scaledToWidth( PIXMAP_MAXWIDTH(widget->width()), Qt::SmoothTransformation); DragPixmap *dragpixmap = new DragPixmap(pixmap, PIXMAP_OPACITY, widget); connect(drag, SIGNAL(destroyed()), dragpixmap, SLOT(deleteLater())); dragpixmap->setObjectName("dragpixmap"); connect(dragpixmap, SIGNAL(destroyed()), twutil, SLOT(dumpDestroyed())); dragpixmap->show(); drag->exec(); emit widgetDnD(currentWidget(), drag->target()); QTabBar::mouseMoveEvent(event); fn_end; }