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

Резултати

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

Пребарај: #ofox

当前筛选 #ofox清除筛选
Xiaomi 12T Pro | K50U | Updates

@xiaomi_12tpro_updates · Post #373 · 17.06.2025 г., 01:54

🚀 ¡New OrangeFOX Build is released! #Ofox#diting Code Name:diting FileName:OrangeFox-R11.3_1-Unofficial-diting.zip Sha1Sum:f786d578226c382a83572c26af7448c34f8ba4a0 Size:53M * Weekly update Download:GoFile Mirror by @TeamMEX_XDA If you like my work and want to support it please consider making a donation this helps with server costs. Donate PayPal

Hashtags

Xiaomi 12T Pro | K50U | Updates

@xiaomi_12tpro_updates · Post #350 · 01.06.2025 г., 17:45

🚀 ¡New OrangeFOX Build is released! #Ofox#diting Code Name:diting FileName:OrangeFox-R11.3_1-Unofficial-diting.zip Sha1Sum:38c8a1a6bbf7307ff1a58ea2c6af078b121adb02 Size:53M * Weekly update Download: GoFile Mirror by @TeamMEX_XDA If you like my work and want to support it please consider making a donation this helps with server costs. Donate PayPal

Hashtags

Xiaomi 12T Pro | K50U | Updates

@xiaomi_12tpro_updates · Post #346 · 30.05.2025 г., 19:38

🚀 ¡New OrangeFOX Build is released! #Ofox#diting Code Name:diting FileName: OrangeFox-R11.3_1-Unofficial-diting.zip Sha1Sum: 40f78ea0499c97863426e72e78a56035f4b5df6d Size: 53M * Weekly update Download:GoFile Mirror by @TeamMEX_XDA If you like my work and want to support it please consider making a donation this helps with server costs. Donate PayPal

Hashtags

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #653 · 21.07.2025 г., 07:23

OrangeFox Recovery Project - Official | Nothing Phone (2) ✍️ Details: - Version: R11.3_1 Stable - Codename: #Pong - Released: 27/07/25 🔽 Download : Here ⚙️ Installation: Here 🆘 Support Threads : Here 📸 Screenshot: Here 🎄 DT: Here 💵 Donate : UPI | PayPal 🔖 Tags: #OFOX#Recovery#Official#NothingPhone2 💫 Changelogs: - Update to R11.3 stable 🏆Credits: - Nebrassy for his TWRP trees 👤 Maintainer : @phattylol 🔔 Updates : @NothingPhone2Updates 🐙 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #298 · 19.05.2024 г., 04:53

OrangeFox Recovery Project - Official | Nothing Phone (2) ✍️ Details: - Version: R11.1_2 - Codename: #Pong - Released: 19/05/24 🔽 Download : Here | Toolbox ⚙️ Installation: Here 🆘 Support Threads : TG | XDA 📸 Screenshot: Here 🎄 DT: Here 💵 Donate : UPI | PayPal 🔖 Tags: #OFOX#Recovery#Official 💫Changelogs: - Built with latest sources 🏆Credits: - Nebrassy for his TWRP trees 👤 Maintainer : @phobosc_io 🔔 Updates : @NothingPhone2Updates 🐙 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #241 · 08.02.2024 г., 12:58

OrangeFox Recovery Project - Official | Nothing Phone (2) 📝 Details: - Version: R11.1_1 - Codename: #Pong - Released: 08/02/24 ⬇️ Download : Here 🏛 Support Threads : TG | XDA ⚙️Installation | Visual Tutorial 📸Screenshots 💰 Donate : UPI || PayPal 🏷 Tags: #OFOX#Recovery#Official 🗒 Notes: Cmds to flash via fastboot: fastboot flash recovery_a <recovery.img> fastboot flash recovery_b <recovery.img> Flashing to both slots is optional! Users can update by flashing the new build over the previous one by flashing the zip in magisk or manually extracting the recovery.img and flashing it via fastboot or supported flashing apps. If you flash the OTA.zip (Nothing OS update packages), it's recommended to follow these steps for a smooth update process: 1. Flash the OTA.zip. 2. Immediately flash the OrangeFox.zip. 3. Reboot to recovery. 4. Flash the OTA.zip again. 5. Follow up with flashing the OrangeFox.zip. ✨Changelogs: - Synced with latest sources - fixes various bugs and problems - Fixed flags - Fixed flashing error via old orangefox via last build - Improved compatibility with custom roms 🏆Credits: - Nebrassy for his TWRP trees 👤 Maintainer : @phobosc_io 🔔 Updates : @NothingPhone2Updates 🐙 Chat : @NothingPhone2

Oneplus 13 Updates

@OnePlus13Series · Post #364 · 17.12.2025 г., 06:04

