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

Резултати

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

Пребарај: #farcaster

当前筛选 #farcaster清除筛选
Crypto Drop Club

@drop_cryptogo · Post #2261 · 23.01.2026 г., 17:54

🗣#Farcaster: Project Acquired by Neynar — What’s Next Recently, the Farcaster founder announced a shift from a social platform toward a crypto-wallet–first model. Yesterday, another major update followed — Farcaster has been acquired by Neynar Neynar is the core infrastructure and API provider for Farcaster (similar to Alchemy or Infura), powering most applications, bots, and tools across the ecosystem. What changes after the acquisition: 🟢 Farcaster founders step away from day-to-day operations to focus on new projects. 🟢 Part of the team joins Neynar, while others exit. 🟢 The protocol will continue operating and is not being shut down. 🟢 The $180 million in raised funding will be returned to investors 🟢 According to the founders, Neynar is the best-positioned team to scale Farcaster further, with a strong focus on developers and infrastructure. What to do now: ✔ Check your Neynar points here Neynar is expected to publish a detailed roadmap soon, outlining their vision for the future of the Farcaster protocol. Crypto Drop Club 👉 SUBSCRIBE

Hashtags

Airdrop3 LTD

@airdrop3ltd · Post #522 · 31.05.2024 г., 05:01

#Farcaster, Blockchain-Based Social Media Startup, Raises $150M, Led by Paradigm 🚀 𝗚𝗲𝘁 𝗿𝗲𝗮𝗱𝘆 𝗳𝗼𝗿 𝘁𝗵𝗲 𝗙𝗮𝗿𝗰𝗮𝘀𝘁𝗲𝗿 (𝗪𝗮𝗿𝗽𝗰𝗮𝘀𝘁𝗲𝗿) 𝗘𝘅𝗽𝗲𝗰𝘁𝗲𝗱 🪂𝗔𝗶𝗿𝗱𝗿𝗼𝗽! 🎁 🔗 𝗖𝗿𝗲𝗮𝘁𝗲 𝗔𝗰𝗰𝗼𝘂𝗻𝘁 𝗵𝗲𝗿𝗲: https://warpcast.com/~/invite-page/273205?id=6a9285bc 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗔𝗶𝗿𝗱𝗿𝗼𝗽 𝗤𝘂𝗲𝘀𝘁 - Connect Metamask wallet => Claim Handle =>chain OP - Complete all task "Quest" & "Items" => get more reward points - Get link invite & get more rewards - DONE

Hashtags

Crypto Officer™

@cryptoofficer · Post #1483 · 08.05.2024 г., 17:38

📦UXLINK PROJECT — MINT IS LIVE ✅ 🖥Guess what's finally happening? After months of keeping tabs on it, UXLINK is gearing up for some major airdrops! Plus, mark your calendar, the Minting of their NFTs, the golden tickets for this event, just live! ============================= ❓Why should you care? 🔘TGE is right around the corner, so grab the chance to join in and maybe even get ahead! 🔘The next super social platform is about to emerge, are you following? 🔘 Based on the latest insights from the whitepaper, The maximum supply of $UXLINK governance tokens is 1 billion, 40% of which will be distributed to community users. 🔘 Data analysis, compared to similar social projects, $Cyber's current market capitalization is about $1 billion, #Farcaster's last round valuation has already reached $1 billion, UXLINK is projected to skyrocket past $1.5 billion, possibly even hitting $2 billion post #TGE📈 Which mean UXLINK >= 1-1.5USDT ============================= 🌐Website || ✈️Telegram || ✖️Twitter ============================= 💎Go to mint your NFT and get airdrop: Update : Uxuy × Okx ✅Login : https://dapp.uxlink.io/uxtask/okx ✅ My Account > Withdraw Uxuy ✅ Fee ETH Arb ✅ Mint NFT With UXUY Token : https://dapp.uxlink.io/uxnft ============================= 💎Giveaway 5 WL for 5 people ➡️Join our Tg :https://t.me/uxlinkofficial2 🔴Note:Please do your own research (DYOR) before joining to any project, also projects are 100% free. Don't send any fee or penny for receiving any token.

Airdrop Ninja™

@airdropsalertteam · Post #9386 · 08.05.2024 г., 17:38

📦UXLINK PROJECT — MINT IS LIVE ✅ 🖥Guess what's finally happening? After months of keeping tabs on it, UXLINK is gearing up for some major airdrops! Plus, mark your calendar, the Minting of their NFTs, the golden tickets for this event, just live! ============================= ❓Why should you care? 🔘TGE is right around the corner, so grab the chance to join in and maybe even get ahead! 🔘The next super social platform is about to emerge, are you following? 🔘 Based on the latest insights from the whitepaper, The maximum supply of $UXLINK governance tokens is 1 billion, 40% of which will be distributed to community users. 🔘 Data analysis, compared to similar social projects, $Cyber's current market capitalization is about $1 billion, #Farcaster's last round valuation has already reached $1 billion, UXLINK is projected to skyrocket past $1.5 billion, possibly even hitting $2 billion post #TGE📈 Which mean UXLINK >= 1-1.5USDT ============================= 🌐Website || ✈️Telegram || ✖️Twitter ============================= 💎Go to mint your NFT and get airdrop: Update : Uxuy × Okx ✅Login : https://dapp.uxlink.io/uxtask/okx ✅ My Account > Withdraw Uxuy ✅ Fee ETH Arb ✅ Mint NFT With UXUY Token : https://dapp.uxlink.io/uxnft ============================= 💎Giveaway 5 WL for 5 people ➡️Join our Tg :https://t.me/uxlinkofficial2 🔴Note:Please do your own research (DYOR) before joining to any project, also projects are 100% free. Don't send any fee or penny for receiving any token.