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,9 +25,10 @@ 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
- Image histogram
- Movable region over histogram to select black/white levels
- Gradient editor to define color lookup table for single-channel images
"""
sigLookupTableChanged = QtCore.Signal(object)
@ -201,4 +202,4 @@ class HistogramLUTItem(GraphicsWidget):
return self.region.getRegion()
def setLevels(self, mn, mx):
self.region.setRegion([mn, mx])
self.region.setRegion([mn, mx])

View File

@ -34,11 +34,15 @@ 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()
for k in args:
@ -108,4 +112,4 @@ class LabelItem(GraphicsWidget):
#p.setPen(fn.mkPen('r'))
#p.drawRect(self.rect())
#p.drawRect(self.item.boundingRect())

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),
which means the item will have the same bounds as the view.
============== =============================================================================
**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)
@ -124,4 +126,4 @@ class UIGraphicsItem(GraphicsObject):
return self.mapFromDevice(ds2)

View File

@ -3,18 +3,23 @@ from pyqtgraph.Qt import QtGui, QtCore
__all__ = ['ProgressDialog']
class ProgressDialog(QtGui.QProgressDialog):
"""Extends QProgressDialog for use in 'with' statements.
Arguments:
labelText (required)
cancelText Text to display on cancel button, or None to disable it.
minimum
maximum
parent
wait Length of time (im ms) to wait before displaying dialog
busyCursor If True, show busy cursor until dialog finishes
"""
Extends QProgressDialog for use in 'with' statements.
============== ================================================================
**Arguments:**
labelText (required)
cancelText Text to display on cancel button, or None to disable it.
minimum
maximum
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
@ -102,4 +107,4 @@ class ProgressDialog(QtGui.QProgressDialog):
if self.disabled:
return 0
return QtGui.QProgressDialog.minimum(self)

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):
@ -247,4 +243,4 @@ if __name__ == '__main__':
]}
])
t.setData(ma)