summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2014-11-13 13:52:05 +0100
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2014-11-19 10:34:39 +0100
commit42b4dda39ccedc60dccddc345ea813168b13df40 (patch)
tree245f0bfd5ff377cd9d53ef6e885777d3a4308e5a /src
parent85a4aaa5ce7caa783a187b775961db3a77a3afb6 (diff)
Fix rubberband position for tabbed mdi windows
Place the rubberband over the tabs instead of where the hidden subwindows happen to be. [ChangeLog][QtWidgets][QMdiArea] Fix rubberband position for tabbed mdi windows Task-number: QTBUG-42612 Change-Id: I41e81ab8b99ab9e0fa533fd4ed1b2a8141d19753 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qmdiarea.cpp16
-rw-r--r--src/widgets/widgets/qmdiarea_p.h9
2 files changed, 16 insertions, 9 deletions
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 1e291f469e..3553baf68a 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -1511,7 +1511,7 @@ void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor)
#ifndef QT_NO_RUBBERBAND
if (!rubberBand) {
- rubberBand = new QRubberBand(QRubberBand::Rectangle, viewport);
+ rubberBand = new QRubberBand(QRubberBand::Rectangle, q);
// For accessibility to identify this special widget.
rubberBand->setObjectName(QLatin1String("qt_rubberband"));
rubberBand->setWindowFlags(rubberBand->windowFlags() | Qt::WindowStaysOnTopHint);
@@ -1528,6 +1528,20 @@ void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor)
Q_ASSERT(indexToHighlighted >= 0);
}
+void QMdiAreaPrivate::showRubberBandFor(QMdiSubWindow *subWindow)
+{
+ if (!subWindow || !rubberBand)
+ return;
+
+ if (viewMode == QMdiArea::TabbedView)
+ rubberBand->setGeometry(tabBar->tabRect(childWindows.indexOf(subWindow)));
+ else
+ rubberBand->setGeometry(subWindow->geometry());
+
+ rubberBand->raise();
+ rubberBand->show();
+}
+
/*!
\internal
\since 4.4
diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h
index 1092fd9a30..ba531adaad 100644
--- a/src/widgets/widgets/qmdiarea_p.h
+++ b/src/widgets/widgets/qmdiarea_p.h
@@ -248,14 +248,7 @@ public:
}
#ifndef QT_NO_RUBBERBAND
- inline void showRubberBandFor(QMdiSubWindow *subWindow)
- {
- if (!subWindow || !rubberBand)
- return;
- rubberBand->setGeometry(subWindow->geometry());
- rubberBand->raise();
- rubberBand->show();
- }
+ void showRubberBandFor(QMdiSubWindow *subWindow);
inline void hideRubberBand()
{