MuseScore  3.4
Music composition and notation
Public Types | Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
Ms::PaletteTreeModel Class Reference

#include <palettemodel.h>

Inheritance diagram for Ms::PaletteTreeModel:
Inheritance graph
[legend]
Collaboration diagram for Ms::PaletteTreeModel:
Collaboration graph
[legend]

Public Types

enum  PaletteTreeModelRoles {
  PaletteCellRole = Qt::UserRole, VisibleRole, CustomRole, EditableRole,
  MimeDataRole, GridSizeRole, DrawGridRole, PaletteExpandedRole,
  PaletteTypeRole, PaletteContentTypeRole, CellActiveRole
}
 

Public Slots

void itemDataChanged (const QModelIndex &idx)
 
void setTreeChanged ()
 
void setTreeUnchanged ()
 

Signals

void treeChanged ()
 

Public Member Functions

 PaletteTreeModel (std::unique_ptr< PaletteTree > tree, QObject *parent=nullptr)
 
 PaletteTreeModel (PaletteTree *tree, QObject *parent=nullptr)
 
bool blockTreeChanged (bool block)
 
void setPaletteTree (std::unique_ptr< PaletteTree > tree)
 
const PaletteTreepaletteTree () const
 
bool paletteTreeChanged () const
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &index) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
QHash< int, QByteArray > roleNames () const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
Qt::DropActions supportedDropActions () const override
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
QStringList mimeTypes () const override
 
bool canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const override
 Currently only searching for a given palette cell is implemented, for anything else the corresponding member function of QAbstractItemModel is used. More...
 
QModelIndex findPaletteCell (const PaletteCell &cell, const QModelIndex &parent) const
 
PaletteCellFiltergetFilter (const QModelIndex &) const
 The ownership of the returned filter is passed to a caller. More...
 
bool moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override
 
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
const PalettePanelfindPalettePanel (const QModelIndex &) const
 
PalettePanelfindPalettePanel (const QModelIndex &index)
 
PaletteCellConstPtr findCell (const QModelIndex &) const
 
PaletteCellPtr findCell (const QModelIndex &index)
 
bool insertPalettePanel (std::unique_ptr< PalettePanel > pp, int row, const QModelIndex &parent=QModelIndex())
 
void updateCellsState (const Selection &)
 
void retranslate ()
 

Private Slots

void onDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
 

Private Member Functions

std::vector< std::unique_ptr< PalettePanel > > & palettes ()
 
const std::vector< std::unique_ptr< PalettePanel > > & palettes () const
 
PalettePaneliptrToPalettePanel (void *iptr, int *idx=nullptr)
 
const PalettePaneliptrToPalettePanel (void *iptr, int *idx=nullptr) const
 

Private Attributes

std::unique_ptr< PaletteTree_paletteTree
 
bool _treeChanged = false
 
bool _treeChangedSignalBlocked = false
 

Member Enumeration Documentation

◆ PaletteTreeModelRoles

Enumerator
PaletteCellRole 
VisibleRole 
CustomRole 
EditableRole 
MimeDataRole 
GridSizeRole 
DrawGridRole 
PaletteExpandedRole 
PaletteTypeRole 
PaletteContentTypeRole 
CellActiveRole 

Constructor & Destructor Documentation

◆ PaletteTreeModel() [1/2]

Ms::PaletteTreeModel::PaletteTreeModel ( std::unique_ptr< PaletteTree tree,
QObject *  parent = nullptr 
)
explicit

◆ PaletteTreeModel() [2/2]

Ms::PaletteTreeModel::PaletteTreeModel ( PaletteTree tree,
QObject *  parent = nullptr 
)
inlineexplicit

Member Function Documentation

◆ blockTreeChanged()

bool Ms::PaletteTreeModel::blockTreeChanged ( bool  block)

◆ canDropMimeData()

bool Ms::PaletteTreeModel::canDropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
) const

◆ columnCount()

int Ms::PaletteTreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ data()

QVariant Ms::PaletteTreeModel::data ( const QModelIndex &  index,
int  role 
) const
override

◆ dropMimeData()

bool Ms::PaletteTreeModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)

◆ findCell() [1/2]

PaletteCellConstPtr Ms::PaletteTreeModel::findCell ( const QModelIndex &  index) const

◆ findCell() [2/2]

PaletteCellPtr Ms::PaletteTreeModel::findCell ( const QModelIndex &  index)

◆ findPaletteCell()

QModelIndex Ms::PaletteTreeModel::findPaletteCell ( const PaletteCell cell,
const QModelIndex &  parent 
) const

◆ findPalettePanel() [1/2]

const PalettePanel * Ms::PaletteTreeModel::findPalettePanel ( const QModelIndex &  index) const

◆ findPalettePanel() [2/2]

PalettePanel * Ms::PaletteTreeModel::findPalettePanel ( const QModelIndex &  index)

◆ flags()

Qt::ItemFlags Ms::PaletteTreeModel::flags ( const QModelIndex &  index) const
override

◆ getFilter()

PaletteCellFilter * Ms::PaletteTreeModel::getFilter ( const QModelIndex &  index) const

The ownership of the returned filter is passed to a caller.

◆ index()

QModelIndex Ms::PaletteTreeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

◆ insertPalettePanel()

bool Ms::PaletteTreeModel::insertPalettePanel ( std::unique_ptr< PalettePanel pp,
int  row,
const QModelIndex &  parent = QModelIndex() 
)

◆ insertRows()

bool Ms::PaletteTreeModel::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

◆ iptrToPalettePanel() [1/2]

PalettePanel * Ms::PaletteTreeModel::iptrToPalettePanel ( void *  iptr,
int *  idx = nullptr 
)
private

◆ iptrToPalettePanel() [2/2]

const PalettePanel* Ms::PaletteTreeModel::iptrToPalettePanel ( void *  iptr,
int *  idx = nullptr 
) const
inlineprivate

◆ itemDataChanged

void Ms::PaletteTreeModel::itemDataChanged ( const QModelIndex &  idx)
slot

◆ match()

QModelIndexList Ms::PaletteTreeModel::match ( const QModelIndex &  start,
int  role,
const QVariant &  value,
int  hits,
Qt::MatchFlags  flags 
) const
override

Currently only searching for a given palette cell is implemented, for anything else the corresponding member function of QAbstractItemModel is used.

◆ mimeData()

QMimeData * Ms::PaletteTreeModel::mimeData ( const QModelIndexList &  indexes) const
override

◆ mimeTypes()

QStringList Ms::PaletteTreeModel::mimeTypes ( ) const
override

◆ moveRows()

bool Ms::PaletteTreeModel::moveRows ( const QModelIndex &  sourceParent,
int  sourceRow,
int  count,
const QModelIndex &  destinationParent,
int  destinationChild 
)
override

◆ onDataChanged

void Ms::PaletteTreeModel::onDataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight,
const QVector< int > &  roles 
)
privateslot

◆ palettes() [1/2]

std::vector<std::unique_ptr<PalettePanel> >& Ms::PaletteTreeModel::palettes ( )
inlineprivate

◆ palettes() [2/2]

const std::vector<std::unique_ptr<PalettePanel> >& Ms::PaletteTreeModel::palettes ( ) const
inlineprivate

◆ paletteTree()

const PaletteTree* Ms::PaletteTreeModel::paletteTree ( ) const
inline

◆ paletteTreeChanged()

bool Ms::PaletteTreeModel::paletteTreeChanged ( ) const
inline

◆ parent()

QModelIndex Ms::PaletteTreeModel::parent ( const QModelIndex &  index) const
override

◆ removeRows()

bool Ms::PaletteTreeModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

◆ retranslate()

void Ms::PaletteTreeModel::retranslate ( )

◆ roleNames()

QHash< int, QByteArray > Ms::PaletteTreeModel::roleNames ( ) const
override

◆ rowCount()

int Ms::PaletteTreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ setData()

bool Ms::PaletteTreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
override

◆ setPaletteTree()

void Ms::PaletteTreeModel::setPaletteTree ( std::unique_ptr< PaletteTree tree)

◆ setTreeChanged

void Ms::PaletteTreeModel::setTreeChanged ( )
slot

◆ setTreeUnchanged

void Ms::PaletteTreeModel::setTreeUnchanged ( )
inlineslot

◆ supportedDropActions()

Qt::DropActions Ms::PaletteTreeModel::supportedDropActions ( ) const
override

◆ treeChanged

void Ms::PaletteTreeModel::treeChanged ( )
signal

◆ updateCellsState()

void Ms::PaletteTreeModel::updateCellsState ( const Selection sel)

Member Data Documentation

◆ _paletteTree

std::unique_ptr<PaletteTree> Ms::PaletteTreeModel::_paletteTree
private

◆ _treeChanged

bool Ms::PaletteTreeModel::_treeChanged = false
private

◆ _treeChangedSignalBlocked

bool Ms::PaletteTreeModel::_treeChangedSignalBlocked = false
private

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