В фреймворке 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
On the Morrigan
The Morrigan is the Celtic archetype of Maiden, Mother & Crone. She the goddess of faith and death.
After battle, she would fly over the bodies of the fallen in form of a raven and sing mystic runic songs. Brave soldiers would obtain a protection amulet from her.
As with many female deities like Cybele, Kali or Hathor, we must seek the origin of the Morrigan in remote antiquity, when there was a specific incident which defined the archetype of the beautiful woman with a magical or terrible aspect.
#goddess#celtic
@EuropeanTribalism
Эксперимент с расширением и многоуровневым апскейлом в Стабле из оригинальной пикчи из Далле-3
Считаю, что прошёл неплохо, оригинальная пнг аж 18.5 мегабайта)
By Voodoont
#voodoont
#арт#art#ai#girl#space#goddess#celestial#sun#solarpunk#upscale