В фреймворке 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
💍The #Ministry of #Finance proposed to increase the state duty for divorce from 650₽ to 5,000₽ (by almost 8 times)
📛 For state registration of a name change, including the issuance of a name change certificate - from 1,600 rubles. up to 5000 rubles.
🧑🎓For the issuance of a certificate, certificate or other document confirming the level of qualification, or its duplicate due to loss, the fee will rise from 1300 rubles. up to 2000 rub.
👮 For consideration of a petition provided for by antimonopoly legislation - from 35 thousand rubles. up to 400 thousand rubles.
🚔 For consideration of an application provided for by the legislation on natural monopolies - from 16 thousand rubles. up to 50 thousand rubles.
Subscribe: @nido_russia
https://t.me/nido_russia/1666
#stateduties#госпошлина#fees#tax#fines
Долго смаковал в ожидании нужного момента и вот посмотрел. Кайф! Вроде и знал всё об истории этой культовой в своё время тусовки, но некоторые факты открылись впервые. И конечно яркий документ эпохи, когда лейблы формировали музыкальную сцену, стимулируя к творчеству и воспитывая вкус у слушателя. Рекомендую всем неравнодушным ⚡
#ministry#revoltingcocks#kmfdm#meatbeatmanifesto#theklf#younggods#cubanate#coil#front242#etc