Ignore:
Timestamp:
03/18/13 14:00:55 (13 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Added a 'expandedChanged' signal to 'CollapsibleDockWidget'.

File:
1 edited

Legend:

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

    r11366 r11414  
    1616from PyQt4.QtCore import Qt, QEvent 
    1717 
    18 from PyQt4.QtCore import pyqtProperty as Property 
     18from PyQt4.QtCore import pyqtProperty as Property, pyqtSignal as Signal 
    1919 
    2020from .stackedwidget import AnimatedStackedWidget 
     
    3131    and ``setCollapsedWidget``. 
    3232 
    33     .. note:: Do use the base class ``QDockWidget.setWidget`` method to set 
    34               the contents. 
     33    .. note:: Do  not use the base class ``QDockWidget.setWidget`` method 
     34              to set the docks contents. Use set[Expanded|Collapsed]Widget 
     35              instead. 
    3536 
    3637    """ 
     38 
     39    #: Emitted when the dock widget's expanded state changes. 
     40    expandedChanged = Signal(bool) 
     41 
    3742    def __init__(self, *args, **kwargs): 
    3843        QDockWidget.__init__(self, *args, **kwargs) 
     
    98103            self.__fixIcon() 
    99104 
     105            self.expandedChanged.emit(state) 
     106 
    100107    def expanded(self): 
    101108        """ 
    102         Is the dock widget in expanded state. When `True` the 
     109        Is the dock widget in expanded state. If `True` the 
    103110        ``expandedWidget`` will be shown, and ``collapsedWidget`` otherwise. 
    104111 
     
    131138            self.updateGeometry() 
    132139 
    133     def expandedWidet(self): 
     140    def expandedWidget(self): 
    134141        """ 
    135142        Return the widget previously set with ``setExpandedWidget``, 
Note: See TracChangeset for help on using the changeset viewer.