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


Python QtWidgets.QCheckBox方法代码示例

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


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

示例1: CreateWidget

# 需要导入模块: from Qt import QtWidgets [as 别名]
# 或者: from Qt.QtWidgets import QCheckBox [as 别名]
def CreateWidget(info):
        name, label, parm_type, default = info

        if parm_type is medic.Types.Null or\
           parm_type is medic.Types.BoolArray or\
           parm_type is medic.Types.IntArray or\
           parm_type is medic.Types.FloatArray or\
           parm_type is medic.Types.StringArray:
            print("This type parameter is not supported yet : %s" % parm_type)
            return None, None

        widget = None
        function = None

        if parm_type == medic.Types.Bool:
            widget = QtWidgets.QCheckBox()
            widget.setChecked(default)
            function = ParameterFunctions.SetBool

        elif parm_type == medic.Types.Int:
            widget = NumericLine.CreateIntLine()
            widget.setText(str(default))
            function = ParameterFunctions.SetInt

        elif parm_type == medic.Types.Float:
            widget = NumericLine.CreateFloatLine()
            widget.setText(str(default))
            function = ParameterFunctions.SetFloat

        elif parm_type == medic.Types.String:
            widget = QtWidgets.QLineEdit()
            widget.setText(default)
            function = ParameterFunctions.SetString

        widget.setObjectName("parameter_widget")

        return widget, function 
开发者ID:sol-ansano-kim,项目名称:medic,代码行数:39,代码来源:widgets.py

示例2: __makeWidgets

# 需要导入模块: from Qt import QtWidgets [as 别名]
# 或者: from Qt.QtWidgets import QCheckBox [as 别名]
def __makeWidgets(self):
        main_layout = QtWidgets.QVBoxLayout()
        main_layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(main_layout)

        horizon_layout = QtWidgets.QHBoxLayout()
        horizon_layout.setSpacing(10)
        horizon_layout.setContentsMargins(0, 0, 0, 0)
        self.__browser_button_widget = BrowserButtonWidget()
        self.reset_button = QtWidgets.QPushButton()
        self.test_button = QtWidgets.QPushButton()
        self.selection_only_check = QtWidgets.QCheckBox()
        self.reset_button.setObjectName("reset_button")
        self.test_button.setObjectName("test_button")
        self.selection_only_check.setObjectName("selection_check")
        self.status_label = StatusLabel()
        self.__current_karte_label = CurrentKarteLabel()

        self.__phase_items[1] = [self.reset_button, self.test_button, self.selection_only_check, self.status_label]
        
        horizon_layout.addWidget(self.__browser_button_widget)
        horizon_layout.addSpacing(20)
        horizon_layout.addWidget(self.reset_button)
        horizon_layout.addWidget(self.test_button)
        horizon_layout.addWidget(self.selection_only_check)
        horizon_layout.addWidget(self.status_label)
        horizon_layout.addStretch(9999)
        horizon_layout.addWidget(self.__current_karte_label)

        main_layout.addLayout(horizon_layout)

        self.__browser_button_widget.BackClicked.connect(self.BackClicked.emit)
        self.__browser_button_widget.NextClicked.connect(self.NextClicked.emit)
        self.selection_only_check.stateChanged.connect(self.__selectionOnlyChanged) 
开发者ID:sol-ansano-kim,项目名称:medic,代码行数:36,代码来源:widgets.py

示例3: setupUi

# 需要导入模块: from Qt import QtWidgets [as 别名]
# 或者: from Qt.QtWidgets import QCheckBox [as 别名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(168, 75)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        self.verticalLayout = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSpacing(7)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.lePinName = QtWidgets.QLineEdit(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.lePinName.sizePolicy().hasHeightForWidth())
        self.lePinName.setSizePolicy(sizePolicy)
        self.lePinName.setMinimumSize(QtCore.QSize(0, 0))
        self.lePinName.setMaximumSize(QtCore.QSize(60, 16777215))
        self.lePinName.setObjectName("lePinName")
        self.horizontalLayout.addWidget(self.lePinName)
        self.cbType = QtWidgets.QComboBox(Form)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.cbType.sizePolicy().hasHeightForWidth())
        self.cbType.setSizePolicy(sizePolicy)
        self.cbType.setObjectName("cbType")
        self.horizontalLayout.addWidget(self.cbType)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.cbHideLabel = QtWidgets.QCheckBox(Form)
        self.cbHideLabel.setObjectName("cbHideLabel")
        self.horizontalLayout_2.addWidget(self.cbHideLabel)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.verticalLayout.addLayout(self.horizontalLayout_2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
开发者ID:wonderworks-software,项目名称:PyFlow,代码行数:46,代码来源:PinWidget_ui.py


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