В фреймворке 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
#SIGN/USDT 🔥🔥
Leverage: Cross (10.00X)
Buy Zone: 0.0410–0.0450
TP1: 0.0505
TP2: 0.0558
TP3: 0.0615
TP4: 0.0690
TP5: 0.0780
SL: below 0.0375
From a fundamental perspective, $SIGN has seen increased market attention due to rising trading volume and liquidity on Binance, with strong recent growth performance over the past 30 days. Additionally, Binance has also launched a CreatorPad campaign for $SIGN recently, aiming to boost community engagement and user participation through reward-based activities, which can increase visibility and short-term trading momentum around the token.
🗣#Sign – Join the Potential Airdrop
Backed by $29M from Binance (Incubation), Sequoia, HashKey, and Circle.
What to do:
✔️ Visit the site
✔️ Go to “Profile” and click “Create Schema”
✔️ Randomly click through all fields
✔️ Mint in low-cost networks (Polygon costs ~0.01$)
🟠 Rewards: Potential airdrop
🟠 Deadline: TBA
🟠 Expenses: 0.01$ – 1$
🟠 Low costs but huge investment ($29M from top-tier funds).
☝️ Start trading on Bybit
Crypto Drop Club 👉 SUBSCRIBE