Skip to content

Convenient shortcuts

Compare
Choose a tag to compare
@jdranczewski jdranczewski released this 30 Nov 21:21
· 64 commits to main since this release

You can now access the QApplication class as puzzlepiece.QApp, and pass Piece classes to add_piece instead of instantiating them first - this will reduce the clutter when building applications, and bring the minimum viable app to this neater form:

import puzzlepiece as pzp
from puzzlepiece.pieces import random_number

app = pzp.QApp([])
puzzle = pzp.Puzzle(app, "Basic example")
puzzle.add_piece("random", random_number.Piece, 0, 0)
puzzle.show()
app.exec()