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

Резултати

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

Пребарај: #req

当前筛选 #req清除筛选
Coin Sonar

@CoinSonar · Post #244235 · 18.04.2026 г., 15:11

#REQ | Volume spike (USDT PAIR) 1597 times the average volume 120.14K USDT traded in 1 min └Buying vol: 97.73K USDT 🟢 Boost score: 8/10 24h Vol: 108.28K USDT (Binance) Price: 0.0835 (-0.9% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #27985 · 04.10.2024 г., 16:22

#REQ/USDT analysis : #REQ is currently encountering resistance at the resistance zone. The price is likely to experience a rejection from this level and continue its bearish momentum. Previous low is expected to be tested. Wait for price retracement for entry. TF : 15min Entry : $0.0963 Target : $0.0928 SL : $0.0985

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #9119 · 13.02.2025 г., 14:03

#REQ👈 https://www.binance.com/en/trade/REQ_BTC Buy Zone 👉 98-101 Showing upcoming bullish momentum 🔥 Strictly follow as directed 👆 Sell 🤑107-110 🤑 110-120 🤑 120-130 🤑 130-140 🚀 140-150 & above Bullish above 94🔼 Death Zone below- 94🔽🔽

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #9010 · 03.05.2024 г., 17:12

#REQ👈 https://www.binance.com/en/trade/REQ_BTC Buy Zone 👉 200-208 Showing upcoming bullish momentum 🔥 Strictly follow as directed 👆 Sell 🤑227-230 🤑 230-250 🤑 250-280 🤑 280-300 🚀 300-330 & above Bullish above 195 🔼

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8978 · 22.03.2024 г., 17:46

#REQ👈 https://www.binance.com/en/trade/REQ_BTC Buy Zone 👉 195-210 Showing upcoming bullish momentum 🔥 Strictly follow as directed 👆 Sell 🤑 230-250 🤑 250-280 🤑 280-300 🚀 300-330 & above Bullish above 190🔼

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8774 · 17.04.2023 г., 17:18

#REQ👈 https://www.binance.com/en/trade/REQ_BTC Buy Zone 👉 345-350 Showing upcoming bullish momentum 🔥 Strictly follow as directed 👆 Sell 🤑 370-385 🤑 385-410 🤑 410-450 🤑 450-490 🚀 490-530 & above Bullish above 330🔼

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8622 · 02.01.2023 г., 19:09

#REQ👈 https://www.binance.com/en/trade/REQ_BTC Buy Zone 👉 510-516 Showing upcoming bullish momentum Strictly follow as directed 👆 Sell 🤑540-570 🤑 570-620 🤑 620-670 🤑 670-720 🚀 720-770 & above Bullish above 500

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8560 · 05.12.2022 г., 17:36

#REQ👈 https://www.binance.com/en/trade/REQ_BTC Buy Zone 👉 530-545 Showing upcoming bullish momentum Strictly follow as directed 👆 Sell 🤑580-610 🤑 610-650 🤑 650-700 🤑 700-750 🚀 750-800 & above Bullish above 480 Signal Date 02/12/22

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8530 · 24.11.2022 г., 08:28

#REQ👈 https://www.binance.com/en/trade/REQ_BTC Buy Zone 👉 500-528 Showing upcoming bullish momentum Strictly follow as directed 👆 Sell 🤑580-610 🤑 610-650 🤑 650-700 🤑 700-750 🚀 750-800 & above Bullish above 480 Signal Date 23/11/22

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8506 · 21.11.2022 г., 12:35

#REQ👈 https://www.binance.com/en/trade/REQ_BTC Buy Zone 👉 500-535 Showing upcoming bullish momentum Strictly follow as directed 👆 Sell 🤑588-610 🤑 610-650 🤑 650-700 🤑 700-750 🚀 750-800 & above Bullish above 480 Signal Date 21/11/22

Hashtags

12
ПретходнаСтраница 1 од 2Следна