6#include "GeoDataPlaylist.h"
8#include "GeoDataTypes.h"
13bool GeoDataPlaylist::operator==(
const GeoDataPlaylist& other)
const
15 if( this->m_primitives.
size() != other.m_primitives.size() ){
20 for( GeoDataTourPrimitive* m_primitive: m_primitives ){
21 if (*m_primitive != *other.m_primitives.at(index)) {
31bool GeoDataPlaylist::operator!=(
const GeoDataPlaylist& other)
const
33 return !this->operator==(other);
36const char *GeoDataPlaylist::nodeType()
const
38 return GeoDataTypes::GeoDataPlaylistType;
41GeoDataTourPrimitive* GeoDataPlaylist::primitive(
int id)
43 if (size() <=
id ||
id < 0) {
46 return m_primitives.
at(
id);
49const GeoDataTourPrimitive* GeoDataPlaylist::primitive(
int id)
const
51 if (size() <=
id ||
id < 0) {
54 return m_primitives.
at(
id);
57void GeoDataPlaylist::addPrimitive( GeoDataTourPrimitive *primitive )
59 primitive->setParent(
this );
63void GeoDataPlaylist::insertPrimitive(
int position, GeoDataTourPrimitive *primitive )
65 primitive->setParent(
this );
66 int const index = qBound( 0, position, m_primitives.
size() );
67 m_primitives.
insert( index, primitive );
70void GeoDataPlaylist::removePrimitiveAt(
int position)
75void GeoDataPlaylist::swapPrimitives(
int positionA,
int positionB )
77 if ( qMin( positionA, positionB ) >= 0 && qMax( positionA, positionB ) < m_primitives.
size() ) {
79#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
82 m_primitives.
swap( positionA, positionB );
87int GeoDataPlaylist::size()
const
89 return m_primitives.
size();
Binds a QML item to a specific geodetic location in screen coordinates.
const_reference at(qsizetype i) const const
iterator insert(const_iterator before, parameter_type value)
void push_back(parameter_type value)
void removeAt(qsizetype i)
qsizetype size() const const
void swap(QList< T > &other)
void swapItemsAt(qsizetype i, qsizetype j)