OrangeFox Recovery Project - Official | Oneplus 13 ✍️ Details: - Version: R11.3.1 beta - Codename: #dodge - Compatibility: CPH2653, CPH2649, CPH2655, PJZ110 - Released: 17/12/25 🔽 Download : Here 🌳 DT: Here 🔖 Tags: #OFOX#Recovery#Official 💫 Changelogs: - KernelSU: updated to v2.1.2 - KernelSU Next: updated to v3.0.0 - SukiSU Ultra: updated to v4.0.0 ✍️ Note: - CMDs for flashing in fastboot mode: fastboot flash recovery_a <recovery_name.img> fastboot flash recovery_b <recovery_name.img> 🏆Credits: - brokestar223 for initial recovery tree for PJZ110 - Daniel Springer & Ofox team for help 👤 Maintaner: @jonassalo93 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #170 · 04.10.2023 г., 06:59

OrangeFox Recovery Project | Nothing Phone (2) 📝 Details: - Version: R11.1_0 (based on TWRP v3.7.0) - Type: #Recovery - Build: #Official - Status: #Beta (almost stable) - Codename: #Pong - Released: 01/10/23 Links: ⬇️ Download : Here 🏛XDA ⚙️Installation | Visual Tutorial 📲 Support Group 📸Screenshots 💰 Donate : UPI || PayPal 🏷Tags : #Recovery#Ofox Changelogs: * Released official version * Removed aromaFM and added app manager * Synced with latest source and changes Install cmd: - fastboot flash recovery_a <recovery.img> - fastboot flash recovery_b <recovery.img> Note: Flashing to both slots is recommended or switch slots accordingly Bugs: - You tell us (ofc with logs if any) Credits: - Nebrassy for his TWRP trees for Pong! 👤 Maintainer : @Phobosc_io 🔔 Updates : @NothingPhone2Updates 🐙 Chat : @NothingPhone2

Oneplus 13 Updates

@OnePlus13Series · Post #347 · 13.11.2025 г., 15:51

OrangeFox Recovery Project - Official | Oneplus 13 ✍️ Details: - Version: R11.3 beta - Codename: #dodge - Compatibility: CPH2653, CPH2649, CPH2655, PJZ110 - Released: 24/10/25 🔽 Download : Here 🌳 DT: Here 🔖 Tags: #OFOX#Recovery#Unofficial 💫 Changelogs: - Initial official release ✍️ Note: - CMDs for flashing in fastboot mode: fastboot flash recovery_a <recovery_name.img> fastboot flash recovery_b <recovery_name.img> 🏆Credits: - brokestar223 for initial recovery tree for PJZ110 - Daniel Springer & Ofox team for help 👤 Maintaner: Jonas Salo 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #605 · 27.04.2025 г., 17:47

OrangeFox Recovery Project - Official | Nothing Phone (2) ✍️ Details: - Version: R11.3 Beta - Codename: #Pong - Released: 27/04/25 🔽 Download : Here ⚙️ Installation: Here 🆘 Support Threads : Here 📸 Screenshot: Here 🎄 DT: Here 💵 Donate : UPI | PayPal 🔖 Tags: #OFOX#Recovery#Official#NothingPhone2 💫 Changelogs: - Update to R11.3 🏆Credits: - Nebrassy for his TWRP trees 👤 Maintainer : @phatty_69 🔔 Updates : @NothingPhone2Updates 🐙 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #514 · 18.01.2025 г., 11:29

OrangeFox Recovery Project - Official | Nothing Phone (2) ✍️ Details: - Version: R11.1_8 - Codename: #Pong - Released: 22/01/25 🔽 Download : Here | Toolbox ⚙️ Installation: Here 🆘 Support Threads : Here 📸 Screenshot: Here 🎄 DT: Here 💵 Donate : UPI | PayPal 🔖 Tags: #OFOX#Recovery#Official#NothingPhone2 💫 Changelogs: - Shows all option when flashing images - Built with latest sources 🏆Credits: - Nebrassy for his TWRP trees 👤 Maintainer : @phatty_69 🔔 Updates : @NothingPhone2Updates 🐙 Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #451 · 17.10.2024 г., 05:32

OrangeFox Recovery Project - Official | Nothing Phone (2) ✍️ Details: - Version: R11.1_6 - Codename: #Pong - Released: 17/10/2024 🔽 Download : Here | Toolbox ⚙️ Installation: Here 🆘 Support Threads : TG | XDA 📸 Screenshot: Here 🎄 DT: Here 💵 Donate : UPI | PayPal 🔖 Tags: #OFOX#Recovery#Official#NothingPhone2 💫 Changelogs: - Update to R11.1_6 version - Updated prebuilt magisk to v28.0 - Now when flashing image you see all options at once - Built with latest source 🏆Credits: - Nebrassy for his TWRP trees 👤 Maintainer : @phobosc_io 🔔 Updates : @NothingPhone2Updates 🐙 Chat : @NothingPhone2

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