TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #381 · 23 окт.

Установить свойства виджета в PySide можно не только через соответствующие методы и конструктор класса. Можно их изменять с помощью метода setProperty по имени. btn = QPushButton("Click Me") btn.setProperty("flat", True) Это аналогично вызову btn.setFlat(True) Если указать несуществующее свойство, то оно просто создается btn.setProperty("btnType", "super") Получить его значение можно методом .property(name) btn_type = btn.property("btnType") Когда это может быть полезно? ▫️Можно просто хранить какие то данные в виджете и потом их доставать обратно widget = QWidget() widget.setProperty('my_data', 123) print(widget.property('my_data')) ▫️ Назначая эти свойства разным виджетам можно потом отличить виджеты во время итераци по ним. Например, найти все кнопки со свойством my_data="superbtn". Но ведь вместо кастомного свойства можно использовать objectName, будет тот же результат. Да, но y ObjectName есть ограничение - только строки. ▫️ Если нам потребуется не просто поиск а, например, сортировка по числу, то свойства позволяют нам это сделать. Поддерживается любой тип данных widget.setProperty('my_data', {'Key': 'value'}) widget.setProperty('order', 1) all_widgets.sort(key=w: w.property('order')) Но ведь Python позволяет всё вышеперечисленное сделать простым созданием атрибута у объекта widget.order = 1 widget.my_data = 123 Да, но я думаю что не надо объяснять почему не стоит так делать. К тому же, если у виджета нет свойства то метод .property(name) вернет None, а отсутствующий атрибут выбросит исключение. ▫️ Действительно полезное применение кастомным свойствам - контроль стилей. Здесь атрибутами не обойтись, нужны именно свойства. Дело в том, что в селекторах стилей можно указывать конкретные свойства виджетов на которые следует назначать стиль. Просто запустите этот код from PySide2.QtWidgets import * if __name__ == "__main__": app = QApplication([]) widget = QWidget(minimumWidth=300) layout = QVBoxLayout(widget) btn1 = QPushButton("Action 1") btn2 = QPushButton("Action 2") btn3 = QPushButton("Action 3", flat=True) layout.addWidget(btn1) layout.addWidget(btn2) layout.addWidget(btn3) # добавим кастомное свойство одной кнопке btn1.setProperty("btnType", "super") # добавляем стили widget.setStyleSheet( """ QPushButton[btnType="super"] { background-color: yellow; color: red; } QPushButton[flat="true"] { color: yellow; } """ ) widget.show() app.exec_() С помощью селектора мы избирательно назначили стили на конкретные кнопки. Как получить список всех кастомный свойств? Функция получения списка кастомных свойств отличается от получения дефолтных. def print_widget_dyn_properties(widget): for prop_name in widget.dynamicPropertyNames(): property_name = prop_name.data().decode() property_value = widget.property(property_name) print(f"{property_name}: {property_value}") #tricks#qt

Hashtags

Резултати

Пронајдени 29 слични објави

Пребарај: #halo

当前筛选 #halo清除筛选
Mega Signals Group

@mega_pump_group · Post #1859 · 19.11.2023 г., 18:38

Pump result: Today's pump on Kucoin shocked us all with the massive volume, this was expected as we onboarded over 30,000 members in the past two weeks. However, due to unprecedented sell pressure from the #HALO team, we had expected a much larger rise in price. In fact internally we had discussed that we will be targeting around 900-1000% which we still tried to achieve with our team buying endless amounts after the first few minutes to guarantee that our members make good enough profit . Nonetheless, member's managed to profit over 150% during the signal, and with the support of our team we even managed to provide a second and third wave for extra profits which means anyone that has bought the dips during the signal had the chance to instantly make a lot of profits! We are receiving an overwhelming amount of positive messages from our community and we're happy to hear so many of you profited. From this point on, our signals will only get stronger, and you can be confident that we will use all the power we have to keep reaching higher targets. As the majority of you are aware, our greatest pump to date generated a profit for our members of around 2000%, and now our primary focus is to see if we can repeat that sort of pump. It will be quite easy to accomplish with our existing power. It can happen once again if we don't face any sell pressure coming from the coin team itself which is something that can be hard to avoid at times, hopefully we can achieve that result once again on the next one. Stay tuned for the next pump announcement.

Hashtags

Crypto Pump Club

@crypto_bitcoin_pumps_signal · Post #587 · 19.11.2023 г., 18:39

Pump result: Today's pump on Kucoin shocked us all with the massive volume, this was expected as we onboarded over 30,000 members in the past two weeks. However, due to unprecedented sell pressure from the #HALO team, we had expected a much larger rise in price. In fact internally we had discussed that we will be targeting around 900-1000% which we still tried to achieve with our team buying endless amounts after the first few minutes to guarantee that our members make good enough profit . Nonetheless, member's managed to profit over 150% during the signal, and with the support of our team we even managed to provide a second and third wave for extra profits which means anyone that has bought the dips during the signal had the chance to instantly make a lot of profits! We are receiving an overwhelming amount of positive messages from our community and we're happy to hear so many of you profited. From this point on, our signals will only get stronger, and you can be confident that we will use all the power we have to keep reaching higher targets. As the majority of you are aware, our greatest pump to date generated a profit for our members of around 2000%, and now our primary focus is to see if we can repeat that sort of pump. It will be quite easy to accomplish with our existing power. It can happen once again if we don't face any sell pressure coming from the coin team itself which is something that can be hard to avoid at times, hopefully we can achieve that result once again on the next one. Stay tuned for the next pump announcement.

Hashtags

便宜机场测速

@cheap_proxy · Post #12001 · 05.08.2025 г., 15:37

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11306 · 03.01.2025 г., 08:14

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11276 · 29.12.2024 г., 07:22

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #上海电信1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11751 · 08.05.2025 г., 12:09

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #成都移动1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11977 · 29.07.2025 г., 01:48

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #河北联通1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

便宜机场测速

@cheap_proxy · Post #11479 · 16.02.2025 г., 11:15

#halo#iepl#不限速#流媒体解锁#chatgpt 测速环境: #河北联通1000 新开的一家专线机场,入口很多,25r/100g,延迟属于顶级水平。因为用户量少,整体比较稳定,晚高峰速度也很快,性价比还是比较高的。 完整套餐价格图 机场地址:https://bit.ly/halo-cloud

Interesting Planet 🌍

@interesting_planet_facts · Post #415 · 25.07.2025 г., 14:22

🌎 Sun halos, circular rainbows encircling the sun, form when sunlight passes through high-altitude ice crystals. These brilliant rings are a natural spectacle, often signaling incoming weather changes. ✨ #sun⚡#halo⚡#atmosphere⚡#optics 👉subscribe Interesting Planet

ПретходнаСтраница 1 од 3Следна