В фреймворке 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
Mvrdv transforms the skyline of Amsterdam with its newly completed building ‘the valley,’ which comprises a trio of ‘crumbling,’ geology-i spired towers.
Covered in landscaping by Piet Oudolf, a green valley is woven throughout the three buildings to create up locally-accessible outdoor space.
Each of the 198 apartments is designed with a unique floor plan, and interiors by Heyligers architects.
images by Ossip Van Duivenbode.
#architecture#thenetherlands#mvrdv#arch_shovel
The competition-winning design for the China Comic & Animation Museum.
Each bubble has a specific function: entrance, education, theatre/cinema, and comic library. Where these forms meet they form openings and exciting collisions of light and sound, creating a circular route that encompasses the entire programme.
.
Architect: MVRDV
Co-architect: Zhubo Design
Structure: Arup
Exhibition design: Kossmanndejong
Location: Hangzhou, China
2015
.
#mvrdv#architecture#comics#animation#iconic#museum#exhibition#design