В фреймворке 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
Field research fellowship
If you're a UPSC student and thinking about a Plan B, this could be the perfect opportunity for you. Data Analytics for Public Policy Fellowship is a 2 months , fully online program that allows you to explore the world of quantative research methods. It's a great way to test your interests and see if research could be your Plan B. The program runs from 5th January to 15th March 2025, and you won't need to travel for fieldwork—everything can be done in your own neighborhood. With limited seats, this is a chance to explore new opportunities without a long-term commitment. Apply by 4th January.
https://iisppr.org.in/data-fellowship/
#UPSC#CareerPlanning#Fellowship#NewOpportunities
Field research fellowship
If you're a UPSC student and thinking about a Plan B, this could be the perfect opportunity for you. The IISPPR Field Research Fellowship is a one-month, fully online program that allows you to explore the world of qualitative research methods. It's a great way to test your interests and see if research could be your Plan B. The program runs from September 1 to 30, 2024, and you won't need to travel for fieldwork—everything can be done in your own neighborhood. With limited seats, this is a chance to explore new opportunities without a long-term commitment. Apply by August 15
https://iisppr.org.in/
#UPSC#CareerPlanning#Fellowship#NewOpportunities
Field research fellowship
If you're a UPSC student and thinking about a Plan B, this could be the perfect opportunity for you. The IISPPR Field Research Fellowship is a one-month, fully online program that allows you to explore the world of qualitative research methods. It's a great way to test your interests and see if research could be your Plan B. The program runs from September 1 to 30, 2024, and you won't need to travel for fieldwork—everything can be done in your own neighborhood. With limited seats, this is a chance to explore new opportunities without a long-term commitment. Apply by August 15
https://iisppr.org.in/
#UPSC#CareerPlanning#Fellowship#NewOpportunities
Field research fellowship
If you're a UPSC student and thinking about a Plan B, this could be the perfect opportunity for you. The IISPPR Field Research Fellowship is a one-month, fully online program that allows you to explore the world of qualitative research methods. It's a great way to test your interests and see if research could be your Plan B. The program runs from September 1 to 30, 2024, and you won't need to travel for fieldwork—everything can be done in your own neighborhood. With limited seats, this is a chance to explore new opportunities without a long-term commitment. Apply by August 15
https://iisppr.org.in/
#UPSC#CareerPlanning#Fellowship#NewOpportunities