Game Editor¶
The game editor is based on Qt’s QTreeWidget.
Since Qt’s QTreeWidget does not fit the tree representing the Portable Game Notation (PGN), i.e.
n variations per move supported
the main (first) variation is privileged.
This behavior is implemented using 2 types of lines:
regular moves where all columns have a white background
beginning of a variation marked with a green cross
The tree widget has 4 colums:
Move shows the actual move or the beginning of a variation in SAN notation
Ann shows the annotation, i.e. a symbolic move assessment
Pos shows the position assessment
Score shows the engine or material score [centipawn] of the last move, material score ending with M
Comment shows either the move comment or starting comment of a variation
By clicking the annotation (Ann) and position assessment (Pos) fields, a popup dialog opens which allows to change the contents
- class gametreeview.GameTreeView(parent=None)[source]¶
Game Editor object
- setup(notifyGameNodeSelectedSignal: pyqtSignal | None, notifyGameNodeChangedSignal: pyqtSignal | None) None [source]¶
Set up of the game editor
- Parameters:
notifyGameNodeSelectedSignal – signal to be emitted if a game node is selected
notifyGameNodeChangedSignal – signal to be emitted if the loaded game is changed
- addVariant(gameNode: GameNode) None [source]¶
Adds a new variant, parent node must exist in the editor
- Parameters:
gameNode – game node to be added (must not be main_variation !!)
- addGameNodes(gameNode: GameNode, parentItem: QTreeWidgetItem | None = None) None [source]¶
Adds 1 or more nodes, parent node of first node must exist in the editor
- Parameters:
gameNode – game node to be added (must be main_variation !!)
parentItem – parent item of the gameNode (used only for internal use)
- setGameResult(result: str) None [source]¶
Sets the ‘Result’ header element
- Parameters:
result – one out of 1-0, 0-1, 1/2-1/2, *
- setGame(game: Game) None [source]¶
Clears the editor and sets new game
- Parameters:
game – game to be set