В фреймворке 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
Bliss - Official | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 18.5
- Codename: #Pong
- Released: 21/4/25
🔽Download:Vanilla | Vanilla(Mirror) (Recovery Build)
🆘 Support : Here
⚙️ Installation: Here
📸 Screenshots: Here
🔖 Tags : #ROM#AOSP#Official#Bliss#V
✨ ChangelogsROM | Device
✍️ Note:
- Vanilla only
- clean flash recommended
- you can use this gapps: here, or flash your choice of gapps/microg if you know what you're doing
- ksu disabled bcs of official requirements
🏆 Credits
- @Ghosuto7 for DT
- Hellboy for Meteoric kernel
- Fabian for PA Glyph Implementation
- Testers
😎 Maintainer : @Drishal
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2
Bliss - Official | Android 15 | Nothing Phone (2)
✍️ Details:
- Version: 18.2
- Codename: #Pong
- Released: 29/1/25
🔽 Download: [ Vanilla | Gapps ] (Recovery Build)
🆘 Support : Here
⚙️ Installation: Here
📸 Screenshots: Here
✨ Source Changelogs: Here
🔖 Tags : #ROM#AOSP#Official#Bliss#V
✨ Changelogs
- Update to NOS V3.0-250113-1723 firmware
- Improvements to system performance and stability
✍️ Note:
- Both Gapps and Vanilla build available
🏆 Credits
- Chandu for base DT
- Hellboy for Meteoric kernel
- Fabian for PA Glyph Implementation
- Testers
- Note: bliss is not patched with ksu due to official requirements
😎 Maintainer : @Drishal
🔔 Updates : @NothingPhone2Updates
💬 Chat : @NothingPhone2