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

Резултати

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

Пребарај: #venture

当前筛选 #venture清除筛选

🚀Startaplarni venchur moliyalashtirish forumiga taklif qilamiz! 💡2024-yil 15-noyabr kuni Biznes va tadbirkorlik oliy maktabi Koreya xalqaro hamkorlik agentligi (KOICA) ko‘magida startaplarni venchur moliyalashtirish forumini tashkil etadi. 📈Forumning maqsadi - startap loyihalarni venchur moliyalashtirish ekotizimini rivojlantirishni muhokama qilish, O‘zbekistonda startap loyihalarga investitsiyalarni jalb qilish bo‘yicha venchur investitsiyabozori va startap ekotizimi ishtirokchilari o‘rtasida fikr va tajriba almashishdan iboratdir. 💠Forumning asosiy mavzulari: Global venchur investitsiyalar tendensiyalari; Koreya Respublikasi venchur ekotizimi rivojlanishining o‘ziga xos xususiyatlari; Startap loyihalarni moliyalashtirishda O‘zbekistondagi yetakchi venchur kompaniyalarining asosiy yo‘nalishlari va uslublari; Startaplar va ularning biznes modellarini baholashda zamonaviy yondashuvlar. 💼Kimlar ishtirok etishi mumkin? vazirliklar, idoralar va davlat tashkilotlari vakillari; startaplar; investorlar; moliya institutlari vakillari; biznes maslahatchilari; venchur moliyalashtirishga qiziqish bildirganlar. ➡️Joylar soni cheklangan! 📄Forumga ro ‘yxatdan o‘tish 🗓Sanasi: 2024-yil, 15-noyabr ⏱Vaqti: 09:00-12:00 📍Joylashuv: Biznes va tadbirkorlik oliy maktabi (5-qavat) 📞Telefon: +998 71 239-23-07 🇬🇧Eng 🇷🇺Ru #GraduateSchool#Startup#Venture#Fund 🔝Web-site |🔝Facebook | 🔝Instagram | 🔝Youtube

DWF Labs Broadcast

@Dwflabs · Post #121 · 29.12.2022 г., 03:01

[22 Dec to 28 Dec] DWF Crypto Snapshot 🗞️ Here's a peek at our final #crypto report for the year by DWF Labs Managing Partner Andrei Grachev here. Here's a round up of highlights 🙌 💠Metamask Inches Closer To Being The De Facto #Digital Wallet With Novel Non-EVM Solution 💠GameFi and #NFTs Take Top Spots In Attracting #Venture Investment, According To The Block Research’s 2023 Digital Assets Outlook 💠Solana Network Picks Up In Terms Of NFT And #GameFi Utility 💠Memecoins Eager To Prove Utility With Baby Doge’s Latest Partnership 💠World Cup Event Shows #Digital Assets Augment Experience For Football Fans 💠BNB Chain’s Focus On Technological Improvements Pays Off By Surpassing #Ethereum 💠Institutions Leads The Charge In Making #DeFi A Legitimate Financial Space, Says Chainalysis’ Latest Report Missed last week's snapshot? Read here. Follow us on Medium here. Stay up-to-date on the latest DWF Labs updates: Website| Twitter | Linkedin | Telegram

Venture Village Wall 🦄

@venturevillagewall · Post #3357 · 18.12.2024 г., 12:07

Fix AI Secures $500K Funding 🔹 Fix AI has successfully closed a funding round amounting to $500K on December 4, 2024. For more details, visit their website: Fix AI #Funding#AI#Investment#Tech#Startups#Innovation#Finance#Capital#Growth#Venture #2024 #Business#Entrepreneurship#Development#Project#Startup#Ecosystem#Technology#FundingRound#Launch

Venture Village Wall 🦄

@venturevillagewall · Post #3367 · 18.12.2024 г., 12:08

Pearson Labs Secures $500K Funding Pearson Labs has successfully raised $500K in its latest funding round as of December 4, 2024. For more details, visit their website: pearsonlabs.ai #Funding#PearsonLabs#Investment#Capital#Tech#AI#Startups#Business#Round #2024 #Venture#Innovation#Growth#Market#Finance#Development#Research#Strategy#Entrepreneurship#Digital

Venture Village Wall 🦄

@venturevillagewall · Post #3407 · 18.12.2024 г., 12:10

AISTI Raises $30.37M AISTI secures funding of $30.37 million on December 12, 2024. For more details, visit AISTI's official site. #AISTI#Funding#Investment#Tech#Corporate#Finance #2024 #Round#Capital#Venture#Startups#Growth#Innovation#Business#Synergy#Development#Ecosystem#Partnerships#Strategy#Market

Venture Village Wall 🦄

@venturevillagewall · Post #3346 · 18.12.2024 г., 12:06

Bramble Secures $500K Funding Bramble has closed a $500K funding round as of December 4, 2024. The company is focused on improving the home buying experience. #Funding#Bramble#HomeBuying#Investment#RealEstate#Startup#Fintech#Innovations#Tech#Market#Development#FundingRound#Business#Venture#Growth#Capital#Finance#Equity#FundingNews

Venture Village Wall 🦄

@venturevillagewall · Post #3388 · 18.12.2024 г., 12:09

Heecap Secures $2.92M Funding Heecap has successfully raised $2.92 million in funding aimed at enhancing the activation of respiratory muscles. This investment round took place on December 9, 2024. #Heecap#Funding#Respiratory#Health#Investment#Startup#MuscleActivation#Tech#Innovation #2024 #Project#Venture#Biotech#Wellness#Medical#Research#Development#Physiology#Healthcare#FundingRound