ChatCrawlersearch across public Telegram Open the app
Q

Qt for Python (PySide/Shiboken)

1 August 2023
2023-08-01×
1 August 2023
weird, maybe it doesn't like url encoding 😅
A
The second link can be useful if you want to setup everything manually except that I use Meson instead of CMake, the first one relies on pypa/cibuildwheel and can be quite hard to follow
I just started Qt last week and here is my first example, user_interface.py
from PySide6 import QtCore, QtWidgets from PySide6.QtUiTools import QUiLoader from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection loader = QUiLoader() class UserInterface(QtCore.QObject): # An object wrapping around our UI def __int__(self, parent=None): super().__init__(parent) self.ui = loader.load("widget.ui", None) self.ui.setWindowTitle("User Data") self.ui.submit_button.clicked.connect(self.do_something) QPyDesignerCustomWidgetCollection.registerCustomWidget(self.ui, module="user interface") def show(self): self.ui.show() def do_something(self): print(f"{self.ui.full_name_line_edit.text()} is a {self.ui.occupation_line_edit.text()}")
main.py contents are from PySide6 import QtWidgets from user_interface import UserInterface import sys import os os.environ['PYSIDE_DESIGNER_PLUGINS'] = "." app = QtWidgets.QApplication(sys.argv) window = UserInterface() window.show() sys.exit(app.exec())
I
Running main.py shows the following errors qt.pysideplugin: Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out. qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found. Traceback (most recent call last): File "/path/qt-examples/pyside6_examples/17_qdesigner_quiloader_v2/main.py", line 10, in <module> window.show() File "/path/qt-examples/pyside6_examples/17_qdesigner_quiloader_v2/user_interface.py", line 18, in show self.ui.show() ^^^^^^^ AttributeError: 'UserInterface' object has no attribute 'ui'
Calendar: August 2023
MoTuWeThFrSaSu18233345678910111251310142151631731821920213222382425126272829430931
Archive by month
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog