1,084 questions
2
votes
0
answers
63
views
PySide6 import error: DLL load failed while importing QtWidgets [closed]
I've developed a Python application on my PC running Windows 11 using the library PySide6 to create a GUI. Then, I moved all .py files on a machine running Windows Server 2016 and installed all the ...
1
vote
0
answers
49
views
QTableview in PySide6 calls data() multiple times for rows that should not be visible
I have tested QTableview in pyside6 using the code below. When QTableview gets focus and we minimize the window when we restore the window suddenly the data() procedure can be called multiple times ...
-3
votes
1
answer
57
views
Progress tracking on form with QRadioButtons
I'm doing a test app, and I wanna track the progress on the test by showing the number of answered questions the person has done.
I've managed to do that with the clicked property of radiobuttons (...
Advice
0
votes
2
replies
103
views
How to retrieve a figure title from a Figure or FigureCanvas?
I'm using python and PySide6 to build GUI desktop apps.
In my code I generate a list of figures, and then pass them to my view to display each in a separate tab. Right now i loop through the list, and ...
1
vote
0
answers
48
views
QPalette.ColorRole.ButtonText not updating on hover and checked [duplicate]
In my paintEvent for QPushButton I am getting the current text color, whether the button is disabled, hovered, checked, or static. This works for disabled but when the button is hovered or checked, it'...
Advice
1
vote
4
replies
82
views
Which paradigm and tech stack for an app that listens to messages and updates shapes on a satellite map
I am taking advantage of StackOverflow's new "General advice" question type to present my use case and ask for technical guidance.
I am a Data Scientist with several years experience in ...
2
votes
1
answer
124
views
PySide6 QRunnable random Segmentation Fault
I'm following the python gui's tutorial for multithreading (which works as expected) and tried to adapt it to my case. However sometimes the thread runs as I expect while randomly the thread doesn't ...
1
vote
0
answers
63
views
Why does my PySide6 DBUS ScreenSaver Signal-Listener not work?
I am currently trying to connect to the Screensaver Signal (org.freedesktop.ScreenSaver - /ScreenSaver - ActiveChanged(bool)) that is emitted when the Screen-Saver is closed:
$ dbus-monitor "...
6
votes
1
answer
169
views
Type-hinting a combined Mix-in class and subclass leads to TypeErrors
The following code-snippet bridges some dataclasses and GUI-classes using PySide6 (the Qt library).
The HasDataobject class is key here. It defines a mix-in for subclasses of QGraphicsItem. It adds an ...
1
vote
1
answer
47
views
QListView drag and drop items (IconMode)
I have a QListView that is configured like this:
self.added_items_model = ReorderableModel(self.ui.lstViewAddedItems)
lstViewAddedItems = self.ui.lstViewAddedItems
lstViewAddedItems.setModel(self....
1
vote
0
answers
87
views
Unable to find module resources_rc, import resources_rc: How to generate import resource header to package name in PySide6
I'm trying to import my resource file but through my package. How do I generate the ui/resource files so that it can specify the package name. So that instead of this:
import resources_rc
it should ...
0
votes
0
answers
111
views
Cannot import QtWebEngineWidgets in PySide6 on a docker Windows container
I have a python PySide6 program that I want to compile and test on a container. The program runs on Windows, so I have a Windows container:
FROM winamd64/python:3.13.5-windowsservercore
# .. install ...
0
votes
0
answers
39
views
How can I test trayicon interactions on the command line in Linux in a headless CI/CD environment
I currently have a CD/CI pipeline that tests my application by using Xvfb to start a framebuffer and xdotool to focus on the window and send a ctrl+q. My application is set to exit on ctrl+q:
#!/...
2
votes
0
answers
100
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 ...
1
vote
0
answers
58
views
qt interface app in python does not load when loaded on system made with WinPE v10
I am trying to have a bootable USB stick that starts a python app with a Qt interface. I get an error on loading QtCore :
# code object from 'X:\\Python313\\Lib\\__pycache__\\string.cpython-313.pyc'
...
0
votes
0
answers
73
views
Using text in pyqtgraph colorbar tick values
I am writing an application in pyside6 and using pyqtgraph's imageitem & colorbar for displaying plots.
The simplified requirement is
The y-axis has a value between 0 and 2, representing 3 states ...
2
votes
0
answers
71
views
How can I change the color for selected (highlighted) items in a QListWidget [duplicate]
I'm trying to make a QListWidget subclass that will have just a cyan border when an item is selected
But when I use transparent in its stylesheet I get a gray-like color (in fusion style) and when I ...
1
vote
0
answers
44
views
Pyside environment variable doesn't apply in Pycharm's run configuration
I'm trying to diagnose missing Slot decorators as specified in the end of the section https://doc.qt.io/qtforpython-6/tutorials/basictutorial/signals_and_slots.html#the-slot-class. I was able to ...
1
vote
2
answers
130
views
In PySide6 how to set the QTableView cell font color when in edit mode?
I created a PySide6 application with a QTableView where the user can edit cells values.
The QTableView parent QDialog has a blue background set with stylesheet:
background-color: #11375E;
and the ...
1
vote
0
answers
90
views
PySide6 QThread with Worker never emits finish signal
Before asking the question, I am aware of people having similar problems and reviewed similar questions, but I did not find the answer.
I have tried to follow the example from here to do proper ...
2
votes
0
answers
104
views
QObject.disconnect() behavior in PySide6
I have the following PySide6 code
import sys
from PySide6.QtWidgets import (QApplication,
QWidget, QPushButton, QVBoxLayout, QHBoxLayout,
QLabel)
class Window(QWidget):
def __init__(...
0
votes
0
answers
98
views
Not able to get selection of PDF document
With PySide6 getSelection returns an invalid QPdfSelection. No matter what arguments we pass to it.
We'd expect a valid QPdfSelection with a non-zero boundingRectangle.
How to reproduce it
We call ...
1
vote
1
answer
104
views
Silent crash when adding emoji to button label in PySide6 / Qt Creator
I'm using Qt Creator to design the GUI for an app. I wanted to add some emoji to the button labels but the app silently crashes when I do. I followed the error to the retranslateUI() function (which ...
0
votes
0
answers
64
views
Running scripts in Embed QTConsole from Qt buttons
I'm attempting to make a gui to run and distribute a toolbox of scripts for my job and I'm struggling to get the QT console to interact properly. I want to have the embbeded console with a row of ...
0
votes
0
answers
69
views
PySide6-QtQuick QSGGeometryNode used in QQuickItem.updatePaintNode not visible and sometimes causes crash
I am writing an application in Python3.12 on Ubuntu, using PySide6.9 and QML.
I tried to create an own QQuickItem in Python as QmlElement to use it in QML.
I subclassed QQuickItem and used the ...
0
votes
1
answer
71
views
PySide6.QtDBus QDBusArgument cannot be converted to Python dict
I'm trying to access MPRIS metadata from a media player using PySide6.QtDBus in Python. Here's a minimal example of my code:
from PySide6.QtDBus import QDBusInterface, QDBusConnection
BUS = ...
0
votes
0
answers
49
views
Is there a way to specify layout independent key sequence in pyside?
I'm trying to implement a settings menu which should open on pressing keys of ctrl+, of the standard US layout on any layout. But on non-US layout it opens on different keys. Is there a way to achieve ...
1
vote
0
answers
216
views
module "org.kde.kirigami" and "org.kde.desktop" not installed
I'm following the tutorial: A full Python + Kirigami application to learn how to build Python applications using PySide6 and Kirigami for KDE, under Arch Linux and Fedora.
However, when running the ...
0
votes
1
answer
55
views
How to map nested GLLineItems from different parent items
I am trying to paint pyqtgraph.opengl.GLLinePlotItem nested within other GLLinePlotItem with different parents, where the painted result is identical had you not nested them and instead just painted ...
1
vote
1
answer
208
views
Python asyncio: execute an asyncronous function while the main thread is blocked [closed]
I'm coding a python project split into two parts:
a PySide6 GUI interface that needs to run on the main thread synchronously, and consequently block it,
a playwright virtual web browser (asynchronous)...
1
vote
0
answers
81
views
Display and update short text next to system tray icon
I have an application written with PySide6, and I want to display a short text (3 characters) next to the system tray icon. Displaying just the icon works fine, but I haven’t found a way to show the ...
0
votes
1
answer
82
views
Load QPdfDocument outside of GUI thread for QPdfView?
In a pyside6 app, local pdf-files get displayed with QPdfView. The user can go through many pdfs within a second, and some of them take rather long to load and parse. Thus, loading the latest pdf in a ...
1
vote
1
answer
45
views
Resize table columns weird warning in PySide6 when disconnecting/connecting function to signal
I have the following function to be able to resize the first two columns of a table in PySide6 while keeping the third the same size since it contains a combobox and keeps the ratios they get of the ...
0
votes
0
answers
31
views
PySide6: PyQtGraph scatterplot not loading data spots correctly, it displays all spot on top-left side of the graph [duplicate]
I am working on a PySide6 application and am implementing a PyQtGraph in a layout.
I want to use PyQtGraph instead of Matplotlib because apperently it would be better to use it for interactive graph (...
0
votes
0
answers
95
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 ...
0
votes
0
answers
39
views
PyQt vs PySide uic loader difference [duplicate]
I'm migrating some code from PtQy5 to PySide6. I'm experiencing a significant behavioural difference when loading .ui files.
The original PyQt5 code:
import sys
import os
from PyQt5.QtWidgets import ...
1
vote
1
answer
146
views
Send messages to Qt GUI from a process pool. PySide6
I have an app that downloads files from an ftp server and it does so in a process pool to save time because there can be a lot of files at times.
I'd like to show the progress of what files are being ...
1
vote
0
answers
72
views
Transparent background QLabel overwrites text on updates
I'm using Pyside6 with PyVista for an app we use to visualize and derive measurements from body scan meshes. The issue I'm hitting is with QLabel text overlays with transparent backgrounds. (The ...
1
vote
2
answers
567
views
pyqtgraph not working on example in pythonGUIs website - PySide6 with pyqtgraph
I am trying the example from PythonGUIs website using this script:
from PySide6.QtWidgets import QApplication, QMainWindow
import pyqtgraph as pg
import sys
class MainWindow(QMainWindow):
def ...
0
votes
1
answer
111
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, ...
0
votes
1
answer
186
views
QTableWidget cells background color has unwanted "rounded padding"
On Windows 11, when I set the background color of items in my QTableWidget using item.setBackground(QColor(210,210,210)), the color doesn't fill the cell entirely, there is some sort of padding with ...
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, ...
1
vote
0
answers
62
views
Drawing a long cursor over a QPlainTextEdit
I'm trying to draw a long cursor in Qt.
I already have a function to edit many lines of a QPlainTextEdit at the same time (<-> alt edition in Notepad++), and my current goal is to display the ...
0
votes
1
answer
447
views
Pyside6 - Change svg icon color dynamically
I am trying to build a pyside6 application with a light mode and a dark mode. That means that my icons also need to be light and dark mode.
Now I was hoping to set the color of the QIcon SVGs inside ...
-1
votes
1
answer
67
views
QSqlQueryModel.setQuery() won't accept str [closed]
I'm trying to fill a QSQlQueryModel with data using setQuery and a specific database, but I get an error which to me looks like setQuery won't accept a string - despite that is what is described in ...
0
votes
0
answers
39
views
PySide6.QtWidgets.QWidget crashes on super().__init__() [duplicate]
The following code crashes and I don't understand why.
from PySide6 import QtWidgets
class MockParent(QtWidgets.QWidget):
def __init__(self, /):
try:
super().__init__()
...
1
vote
0
answers
29
views
Does QGridLayout have a padding bug? [duplicate]
When adding a padding to the top of a QLabel, QGridLayout also adds a padding/margin on the left:
Why? is this a bug?
class MainWindow(QWidget):
def __init__(self):
super().__init__()
...
0
votes
1
answer
95
views
How to add text to a series point in a pyside6 Qchart? I'm not sure if its a bug but I can't find a working example
How to add text to a series point in a pyside6 Qchart?
I'm not sure if its a bug but I can't find a working example.
I would also like to add a box with some text, similar to a legend, if possible.
...
1
vote
1
answer
71
views
Automate screenshots of QLayout
I automatically take screenshots of the MainWindow of a Qt application that I am developing. The screenshots are for documentation. I can take screenshots of the whole MainWindow with QWidget.render. ...
1
vote
0
answers
123
views
How can I change the language of a QFileDialog to French in a PySide6 project? [duplicate]
I'm working on a PySide6 project and I'm trying to change the interface language to French. While I've managed to translate most of my application, the QFileDialog widget stubbornly remains in English ...