easygraphics.widget package¶
The qt widget package.
This package provides two qt widget classes, for embeding easygraphics image or turtle graphics in qt applications:
- ImageWidget: this class is for embedding easygraphics image in qt applications. No animation support
- TurtleWidget: this class is for embedding turtle graphics in qt applications. Can run animation code (using run_animated_code() method).
Functions¶
-
class
easygraphics.widget.
ImageWidget
(parent=None)¶ -
close
()¶
-
getImage
() → easygraphics.image.Image¶ Get the underlying image object.
Returns: the underlying image object
-
paintEvent
(e: <sphinx.ext.autodoc.importer._MockObject object at 0x7f507883c510>)¶
-
setImage
(image: easygraphics.image.Image)¶ Set the widget’s underlying Image object.
Parameters: image – the underlying image object
-
-
class
easygraphics.widget.
TurtleWidget
(parent=None, width=600, height=400)¶ -
close
()¶ Close the widget.
-
closeEvent
(e: <sphinx.ext.autodoc.importer._MockObject object at 0x7f507866e7d0>)¶
-
getTurtle
() → easygraphics.turtle.turleclass.Turtle¶ Get the turtle.
Returns: the turtle
-
getWorld
() → easygraphics.turtle.turleclass.TurtleWorld¶ Get the underlying turtle world.
Returns: the turtle world
-
hideEvent
(QHideEvent)¶
-
is_run
()¶ Test if the turtle world is running.
Returns: True if is running, False if not.
-
paintEvent
(e: <sphinx.ext.autodoc.importer._MockObject object at 0x7f507866e7d0>)¶
-
run_animated_code
(f)¶ Run turtle code.
Parameters: f – the callable object(function or method) to run
-
showEvent
(QShowEvent)¶
-