From b86426c81e1c95126ff9b8b84ed5824160c2965b Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Thu, 5 Dec 2013 10:25:23 +0100 Subject: Fixed a bug where toolbars sometimes could not be docked. Task-number: QTBUG-33839 Change-Id: I542fb894c31ce38509a70a71bd0ea1bc84bb2a03 Reviewed-by: Jens Bache-Wiig --- src/widgets/widgets/qtoolbararealayout.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qtoolbararealayout.cpp') diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp index 94a1148ded..04ef6a80be 100644 --- a/src/widgets/widgets/qtoolbararealayout.cpp +++ b/src/widgets/widgets/qtoolbararealayout.cpp @@ -485,9 +485,12 @@ void QToolBarAreaLayoutInfo::moveToolBar(QToolBar *toolbar, int pos) QList QToolBarAreaLayoutInfo::gapIndex(const QPoint &pos, int *minDistance) const { - int p = pick(o, pos); - if (rect.contains(pos)) { + // is in QToolBarAreaLayout coordinates. + // is in local dockarea coordinates (see ~20 lines below) + // Since we're comparing p with item.pos, we put them in the same coordinate system. + const int p = pick(o, pos - rect.topLeft()); + for (int j = 0; j < lines.count(); ++j) { const QToolBarAreaLayoutLine &line = lines.at(j); if (line.skip()) -- cgit v1.2.3