В фреймворке 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
#DODO/USDT analysis :
#DODO is currently in a downtrend, trading below the 200 EMA. Following an impulsive move, a retracement is underway. Price is expected to revert from the current level and move upward to test previous highs and the 200 EMA. Wait for a pullback in price for a long entry.
TF : 30min
Entry : $0.1200
Target : $0.1304
SL : $0.1150
#DODO result
1st target achieved in just 9 hours✅
One more quick profit 8%💰🤑
👉 More quick profit signals available in premium channel. Hurry up 🏃♂👇
☎️ Contact @FutureExpertAdmin
🌎 The dodo bird, once native to Mauritius, vanished by the late 17th century. Little was documented about its appearance or habits, leaving scientists puzzled. Recent studies of preserved bones and rare historical notes suggest the dodo was likely grayish with small wings and weighed up to 18 kilograms. ✨
#dodo⚡#extinction⚡#mysteries
👉subscribe Interesting Planet