В фреймворке 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
🌎 Earth produces mysterious low-frequency sounds called "the Hum," detected by instruments but rarely heard by humans. These vibrations, recorded by seismometers and microphones, sometimes travel thousands of kilometers through the ground and air. The Hum’s exact causes vary, but some are linked to ocean waves shifting the seafloor or atmospheric pressure changes. ✨
#geophysics⚡#soundspace⚡#mysteries
👉subscribe Interesting Planet
👉more Channels
The Hudson Bay region in Canada sits on top of a significant gravity anomaly, making you weigh slightly less there than elsewhere on Earth. This is caused by the missing mass from the melted Laurentide Ice Sheet, which compressed the land and shifted dense rock away. After the ice melted, the area began slowly rebounding upward, creating this unique gravitational phenomenon. 🌍⚖️🇨🇦
[Read more]
@googlefactss
#GravityAnomaly#HudsonBay#ScienceFacts#Geophysics#Canada
#The_Science🇺🇸📕[PDF]⬇️
30 #October2025
#Weekly_Magazines
For learning, for free(dom).
@backupofmagazines
This issue delivers a powerful special on the #MandalayEarthquake, unpacking rupture physics and how Earth’s crust defies its own limits. Seismic data, #AI-based imaging, and dual-material energy models reveal a new frontier in #Geophysics. Meanwhile, reports span #BigTech access wars, #COVID19 legacy effects, and synthetic antibodies for #Snakebite treatment. Behavioral studies highlight chimpanzee rationality and neural rewiring. Advances in #Catalysis, #Recycling, and #Neuroscience mark the rise of adaptive science facing global turbulence. From earthquakes to evolution, this issue captures the restless pulse of a changing planet.
#ClimateCrisis#EarthScience#Innovation#Research