Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
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
// Qt-Security score:significant reason:default
4
5
#
include
"qquickpopupanchors_p.h"
6
#
include
"qquickpopupanchors_p_p.h"
7
#
include
"qquickpopup_p_p.h"
8
9
QT_BEGIN_NAMESPACE
10
11
QQuickPopupAnchors::QQuickPopupAnchors(QQuickPopup *popup)
12
: QObject(*(
new
QQuickPopupAnchorsPrivate), popup)
13
{
14
Q_D(QQuickPopupAnchors);
15
d->popup = popup;
16
}
17
18
QQuickPopupAnchors::~QQuickPopupAnchors()
19
{
20
Q_D(
const
QQuickPopupAnchors);
21
if
(d->centerIn) {
22
auto
centerInPrivate = QQuickItemPrivate::get(d->centerIn);
23
centerInPrivate->removeItemChangeListener(
this
, QQuickItemPrivate::Destroyed);
24
}
25
}
26
27
QQuickItem *QQuickPopupAnchors::centerIn()
const
28
{
29
Q_D(
const
QQuickPopupAnchors);
30
return
d->centerIn;
31
}
32
33
void
QQuickPopupAnchors::setCenterIn(QQuickItem *item)
34
{
35
Q_D(QQuickPopupAnchors);
36
if
(item == d->centerIn)
37
return
;
38
39
if
(d->centerIn) {
40
auto
centerInPrivate = QQuickItemPrivate::get(d->centerIn);
41
centerInPrivate->removeItemChangeListener(
this
, QQuickItemPrivate::Destroyed);
42
}
43
44
d->centerIn = item;
45
46
if
(d->centerIn) {
47
auto
centerInPrivate = QQuickItemPrivate::get(d->centerIn);
48
centerInPrivate->addItemChangeListener(
this
, QQuickItemPrivate::Destroyed);
49
}
50
51
QQuickPopupPrivate::get(d->popup)->reposition();
52
53
emit centerInChanged();
54
}
55
56
void
QQuickPopupAnchors::resetCenterIn()
57
{
58
setCenterIn(
nullptr
);
59
}
60
61
void
QQuickPopupAnchors::itemDestroyed(QQuickItem *)
62
{
63
resetCenterIn();
64
}
65
66
QT_END_NAMESPACE
67
68
#
include
"moc_qquickpopupanchors_p.cpp"
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtdeclarative
src
quicktemplates
qquickpopupanchors.cpp
Generated on
for Qt by
1.18.0