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

Резултати

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

Пребарај: #bbusdt

当前筛选 #bbusdt清除筛选
Propheta Indicator Signals

@propheta_indicator · Post #23147 · 02.12.2025 г., 17:59

Oops, we did it again 🤣 #BBUSDT has achieved 9th TP in 2 hours in our VIP HTL channel! $203 in profits with a 5% entry and a $1000 deposit! Feels good to be a Propheta VIP, man... 🏖ACCESS TO MANUAL TRADING for 70usdt/month 👉 We know how to earn 3-4-5 digit amounts without any deposit, with zero risk! Click the link, then START >>> Referral Program Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #buycrypto#cryptobot#cryptomarket

Propheta Indicator Signals

@propheta_indicator · Post #23171 · 07.12.2025 г., 10:29

Oops, we did it again 🤣 #BBUSDT has achieved 9th TP in our VIP HTL channel! $213 in profits with a 5% entry and a $1000 deposit! ACCESS TO MANUAL TRADING for 70usdt/month 💪Rule the market with Propheta AI Signals: ultra-sharp alerts, full-on process automation, and a killer Cornix synergy — your fast track to max profits! GET THE ACCESS TO AI SIGNALS Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #trading#buybtc#tradingindicator

Propheta Indicator Signals

@propheta_indicator · Post #23432 · 04.03.2026 г., 15:30

Oops, we did it again 🤣 #BBUSDT has reached 9th TP in the VIP HTL signals channel!👍 Easy $202 with a 5% entry and a $1000 deposit! Every day we're on fire! 🔥🔥🔥ACCESS TO MANUAL TRADING for 70usdt/month 👉 Multiplying deposits every day! Not convinced? Contact us for a free trial - @propheta_help Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #tradingviewindicator#tradingview#bitcoin

Propheta Indicator Signals

@propheta_indicator · Post #23460 · 13.03.2026 г., 15:51

Now that's trading 👆🔥🔥🔥 #BBUSDT has just reached 9th TP in the VIP HTL channel!!! Trade took just 2 hours! 👍 Easy $206 with a 5% entry and a $1000 deposit! ACCESS TO MANUAL TRADING for 70usdt/month 👉 In our VIP community, not only will your deposit grow, but your skill as a trader as well! Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #tradingview#eth#trading

Propheta Indicator Signals

@propheta_indicator · Post #23452 · 11.03.2026 г., 15:45

Now that's trading 👆🔥🔥🔥 #BBUSDT has achieved 9th TP in our VIP HTL channel! With a 5% entry and a $1000 deposit, you could've earned $204! That's why we call it the "Money Printer" 💴💷💵ACCESS TO MANUAL TRADING for 70usdt/month 💰Turn data into gains with Propheta AI Analyzer: deep AI analysis spots trends with surgical precision, tweaks in seconds to your goals, and pair hunting pumps your trading to the next level — this is the evolution of the game! GET THE ACCESS Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #cryptonews#AItrading#autotrading

Propheta Indicator Signals

@propheta_indicator · Post #23306 · 05.02.2026 г., 15:36

👆 OMG! Would you look at that 👀 #BBUSDT reached 9th TP! Signal from our VIP HTL channel! Easy $210 with a 5% entry and a $1000 deposit! That's why we call it the "Money Printer" 💴💷💵ACCESS TO MANUAL TRADING for 70usdt/month 👉 How to earn every month with zero risk? Become Propheta partner with zero investment required! Click the link, then START >>> Referral Program Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #tradingviewindicator#tradingindicator#buycrypto

Propheta Indicator Signals

@propheta_indicator · Post #23326 · 14.02.2026 г., 17:00

👍 This is why we're here! Reached 9th TP on our #BBUSDT trade! 🔥🔥🔥 With a 5% entry and a $1000 deposit, you could've earned $207! Every day we're on fire! 🔥🔥🔥ACCESS TO MANUAL TRADING for 70usdt/month 👉 We're sure that 99% of the signals channels simply cannot provide transparent performance reports like we do! Check it out - @propheta_reports Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #cryptotrading#tradingview#buycrypto

Propheta Indicator Signals

@propheta_indicator · Post #23479 · 16.03.2026 г., 11:18

👍 This is why we're here! #BBUSDT has achieved 9th TP in our VIP HTL channel! $211 in profits with a 5% entry and a $1000 deposit! That's why we call it the "Money Printer" 💴💷💵ACCESS TO MANUAL TRADING for 70usdt/month 📊Dominate the market with Propheta AI Analyzer: AI uncovers hidden patterns with razor-sharp analysis, adapts on the fly with slick customization, and delivers next-level pair hunting — your edge for strategic supremacy! GET THE ACCESS Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #CryptoSignal#trading#crypto

Propheta Indicator Signals

@propheta_indicator · Post #23105 · 25.11.2025 г., 08:54

Reached 9th TP in 14 hours on our #BBUSDT trade! 🔥🔥🔥 Using a 5% entry you could've earned $199 with a $1000 deposit ACCESS TO MANUAL TRADING for 70usdt/month 👉 It's time to get a moneyprinter of your own! Get access: t.me/ProphetaAdmin_bot Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #cryptochannel#bitcoin#AItrading

Propheta Indicator Signals

@propheta_indicator · Post #23190 · 12.12.2025 г., 15:27

👍 This is why we're here! #BBUSDT has just reached 9th TP in the VIP HTL channel!!!👍 $205 in profits with a 5% entry and a $1000 deposit! ACCESS TO MANUAL TRADING for 70usdt/month 👉 Multiplying deposits every day! Not convinced? Contact us for a free trial - @propheta_help Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #crypto#AItrader#cryptonews

Propheta Indicator Signals

@propheta_indicator · Post #23352 · 20.02.2026 г., 08:52

Oops, we did it again 🤣 #BBUSDT has just reached 9th TP in the VIP HTL channel!!! Trade took just 87 minutes! 👍 Using a 5% entry you could've earned $209 with a $1000 deposit 🤑 All this profit could have been yours! 🔥ACCESS TO MANUAL TRADING for 70usdt/month 👉 Love the profits you're seeing, but can't afford the VIP cost? Earn over $40 per one recommendation with zero risk using our referral program! Click the link, then START >>> Referral Program Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #tradingbot#tradingindicator#cryptobot

Propheta Indicator Signals

@propheta_indicator · Post #23368 · 23.02.2026 г., 03:39

👆 OMG! Would you look at that 👀 #BBUSDT has achieved 9th TP in our VIP HTL channel! You could've earned $213 with a 5% entry and a $1000 deposit! Every day we're on fire! 🔥🔥🔥ACCESS TO MANUAL TRADING for 70usdt/month 👉 We will keep posting about how we earn money. Will you keep watching how someone else does it, or start earning yourself? Subscribe using our telegram bot: t.me/ProphetaAdmin_bot Register and get bonuses up to $6,000 Binance | OKX | ByBit👈🏻click! #cryptobot#cryptocurrency#crypto

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