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

Резултати

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

Пребарај: #schumannresonance

当前筛选 #schumannresonance清除筛选
My Lifeguard

@lifegaurdhelp · Post #39200 · 11.02.2026 г., 23:56

Schumann Resonance Today – Power 51 & 1 Hr Blackout ✨#SchumannResonance Today 11/2/2026 17:00 UTC https://www.disclosurenews.it/schumann-resonance-today/

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #47769 · 10.05.2026 г., 00:08

https://x.com/mrmbb333/status/2053139040468418953?s=52 WHILE PEOPLE WERE SLEEPING… EARTH’S FREQUENCY WENT FULL WHITE-OUT AGAIN Overnight, the Schumann Resonance exploded into repeated white-out bursts for more than 5 hours straight. Not one quick spike. Not normal background activity. The chart kept surging, fading, then surging again — staying highly energized deep into the night while most people were asleep. And the amount of white showing across the chart is hard to ignore. Something kept the signal highly charged for hours. Did anyone wake up suddenly last night? • Vivid dreams • Pressure or headaches • Ringing ears • Restless sleep • Electronics acting strange • Pets acting off What are you noticing where you are? #MrMBB333#SchumannResonance#SpaceWeather

Question Everything

@gratefulpatriot · Post #90727 · 20.04.2026 г., 02:17

https://i.fixupx.com/i/status/2045928133946433932 UNKNOWN ACTIVITY SHOWING UP AGAIN IN EARTH’S FREQUENCY For nearly 7 hours, the Schumann Resonance monitor showed sustained saturation across multiple bands. The signal didn’t clear. It stayed compressed across the chart. This isn’t a normal pattern. It follows right behind the last disturbance. Back-to-back activity now. Something is passing through the system. Origin unclear. Monitoring. #MrMBB333#SchumannResonance#SpaceWeather

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #47912 · 10.05.2026 г., 18:56

https://x.com/mrmbb333/status/2053541044068012078?s=52 SOMETHING KEPT HITTING EARTH’S FREQUENCY TODAY ⚡️ The Schumann Resonance has been showing something difficult to ignore. The graph has been cycling through repeated bursts of intense activity, including multiple sustained whiteout periods and powerful 50 Hz pulses lasting close to an hour at a time. This wasn’t a quick spike and fade. The signal kept returning over and over with very little quiet in between. At several points the chart looked completely overwhelmed before briefly calming… only to surge right back again. The level of prolonged saturation showing up today has been unusual. Anyone else feeling like today has felt unusually heavy, restless, intense, or just “off”? Drop your location below. #MrMBB333#SchumannResonance#EarthWatch#SpaceWeather

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #48418 · 13.05.2026 г., 17:59

https://x.com/paulgoldeagle/status/2054619457520271823?s=52 🚨 ANOTHER MASSIVE SURGE IN THE EARTH'S FREQUENCY TODAY. 🚨 The Schumann Resonance—the natural electromagnetic heartbeat of our planet—is lighting up the charts again today. We are seeing strong, bright bands of energy blasting through the atmosphere for hours on end. Instead of feeling heavy, today's energy is highly electric. The Schumann Resonance is created by global lightning and electromagnetic waves trapped between the Earth's surface and the edge of space. When this field gets this charged up, a lot of people across the country report feeling it directly in their nervous systems. Here is what people are experiencing right now: • Racing thoughts and mental restlessness • Interrupted sleep and incredibly vivid dreams • Sudden pressure in the head or a "buzzing" feeling in the body • Random bursts of energy followed by quick exhaustion • A feeling like you just can't slow down or relax With all this extra static in the air, your body needs a break to process it. Drink plenty of water, step away from the overstimulation, and get some solid rest to help your system reset and ground itself. Monitoring the electric pulse of our planet here at Glynce. 📡🩵🟣 👇 Are you feeling any of these electric "symptoms" today? Drop what you are experiencing in the comments! #Glynce#SchumannResonance#EarthScience#SpaceWeather#ElectromagneticField#EnergyShift#BreakingNews#Frequency