TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #45 · 2 мар.

В фреймворке 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

Hashtags

Резултати

Пронајдени 2 слични објави

Пребарај: #anger

当前筛选 #anger清除筛选
Self-Immolation

@SelfImmolation · Post #908 · 18.07.2022 г., 17:31

How to react if someone is angry with you? One time Brahmin Akkosaka got angry at Buddha, because a man from his clan had become a Bhikkhu. Akkosaka was yelling and insulting the Buddha. Buddha: “What do you think, Akkosaka? Do your friends, relatives, and guests sometimes come to visit you?” Akkosaka: "Sometimes they do, Master Gotama.” Buddha: "Do you then serve them with a variety of food and drinks?” Akkosaka: "Sometimes I do.” Buddha: “But if they don’t accept it, who do those food and drinks belong to?” Akkosaka: “In that case Master Gotama, they still belong to me.” Buddha: “In the same way, Akkosaka, when you abuse, harass, and attack me, who does not abuse, harass, and attack, I don’t accept your insults. They still belong to you, Akkosaka, they still belong to you!" - SN 7.2 Akkosaka Sutta#anger#Buddha