В фреймворке 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
The Unbalanced Equation
Reading Between the Lines of Tibor Nagy’s Diplomatic Signaling
The Diplomat’s Blueprint: Nagy’s Calculated Candor
(Based on Tibor Nagy’s interview withThe Reporter)
Tibor Nagy’s interview was not a casual reflection by a retired diplomat. It was a carefully calibrated act of strategic signaling—a rare moment where the inner logic of U.S. policy toward 🇪🇹 was articulated with unusual bluntness.
Wrapped in the practiced composure of a veteran envoy, Nagy’s words offered 🇪🇹 neither reassurance nor partnership, but something more revealing: clarity without comfort.
To grasp the interview’s real significance, Ethiopians must do what diplomacy often discourages—read not only what was said, but what was deliberately excluded, & examine how language is used to normalize hierarchy, constrain agency, & predefine acceptable limits of sovereignty.
👉Read the Full Article
#RedNileMedia#GERD#NileSovereignty#Geopolitics#TransactionalDiplomacy#AfricanAgency#MultipolarWorld#Somaliland
The Unbalanced Equation
Reading Between the Lines of Tibor Nagy’s Diplomatic Signaling
The Diplomat’s Blueprint: Nagy’s Calculated Candor
(Based on Tibor Nagy’s interview withThe Reporter)
Tibor Nagy’s interview was not a casual reflection by a retired diplomat. It was a carefully calibrated act of strategic signaling—a rare moment where the inner logic of U.S. policy toward 🇪🇹 was articulated with unusual bluntness.
Wrapped in the practiced composure of a veteran envoy, Nagy’s words offered 🇪🇹 neither reassurance nor partnership, but something more revealing: clarity without comfort.
To grasp the interview’s real significance, Ethiopians must do what diplomacy often discourages—read not only what was said, but what was deliberately excluded, & examine how language is used to normalize hierarchy, constrain agency, & predefine acceptable limits of sovereignty.
👉Read the Full Article
#RedNileMedia#GERD#NileSovereignty#Geopolitics#TransactionalDiplomacy#AfricanAgency#MultipolarWorld#Somaliland