@inpdf · Post #7727 · 18.05.2026 г., 12:15
Champions #League All Stars - 2nd Ed. 🇬🇧 UK May 2026 #sport ⤵️@inPDF📬
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
Пребарај: #league
@inpdf · Post #7727 · 18.05.2026 г., 12:15
Champions #League All Stars - 2nd Ed. 🇬🇧 UK May 2026 #sport ⤵️@inPDF📬
@tonevents_en · Post #1025 · 27.11.2024 г., 10:11
🔔The New Year season of the Open League begins! 7th Season of The Open League starts today at 11:00 UTC. Anyone who wants to participate needs to get their #DeFi badges and read the terms of the rewards. The main focus of this season is liquidity💧 The season will last 20 days (from November 27 to December 17). The prize fund is $1.5M. The maximum reward for a participant is $1,000. Points can be earned in two categories: provided liquidity (TVL) and conducted trading turnover (Volume). The user's total points are the sum of the two categories. 💱Volume Points in this category are added for every $20 spent through League member projects. The dollar amount is calculated at the time of the exchange. ✔️GasPump — 5 points ✔️BigPump — 5 points ✔️Blum Mempad — 5 points ✔️TONPump — 5 points ✔️Wagmi — 5 points ✔️swap.coffee — 1 point ✔️Rainbow Swap — 1 point 🔒Liquidity | TVL Points in this category are added for every $20 invested in the liquidity of the sites that participate in the league. The dollar amount is calculated based on the value of the tokens at the end of the season. ✔️DAOLama — 15 points ✔️Aqua protocol — 15 points ✔️TonStable — 15 points ✔️TONCO — 10 points ✔️Coffin — 10 points ✔️JVault — 10 points ✔️Parraton — 10 points ✔️SettleTON — 10 points ✔️TonPools — 10 points ✔️TON Hedge — 10 points ✔️swap.coffee — 10 points for staking If you want to know how to get the most out of the season, join our chat for League tips. Leave your questions in the comments below this post. Get your badge now!🎁 #TON#SBT#AirDrop#League
@TFGames · Post #1794 · 02.01.2024 г., 09:25
#FEL#LEAGUE#GAMES https://testflight.apple.com/join/dzYEhXYw
@TestFlightX · Post #34760 · 01.12.2024 г., 10:16
#MONSTER#LEAGUE#FANTASY https://testflight.apple.com/join/7pBNJgK3
@TFGames · Post #2171 · 16.02.2024 г., 19:06
#RUMBLE#KONG#LEAGUE#GAMES https://testflight.apple.com/join/FKHsFUMi
@testflightynoti · Post #38088 · 12.05.2026 г., 18:35
#Zeebra#League#amp#Rankings Join the Zeebra - League & Rankings beta on ✈️#TestFlight 🔗 Link: https://testflight.apple.com/join/aSvp2czv Shared by Dimitri
@KartInfoTW · Post #294 · 09.10.2021 г., 08:16
今晚五點,韓服 2021 跑跑聯賽第二季總決賽開打! 團體賽是文浩俊經營的戰隊「BLADES」對上循環賽一場都沒輸過但準決賽輸給 BLADES 的「Liiv SANDBOX」,個人賽則是有柳昌賢、朴仁秀和李載赫等多位明星選手登場,相信這次決賽肯定會相當精采 🔥 🏁 聯賽資訊/獎勵:https://kinf.cc/aSKLe ▶️ 追蹤 Google 新聞:https://kinf.cc/gn ▶️ 立即加入 Discord:https://kinf.cc/dc #跑跑卡丁車#KartRider#韓服#聯賽#跑跑聯賽#League#冠軍賽#總決賽