В фреймворке 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
🎤🏆 Thrilling Highlights: Public Speaking Contest at New Uzbekistan University! 📢✨
🌟 Captivating speeches, exceptional talent, and a deserving winners. Congratulations to all participants for their inspiring performances! 🏅👏
#PublicSpeaking#NewUzbekistanUniversity#TalentShines
Best,
The Renaissance Party & Open Microphone Club
🎤 Great news! 🌟 We are excited to announce the launch of our new public speaking course at ADC! 🏫
If you want to overcome the fear of public speaking, improve your presentation skills, or simply become a more effective communicator, our course is designed for you. With experienced instructors, a supportive environment, and a program focused on real-life success, we are here to help you find your voice and make an impact.
👩🏫👨🏫 Join us on a journey of development, confidence, and empowerment. Classes are starting soon, and spaces are limited, so book your spot today!
☎️For more details:
74 2261078
74 2281121
74 2281666
74 2276163
74 2252536
#PublicSpeaking#FindYourVoice#Empowerment#CommunicationSkills#Education#NewCourse#JoinUs