Exemplo n.º 1
0
 def createActionItem( self, key ):
     """
     Creates a new action item for the inputed key.
     
     :param      key | <str>
     
     :return     <QTreeWidgetItem>
     """
     action = self._actions.get(key)
     if ( not action ):
         text = 'Missing Action: %s' % key
         item = QTreeWidgetItem([text])
         ico = projexui.resources.find('img/log/warning.png')
         item.setIcon(0, QIcon(ico))
     else:
         item = QTreeWidgetItem([nativestring(action.text()).replace('&', '')])
         item.setIcon(0, action.icon())
     
     item.setSizeHint(0, QSize(120, 20))
     item.setData(0, Qt.UserRole, wrapVariant(key))
     
     flags = item.flags()
     flags ^= Qt.ItemIsDropEnabled
     item.setFlags(flags)
     
     return item
Exemplo n.º 2
0
    def createActionItem(self, key):
        """
        Creates a new action item for the inputed key.
        
        :param      key | <str>
        
        :return     <QTreeWidgetItem>
        """
        action = self._actions.get(key)
        if (not action):
            text = 'Missing Action: %s' % key
            item = QTreeWidgetItem([text])
            ico = projexui.resources.find('img/log/warning.png')
            item.setIcon(0, QIcon(ico))
        else:
            item = QTreeWidgetItem(
                [nativestring(action.text()).replace('&', '')])
            item.setIcon(0, action.icon())

        item.setSizeHint(0, QSize(120, 20))
        item.setData(0, Qt.UserRole, wrapVariant(key))

        flags = item.flags()
        flags ^= Qt.ItemIsDropEnabled
        item.setFlags(flags)

        return item
Exemplo n.º 3
0
 def createMenuItem( self, title ):
     """
     Creates a new menu item with the given title.
     
     :param      title | <str>
     
     :return     <QTreeWidgetItem>
     """
     item = QTreeWidgetItem([title])
     ico = projexui.resources.find('img/folder.png')
     
     item.setIcon(0, QIcon(ico))
     item.setSizeHint(0, QSize(120, 20))
     item.setData(0, Qt.UserRole, wrapVariant('menu'))
     
     return item
Exemplo n.º 4
0
    def createMenuItem(self, title):
        """
        Creates a new menu item with the given title.
        
        :param      title | <str>
        
        :return     <QTreeWidgetItem>
        """
        item = QTreeWidgetItem([title])
        ico = projexui.resources.find('img/folder.png')

        item.setIcon(0, QIcon(ico))
        item.setSizeHint(0, QSize(120, 20))
        item.setData(0, Qt.UserRole, wrapVariant('menu'))

        return item