Ignore:
Timestamp:
02/19/13 15:01:43 (14 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Added rst documentation for the canvas gui package.

Fixing docstrings in the process.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/gui/lineedit.py

    r11105 r11366  
    2424 
    2525class LineEditButton(QToolButton): 
     26    """ 
     27    A button in the :class:`LineEdit`. 
     28    """ 
    2629    def __init__(self, parent=None, flat=True, **kwargs): 
    2730        QToolButton.__init__(self, parent, **kwargs) 
     
    5154 
    5255class LineEdit(QLineEdit): 
    53     """A line edit widget with support for adding actions (buttons) to 
     56    """ 
     57    A line edit widget with support for adding actions (buttons) to 
    5458    the left/right of the edited text 
    5559 
    5660    """ 
     61    #: Position flags 
    5762    LeftPosition, RightPosition = 1, 2 
    5863 
     64    #: Emitted when the action is triggered. 
    5965    triggered = Signal(QAction) 
     66 
     67    #: The left action was triggered. 
    6068    leftTriggered = Signal() 
     69 
     70    #: The right action was triggered. 
    6171    rightTriggered = Signal() 
    6272 
     
    6676 
    6777    def setAction(self, action, position=LeftPosition): 
    68         """Set `action` to be displayed at `position`. Existing action 
    69         if present will be removed. 
     78        """ 
     79        Set `action` to be displayed at `position`. Existing action 
     80        (if present) will be removed. 
     81 
     82        Parameters 
     83        ---------- 
     84        action : :class:`QAction` 
     85        position : int 
     86            Position where to set the action (default: ``LeftPosition``). 
    7087 
    7188        """ 
     
    93110 
    94111    def actionAt(self, position): 
    95         """Return `action` at `position`. 
     112        """ 
     113        Return :class:`QAction` at `position`. 
    96114        """ 
    97115        self._checkPosition(position) 
     
    103121 
    104122    def removeActionAt(self, position): 
    105         """Remove action at position. 
     123        """ 
     124        Remove the action at position. 
    106125        """ 
    107126        self._checkPosition(position) 
     
    116135 
    117136    def button(self, position): 
    118         """Return the actions button at position. 
     137        """ 
     138        Return the button (:class:`LineEditButton`) for the action 
     139        at `position`. 
     140 
    119141        """ 
    120142        self._checkPosition(position) 
Note: See TracChangeset for help on using the changeset viewer.