В фреймворке 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
@JPG2PDFBot
Qué puede hacer este bot?
Envíame fotos JPG o BMP como medios de Telegram.
Cuando hayas terminado,
use /done e intentaré generar un archivo PDF usando las imágenes enviadas en ese orden.
Idioma: Inglés
(visto en @BotsGram_cu)
#pdf, #convert, #photo
@HearForYou_Bot
Qué puede hacer este bot?
Este bot puede Convertir mensajes de audio de Telegram y WhatsApp a texto
Idioma: Inglés
(visto en @BotsGram_cu)
#whatsapp, #telegram, #speachtotext, #convert, #audio
@textUtilsBot
Qué puede hacer este bot?
Bot en línea para transformaciones de texto. Puede ayudarlo a traducir texto del lenguaje humano a código binario o hexadecimal, cadena base64 y viceversa.
Idioma: Inglés
(visto en @BotsGram_cu)
#inline, #utility, #base64, #binary, #hexadecimal, #convert
@NewStickerOptimizerBot
Qué puede hacer este bot?
Simplemente envíeme una imagen o pegatina, y la convertiré en un archivo png y la optimizaré para que su tamaño sea más pequeño o igual a 350Kb, para que pueda agregarlo a un paquete de pegatinas usando el bot @stickers.
Idioma: Inglés
(visto en @BotsGram_cu)
#sticker, #png, #image, #picture, #optimize, #pack, #create, #tool, #convert
#typescript#bun#conversion#convert#converter#document_conversion#elysia#file_conversion#file_converter#hacktoberfest#pdf_converter#self_hosted#tailwindcss#typescript
ConvertX is a self-hosted online file converter that supports over a thousand file formats, including images, videos, documents, e-books, and 3D assets. It lets you convert multiple files at once, offers password protection, and supports multiple user accounts for privacy. You can run it easily using Docker, making it simple to set up on your own server. This means your files stay private since conversions happen locally without sending data to external servers. It uses powerful open-source tools like FFmpeg and ImageMagick, giving you a versatile and secure way to handle all your file conversion needs in one place[1][2].
https://github.com/C4illin/ConvertX
@TelescopyBot
Qué puede hacer este bot?
Con este bot puedes convertir videos cuadrados a videos redondos
Idioma: Inglés, Ruso
(visto en @BotsGram.cu)
#telescope, #video_\message, #convert, #mp4, #gif, #media, #questions, #command, #round, #message, #video