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
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
def createSeparatorItem( self ): """ Creates a new separator item. :return <QTreeWidgetItem> """ item = QTreeWidgetItem([' ']) font = item.font(0) font.setStrikeOut(True) item.setFont(0, font) item.setData(0, Qt.UserRole, wrapVariant('separator')) flags = item.flags() flags ^= Qt.ItemIsDropEnabled item.setFlags(flags) return item
def createSeparatorItem(self): """ Creates a new separator item. :return <QTreeWidgetItem> """ item = QTreeWidgetItem([' ']) font = item.font(0) font.setStrikeOut(True) item.setFont(0, font) item.setData(0, Qt.UserRole, wrapVariant('separator')) flags = item.flags() flags ^= Qt.ItemIsDropEnabled item.setFlags(flags) return item