Python PyQt4.QtCore.Qt 模块,ItemIsEnabled() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用PyQt4.QtCore.Qt.ItemIsEnabled()

项目:rexploit    作者:DaniLabs    | 项目源码 | 文件源码
def addItem(self, row, data):
        """
        This function add a item on a row
        :param row: the row's number
        :param data: the information
        :return: None
        """

        # state can be filtered, closed or open
        # data[3] is state
        if data[3] in ["open"]:
            self.tableWidget.setVerticalHeaderItem(row, QTableWidgetItem(QIcon().fromTheme('list-add'), ''))
        else:
            self.tableWidget.setVerticalHeaderItem(row, QTableWidgetItem(QIcon().fromTheme('dialog-error'), ''))

        for i, d in enumerate(data):
            item = QTableWidgetItem(d)
            item.setFlags(Qt.ItemIsEnabled)
            self.tableWidget.setItem(row, i, item)
项目:czml_generator    作者:samanbey    | 项目源码 | 文件源码
def updateList(self):
        """Update sample values list"""
        # get number of samples
        try:
            N=int(self.leNumberOfSamples.text())
        except ValueError:
            N=0
            return
        # re-generate sample list
        self.lwSampleValues.clear()
        for i in range(N):
            value=self.settings['minV']+(self.settings['maxV']-self.settings['minV'])*i/(N-1)
            self.lwSampleValues.addItem(str(value))
            self.lwSampleValues.item(i).setFlags(Qt.ItemIsEditable | Qt.ItemIsEnabled | Qt.ItemIsSelectable)
        # store number of samples
        self.N=N
        # update preview
        self.updatePreview()
项目:qgis-shapetools-plugin    作者:NationalSecurityAgency    | 项目源码 | 文件源码
def insertParams(self, position, distance, startAngle, endAngle):
        if position > self.tableWidget.rowCount():
            self.tableWidget.insertRow(position-1)
        item = QTableWidgetItem('{:.4f}'.format(self.unitDistance(distance)))
        item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
        self.tableWidget.setItem(position-1, 2, item)
        item = QTableWidgetItem('{:.4f}'.format(startAngle))
        item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
        self.tableWidget.setItem(position-1, 0, item)
        item = QTableWidgetItem('{:.4f}'.format(endAngle))
        item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
        self.tableWidget.setItem(position-1, 1, item)
项目:orquesta    作者:ej-f    | 项目源码 | 文件源码
def flags(self, index):
        if index.isValid() and self.isDir(index):
            return Qt.ItemIsDropEnabled | Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsDragEnabled
        else:
            return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsDragEnabled
项目:hachoir3    作者:vstinner    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super(CustomTableWidgetItem, self).__init__(parent)
        self.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)