Python qtpy.QtWidgets.QCheckBox() Examples

The following are 5 code examples of qtpy.QtWidgets.QCheckBox(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module qtpy.QtWidgets , or try the search function .
Example #1
Source File: QLinkableWidgets.py    From pylustrator with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #2
Source File: attribute_widgets.py    From pyrpl with GNU General Public License v3.0 5 votes vote down vote up
def _make_widget(self):
        self.widget = QtWidgets.QCheckBox()
        self.widget.stateChanged.connect(self.write_widget_value_to_attribute) 
Example #3
Source File: attribute_widgets.py    From pyrpl with GNU General Public License v3.0 5 votes vote down vote up
def _make_widget(self):
        """
        Sets the widget (here a QCheckbox)
        :return:
        """
        self.widget = QtWidgets.QCheckBox()
        self.widget.setTristate(True)
        self.widget.stateChanged.connect(self.write_widget_value_to_attribute)
        self.setToolTip("Checked:\t    on\nUnchecked: off\nGrey:\t    ignore") 
Example #4
Source File: SubmitChangeWindow.py    From P4VFX with MIT License 4 votes vote down vote up
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 
Example #5
Source File: SubmitChangeWindow.py    From P4VFX with MIT License 4 votes vote down vote up
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