В фреймворке 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
⚡️Catizen Announcement: COC Wipe Test Now Live!
#Diamonds#COC
The Catizen Announcement channel reveals the launch of the COC Wipe Test. Participants can try it first and earn 2x Diamonds for every USD spent during the test, redeemable at the official launch.
Source: link
@tonlines
🌎 A layer of diamond rain may fall deep within Neptune and Uranus! Under immense pressure, methane breaks apart, causing carbon atoms to form glittering diamond crystals that drift towards the core. ✨
#planets⚡#diamonds⚡#methane
👉subscribe Interesting Planet
🎈Hot Game This Week🎈
🐲Dusk of Dragons: Survivor🔥🔥🔥
📌Developed by 🔗Core Games
🚀#June 19 | Countdown!!!
From #diamonds to dragon #coins, the Dusk of Dragons codes can help boost your inventory, increase your levelups, and make your adventure across Libida even more thrilling!!!
The 100 diamonds and 500 dragon coins are yours after redeeming this code: 👇👇👇
🎁【 APKPURE 】🎁[Valid for Limited Time!]
*Expires on 6/30‼️
🕹️Get Access to Dusk of Dragons June 30 Update
Add @APKFreeDownloader_Bot to get any apk you want.