В фреймворке PyQt (и PySide тоже) часто встречается настройка чего-либо с помощью так называемых флагов.
widget.setWindowFlags(Qt.Window)
Взаимодействие нескольких флагов делается с помощью бинарных (или побитовых) операторов.
Несколько флагов можно указать с помощью оператора "|"
list_item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
исключить флаг из уже имеющегося набора можно так
list_item.setFlags(list_item.flags() ^ Qt.ItemIsEnabled)
Добавить новый флаг к имеющимся можно так
list_item.setFlags(list_item.flags() | Qt.ItemIsEnabled)
А проверка наличия делается так
is_enabled = item.flags() & Qt.ItemIsEnabled > 0
Почему именно так? Всё дело в том как именно работают побитовые операторы. Но об этом в следующем посте.
#qt
#AnimeBytes#AB#Transmission
We have taken a very hard decision to disable Transmission in version 4.0.6 due to outstanding bug where announces are seen as failed and retried consequently against tracker, increasing load on it. You can follow the issue as reported on GitHub. Please note that this is unrelated to recent issue with libcurl crashes, this is a logical bug in how client handles announces to tracker.
We recommend you downgrade to 4.0.5 which does not exhibit this behavior.
小编注:同样的 4.0.6 问题,虽然 BLU 与 HDB 公告说会恢复此版本,但建议各位直接跳过此版本。