Mercurial > hg > svgui
changeset 820:b2349053c5f8 tonioni
adding number to display of illuminated note
author | matthiasm |
---|---|
date | Tue, 15 Jul 2014 15:54:06 +0100 |
parents | 24f18a7dd26d |
children | ec0906aef9bf |
files | layer/FlexiNoteLayer.cpp |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp Wed Jul 02 19:22:05 2014 +0100 +++ b/layer/FlexiNoteLayer.cpp Tue Jul 15 15:54:06 2014 +0100 @@ -801,7 +801,7 @@ int frame0 = v->getFrameForX(x0); int frame1 = v->getFrameForX(x1); - FlexiNoteModel::PointList points(m_model->getPoints(frame0, frame1)); + FlexiNoteModel::PointList points(m_model->getPoints(0, frame1)); if (points.empty()) return; paint.setPen(getBaseQColor()); @@ -828,9 +828,12 @@ paint.save(); paint.setRenderHint(QPainter::Antialiasing, false); + int noteNumber = 0; + for (FlexiNoteModel::PointList::const_iterator i = points.begin(); i != points.end(); ++i) { + ++noteNumber; const FlexiNoteModel::Point &p(*i); int x = v->getXForFrame(p.frame); @@ -882,6 +885,11 @@ x, y + h + 2 + paint.fontMetrics().descent(), llabel, View::OutlinedText); + QString nlabel = QString("%1").arg(noteNumber); + v->drawVisibleText(paint, + x + paint.fontMetrics().averageCharWidth() / 2, + y + h/2 - paint.fontMetrics().descent(), + nlabel, View::OutlinedText); } paint.drawRect(x, y - h/2, w, h);