fixed an issue where the application would crash when trying to drag and drop any unexpected object on the thumbnails view

preferencesAboutTextFull
Clément Fauconnier 4 years ago
parent 8bd95da538
commit 793dec5757
  1. 3342
      resources/forms/preferences.ui.autosave
  2. 7
      src/gui/UBDocumentNavigator.cpp

File diff suppressed because it is too large Load Diff

@ -532,6 +532,8 @@ void UBDocumentNavigator::dragMoveEvent(QDragMoveEvent *event)
item->pos().y() + item->boundingRect().height() * scale / 2); item->pos().y() + item->boundingRect().height() * scale / 2);
bool dropAbove = mapToScene(position.toPoint()).y() < itemCenter.y(); bool dropAbove = mapToScene(position.toPoint()).y() < itemCenter.y();
if (mDropSource)
{
bool movingUp = mDropSource->sceneIndex() > item->sceneIndex(); bool movingUp = mDropSource->sceneIndex() > item->sceneIndex();
qreal y = 0; qreal y = 0;
@ -554,7 +556,7 @@ void UBDocumentNavigator::dragMoveEvent(QDragMoveEvent *event)
} }
} }
} }
}
event->acceptProposedAction(); event->acceptProposedAction();
} }
@ -562,8 +564,11 @@ void UBDocumentNavigator::dropEvent(QDropEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
if (mDropSource && mDropTarget)
{
if (mDropSource->sceneIndex() != mDropTarget->sceneIndex()) if (mDropSource->sceneIndex() != mDropTarget->sceneIndex())
UBApplication::boardController->moveSceneToIndex(mDropSource->sceneIndex(), mDropTarget->sceneIndex()); UBApplication::boardController->moveSceneToIndex(mDropSource->sceneIndex(), mDropTarget->sceneIndex());
}
mDropSource = NULL; mDropSource = NULL;
mDropTarget = NULL; mDropTarget = NULL;

Loading…
Cancel
Save