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
  • PyQt6 minimal requirements for Ubuntu github workflow

    Solved
    6
    0 Votes
    6 Posts
    282 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
    104 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
    372 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
    205 Views
    B
    Thank you once again! I will dig into those examples.
  • simplest mvc pattern in pyside6

    Unsolved
    3
    0 Votes
    3 Posts
    275 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
    296 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
    208 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
    125 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
    100 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
    119 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
  • Why does PySide6 need glibc 2.39 since 6.8.1 on aarch64?

    Solved
    3
    0 Votes
    3 Posts
    173 Views
    CristianMaureiraC
    The decision comes from the fact that the CI nodes for aarch64 use a higher glibc version, like @SGaist mentioned.
  • Cannot pip install pyside6_ds?

    Solved
    2
    0 Votes
    2 Posts
    128 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
  • 0 Votes
    3 Posts
    117 Views
    CristianMaureiraC
    Just to add to point 2. PyKDE seems to be very old and unmaintained. But, you can write KDE Apps with Python https://develop.kde.org/docs/getting-started/python/ (using Kirigami, like the C++ apps do)
  • 0 Votes
    5 Posts
    144 Views
    P
    @jsulm Thanks for replying Its on the main thread, called by the variable in current_queue_item var in update_progress_to_specific_queue_num() function. But the update_progress_to_specific_queue_num() is called by the signal that is emitted by the worker thread. Which is safe. UPDATE: I solved this problem by changing the data variable in the queue_worker.addWork() function. from: data = [f'{args["name"]} - {args["frame_name"]} - {args["size_str"]}', args] to: data = [f'{args["name"]} - {args["frame_name"]} - {args["size_str"]}', args["queue_num"]] I now only sent the queue_num's value, not the whole args dict. It was a dumb idea to send the whole args dict, when some of the information is not even used. Also changed a couple of code in Queue.add_to_list() item_widget var from item_widget = QueueItemWidget(item_data[0], item_data[1]["queue_num"]) to item_widget = QueueItemWidget(item_data[0], item_data[1]) and lastly in the function Queue.find_item_by_value() from if list_item.data(Qt.UserRole)["queue_num"] == value: return list_item to if list_item.data(Qt.UserRole) == value: return list_item But I still don't know why using the whole args dict threw an error.
  • 0 Votes
    2 Posts
    87 Views
    SGaistS
    Hi, Are you thinking about something like the Qt Graphs module ? The KDE project also has quite a lot of additional libraries.
  • PySide6 D-Bus Signal Interface Not Emitting or Discoverable

    2
    0 Votes
    2 Posts
    75 Views
    SGaistS
    Hi and welcome to devnet, Thanks for the detailed post and sorry I can't help you directly. Things that would help further: which version of PySide6 are you using ? which Linux distribution are you running ? which version of DBus do you have ?
  • shiboken6-genpyi with C++ class mapped to primitive type (dict)

    Solved
    3
    0 Votes
    3 Posts
    114 Views
    SGaistS
    Hi, Glad you found out and thanks for sharing ! Would you mind posting the fixed version ? That might be useful to someone in the future.
  • importing PySide6 or shiboken6 removes trace callback

    Solved
    7
    1 Votes
    7 Posts
    205 Views
    B
    @ctismer Thanks for fixing the problem.
  • How to set the QGraphicsDropShadowEffect on the drop down menu of a QComboBox?

    Moved Unsolved
    6
    0 Votes
    6 Posts
    231 Views
    M
    @Shankarlinga-M I did some testing and it seems that the style from QStyleFactory can override the behavior of effects in the combobox's view() and view().viewport() You can try printing the available styles and changing them like this: print(QStyleFactory.keys()) app = QApplication(sys.argv) app.setStyle(QStyleFactory.create('Windows')) It also seems that the QGraphicsDropShadowEffect() expands the bounding box of the widget you apply it to, but doesn't expand the bounding box of the combobox.view()
  • How to Keep PyQt6 Window Always on Top on macOS

    Unsolved
    4
    0 Votes
    4 Posts
    231 Views
    SGaistS
    I tested your code on 14.7.3 removing all things that would not work such as the label stuff and it behaves correctly with PyQt6 6.7.1 as well as 6.8.1. Which version of PyQt6 are you using ?