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

Резултати

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

Пребарај: #blz

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

@proanalysistrader · Post #27872 · 25.08.2024 г., 15:26

#BLZ/USDT analysis : #BLZ is in an uptrend, making Higher Highs (HHs) and Higher Lows (HLs) above the 200ema. The price broke the trendline after bouncing from a support zone. It's likely to keep up its bullish momentum and aim for previous highs. TF : 15min Entry : $0.1547 Target : $0.1600 SL : $0.1507

Hashtags

Coinlegs Cryptocurrency Signals

@coinlegs · Post #10032 · 01.03.2024 г., 06:21

#BLZ | S/R Breakout Confirmation Detected🧐 No FOMO, No FUD. Everyday we are getting bunch of trade opportunities whatever the market conditions are. Life? Difficult. Trade? Simple. Try out algorithm based detections, enjoy profits 💸

Hashtags

Coinlegs Cryptocurrency Signals

@coinlegs · Post #9705 · 12.01.2024 г., 13:56

#BLZ👀 It seems to be in the accumulation phase lately. If the candle closes below the support, we can say Stop-Loss. Then there will be a downside opportunity 📉 How did we come up with this analysis? We used the Support and Resistance detection of Coinlegs algorithm 👑 Check it out today.

Hashtags

We want you

@we_want_youu · Post #4591 · 05.09.2024 г., 13:38

#BLZ follows a descending channel pattern and seems to be gearing up for a bullish breakout. The next key target to watch after the breakout is the internal minor resistance at $0.1550 . If #BLZ holds steady at $0.1110, we could be on the brink of a significant bullish rally, much like those explosive moves we've seen before. A breakout above the crucial resistance at $0.150 could pave the way for a run toward even higher resistance zones -caution is essential. If momentum weakens at this critical demand zone, we might see a pullback to the lower demand area around $0.0800-

Hashtags

Crypto

@signal_bitcoins · Post #1948 · 21.12.2023 г., 12:33

#BLZ is moving up in the bullish channel on Daily time frame, price has a good support on Green zone,we expect another pump from this area 🚀 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

Crypto

@signal_bitcoins · Post #1857 · 15.12.2023 г., 12:43

#BLZ is moving up in a broadening channel,we expect it will pump again from the bottom of this pattern..⏳ ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

CRYPTO SIGNALS FREE

@crypto_vip_signals_free · Post #865 · 20.02.2022 г., 17:25

You missed one more quick profit 😢 almost (395%🔥)in 14x #BLZ/USDT (7 - 14)X 📉SHORT ➖➖➖➖➖➖➖➖➖➖ 💵Target 1=0.228✅ 💵Target 2=0.221✅ 💵Target 3=0.213✅ 💵Target 4=0.2046✅ 💵Target 5=0.189✅ 💵Target 6=0.175✅ 🔥394.38% Profits in (14X) 🔥 🔘Six target deatroyed within few days leaving us huge profits even in this worse market. 🔘It was a perfect call exactly from the top. We knew BLZ/usdt will fall hardly. This one made us huge profits🔥. 🔘Our premium members are literally printing money out of our perfect trades. 🔘For premium Contact @cryptomathh ➖➖➖➖➖➖➖➖ Crypto Signals Premium

Hashtags

Alex Kowalski | Trade

@kowalskitrade · Post #526 · 30.07.2024 г., 15:55

#BLZ On the coin there are signs of formation of ascending OF, liquidity removal from below, and reaction from the OB area, so let's try to open long, on removal of upper magnets 📈Sign up on Bybit to trade with me

Hashtags

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