В фреймворке 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
crDroid - Unofficial | Android 16 | Nothing Phone (2)
📝 Details:
- Version: v12.3
- Device: #Pong
- Released: 15/11/25
⬇️ Downloads: ROM and Recovery Image
⚙️ Flashing Instructions: Here
📖 Changelogs: Here
🏷 Tags: #LOS#ROM#crDroid#Unofficial
✍️Notes:
- GAPPS and Vanilla builds available
- Dolby and initial Nothing camera support available
- WFD broken
- SukiSU Ultra with SUSFS out of the box
- OTA updates are supported
- Signed with release-keys
- Use latest NOS 3 firmware
- If face any bugs report with logs
🏆Credits:
- Ghost and Chandu for DT
- Fabian & HELLBOY for Glyph
- HELLBOY for Meteoric Kernel
👤 Maintainer: @deadlylxrd
💬 Chat: @NothingPhone2
🔔 Updates: @NothingPhone2Updates
OrionOS Project - OFFICIAL | A14 | Nothing Phone (2)
Based on LineageOS & crDroidAndroid
📔 Details:
- Version: Cosmic
- Codename: #Pong
- Released: 04/08/2024
🔽 Download (Recovery) : Vanilla | Gapps
⚙️ Installation: Here
📸 Screenshots: Here
🆘 Support: Telegram
🔖 Tags : #ROM#LOS#Official#QPR3#U#NothingPhone2
✍️ Note:
- Kernel is prepatched with KSU (Download Manager)
- Clean flashing is mandatory
- Both Vanilla & Gapps Build Available
- Powershare (Wireless Reverse Charging)
- Auto brightness in Glyph
- X-Reality Engine in Colors
- MicroG should pass Integrity (Not tested)
- Game Space
- Battery Backup was pretty decent during testing.. Wait for a charging cycle to complete..
‼️ Known Bugs:
- Lock Screen Carrier Text is a bit right.. Would be fixed with next OTA of August SP
🏆 Credits
- Chandu for base device tree & Kernel
- OC'D, Miki, Unluck & Ghost for all help
- Fabian & Hellboy for PA Glyph
- Testers
😎 Maintainers: @AgBKartikey
🔔 Updates: @NothingPhone2Updates
💬 Chat: @NothingPhone2