В фреймворке 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
🚀 Back to Back profits are made in the Premium Group
🎯🎯#C98/USDT has covered all the target to give a Profit of 22% to all Premium Members
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gain
#C98/USDT analysis :
#C98 is currently in a bearish trend, consistently making new lows. The price is expected to test the resistance zone before resuming its bearish momentum.
TF : 1h
Entry : $0.0872
Target : $0.0822
SL : $0.0900
#C98
Coin98 has successfully broken above the descendingchannel formation on the daily timeframe👀
Now, the price is holding above the previous resistance-turned-supportlevel
A bounce from the support zone could push the price toward targets at $0.077, $0.093, and $0.130
#C98 result
1st target achieved in just 15 hours✅
One more quick profit 6%💰🤑
👉 More quick profit signals available in premium channel. Hurry up 🏃♂👇
☎️ Contact @FutureExpertAdmin