aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/qquickoverlay.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-28 14:50:43 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-28 14:30:04 +0000
commitd12c37e52b64184bbb50e375d17d7eca3244a360 (patch)
treef5f5ce381506c1c4465f7502b977a67ed668928b /src/templates/qquickoverlay.cpp
parentfce62e0d0fab90932f1afb7c1520b721f50cf7c1 (diff)
Add QQuickPopup::popupItem()
Even though I didn't want to expose this, because I'm still hoping we could make QQuickPopup inherit QQuickControl in the future, the fact that QQuickPopupPrivate::get(popup)->popupItem was used in so many places is a good indicator that accessing the popup item is often required when dealing with popups. In any case, this is C++ only API and not exposed to QML, so it's not that big deal... and we can always deprecate it later and make it return "this" should the item plans come true. Change-Id: I6b99a499327d838ee61eae70f8ebf8e77f00ae39 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/templates/qquickoverlay.cpp')
-rw-r--r--src/templates/qquickoverlay.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/templates/qquickoverlay.cpp b/src/templates/qquickoverlay.cpp
index 09fa05b4..589cafdf 100644
--- a/src/templates/qquickoverlay.cpp
+++ b/src/templates/qquickoverlay.cpp
@@ -35,7 +35,7 @@
****************************************************************************/
#include "qquickoverlay_p.h"
-#include "qquickpopup_p_p.h"
+#include "qquickpopup_p.h"
#include "qquickdrawer_p.h"
#include <QtQml/qqmlinfo.h>
#include <QtQml/qqmlproperty.h>
@@ -97,8 +97,8 @@ void QQuickOverlayPrivate::closePopup(QQuickPopup *popup, QMouseEvent *event)
const bool onOutside = popup->closePolicy().testFlag(isPress ? QQuickPopup::OnPressOutside : QQuickPopup::OnReleaseOutside);
const bool onOutsideParent = popup->closePolicy().testFlag(isPress ? QQuickPopup::OnPressOutsideParent : QQuickPopup::OnReleaseOutsideParent);
if (onOutside || onOutsideParent) {
- QQuickItem *popupItem = QQuickPopupPrivate::get(popup)->popupItem;
- QQuickItem *parentItem = QQuickPopupPrivate::get(popup)->parentItem;
+ QQuickItem *popupItem = popup->popupItem();
+ QQuickItem *parentItem = popup->parentItem();
if (onOutside && onOutsideParent) {
if (!popupItem->contains(q->mapToItem(popupItem, event->pos())) &&