Skip to content

Qt for Python

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

3.3k Topics 14.6k Posts
  • 0 Votes
    2 Posts
    291 Views
    B
    I solved the problem by using qtbase 6.9 instead of 6.10. However there might be other subtle reasons that I overlooked(?).
  • Could not update timestamps for skipped samples.

    Unsolved
    7
    0 Votes
    7 Posts
    991 Views
    L
    @SGaist I get it, thx, I will try.
  • NotImplementedError: QAsyncioEventLoop.getaddrinfo() is not implemented yet

    Unsolved
    1
    0 Votes
    1 Posts
    241 Views
    No one has replied
  • PyQt and resizing windows when widgets shrink - minimal example included

    Unsolved
    3
    0 Votes
    3 Posts
    921 Views
    B
    Sorry, I misread your needs, if it is not the table but other widgets expanding, I suggest that you wrap the other widgets in a subclassed QWidget with fixed vertical sizeHint and fixed vertical sizePolicy like above. Or try setting other widgets' sizePolicy to Preferred, if they were Expanding. I will take a more thorough look later. In my experience, it is hard to control sizes like this by only using layout methods, even with Qt Designer. If you stumble on this, do not spend too much time.
  • Error interpreting message in nativeEvent on Windows (might be a Qt bug?)

    Unsolved pyside python
    2
    0 Votes
    2 Posts
    494 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    17 Views
    No one has replied
  • How to change the background color of a DockLabel instance??

    Unsolved
    4
    0 Votes
    4 Posts
    343 Views
    B
    @JonB ignore what i said in that line because i can't do this, if you just copy and run the script above, you will notice how it doesn't work and the color does not change to blue, hence the problem
  • Qml Webcam Integration

    Unsolved
    1
    0 Votes
    1 Posts
    127 Views
    No one has replied
  • 0 Votes
    5 Posts
    494 Views
    G
    @SGaist Thanks for the suggestion! I’ll definitely try using commitDataRequest(). Just to clarify — will this method reliably block or cancel GUI-initiated shutdowns (like using the power-off button from GNOME or KDE) if I call manager.cancel() inside that slot? Also, does this approach still work reliably with modern session managers, given that some DEs (like GNOME) are moving away from traditional X11 session management? Are there any best practices for using commitDataRequest() together with D-Bus inhibitors or org.freedesktop.login1 to improve compatibility across desktop environments? Thanks again — I appreciate your insights!
  • PyQt6 minimal requirements for Ubuntu github workflow

    Solved
    6
    0 Votes
    6 Posts
    585 Views
    SGaistS
    Glad you found out and thanks for sharing ! I did not think about this library because most of the time it happens when building C++ projects without all dependencies properly installed.
  • Unable to change the background color of DockLabel

    Unsolved
    4
    0 Votes
    4 Posts
    283 Views
    B
    sorry i messed up the code in the first reply, i'm new here haha from PyQt5.QtWidgets import QApplication, QMainWindow from pyqtgraph.dockarea import Dock, DockArea import pyqtgraph as pg import sys class DockApp(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Dockable Display App") self.setGeometry(100, 100, 800, 600) self.area = DockArea() self.setCentralWidget(self.area) self.set_dock_default() def set_dock_default(self): """Sets up the dock with a display window.""" self.image_dock = Dock(name="Display Dock", size=(1, 1)) self.image_dock.label.setStyleSheet("background-color: #04B2E2;") #change to blu but doesn't work self.display_window = pg.PlotWidget(title="Image Display") self.display_window.getViewBox().invertY(True) # Inverting Y axis self.image_dock.addWidget(self.display_window) self.area.addDock(self.image_dock, "top") if __name__ == "__main__": app = QApplication(sys.argv) window = DockApp() window.show() sys.exit(app.exec_())
  • Help resolving PySide6 install issues on Rocky Linux 8

    Unsolved
    13
    0 Votes
    13 Posts
    1k Views
    M
    @CristianMaureira Thank you, this is exactly what I was looking for. I have no idea how I didn't find it while googling.
  • Exchanging data between a PyQt5 app asynchronously

    Unsolved
    5
    0 Votes
    5 Posts
    472 Views
    B
    Thank you once again! I will dig into those examples.
  • simplest mvc pattern in pyside6

    Unsolved
    3
    0 Votes
    3 Posts
    685 Views
    CristianMaureiraC
    In case you need some guidance, here is an auto-translate (C++ -> Python) for the snippet within that page https://doc.qt.io/qtforpython-6/overviews/qtwidgets-model-view-programming.html (some of the code might not be 100% working but it might be hopefully a starting point)
  • Packaging a desktop app for cross platform built on PyQt6 Python

    Unsolved
    4
    0 Votes
    4 Posts
    672 Views
    CristianMaureiraC
    Hey @dev-anis what you are trying to achieve is completely possible in PyQt6 (bindings by Riverbank Computng), but I'm not familiar how. That being said, within PySide6 (official bindings by The Qt Company) we have a tutorial for creating a SQL Alchemy PySide6 application https://doc.qt.io/qtforpython-6/tutorials/finance_manager/index.html#tutorial-financemanager where you can create a package with the deployment tool
  • How to develop python qwidget for c++ QMainWindow?

    Unsolved
    5
    0 Votes
    5 Posts
    432 Views
    CristianMaureiraC
    Hello @MonkeyBusiness The use case you are describing is not very usual, and that's why you might have find difficult to do it. As stated before, you can embed a Python interpreter within your C++ application, which can help you to have a Python interface that can interact with some of the C++ objects of your application. This is known as making a Qt/C++ application scriptable with Python. You could create a QWidget from Python, and display that like a QMessageBox, QLabel, QTreeWidget, etc, but that requires a bit more work, because that needs a runtime registration of the bindings to be generated. There has been some internal work on dynamic Python bindings within C++ applications, but it's not released yet. Like other recommendations, it seems that you can rely on .ui files for easily creating interfaces for your C++ application, rather than trying to expose python widgets to C++.
  • QSystemTrayIcon bug for computer system!!!

    Locked Unsolved
    3
    0 Votes
    3 Posts
    314 Views
    CristianMaureiraC
    And here there is the auto-translated version for Python https://doc.qt.io/qtforpython-6/overviews/qtwidgets-model-view-programming.html (please note that some issues might be present in the code snippets)
  • 0 Votes
    2 Posts
    284 Views
    CristianMaureiraC
    Officials, no, but Community driven maybe. You can check the Qt Design Studio implementation though: https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/?h=qds/dev
  • shiboken: wrap class derived from (specialized) template class

    Unsolved
    3
    0 Votes
    3 Posts
    264 Views
    CristianMaureiraC
    Hey @giacomos also consider looking at this old Qwt implementation of bindings: https://github.com/qt-ps-americas/pysideqwt it's not up-to-date, but it can help you with some types, for example you can see how QwtPlotCurve was exposed here: https://github.com/qt-ps-americas/pysideqwt/blob/master/bindings.xml#L13
  • Cannot pip install pyside6_ds?

    Solved
    2
    0 Votes
    2 Posts
    313 Views
    CristianMaureiraC
    Yeah, it doesn't support 3.13 yet. Please make sure to report a bug in case you find anything else: https://wiki.qt.io/Qt_for_Python/Reporting_Bugs