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

Резултати

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

Пребарај: #evaa

当前筛选 #evaa清除筛选
Binance crypto champions

@binancecryptochampions · Post #2964 · 20.12.2025 г., 12:41

✴️Free signal-Futures ✴️ ⚡️⚡️#EVAA/USDT⚡️⚡️ Signal Type: Regular (Long) Leverage: Cross (20x) Margin: 2.0% Entry Targets: 1) 0.775 2) 0.855 Take-Profit Targets: 1) 0.91 2) 0.95 3) 1.03 Stop Targets: 1) 0.735 🍁 Published by: @Trading_exp🍁 Join_vip: @Crypto_Futures_Spot_Payment_bot

Hashtags

Binance crypto champions

@binancecryptochampions · Post #2785 · 16.10.2025 г., 02:19

✴️Free signal-Futures ✴️ ⚡️⚡️#EVAA/USDT⚡️⚡️ Signal Type: Regular (Long) Leverage: Cross 20.0x 🚪Entry Targets: 1) 2.82 🎯Take-Profit Targets: 1) 2.895 2) 3.033 3) 3.38 🚫Stop Loss: 2.657 🌱 Published By: @Trading_exp🌱 Join_vip: @Crypto_Futures_Spot_Payment_bot

Hashtags

🎆 The long-awaited 😇 EVAA TGE is just around the corner! And FIVA is now live in closed mainnet 👍 FIVA Protocol is one of the most advanced DeFi projects on TON right now. Think of it like Pendle on Ethereum, but built for TON: users can lock in fixed yields, trade future yield, and treat yield as a tradable asset. 💡How does it work? Let’s say there’s 100 USDT and the goal is to lock in 5% APY over 60 days • Open FIVA in Telegram and connect a wallet • Under the Earn tab, convert 100 USDT into a PT (Principal Token) — a base asset that returns with a fixed 5% • In the Market tab, buy or sell YT (Yield Token) — a token representing rights to the future yield To simplify: PT — fixed base + guaranteed return YT — tradable yield — can be held or sold for potential profit 💵 Funds can be withdrawn early, but the outcome will depend on market conditions. Both profits and losses are possible. 💻FIVA is currently live in closed mainnet. Liquidity is still limited, so large positions may cause slippage. But: 🟠 $EVAA $XP can be farmed 58x faster with YT 🟠 Yield, XP, and trading fees are available via liquidity pools 🟠 Everything is explained in the official strategy guide 🛡 FIVA has already been audited, integrates Pyth oracles, and remains protected even if #EVAA encounters issues — fixed yields stay intact. 😇And finallyyy…🥳🎉🎆TGE news is here!!! The official TGE page has gone live with the first details. Vesting and token lock specifics are still being finalized — more updates expected soon. FIVA App | Channel

Hashtags

EVAA integration in Binance Web3, joint activity with Storm Trade and boosts for XP farming 🏦 Binance Web3 Wallet has integrated EVAA — its good news, now onboarding new users in TON DeFi, exactly in #EVAA, will be easier and faster.💱Last year, the OKX exchange also integrated EVAA in its Web3 wallet. 🪙 EVAA and Storm Trade are giving away 2 000 000 RP for liquidity supply. The reward will get only top 20 suppliers, your part of reward will depend on the supply amount and the time spent in the pool. You need to hold until 03/03/2025. 🔥 Increasing the coefficients for EVAA XP farming. The NFT card boost rate has been increased from 1.1x to 1.2x, and for your referrals from 5% to 10%. The maximum bonus is now ~1.73x with Boost Card, Mainnet Card and Telegram Gifts. 😇EVAA also took 9th place in the CryptoRank rating – 15 best projects by TVL growth in January 2025. EVAA app | News | Chat | Website

Hashtags

Getting ready for EVAA XP halving⬇️ Very soon, the number of #EVAA XP points received will be halved, which will increase their value, respectively, and the future token too. 🟣 Season 1: will last until June 24, the first halving will occur. 🟣 Season 2: from June 24 to August 1, after which there is also a halving. 🟣 Season 3: Starts August 1st until TGE. ✅ Therefore, we are not relaxing, but rather accelerating the pace and continuing to actively farm XP, because $EVAA promises to be a promising coin and we expect its release at the end of this summer. 🔽We would also like to remind you of several activities from EVAA that are worth taking part in: 💥EVAA and TonStakers (more details in the previous post ) 💥EVAA and Bemo (more information here ) 💥Evaa, @Xircus and @XPlus (our previous post about this ) EVAA app | News | Chat | Website

Hashtags

123•••67
ПретходнаСтраница 1 од 7Следна