Регулярно приходится писать и ревьюить код, где используется 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
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce Our #BinanceLive AMA with BOSS || 5th January 2025 at ( 1:00 PM UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 5th January , 2026 at (1:00 PM UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Project Team
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉BOSS
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝Clarnium on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
⏰ Must Join " BOSS Social Media Links :
🌐Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with Stake Cash Coin(SACO) || 1st December, 2025 at ( 2:00 PM UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 1st December , 2025 at (2:00 PM UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Project Team
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉Stake Cash Coin(SACO)
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝Stake Cash Coin(SACO) on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/live/video?roomId=2285385
⏰ Must Join " Stake Cash Coin(SACO)" Social Media Links :
❌Twitter
✉️Telegram
🌐Website
📷Instagram
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with AIO protocol || 21th November , 2025 at ( 1:00 PM UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 21th November , 2025 at (1:00 PM UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Chloe & Jade
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉AIO protocol
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝AIO protocol on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/en/live/video?roomId=2283711
⏰ Must Join " AIO protocol" Social Media Links :
❌Twitter
✉️Telegram
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with GIGGLE FUND || 16th November , 2025 at ( 6:00 PM UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 16th November , 2025 at (6:00 PM UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest :
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉GIGGLE FUND
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝GIGGLE FUND on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
⏰ Must Join " GIGGLE FUND" Social Media Links :
❌Twitter
🔥Website
✉️Telegram
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with Usd1swap || 13th November , 2025 at ( 1:00 PM UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 13th November , 2025 at (1:00 PM UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest :
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉Usd1swap
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝Usd1swap on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/en/live/video?roomId=2283379
⏰ Must Join " Usd1swap" Social Media Links :
❌Twitter
🔥Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with MetaPi || 10th November , 2025 at ( 2:00 PM UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 10th November , 2025 at (2:00PM UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Caitlyn
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉MetaPi
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝MetaPi on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/en/live/video?roomId=2283001
⏰ Must Join " MetaPi" Social Media Links :
❌Twitter
🔥Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with MetaPi || 14th October , 2025 at ( 2:00 PM UTC)
🔠
🔠
🔠
🔠🔠🔠
🔠🔠
🔠🔠
⏳ Time : 14th October , 2025 at (2:00 PM UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Caitlyn
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉MetaPi
✅Like & Retweet✅Twitter Post
✅ Follow
📝CryptoFight &
📝MetaPi on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/live/video?roomId=2280210
⏰ Must Join " MetaPi" Social Media Links :
❌Twitter🔥Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram✉️Channel
📝Twitter🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with Biokript-Bro || 09th October , 2025 at ( 3:00 PM UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 09th October , 2025 at (3:00 PM UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Adnan Alisic, CEO, Adnan_Biokript
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉Biokript-Bro
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝Biokript-Bro on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/en/live/video?roomId=2280011
⏰ Must Join " Biokript-Bro" Social Media Links :
❌Twitter
✉️Telegram
🔥Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with "CDL" at 11th February 2025 at ( 4:PM, UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 11th February 2025 ( 4: PM, UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 50$ USDT
🤵♂️Guest : CDL Team
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉CDL
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝CDL on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/en/live/video?roomId=2249344
⏰ Must Join "CDL" Social Media Links :
✉️Telegram
📝Twitter
🌐Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with "EvolveToken" at 3th February 2025 at ( 2:PM, UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 3th February 2025 ( 2:00 PM, UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Seth Founder Of Evolve
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉EvolveToken
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝EvolveToken on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/en/live/video?roomId=2248252&utm_campaign=binance_live
⏰ Must Join "EvolveToken" Social Media Links :
✉️Telegram
📝Twitter
🌐Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with "StohnCoin" at 6th February 2025 at (3 PM, UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 6th February 2025 ( 3:00 PM, UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Ing. Jozef Libant - CEO / Brett Weigel - COO / Jason Stanley - CIO / Alexander Almkvist - CTO
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝StohnCoin on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/en/live/video?roomId=2248211
⏰ Must Join "StohnCoin" Social Media Links :
📝Twitter
🌐Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight
⚠️
⚠️
⚠️
⚠️
⚠
🔔AMA ANNOUNCEMENT
🗣We are pleased to announce our #BinanceLive AMA with "POPG" at 21th February 2025 at ( 12 PM, UTC)
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
🔠
⏳ Time : 21th February 2025 ( 12 PM, UTC)
🏠 Venue
🔶Binance Live
💎 Reward : 100$ USDT
🤵♂️Guest : Petra Apostolovic - PR & Community and Gabriel Raimundi - Marketing
➡️There will be 3 segments. Last approximately for 45 minutes - 1 hours.
🟢Segment 1: Introduction Questions
🟢Segment 2: Twitter Questions
🟢Segment 3: Live Questions
📌Rules to follow AMA:
✅ Join
✉️CryptoFight
✉POPG
✅Like & Retweet
✅Twitter Post
✅ Follow
📝CryptoFight &
📝POPG on Twitter
📝 Ask Your Questions ( Here )
🔔 Set Reminder :
https://www.binance.com/en/live/video?roomId=2247598
⏰ Must Join "POPG" Social Media Links :
✉️Telegram
📝Twitter
🌐Website
⏰ Must JoinCrypto Fight Community :
✉️Telegram
✉️Channel
📝Twitter
🔶Binance Live
*️⃣Linktree
💥If You Want To Promote Your Project Or AMA Proposal
📞DM @Ryan_Fight