В фреймворке 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 would-be #assassin of #Slovakian PM Robert #Fico has been identified as 71 year old Juraj #Cintula
He is alleged to be a supporter of the "#ProgressiveSlovakia" (PS) political party.
PS is pro-: neoliberalism, Eurocentrism, rearmament, #Russia sanctions and open borders.
Basically your average treacherous European-centrist party.
The 1st video above is from 2016, when Cintula was working for the security company #SBS and was briefly in the press because he had overpowered a rioter.
The 2nd video seems to have been taken today, 15th of May 2024, shortly after he was apprehended by Slovakian #Police, and appears to be videoed in either a Hospital or in a Police Station
Cintula is explaining his motives for shooting Fico
#Slovakian prime minister Robert #Fico shot and rushed to hospital after ‘attempted assassination’
Fico was shot in the town of #Handlova with a man detained at the scene
•In 2022 and 2023, Fico was a loud critic of the #VonderLeyen Commission and her foreign and #military policies in relation to #Russian invasion of #Ukraine.
He also expressed disagreements with the Commission in questions of #immigration.
•In December 2023, Fico criticized the "hypocrisy" of the EU, which was reluctant to talk about #Israeli#WarCrimes in #Gaza
•In 2023, Fico said #Ukraine's #Azov Battalion was "clearly a #fascist regiment".
•During a rally on 30 August, he also said that the War in Donbas started in 2014 when "Ukrainian #Nazis and fascists started murdering the Russian population of #Donbas"