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


Python QtWidgets.QCheckBox方法代码示例

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


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

示例1: __init__

# 需要导入模块: from qtpy import QtWidgets [as 别名]
# 或者: from qtpy.QtWidgets import QCheckBox [as 别名]
def __init__(self, layout: QtWidgets.QLabel, text: str):
        """ a widget that contains a checkbox with a label

        Args:
            layout: the layout to which to add the widget
            text: the label text
        """
        QtWidgets.QWidget.__init__(self)
        layout.addWidget(self)
        self.layout = QtWidgets.QHBoxLayout(self)
        self.label = QtWidgets.QLabel(text)
        self.layout.addWidget(self.label)
        self.layout.setContentsMargins(0, 0, 0, 0)

        self.input1 = QtWidgets.QCheckBox()
        self.input1.setTristate(False)
        self.input1.stateChanged.connect(self.onStateChanged)
        self.layout.addWidget(self.input1) 
开发者ID:rgerum,项目名称:pylustrator,代码行数:20,代码来源:QLinkableWidgets.py

示例2: _make_widget

# 需要导入模块: from qtpy import QtWidgets [as 别名]
# 或者: from qtpy.QtWidgets import QCheckBox [as 别名]
def _make_widget(self):
        self.widget = QtWidgets.QCheckBox()
        self.widget.stateChanged.connect(self.write_widget_value_to_attribute) 
开发者ID:lneuhaus,项目名称:pyrpl,代码行数:5,代码来源:attribute_widgets.py

示例3: on_submit

# 需要导入模块: from qtpy import QtWidgets [as 别名]
# 或者: from qtpy.QtWidgets import QCheckBox [as 别名]
def on_submit(self):
        if not self.validateText():
            QtWidgets.QMessageBox.warning(
                interop.main_parent_window(), "Submit Warning", "No valid description entered")
            return

        files = []
        for i in range(self.tableWidget.rowCount()):
            cellWidget = self.tableWidget.cellWidget(i, 0)
            if cellWidget.findChild(QtWidgets.QCheckBox).checkState() == QtCore.Qt.Checked:
                files.append(self.fileList[i]['File'])

        keepCheckedOut = self.chkboxLockedWidget.checkState()

        progress = SubmitProgressUI(len(files))
        progress.create("Submit Progress")

        callback = TestOutputAndProgress(progress)

        progress.show()

        # self.p4.progress = callback
        # self.p4.handler = callback

        # Remove student setting from Maya .ma files
        # @ToDo make this a generic callback
        # for submitFile in files:
        #     if ".ma" in submitFile:
        #         try:
        #             pathData = self.p4.run_where(submitFile)[0]
        #             Utils.removeStudentTag(pathData['path'])
        #         except P4Exception as e:
        #             print e


        try:
            CmdsChangelist.submitChange(self.p4, files, str(
                self.descriptionWidget.toPlainText()), callback, keepCheckedOut)
            if not keepCheckedOut:
                clientFiles = []
                for file in files:
                    try:
                        path = self.p4.run_fstat(file)[0]
                        clientFiles.append(path['clientFile'])
                    except P4Exception as e:
                        displayErrorUI(e)

                # Bug with windows, doesn't make files writable on submit for
                # some reason
                Utils.removeReadOnlyBit(clientFiles)
            self.close()
        except P4Exception as e:
            self.p4.progress = None
            self.p4.handler = None
            displayErrorUI(e)

        progress.close()

        self.p4.progress = None
        self.p4.handler = None 
开发者ID:TomMinor,项目名称:P4VFX,代码行数:62,代码来源:SubmitChangeWindow.py


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