В фреймворке 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
The Wait is Over — Hot Devil Slot is Here! 😈
Kick off our HOT Series with a spin that’s hotter than your ex and easily twice as fun. Ready to play with fire or just here to warm up? With classic gameplay turned up to inferno levels, every spin is destined to thrill.
Let the games begin! 🔥
🍒 IGNITE THE FUN: https://play.truelab.games/game/hot-devil-slot-v1/static/index.html
#HotDevilSlot#OUTNOW#igamingnews#TrueLab#TrueSlots#TrueGames
🔞 | Play Responsibly
The clocks are ticking down, and things are heating up! We're now only 2 days away from the launch of HOT DEVIL SLOT, the first of 3 titles to form part of our classic-inspired HOT SERIES! 🔥
🗓️ Let's raise a little hell come Wednesday 8th May! 😈
#HotDevilSlot#HotSeries#OutSoon#NewSlots#TrueLab#TrueSlots#TrueGames
HOT DEVIL SLOT kicks off the TrueLab HOT SERIES, blending iconic fruit and fire elements with an eye-poppingly sexy modern twist. All the goodness from the classics, reinvented with modern graphics, variable lines to vary hit rate and volatility and a gamble feature to really up the ante on those fiery hot sessions.
🗓️ Debuting: May 8th. Time to rediscover that classic feeling.
🎰 Demo is comin' in HOT! Stay tuned!
#HotDevilSlot#ComingSoon#OnlineSlots#iGamingNews#NewSlots#TrueLab#TrueGames#TrueSlots