В фреймворке 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
#IOTA/USDT analysis :
#IOTA bounced off the tested support zone with strong volume. A breakout above the trendline is expected, resuming its uptrend. Watch for a break above the $0.4870 level to consider going long. The outlook remains bullish.
TF : 1H
Entry : $0.4870
Target : $0.6000
SL : $0.4212
#IOTA/USDT analysis :
#IOTA is currently consolidating sideways within the support and resistance zones. The price has recently bounced back from the support zone and is expected to continue its momentum to test the resistance zone.
TF : 1D
Entry : $0.1250
Target : $0.1443
SL : $0.1127
#IOTA/USDT analysis -
#IOTA is in a downtrend on the lower time frame, trading below the 200 EMA. Following a corrective pullback, the price is currently holding the support level. A breakdown of this support has triggered an entry in the price, leading to a continuation of the bearish trend. The previous low will be the target level.
TF : 1h
Entry : $0.1670
Target : $0.1493
SL : $0.1797
🔎#IOTA - Новый цикл ?
В 18 декабря представил глобальный расклад по монете IOTA
Спустя 2 месяца монета пришла в зону покупки и сейчас показывает себя отлично чтобы продолжить свой рост
В ближайшие 3 месяца жду рост до уровня 0.45
💻https://ru.tradingview.com/chart/IOTAUSDT/K4o0pgo9-iota-novyj-tsikl/
Как вам эта инвест идея ? пишите в комментарии
Торгуйте с умом
@ProfessorKlinkov