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

Резултати

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

Пребарај: #justinsun

当前筛选 #justinsun清除筛选
SpotOnChain | Announcement

@spotonchain · Post #907 · 14.07.2024 г., 01:23

9 hours ago, Justin Sun allegedly withdrew 14,436 $ETH (~$45.5M) from #Binance. 3 days ago, he deposited 45M $USDT to the CEX; therefore, this time's purchasing price was ~$3,117. Overall, since Feb 8, he might have bought 377,188 $ETH at ~$3.049 via 3 wallets and now has an unrealized profit of over $50M (+4.4%). Follow @spotonchain and set alerts for more updates about #JustinSun via https://platform.spotonchain.ai/en/platform/entity/278

SpotOnChain | Announcement

@spotonchain · Post #854 · 10.06.2024 г., 06:44

Justin Sun (@justinsuntron) deposited $21M worth of 4 assets to #Binance in the past 30 minutes, including: • 93,979 $AAVE ($11.26M) • 3,800 $MKR ($9.3M) • 4,178 $COMP ($245K) • 203,623 $LQTY ($217K) Follow @spotonchain and set alert for #JustinSun entity on our platform nowz https://platform.spotonchain.ai/en/entity/278

SpotOnChain | Announcement

@spotonchain · Post #944 · 05.08.2024 г., 09:33

How much did your portfolio drop today? Justin Sun took a hit of ~$280M as #Ethereum nosedived by 20%! Since Feb 8, 2024, he reportedly accumulated 377,590 $ETH (est. cost: $1.15B) via 3 wallets. But now $ETH is trading well below his average buying price of $3051! Still, Justin Sun hasn’t been liquidated yet! Follow @spotonchain and monitor the #JustinSun entity via https://platform.spotonchain.ai/en/entity/278

SpotOnChain | Announcement

@spotonchain · Post #946 · 06.08.2024 г., 01:27

Justin Sun (@justinsuntron) withdrew 14,884 $ETH ($35.97M) from #Binance 10 hours ago! This brought the total amount of $ETH he accumulated since Feb to 392,474 $ETH (est. cost: $1.19B, now worth: $995M). Note that Justin Sun also deposited a net amount of 49M $USDT to #HTX in the past 3 days. More $ETH purchases? Follow @spotonchain for more updates about #JustinSun now at https://platform.spotonchain.ai/en/platform/entity/278

SpotOnChain | Announcement

@spotonchain · Post #862 · 18.06.2024 г., 01:51

15 hours ago, Justin Sun (@justinsuntron) deposited another $14M in 8 assets to #Binance, including: • 3.45M $ETHFI ($12.05M) - claimed from the airdrop 3 months ago. • 6.23M $CRV ($1.96M) - of which 5M $CRV was purchased from Curve founder Michale Egorov at an OTC price of $0.4 last Aug. • and $333K in 6 other tokens $CVX, $MATIC, $GAL, $WOO, $PROS and $TRU. Overall, in the past week, Justin Sun has deposited $35M in 12 tokens, mostly #DeFi ones, to Binance. Follow @spotonchain and set alert for #JustinSun entity on our platform now: https://platform.spotonchain.ai/en/entity/278

NEWS 鏈新聞-ABMedia

@abmedia_news · Post #24049 · 22.04.2026 г., 06:00

【🚀 交易市場|不滿代幣遭凍結!TRON 創辦人孫宇晨對川普家族 WLFI 提告 】 #JustinSun#WLFI 📍 請見報導: https://abmedia.io/tron-justin-sun-sue-trump-wlfi 📍 訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

SpotOnChain | Announcement

@spotonchain · Post #957 · 10.08.2024 г., 18:44

Justin Sun transferred 500 $BTC ($30.3M) to a #Binance deposit and 513.4 $BTC ($31.2M) to a new wallet in the past hour. So far in 2024, he has deposited a net amount of 2,969 $BTC ($164M) to #HTX and #Binance at ~$55,185. Notably, Justin Sun often claims to be a strong advocate of #Bitcoin: • In late February, he revealed an HTX account holding 28,614 $BTC (now $1.74B). • In July, he offered to buy all $BTC off-market from the German government to minimize market impact. • However, also in July, he denied going long on $BTC at the $69,000 price level. Follow @spotonchain for more updates about #JustinSun now via https://platform.spotonchain.ai/en/platform/entity/278

NEWS 鏈新聞-ABMedia

@abmedia_news · Post #24364 · 05.05.2026 г., 05:32

【🔗 DeFi|孫哥槓上川普家族!孫宇晨遭 WLFI 反訴誹謗,直批「公關作秀」】 #WLFI#JustinSun#Trump 波場創辦人週二遭佛州法院起訴,指控其索要封口費不成後發動報復。 他斥資 1.75 億美元入局,現因 2.4 億代幣凍結遭控違反 2025 年清晰法案。昔日盟友反目,對決凸顯政治品牌與幣圈大亨的利益摩擦。 📍閱讀全文: https://abmedia.io/trump-affiliated-world-liberty-sues-justin-sun 📍 訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

华人社

@hrtt · Post #3095 · 22.04.2026 г., 15:59

😁 😁 😁 🚨 突发:币圈大佬彻底开战!孙宇晨反击特朗普关联公司:指控其“敲诈勒索”!💥 币圈又变天了! 波场(TRON)创始人孙宇晨(Justin Sun)正式提起诉讼,矛头直指与美国前总统特朗普有千丝万缕联系的加密货币公司 World Liberty Financial (WLF)! 孙宇晨指控该项目并非普通的商业合作,而是一场精心策划的“敲诈勒索”! 孙宇晨声称由于对方的违规操作和蓄意误导,导致其旗下公司遭受了高达数亿美元的惨重损失!📉💸 “我们不会对这种赤裸裸的掠夺行为坐视不管!” 🔥孙宇晨 vs 特朗普关联项目,这不仅是商业纠纷,更是顶级流量与政治背景的跨界大混战!🥊 诉讼文件揭露了多项不为人知的交易细节,直指对方利用特朗普的影响力进行“收割”。🤫 随着诉讼爆出,相关代币价格出现剧烈波动,引发全网投资者恐慌!📊🔥 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁 😁这是又要搞什么跨世纪营销? #孙宇晨#特朗普#加密货币#WLF#敲诈勒索#币圈大地震#JustinSun 😀一键订阅 😀助推频道

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