From d479af48b1c2a49a7e6d18035c23d78587812ec6 Mon Sep 17 00:00:00 2001 From: Martin Baeuml Date: Fri, 10 Jun 2011 17:34:45 +0200 Subject: [PATCH] doc: AnnotationGraphicsItem --> BaseItem --- doc/items.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/items.rst b/doc/items.rst index bd25634..f0883fc 100644 --- a/doc/items.rst +++ b/doc/items.rst @@ -57,22 +57,22 @@ Usage: Write your own visualization item ================================= -The base class for all visualization item is the :ref:`AnnotationGraphicsItem ` class. In +The base class for all visualization item is the :ref:`BaseItem ` class. In order to write a new visualization item, you need to subclass this class and implement a few functions. The easiest way to visualize your label is by using some of the existing Qt graphics items. You can initialize it in the constructor and be done:: - class MyRectItem(AnnotationGraphicsItem): + class MyRectItem(BaseItem): def __init__(self, index, data): # Call the base class constructor. This will make the label # data available in self.data - AnnotationGraphicsItem.__init__(self, index, data) + BaseItem.__init__(self, index, data) # Create a new rect item and add it as child item. # This defines what will be displayed for this label, since the - # AnnotationGraphicsItem base class itself does not display anything. + # BaseItem base class itself does not display anything. x, y, width, height = map(float, (self.data['x'], self.data['y'], self.data['width'], self.data['height'])) self.rect_ = QGraphicsRectItem(x, y, width, height, self) @@ -119,9 +119,9 @@ to clone. Example:: - class MyRectItem(AnnotationGraphicsItem): + class MyRectItem(BaseItem): def __init__(self, index, data): - AnnotationGraphicsItem.__init__(self, index, data) + BaseItem.__init__(self, index, data) self.color_ = Qt.Red def setColor(self, color):