7#include "GeoSceneSettings.h"
9#include "MarbleDebug.h"
11#include "GeoSceneGroup.h"
12#include "GeoSceneProperty.h"
13#include "GeoSceneTypes.h"
18class GeoSceneSettingsPrivate
21 ~GeoSceneSettingsPrivate()
23 qDeleteAll(m_properties);
32GeoSceneSettings::GeoSceneSettings()
33 : d(new GeoSceneSettingsPrivate)
37GeoSceneSettings::~GeoSceneSettings()
42const char *GeoSceneSettings::nodeType()
const
44 return GeoSceneTypes::GeoSceneSettingsType;
47bool GeoSceneSettings::propertyAvailable(
const QString &name,
bool &available)
const
51 for (; it != propEnd; ++it) {
52 if ((*it)->name() == name) {
53 available = (*it)->available();
60 for (; itGroup != groupEnd; ++itGroup) {
61 bool success = (*itGroup)->propertyAvailable(name, available);
72bool GeoSceneSettings::setPropertyValue(
const QString &name,
bool value)
74 mDebug() << name <<
"to" << value;
78 for (; it != propEnd; ++it) {
79 if ((*it)->name() == name) {
80 (*it)->setValue(value);
87 for (; itGroup != groupEnd; ++itGroup) {
88 bool success = (*itGroup)->setPropertyValue(name, value);
97bool GeoSceneSettings::propertyValue(
const QString &name,
bool &value)
const
101 for (; it != propEnd; ++it) {
102 if ((*it)->name() == name) {
103 value = (*it)->value();
110 for (; itGroup != groupEnd; ++itGroup) {
111 bool success = (*itGroup)->propertyValue(name, value);
128 for (; itGroup != groupEnd; ++itGroup) {
129 allProperties << (*itGroup)->properties();
132 allProperties << d->m_properties;
134 return allProperties;
143 for (; itGroup != groupEnd; ++itGroup) {
144 allProperties << const_cast<const GeoSceneGroup *>(*itGroup)->properties();
147 allProperties.
reserve(allProperties.
size() + d->m_properties.size());
149 allProperties << property;
152 return allProperties;
159 while (it != d->m_groups.end()) {
161 if (currentGroup->name() == group->name()) {
163 d->m_groups.erase(it);
171 d->m_groups.append(group);
174 connect(group, SIGNAL(valueChanged(
QString,
bool)), SIGNAL(valueChanged(
QString,
bool)));
184 for (; it != groupEnd; ++it) {
185 if ((*it)->name() == name) {
205 while (it != d->m_properties.end()) {
207 if (currentProperty->name() == property->name()) {
208 delete currentProperty;
209 d->m_properties.erase(it);
217 d->m_properties.append(property);
220 connect(property, SIGNAL(valueChanged(
QString,
bool)), SIGNAL(valueChanged(
QString,
bool)));
221 Q_EMIT valueChanged(property->name(), property->value());
231 for (; it != propEnd; ++it) {
232 if ((*it)->name() == name) {
250 return d->m_properties;
255#include "moc_GeoSceneSettings.cpp"
Group inside the settings of a GeoScene document.
Settings property within a GeoScene document.
Settings of a GeoScene document.
const GeoSceneProperty * property(const QString &name) const
Get a property from the settings.
const GeoSceneGroup * group(const QString &name) const
Get a group from the settings.
Binds a QML item to a specific geodetic location in screen coordinates.
void reserve(qsizetype size)
qsizetype size() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 12:02:43 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.