8#include "ArraySource.h"
15int ArraySource::itemCount()
const
17 return m_array.count();
20QVariant ArraySource::item(
int index)
const
22 if (m_array.isEmpty()) {
26 if (!m_wrap && (index < 0 || index > m_array.count() - 1)) {
30 return m_array.at(index % m_array.count());
35 auto itr = std::min_element(m_array.cbegin(), m_array.cend(), variantCompare);
36 if (itr != m_array.cend()) {
44 auto itr = std::max_element(m_array.cbegin(), m_array.cend(), variantCompare);
45 if (itr != m_array.cend()) {
51QVariantList ArraySource::array()
const
56bool ArraySource::wrap()
const
61void ArraySource::setArray(
const QVariantList &array)
63 if (m_array == array) {
71void ArraySource::setWrap(
bool wrap)
81#include "moc_ArraySource.cpp"
ArraySource(QObject *parent=nullptr)
Constructor.
Abstract base class for data sources.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:23 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.