TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #380 · 21 окт.

Регулярно приходится писать и ревьюить код, где используется PySide2-6. Заметил, что в подавляющем большинстве случаев настройка создаваемых базовых виджетов происходит через методы. Думаю, всем знаком такой способ. Простой пример с кнопкой: button = QPushButton("Click Me") button.setMinimumWidth(300) button.setFlat(True) button.setStyleSheet("font-size: 20pt") button.setToolTip("Super Button") button.clicked.connect(lambda: print("Button clicked")) Но есть и альтернативный способ - настройка через свойства. Это просто ключевые аргументы конструктора класса. Хоть они и не указаны в документации как аргументы, но они есть) Этот код делает тоже самое но с помощью Property button = QPushButton( "Click Me", minimumWidth=300, flat=True, styleSheet="font-size: 20pt", toolTip="Super Button", clicked=lambda: print("Button clicked"), ) Где это может быть полезно ▫️ Это выглядит более аккуратно и коротко, уже повод использовать ▫️ Может использоваться в заполнении лейаута, когда нам не нужно никакое другое взаимодействие с виджетом и поэтому сохранять его в переменную не требуется. Например, лейбл или кнопка. widget = QWidget(minimumWidth=400) layout = QHBoxLayout(widget) layout.addWidget(QLabel("Button >", alignment=Qt.AlignRight)) layout.addWidget(QPushButton("Click Me", clicked=lambda: print("Button clicked"))) widget.show() Либо так widget = QWidget(minimumWidth=400) layout = QHBoxLayout(widget) for wd in ( QLabel("Button >", alignment=Qt.AlignRight), QPushButton("Click Me", clicked=lambda: ...) ): layout.addWidget(wd) widget.show() ▫️ Можно хранить настройки в каком-то конфиге или генерировать на лету, после чего передавать как kwargs. kwargs = {"text": "Hello " * 30, "wordWrap": True} my_label = QLabel(**kwargs) Как получить полный список доступных свойств? Эта функция распечатает в терминал все свойства виджета и их текущие значения def print_widget_properties(widget): meta_object = widget.metaObject() for i in range(meta_object.propertyCount()): property_ = meta_object.property(i) property_name = property_.name() property_value = property_.read(widget) print(f"{property_name}: {property_value}") #tricks#qt

Hashtags

Резултати

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

Пребарај: #rdp

当前筛选 #rdp清除筛选
GitHub 红队武器库🚨

@githubredteam · Post #82995 · 06.05.2026 г., 04:00

🚨 GitHub 监控消息提醒 🚨发现关键词:#横向#移动#RDP 📦项目名称:bandwagon-169-guide 👤项目作者:mxoc83 🛠开发语言: None ⭐Star数量: 1 | 🍴Fork数量: 0 📅更新时间: 2026-05-06 03:26:23 📝项目描述: 搬瓦工169.99套餐完整指南:配置是什么、怎么买、值不值?机房怎么选、优惠码用哪个(附各档位套餐横向对比) 🔗点击访问项目地址

GitHub 红队武器库🚨

@githubredteam · Post #82728 · 04.05.2026 г., 07:00

🚨 GitHub 监控消息提醒 🚨发现关键词:#横向#移动#RDP 📦项目名称:dmit-server-review 👤项目作者:tqmo99 🛠开发语言: None ⭐Star数量: 1 | 🍴Fork数量: 0 📅更新时间: 2026-05-04 06:22:46 📝项目描述: DMIT服务器好吗?从线路质量、硬件性能到价格套餐的完整评测:洛杉矶CN2 GIA、香港、日本机房横向对比,值不值得买一篇说清楚(附购买入门教程) 🔗点击访问项目地址

GitHub Trends

@githubtrending · Post #15209 · 09.10.2025 г., 14:30

#typescript#docker#docker_compose#linux#rdp#virtualization#windows WinBoat lets you run any Windows app on Linux with a smooth, native-like experience by running a full Windows system inside a Docker container using virtualization. It has an elegant interface and automates installation, so you just pick your settings and it handles the rest. You can run individual Windows apps seamlessly alongside Linux apps or access the full Windows desktop when needed. Your Linux files are easily shared with Windows, making file management simple. This helps you use Windows-only software on Linux without complicated setups, though it requires some system resources and setup steps like enabling virtualization and installing Docker. WinBoat is still in beta, so occasional bugs may occur. https://github.com/TibixDev/winboat

GitHub Trends

@githubtrending · Post #14894 · 02.07.2025 г., 11:30

#typescript#antd#antd_design#docker#go#golang#guacamole#rdp#react#ssh#vnc Next Terminal is a simple and secure system that lets you access and manage remote computers using protocols like RDP, SSH, VNC, Telnet, and HTTP. It is designed for businesses to record sessions, track audits, and help with compliance reporting, making IT management easier and safer. Using Next Terminal can improve security by monitoring remote access and help ensure your company meets regulatory requirements. It is user-friendly and supports multiple connection types, which saves time and effort in managing remote systems securely. Consulting your IT administrator before use is recommended for safe deployment. This tool benefits you by enhancing control and oversight of remote IT activities. https://github.com/dushixiang/next-terminal