pyqt6

QtMultimedia is not currently supported on this platform or compiler. PyInstaller

QtMultimedia is not currently supported on this platform or compiler. PyInstaller Question: I’m using PyInstaller v5.6.2. I prescribe pyinstaller mp3pyqt6.py, after which I add the necessary files to mp3pyqt6.spec, updating the pyinstaller mp3pyqt6.spec command. The console that comes with the application says: could not load multimedia backend "" QtMultimedia is not currently supported on this …

Total answers: 2

PYQT6.4 QTableWidget.sortItems function, Pycharm is throwing a syntax issue even though syntax follows documentation

PYQT6.4 QTableWidget.sortItems function, Pycharm is throwing a syntax issue even though syntax follows documentation Question: Here is the documentation: QTableWidget.sortItems This is the function: PySide6.QtWidgets.QTableWidget.sortItems(column[, order=Qt.AscendingOrder]) The following is my code: self.notes_current_table_widget.sortItems(column[2, order=Qt.AscendingOrder]) PyCharm displays this as an error, when I try to run I get: SyntaxError: invalid syntax. Maybe you meant ‘==’ or ‘:=’ …

Total answers: 1

Unable to click, select or move QGraphicsEllipseItem

Unable to click, select or move QGraphicsEllipseItem Question: A small snippet I am using to understand QGraphicsEllipseItem. From my understanding , based on the flags set I should be able to move and capture mouse events but am unable to do so. Any help or guidance ? import sys from PySide6.QtCore import QPoint, QRectF from …

Total answers: 1

How to call a QTextEdit widget from MainWindow and use it from another class? [pyqt5, pyside, python]

How to populate a QTextEdit, that is inside a QTabWidget, by opening a text file? [pyqt5, python] Question: I am trying to use the self.textedit = qtw.QTextEdit() widget that I declared from my MainWindow into my TextFileOpenedInNewTab class by doing this self.main_window = MainWindow() and using it like this self.main_window.textedit.setPlainText(content). It works, but it has …

Total answers: 2

PySide6 app crashes when using QPainter.drawLine()

PySide6 app crashes when using QPainter.drawLine() Question: On Windows 10, python3.10, PySide6 (or PyQt6) QApplication crashes when calling QPainter.drawLine() . The terminal just displays : Process finished with exit code -1073741819 (0xC0000005) Please find below the code: import sys from PySide6.QtCore import QPoint, Qt from PySide6.QtGui import QColor, QPainter, QPen, QPixmap from PySide6.QtWidgets import QApplication, …

Total answers: 1

A minimal OpenGL example in PyQt6 does not work. Error: "invalid operation" in glClearColor

A minimal OpenGL example in PyQt6 does not work. Error: "invalid operation" in glClearColor Question: I try to run a very simple OpenGL example: import sys from OpenGL import GL as gl from PyQt6.QtOpenGLWidgets import QOpenGLWidget from PyQt6.QtWidgets import QApplication class Widget(QOpenGLWidget): def __init__(self): super().__init__() self.setWindowTitle("PyQt6, OpenGL 3.3") self.resize(400, 400) def initializeGL(self): gl.glClearColor(0.5, 0.5, 0.5, …

Total answers: 1

PyQt6 Tutorial – how to receiving signal parameters

PyQt6 Tutorial – how to receiving signal parameters Question: I am a newbie to Python Qt programming. I have been going through a tutorial at the link – https://www.pythonguis.com/tutorials/pyqt6-signals-slots-events/ The part of the tutorial that I am unable to understand is under the section "Receiving data" class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("My App") button = …

Total answers: 2

PyQt6: How to set allocation limit in QImageReader?

PyQt6: How to set allocation limit in QImageReader? Question: I’m updating an application from PyQt5 to PyQt6. The application uses very large image files. I’ve updated the code to work with PyQt6, however, when I run the Python script I now get an error: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of …

Total answers: 2

How use asyncio with pyqt6?

How use asyncio with pyqt6? Question: qasync doesn’t support pyqt6 yet and I’m trying to run discord.py in the same loop as pyqt but so far I’m not doing the best. I’ve tried multiprocess, multithread, and even running synchronous code from non-synchronous code but I either end up with blocking code that makes the pyqt …

Total answers: 2

PyQt6 auto-resize QTextEdit to fit content problem

PyQt6 auto-resize QTextEdit to fit content problem Question: I have a bunch of QTextEdits in a QVBoxLayout in a QScrollArea. The texts can often get very long and the horizontal space is limited by design, and QTextEdit automatically wraps text in multiple lines which is good. I want to automatically resize the QTextEdit to fit …

Total answers: 1