Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickpopupanchors.cpp
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
6#include "qquickpopup_p_p.h"
7
9
11 : QObject(*(new QQuickPopupAnchorsPrivate), popup)
12{
14 d->popup = popup;
15}
16
18{
19 Q_D(const QQuickPopupAnchors);
20 if (d->centerIn) {
21 auto centerInPrivate = QQuickItemPrivate::get(d->centerIn);
22 centerInPrivate->removeItemChangeListener(this, QQuickItemPrivate::Destroyed);
23 }
24}
25
27{
28 Q_D(const QQuickPopupAnchors);
29 return d->centerIn;
30}
31
33{
35 if (item == d->centerIn)
36 return;
37
38 if (d->centerIn) {
39 auto centerInPrivate = QQuickItemPrivate::get(d->centerIn);
40 centerInPrivate->removeItemChangeListener(this, QQuickItemPrivate::Destroyed);
41 }
42
43 d->centerIn = item;
44
45 if (d->centerIn) {
46 auto centerInPrivate = QQuickItemPrivate::get(d->centerIn);
47 centerInPrivate->addItemChangeListener(this, QQuickItemPrivate::Destroyed);
48 }
49
50 QQuickPopupPrivate::get(d->popup)->reposition();
51
53}
54
59
64
66
67#include "moc_qquickpopupanchors_p.cpp"
\inmodule QtCore
Definition qobject.h:103
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
void setCenterIn(QQuickItem *item)
void itemDestroyed(QQuickItem *item) override
QQuickPopupAnchors(QQuickPopup *popup)
static QQuickPopupPrivate * get(QQuickPopup *popup)
Combined button and popup list for selecting options.
#define emit
QGraphicsItem * item