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

Резултати

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

Пребарај: #seedfunding

当前筛选 #seedfunding清除筛选
Crypto M - Crypto News

@CryptoM · Post #65173 · 11.04.2026 г., 16:05

🚀 USDi Stablecoin Seeks $1.5 Million in Seed Funding Amid Rising Inflation USDi, a stablecoin already in circulation, is aiming to secure approximately $1.5 million in seed funding. According to NS3.AI, the token is designed to track the U.S. Consumer Price Index (CPI) and is intended to increase in value with inflation, rather than maintaining a fixed nominal value of $1. Michael Ashton highlighted that the initiative comes at a time when U.S. inflation has surged to 0.9% in the past month, primarily due to energy costs linked to the ongoing conflict in Iran. #USDi#Stablecoin#SeedFunding#Inflation#CPI#EnergyCosts#IranConflict

Venture Village Wall 🦄

@venturevillagewall · Post #4108 · 09.02.2025 г., 19:00

End Chokepoint 2.0 Now! Senator Lummis urges that personal beliefs regarding guns, #Bitcoin, crypto, and religion should not affect banking practices, calling for an end to Chokepoint 2.0. In other news, Coala Pay secures $3.50M in Seed funding led by Castle Island Ventures, alongside participation from Lattice Fund and Factor Capital. Read more here: ICO Analytics #Bitcoin#Crypto#VC#Banking#Funding#Chokepoint2.0 #Politics#SenatorLummis#InternationalAid#CoalaPay#Investing#SeedFunding

Crypto M - Crypto News

@CryptoM · Post #64994 · 10.04.2026 г., 13:15

🚀 SimpleChain Secures $15 Million in Seed Funding for RWA Network SimpleChain has announced the successful completion of a $15 million seed funding round. According to Foresight News, the funding was supported by family offices and institutional investors. SimpleChain aims to develop a Real World Asset (RWA) Layer 1 network, positioning itself as an 'Institutional OS' for RWA. The network will be powered by Granular Data and native CaaS, focusing on providing financial-grade infrastructure for the tokenization of real-world assets globally. #SimpleChain#SeedFunding#RWA#Layer1Network#InstitutionalOS#GranularData#CaaS#Tokenization#RealWorldAssets#FinancialInfrastructure

Venture Village Wall 🦄

@venturevillagewall · Post #4142 · 13.02.2025 г., 16:00

Teneo Raises $3M for Decentralized Platform Teneo, a decentralized data utilization and tokenization platform (formerly ELOOP), has secured $3M in Seed funding led by RockawayX and Borderless Capital. Ethereum L1 users spent $570M in January 2025, showcasing active economic engagement. Additionally, Plasma raised $24M to launch a blockchain for Tether, enabling zero-fee USDT transactions. Read more: Tokenterminal | Fortune #Teneo#Blockchain#Funding#Plasma#Ethereum#DeFi#Crypto#Tokenization#SeedFunding#NEIRO#USDT#EVM#Web3#Bitcoin#Solana#Investments#VC#EconomicActivity#DigitalAssets#Stablecoin

Venture Village Wall 🦄

@venturevillagewall · Post #3431 · 18.12.2024 г., 14:33

Silencio Raises $2.5M in Seed Funding Community-focused network Silencio, tackling noise pollution, secures $2.5M in Seed funding led by Blockchange Ventures, with contributions from Borderless Capital, Master Ventures, Blockchain Founders Fund (BFF), Prosper GmbH & Co. KG, and Advanced Blockchain AG. #Silencio#Fundraising#NoisePollution#SeedFunding#BlockchangeVentures#BorderlessCapital#MasterVentures#BlockchainFoundersFund#ProsperGmbH#AdvancedBlockchainAG

Venture Village Wall 🦄

@venturevillagewall · Post #4255 · 26.02.2025 г., 22:00

Major Crypto Hacks and Market Updates Bybit suffers $1.4B ETH hack, among largest ever, surpassing Mt. Gox and FTX. NVIDIA posts strong Q4 FY25 results; expects $43B Q1 FY26 revenue. Bitcoin drops to $82,236, with over $433M liquidated. Bank of America set to launch its own dollar stablecoin, joining other major banks in the crypto finance space. Donald Trump's tariffs may impact Bitcoin prices. #Crypto#Bitcoin#ETH#NVIDIA#Hack#Stablecoin#MarketManipulation#Finance#BankOfAmerica#Tariffs#Liquidity#Tech#USDC#USDT#Aegis#Truesense#Ligero#SeedFunding#VC#AI

Venture Village Wall 🦄

@venturevillagewall · Post #4032 · 30.01.2025 г., 19:00

Cedar Money Raises $9.90M in Seed Funding 📈 Cedar Money, a stablecoin-powered payments platform, has secured $9.90M in a Seed funding round led by QED Investors. The funding aims to enhance cross-border payment solutions using digital assets. 💰 Other funding highlights include: - McQueen Labs Inc. raised $1.16M for luxury car investments. - Irreducible raised $24M for ZKP acceleration. - Mevvy secured $2.80M for MEV execution. - Clipper acquired by Sushi Labs. 🇨🇿 In a groundbreaking move, the Czech National Bank is considering investing up to 5% of its €146 billion reserves in bitcoin, making it the first Western central bank to officially do so if approved. 🔗 Read more about Cedar Money at ICO Analytics. #CedarMoney#SeedFunding#Stablecoin#Crypto#Bitcoin#CzechRepublic#Investment#Fintech#Payments#DigitalAssets#McQueenLabs#Irreducible#Mevvy#SushiLabs#VC#Innovation#Economy#Blockchain#Regulation#FundingRound