0

I have a video player which displays images in QgraphicsScene frame by frame. There's a play button, which shows frames by frames, like video. I want to show the preview image when mouse hover the qslider for the player, like in YouTube n other video players. Preview Image on slider

Request to suggest some approach!! I tried, mouse hover event on the qslider n displaying a qlabel with the particular frame.

Regards, Sayan

1 Answer 1

0

As you mention you are using Qt 2D graphical scene. Here is a demo project I put it on Github.

It's simple to draw the slider by QGraphicsItem, and show a small QGraphicsPixmapItem at the slider above as the preview.

For preview, the point is to reimplement the hoverMoveEvent(QGraphicsSceneHoverEvent* event) of QGraphicsItem to catch the mouse hover event and get the position. Then calculate it with the total width of the slider bar to get the index the of images and show it.

1
  • Thanks so much..hope this helps my requirement.
    – Sayan Bera
    Commented Apr 3, 2018 at 6:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.