@TestFlightX · Post #35138 · 07.04.2026 г., 17:12
#Steam Mobile https://testflight.apple.com/join/8BOPXsGz
Hashtags
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
Пребарај: #steam
@TestFlightX · Post #35138 · 07.04.2026 г., 17:12
#Steam Mobile https://testflight.apple.com/join/8BOPXsGz
Hashtags
@ParadoxW98 · Post #24067 · 12.02.2025 г., 22:47
Steam发布公告:禁止在游戏中植入干扰玩家体验的广告 开发者不应该使用付费广告作为游戏内的业务模式,例如要求玩家观看广告或以其他方式参与广告才能玩游戏,或是用广告来限制游戏内容。 🗒 标签: #Steam
Hashtags
@linuxgram · Post #18771 · 13.05.2026 г., 09:59
📰 Unreal Engine 5.8 adds experimental Steam Frame support, Qualcomm give the Steam Frame a dedicated page Valve's new VR kit the Steam Frame appears to be inching closer to a release announcement - here's two more fun bits of news on it for you.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/05/unreal-engine-5-8-adds-experimental-steam-frame-support-qualcomm-give-the-steam-frame-a-dedicated-page/ #steam
Hashtags
@linuxgram · Post #18567 · 25.04.2026 г., 16:12
📰 Your Gen 5 SSD is probably throttling right now, and you have no idea You paid a premium for 14,000 MB/s speeds, but during a large Steam download or 4K video export, it feels like your PC is struggling to keep up and overall just comes across quite mushy. Unlike a CPU, which might trigger a loud fan spike, an SSD suffers in silence, making it hard for you to identify when it is actually occurring. 🔗 Source: https://www.xda-developers.com/your-pcie-50-ssd-might-be-throttling-without-you-knowing/ #steam
Hashtags
@linuxgram · Post #18465 · 16.04.2026 г., 22:16
📰 Proton 11.0 Beta Released With More Games Playable On Steam Play Valve and CodeWeavers have just released Proton 11.0 Beta as their first beta milestone for this software that powers Steam Play now rebased against upstream Wine 11.0... 🔗 Source: https://www.phoronix.com/news/Proton-11.0-Beta #steam
Hashtags
@linuxgram · Post #18297 · 03.04.2026 г., 13:59
📰 Valve recently confirmed Steam game pricing updates across different regions At the end of March, Valve issued an announcement to game developers on Steam about changes to how games get priced across different regions.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/04/valve-recently-confirmed-steam-game-pricing-updates-across-different-regions/ #steam
Hashtags
@linuxgram · Post #18285 · 02.04.2026 г., 15:05
📰 SteamOS 3.8 just dramatically improved a lot of handhelds except the Steam Deck itself The Steam Deck just saw one of its biggest updates enter the preview phase, and if you're on the Preview update channel, then chances are you've already updated it. After such a major update, you might realize that not much has changed, though. SteamOS 3.8 is, by all accounts, one of Valve's most important updates yet. It expands compatibility, improves performance, and lays the groundwork for something much bigger than a handheld. 🔗 Source: https://www.xda-developers.com/steamos-38-dramatically-improves-many-gaming-handhelds-except-steam-deck/ #steam
Hashtags
@linuxgram · Post #18119 · 20.03.2026 г., 07:36
📰SteamOS 3.8.0 is finally making the Steam Machine a reality The first glimpse of the Steam Machine's release date is on the horizon. 🔗 Source: https://www.xda-developers.com/steamos-380-is-finally-making-the-steam-machine-a-reality/ #steam
Hashtags
@linuxgram · Post #18057 · 13.03.2026 г., 23:43
📰 New Steam Release Fixes Proton Games Wrongly Flagged as Unplayable Also includes opt-in frame rate telemetry, hardware-tagged reviews, and several quality-of-life improvements. 🔗 Source: https://feed.itsfoss.com/link/24361/17298791/steam-client-march-2026-release #steam
Hashtags
@linuxgram · Post #17987 · 05.03.2026 г., 22:17
📰 Theme park building game Parkitect gets its first ever Steam Free Weekend Parkitect is an absolute gem and if you've not played this theme park builder before - well, now is your best chance because it's free for a while.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/03/theme-park-building-game-parkitect-gets-its-first-ever-steam-free-weekend/ #steam
Hashtags
@linuxgram · Post #17846 · 20.02.2026 г., 12:19
📰 Steam Deck now out of stock in Europe in addition to USA, Canada and Asia Unfortunately the stock availability of the Steam Deck has only worsened recently, with Europe now appearing to be completely out of stock.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/02/steam-deck-now-out-of-stock-in-europe-in-addition-to-usa-canada-and-asia/ #steam
Hashtags
@linuxgram · Post #17810 · 17.02.2026 г., 16:02
📰Valve confirm Steam Deck stock issues due to "memory and storage shortages" We reported recently how the Steam Deck was completely out of stock in the USA, Canada and Asia and now Valve have put up a short statement on it.Read the full article on GamingOnLinux. 🔗 Source: https://www.gamingonlinux.com/2026/02/valve-confirm-steam-deck-stock-issues-due-to-memory-and-storage-shortages/ #steam
Hashtags