В фреймворке 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
#SHIB/USDT analysis :
The price of #SHIB has recently broken out of its trendline, indicating a potential bullish momentum. While a retracement to the 200 EMA is expected, the overall sentiment suggests that the price is likely to move upwards and test the swing high level.
TF : 4h
Entry : $0.00001480
Target : $0.00001734
SL : $0.00001313
#SHIB/USDT analysis :
#SHIB has successfully broken out of the trendline, demonstrating a strong bullish movement. It is anticipated that this upward momentum will continue, allowing the price to test higher levels.
TF : 1D
Entry : $0.00002536
Target : $0.00004567
SL : $0.00001827
#SHIB -%5 in 6hrs 🤑🤑
Algorithmic bots on our Discord server print us instant money.
Thanks to Hey CoinLegs signals, we were able to catch short-term signals instantly.
Join us to get access to these and many other algorithmic auto signals 👇
https://discord.gg/8RKtAA9cxZ