documentation fixes / updates

This commit is contained in:
Luke Campagnola 2012-05-08 18:14:12 -04:00
parent aadd02f819
commit 2e03c9719f
6 changed files with 49 additions and 41 deletions

View File

@ -6,7 +6,7 @@ from pyqtgraph.Point import Point
__all__ = ['GridItem']
class GridItem(UIGraphicsItem):
"""
**Bases:** `UIGraphicsItem <pyqtgraph.UIGraphicsItem>'
**Bases:** :class:`UIGraphicsItem <pyqtgraph.UIGraphicsItem>'
Displays a rectangular grid of lines indicating major divisions within a coordinate system.
Automatically determines what divisions to use.

View File

@ -25,6 +25,7 @@ class HistogramLUTItem(GraphicsWidget):
"""
This is a graphicsWidget which provides controls for adjusting the display of an image.
Includes:
- Image histogram
- Movable region over histogram to select black/white levels
- Gradient editor to define color lookup table for single-channel images

View File

@ -34,10 +34,14 @@ class LabelItem(GraphicsWidget):
def setText(self, text, **args):
"""Set the text and text properties in the label. Accepts optional arguments for auto-generating
a CSS style string:
color: string (example: 'CCFF00')
size: string (example: '8pt')
bold: boolean
italic: boolean
==================== ==============================
**Style Arguments:**
color (str) example: 'CCFF00'
size (str) example: '8pt'
bold (bool)
italic (bool)
==================== ==============================
"""
self.text = text
opts = self.opts.copy()

View File

@ -4,7 +4,8 @@ from GraphicsObject import GraphicsObject
__all__ = ['UIGraphicsItem']
class UIGraphicsItem(GraphicsObject):
"""Base class for graphics items with boundaries relative to a GraphicsView or ViewBox.
"""
Base class for graphics items with boundaries relative to a GraphicsView or ViewBox.
The purpose of this class is to allow the creation of GraphicsItems which live inside
a scalable view, but whose boundaries will always stay fixed relative to the view's boundaries.
For example: GridItem, InfiniteLine
@ -19,10 +20,11 @@ class UIGraphicsItem(GraphicsObject):
def __init__(self, bounds=None, parent=None):
"""
Initialization Arguments:
#view: The view box whose bounds will be used as a reference vor this item's bounds
bounds: QRectF with coordinates relative to view box. The default is QRectF(0,0,1,1),
============== =============================================================================
**Arguments:**
bounds QRectF with coordinates relative to view box. The default is QRectF(0,0,1,1),
which means the item will have the same bounds as the view.
============== =============================================================================
"""
GraphicsObject.__init__(self, parent)
self.setFlag(self.ItemSendsScenePositionChanges)

View File

@ -3,8 +3,11 @@ from pyqtgraph.Qt import QtGui, QtCore
__all__ = ['ProgressDialog']
class ProgressDialog(QtGui.QProgressDialog):
"""Extends QProgressDialog for use in 'with' statements.
Arguments:
"""
Extends QProgressDialog for use in 'with' statements.
============== ================================================================
**Arguments:**
labelText (required)
cancelText Text to display on cancel button, or None to disable it.
minimum
@ -12,9 +15,11 @@ class ProgressDialog(QtGui.QProgressDialog):
parent
wait Length of time (im ms) to wait before displaying dialog
busyCursor If True, show busy cursor until dialog finishes
============== ================================================================
Example:
Example::
with ProgressDialog("Processing..", minVal, maxVal) as dlg:
# do stuff
dlg.setValue(i) ## could also use dlg += 1

View File

@ -11,18 +11,14 @@ except:
__all__ = ['TableWidget']
class TableWidget(QtGui.QTableWidget):
"""Extends QTableWidget with some useful functions for automatic data handling
and copy / export context menu.
Can automatically format and display:
numpy arrays
numpy record arrays
metaarrays
list-of-lists [[1,2,3], [4,5,6]]
dict-of-lists {'x': [1,2,3], 'y': [4,5,6]}
list-of-dicts [
{'x': 1, 'y': 4},
{'x': 2, 'y': 5},
{'x': 3, 'y': 6}
]
and copy / export context menu. Can automatically format and display:
- numpy arrays
- numpy record arrays
- metaarrays
- list-of-lists [[1,2,3], [4,5,6]]
- dict-of-lists {'x': [1,2,3], 'y': [4,5,6]}
- list-of-dicts [{'x': 1, 'y': 4}, {'x': 2, 'y': 5}, ...]
"""
def __init__(self, *args):