В фреймворке 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
@siftrBot
Qué puede hacer este bot?
Este bot te ayuda a encontrar Bots, Canales y Grupos para explorar. Comienza tocando 'Categorías'.
Idioma: Inglés
(visto en @BotsGram_cu)
#search
📰 Global Keyword Post Search
In the latest version of Telegram Beta for Android, searching posts using keywords is now subject to a daily cap. To find posts, go to Search, select Posts and enter your keyword.
Users receive 10 free keyword searches each day. After that, you must spend 10 stars to unlock two more searches or wait for the next reset. This limit applies to all users including Premium. Non Premium users cannot access keyword searches at all.
This feature is currently available in the test backend.
#Search | #beta v11.14.0
👉The TG Times
📰New Search Bar option
In the latest version of Telegram Beta for Android, you will be able to manage your search bar better than before and find the information that you are looking for easily
#Search | #beta v11.6
👉The TG Times