В фреймворке 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
Non-speaking does not equal non-thinking.
They're just as capable of thinking you're an a$$hole as anyone else, so watch your step. 😉
#nonspeaking#nonverbal#Autism#Autistic#ActuallyAutistic#AACsource
#python#4k#aac#apple_music#apple_music_downloader#downloader#m4a#m4v
Gamdl is a free command-line tool to download Apple Music songs in high-quality AAC 256kbps, music videos up to 4K, albums, playlists, and artist content, with synced lyrics (LRC/SRT), rich metadata, and cover art. Install via `pip install gamdl`, add your browser cookies from an active subscription, and run `gamdl [URL]`. It benefits you by letting you enjoy offline playback anywhere without streaming data costs, on any device, with organized files ready for your library.
https://github.com/glomatico/gamdl
Gatekeeping communication methods = time to find a new practitioner. #Autism#Autistic#ActuallyAutistic#nonspeaking#nonverbal#Speechtherapy#AAC#apraxia#dyspraxiasource