diff --git a/src/waveform/renderers/allshader/waveformrendermark.cpp b/src/waveform/renderers/allshader/waveformrendermark.cpp index 59a8efc46d1..17d113155c3 100644 --- a/src/waveform/renderers/allshader/waveformrendermark.cpp +++ b/src/waveform/renderers/allshader/waveformrendermark.cpp @@ -159,7 +159,7 @@ void allshader::WaveformRenderMark::drawMark(const QRectF& rect, QColor color) { void allshader::WaveformRenderMark::paintGL() { const float devicePixelRatio = m_waveformRenderer->getDevicePixelRatio(); - QList> marksOnScreen; + QList marksOnScreen; checkCuesUpdated(); @@ -221,7 +221,9 @@ void allshader::WaveformRenderMark::paintGL() { } if (visible) { - marksOnScreen.append(qMakePair(pMark, drawOffset)); + marksOnScreen.append( + WaveformWidgetRenderer::WaveformMarkOnScreen{ + pMark, static_cast(drawOffset)}); } } } diff --git a/src/waveform/renderers/waveformrendermark.cpp b/src/waveform/renderers/waveformrendermark.cpp index 6d9f8e4e426..df5e6025ce3 100644 --- a/src/waveform/renderers/waveformrendermark.cpp +++ b/src/waveform/renderers/waveformrendermark.cpp @@ -41,7 +41,7 @@ void WaveformRenderMark::setup(const QDomNode& node, const SkinContext& context) void WaveformRenderMark::draw(QPainter* painter, QPaintEvent* /*event*/) { PainterScope PainterScope(painter); // Associates mark objects with their positions in the widget. - QList> marksOnScreen; + QList marksOnScreen; painter->setWorldMatrixEnabled(false); @@ -102,7 +102,9 @@ void WaveformRenderMark::draw(QPainter* painter, QPaintEvent* /*event*/) { } if (visible) { - marksOnScreen.append(qMakePair(pMark, drawOffset)); + marksOnScreen.append( + WaveformWidgetRenderer::WaveformMarkOnScreen{ + pMark, drawOffset}); } } else { const int markHalfHeight = @@ -146,7 +148,9 @@ void WaveformRenderMark::draw(QPainter* painter, QPaintEvent* /*event*/) { } if (visible) { - marksOnScreen.append(qMakePair(pMark, drawOffset)); + marksOnScreen.append( + WaveformWidgetRenderer::WaveformMarkOnScreen{ + pMark, drawOffset}); } } } diff --git a/src/waveform/renderers/waveformwidgetrenderer.cpp b/src/waveform/renderers/waveformwidgetrenderer.cpp index ec721502708..a3e31555b56 100644 --- a/src/waveform/renderers/waveformwidgetrenderer.cpp +++ b/src/waveform/renderers/waveformwidgetrenderer.cpp @@ -422,12 +422,12 @@ WaveformMarkPointer WaveformWidgetRenderer::getCueMarkAtPoint(QPoint point) cons // drawoffset from the drawing and c) storing it in WaveformMark. for (auto it = m_markPositions.crbegin(); it != m_markPositions.crend(); ++it) { - const WaveformMarkPointer& pMark = it->first; + const WaveformMarkPointer& pMark = it->m_pMark; VERIFY_OR_DEBUG_ASSERT(pMark) { continue; } - int markImagePositionInWidgetSpace = it->second; + int markImagePositionInWidgetSpace = it->m_offsetOnScreen; QPoint pointInImageSpace; if (getOrientation() == Qt::Horizontal) { pointInImageSpace = QPoint(point.x() - markImagePositionInWidgetSpace, point.y()); diff --git a/src/waveform/renderers/waveformwidgetrenderer.h b/src/waveform/renderers/waveformwidgetrenderer.h index 912ece5539c..f2c3a6e78b4 100644 --- a/src/waveform/renderers/waveformwidgetrenderer.h +++ b/src/waveform/renderers/waveformwidgetrenderer.h @@ -26,6 +26,11 @@ class WaveformWidgetRenderer { static const double s_waveformDefaultZoom; static const double s_defaultPlayMarkerPosition; + struct WaveformMarkOnScreen { + WaveformMarkPointer m_pMark; + int m_offsetOnScreen; + }; + public: explicit WaveformWidgetRenderer(const QString& group); virtual ~WaveformWidgetRenderer(); @@ -149,7 +154,7 @@ class WaveformWidgetRenderer { } void setTrack(TrackPointer track); - void setMarkPositions(const QList>& markPositions) { + void setMarkPositions(const QList& markPositions) { m_markPositions = markPositions; } @@ -217,7 +222,7 @@ class WaveformWidgetRenderer { private: DISALLOW_COPY_AND_ASSIGN(WaveformWidgetRenderer); friend class WaveformWidgetFactory; - QList> m_markPositions; + QList m_markPositions; // draw play position indicator triangles void drawPlayPosmarker(QPainter* painter); void drawTriangle(QPainter* painter,