当前位置: 首页>>代码示例>>Python>>正文


Python Qt.NoItemFlags方法代码示例

本文整理汇总了Python中PyQt5.QtCore.Qt.NoItemFlags方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.NoItemFlags方法的具体用法?Python Qt.NoItemFlags怎么用?Python Qt.NoItemFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.Qt的用法示例。


在下文中一共展示了Qt.NoItemFlags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: flags

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def flags(self, index):
        """Return the item flags for index.

        Override QAbstractItemModel::flags.

        Return: The item flags, or Qt.NoItemFlags on error.
        """
        if not index.isValid():
            return Qt.NoItemFlags
        if index.parent().isValid():
            # item
            return (Qt.ItemIsEnabled | Qt.ItemIsSelectable |
                    Qt.ItemNeverHasChildren)
        else:
            # category
            return Qt.NoItemFlags 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:18,代码来源:completionmodel.py

示例2: flags

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def flags(self, index: QModelIndex):
        if not index.isValid():
            return None

        j = index.column()
        device = self.get_device_at(index.row())
        if j == 0 and not device.has_native_backend and not device.has_gnuradio_backend:
            return Qt.NoItemFlags

        if j in [1, 2, 3] and not device.is_enabled:
            return Qt.NoItemFlags

        if j == 2 and not device.has_native_backend:
            return Qt.NoItemFlags

        if j == 3 and not device.has_gnuradio_backend:
            return Qt.NoItemFlags

        flags = Qt.ItemIsEnabled

        if j in [0, 2, 3]:
            flags |= Qt.ItemIsUserCheckable

        return flags 
开发者ID:jopohl,项目名称:urh,代码行数:26,代码来源:OptionsDialog.py

示例3: set_server_mgr

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def set_server_mgr(self, server_mgr):
        self.server_mgr = server_mgr
        self.nodesets = []
        self.model.clear()
        self.model.setHorizontalHeaderLabels(['Node Sets'])
        item = QStandardItem("Opc.Ua.NodeSet2.xml")
        item.setFlags(Qt.NoItemFlags)
        self.model.appendRow([item])
        self.view.expandAll() 
开发者ID:FreeOpcUa,项目名称:opcua-modeler,代码行数:11,代码来源:refnodesets_widget.py

示例4: flags

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def flags(self, index):
        if not index.isValid():
            return Qt.NoItemFlags

        return Qt.ItemIsEnabled | Qt.ItemIsSelectable 
开发者ID:dragondjf,项目名称:QMusic,代码行数:7,代码来源:treemodel.py

示例5: flags

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def flags(self, index):
        if not index.isValid():
            return Qt.NoItemFlags

        return Qt.ItemIsEnabled | Qt.ItemIsUserCheckable 
开发者ID:borgbase,项目名称:vorta,代码行数:7,代码来源:extract_dialog.py

示例6: flags

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def flags(self, index):
        if not index.isValid():
            return Qt.NoItemFlags
        return Qt.ItemIsEnabled 
开发者ID:borgbase,项目名称:vorta,代码行数:6,代码来源:diff_result.py

示例7: flags

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def flags(self, index):
            if not index.isValid():
                return Qt.NoItemFlags

            try:
                _ = self.checksum_label.data_ranges[index.row()]
            except IndexError:
                return Qt.NoItemFlags

            return Qt.ItemIsEditable | Qt.ItemIsEnabled | Qt.ItemIsSelectable 
开发者ID:jopohl,项目名称:urh,代码行数:12,代码来源:ChecksumWidget.py

示例8: flags

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def flags(self, index):
        if not index.isValid():
            return Qt.NoItemFlags

        try:
            _ = self.message_type[index.row()]
        except IndexError:
            return Qt.NoItemFlags

        return Qt.ItemIsEditable | Qt.ItemIsEnabled | Qt.ItemIsSelectable 
开发者ID:jopohl,项目名称:urh,代码行数:12,代码来源:PLabelTableModel.py

示例9: flags

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def flags(self, index: QModelIndex):
        if not index.isValid():
            return Qt.NoItemFlags

        return Qt.ItemIsEditable | Qt.ItemIsEnabled | Qt.ItemIsSelectable 
开发者ID:jopohl,项目名称:urh,代码行数:7,代码来源:ParticipantTableModel.py

示例10: conteudoTabela

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def conteudoTabela(self, tabela, row, col, data):
        item = QtWidgets.QTableWidgetItem()
        item.setTextAlignment(Qt.AlignJustify |
                              Qt.AlignHCenter | Qt.AlignVCenter)
        item.setFlags(Qt.NoItemFlags)
        item.setText(data)
        tabela.setItem(row, col, item)

    # Conteudo tabela alinhado a esquerda 
开发者ID:andrersp,项目名称:controleEstoque,代码行数:11,代码来源:main.py

示例11: conteudoTabelaLeft

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def conteudoTabelaLeft(self, tabela, row, col, data):
        item = QtWidgets.QTableWidgetItem()
        item.setTextAlignment(Qt.AlignJustify |
                              Qt.AlignLeft | Qt.AlignVCenter)
        item.setFlags(Qt.NoItemFlags)
        item.setText(data)
        tabela.setItem(row, col, item)

    # Botão Tabela 
开发者ID:andrersp,项目名称:controleEstoque,代码行数:11,代码来源:main.py

