В фреймворке 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
📰US stock prices soar in early Asian trading after truce news
🔗https://top-news.shepherdgazette.com/us-stock-prices-soar-early-asian-trading-truce/?utm_source=telegram&utm_medium=social&utm_campaign=zimm-distribute
via Daily Political Press
#Asian#TopNews#News
News: #Ethiopia, #Asian Infrastructure Investment Bank discusse support for Bishoftu airport project
Ethiopia’s Minister of Finance, Ahmed Shide, has held discussions with the President of the Asian Infrastructure Investment Bank (#AIIB) on potential financing support for the planned #Bishoftu International Airport project.
According to a statement from the Ministry of Finance, the meeting focused on strengthening cooperation between Ethiopia and the multilateral lender, with particular emphasis on priority infrastructure and development initiatives.
The two sides also explored avenues to expand collaboration in mobilizing private sector financing.
A week ago Addis Standard reported that Ahmed Shide, Ethiopia’s Minister of Finance, held high-level discussions with a delegation from the #China Export-Import (Exim) Bank and the Chinese Ambassador to Ethiopia, Chen Hai, the talks centered on exploring financing options for the construction of the Bishoftu....
Read more: https://addisstandard.com/?p=56203