Ignore:
Timestamp:
04/05/13 15:02:18 (13 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed/added editlinksdialog docstrings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/document/editlinksdialog.py

    r11447 r11448  
    11""" 
     2=========== 
     3Link Editor 
     4=========== 
     5 
    26An Dialog to edit links between two nodes in the scheme. 
    37 
     
    1418    QGraphicsLinearLayout, QGraphicsGridLayout, QGraphicsPixmapItem, 
    1519    QGraphicsDropShadowEffect, QSizePolicy, QPalette, QPen, 
    16     QPainter 
     20    QPainter, QIcon 
    1721) 
    1822 
     
    2832from ..resources import icon_loader 
    2933 
    30  
     34# This is a special value defined in Qt4 but does not seem to be exported 
     35# by PyQt4 
    3136QWIDGETSIZE_MAX = ((1 << 24) - 1) 
    3237 
     
    8691 
    8792    def setNodes(self, source_node, sink_node): 
    88         """Set the source/sink nodes (`SchemeNode` instances) 
     93        """ 
     94        Set the source/sink nodes (:class:`.SchemeNode` instances) 
    8995        between which to edit the links. 
    9096 
     97        .. note:: This should be called before :func:`setLinks`. 
     98 
    9199        """ 
    92100        self.scene.editWidget.setNodes(source_node, sink_node) 
    93101 
    94102    def setLinks(self, links): 
    95         """Set a list of links to display between the source and sink 
     103        """ 
     104        Set a list of links to display between the source and sink 
    96105        nodes. The `links` is a list of (`OutputSignal`, `InputSignal`) 
    97         instances where the first element refers to the source node 
    98         and the second to the sink node. 
     106        tuples where the first element is an output signal of the source 
     107        node and the second an input signal of the sink node. 
    99108 
    100109        """ 
     
    102111 
    103112    def links(self): 
    104         """Return the links between the source and sink node. 
     113        """ 
     114        Return the links between the source and sink node. 
    105115        """ 
    106116        return self.scene.editWidget.links() 
     
    115125def find_item_at(scene, pos, order=Qt.DescendingOrder, type=None, 
    116126                 name=None): 
    117     """Find an object in a :class:`QGraphicsScene` `scene` at `pos`. 
     127    """ 
     128    Find an object in a :class:`QGraphicsScene` `scene` at `pos`. 
    118129    If `type` is not `None` the it must specify  the type of the item. 
    119130    I `name` is not `None` it must be a name of the object 
     
    136147 
    137148class LinksEditScene(QGraphicsScene): 
    138     """A :class:`QGraphicsScene` used by the :class:`LinkEditWidget`. 
    139  
     149    """ 
     150    A :class:`QGraphicsScene` used by the :class:`LinkEditWidget`. 
    140151    """ 
    141152    def __init__(self, *args, **kwargs): 
     
    185196    def removeItems(self, items): 
    186197        """ 
    187         Remove child items form the widget and scene. 
     198        Remove child items from the widget and scene. 
    188199        """ 
    189200        scene = self.scene() 
     
    209220        which to edit the links. 
    210221 
    211         .. note:: Call this before `setLinks`. 
     222        .. note:: Call this before :func:`setLinks`. 
    212223 
    213224        """ 
     
    450461class EditLinksNode(QGraphicsWidget): 
    451462    """ 
    452     A Node with channel anchors. 
     463    A Node representation with channel anchors. 
    453464 
    454465    `direction` specifies the layout (default `Qt.LeftToRight` will 
     
    504515        """ 
    505516        if size != self.__iconSize: 
    506             self.__iconSize = size 
     517            self.__iconSize = QSize(size) 
    507518            if self.__icon: 
    508519                self.__iconItem.setPixmap(self.__icon.pixmap(size)) 
     
    510521 
    511522    def iconSize(self): 
    512         return self.__iconSize 
     523        """ 
     524        Return the icon size. 
     525        """ 
     526        return QSize(self.__iconSize) 
    513527 
    514528    def setIcon(self, icon): 
     
    517531        """ 
    518532        if icon != self.__icon: 
    519             self.__icon = icon 
     533            self.__icon = QIcon(icon) 
    520534            self.__iconItem.setPixmap(icon.pixmap(self.iconSize())) 
    521535            self.__iconLayoutItem.updateGeometry() 
    522536 
    523537    def icon(self): 
    524         return self.__icon 
     538        """ 
     539        Return the icon. 
     540        """ 
     541        return QIcon(self.__icon) 
    525542 
    526543    def setSchemeNode(self, node): 
    527544        """ 
    528         Set an instance of `SchemeNode`. The widget will be 
    529         initialized with its icon and channels. 
     545        Set an instance of `SchemeNode`. The widget will be initialized 
     546        with its icon and channels. 
    530547 
    531548        """ 
     
    653670 
    654671class ChannelAnchor(QGraphicsRectItem): 
     672    """ 
     673    A rectangular Channel Anchor indicator. 
     674    """ 
    655675    def __init__(self, parent=None, channel=None, rect=None, **kwargs): 
    656676        QGraphicsRectItem.__init__(self, **kwargs) 
     
    673693 
    674694    def setChannel(self, channel): 
     695        """ 
     696        Set the channel description. 
     697        """ 
    675698        if channel != self.__channel: 
    676699            self.__channel = channel 
     700 
    677701            if hasattr(channel, "description"): 
    678702                self.setToolTip(channel.description) 
     
    681705 
    682706    def channel(self): 
     707        """ 
     708        Return the channel description. 
     709        """ 
    683710        return self.__channel 
    684711 
     
    693720 
    694721class GraphicsTextWidget(QGraphicsWidget): 
    695     """A QGraphicsWidget subclass that manages a QGraphicsTextItem 
    696  
     722    """ 
     723    A QGraphicsWidget subclass that manages a `QGraphicsTextItem`. 
    697724    """ 
    698725 
Note: See TracChangeset for help on using the changeset viewer.