ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

snapshot for October 2021
‹ October 2021 ›×
hello, everyone! I'm trying to change the state of a checkbox, but it always return as checked. Is there anything wrong if the code bellow? if isinstance(child, QCheckBox) and child.isChecked() is True: child.setChecked(Qt.Unchecked) print(child.isChecked())
R
this is the output: <class 'PySide6.QtWidgets.QCheckBox'> True
Ë
Are you listening to a clicked signal and accidentally set it to False again? 🤔
R
Hmm... I have to double check, but I believe I don't, since there's only one check box marked because it's an exclusive group.
K
Hmm seems odd. Try using toggle() method to set the checkbox checked (after you check the value) and see if that works? Another thing you could try is access the state via the checked property. Afaik that is a property.
K
Hmm this might be a PySide bug... It should probably fail if you pass something other than a boolean, though I'm not sure. Oftentimes you want to coerce something to a boolean. @cmaureir thoughts? The issue is calling QCheckBox::setChecked(Qt.Unchecked) doesn't fail (I think it sets the checkbox to checked).
if your checkbox doesn't appear unchecked after cb.setChecked(False) it's pretty major
what does cb.checkState() return ?
I
can you try cb.setCheckState(Qt.Unchecked) ?
Non-exclusive checkbox work as expected.
I'm using PySide6, though I'm not sure which version
R
I can work with the values on the back, setting to None the correspondent variables. But it would be nice to have this visual feedback to the user.
Calendar: October 2021
Archive by month
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog