В фреймворке 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
#typescript#chatbot#chatwoot#cloud_api#dify#evolution#n8n#openai#pusher#rabbitmq#typebot#whatsapp#whatsapp_api#whatsapp_bot
Evolution API is a powerful tool that lets you connect and control WhatsApp and other messaging platforms easily. It supports both free WhatsApp Web-based API and the official WhatsApp Business API, plus upcoming Instagram and Messenger support. You can integrate it with popular services like OpenAI for AI features, Chatwoot for customer support, and Amazon S3 for media storage. There’s also a lightweight version for simple, fast setups. Using Evolution API helps you automate messaging, manage chats, and build smart bots, saving time and improving communication for your business or projects.
https://github.com/EvolutionAPI/evolution-api