В фреймворке 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
🎈Hot App This Week🎈
🚀💰#Pi Network Has A New Competitor: #InterLink!⛏️⚡
[🔗InterLink Network]📌Released on Jul 15, 2025
✅Biometric face scan🤳 + liveness
✅Collections of mobile games 🎮🕹️
❌Small user base. 10 billion coin supply limit
[🔗Pi Network]📌Released on Mar 14, 2019
✅Wide global user base
✅100 billion coin supply limit
❌Many unverified users
Pick your desired bitcoin miner and start your crypto mining, earning, and trading TODAY!
Add @APKFreeDownloader_Bot to get any apk you want.
🔤🔤🔤🔤🔤🔤🔤🔤🔤
All of you already heard about Pi and its price. If you still don't have it, join Pi network and earn tokens.
Pi network - link
#Pi#Binance#Pinetwork
✨
✨#BANANAS31#PI#EVAA trades in VIP channel📈📈
We're here to help you recover your losses!
Step by step, no rush, but I will turn your losses into profit 👌🏼⚡️
😄
😄@CryptoBull_360_admin☑️
Mathematicians found that many formulas used to calculate π are connected.
About 43% of known π formulas come from one main form. Another 51% belong to related groups.
This shows many π formulas are not separate. They share common structures in math.
π is still an infinite number with no repeating digits.
📐🧠➗
[Read more]
@googlefactss
#math#pi#mathematics#science#facts