diff --git a/documentation/source/graphicsItems/index.rst b/documentation/source/graphicsItems/index.rst index aaabb64f..c554db8c 100644 --- a/documentation/source/graphicsItems/index.rst +++ b/documentation/source/graphicsItems/index.rst @@ -21,6 +21,7 @@ Contents: scatterplotitem isocurveitem axisitem + textitem arrowitem curvepoint curvearrow diff --git a/documentation/source/graphicsItems/textitem.rst b/documentation/source/graphicsItems/textitem.rst new file mode 100644 index 00000000..143e539d --- /dev/null +++ b/documentation/source/graphicsItems/textitem.rst @@ -0,0 +1,8 @@ +TextItem +======== + +.. autoclass:: pyqtgraph.TextItem + :members: + + .. automethod:: pyqtgraph.TextItem.__init__ + diff --git a/documentation/source/parametertree/apiref.rst b/documentation/source/parametertree/apiref.rst index 7ca0f99e..876253e0 100644 --- a/documentation/source/parametertree/apiref.rst +++ b/documentation/source/parametertree/apiref.rst @@ -1,5 +1,3 @@ -.. _api_widgets: - ParameterTree API Reference =========================== diff --git a/graphicsItems/GraphicsLayout.py b/graphicsItems/GraphicsLayout.py index bb68492d..9d48e627 100644 --- a/graphicsItems/GraphicsLayout.py +++ b/graphicsItems/GraphicsLayout.py @@ -75,7 +75,7 @@ class GraphicsLayout(GraphicsWidget): All extra keyword arguments are passed to :func:`LabelItem.__init__ ` Returns the created item. - To create a vertical label, use *angle*=-90 + To create a vertical label, use *angle* = -90. """ text = LabelItem(text, **kargs) self.addItem(text, row, col, rowspan, colspan) diff --git a/graphicsItems/TextItem.py b/graphicsItems/TextItem.py index a16e6841..5d84e23f 100644 --- a/graphicsItems/TextItem.py +++ b/graphicsItems/TextItem.py @@ -9,16 +9,18 @@ class TextItem(UIGraphicsItem): """ def __init__(self, text='', color=(200,200,200), html=None, anchor=(0,0), border=None, fill=None): """ + =========== ================================================================================= Arguments: - *text* The text to display - *color* The color of the text (any format accepted by pg.mkColor) - *html* If specified, this overrides both *text* and *color* - *anchor* A QPointF or (x,y) sequence indicating what region of the text box will - be anchored to the item's position. A value of (0,0) sets the upper-left corner - of the text box to be at the position specified by setPos(), while a value of (1,1) - sets the lower-right corner. - *border* A pen to use when drawing the border - *fill* A brush to use when filling within the border + *text* The text to display + *color* The color of the text (any format accepted by pg.mkColor) + *html* If specified, this overrides both *text* and *color* + *anchor* A QPointF or (x,y) sequence indicating what region of the text box will + be anchored to the item's position. A value of (0,0) sets the upper-left corner + of the text box to be at the position specified by setPos(), while a value of (1,1) + sets the lower-right corner. + *border* A pen to use when drawing the border + *fill* A brush to use when filling within the border + =========== ================================================================================= """ UIGraphicsItem.__init__(self) self.textItem = QtGui.QGraphicsTextItem() diff --git a/parametertree/Parameter.py b/parametertree/Parameter.py index 80d6d47b..fce4ae3a 100644 --- a/parametertree/Parameter.py +++ b/parametertree/Parameter.py @@ -364,9 +364,10 @@ class Parameter(QtCore.QObject): return self.insertChild(len(self.childs), child) def insertChild(self, pos, child): - """Insert a new child at pos. + """ + Insert a new child at pos. If pos is a Parameter, then insert at the position of that Parameter. - If child is a dict, then a parameter is constructed as Parameter(**child) + If child is a dict, then a parameter is constructed as Parameter(\*\*child) """ if isinstance(child, dict): child = Parameter.create(**child) diff --git a/parametertree/ParameterItem.py b/parametertree/ParameterItem.py index c2fcbb1c..30105d9b 100644 --- a/parametertree/ParameterItem.py +++ b/parametertree/ParameterItem.py @@ -5,10 +5,12 @@ class ParameterItem(QtGui.QTreeWidgetItem): """ Abstract ParameterTree item. Used to represent the state of a Parameter from within a ParameterTree. - - Sets first column of item to name - - generates context menu if item is renamable or removable - - handles child added / removed events - - provides virtual functions for handling changes from parameter + + - Sets first column of item to name + - generates context menu if item is renamable or removable + - handles child added / removed events + - provides virtual functions for handling changes from parameter + For more ParameterItem types, see ParameterTree.parameterTypes module. """ diff --git a/parametertree/parameterTypes.py b/parametertree/parameterTypes.py index dba7462d..3e650afc 100644 --- a/parametertree/parameterTypes.py +++ b/parametertree/parameterTypes.py @@ -10,10 +10,12 @@ import os, collections class WidgetParameterItem(ParameterItem): """ ParameterTree item with: - - label in second column for displaying value - - simple widget for editing value (displayed instead of label when item is selected) - - button that resets value to default - - provides SpinBox, CheckBox, LineEdit, and ColorButton types + + - label in second column for displaying value + - simple widget for editing value (displayed instead of label when item is selected) + - button that resets value to default + - provides SpinBox, CheckBox, LineEdit, and ColorButton types + This class can be subclassed by overriding makeWidget() to provide a custom widget. """ def __init__(self, param, depth): @@ -64,9 +66,13 @@ class WidgetParameterItem(ParameterItem): """ Return a single widget that should be placed in the second tree column. The widget must be given three attributes: - sigChanged -- a signal that is emitted when the widget's value is changed - value -- a function that returns the value - setValue -- a function that sets the value + + ========== ============================================================ + sigChanged a signal that is emitted when the widget's value is changed + value a function that returns the value + setValue a function that sets the value + ========== ============================================================ + This is a good function to override in subclasses. """ opts = self.param.opts