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

Резултати

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

Пребарај: #total

当前筛选 #total清除筛选
CryptoBull_360™

@cryptobull_360 · Post #48600 · 03.03.2026 г., 13:47

#TOTAL crypto market cap has broken out of a symmetrical triangle pattern with strong volume confirmation. The Ichimoku Cloud is now acting as support, indicating underlying strength. A successful retest of the breakout level would likely confirm the move and fuel a bullish rally across the crypto market. However, if the retest fails, we could see price slipping back inside the triangle, leading to further consolidation. Keep monitoring the price action closely for confirmation..

Hashtags

Pro Analysis

@proanalysistrader · Post #28095 · 30.10.2024 г., 11:45

#TOTAL Analysis: The TOTAL crypto market cap has broken out of its downtrend. After the breakout, it retested the trendline and then broke through the previous swing high, suggesting a potential upward move in the coming days.

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #15576 · 31.01.2024 г., 12:53

#TOTAL MARKET CAP UPDATE : Total MarketCap moved a anticipated, Index dipped down into the support zone and rejected it strongly, also, Made a quick flip above the structural resistance zone now. Currently, a retest happening and need to see it hodling above the zone then a min-term rally in the market. In case of Daily again closing below then a short correction will hit the market again. By Crypto Australia

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #15408 · 22.01.2024 г., 13:00

#TOTAL MARKET CAP UPDATE : Index changed the market structure flipped the bearish, and given a close below too. Moreover, if we look into weekly TF, Weekly says some huge rejection past few weeks and this might be the final one. Well, overall now market kinda turning bearish, so better wait for the market to switch the direction before entering any sort of full positioning entries. Next Zone Index can reach will be $1.46T - $1.49T Support Area. By Crypto Australia

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #15340 · 19.01.2024 г., 10:42

#TOTAL MARKET CAP UPDATE : Marketcap still in a bullish market structure, in we'll see the top view. There are some minor breaks in below but still tend to be bullish. Well, price might again text the $750B Support zone before going up. We still have room for price to reach the Resistance area of $950B Mark. Attempting fresh trades would be not preferred. By Crypto Australia

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #14962 · 27.12.2023 г., 10:00

#TOTAL MARKETCAP UPDATE : Marketcap moving into the positive side and even though 4H given a close below of the support area of $1.59T - $1.60T, but Daily giving a close above and multiple wick rejections, showing bullishness. Well, a whole lot of push is anticipated towards the major resistance zone of $1.75T - $1.78T, where alts could fly smoothly. By Crypto Australia

Hashtags

Crypto Australia🇭🇲🇭🇲

@CryptoAustralia · Post #14631 · 08.12.2023 г., 10:19

#TOTAL MARKETCAP UPDATE : #TOTAL MARKETCAP gone as per anticipated and pushed till the Resistance area around $1.46 - $1.48. Index flipped and retest the level and pushing. Well, its a already testing a resistance, but not a good one, so in coming Days/ Weeks we can see continuation towards the major Resistance area around $1.75 - $1.78. Currently, its looks like a tiny Head and Shoulder forming, so might gonna have a retracement a bit By Crypto Australia

Hashtags

Maximus Trade 🌕

@maximustrade1 · Post #7774 · 19.11.2023 г., 08:53

#TOTAL💭 ▪️Классно отрабатывают уровни и можно тем самым анализировать график биткоина по ТОТАЛу. ▪️Да, уровень 0.5 Фибоначчи всегда является магнитом. Как ни крути, цена всегда тестирует 0.5 фибо, так как, это является коррекцией падения с 69000$. ▪️Вопрос лишь в том, что произойдет раньше: тест 0,5 или 0,38? Сейчас мы стоим ровно в середине диапазона. Что будет первым? 0,382 - 🎃 0,5 - 🔥 LINK - Maximus Trade|TWITTER

Hashtags

Evening Trader Official

@eveningtrader_real · Post #6873 · 28.09.2025 г., 20:03

#TOTAL MARKET CAP ANALYSIS The total crypto market cap is rebounding from the support trendline of the symmetrical triangle, with the 100MA reinforcing this level as a key support. However, the Ichimoku Cloud remains a resistance barrier above the current price action. A decisive breakout above both the triangle and the cloud would confirm bullish momentum and open the door for further upside in the market.

Hashtags

CryptoNinjas Trading 🥷🏿

@cryptoninjastradingofficial1 · Post #5939 · 28.09.2025 г., 20:03

#TOTAL MARKET CAP ANALYSIS The total crypto market cap is rebounding from the support trendline of the symmetrical triangle, with the 100MA reinforcing this level as a key support. However, the Ichimoku Cloud remains a resistance barrier above the current price action. A decisive breakout above both the triangle and the cloud would confirm bullish momentum and open the door for further upside in the market.

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4497 · 16.08.2024 г., 19:06

#TOTAL MARKET CAP ANALYSIS The total cryptocurrency market cap is consolidating within a bull flag pattern. It is currently trading below the Ichimoku Cloud, which is acting as a resistance barrier above the current price action. A breakout above the Ichimoku Cloud and the pattern's resistance trendline would provide strong bullish confirmation. Conversely, if the market cap breaks below the support trendline, the pattern will be invalidated.

Hashtags

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