В фреймворке 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
📊#XVG – POSITION UPDATE
Placed initial bids in the $0.0076 – $0.0078 zone.
This area is acting as a key decision level.
If the weekly candle closes above $0.0078, it would mark the first confirmed breakout since 2024.
In that case, continuation setups will be considered.
Until then, patience matters.
#XVG/USDT analysis :
#XVG is currently consolidating sideways. The price has tested and held support. A rebound from this support level is anticipated, with the target being the resistance level.
TF : 4h
Entry : $0.005600
Target : $0.007415
SL : $0.004360
✅✅ 27% Profit on #XVG/USDT for our Premium Members on Binance Futures, ByBit USDT, KuCoin Futures, OKX Futures
👁🗨Contact @primemod to enter the Premium Group & make daily profit on SPOT & FUTURES Signals