В фреймворке 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
Shipping disruptions strand 8 million kg of #Kenyan tea in #Mombasa as #US-#Israel war with #Iran hits exports
Disruptions to global shipping routes linked to the ongoing war between the United States, Israel, and Iran have left nearly eight million kilograms of tea stranded in warehouses in Mombasa, threatening export earnings and farmer incomes, according to the East Africa Tea Traders Association.
George Omuga, managing director of the association that runs the Mombasa tea auction, told Reuters that losses have been accumulating at roughly $8 million per week since 01 March.
“The current conflict in the Middle East has had a direct impact, a negative impact on this auction,” Omuga said, noting that no tea shipments were currently leaving for Middle Eastern markets, which account for 20–25% of Kenya’s tea exports.
https://x.com/addisstandard/status/2039378986518626404?s=20
News: #Somaliland's #Israel deal could put #Berbera port at risk
#Somaliland says its recognition by Israel could be a boon for its Berbera port. But with missiles flying across the region, it could also be a target.
Berbera port on the Gulf of Aden has been transformed by the #UAE firm #DP_World over the past decade into a state-of-the-art facility on one of the world's busiest trade routes.
Berbera still handles far fewer containers than nearby #Djibouti or #Mombasa, but port traffic was up 30 percent from 2023 to 2025, and recent diplomatic moves could lead to much more.
A deal under negotiation with #Ethiopia, a landlocked neighbour with more than 130 million inhabitants, could see traffic rise by another 80 percent, said port authority director Ali Diriye Ahmed.
Ethiopia did not respond to queries on the subject.
But an alliance with Israel also brings risks, particularly as the US-Israeli attacks on Iran this weekend increase the threat of ........
Read more: https://addisstandard.com/?p=55487