當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。