Skip to content
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Qt for Python

For discussion and questions about Qt for Python (PySide & Shiboken)

3.4k Topics 15.0k Posts
Qt 6.12 LTS is out! See what's new in the release blog
  • PySide6 6.10.2 Windows MSIX: ICU dependencies, wheel provenance and LGPL redistribution

    Unsolved
    1
    0 Votes
    1 Posts
    28 Views
    No one has replied
  • ModuleNotFoundError: No module named 'PyQt6' using Thonny for Windows

    Unsolved
    2
    0 Votes
    2 Posts
    119 Views
    SGaistS
    Hi and welcome to devnet, I didn't know it's existence so there are a couple of things. You seem to have an existing Python setup on your system, correct ? Thonny comes with its own Python environment if installed through its package. So: How did you install Thonny ? If through its official package, did you install PyQt6 from within the IDE ? If wanting to use your existing Python environment, did you follow the separate install wiki page ?
  • No PyQt5 package for Windows?

    Unsolved
    3
    0 Votes
    3 Posts
    234 Views
    SGaistS
    Hi, PyQt5 is not a product of the Qt Company. You need to contact Riverbank computing about that matter.
  • QMessageBox crash on macOS 27.0.1

    Unsolved
    3
    0 Votes
    3 Posts
    258 Views
    I
    Unlikely, the internal mechanism is different, and I furthermore cannot reproduce any crash with OP's sample. @Qoissi Please provide more detail - which version of Qt and which version of PyQt? Is the crash due to a Python exception or in native code? Can you provide a stack trace?
  • QWidget modification at runtime

    Unsolved
    12
    0 Votes
    12 Posts
    854 Views
    JonBJ
    @SamuraiDestroy Qt widget layouts is a dark art. Everything you do in Designer is saved in (fairly) readable XML in the generated .ui file, nothing else. You can look at that to try to figure what is going on, and if you are really stuck you can paste it here and people can tell you what you need so long as they understand what you are trying to achieve.
  • Selection highlight is a thin blue bar at the left of the cell.

    Unsolved
    15
    0 Votes
    15 Posts
    794 Views
    S
    @Jim-G said in Selection highlight is a thin blue bar at the left of the cell.: So why does setting alternatingRowColors cause the change in highlight? Qt tries to use the OS default widgets first. Alternating row colors is not supported by the OS directly. So, Qt will draw it from scratch and usually tries to mimic the OS look. Seems like it did not get updated, yet.
  • looking for a code editor widget for Qt for Python

    Unsolved
    13
    1 Votes
    13 Posts
    5k Views
    D
    Hi. I made this gizmo https://brainless-software.github.io/qppte/ Not sure if it fits but it works for my use case.
  • Trouble setting up QDataWidgetMapper

    Solved
    9
    0 Votes
    9 Posts
    580 Views
    A
    I did in fact discover that particular quirk while trying to whittle everything down into a MRP! Figured it would be more helpful to just state my finding instead of making folks trudge through the project.
  • Possible mistake in the translation example?

    Unsolved
    7
    1 Votes
    7 Posts
    657 Views
    JKSHJ
    @axu2 said in Possible mistake in the translation example?: The website still isn't updated? The website shows the official documentation of the current release. It will update with the next release.
  • Creating Python bindings for KSyntaxHighlighter with shiboken

    Unsolved
    3
    0 Votes
    3 Posts
    818 Views
    M
    see also: looking for a code editor widget for Qt for Python
  • pyside6-lupdate does not extract translations from Python files when given a directory

    Unsolved
    2
    0 Votes
    2 Posts
    272 Views
    Nils SjobergN
    You need to pass all the .py files in the directory to pyside6-lupdate, or use pyside6-project lupdate.
  • 0 Votes
    13 Posts
    1k Views
    J
    @JonB OK, for future readers here's the code I ended up with. It's a lot simpler than all the hallucinations provided by Google. I'm pretty sure it's not the canonical way to do this but it works and I'll continue studying the links provided in this thread. import sys from PySide6.QtCore import QFile from PySide6.QtWidgets import QApplication, QVBoxLayout, QWidget from PySide6.QtUiTools import QUiLoader def load_ui(ui_file_path: str) -> QWidget: loader = QUiLoader() ui_file = QFile(ui_file_path) if not ui_file.open(QFile.ReadOnly): print("Cannot open ui file") sys.exit(-1) ui = loader.load(ui_file) ui_file.close() return ui class MainWindow(QWidget): def __init__(self, ui:QWidget): super().__init__() self.ui = ui self.setWindowTitle("My Qt Designer App") layout = QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(ui) # Load comboBox items #ui.comboBox.addItems(getLoginCandidates(dbEngine)) ui.pushButton.clicked.connect(self.on_submit_clicked) def on_submit_clicked(self): print("The button was clicked!") if __name__ == "__main__": app = QApplication(sys.argv) ui = load_ui("../ui/test.ui") window = MainWindow(ui) window.show() rc = app.exec() sys.exit(rc)
  • Detecting checkbox toggle via keyboard on a QTreeWidgetItem

    Solved
    2
    0 Votes
    2 Posts
    226 Views
    Christian EhrlicherC
    You should get a https://doc.qt.io/qt-6/qtreewidget.html#itemChanged signal when the data of an item changes.
  • 0 Votes
    4 Posts
    406 Views
    JKSHJ
    @FatesealMagic said in How do I make my QMainWindow's contents dynamically resize after floating a QDockWidget?: I tried this code on a different machine with Ot/PySide6 6.11.0 and it worked as expected. Thank you! EDIT: For completeness, apparently this issue only impacts very specific QT versions: https://stackoverflow.com/questions/79999518/how-do-i-make-my-qmainwindows-contents-dynamically-resize-after-floating-a-qdoc/79999535#79999535 Indeed: https://qt-project.atlassian.net/browse/QTBUG-147209
  • Do I need to add qmldir for python objects exposed as singleton instances?

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    L
    hey helping you out if you've not figured it out yet since the previous poster was very vague, after some testing myself you do you need to use qmlRegisterSingletonInstance() function to regsiter an existing precreated instance from python to QML there is no decorator that does this for obvious reasons. Going for the decorator is only for regsitering it as usable property Type and/or be used by QML to create. To auto generate the qmltypes I suggest you use something like "pyside6-qml-stubgen" library I found this works best as it is able to run regsiter types even from the function if you make a seperate file that is run when imported. Then you need to add whatever folder the library generates to your QML import path for the linter to know of it if you're using something like VSCode qml extensions.
  • Pyside6 Slot with Name arg crashes app

    Unsolved
    4
    0 Votes
    4 Posts
    457 Views
    F
    That produces file:///../Example/Main.qml:11: TypeError: Property 'testMethod' of object Example/Controller is not a function - an instance of Controller is needed.
  • How to make QRangeModel in Python PySide6 with pure strings?

    Moved Unsolved
    6
    0 Votes
    6 Posts
    702 Views
    F
    Support for string tables has been added in 6.12.
  • QWidgets Pixmap not appearing

    Solved
    2
    0 Votes
    2 Posts
    312 Views
    SGaistS
    Hi, Your drawn widget is never shown. That said, please stop using globals for everything you are doing. Take the time to learn how to build proper widgets and use signals and slots cleanly. Take a look at the image viewer example for a start. There are many others.
  • aboutQt() Runtime Error

    Solved pyside python
    3
    0 Votes
    3 Posts
    404 Views
    S
    @JonB said in aboutQt() Runtime Error: I thought you were just supposed to write something like: QtWidgets.QMessageBox.aboutQt(None) This works perfectly, thank you
  • PySide6 6.11.1: qtquickshapesdesignhelpersplugin.dll not found

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    F
    Solved in PySide 6.11.2