17,201 questions
1
vote
1
answer
73
views
My custom label's text is uneven when rotated
I've created a custom qlabel using pyqt, however the text is slightly uneven when rotated. I've attached a picture of this vs an unrotated label. I've tried fixing it with setRenderHint Antialiasing, ...
2
votes
0
answers
30
views
How do I remove nested buttons from nested QHboxLayout in PyQt6? [duplicate]
I have a QVBoxLayout that contains three QLabels and a QHBoxLayout nested inside it. The nested QHboxLayout itself also has two nested buttons. When the buttons are pressed, I want to empty the entire ...
3
votes
1
answer
84
views
pyQt - Trying to draw B-Spline curve with mouse
I am trying to have a Pen Tool in my pyqt6 application. I am trying to make it how Inkscape's PenTool works. For now, I am trying to achieve the 'B-Spline' mode.
The issue is that my curve does not ...
1
vote
0
answers
44
views
Extra "pyside" and "qt" in SRC_URI
I'm getting some strange behavior in my Yocto build of PySide6. I've cloned the meta-qt6 layer (release 6.8) and I want to install PySide6. I found that I was getting a bunch of do_fetch errors ...
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'...
2
votes
1
answer
100
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 ...
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
1
answer
128
views
QTreeView as popup of QComboBox
The goal is to have a QTreeView that doesn't take up real estate on the GUI when not needed.
QComboBox seems like a great vehicle to make that happen. But maybe there's a better way that's similarly ...
2
votes
0
answers
98
views
PyQt6 QWebEngineView 3D Plot Fail To Render With Large Data
I'm working on an antenna 3D polar plot program which need to render real-time plot.
Things I'm using:
Python 3.11.9
PyQt6 6.9.1
PyQt6-WebEngine-Qt6 6.9.2
plotly 6.3.1
Issue:
The code can generate ...
-1
votes
1
answer
92
views
Closing QDialog internally
I am trying to start a Dialog including QListWidget. In this list every time a status is changed, the list should get a new line. At the end, if the backup process has finished, the dialog should ...
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 ...
2
votes
0
answers
157
views
Is there an equivalent of "em" for font sizes in PyQt6 StyleSheets?
In pyqt6, i am creating a fillable form. I'd like the first element in the form, the title, to be 25% larger than the rest of the elements in the form. In CSS, i'd do this by setting:
{font-size: 1....
1
vote
0
answers
79
views
What is the syntax for adding non-rendered data/metadata to a .ui file?
I’m making an application where I’m converting a .xml to a .ui file (qtdesigner), and rendering that using pyqt.
However, there is some data in the .xml that I do not want to render (e.g. as metadata);...
1
vote
0
answers
43
views
How to make QTableView's drag selection behave like a QTreeView
There's a difference in behaviour between QTableView and QTreeView when it comes to selecting multiple items by dragging the mouse.
In a QTreeView you can start outside the populated area and drag ...
1
vote
0
answers
61
views
pqyt6 - How to insert word-wrap in svg content
I'm creating pyqt6 app where I can replace normal fonts/text with svg fonts(.svg files like a.svg, b.svg etc).
My issue is with word-wrap. In normal mode(svg mode is disabled) QTextEdit correctly ...
1
vote
0
answers
56
views
PyQt6 - How can I change the direction of the scale/ruler
I have this Ruler class
Right now the scale looks like the below image. I want the ticks to have their roots towards the view instead of having them outwards. The base of the scale should be inside.
I ...
1
vote
1
answer
67
views
Pybind11 cannot integrate with Qt 6.9.1
I included Qt 6.9.1 header files and pybind11/pybind11.h in a same file. but then I use python to build a package.(the compiler is MSVC2022 x64 and I only use CMake)
this is part of setup.py:
import ...
0
votes
0
answers
63
views
PyQt6 QTextEdit won't expand as much as it should
I am trying to create a UI that resembles OpenAI's, where code and markdown snippets follow each other and markdown and the code are parsed/syntax highlighted accordingly. I've been using PyQt6 and my ...
1
vote
1
answer
163
views
How do I change the color of the white select all cell on the top right corner? - PyQt5 QTableWidget [duplicate]
The white block on top right corner gets auto added whenever I insert a row.
It selects all rows and columns when I click on it just like in excel
I can see it makes space for S.nos; I've decided it'...
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 ...
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 ...
0
votes
0
answers
65
views
QLabel css "text-align: center" is ignored [duplicate]
Contrary to the spec, CSS setting text-align: center is ignored by QLabel (other settings like font-size and color are respected):
from PyQt6.QtWidgets import QApplication, QLabel
app = QApplication([...
0
votes
1
answer
66
views
gradient background in pyqtgraph w/ pyqt6
Is it possible to give a gradient background to a plot in pyqtgraph & pyqt6?
Minimal code to start with:
import pyqtgraph as pg
from PyQt6.QtWidgets import QApplication
# Create application
app = ...
0
votes
0
answers
38
views
How to enable back windows animations if I disabled the default windows frame with the respective flag?
I disabled the window frame and made my own window frame, but it also removed all window animations when maximizing/minimizing or closing etc. How to enable them back without enabling the default ...
-1
votes
1
answer
73
views
QGraphicsScene.items() only returning items whose pos() exactly matches a test point, not items which contain the test point [closed]
A QGraphicsScene contains a number of MyItem items.
A MyItem is a QGraphicsItemGroup which contains, among other child items, a QGraphicsEllipseItem centred at the local origin.
A number of MyItem ...
1
vote
1
answer
68
views
ctrl-C to terminate a pyqt application with a QOpenGLWidget
My main file for a pyqt application looks like this:
#!/usr/bin/env python3
from PyQt5.QtWidgets import QApplication
import signal
import sys
from main_window import MainWindow
if __name__ == "...
0
votes
0
answers
86
views
I made an effect that can dissolve widgets with QMovie, but I can't find a way to only dissolve a single widget without affecting widgets behind it
How the dissolve looks like if you want to dissolve the entire window:
And if I apply it to a single widget like this:
self.test_label = QLabel()
self.test_label.setFixedSize(300, 300)...
1
vote
1
answer
175
views
Is there any way to obtain a listing of enum names and values in a typedef for QFlags? [duplicate]
As such I (questioner) am no longer looking for an answer but I am not sure on what grounds to recommend closing. It could possibly be helpful to someone.
Here's an example of what I mean (based on ...
0
votes
2
answers
83
views
Should I include build and dist folders in github, or just spec file? [closed]
I am using PyQt and Install Forge for an internal tool I am building for my current job, I cannot find any internal guides on whether I should be including my dist and build folders as generated by ...
1
vote
1
answer
178
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 ...
1
vote
1
answer
89
views
Run function when leaving QTabWidget tab
I have multiple tabs that a user can switch between. I need a widget on a given tab to run an exit function when that tab is no longer selected. For example, if the user currently has tab_1 selected, ...
1
vote
0
answers
189
views
Matplotlib on Arch Linux (KDE) shows QFont::fromString: Invalid description warnings, but fonts render correctly
I'm using Matplotlib on Arch Linux with KDE Plasma 6.3.5 (Wayland). My system's default Qt font is set to "WenQuanYi Micro Hei" (文泉驿微米黑), and it displays correctly in all system applications....
1
vote
0
answers
142
views
WebRTC Connection Failure between Next.js and QtPython Applications
I am developing two applications, a Next.js and a QtPython application. The goal is that the Next.js application will generate a WebRTC offer, post it to a Firebase document, and begin polling for an ...
1
vote
0
answers
112
views
limiting value for int in pyqtSignal?
NOT A DUPLICATE AS THIS INVOLVES A COMPLETELY SILENT ERROR
I have a signal which looks like this:
add_history_row_signal = QtCore.pyqtSignal(int, int)
The first int is a key for a dict, to retrieve a ...
0
votes
0
answers
51
views
Making a TableView item function like QComboBox instead of a QLineEdit in PyQT
I wrote a class that makes a window, part of this class is a function dynamic_table_view that creates a TableView widget with a possibility to view data and edit it right in that same window:
def ...
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, ...
0
votes
1
answer
168
views
PyQt6 6.9.0 QPainter errors/warnings in command prompt but not in PyCharm
When I create a simple application with the below code, I get the additional errors/messages (all starting with QPainter) in the command line output in some scenarios (detailed in table below).
It ...
2
votes
1
answer
110
views
Setting a persistent clipboard with multiple targets on X11
General overview
I am trying to set an image in clipboard into different linux’s targets. As example, depending of the context, the same image could be paste in png, jpg, or whatever else.
The problem
...
0
votes
0
answers
47
views
Permutate two rows inside QTableWidget [duplicate]
I have a simple QTableWidget with a unique relevant column (the other one still empty for the moment). And I try to permute two rows.
I’ve made this method to my table:
def permuteRows(self, row1=...
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 ...
2
votes
1
answer
119
views
Problem nesting QT layouts when using if <QT layout> statement
For my application I created a Window class, I minimized my code as much as possible so that there would be nothing unrelated.
The code is below:
import sys
from PyQt6.QtWidgets import (QApplication, ...
-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
1
answer
88
views
Can tree-sitter be used on a QsciLexerCustom in PyQt?
I want to implement a custom lexer (syntax highlighting) for my QScintilla based IDE in PyQt. I tried to use tree sitter's python bindings to parse the editor's text, then use a bunch of if/else ...
0
votes
2
answers
136
views
How can I change the white color in QComboBox?
I would like to change the color or adjust the size of this rectangle behind the open Combobox
I noticed that there is a problem with the increased size of this white background and the offset options ...
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
87
views
keyPressEvent on a vispy scene embedded in pyqt
I have a vispy scene embedded in a pyqt frame on a pyqt app to display some plots. Now, i need a keypressevent on the whole app for some unrelated thing (a home-made implementation of vim command mode)...
0
votes
1
answer
50
views
How to return combobox item to main window when item is selected
New to Qt. I'm trying to create a general purpose ComboBox that can be used in multiple situations. This code works when the Save button is pressed. However I would like to dispense with the save ...
0
votes
0
answers
58
views
About animating the scale of a QDialog
I'm looking for ways to animate the scale of a QDialog to create a smooth animated popup.
Qt widgets don't have a scale property that you can animate, so I tried using a QGraphicsView() and wrapped a ...