]> Some of my projects - aniplayer2.git/commitdiff
Fix SeekSlider not showing seek time when hovering over it.
authorAPTX <marek321@gmail.com>
Sun, 16 Feb 2014 12:32:03 +0000 (13:32 +0100)
committerAPTX <marek321@gmail.com>
Sun, 16 Feb 2014 12:32:03 +0000 (13:32 +0100)
player/seekslider.cpp

index b76bfb1f2196f13d7735f5598a2638eb50f24a86..919be600a8d25d83ffb7b69bf11c4e8a89bfcd07 100644 (file)
@@ -99,7 +99,7 @@ void SeekSlider::paintEvent(QPaintEvent *event)
        p.fillRect(markerPos + markerWidth / 2, seekerTop + 1, seekerWidth - markerPos, seekerHeight - 1, unwatchedPartColor);
 
        int i = 1;
-       for (QQueue<qint64>::const_iterator it = previuousPos.constBegin(); it != previuousPos.constEnd(); ++it)
+       for (auto it = previuousPos.constBegin(); it != previuousPos.constEnd(); ++it)
        {
                int markerPos = seekerLeft + 1 + markerWidth / 2 + qRound(double(*it) / double(m_length) * double(seekerWidth - markerWidth / 2 - 1));
                QColor c = previousMarkerColor;
@@ -117,7 +117,7 @@ void SeekSlider::paintEvent(QPaintEvent *event)
                markerShadowPos = qBound(seekerLeft + 1 + markerWidth / 2, markerShadowPos, seekerLeft + seekerWidth - markerWidth / 2);
                p.fillRect(markerShadowPos - markerWidth / 2, seekerTop + 1, markerWidth, seekerHeight - 1, markerShadowColor);
 
-               QString time = QTime().addMSecs(pos2time(markerShadowPos)).toString("hh:mm:ss");
+               QString time = QTime(0, 0).addMSecs(pos2time(markerShadowPos)).toString("hh:mm:ss");
                QRect r = p.fontMetrics().boundingRect(time);
 
                int xdelta = markerShadowPos + markerWidth / 2 + 1;