3,631 questions
2
votes
1
answer
66
views
Opening a pop-up window when error from a worker running in Qthread occurs completely freezes the program
I was trying to create a little Python program with a GUI using Pyside6. I ran into a problem when creating a thread for a worker to do a task (check files with a certain condition and then copy them ...
2
votes
1
answer
103
views
Asynchronous listening and processing in a Pyside app
I am having difficulties integrating asyncio with Pyside.
What I want to acheive:
I have several emitters (up to 30) sending messages independently every few milliseconds (200ms) in multicast.
I have ...
2
votes
0
answers
107
views
PySide6 subclassing QSqlDatabase
I've run into an issue with PySide6 that I cannot subclass QSqlDatabase.
My biggest complaint about the QtSql system is that it does not throw exceptions when things go wrong. You have to manually ...
0
votes
0
answers
99
views
Avoiding Repetitive layout.addWidget() calls in PySide6
After working with the introduction to PySide6, I began to develop a simple GUI for an app. One thing I noticed is the requirement to add a component, like a QLabel, then having to determine where the ...
1
vote
1
answer
187
views
QMovie is stuttering / lagging when using an animated .webp file on both PyQt6 and PySide6
The animated .webp file on the left is being played on Google Chrome, while the one on the right with a QMovie.
I've tested this on PyQt6 6.7.1, 6.8.1 and 6.9.1, and also on PySide6 6.8.2. There ...
0
votes
1
answer
117
views
PySide6 QGuiApplication.primaryScreen().grabWindow() creates null QPixMap
I'm trying to implement a screenshot functionality into my PySide6 application using QGuiApplication.primaryScreen().grabWindow().
So far I've tried on two systems, both are running Ubuntu 22.04.5, ...
1
vote
1
answer
98
views
How do you change the position (column and row) of a PyQt QWidget inside a QTableWidget?
I want to move a QWidget from one position to another. I tried the following:
import sys
from PySide6.QtWidgets import (
QApplication, QMainWindow, QTableWidget, QLabel, QPushButton, QVBoxLayout, ...
0
votes
1
answer
66
views
how to have a fixed azimuth and elevation of a GLTextItem
I am trying to remove the banner effect from the pyqtgraph.opengl.GLTextItem such that whenever the camera angle changes, the angle of the text item is fixed. I can get the size of the text item to be ...
0
votes
0
answers
111
views
Cannot Drag Dock Widgets PySide6 Ubuntu 22.04
I'm developing a GUI using PySide6 and experiencing an issue with QDockWidgets on Linux Ubuntu 22.04. The dock widgets initialize correctly, but I cannot drag it to a new location. I can click on the ...
0
votes
0
answers
60
views
Add Tab Button on PyQt6/PySide6 QTabWidget [duplicate]
I'm currently extending a program with a tab view. For this i need a button to add tabs, which i would like to have directly next to tabs, like in a web browser. I can't just add it as an extra tab, ...
2
votes
1
answer
189
views
How to load a PDF from bytes instead of file in Pyside6?
I'm trying to display a PDF I created (using fpdf2) in a Pyside6 app.
There seems to be two roads there:
I can use QWebEngineView with plugins enabled, in which I can inject the PDF raw bytes, which ...
1
vote
0
answers
62
views
PyQtGraph ROI Mouse Events Not Working Inside QGraphicsProxyWidget
When I place a PyQtGraph PlotWidget with ROIs inside a QGraphicsProxyWidget, the ROIs don't respond to some of the mouse interactions. Except the hover events, no operations work with the ROI e.g. ...
0
votes
0
answers
41
views
setText in a function before await not working
when running this code:
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QLineEdit
from PySide6.QtGui import QIcon, QFont, QValidator
from PySide6.QtCore import QSize, QPoint, Qt
...
0
votes
0
answers
123
views
Qt Platform Plugin ‘cocoa’ Not Found on macOS: How to Resolve Missing Plugin Issue?
I’m encountering an issue with my Qt application on macOS. When I try to run my PySide6-based application, I get the following error:
qt.qpa.plugin: Could not find the Qt platform plugin "cocoa&...
0
votes
0
answers
40
views
Python is considering my button as a bool type [duplicate]
I'm creating a calculator with PySide6. In all methods I created, doing this buttonText = button.text() works well, but for some reason, in this specific method, Python says that my button is a ...
0
votes
0
answers
94
views
pyqtgraph.opengl.GLScatterPlotItem scatter object is not rendering correctly
I am having issues with how pyqtgraph.opengl.GLScatterPlotItem is rendered. It seems that when adding GLScatterPlotItem to gl.GLViewWidget before showing the QMainWindow, the scatter plot never ...
0
votes
0
answers
34
views
QWidget does not update when the slot is called in PySide [duplicate]
Sorry if this sounds like a dummy question, I am new to PySide.
I want to create two QListWidgets in a single layout after a clicked signal is emitted. However, the lists do not appear as expected ...
1
vote
1
answer
90
views
pytest isn't catching exception found in Qt Event Loop?
I am writing an integration test for saving data disk as JSON. The desired behavior: when a record already exists in the JSON file, the application should raise an exception before overwriting ...
0
votes
0
answers
182
views
Why does a Pyside6 GUI crash after making multiple calls to matplotlib flush_events() in quick succession?
I would be very grateful for your help in explaining why this Pyside6 GUI crashes when making multiple calls to matplotlib's flush_events() method in quick succession. Minimal reproduceable code is ...
0
votes
0
answers
100
views
shiboken6/pyside6 with poetry under msys2
I would like to use PySide6 in a poetry project under msys2
My configuration is the following:
poetry version 2.0.1 from package mingw64/mingw-w64-x86_64-python-poetry
pyproject.toml settings:
[tool....
0
votes
0
answers
77
views
Resize Docks in QtAds Docking System
I am using Qt in Python with QtAds for a docking-based UI. However, I am unable to make the sidebar (navigation panel) narrower. No matter what width I set using setMinimumWidth() or resize(), it ...
0
votes
0
answers
34
views
How to tackle dynamic translation of PyQt application whilst using QUiLoader
I would love some input into what the best way is to go about translating a widget in PyQt dynamically. I am aware of the retranslateUi() method, but this is not accessible when loading the .ui file (...
0
votes
1
answer
91
views
PyQT manual animation of Mouse Cursor. Repeatedly change shapes needed for cursor. Works on main thread. Doesnt work on separate thread. How so?
I would like to implement changing cursor in PyQT(PySide6) application. Since didn't find animated gif support for QCursor -> decided to create my own manual animation.
So far:
When change cursor ...
-1
votes
1
answer
55
views
Use Properties declared in separate Python file in QML
I want to keep order in my project, hence I thought about moving the properties from the "main.py" file to another called "CustomVariables.py". But now I get "TypeError: ...
3
votes
2
answers
139
views
Type Hinting and Type Checking for IntEnum custom types
Qt has several IntEnum's that support custom , user-specified types or roles. A few examples are:
QtCore.Qt.ItemDataRole.UserRole
QtCore.QEvent.Type.User
In both cases, a user type/role is created ...
0
votes
1
answer
185
views
QtTest + unittest: How to use QSignalSpy?
How to use QtTest.QSignalSpy with unittest?
It is not clear from the documentation; there are few examples.
from PySide6.QtWidgets import QApplication, QLabel, QWidget, QVBoxLayout, QPushButton
from ...
0
votes
1
answer
96
views
Where are Qt tools after installing PySide6 on macOS?
After running pip3 install pyside6 on Windows, we can see many Qt tools under PySide6.
Where are these tools after installing PySide6 on macOS?
There is no result in the search.
please tell me where ...
0
votes
0
answers
39
views
How to add properties for QObject on-the-fly? [duplicate]
I have a class that inherits from QObject. It contains a big dictionary of strings.
I want to use all of them as properties to be able use them in assignments and QML.
Now my class looks like this:
...
2
votes
2
answers
219
views
Waiting for a PyQt/PySide.QtCore.QThread to finish before doing something
I have a data acquisition thread which samples and processes data which it then emits as a signal to a receiver.
Now, when that thread is stopped, how can I ensure it has finished the current loop and ...
0
votes
0
answers
41
views
Setting the origin of a 2DHistogram Plot in PlotPy
I have been working with the PlotPy library (not to be confused with Plotly) to create a Python Qt GUI to display a series of plots -- one of which happens to be a 2D Histogram. Following their ...
0
votes
0
answers
49
views
How to track mouse position inside an image widget after resizing and avoid blind spots in PySide6? [duplicate]
I am trying to print the mouse position only when the user clicks on an image widget in a PySide6 application, but I am facing a couple of issues:
Blind spots: After clicking on the image, I am ...
0
votes
1
answer
108
views
How to fix jagged edges when drawing custom shaped translucent QWidget window?
I am trying to make a QWidget with a triangular tip at the bottom with the help of this tutorial. While I am able to get the shape I want, the tip has some jagged edges which I am not sure how to fix?
...
2
votes
1
answer
485
views
How to make transparent but clickable window?
I am making a screenshot snipping tool with PySide6 and I want to make an invisible frameless window to let user drag and capture screenshot. But every method I know will let the mouse click behind ...
0
votes
0
answers
36
views
Data Lost after convert .py file (GUI with QT) to .exe [duplicate]
So I am developing an application using QT and Python. Then in the python file I use 3 databases, namely using simple CSV and JSON to store information. Then I use the code below to make sure python ...
1
vote
0
answers
302
views
Qt.ItemIsTristate missing in PySide6?
I'm porting some code from PySide2 to PySide6 and have problems with the Qt.ItemIsTristate flag for a QTreeWidget item. Seems like this flag is missing in PySide6? Any suggestions how to work around ...
1
vote
0
answers
81
views
How to properly quit an event-based thread that needs to clean up resources?
I need to properly quit a thread that only processes signals from another threads. This thread owns a resources that need to be cleaned up. Before the thread will be quit, I call it's abort function, ...
2
votes
0
answers
45
views
How to set application name in PySide6 [duplicate]
I wanted to change the name of my application using setApplicationName() but when the program starts, the application is displayed as "Python" on my desktop.
from PySide6.QtWidgets import ...
0
votes
1
answer
435
views
Cannot run PySide6 application: unable to load Shiboken DLL
Good afternoon.
I faced the following problem:
I wrote a (PySide6) application, built it into an exe and tried to run it on Windows7, but I failed. After analyzing the logs and googling it turned out ...
1
vote
0
answers
60
views
Different rendering when creating QWidget from class or method [duplicate]
I'm building a GUI with Pyside 6, especially a title bar at the top. Seeing that I have many widgets, I've created a class to extend QWidget and set ContentsMargins and Spacing to 0 by default. Here's ...
1
vote
0
answers
264
views
How to efficiently keep a stable frame rate video stream in a PyQt application?
I am developing a PyQt (PySide6) application that needs to display and store multiple camera streams at the same time. The display of the camera streams goes well; however, storing these streams seems ...
0
votes
0
answers
174
views
PySide6.QMediaPlayer Cannot play audio on Windows 11
I tried to develop an audio player app using PySide6, but I found that I couldn't play any audio,The program is running normally, but no sound is playing. The mediaStatusChanged signal of QMediaPlayer ...
2
votes
0
answers
558
views
How does QtAsyncio.run() know what to run?
Full code for this example is below. I'm more interested in this part:
if __name__ == "__main__":
app = QApplication(sys.argv)
main_window = MainWindow()
main_window.show()
...
0
votes
0
answers
152
views
PyQt QMessageBox is Blocking, or not?
I have some operations that take place in the init() phase of my GUI. It looks for the presence of a file in a particular location and if it finds it, it will pop up a message box asking the user if ...
1
vote
0
answers
152
views
Calling QDialog.reject() has no effect - why? How do I close my dialog when certain conditions are met?
Calling QDialog.reject() has no effect. What am I missing?
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QDialog, QVBoxLayout
class MyDialog(QDialog):
def __init__(self):
...
1
vote
0
answers
126
views
How to create a QComboBox with checkboxes for multiple selection in PySide6? [duplicate]
I’m trying to create a custom QComboBox in PySide6 that allows multiple selection by adding checkboxes next to each item. The goal is to have the selected items displayed in the placeholder area of ...
0
votes
0
answers
276
views
How to set one of the standard pixmaps on a label in PySide6?
I'm trying to set a standard pixmap on a label, but nothing I do works.
I tried:
self.konfiguracja_groupBox.findChildren(qtw.QLabel, "polaczenie_label")[0].setPixmap(self.style()....
-1
votes
1
answer
197
views
Qt/PySide6: Add widget to QScrollArea during runtime, not showing up
I have a window with a button and a QScrollArea widget. When the button is pressed, a QLabel is supposed to be added to the QScrollArea widget. However, it's not showing up.
I know there are plenty of ...
0
votes
0
answers
97
views
How to Set the Height of QScrollArea to Avoid Extra Spacing Between Buttons in PySide6? [duplicate]
I'm working on a PySide6 application where I have a QScrollArea that contains a QFrame (topMenu) with several QPushButton widgets. My goal is to have the buttons closely aligned one after another, ...
0
votes
0
answers
100
views
Qml set context property for child item
I want to set a context property of a Qml Button from PySide6 but I get an error. Here are the relevant files:
main.py
import sys
from PySide6.QtCore import QObject, Slot
from PySide6.QtGui import ...
0
votes
2
answers
599
views
How do I add padding around a PyQtGraph PlotWidget?
I am trying to add padding around a PlotWidget as the default settings are extremely tight. However, the strategies I am trying to take are not working. The default padding is seen below.
default ...