Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdeclarativegeomapitemgroup.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 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
7
9
109{
112}
113
115{
116
117}
118
120{
121 m_parentGroup = &parentGroup;
124}
125
127{
128 if (!quickMap && m_quickMap)
129 m_quickMap->disconnect(this);
130 m_quickMap = quickMap;
131 if (m_quickMap) {
135 }
136}
137
139{
140 return m_quickMap;
141}
142
144{
145 return ((m_parentGroup) ? m_parentGroup->mapItemOpacity() : 1.0) * opacity();
146}
147
149{
151}
152
154{
156
157 // In certain cases the parent won't be set via the constructor, but rather later on
158 // during the instantiation/incubation process.
159 // Therefore calling setParentGroup here, when the parent is known.
160 // The childrenChanged use case to handle dynamically-added items is currently unsupported.
161 const QList<QQuickItem *> &quickKids = childItems();
162 for (QQuickItem *k : quickKids) {
164 = qobject_cast<QDeclarativeGeoMapItemGroup *>(k);
165 if (childGroup) {
166 childGroup->setParentGroup(*this);
167 continue;
168 }
170 = qobject_cast<QDeclarativeGeoMapItemBase *>(k);
171 if (childItem) {
172 childItem->setParentGroup(*this);
173 continue;
174 }
175 }
176}
177
179{
180 setWidth(m_quickMap->width());
181 setHeight(m_quickMap->height());
182}
183
void setParentGroup(QDeclarativeGeoMapItemGroup &parentGroup)
void classBegin() override
Invoked after class creation, but before any properties have been set.
QDeclarativeGeoMapItemGroup(QQuickItem *parent=nullptr)
\qmltype MapItemGroup \instantiates QDeclarativeGeoMapItemGroup \inqmlmodule QtLocation
void setQuickMap(QDeclarativeGeoMap *quickMap)
QDeclarativeGeoMap * quickMap() const
void setParentGroup(QDeclarativeGeoMapItemGroup &parentGroup)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
Definition qlist.h:74
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2823
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
Definition qobject.cpp:3099
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
void heightChanged()
void classBegin() override
\reimp Derived classes should call the base class method before adding their own action to perform at...
QList< QQuickItem * > childItems() const
Returns the children of this item.
void widthChanged()
void componentComplete() override
\reimp Derived classes should call the base class method before adding their own actions to perform a...
void opacityChanged()
void setHeight(qreal)
qreal width
This property holds the width of this item.
Definition qquickitem.h:76
qreal height
This property holds the height of this item.
Definition qquickitem.h:77
void setWidth(qreal)
qreal opacity
\qmlproperty real QtQuick::Item::opacity
Definition qquickitem.h:79
Combined button and popup list for selecting options.
double qreal
Definition qtypes.h:92
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent