Skip to content

Qt for Python

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

3.3k Topics 14.4k Posts
QtWS25 Last Chance
  • hiding a QLabel at default

    Unsolved
    2
    0 Votes
    2 Posts
    54 Views
    SGaistS
    Hi and welcome to devnet, How are you setting up your label ? On a side note, I would recommend you take the time to re-evaluate your architecture. Your chain of dialogs is currently pretty brittle. There are other ways to switch from one widget to another that does not involve creating a new widget every time. Check for example QStackedWidget. You might want to also consider QMainWindow which provides a status bar. Depending on the error you might want to consider a QMessageBox using the appropriate level of urgency to show the message.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    11 Views
    No one has replied
  • 0 Votes
    2 Posts
    60 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
    306 Views
    L
    @SGaist I get it, thx, I will try.
  • Hiding viewer panel vs window maximization

    Moved Unsolved
    1
    0 Votes
    1 Posts
    31 Views
    No one has replied
  • NotImplementedError: QAsyncioEventLoop.getaddrinfo() is not implemented yet

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

    Unsolved
    3
    0 Votes
    3 Posts
    101 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
    83 Views
    B
    I decided to go ahead and submit an issue because I feel like it is likely a bug.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    17 Views
    No one has replied
  • Is building for iOS supported?

    Unsolved
    4
    0 Votes
    4 Posts
    94 Views
    JKSHJ
    @patrickkidd As far as I know, Qt R&D is looking into it, but there is still lots of work to be done before iOS deployment is possible.
  • How to change the background color of a DockLabel instance??

    Unsolved
    4
    0 Votes
    4 Posts
    132 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
    33 Views
    No one has replied
  • 0 Votes
    5 Posts
    147 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
    263 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.
  • Defer Resize Event due to expensive resize method.

    Unsolved
    3
    0 Votes
    3 Posts
    86 Views
    S
    @AliSot2000 said in Defer Resize Event due to expensive resize method.: Is there a way to detect if the LMB is pressed during a ResizeEvent? Because it doesn't seem to be the case. Most likely resizing a (top-level) window is done by the underlying OS/window manager and thus Qt does not know anything about the mouse. This is why you only a resize event, but no mouse event. (At least, that is my guess.) There is a common trick using two timers, though the second timer is usually used to not delay the function call indefinitely (which you don't seem to need in your case). So, using a single timer is okay. However, you need to make sure that you reuse the same timer and reset it, so that the timeout is further delayed until there no more interactions.
  • Unable to change the background color of DockLabel

    Unsolved
    4
    0 Votes
    4 Posts
    93 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
    322 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
    168 Views
    B
    Thank you once again! I will dig into those examples.
  • simplest mvc pattern in pyside6

    Unsolved
    3
    0 Votes
    3 Posts
    246 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
    262 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