TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #380 · 21 окт.

Регулярно приходится писать и ревьюить код, где используется PySide2-6. Заметил, что в подавляющем большинстве случаев настройка создаваемых базовых виджетов происходит через методы. Думаю, всем знаком такой способ. Простой пример с кнопкой: button = QPushButton("Click Me") button.setMinimumWidth(300) button.setFlat(True) button.setStyleSheet("font-size: 20pt") button.setToolTip("Super Button") button.clicked.connect(lambda: print("Button clicked")) Но есть и альтернативный способ - настройка через свойства. Это просто ключевые аргументы конструктора класса. Хоть они и не указаны в документации как аргументы, но они есть) Этот код делает тоже самое но с помощью Property button = QPushButton( "Click Me", minimumWidth=300, flat=True, styleSheet="font-size: 20pt", toolTip="Super Button", clicked=lambda: print("Button clicked"), ) Где это может быть полезно ▫️ Это выглядит более аккуратно и коротко, уже повод использовать ▫️ Может использоваться в заполнении лейаута, когда нам не нужно никакое другое взаимодействие с виджетом и поэтому сохранять его в переменную не требуется. Например, лейбл или кнопка. widget = QWidget(minimumWidth=400) layout = QHBoxLayout(widget) layout.addWidget(QLabel("Button >", alignment=Qt.AlignRight)) layout.addWidget(QPushButton("Click Me", clicked=lambda: print("Button clicked"))) widget.show() Либо так widget = QWidget(minimumWidth=400) layout = QHBoxLayout(widget) for wd in ( QLabel("Button >", alignment=Qt.AlignRight), QPushButton("Click Me", clicked=lambda: ...) ): layout.addWidget(wd) widget.show() ▫️ Можно хранить настройки в каком-то конфиге или генерировать на лету, после чего передавать как kwargs. kwargs = {"text": "Hello " * 30, "wordWrap": True} my_label = QLabel(**kwargs) Как получить полный список доступных свойств? Эта функция распечатает в терминал все свойства виджета и их текущие значения def print_widget_properties(widget): meta_object = widget.metaObject() for i in range(meta_object.propertyCount()): property_ = meta_object.property(i) property_name = property_.name() property_value = property_.read(widget) print(f"{property_name}: {property_value}") #tricks#qt

Hashtags

Резултати

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

Пребарај: #nodepay

当前筛选 #nodepay清除筛选
Airdrop Gold : Crypto Airdrop

@airdropgoldchannel · Post #157512 · 09.09.2024 г., 18:31

⭐️#Nodepay Airdrop: Learn To ai And Earn #Airdrop 1. Register At NodePay 2. download the chrome extension in. pc/android (kiwi/mises browser) 3. login with your account 4. Browse Internet to earn 5.Enjoy @AirdropGoldChannel

Crypto Profits Hub

@Futurentry · Post #4205 · 26.12.2024 г., 18:40

NodePay Airdrop Listing Date: Latest 2024 Release Details Discover when NodePay airdrop listing date will be announced and stay updated on this promising DeFi project's token distribution and exchange availability in 2024 Contact admin if you have any questions : @Riley_Fe #airdrops#bitcoin#blockchain#crypto#Nodepay#technology

Crypto Profits Hub

@Futurentry · Post #4180 · 24.12.2024 г., 16:40

When Will New Nodepay Listing Date Be Announced? Discover when Nodepay listing date will be announced and learn about this innovative payment platform's journey toward public trading. Stay updated on market entrance details Contact admin if you have any questions : @Riley_Fe #airdrops#bitcoin#blockchain#crypto#Nodepay#technology

Crypto Profits Hub

@Futurentry · Post #4164 · 23.12.2024 г., 08:46

NodePay Airdrop Date: New Token Distribution Info Stay informed about the nodepay airdrop date and distribution schedule. Get essential details on eligibility criteria, token allocation, and how to participate in this upcoming crypto event Contact admin if you have any questions : @Riley_Fe #airdrops#bitcoin#blockchain#crypto#Nodepay#technology

Crypto Profits Hub

@Futurentry · Post #4129 · 20.12.2024 г., 10:43

NodePay Airdrop: Claim Free Crypto Rewards Now Join the NodePay airdrop and earn free crypto rewards by participating in simple tasks. Get your share of tokens by completing social media activities and community engagement Contact admin if you have any questions : @Riley_Fe #airdrops#bitcoin#blockchain#crypto#Nodepay#technology

Crypto Profits Hub

@Futurentry · Post #4193 · 25.12.2024 г., 18:45

NodePay Airdrop Listing Date: New Upcoming 2024 Stay updated on the nodepay airdrop listing date and upcoming schedule for 2024. Get ready to participate in this highly anticipated token distribution event and secure your rewards Contact admin if you have any questions : @Riley_Fe #airdrops#blockchain#crypto#defi#Nodepay#technology

Venture Village Wall 🦄

@venturevillagewall · Post #3731 · 27.12.2024 г., 19:00

AI Startups Secure Major Funding Deals 🚀 1. Inferix: Decentralized GPU network raising $2.60M led by DePIN X. 2. PoSciDonDAO: Receives undisclosed funding from BoostVC for personalized medicine. 3. Skynet: Autonomous AI agent protocol secures $1.20M in Pre-seed funding. 4. Nodepay: AI training decentralized network raises $7M, led by IDG Capital and MVP. 5. The Grid: Web3 metadata directory collects $624K in Angel funding. For more on the funding rounds: source #AI#Funding#Inferix#PoSciDonDAO#Skynet#Nodepay#TheGrid#DeFi#Crypto#VC

Airdrop Center

@centralchanel · Post #15821 · 04.01.2025 г., 20:20

January Listing 🔥 ✅#Nodepay: 6 January ✅#MomoAi: 6 January ✅#Xterio: 8 January ✅#Sidekick : 8 January ✅ $Vertus :13 January ✅#Seed : 15 January ✅#Xcoin : 20 January ✅#Tapswap : 23 January ✅#Wcoin : 25 January ✅#CommunityGaming : 28 January Unofficial Listing ✅#PAWS ✅#UXUY ✅#Yuligo ✅#MemeWar ✅#DuckChain ✅#Celia Stay connected