Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1159

QCheckBox.setChecked(True) appears different from checkbox clicked by user.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.13.2
    • PySide
    • None
    • I am on MacOS with Python 3.7, pyqt version 5.13.0, qt version 5.13.0
    • macOS

    Description

      This is described completely in this stack overflow item with source code and solutions. The answerer pointed out that the problem did not exist in 5.10.1 but fails in 5.13.2 and suggested I report it here.

      Here is a brief summary based on the image below,

      If I use QCheckBox.setChecked(True) to initialize a box to "checked" before the application is running the blue background in the box is missing as in "set with Python code" in the image. But if the user checks the box then the blue background is present, as in "Set by user clicking".

      A workaround is to use 

      QTimer.singleShot(500, lambda: self.setwithPythoncode.setChecked(True))

      Apparently, during the 500 msec delay the setup code completes and the application has reached the running state.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            wrishel Wesley Rishel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes