Fixed DockAreaTabBar.cpp to properly count the contained tabs (ignore stretch item)

This commit is contained in:
Uwe Kindler
2018-10-11 15:23:19 +02:00
parent 548dfb363a
commit 7c67d71f68
4 changed files with 61 additions and 6 deletions

View File

@@ -244,7 +244,7 @@ void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev)
if (d->isDraggingState(DraggingTab) && d->DockArea)
{
// Find tab under mouse
QPoint pos = d->DockArea->mapFromGlobal(ev->globalPos());
/*QPoint pos = d->DockArea->mapFromGlobal(ev->globalPos());
int fromIndex = d->DockArea->index(d->DockWidget);
int toIndex = d->DockArea->indexOfContentByTitlePos(pos, this);
if (-1 == toIndex)
@@ -252,7 +252,8 @@ void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev)
toIndex = d->DockArea->dockWidgetsCount() - 1;
}
qDebug() << "Move tab from " << fromIndex << " to " << toIndex;
d->DockArea->reorderDockWidget(fromIndex, toIndex);
d->DockArea->reorderDockWidget(fromIndex, toIndex);*/
emit moved();
}
if (!d->DragStartMousePosition.isNull())