Пример #1
0
void QsciScintillaBase::acceptAction(QDropEvent *e)
{
    if (sci->pdoc->IsReadOnly() || !canInsertFromMimeData(e->mimeData()))
        e->ignore();
    else
        e->acceptProposedAction();
}
void PersistentState::dragMoveEvent(QDragMoveEvent *e) {
	if (editor()->isReadOnly() || !canInsertFromMimeData(e->mimeData())) {
		e->ignore();
		return;
	}

	int cursorPos = editor()->document()->documentLayout()->hitTest(QPoint(e->pos().x() + editor()->horizontalScrollBar()->value(), e->pos().y() + editor()->verticalScrollBar()->value()), Qt::FuzzyHit);
	if (cursorPos != -1) {
		_dndFeedbackCursor = _persistentCursor;
		_dndFeedbackCursor.setPosition(cursorPos);
	}

	editor()->updateView(true);
	e->acceptProposedAction();
}
Пример #3
0
void QsciScintillaBase::acceptAction(QDropEvent *e)
{
    if (sci->pdoc->IsReadOnly() || !canInsertFromMimeData(e->mimeData()))
    {
        e->ignore();
    }
    else if ((e->source() == this || e->source() == viewport()) && (e->keyboardModifiers() & Qt::ControlModifier) == 0)
    {
        e->setDropAction(Qt::MoveAction);
        e->accept();
    }
    else
    {
        e->acceptProposedAction();
    }
}