В фреймворке 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 July 1, 2024 , a law comes into force that provides for a 20% indexation of state fees. So from 1 July, state fees for a number of state services will increase:
🔸 Temporary residence permit: from 1600 to 1920 Rubles;
🔸 Residence permit: from 5000 to 6000 Rubles;
🔸 Russian citizenship: from 3500 to 4200 Rubles;
🔸 Registration at the place of residence: from 350 to 420 Rubles;
🔸 Visa renewal: from 1000 to 1200 Rubles;
🔸 Issuance of invitations to the Russian Federation: from 800 to 960 Rubles;
🔸 Work permit: from 3500 to 4200 Rubles;
🔸 Permit to hire foreign workers: from 10,000 to 12,000 Rubles;
🔸 Travel passport; from 5000 to 6000 Rubles;
🔸 Travel passport up to 14 years old: from 2500 to 3000 Rubles.
❗️ Make all relevant applications before 1 July, to avoid paying the new rate.
#state_fee#госпошлина#TRP#RP#RVP#VNZH#citizenship#nido#nidorussia
Subscribe: @nido_russia
https://t.me/nido_russia/1661