В фреймворке 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
In a situation where the market is not in a good condition, #TRXUSDT's trend is still upward.
After reaching the bottom of the channel and the support level of $0.1100-0.1050, the price started to grow and first broke the small dynamic resistance.
According to the general situation of this currency and the registered candles, it can be expected that the price will grow again up to the ceiling of the channel.
Signal for a futures trade
#TRXUSDT.P
📌 Logged into SHORT
Entry: ±$0.08521
Take profit: $0.084; $0.082; $0.0805
Stop loss: $0.0867
The price broke through the trend support and left the bottom. Also against the downside is a “flat-bottomed triangle” formation. I expect the decline to continue.