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

Резултати

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

Пребарај: #phb

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

@CoinSonar · Post #244225 · 18.04.2026 г., 14:50

#PHB | Volume spike (USDT PAIR) 32 times the average volume 129.92K USDT traded in 15 min └Buying vol: 92.16K USDT 🟢 Boost score: 5/10 24h Vol: 385.73K USDT (Binance) Price: 0.123 (-6.6% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #244006 · 18.04.2026 г., 06:15

#PHB | Volume spike (USDT PAIR) 32 times the average volume 128.74K USDT traded in 15 min └Buying vol: 69.89K USDT 🟢 Boost score: 4/10 24h Vol: 385.73K USDT (Binance) Price: 0.117 (-6.6% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243480 · 17.04.2026 г., 06:22

#PHB | Volume spike (USDT PAIR) 32 times the average volume 131.17K USDT traded in 15 min └Buying vol: 92.51K USDT 🟢 Boost score: 6/10 24h Vol: 385.73K USDT (Binance) Price: 0.115 (-6.6% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28329 · 09.12.2024 г., 08:32

#PHB/USDT analysis : #PHB is currently in an uptrend, consistently trading above the 200-day exponential moving average (EMA). The price has recently approached a key support zone, which is expected to act as a rebound point. This suggests a likely continuation of its bullish momentum, with the potential to challenge previous highs. TF : 2H Entry : $2.286 Target : $2.580 SL : $2.580

Hashtags

Pro Analysis

@proanalysistrader · Post #28303 · 03.12.2024 г., 09:41

#PHB/USDT analysis : #PHB is currently in an uptrend, consistently reaching new highs while trading above the 200-period exponential moving average (EMA). The price has recently rebounded from a key support zone, indicating strong bullish momentum. For a long entry, it is advisable to wait for the price to retest this support zone. TF : 1h Entry : $2.195 Target : $2.440 SL : $2.065

Hashtags

Pro Analysis

@proanalysistrader · Post #27877 · 26.08.2024 г., 13:28

#PHB/USDT analysis : #PHB is currently forming a double top pattern within the resistance zone. It is expected to be rejected from there and continue its bearish momentum to test previous lows. TF : 2H Entry : $1.459 Target : $1.222 SL : $1.613

Hashtags

Pro Analysis

@proanalysistrader · Post #27688 · 21.06.2024 г., 02:00

#PHB/USD analysis - #PHB is on a downtrend, trading below the 200 EMA. Right now, it's having a pullback and has retraced to previous support levels near the 200 EMA. The price is facing resistance near the 200 EMA and seems like it might start going down. Just wait for a small price pullback before considering a short entry. The price is likely to test previous lows soon. TF : 2h Entry : $1.911 Target : $1.584 SL : $2.138

Hashtags

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