Zrythm v2.0.0-alpha.1+31.4967fd053471
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::gui::qquick::ChordRowListModel Class Reference

Derived QAbstractListModel that lists the unique chords used in a ChordRegion, grouped by ChordDescriptor::isEquivalent. More...

#include <src/gui/qquick/chord_row_list_model.h>

Inheritance diagram for zrythm::gui::qquick::ChordRowListModel:
Collaboration diagram for zrythm::gui::qquick::ChordRowListModel:

Public Types

enum  Roles { ChordNameRole = Qt::UserRole + 1 , ChordDescriptorRole , ChordObjectCountRole }

Public Member Functions

 ChordRowListModel (QObject *parent=nullptr)
structure::arrangement::ChordRegionregion () const
void setRegion (structure::arrangement::ChordRegion *region)
QHash< int, QByteArray > roleNames () const override
int rowCount (const QModelIndex &parent=QModelIndex()) const override
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
Q_INVOKABLE int rowForChordObject (zrythm::structure::arrangement::ChordObject *object) const
 Returns the row index (into this model) that the given chord object belongs to, or -1 if not found.
Q_INVOKABLE zrythm::dsp::ChordDescriptordescriptorAtRow (int row) const
 Returns the representative ChordDescriptor for the given row.
Q_INVOKABLE QVariantList chordObjectsAtRow (int row) const
 Returns all ChordObjects on the given row (for batch editing).
Q_SIGNAL void regionChanged ()
Q_SIGNAL void contentChanged ()
 Emitted after every rebuild (when chord objects are added, removed, moved, or have their descriptors changed).

Properties

zrythm::structure::arrangement::ChordRegionregion

Detailed Description

Derived QAbstractListModel that lists the unique chords used in a ChordRegion, grouped by ChordDescriptor::isEquivalent.

Each row represents one unique chord. Rows are sorted alphabetically by display name.

Definition at line 24 of file chord_row_list_model.h.

Member Enumeration Documentation

◆ Roles

enum zrythm::gui::qquick::ChordRowListModel::Roles

Definition at line 31 of file chord_row_list_model.h.

Member Function Documentation

◆ contentChanged()

Q_SIGNAL void zrythm::gui::qquick::ChordRowListModel::contentChanged ( )

Emitted after every rebuild (when chord objects are added, removed, moved, or have their descriptors changed).

QML delegates use this to recompute derived span widths and row positions.

◆ region()

structure::arrangement::ChordRegion * zrythm::gui::qquick::ChordRowListModel::region ( ) const
inline

Definition at line 41 of file chord_row_list_model.h.

Property Documentation

◆ region

zrythm::structure::arrangement::ChordRegion * zrythm::gui::qquick::ChordRowListModel::region
readwrite

Definition at line 27 of file chord_row_list_model.h.


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