6#include "GeoDataListStyle.h"
7#include "GeoDataItemIcon.h"
8#include "GeoDataTypes.h"
16class GeoDataListStylePrivate
19 GeoDataListStylePrivate();
21 GeoDataListStyle::ListItemType m_listItemType;
27GeoDataListStylePrivate::GeoDataListStylePrivate()
28 : m_listItemType(GeoDataListStyle::Check)
33GeoDataListStyle::GeoDataListStyle()
34 : d(new GeoDataListStylePrivate)
38GeoDataListStyle::GeoDataListStyle(
const Marble::GeoDataListStyle &other)
39 : GeoDataObject(other)
40 , d(new GeoDataListStylePrivate(*other.d))
44GeoDataListStyle &GeoDataListStyle::operator=(
const GeoDataListStyle &other)
46 GeoDataObject::operator=(other);
51bool GeoDataListStyle::operator==(
const GeoDataListStyle &other)
const
53 if (!GeoDataObject::equals(other) || d->m_bgColor != other.d->m_bgColor || d->m_listItemType != other.d->m_listItemType
54 || d->m_vector.size() != other.d->m_vector.size()) {
63 if (**begin != **otherBegin) {
71bool GeoDataListStyle::operator!=(
const GeoDataListStyle &other)
const
76GeoDataListStyle::~GeoDataListStyle()
81const char *GeoDataListStyle::nodeType()
const
83 return GeoDataTypes::GeoDataListStyleType;
86GeoDataListStyle::ListItemType GeoDataListStyle::listItemType()
const
88 return d->m_listItemType;
91void GeoDataListStyle::setListItemType(ListItemType type)
93 d->m_listItemType =
type;
96QColor GeoDataListStyle::backgroundColor()
const
101void GeoDataListStyle::setBackgroundColor(
const QColor &color)
103 d->m_bgColor = color;
111GeoDataItemIcon *GeoDataListStyle::child(
int i)
113 return d->m_vector.
at(i);
116const GeoDataItemIcon *GeoDataListStyle::child(
int i)
const
118 return d->m_vector.at(i);
121int GeoDataListStyle::childPosition(
const GeoDataItemIcon *
object)
const
123 return d->m_vector.indexOf(
const_cast<GeoDataItemIcon *
>(
object));
126void GeoDataListStyle::append(GeoDataItemIcon *other)
128 other->setParent(
this);
129 d->m_vector.append(other);
132void GeoDataListStyle::remove(
int index)
134 d->m_vector.remove(index);
137int GeoDataListStyle::size()
const
139 return d->m_vector.size();
142GeoDataItemIcon &GeoDataListStyle::at(
int pos)
144 return *(d->m_vector[pos]);
147const GeoDataItemIcon &GeoDataListStyle::at(
int pos)
const
149 return *(d->m_vector.at(pos));
152GeoDataItemIcon &GeoDataListStyle::last()
154 return *(d->m_vector.last());
157const GeoDataItemIcon &GeoDataListStyle::last()
const
159 return *(d->m_vector.last());
162GeoDataItemIcon &GeoDataListStyle::first()
164 return *(d->m_vector.first());
167const GeoDataItemIcon &GeoDataListStyle::first()
const
169 return *(d->m_vector.first());
172void GeoDataListStyle::clear()
174 qDeleteAll(d->m_vector);
180 return d->m_vector.begin();
185 return d->m_vector.end();
190 return d->m_vector.constBegin();
195 return d->m_vector.constEnd();
198void GeoDataListStyle::pack(
QDataStream &stream)
const
200 GeoDataObject::pack(stream);
201 stream << d->m_vector.count();
204 const GeoDataItemIcon *itemIcon = *iterator;
205 itemIcon->pack(stream);
211 GeoDataObject::unpack(stream);
219 auto itemIcon =
new GeoDataItemIcon;
220 itemIcon->unpack(stream);
221 d->m_vector.append(itemIcon);
KIOCORE_EXPORT bool operator==(const UDSEntry &entry, const UDSEntry &other)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
const QList< QKeySequence > & begin()
const QList< QKeySequence > & end()
Binds a QML item to a specific geodetic location in screen coordinates.
const_reference at(qsizetype i) const const