Loading...
Searching...
No Matches
Dataflow::ConnectionsWidget Class Referencefinal
Inheritance diagram for Dataflow::ConnectionsWidget:

Detailed Description

Lists the cables and address bindings of a document, kept up to date while shown. Edits go through the document's command stack.

Public Types

enum  Column {
  KindColumn , StatusColumn , FromColumn , ToColumn ,
  LocationColumn , ColumnCount
}
 
enum  Grouping {
  NoGrouping , ByKind , ByFrom , ByTo ,
  ByDevice
}
 
enum  KindFilter { AllKinds , CablesOnly , AddressesOnly }
 

Public Member Functions

 ConnectionsWidget (QWidget *parent=nullptr)
 
void setDocument (const score::DocumentContext *ctx)
 
void setSelection (const Selection &s)
 Mirrors a selection made elsewhere in the document.
 
const std::vector< ConnectionRow > & rows () const noexcept
 
void refresh ()
 Rebuilds now instead of on the next event loop iteration.
 
bool refreshPending () const noexcept
 
QTreeView & view () const noexcept
 
QLineEdit & searchField () const noexcept
 
QComboBox & groupingBox () const noexcept
 
QComboBox & kindBox () const noexcept
 
int rowAt (const QModelIndex &viewIndex) const
 Index in rows() of a view index, -1 for a group or nothing.
 
QModelIndex viewIndexOf (int row) const
 View index of the Kind column of a row, invalid when filtered out.
 
std::vector< int > selectedRows () const
 Rows selected in the view.
 
std::vector< ConnectionRow > rowsAt (const std::vector< int > &rows) const
 Copies, which stay valid across rebuilds.
 
void selectInDocument (const std::vector< int > &rows)
 Selects the connections of the rows in the document and reveals the first.
 
void reveal (const ConnectionRow &row)
 Shows the processes of a row in the scenario or nodal view.
 
void goToEnd (int row, bool from)
 Goes to one end of a row, what a double click on From or To does.
 
void removeConnections (const std::vector< ConnectionRow > &rows)
 Cables are removed, address bindings cleared, in one command.
 
void setCableType (const std::vector< ConnectionRow > &rows, Process::CableType t)
 Sets the mode of the cables of the rows in one command.
 
void fillContextMenu (QMenu &menu, int clickedRow)
 Builds the context menu of the selection, the clicked row first.
 

Static Public Attributes

static constexpr int RowRole = Qt::UserRole + 1
 Item data role holding the index in rows() of a connection item.
 
static constexpr int GroupRole = Qt::UserRole + 2
 Item data role holding the name of a group item, without its count.
 
static constexpr int SearchRole = Qt::UserRole + 3
 
static constexpr int PortTypeRole = Qt::UserRole + 4
 Item data role holding the Process::PortType shown by the Kind cell's icon.
 

Member Enumeration Documentation

◆ Column

Enumerator
KindColumn 

An icon for a cable or for an address, in the color of the port type; the words, the type and the cable mode are in its tooltip

StatusColumn 

A warning icon when an address is not bound, an information icon for a pattern, empty otherwise; its tooltip says why

Member Function Documentation

◆ goToEnd()

void Dataflow::ConnectionsWidget::goToEnd ( int  row,
bool  from 
)

Goes to one end of a row, what a double click on From or To does.

A port: displays the interval holding its process, selects the process and the port, centers the view on the port. An address: reveals it in the device explorer.

Member Data Documentation

◆ SearchRole

constexpr int Dataflow::ConnectionsWidget::SearchRole = Qt::UserRole + 3
staticconstexpr

Item data role holding the text the search matches: what the cell shows, and for the Kind cell the port type and cable mode of its tooltip


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