示例12: botaoTabela

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def botaoTabela(self, tabela, row, col, funcao, bg):
        item = QtWidgets.QPushButton()
        # item.setFixedWidth(30)
        # item.setFixedHeight(30)
        item.setCursor(QtGui.QCursor(Qt.PointingHandCursor))
        item.setFocusPolicy(Qt.NoFocus)
        item.setFlat(Qt.NoItemFlags)
        item.setStyleSheet("QPushButton{\n"
                           "background-color: #1E87F0;\n"
                           "border-radius: 2px;\n"
                           "padding: 2px;\n"
                           "color: #FFF;\n"
                           "font: 10px \"Tahoma\" Bold\n"
                           "}\n"
                           "QPushButton:hover{\n"
                           "background-color: #40a286\n"
                           "}")
        item.setText("EDITAR")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(
            self.resourcepath('Images/editar.png')), 
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        item.setIcon(icon1)
        tabela.setCellWidget(row, col, item)
        item.clicked.connect(funcao)

    # Botão Remove Item 
开发者ID:andrersp,项目名称:controleEstoque,代码行数:29,代码来源:main.py

示例13: botaoRemoveItem

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def botaoRemoveItem(self, tabela, row, col, funcao, bg):
        item = QtWidgets.QPushButton()
        # item.setFixedWidth(30)
        # item.setFixedHeight(30)
        item.setCursor(QtGui.QCursor(Qt.PointingHandCursor))
        item.setFocusPolicy(Qt.NoFocus)
        item.setFlat(Qt.NoItemFlags)
        item.setStyleSheet("QPushButton{\n"
                           "background-color: " + bg + ";\n"
                           "border-radius: 2px;\n"
                           "padding: 2px;\n"
                           "}\n"
                           "QPushButton:hover{\n"
                           "background-color: #40a286\n"
                           "}")
        item.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(
            self.resourcepath('Images/edit-delete.png')), 
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        item.setIcon(icon1)
        tabela.setCellWidget(row, col, item)
        item.clicked.connect(funcao)

    
    # data e Status entrega tabela compra / venda 
开发者ID:andrersp,项目名称:controleEstoque,代码行数:28,代码来源:main.py

示例14: botaoReceberParcela

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def botaoReceberParcela(self, tabela, row, col, funcao, texto, status):
        item = QtWidgets.QPushButton()
        # item.setFixedWidth(70)
        # item.setFixedHeight(30)
        item.setCursor(QtGui.QCursor(Qt.PointingHandCursor))
        if status == 1:
            item.setDisabled(True)
        item.setFocusPolicy(Qt.NoFocus)
        item.setFlat(Qt.NoItemFlags)
        item.setStyleSheet("QPushButton{\n"
                           "background-color: #7AB32E;\n"
                           "border-radius: 2px;\n"
                           "padding: 2px;\n"
                           "border: none;\n"
                           "text-transform: uppercase;\n"
                           "font: 10px \"Arial\";\n"
                           "}\n"
                           "QPushButton:hover{\n"
                           "background-color: #40a286\n"
                           "}"
                           )
        item.setText(texto)
        font = QtGui.QFont()
        font.setFamily("Tahoma")
        font.setPointSize(10)
        item.setFont(font)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(
            self.resourcepath('Images/money.png')), 
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        item.setIcon(icon1)
        tabela.setCellWidget(row, col, item)
        item.clicked.connect(funcao)


    # Input receber/pagar parcela  compra e venda 
开发者ID:andrersp,项目名称:controleEstoque,代码行数:38,代码来源:main.py

示例15: _process_row

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoItemFlags [as 别名]
def _process_row(self, y, row):
        cols = self.columnCount()
        for x, i in enumerate(range(0, len(row), self._width)):
            block = row[i:i+self._width]
            item = QTableWidgetItem(codecs.encode(block, 'hex').decode())
            if block in bytes(string.printable, 'ascii'):
                item.setFont(self.bold_font)
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            item.setData(Qt.UserRole, block)  # store original data
            if self._read_only:
                item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
            else:
                item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsEditable)
            self.setItem(y, x, item)

        # process remaining, unfilled cells
        for j in range(x+1, cols):
            item = QTableWidgetItem()
            item.setFlags(Qt.NoItemFlags)
            item.setTextAlignment(Qt.AlignHCenter)
            self.setItem(y, j, item)

        text = self._bytes_to_ascii(row)
        item = QTableWidgetItem(text)
        item.setFlags(Qt.NoItemFlags)
        text_widget = QPlainTextEdit()
        # Prevent vertical scrollbars in ASCII view
        def _fix_widget_size():
            if text_widget.verticalScrollBar():
                text_widget.setMinimumWidth(text_widget.width() + 25)
        text_widget.textChanged.connect(_fix_widget_size)
        text_widget.setReadOnly(True)
        text_widget.setFrameStyle(QFrame.NoFrame)
        text_widget.setPlainText(text)
        text_widget.setFont(self.ascii_font)
        text_widget.setLineWrapMode(QPlainTextEdit.NoWrap)
        text_widget.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.setColumnWidth(cols - 1, 250)
        if self._read_only:
            item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
        else:
            item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsEditable)
        item.setFlags(Qt.NoItemFlags)
        self.setCellWidget(y, cols - 1, text_widget) 
开发者ID:takeshixx,项目名称:deen,代码行数:46,代码来源:hex.py


注:本文中的PyQt5.QtCore.Qt.NoItemFlags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。