Skip to content

Commit

Permalink
[Inspector/FretDiagram] Update NotationPaintView when clicking Reset …
Browse files Browse the repository at this point in the history
…button
  • Loading branch information
cbjeukendrup committed Oct 12, 2021
1 parent be8455a commit d2641f8
Showing 1 changed file with 4 additions and 34 deletions.
38 changes: 4 additions & 34 deletions src/inspector/view/widgets/fretcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@

using namespace mu::inspector;

//---------------------------------------------------------
// FretCanvas
//---------------------------------------------------------

FretCanvas::FretCanvas(QQuickItem* parent)
: QQuickPaintedItem(parent)
{
Expand All @@ -49,10 +45,6 @@ FretCanvas::FretCanvas(QQuickItem* parent)
m_cfret = -2;
}

//---------------------------------------------------------
// paintEvent
//---------------------------------------------------------

void FretCanvas::draw(QPainter* painter)
{
double mag = 1.5;
Expand Down Expand Up @@ -183,10 +175,6 @@ void FretCanvas::draw(QPainter* painter)
}
}

//---------------------------------------------------------
// paintDotSymbol
//---------------------------------------------------------

void FretCanvas::paintDotSymbol(QPainter* p, QPen& pen, qreal x, qreal y, qreal dotd, Ms::FretDotType dtype)
{
switch (dtype) {
Expand All @@ -212,10 +200,6 @@ void FretCanvas::paintDotSymbol(QPainter* p, QPen& pen, qreal x, qreal y, qreal
}
}

//---------------------------------------------------------
// getPosition
//---------------------------------------------------------

void FretCanvas::getPosition(const QPointF& p, int* string, int* fret)
{
double mag = 1.5;
Expand All @@ -233,10 +217,6 @@ void FretCanvas::getPosition(const QPointF& p, int* string, int* fret)
*string = (p.x() - xo + stringDist * .5) / stringDist;
}

//---------------------------------------------------------
// mousePressEvent
//---------------------------------------------------------

void FretCanvas::mousePressEvent(QMouseEvent* ev)
{
int string;
Expand Down Expand Up @@ -327,10 +307,6 @@ void FretCanvas::mousePressEvent(QMouseEvent* ev)
globalContext()->currentNotation()->notationChanged().notify();
}

//---------------------------------------------------------
// hoverMoveEvent
//---------------------------------------------------------

void FretCanvas::hoverMoveEvent(QHoverEvent* ev)
{
int string;
Expand All @@ -343,10 +319,6 @@ void FretCanvas::hoverMoveEvent(QHoverEvent* ev)
}
}

//---------------------------------------------------------
// setFretDiagram
//---------------------------------------------------------

void FretCanvas::setFretDiagram(QVariant fd)
{
m_diagram = fd.value<Ms::FretDiagram*>();
Expand All @@ -363,16 +335,14 @@ void FretCanvas::setFretDiagram(QVariant fd)
update();
}

//---------------------------------------------------------
// clear
//---------------------------------------------------------

void FretCanvas::clear()
{
m_diagram->score()->startCmd();
globalContext()->currentNotation()->undoStack()->prepareChanges();
m_diagram->undoFretClear();
m_diagram->score()->endCmd();
globalContext()->currentNotation()->undoStack()->commitChanges();
update();

globalContext()->currentNotation()->notationChanged().notify();
}

void FretCanvas::paint(QPainter* painter)
Expand Down

0 comments on commit d2641f8

Please sign in to comment.