2 #include <Device/Address/AddressSettings.hpp>
3 #include <Device/Node/DeviceNode.hpp>
4 #include <Device/Protocol/DeviceSettings.hpp>
6 #include <score/model/tree/InvisibleRootNode.hpp>
7 #include <score/model/tree/TreeNode.hpp>
8 #include <score/model/tree/TreeNodeItemModel.hpp>
10 #include <score_lib_device_export.h>
23 QModelIndex modelIndexFromNode(
node_type& n,
int column)
const
31 SCORE_ASSERT(n.parent());
32 return createIndex(n.parent()->indexOfChild(&n), 0, &n);
38 SCORE_ASSERT(parent != &rootNode());
40 return createIndex(parent->indexOfChild(&n), column, &n);
46 QModelIndex parentIndex = modelIndexFromNode(parentNode, 0);
48 beginInsertRows(parentIndex, row, row);
50 auto it = parentNode.begin();
51 std::advance(it, row);
52 parentNode.emplace(it, other, &parentNode);
57 auto removeNode(node_type::const_iterator node)
65 SCORE_ASSERT(parent != &rootNode());
66 node_type* grandparent = parent->parent();
67 SCORE_ASSERT(grandparent);
68 int rowParent = grandparent->indexOfChild(parent);
69 QModelIndex parentIndex = createIndex(rowParent, 0, parent);
71 int row = parent->indexOfChild(&*node);
73 beginRemoveRows(parentIndex, row, row);
74 auto it = parent->erase(node);
81 int row = rootNode().indexOfChild(&*node);
83 beginRemoveRows(QModelIndex(), row, row);
84 auto it = rootNode().erase(node);
92 makeFullAddressAccessorSettings(
94 ossia::value min, ossia::value max, ossia::value val);
96 makeFullAddressAccessorSettings(
const Device::Node& mess);
Definition: NodeBasedItemModel.hpp:18
Definition: TreeNodeItemModel.hpp:38
Manipulation of Devices from Qt.
Definition: AddressSettings.cpp:14
Definition: AddressSettings.hpp:49
Definition: DeviceSettings.hpp:20
Definition: AddressSettings.hpp:131
The InvisibleRootNodeTag struct.
Definition: InvisibleRootNode.hpp:11
Definition: Address.hpp:108