В фреймворке 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
#POND/USDT analysis :
#POND has shown a strong recovery from the support zone following a significant decline of -77% from its all-time high (ATH). The price has also successfully broken above the trendline that was previously acting as resistance, indicating a likely continuation of its bullish momentum toward reaching new all-time highs. A potential gain of +120% is anticipated from the current levels.
TF : 1W
Entry : $0.01966
Target : $0.04240
SL : $0.01358
#POND👀
CoinLegs algorithm detected Symmetrical Triangle at 1h chart 📊
Seems like we got a breakout. Stop Loss below the trendline 🛑
Target levels are on the charts.
#POND result
3rd target achieved in just 12 days ✅✅✅
One more huge quick profit 21.9%🤑💰🤑
👉 Still thinking? The more you wait more you lose profit
☎️ Contact @MichaelStrategiesVip for membership and grab next breakout signal
#POND result
1st target achieved in just 1 day✅
One more quick profit 7%💰🤑
👉 More quick profit signals available in premium channel. Hurry up 🏃♂👇
☎️ Contact @MichaelStrategiesVip