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

Резултати

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

Пребарај: #apy

当前筛选 #apy清除筛选
UXLINK

@uxlink_community · Post #180 · 13.01.2025 г., 06:14

Congrats #UXLINKseason1 stakers! After 6 months, $UXLINK price raised from $0.2 to $1.2, with nice #APY average on around 50%, you've got 750%+ ROI on average, the best investment in this market! Like @cz_binance said before, " If you hold, you will be rich! "💰 We will continue empower $UXLINK and reward our long term holders❤️https://x.com/UXLINKofficial/status/1878686684432486624

TONlines – News

@tonlines · Post #7331 · 22.05.2025 г., 16:35

The Daily TON: Understanding APY for Beginners #APY#network The Daily TON highlights the importance of understanding APY, advising newcomers to approach it with caution due to potentially misleading high rates. Services may use high APYs for marketing or short-term benefits, which might not result in significant long-term gains. Source: link @tonlines

Hashtags

🏦TON DeFi Yields & New Players Since the start of the year, 12 new DeFi protocols have launched, and developers are actively experimenting with solutions that combine the convenience of Telegram with the principles of decentralized finance. Top APRs: 🏆Bidaskoffers 22% APR in the tgUSD/USDT pair and 41.6% APR in Bemo bmTON/TON. 🏆TONCOprovides ~37.7% APR — among the highest yields on the platform. 🏆Storm Tradeoffers Vault to TON and USDT with yields of ~10–13% APR. 🏆FIVA Protocolhas revamped its app for simplicity and even added a game mode — 11.25% APR in USDT. New & Rising Projects: 🔓 Factorial has rebranded to Affluent, focusing on straightforward investment tools. 🔓 Titan introduced Colossus — a high-speed concentrated liquidity market-maker. 🔓Syde.fi launched an alpha version and is in testing; the team has gathered feedback and is about to unveil a new synthetic token-asset product. 🔓Swap.coffee opened Coffee DEX — a fully open-source decentralized exchange. 🔓Torch launched tgUSD, a stablecoin pegged 1:1 to USDT, offering ~10% APR. #DeFi#Yield#APR#APY#Farming#TON#Tonco#Bidask#Torch

Crypto M - Crypto News

@CryptoM · Post #65047 · 10.04.2026 г., 16:10

🚀 Whop Introduces Treasury Yield Product Following Tether Investment Whop has launched its Treasury yield product on March 25, following a significant investment from Tether in February, which valued the company at $1.6 billion. According to NS3.AI, the product was introduced after Tether's $200 million investment. Steven Schwartz noted that 3% of users engaged with the beta version within a week, despite the absence of a marketing campaign. The product channels funds through a Veda vault on Plasma into Aave lending markets, offering an annual percentage yield (APY) of up to 6%. The investment from Tether will enable Whop to integrate on-platform USDT wallets and payment options. #Whop#Tether#TreasuryYield#Investment#Crypto#APY#Aave#USDT#Fintech#Blockchain#AAVE

Ganar Dinero Seguro

@ganardineroseguro · Post #1236 · 20.10.2025 г., 00:03

💰 ¡NUEVA FUNCIONALIDAD: CUENTAS DE AHORRO EN 🔤🔤🔤🔤! 💰 🏦 Protege tu dinero de la inflación y hazlo crecer 🎯 QUEREMOS TU OPINIÓN ANTES DE LANZAR ✨ ¿Cómo funcionaría? 📈 APY: 3.75% - 4.10% anual 💵 Ahorra en QUSD - Protección contra inflación 🔓 Sin período de bloqueo - Retira cuando quieras 🚀 Lanzamiento: Noviembre 2025 🤔 PREGUNTA CLAVE: ¿Cómo prefieres recibir tus ganancias de ahorro? 📊 VOTA TU OPCIÓN FAVORITA EN LAS REACCIONES: 👍 DIARIAS - Ganancias acreditadas cada día ❤️ SEMANALES - Ganancias cada 7 días 🔥 MENSUALES - Ganancias cada mes 🥰 ANUALES - Ganancias al final del año 💡 Beneficios de las Cuentas de Ahorro QvaPay: ✅ Rendimiento garantizado - 3.75% a 4.10% APY ✅ Sin bloqueo de fondos - Liquidez total ✅ Protección contra inflación - Ahorra en QUSD ✅ Crecimiento automático - Tu dinero trabaja por ti ✅ Seguridad QvaPay - Respaldado por nuestra plataforma ✅ Flexibilidad total - Deposita y retira cuando quieras 🎯 Ejemplos de ganancias (APY 4%): 💵 Ahorras $100 → Ganas ~$4/año 💵 Ahorras $1,000 → Ganas ~$40/año 💵 Ahorras $10,000 → Ganas ~$400/año 📊 Según tu voto: • Diarias: Pequeñas ganancias constantes cada día • Semanales: Acumulación semanal visible • Mensuales: Crecimiento mensual significativo • Anuales: Máximo rendimiento al final del período 🚀 ¿Por qué es importante este producto? 💼 Para ti: Protege tu dinero y hazlo crecer 📈 Para QvaPay: Instrumento de crecimiento sostenible 🌟 Para todos: Ecosistema financiero más robusto 💬 ¡TU OPINIÓN DEFINE EL PRODUCTO! 👇 VOTA AHORA y ayúdanos a crear la mejor experiencia de ahorro 👇 🗓️ Lanzamiento previsto: Noviembre 2025 #QvaPay#CuentasDeAhorro#APY#QUSD#Ahorro#ProteccionInflacion#Noviembre2025#Encuesta#Inversion#CrecimientoFinanciero#SinBloqueo#Flexibilidad ⚡️Boost | 📱Twitter | 📱Instagram 🌟TrustPilot | ↔️Ofertas | 🤖Bot