What is the best way to implement the widget/graphicsitem as shown in the picture?

  • Hi,
    I want to write a Qt desktop application in which I want to implement a widget/graphicsitem that looks as follows.

    After reading Qt documentation, I thought maybe graphics item is more suitable. In this graphics item, the four green triangles are clickable. The triangles on the top and bottom controls the appearance of the black dot (whether it appears on the top, on the bottom as in the picture, or doesn't appear). The triangles on the left and right controls the digit in the center, along with the sharp and flat notations. Also, when you click on the digit, you can enter commands directly to alter the appearance of the digit, sharp/flat, and black dot. The green triangles appear only when the mouse hovers around it, otherwise it will disappear. As you might have guessed, it stands for a note in numbered musical notation.

    I'm a bit confused about how to implement it. I think the green triangles can be implemented by QGraphicsPolygonItem's. However, will I be able to encapsulate the whole thing as a graphics item, or whatever class? I want it to be implemented like an ordinary customizable widget (or graphics item), not to be separated QGraphicsPolygonItem's, since there will be a lot of notes in my application.

    What do you think is the best way to implement it? Thank you very much for your help!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.