В фреймворке 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
⚡️Storm Trade: Join the Trading Tournament for $5,000 in Prizes
#Jetton#trades
Storm Trade is hosting a trading tournament with a $5,000 prize pool in partnership with Jetton. Open to those who meet the entry requirements, the tournament runs from April 28 to May 7. Participants can trade to climb the leaderboard and win big.
Source: link
@tonlines
DEPO - #INFOGRAPHICS
Over-the-month brief overview on key depository indicators assembled by the Central Securities Depository, as well as on stock exchange and OTC trading results.
#brief#depo#infographics#statistics#changes#stockexchange#trades
deponet.uz|Tg|Fb|Inst|Youtube
DEPO - #INFOGRAPHICS
Over-the-month brief overview on key depository indicators assembled by the Central Securities Depository, as well as on stock exchange and OTC trading results.
#brief#depo#infographics#statistics#changes#stockexchange#trades
deponet.uz|Tg|Fb|Inst|Youtube
DEPO - #INFOGRAPHICS
Over-the-month brief overview on key depository indicators assembled by the Central Securities Depository, as well as on stock exchange and OTC trading results.
#brief#depo#infographics#statistics#changes#stockexchange#trades
deponet.uz|Tg|Fb|Inst|Youtube