В фреймворке 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
#javascript#hacktoberfest#stremio
Stremio is an easy-to-use media center app that lets you find, watch, and organize movies, TV shows, live channels, and more from many sources in one place. You can install addons to add content, sync your library across devices, and even download videos for offline viewing. It supports subtitles, Chromecast streaming, and high-quality formats like 4K HDR. Stremio keeps your data safe by running addons remotely and respects your privacy with minimal data collection. This means you get a secure, convenient, and personalized streaming experience without switching apps or worrying about security.
https://github.com/Stremio/stremio-web
Stremio
Freedom To Watch Everything You Want
Stremio is a modern media center that's a one-stop solution for your video entertainment. You discover, watch and organize video content from easy to install addons. Movies, TV shows, live TV or web channels - find all this on Stremio.
Features:
• Multi-platform support
• Discover new content with ease
• Extendable video catalogue
• All of your video content on one screen
• Organize your video library
• Keep track of everything you watch
• Cast to another device
• Watch video from many different sources
• Play HTTP links and torrent files
Download: https://www.stremio.com/downloads
https://github.com/Stremio
⚠️ Not fully foss?
#Stremio#movies
@foss_desktop