summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-12-05 10:25:23 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-05 13:48:21 +0100
commitb86426c81e1c95126ff9b8b84ed5824160c2965b (patch)
tree5c6ff6a7584e6a16ea5acdf26bd47a2c104f78bf
parentcd1ce77bf8a3520dee1c2703405c2bf2762360a8 (diff)
Fixed a bug where toolbars sometimes could not be docked.
Task-number: QTBUG-33839 Change-Id: I542fb894c31ce38509a70a71bd0ea1bc84bb2a03 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
-rw-r--r--src/widgets/widgets/qtoolbararealayout.cpp7
1 files changed, 5 insertions, 2 deletions
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<int> QToolBarAreaLayoutInfo::gapIndex(const QPoint &pos, int *minDistance) const
{
- int p = pick(o, pos);
-
if (rect.contains(pos)) {
+ // <pos> is in QToolBarAreaLayout coordinates.
+ // <item.pos> 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())