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

Резултати

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

Пребарај: #sd

当前筛选 #sd清除筛选
American Crypto©

@americancryptotrading · Post #27617 · 11.05.2026 г., 13:43

🇺🇸#SD Volumes are huge🔥 Bullish rally is coming✈️ Stader isn’t trying to be another hype project. They’re building actual staking infrastructure across multiple chains👀 $SD American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27601 · 26.04.2026 г., 14:16

🇺🇸#SD accumulating at the huge volumes🔥 Bullish🐃 People chase hype. Smart money looks at structure. Stader (SD) has: less supply + real revenue flow That matters 🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27504 · 15.01.2026 г., 13:01

🇺🇸#SD Cyclical pump is playing✈️ Do not miss $SD while it's still at the dip🔥 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27494 · 06.01.2026 г., 13:50

🇺🇸#SD keeps to its Cycle✔️ Bear Trend is over❌Bullish Trend Started✅ MACD crosses the mid-lne as well as its signal line crossed for bullish🐃 Stader keeps staking flexible instead of locking funds. At the same time, $SD completed its buyback just yesterday🧱 https://etherscan.io/address/0xefe40ff167a89ce3babdad161d41d798ca7116b2#tokentxns American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27485 · 29.12.2025 г., 12:34

🇺🇸#SD This chart keeps repeating the same story. Sharp sell-off → momentum drains → aggressive upside leg follows. Price is now sitting right at that transition point again. 🧩 Downside move looks complete, and the curve is starting to turn — this is where new trends are born, not extended lower. 📉➡️📈 If history rhymes, the next phase is a strong expansion move. Buybacks coming soon 🔥 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27453 · 28.11.2025 г., 13:02

🇺🇸#SD Price has completed another clean rounded bottom formation at the lower boundary of the long-term structure. The reaction from this zone is strong and mirrors previous cycle reversals. 🔥 Each prior rounded bottom led to a powerful upside expansion, and the current setup is replicating the same rhythm with high precision. The structure shows clear exhaustion of sellers and a decisive shift in momentum. ⚡️ With the pattern repeating and demand stepping in aggressively, price is now positioned for a sustained bullish continuation toward higher macro levels. The next leg up is not just likely—it’s expected. 🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27371 · 10.09.2025 г., 15:24

🇺🇸#SD/USDT Bullish Flag on weekly🐃 Looking for the retest of the MajorSupplyZone and more upside in case of a breakout🚀 Stader fundamentals keep improving — scaling TVL, expanding volumes, and consistent demand from both LST and Cabbage. This aligns with the key catalyst → buybacks roll out next week. American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27217 · 15.04.2025 г., 13:28

🇺🇸#SD/USDT Good recovery on $SD ☝️ Once we are back above the red support, send it✈️ Fundamentals: Stader released cabbage (sign for waitlist to be the first to try) + 500k coins bought from the market😎 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27190 · 20.03.2025 г., 11:31

🇺🇸#SD/USDT Falling wedge below the resistance zone🧐 Expecting a retest of the one and breakout📈 Much Awaited Stader Quarterly Buyback happening this week - Add the fact there are no unlocks after March🔥 $SD is going full deflationary! American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27089 · 19.12.2024 г., 15:11

🇺🇸#SD/USDT Low + Higher Low We are going to break that resistance🚀 $750mln in TVL New product cabbage is coming out + Binance List added $SD American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27065 · 28.11.2024 г., 15:41

🇺🇸#SD/USDT We got a fakeout below the symm. triangle and now breaking out of the one📈 Whitepaper will be released at 4th December | $SD is only $50mln MC still early🔥 American Crypto©

Hashtags

Michaël Van de Poppe Official

@michaelvandepoppeanalyst · Post #4720 · 02.09.2024 г., 13:29

#SD Accumulating structure remains unchanged️ I keep accumulating! Stader buybacks 286.2k SD ($150k) off CEXs - at this rate almost 3.5% circulating supply annualised will be bought from the market BULL️

Hashtags

123•••1011
ПретходнаСтраница 1 од 11Следна