В фреймворке 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
Searching for a better way to serve the community, Bony found his calling in the healthcare industry 🩺 Discover why Bony made the switch here 👉https://go.gov.sg/ssg-20241003tg1
#SkillsFuture#LifelongLearning#Midcareer
With graduation round the corner, Norazlina is eager to explore her next educational pursuits 🎓 Discover her upskilling journey here ➡️https://go.gov.sg/ssg-20240903tg
#SkillsFuture#LifelongLearning#Midcareer
Are you at a pivotal point in your career? 🤔 Seek guidance through our Skills and Training Advisory to chart the most optimal route forward for your professional journey 👉🏻go.gov.sg/ssg-20240521tg
#SkillsFuture#Lifelonglearning#midcareer
Market Trends Impact Developer Salaries
Developers face salary stagnation as the job market grows competitive. With more candidates than job openings, mid-senior professionals find job switches yield minimal salary increases. Becoming a tech lead is rare and corporations limit hiring senior candidates. Stability may lie in entrepreneurship or pet projects instead. Consider exploring these options for long-term financial health.
#JobMarket#DeveloperSalaries#Entrepreneurship#PetProject#IT#CareerGrowth#TechIndustry#EmploymentTrends#SalaryTrends#BusinessModel#Stability#Competition#JobSwitch#MidCareer#SeniorDevelopers#MarketAnalysis#ITCareers#FinancialPlanning#TechJobs#Startup#TechLeadership