В фреймворке 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
📣 Open Call: Enterprise & AI Startups — Your Moment Is Now!
🚀 Plug and Play Central Asia, in partnership with IT Park Uzbekistan, is on the lookout for high-potential startups from Central Asia and around the globe to join Batch 5 of Plug and Play Tech Center Accelerator Program in Uzbekistan.
Who should apply?
✔️ International startups ready to expand into Central Asia and establish a footprint in Uzbekistan
✔️ Homegrown Uzbekistan-based startups looking to scale fast with world-class support
✔️ High-growth startups with real traction and global ambition
What’s in it for you?
✔️ Expert mentorship and hands-on support from Plug and Play's global network
✔️ Investment opportunities and warm intros to VCs
✔️ Exclusive access to pitch at our Expo in front of corporates and investors
✔️ Practical workshops and pitch training sessions
✔️ The chance to join Plug and Play Tech Center GOAL Program in Silicon Valley and visit other locations
IT Park Ventures will review all participating startups for investment - supporting international startups considering entering Uzbekistan and helping local founders scale worldwide.
Applications are open here:link
🗓 Deadline to apply: July 15, 2025
🟢 Selected startups will be announced in August. The program kicks off in early October.
Apply now and let’s build the future together!
#PNPTC#PlugAndPlayCA#Uzbekistan#Accelerator#Batch5#OpenCall#ITPark
📣 Open Call: Enterprise & AI Startups — Your Moment Is Now!
🚀 Plug and Play Central Asia, in partnership with IT Park Uzbekistan, is on the lookout for high-potential startups from Central Asia and around the globe to join Batch 5 of Plug and Play Tech Center Accelerator Program in Uzbekistan.
Who should apply?
✔️ International startups ready to expand into Central Asia and establish a footprint in Uzbekistan
✔️ Homegrown Uzbekistan-based startups looking to scale fast with world-class support
✔️ High-growth startups with real traction and global ambition
What’s in it for you?
✔️ Expert mentorship and hands-on support from Plug and Play's global network
✔️ Investment opportunities and warm intros to VCs
✔️ Exclusive access to pitch at our Expo in front of corporates and investors
✔️ Practical workshops and pitch training sessions
✔️ The chance to join Plug and Play Tech Center GOAL Program in Silicon Valley and visit other locations
IT Park Ventures will review all participating startups for investment - supporting international startups considering entering Uzbekistan and helping local founders scale worldwide.
Applications are open here:link
🗓 Deadline to apply: July 15, 2025
🟢 Selected startups will be announced in August. The program kicks off in early October.
Apply now and let’s build the future together!
#PNPTC#PlugAndPlayCA#Uzbekistan#Accelerator#Batch5#OpenCall#ITPark