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

Резултати

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

Пребарај: #petdog

当前筛选 #petdog清除筛选

The kennel.ai core team and team of DogShow influencers can be contacted easily through Telegram, Twitter, YouTube etc or directly by email at [email protected] Feel free to offer marketing and promotional services Admin @NEO55555 #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

The Kennel.Ai ecosystem has a stabil Token https://kennel.ai/tokenomics …use of KC stabil Token is for making either donations to street dog feeding campaign https://kennel.ai/to-earn or for buying products ( on chain ) from the Webshop using crypto https://kennel.ai/shop #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

Happy December 01 🐶🦴 The kennel.ai core team and team of DogShow influencers can be contacted easily through Telegram, Twitter, YouTube etc or directly by email at [email protected] Feel free to offer marketing and promotional services Admin @NEO55555 #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

One of the core features of the Kennel.ai ecosystem is charitable donations to community that give their waste table food to street dogs https://kennel.ai/to-earn Millions of dog lovers worldwide care about the plight of abandoned street dogs …that’s why Team have created the offer of being the middle man for European and American dog lovers that like to donate money to sponsor the feeding of street dogs in places like India , Romania and other countries where the street dogs need help… at least join the platform today to show your support for this campaign 🐾 https://kennel.ai/login Have a great day …. #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

The Pet dog Industry problem is that the data collected is held on hundreds of independent servers Worldwide 25 million new pet dogs are registered with the worlds fragmented kennel clubs each year This is a multi billion dollar industry, the average price for a pet dog now in 2023 Europe and USA is $1000-1500$ In the Future every Pet dog will be physical digital asset , data on chain Kennel.Ai creates a unique editable NFT for each new pet dog registered You can join the Kennel.Ai ecosystems and help tobtest the platform by registering a dog, start to earn tokens for the data provided by you and supplemental tokens for the data provided by owners of any offspring produced by your dog https://kennel.ai/login Kennel.Ai aims to provide one place on chain for all the worlds kennel clubs members, breeders and pet dog owners to record and own their dog life data… #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

One of the core features of the Kennel.ai ecosystem is charitable donations to community that give their waste table food to street dogs https://kennel.ai/to-earn Millions of dog lovers worldwide care about the plight of abandoned street dogs …that’s why Team have created the offer of being the middle man for European and American dog lovers that like to donate money to sponsor the feeding of street dogs in places like India , Romania and other countries where the street dogs need help… at least join the platform today to show your support for this campaign 🐾 https://kennel.ai/login Have a great day …. #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

The kennel.ai core team and team of DogShow influencers can be contacted easily through Telegram, Twitter, YouTube etc or directly by email at [email protected] Feel free to offer marketing and promotional services Admin @NEO55555 #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

The kennel.ai core team and team of DogShow influencers can be contacted easily through Telegram, Twitter, YouTube etc or directly by email at [email protected] Feel free to offer marketing and promotional services Admin @NEO55555 #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

One of the core features of the Kennel.ai ecosystem is charitable donations to community that give their waste table food to street dogs https://kennel.ai/to-earn Millions of dog lovers worldwide care about the plight of abandoned street dogs …that’s why Team have created the offer of being the middle man for European and American dog lovers that like to donate money to sponsor the feeding of street dogs in places like India , Romania and other countries where the street dogs need help… at least join the platform today to show your support for this campaign 🐾 https://kennel.ai/login Have a great day …. #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

In our busy lives reminders are essential How about reminders for when your pet dogs vaccinations are due for boost Kennel.ai records dog life data on chain such as vaccination type and expiry date Platform reminds pet dog owners when either a vaccination or booster is needed via mobile and by a notification when user is logged in to platform with Google or Web3 metamask https://kennel.ai/login Kennel.Ai aims to provide one place on chain for all the worlds kennel clubs members, breeders and pet dog owners to record and own their dog life data… #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

The Pet dog Industry is massive , behind every pet dog sale their is a professional pet dog breeder 25 million new pet dogs are registered with the worlds fragmented kennel clubs each year This is a multi billion dollar industry, the average price for a pet dog now in 2023 Europe and USA is $1000-1500$ In the Future every Pet dog will be physical digital asset , data on chain Kennel.Ai creates a unique editable NFT for each new pet dog registered You can join the Kennel.Ai ecosystems and register a dog, start to earn tokens for the data provided by you and for the data provided by owners of any offspring produced by your dog https://kennel.ai/login Registration process uses Artificial intelligence to help end genetic breeding faults by suggesting near perfect breeding mate for your dog #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

One of the core features of the Kennel.ai ecosystem is charitable donations to community that give their waste table food to street dogs https://kennel.ai/to-earn Millions of dog lovers worldwide care about the plight of abandoned street dogs …that’s why Team have created the offer of being the middle man for European and American dog lovers that like to donate money to sponsor the feeding of street dogs in places like India , Romania and other countries where the street dogs need help… at least join the platform today to show your support for this campaign 🐾 https://kennel.ai/login Have a great day …. #dogs #$DOGS #petdog#dogbreeder#kennelclub#blockchain#Ai

123•••56
ПретходнаСтраница 1 од 6Следна