示例#1
0
 def instances(cls, parent=None):
     """
     Returns all the instances that exist for a given parent.  If
     no parent exists, then a blank list will be returned.
     
     :param      parent | <QtGui.QWidget>
     
     :return     [<XView>, ..]
     """
     if parent is None:
         parent = projexui.topWindow()
     return parent.findChildren(cls)
示例#2
0
 def instances(cls, parent=None):
     """
     Returns all the instances that exist for a given parent.  If
     no parent exists, then a blank list will be returned.
     
     :param      parent | <QtGui.QWidget>
     
     :return     [<XView>, ..]
     """
     if parent is None:
         parent = projexui.topWindow()
     return parent.findChildren(cls)
示例#3
0
    def currentView(cls, parent=None):
        """
        Returns the current view for the given class within a viewWidget.  If
        no view widget is supplied, then a blank view is returned.
        
        :param      viewWidget | <projexui.widgets.xviewwidget.XViewWidget> || None
        
        :return     <XView> || None
        """
        if parent is None:
            parent = projexui.topWindow()

        for inst in parent.findChildren(cls):
            if inst.isCurrent():
                return inst
        return None
示例#4
0
 def currentView(cls, parent=None):
     """
     Returns the current view for the given class within a viewWidget.  If
     no view widget is supplied, then a blank view is returned.
     
     :param      viewWidget | <projexui.widgets.xviewwidget.XViewWidget> || None
     
     :return     <XView> || None
     """
     if parent is None:
         parent = projexui.topWindow()
     
     for inst in parent.findChildren(cls):
         if inst.isCurrent():
             return inst
     return None
示例#5
0
 def __init__( self, parent = None, uifile = '' ):
     super(XShortcutWidget, self).__init__( parent, uifile )
     
     # load the user interface
     projexui.loadUi(__file__, self)
     
     # update the tree view
     header = self.uiActionTREE.header()
     header.setStretchLastSection(False)
     header.setResizeMode(0, header.Stretch)
     header.setResizeMode(1, header.ResizeToContents)
     
     window = projexui.topWindow()
     self.setActions(window.actions())
     
     # intercept key press events for the shortcut widget
     self.uiShortcutTXT.installEventFilter(self)
     
     # create connections
     self.uiActionTREE.itemSelectionChanged.connect( self.updateAction )
     self.uiClearBTN.clicked.connect( self.clear )
     self.uiSaveBTN.clicked.connect( self.updateShortcut )
示例#6
0
    def __init__(self, parent=None, uifile=''):
        super(XShortcutWidget, self).__init__(parent, uifile)

        # load the user interface
        projexui.loadUi(__file__, self)

        # update the tree view
        header = self.uiActionTREE.header()
        header.setStretchLastSection(False)
        header.setResizeMode(0, header.Stretch)
        header.setResizeMode(1, header.ResizeToContents)

        window = projexui.topWindow()
        self.setActions(window.actions())

        # intercept key press events for the shortcut widget
        self.uiShortcutTXT.installEventFilter(self)

        # create connections
        self.uiActionTREE.itemSelectionChanged.connect(self.updateAction)
        self.uiClearBTN.clicked.connect(self.clear)
        self.uiSaveBTN.clicked.connect(self.updateShortcut)