TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #381 · 23 окт.

Установить свойства виджета в PySide можно не только через соответствующие методы и конструктор класса. Можно их изменять с помощью метода setProperty по имени. btn = QPushButton("Click Me") btn.setProperty("flat", True) Это аналогично вызову btn.setFlat(True) Если указать несуществующее свойство, то оно просто создается btn.setProperty("btnType", "super") Получить его значение можно методом .property(name) btn_type = btn.property("btnType") Когда это может быть полезно? ▫️Можно просто хранить какие то данные в виджете и потом их доставать обратно widget = QWidget() widget.setProperty('my_data', 123) print(widget.property('my_data')) ▫️ Назначая эти свойства разным виджетам можно потом отличить виджеты во время итераци по ним. Например, найти все кнопки со свойством my_data="superbtn". Но ведь вместо кастомного свойства можно использовать objectName, будет тот же результат. Да, но y ObjectName есть ограничение - только строки. ▫️ Если нам потребуется не просто поиск а, например, сортировка по числу, то свойства позволяют нам это сделать. Поддерживается любой тип данных widget.setProperty('my_data', {'Key': 'value'}) widget.setProperty('order', 1) all_widgets.sort(key=w: w.property('order')) Но ведь Python позволяет всё вышеперечисленное сделать простым созданием атрибута у объекта widget.order = 1 widget.my_data = 123 Да, но я думаю что не надо объяснять почему не стоит так делать. К тому же, если у виджета нет свойства то метод .property(name) вернет None, а отсутствующий атрибут выбросит исключение. ▫️ Действительно полезное применение кастомным свойствам - контроль стилей. Здесь атрибутами не обойтись, нужны именно свойства. Дело в том, что в селекторах стилей можно указывать конкретные свойства виджетов на которые следует назначать стиль. Просто запустите этот код from PySide2.QtWidgets import * if __name__ == "__main__": app = QApplication([]) widget = QWidget(minimumWidth=300) layout = QVBoxLayout(widget) btn1 = QPushButton("Action 1") btn2 = QPushButton("Action 2") btn3 = QPushButton("Action 3", flat=True) layout.addWidget(btn1) layout.addWidget(btn2) layout.addWidget(btn3) # добавим кастомное свойство одной кнопке btn1.setProperty("btnType", "super") # добавляем стили widget.setStyleSheet( """ QPushButton[btnType="super"] { background-color: yellow; color: red; } QPushButton[flat="true"] { color: yellow; } """ ) widget.show() app.exec_() С помощью селектора мы избирательно назначили стили на конкретные кнопки. Как получить список всех кастомный свойств? Функция получения списка кастомных свойств отличается от получения дефолтных. def print_widget_dyn_properties(widget): for prop_name in widget.dynamicPropertyNames(): property_name = prop_name.data().decode() property_value = widget.property(property_name) print(f"{property_name}: {property_value}") #tricks#qt

Hashtags

Резултати

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

Пребарај: #egld

当前筛选 #egld清除筛选
Pro Analysis

@proanalysistrader · Post #28200 · 15.11.2024 г., 10:10

#EGLD/USDT analysis : #EGLD is currently in an uptrend, trading above the 200 EMA. The price has successfully broken out and retested the previous swing high resistance levels. It is anticipated that the price will bounce back from this point and continue its bullish momentum, aiming to test the recent swing high. TF : 4h Entry : $28.44 Target : $33.75 SL : $26.00

Hashtags

Pro Analysis

@proanalysistrader · Post #28040 · 19.10.2024 г., 17:47

#EGLD/USDT analysis : #EGLD has broken out and retested the support zone. It is now expected to bounce from this support zone and test the previous swing high level. TF : 1D Entry : $26.26 Target : $28.14 SL : $25.12

Hashtags

American Crypto©

@americancryptotrading · Post #27602 · 27.04.2026 г., 08:54

🇺🇸#EGLD/USDT is holding above the lowerboundary of the descendingchannel formation on the weekly chart💁‍♂️ Rebound incoming🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27551 · 03.03.2026 г., 10:13

🇺🇸#EGLD/USDT has found support at the lowerboundary of the descendingchannel formation on the weekly timeframe👨‍💻 A leg up is forming✈️ American Crypto©

Hashtags

Elf Crypto VIP

@elfcryptovip · Post #12553 · 09.04.2026 г., 11:50

#EGLD Weekly Support Zone Retest🧐 MultiversX is testing the lowerboundary of the descendingchannel formation on the weekly timeframe👨‍💻 This area serves as a launchpad for a potential bullish reversal🔍 A confirmed rebound could propel the price toward targets at $7, $12, $22, $38, $58, $77, $120, and $200🎯

Hashtags

Elf Crypto VIP

@elfcryptovip · Post #11740 · 19.07.2025 г., 11:37

#EGLD MultiversX has successfully broken out of the descendingchannel pattern on the daily timeframe Price action shows strong bullish momentum after breaching the descending resistance Expect a continuation toward targets at $20.50, $26.00, and $38.00🎯

Hashtags

Crypto Profit Coach™

@cryptoprofitcoach · Post #8905 · 04.11.2023 г., 17:16

#EGLD👈 https://www.binance.com/en/trade/egld_BTC Buying Zone 930- 985 👆 Buy in parts 👈Strictly follow as directed 👆 Showing bullish momentum Sell 🤑 1040-1100 🤑 1100 - 1200 🤑 1200-1300 🚀 1300 - 1400 & above Bullish Over 870

Hashtags

Maximus Trade 🌕

@maximustrade1 · Post #7648 · 20.10.2023 г., 11:46

#EGLD LONG ▪Вход: 25$ ▪Тейк: буду обновлять. ▪Стоп: 22$ пс: до хеллуина, можно подержать. LINK - Maximus Trade|TWITTER

Hashtags

Crypto

@signal_bitcoins · Post #2488 · 24.01.2024 г., 08:42

#EGLD bounced back from the Green zone on 12H Time frame,we expect more pumps after breakup from the Trendline,send it 💎 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

Crypto

@signal_bitcoins · Post #1785 · 10.12.2023 г., 16:32

#EGLD is trying to break up the Supply zone on Weekly time frame,in the case of breakout we may see another bullish leg🚀 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

Crypto

@signal_bitcoins · Post #1325 · 08.08.2023 г., 20:34

💰#EGLD price bounced from the support of $30.50-$31 area. The local resistance is $32.89-$33.50 area and the price is rejected from there. 👀 The major resistance is the $37.10-$38 area. You can open long positions near the support area with tight stop loss. 📈 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

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