Abstract starting a drag

So draggables can give their opinion on when to start a drag.
So we can support movable tab-bars.
This commit is contained in:
Sergio Martins
2019-12-24 10:18:20 +00:00
parent 53238e4f29
commit a29a33a46d
3 changed files with 15 additions and 1 deletions

View File

@@ -153,7 +153,7 @@ void StatePreDrag::onEntry(QEvent *)
bool StatePreDrag::handleMouseMove(QPoint globalPos)
{
if ((globalPos - q->m_pressPos).manhattanLength() > QApplication::startDragDistance()) {
if (q->m_draggable->dragCanStart(q->m_pressPos, globalPos)) {
Q_EMIT q->manhattanLengthMove();
}
return true;