В фреймворке 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
Эти красные водостоки появились в доме на берегу ирландской Атлантики. Здесь часто идут дожди, и такая система акцентирует внимание на их поэтичности. А бетонные опоры помогают двенадцати трубам выдерживать натиск ветров.
Авторы проекта: Ryan W Kennihan Architect’s.
#detail
Ferring pharmaceuticals A/S has opened its new home in Copenhagen.
The site occupies a pivotal waterfront position alongside the Øresund crossing, just north of Copenhagen International Airport. Bordered by predominantly low-rise development, the building affords fantastic views towards Malmö and the Swedish coast – where the company was founded.
“We worked with Ferring to develop an in-depth understanding of the way they work. Through observations and targeted interviews, we gained valuable insight into the processes involved in the development of their drugs. In turn, we have designed a building that responds to the company’s specific needs and brings the range of Ferring’s activities under one roof.”
Architecture by Foster&partners
#arch_shovel#architecturelover#detail#archidaily
Happy World Architecture Day!
Visualization: Plo.mp
Project: Mixed-Use Complex with Kohn pedersen fox
.
#rendering#facade#architect#archidaily#minimalist#detail#architecturelover#arch_shovel