В фреймворке 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
Part 2: Same meaning. Better flow.
⚠️Quick note: phrases like “Get lost” and “Don’t be ridiculous” can sound rude depending on tone—use them carefully.
#englishpractice#englishlearning#EnglishVocabulary#learnenglish
We recently hosted a mock IELTS test at our educational center, offering participants a true-to-life exam experience. 📚✍️ The event meticulously recreated the conditions of the actual test, helping attendees familiarize themselves with the IELTS format and timing. ⏳ Participants had the chance to practice their English under timed conditions, assessing their readiness for the real exam. 🇬🇧🕒 Feedback from attendees was overwhelmingly positive, appreciating the opportunity to simulate the test day in a supportive and structured setting.
👏💼#IELTSPrep#MockTest#EnglishPractice
🎯 Daily English Q&A Practice for Beginners
🔹 Boost your speaking and listening skills every day!
🔹 Simple questions and answers to help you start speaking English confidently.
🔹 Perfect for self-study and classroom use.
📅 New episodes daily!
👂 Listen – 🗣 Repeat – 💬 Practice – ✅ Improve
🎓 No pressure, just daily progress.
Subscribe and start your journey to fluent English today!
#EnglishPractice#LearnEnglish#BeginnersEnglish#DailyEnglish