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 слични објави

Пребарај: #vulnerability

当前筛选 #vulnerability清除筛选
Libreware

@libreware · Post #1262 · 28.03.2024 г., 15:59

#Bluetooth#vulnerability allows unauthorized user to record & play audio on Bluetooth speaker via #BlueSpy Prevention section explains how you can check if your Bluetooth LE speakers/headsets are vulnerable to this attack using nRF Connect app https://www.mobile-hacker.com/2024/03/22/bluetooth-vulnerability-allows-unauthorized-user-to-record-and-play-audio-on-bluetooth-speakers/ #BlueDucky automates exploitation of Bluetooth pairing vulnerability that leads to 0-click code execution ▪️automatically scans for devices ▪️store MAC addresses of devices that are no longer visible but have enabled Bluetooth ▪️uses Rubber Ducky payloads https://www.mobile-hacker.com/2024/03/26/blueducky-automates-exploitation-of-bluetooth-pairing-vulnerability-that-leads-to-0-click-code-execution/ Demonstration of using BlueDucky to exploit 0-click Bluetooth vulnerability of unpatched Android smartphone (CVE-2023-45866) Exploit was triggered by Raspberry Pi 4 and then by Android running NetHunter https://youtu.be/GOGW7U1f2RA @androidMalware

Libreware

@libreware · Post #1568 · 28.03.2026 г., 14:31

https://securityonline.info/telegram-critical-zero-click-vulnerability-zdi-can-30207/ its real apparently, just thankfully not in the wild https://www.zerodayinitiative.com/advisories/upcoming/ In the search result of "ZDI-CAN-30207": https://old.reddit.com/r/Android/comments/1s5xyi1/critical_alert_telegram_vulnerability_zdican30207/ https://news.ycombinator.com/item?id=47546545 #telegram#tg#0click#exploit#vulnerability

GitHub Trends

@githubtrending · Post #15201 · 06.10.2025 г., 12:00

#python#security#security_tools#vulnerability#vulnerability_databases#vulnerability_management#vulnerability_scanners OSV is a free, open-source database and toolset that helps you find and manage security vulnerabilities in open source software you use. It collects vulnerability data from many sources, including official advisories and automated scans, and presents it in a clear, machine-readable format. You can use the OSV scanner tool to automatically check your software dependencies for known security issues, helping you fix them quickly. This improves your software’s security by focusing on real risks and making vulnerability management easier and more efficient. OSV also offers APIs and integrates with other tools for automation and alerts. https://github.com/google/osv.dev

Crypto M - Crypto News

@CryptoM · Post #64770 · 09.04.2026 г., 21:12

🚀 Android SDK Vulnerability Poses Risk to Crypto Wallet Apps A vulnerability in an Android Software Development Kit (SDK) could potentially expose sensitive data from crypto wallet applications, according to Microsoft Defender researchers. The flaw, which affects apps downloaded over 30 million times, may lead to the leakage of personally identifiable information, user credentials, and financial data. According to NS3.AI, there have been no reported instances of attackers exploiting this vulnerability so far. #AndroidSDK#vulnerability#cryptowallet#MicrosoftDefender#NS3AI#dataleak#personallyidentifiableinformation#usercredentials#financialdata#cybersecurity

Crypto M - Crypto News

@CryptoM · Post #65081 · 10.04.2026 г., 20:37

🚀 AI TRENDS | Wall Street Banks Test Anthropic's Mythos Model for Vulnerability Detection Wall Street banks have begun internal testing of Anthropic's Mythos model, as reported by Bloomberg on X. The initiative comes amid encouragement from U.S. President Donald Trump's administration officials, who are advocating for its use in identifying potential vulnerabilities. The Mythos model, developed by Anthropic, is designed to enhance security measures within financial institutions by leveraging advanced AI capabilities. This move reflects a growing trend among major banks to integrate cutting-edge technology to bolster their defenses against emerging threats. #AI#trends#WallStreet#banks#Anthropic#Mythos#model#vulnerability#detection#security#financialinstitutions#AItechnology#emergingthreats

GitHub Trends

@githubtrending · Post #14877 · 28.06.2025 г., 13:30

#python#bounty#bugbounty#bypass#cheatsheet#enumeration#hacking#hacktoberfest#methodology#payload#payloads#penetration_testing#pentest#privilege_escalation#redteam#security#vulnerability#web_application Payloads All The Things is a comprehensive collection of useful payloads and bypass techniques for web application security testing and penetration testing. It offers detailed documentation for each vulnerability, including how to exploit it and ready-to-use payloads, plus files for tools like Burp Intruder. You can contribute your own payloads or improvements, making it a collaborative resource. It also links to related projects for internal network and hardware pentesting, and provides learning resources like books and videos. Using this resource helps you efficiently find and test security weaknesses in web applications, improving your pentesting effectiveness and knowledge. https://github.com/swisskyrepo/PayloadsAllTheThings