// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include QT_BEGIN_NAMESPACE namespace Qt3DInput { namespace Input { namespace Quick { Quick3DPhysicalDevice::Quick3DPhysicalDevice(QObject *parent) : QObject(parent) { } QQmlListProperty Quick3DPhysicalDevice::axisSettings() { using qt_size_type = qsizetype; using ListContentType = QAxisSetting; auto appendFunction = [](QQmlListProperty *list, ListContentType *axisSetting) { Quick3DPhysicalDevice *device = qobject_cast(list->object); device->parentPhysicalDevice()->addAxisSetting(axisSetting); }; auto countFunction = [](QQmlListProperty *list) -> qt_size_type { Quick3DPhysicalDevice *device = qobject_cast(list->object); return device->parentPhysicalDevice()->axisSettings().size(); }; auto atFunction = [](QQmlListProperty *list, qt_size_type index) -> ListContentType * { Quick3DPhysicalDevice *device = qobject_cast(list->object); return device->parentPhysicalDevice()->axisSettings().at(index); }; auto clearFunction = [](QQmlListProperty *list) { Quick3DPhysicalDevice *device = qobject_cast(list->object); const auto axisSettings = device->parentPhysicalDevice()->axisSettings(); for (QAxisSetting *axisSetting : axisSettings) device->parentPhysicalDevice()->removeAxisSetting(axisSetting); }; return QQmlListProperty(this, nullptr, appendFunction, countFunction, atFunction, clearFunction); } } // namespace Quick } // namespace Input } // namespace Qt3DInput QT_END_NAMESPACE #include "moc_quick3dphysicaldevice_p.cpp"