How do I create a widget that looks like this
-
This is the lichess' analysis board game notation sidebar. I've been trying to replicate this design in qt. Currently I can draw the mainline only ignoring variations
Even once I would eventually figure out how to draw the variations I will still need to figure out how to handle clicking and hovering on a move. Each move is associated with a MoveId so I would need to retrieve that.
I think my approach could be fundemantally wrong as I'm doing everything in a paintEvent() of a custom QWidget. Maybe there is some other Qt Widget class that I can inherit, which is better suited for this. Or maybe there is a way to turn each move into it's own child widget? I dont really know what the proper approach would be for this.I can provide any code or further details so please ask if you need any.
-
@MrShawn How would you suggest doing this with QML? What should I look into?
-
This is the lichess' analysis board game notation sidebar. I've been trying to replicate this design in qt. Currently I can draw the mainline only ignoring variations
Even once I would eventually figure out how to draw the variations I will still need to figure out how to handle clicking and hovering on a move. Each move is associated with a MoveId so I would need to retrieve that.
I think my approach could be fundemantally wrong as I'm doing everything in a paintEvent() of a custom QWidget. Maybe there is some other Qt Widget class that I can inherit, which is better suited for this. Or maybe there is a way to turn each move into it's own child widget? I dont really know what the proper approach would be for this.I can provide any code or further details so please ask if you need any.
Custom data view (either custom widget as well or some tableView) with your chess data model.
Esp. if you have database-like structures with identifiers for "moves" or any other action that is going on.You could start here:
To have it displayed neatly, you could make your own delegates to show your data (moves) with the matching icon for every chess figure and more things you might want to add / display.