В фреймворке 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
🚀 Huge profits are made in the Premium Group
🎯🎯#ONT/USDT has covered all the target to give a Profit of 220% to all Premium Members
👁🗨Contact @futurechief to enter the Premium Futures & SPOT Group for daily gain
#ONT/USDT analysis :
#ONT has successfully broken out and is currently testing a previously respected resistance zone. The price has rebounded from this zone, and it is expected to resume its upward momentum, aiming to test previous highs.
TF : 1D
Entry : $0.2595
Target : $0.3900
SL : $0.2050
#ONT/USDT analysis -
#ONT be in downtrend trading below 200ema. After a corrective pullback, price retraced to 200ema and getting rejected. It is expected to drop from current level and test previous lows.
TF : 4H
Entry : $0.2013
Target : $0.1597
SL : $0.2125