void ListView::startDrag() { #if QT_VERSION < 300 if (m_mousePressPos.isNull()) return; m_mousePressPos = QPoint(0, 0); #endif emit dragStart(); startDrag(dragObject()); }
void TreeView::startDrag() { Q3DragObject *drag = dragObject(); if (!drag) return; drag->dragMove(); }
// copy to clipboard aka X11 selection void KfindWindow::copySelection() { TQDragObject *drag_obj = dragObject(); if (drag_obj) { TQClipboard *cb = kapp->clipboard(); cb->setData(drag_obj); } }
void TextShow::copy() { QTextDrag *drag = dragObject(NULL); if ( !drag ) return; #if COMPAT_QT_VERSION <= 0x030100 QApplication::clipboard()->setData(drag); #else QApplication::clipboard()->setData(drag, QClipboard::Clipboard); #endif }
void TextShow::startDrag() { QDragObject *drag = dragObject(viewport()); if (drag == NULL) return; if (isReadOnly()) { drag->dragCopy(); } else { if (drag->drag() && QDragObject::target() != this && QDragObject::target() != viewport() ) removeSelectedText(); } }
void PlayField::mousePressEvent(QMouseEvent *e) { if (!canMoveNow()) return; if (dragInProgress_) { if (e->button() == Qt::LeftButton) dragObject(e->x(), e->y()); else stopDrag(); return; } int x=pixel2x(e->x()); int y=pixel2y(e->y()); if (x < 0 || y < 0 || x >= levelMap_->width() || y >= levelMap_->height()) return; if (e->button() == Qt::LeftButton && pathFinder_.canDrag(x, y)) { changeCursor(Qt::SizeAllCursor); highlightX_ = x; highlightY_ = y; update(x2pixel(x), y2pixel(y), size_, size_); pathFinder_.updatePossibleDestinations(x, y); dragX_ = x2pixel(x); dragY_ = y2pixel(y); mousePosX_ = e->x() - dragX_; mousePosY_ = e->y() - dragY_; dragInProgress_ = true; } Move *m; switch (e->button()) { case Qt::LeftButton: m = pathFinder_.search(levelMap_, x, y); if (m != 0) { history_->add(m); startMoving(m); } break; case Qt::MidButton: undo(); return; break; case Qt::RightButton: push(x, y); break; default: return; } }
void TextShow::slotSelectionChanged() { #if COMPAT_QT_VERSION >= 0x030100 disconnect(QApplication::clipboard(), SIGNAL(selectionChanged()), this, 0); if (QApplication::clipboard()->supportsSelection()){ QTextDrag *drag = dragObject(NULL); if ( !drag ) return; QApplication::clipboard()->setData(drag, QClipboard::Selection); connect( QApplication::clipboard(), SIGNAL(selectionChanged()), this, SLOT(clipboardChanged())); } #endif }
void KstViewWidget::leaveEvent(QEvent *e) { //kstdDebug() << "Leave event" << endl; QWidget::leaveEvent(e); if (_view->viewMode() != KstTopLevelView::DisplayMode) { if (_menu) { return; } if (!_view->tracking()) { //kstdDebug() << "Not tracking" << endl; _view->clearFocus(); } else { //kstdDebug() << "Tracking" << endl; if (_view->trackingIsMove() && _dragEnabled) { QDragObject *d = dragObject(); if (d) { // First cancel any operations _view->cancelMouseOperations(); _view->paint(KstPainter::P_PAINT); d->drag(); } } } } }
void ListView::startDrag() { emit dragStart(); startDrag(dragObject()); }
void PlayField::mouseReleaseEvent(QMouseEvent *e) { if (dragInProgress_) dragObject(e->x(), e->y()); }
void DraggableListView::startDrag() { Q3DragObject *o = dragObject(); if (o) { o->drag(); } }