Loading...
Searching...
No Matches
Explorer::DeviceExplorerModel Class Referencefinal
Inheritance diagram for Explorer::DeviceExplorerModel:
Device::NodeBasedItemModel TreeNodeBasedItemModel< Device::Node > TreeModel

Public Member Functions

 DeviceExplorerModel (DeviceDocumentPlugin &, QObject *parent)
 
Device::NoderootNode () override
 
const Device::NoderootNode () const override
 
void setView (DeviceExplorerView *v)
 
DeviceDocumentPlugin & deviceModel () const
 
QModelIndexList selectedIndexes () const
 
const score::CommandStackFacadecommandStack () const
 
int addDevice (Device::Node &&deviceNode)
 
int addDevice (const Device::Node &deviceNode)
 
void updateDevice (const QString &name, const Device::DeviceSettings &dev)
 
bool replaceDevice (Device::Node &&deviceNode)
 Replaces the whole tree of the device named like deviceNode, in place.
 
Device::NodeaddAddress (Device::Node *parentNode, const Device::AddressSettings &addressSettings, int row)
 
void updateAddress (Device::Node *node, const Device::AddressSettings &addressSettings)
 
void addNode (Device::Node *parentNode, Device::Node &&child, int row)
 
void updateValue (Device::Node *n, const State::AddressAccessor &addr, const ossia::value &v)
 
bool checkDeviceInstantiatable (const Device::DeviceSettings &n) const
 
bool checkDeviceEditable (const QString &originalName, const Device::DeviceSettings &n) const
 
bool checkAddressInstantiatable (Device::Node &parent, const Device::AddressSettings &addr)
 
bool checkAddressEditable (Device::Node &parent, const Device::AddressSettings &before, const Device::AddressSettings &after)
 
bool canRenameNode (const Device::Node &n) const
 Whether the protocol lets this node be renamed.
 
int columnCount () const
 
QStringList getColumns () const
 
bool isEmpty () const
 
bool isDevice (QModelIndex index) const
 
bool hasCut () const
 
void debug_printIndexes (const QModelIndexList &indexes)
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
bool setHeaderData (int, Qt::Orientation, const QVariant &, int=Qt::EditRole) override
 
void editData (const Device::NodePath &path, Column column, const ossia::value &value, int role)
 DeviceExplorerModel::editData.
 
void editData (Device::Node &n, Column column, const ossia::value &value, int role)
 
Qt::DropActions supportedDropActions () const override
 
Qt::DropActions supportedDragActions () const override
 
QStringList mimeTypes () const override
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
bool canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
 
bool dropMimeData (const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
SelectedNodes uniqueSelectedNodes (const QModelIndexList &indexes) const
 
void checkAndLoadDevice (Device::Node n)
 
void checkAndLoadDevice (Device::DeviceSettings n)
 
void nodeChanged (Device::Node *n)
 
void valueUpdated (Device::Node *n)
 A value arrived for this node.
 
void deviceTreeAboutToChange (Device::Node *device)
 
void deviceTreeChanged (Device::Node *device)
 
- Public Member Functions inherited from Device::NodeBasedItemModel
QModelIndex modelIndexFromNode (node_type &n, int column) const
 
void insertNode (node_type &parentNode, const node_type &other, int row)
 
auto removeNode (node_type::const_iterator node)
 
- Public Member Functions inherited from TreeNodeBasedItemModel< Device::Node >
 TreeNodeBasedItemModel (QObject *parent=nullptr)
 
Device::NodenodeFromModelIndex (const QModelIndex &index) const
 
QModelIndex parent (const QModelIndex &index) const final override
 
QModelIndex index (int row, int column, const QModelIndex &parent) const final override
 
int rowCount (const QModelIndex &parent) const final override
 
bool hasChildren (const QModelIndex &parent) const final override
 
- Public Member Functions inherited from TreeModel
template<typename F >
void iterate (const QModelIndex &idx, const F &f)
 idx: should be the root index of the view
 
QModelIndex convertPathToIndex (const TreePath &path) const
 

Protected Member Functions

void debug_printPath (const Device::NodePath &path)
 

Additional Inherited Members

- Public Types inherited from TreeNodeBasedItemModel< Device::Node >
using node_type = Device::Node
 

Member Function Documentation

◆ deviceTreeAboutToChange()

void Explorer::DeviceExplorerModel::deviceTreeAboutToChange ( Device::Node device)

replaceDevice(): the device node's children are about to be swapped (rows removed then re-inserted), and have been.

◆ editData()

void Explorer::DeviceExplorerModel::editData ( const Device::NodePath path,
Explorer::Column  column,
const ossia::value &  value,
int  role 
)

DeviceExplorerModel::editData.

This functions gets called by the command that edit the columns.

◆ replaceDevice()

bool Explorer::DeviceExplorerModel::replaceDevice ( Device::Node &&  deviceNode)

Replaces the whole tree of the device named like deviceNode, in place.

The device keeps its row: only its settings and children change. Returns false if no such device is shown.

◆ rootNode() [1/2]

const Device::Node & Explorer::DeviceExplorerModel::rootNode ( ) const
inlineoverridevirtual

◆ rootNode() [2/2]

Device::Node & Explorer::DeviceExplorerModel::rootNode ( )
inlineoverridevirtual

◆ valueUpdated()

void Explorer::DeviceExplorerModel::valueUpdated ( Device::Node n)

A value arrived for this node.

Not the same thing as dataChanged on the value column, which also fires when an address's settings are replaced – opening a document does that for every address at once. Anything that reacts to traffic rather than to a repaint wants this instead.


The documentation for this class was generated from the following files: