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

#include <palette.h>

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

Signals

void boxClicked (int)
 
void changed ()
 
void displayMore (const QString &paletteName)
 

Public Member Functions

 Palette (QWidget *parent=0)
 
 Palette (std::unique_ptr< PalettePanel >, QWidget *parent=nullptr)
 
virtual ~Palette ()
 
void nextPaletteElement ()
 
void prevPaletteElement ()
 
void applyPaletteElement ()
 
PaletteCellappend (Element *, const QString &name, QString tag=QString(), qreal mag=1.0)
 
PaletteCelladd (int idx, Element *, const QString &name, const QString tag=QString(), qreal mag=1.0)
 
void emitChanged ()
 
void setGrid (int, int)
 
Elementelement (int idx)
 
void setDrawGrid (bool val)
 
bool drawGrid () const
 
bool read (const QString &path)
 
void write (const QString &path)
 
void read (XmlReader &)
 
void write (XmlWriter &) const
 
void clear ()
 
void setSelectable (bool val)
 
bool selectable () const
 
int getSelectedIdx () const
 
void setSelected (int idx)
 
bool readOnly () const
 
void setReadOnly (bool val)
 
bool disableElementsApply () const
 
void setDisableElementsApply (bool val)
 
bool systemPalette () const
 
void setSystemPalette (bool val)
 
void setMag (qreal val)
 
qreal mag () const
 
void setYOffset (qreal val)
 
qreal yOffset () const
 
int columns () const
 
int rows () const
 
int size () const
 
PaletteCellcellAt (int index) const
 
void setCellReadOnly (int c, bool v)
 
QString name () const
 
void setName (const QString &s)
 
int gridWidth () const
 
int gridHeight () const
 
bool moreElements () const
 
void setMoreElements (bool val)
 
bool filter (const QString &text)
 return true if all filtered More...
 
void setShowContextMenu (bool val)
 
int gridWidthM () const
 
int gridHeightM () const
 
int getCurrentIdx ()
 
void setCurrentIdx (int i)
 
bool isFilterActive ()
 
QList< PaletteCell * > getDragCells ()
 
virtual int heightForWidth (int) const
 
virtual QSize sizeHint () const
 
int idx (const QPoint &) const
 

Static Public Member Functions

static bool applyPaletteElement (Element *element, Qt::KeyboardModifiers modifiers=0)
 
static qreal guiMag ()
 

Private Slots

void actionToggled (bool val)
 

Private Member Functions

virtual void paintEvent (QPaintEvent *) override
 
virtual void mousePressEvent (QMouseEvent *) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *) override
 
virtual void leaveEvent (QEvent *) override
 
virtual bool event (QEvent *) override
 
virtual void resizeEvent (QResizeEvent *) override
 
virtual void dragEnterEvent (QDragEnterEvent *) override
 
virtual void dragMoveEvent (QDragMoveEvent *) override
 
virtual void dropEvent (QDropEvent *) override
 
virtual void contextMenuEvent (QContextMenuEvent *) override
 
int idx2 (const QPoint &) const
 
QRect idxRect (int) const
 
const QList< PaletteCell * > * ccp () const
 
QPixmap pixmap (int cellIdx) const
 

Private Attributes

QString _name
 
QList< PaletteCell * > cells
 
QList< PaletteCell * > dragCells
 
int hgrid
 
int vgrid
 
int currentIdx
 
int pressedIndex = -1
 
int dragIdx
 
int selectedIdx
 
QPoint dragStartPosition
 
qreal extraMag
 
bool _drawGrid
 
bool _selectable
 
bool _disableElementsApply { false }
 
bool _readOnly
 
bool _systemPalette
 
qreal _yOffset
 
bool filterActive { false }
 
bool _moreElements
 
bool _showContextMenu { true }
 

Constructor & Destructor Documentation

◆ Palette() [1/2]

Ms::Palette::Palette ( QWidget *  parent = 0)

◆ Palette() [2/2]

Ms::Palette::Palette ( std::unique_ptr< PalettePanel pp,
QWidget *  parent = nullptr 
)

◆ ~Palette()

Ms::Palette::~Palette ( )
virtual

Member Function Documentation

◆ actionToggled

void Ms::Palette::actionToggled ( bool  val)
privateslot

◆ add()

PaletteCell * Ms::Palette::add ( int  idx,
Element s,
const QString &  name,
const QString  tag = QString(),
qreal  mag = 1.0 
)

◆ append()

PaletteCell * Ms::Palette::append ( Element s,
const QString &  name,
QString  tag = QString(),
qreal  mag = 1.0 
)

◆ applyPaletteElement() [1/2]

void Ms::Palette::applyPaletteElement ( )

◆ applyPaletteElement() [2/2]

bool Ms::Palette::applyPaletteElement ( Element element,
Qt::KeyboardModifiers  modifiers = 0 
)
static

◆ boxClicked

void Ms::Palette::boxClicked ( int  )
signal

◆ ccp()

const QList<PaletteCell*>* Ms::Palette::ccp ( ) const
inlineprivate

◆ cellAt()

PaletteCell* Ms::Palette::cellAt ( int  index) const
inline

◆ changed

void Ms::Palette::changed ( )
signal

◆ clear()

void Ms::Palette::clear ( void  )

◆ columns()

int Ms::Palette::columns ( ) const

◆ contextMenuEvent()

void Ms::Palette::contextMenuEvent ( QContextMenuEvent *  event)
overrideprivatevirtual

◆ disableElementsApply()

bool Ms::Palette::disableElementsApply ( ) const
inline

◆ displayMore

void Ms::Palette::displayMore ( const QString &  paletteName)
signal

◆ dragEnterEvent()

void Ms::Palette::dragEnterEvent ( QDragEnterEvent *  event)
overrideprivatevirtual

◆ dragMoveEvent()

void Ms::Palette::dragMoveEvent ( QDragMoveEvent *  event)
overrideprivatevirtual

◆ drawGrid()

bool Ms::Palette::drawGrid ( ) const
inline

◆ dropEvent()

void Ms::Palette::dropEvent ( QDropEvent *  event)
overrideprivatevirtual

◆ element()

Element * Ms::Palette::element ( int  idx)

◆ emitChanged()

void Ms::Palette::emitChanged ( )
inline

◆ event()

bool Ms::Palette::event ( QEvent *  ev)
overrideprivatevirtual

◆ filter()

bool Ms::Palette::filter ( const QString &  text)

return true if all filtered

◆ getCurrentIdx()

int Ms::Palette::getCurrentIdx ( )
inline

◆ getDragCells()

QList<PaletteCell*> Ms::Palette::getDragCells ( )
inline

◆ getSelectedIdx()

int Ms::Palette::getSelectedIdx ( ) const
inline

◆ gridHeight()

int Ms::Palette::gridHeight ( ) const
inline

◆ gridHeightM()

int Ms::Palette::gridHeightM ( ) const
inline

◆ gridWidth()

int Ms::Palette::gridWidth ( ) const
inline

◆ gridWidthM()

int Ms::Palette::gridWidthM ( ) const
inline

◆ guiMag()

qreal Ms::Palette::guiMag ( )
static

◆ heightForWidth()

int Ms::Palette::heightForWidth ( int  w) const
virtual

◆ idx()

int Ms::Palette::idx ( const QPoint &  p) const

◆ idx2()

int Ms::Palette::idx2 ( const QPoint &  p) const
private

◆ idxRect()

QRect Ms::Palette::idxRect ( int  i) const
private

◆ isFilterActive()

bool Ms::Palette::isFilterActive ( )
inline

◆ leaveEvent()

void Ms::Palette::leaveEvent ( QEvent *  )
overrideprivatevirtual

◆ mag()

qreal Ms::Palette::mag ( ) const
inline

◆ moreElements()

bool Ms::Palette::moreElements ( ) const
inline

◆ mouseMoveEvent()

void Ms::Palette::mouseMoveEvent ( QMouseEvent *  ev)
overrideprivatevirtual

◆ mousePressEvent()

void Ms::Palette::mousePressEvent ( QMouseEvent *  ev)
overrideprivatevirtual

◆ mouseReleaseEvent()

void Ms::Palette::mouseReleaseEvent ( QMouseEvent *  event)
overrideprivate

◆ name()

QString Ms::Palette::name ( ) const
inline

◆ nextPaletteElement()

void Ms::Palette::nextPaletteElement ( )

◆ paintEvent()

void Ms::Palette::paintEvent ( QPaintEvent *  )
overrideprivatevirtual

◆ pixmap()

QPixmap Ms::Palette::pixmap ( int  cellIdx) const
private

◆ prevPaletteElement()

void Ms::Palette::prevPaletteElement ( )

◆ read() [1/2]

bool Ms::Palette::read ( const QString &  path)

◆ read() [2/2]

void Ms::Palette::read ( XmlReader e)

◆ readOnly()

bool Ms::Palette::readOnly ( ) const
inline

◆ resizeEvent()

void Ms::Palette::resizeEvent ( QResizeEvent *  e)
overrideprivatevirtual

◆ rows()

int Ms::Palette::rows ( ) const

◆ selectable()

bool Ms::Palette::selectable ( ) const
inline

◆ setCellReadOnly()

void Ms::Palette::setCellReadOnly ( int  c,
bool  v 
)
inline

◆ setCurrentIdx()

void Ms::Palette::setCurrentIdx ( int  i)
inline

◆ setDisableElementsApply()

void Ms::Palette::setDisableElementsApply ( bool  val)
inline

◆ setDrawGrid()

void Ms::Palette::setDrawGrid ( bool  val)
inline

◆ setGrid()

void Ms::Palette::setGrid ( int  hh,
int  vv 
)

◆ setMag()

void Ms::Palette::setMag ( qreal  val)

◆ setMoreElements()

void Ms::Palette::setMoreElements ( bool  val)

◆ setName()

void Ms::Palette::setName ( const QString &  s)
inline

◆ setReadOnly()

void Ms::Palette::setReadOnly ( bool  val)

◆ setSelectable()

void Ms::Palette::setSelectable ( bool  val)
inline

◆ setSelected()

void Ms::Palette::setSelected ( int  idx)
inline

◆ setShowContextMenu()

void Ms::Palette::setShowContextMenu ( bool  val)
inline

◆ setSystemPalette()

void Ms::Palette::setSystemPalette ( bool  val)

◆ setYOffset()

void Ms::Palette::setYOffset ( qreal  val)
inline

◆ size()

int Ms::Palette::size ( ) const
inline

◆ sizeHint()

QSize Ms::Palette::sizeHint ( ) const
virtual

◆ systemPalette()

bool Ms::Palette::systemPalette ( ) const
inline

◆ write() [1/2]

void Ms::Palette::write ( const QString &  path)

◆ write() [2/2]

void Ms::Palette::write ( XmlWriter xml) const

◆ yOffset()

qreal Ms::Palette::yOffset ( ) const
inline

Member Data Documentation

◆ _disableElementsApply

bool Ms::Palette::_disableElementsApply { false }
private

◆ _drawGrid

bool Ms::Palette::_drawGrid
private

◆ _moreElements

bool Ms::Palette::_moreElements
private

◆ _name

QString Ms::Palette::_name
private

◆ _readOnly

bool Ms::Palette::_readOnly
private

◆ _selectable

bool Ms::Palette::_selectable
private

◆ _showContextMenu

bool Ms::Palette::_showContextMenu { true }
private

◆ _systemPalette

bool Ms::Palette::_systemPalette
private

◆ _yOffset

qreal Ms::Palette::_yOffset
private

◆ cells

QList<PaletteCell*> Ms::Palette::cells
private

◆ currentIdx

int Ms::Palette::currentIdx
private

◆ dragCells

QList<PaletteCell*> Ms::Palette::dragCells
private

◆ dragIdx

int Ms::Palette::dragIdx
private

◆ dragStartPosition

QPoint Ms::Palette::dragStartPosition
private

◆ extraMag

qreal Ms::Palette::extraMag
private

◆ filterActive

bool Ms::Palette::filterActive { false }
private

◆ hgrid

int Ms::Palette::hgrid
private

◆ pressedIndex

int Ms::Palette::pressedIndex = -1
private

◆ selectedIdx

int Ms::Palette::selectedIdx
private

◆ vgrid

int Ms::Palette::vgrid
private

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