Skip to content

Qt for Python

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

3.3k Topics 14.6k Posts
  • Installing pyqt6 and pyqt6-tools: MacOS

    Moved Unsolved
    4
    0 Votes
    4 Posts
    4k Views
    SGaistS
    Any chances you have Python 3.12 for your environment ? If so, downgrade to 3.11. At least pip installation of PyQt6-tools worked with that version of Python.
  • app crashes when thread with api request is quitted

    Unsolved
    7
    0 Votes
    7 Posts
    822 Views
    SGaistS
    Can you share how you created your Python environment ? On macOS, with: Python 3.12.0 PySide6 6.6.1 yfinance 0.2.33 No crash happened.
  • Change the background of the row

    Unsolved
    2
    0 Votes
    2 Posts
    184 Views
    SGaistS
    Hi and welcome to devnet, Store the original color before changing it so you can reuse it when you want to reset the color to default.
  • An advice needed to catch Segmentation Violation

    Unsolved
    10
    0 Votes
    10 Posts
    948 Views
    S
    @JonB said in An advice needed to catch Segmentation Violation: @StarterKit I meant an hour of putting in some print()/logging statements all over the place, then letting it run to reproduce in time. Oh... sorry, got it from second reading only. Agree with you.
  • Capturing Joystick button presses

    Unsolved
    1
    0 Votes
    1 Posts
    254 Views
    No one has replied
  • Creating a QComboBox with checkboxes within it

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    R
    @SGaist said in Creating a QComboBox with checkboxes within it: In the context of a menu, having checkboxes is fine as you also have the complete view of the possibilities. In the context of a team of players, I would rather expect to have a list view that I can go up and down at will where I can see what I have selected rather than having to use a combo box that I would need to open and re-open. @JonB said in Creating a QComboBox with checkboxes within it: @rssweiss As @SGaist says use a QListView here. A combobox is intended to pick a single item, not put checks against multiple items. Alright, thank you guys!
  • Text Component not displaying in TreeView

    Unsolved
    1
    0 Votes
    1 Posts
    145 Views
    No one has replied
  • QSurfaceDataProxy not working in QML

    Unsolved
    3
    0 Votes
    3 Posts
    306 Views
    S
    @friedemannkleint Thank you. Will try it
  • cannot access QAxWidget custom event/methods with PyQt6/PySide6

    Unsolved
    4
    0 Votes
    4 Posts
    580 Views
    SGaistS
    Hi, It sounds like a regression then since it used to work. Did you already check the bug report system ? If there's nothing there, then please consider opening a new report with your findings.
  • How to modify font for title of QGroupBox?

    Solved
    5
    0 Votes
    5 Posts
    483 Views
    A
    @SGaist Got it. Thanks!
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    4 Views
  • Accurate Button Placement in QDesigner

    Unsolved pyside
    3
    0 Votes
    3 Posts
    335 Views
    jeremy_kJ
    @LREGS said in Accurate Button Placement in QDesigner: However, when I'm placing them in QDesigner it's not possible with my current knowledge to place them exactly in the holes of the image because it seems the center of the label needs to be anchored to one of the background dots in QDesigner. This is probably the snap to grid behavior. From the menu toolbar: Tools -> Form Editor -> Form Settings ... Check the Grid checkbox, and then uncheck Snap. @SGaist's suggestions are likely easier to deal with in the long run.
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    26 Views
  • Using UI class from another directory

    Unsolved
    2
    0 Votes
    2 Posts
    554 Views
    jsulmJ
    @Joimar said in Using UI class from another directory: from UIClasses\mainwindow import Ui_MainWindow Shouldn't it be from UIClasses.mainwindow import Ui_MainWindow ?
  • Connect to DBus signal - Correct syntax

    Solved
    4
    0 Votes
    4 Posts
    768 Views
    D
    Here is the complete issue: https://bugreports.qt.io/browse/PYSIDE-2547 I got this solution from here: https://stackoverflow.com/questions/38142809/pyqt-5-6-connecting-to-a-dbus-signal-hangs If you have an idea how to get the PropertiesChanged Signal to work, I would be happy, too, otherwise I will switch to GTK I guess... Or maybe I open a separate post for this, but as no one could help on the simple case, I have little hope for the more complex case...
  • [PySide6] QSystemTrayIcon bug when using Class

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    JonBJ
    @Salamafet said in [PySide6] QSystemTrayIcon bug when using Class: I don't understand why, but it works. Well the reason is that when Python detects nothing is refencing any Python object it destroys it --- that's the object collection the language gices you unlike plain C++. The mystery is that one would have thought that self.setContextMenu(menu) would itself increment the reference count on menu and its action added to that. I don't know why it does not. I don't know whether menu = QtWidgets.QMenu(self) inside Tray() would have improved the situation. You might like to add that anyway, and then maybe see if the other 2 changes are no longer required. Ah, see (the C++ explanation for) [void]QSystemTrayIcon::setContextMenu(QMenu *menu) (or PySide6 PySide6.QtWidgets.QSystemTrayIcon.setContextMenu(menu)): Note: The system tray icon does not take ownership of the menu. You must ensure that it is deleted at the appropriate time by, for example, creating the menu with a suitable parent object. This explains everything. Whenever it says "something does not take ownership of this QObject" that will mean the Python code will not increment a reference count. setContextMenu() leaves you in charge of the menu, which e.g. you might be using elsewhere. Consequently any QObjects documented like that will require (typically) a Python self._variable = TheObject() to keep it "alive" for the duration of the class instance, not just a local variable. Or, by the looks of it even better, pass self to the top-level object's constructor (your QMenu()) so it is fully owned by the instance.
  • QSqlDatabase.addDatabase() throws "invalid nullptr parameter"

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    F
    See QTBUG-117621
  • QMediaPlayer only plays video not audio

    Unsolved
    2
    0 Votes
    2 Posts
    710 Views
    SGaistS
    Hi and welcome to devnet, Can you play this file successfully with ffmpeg ?
  • QProgressbar becomes less smooth after applying a stylesheet

    Unsolved
    1
    0 Votes
    1 Posts
    151 Views
    No one has replied
  • qmllint and Python modules

    Solved
    3
    0 Votes
    3 Posts
    314 Views
    V
    @friedemannkleint Thank you for your support, it works.