All Questions
1,389
questions
0
votes
1
answer
46
views
Cleaner methods for creating multi-variable animations in PyQt5 (css)?
I recently came across an example code for animating a widget using QVariantAnimation, the QVariantAnimation has a start and end point, and the calculated value is injected into the css of the button ...
-1
votes
0
answers
48
views
Sort all items of a PyQt5 QMenu
I am using Python 3.11 and Designer from PyQt5 (QT 5.11.1) for design a graphic file. I create the menu once in QDesigner and converted the ui-file "main_form.ui" to an py-file "...
1
vote
1
answer
55
views
Creating a nuance-styled button with css in pyqt5
I came across a button style which I like, I wanted to recreate it for use in pyqt5, using the QPushButton class, and styling it with css. If I can recreate it, I can change it's colours in cool ways.
...
-1
votes
1
answer
51
views
How to margin text in Textedit with Stylesheet on Qt
I have a project that uses PyQt5 to create a GUI. I used StyleSheet to change the widget appearance. Everything is fine but there is only 1 thing
It's not okay. It's about left and center margin of ...
0
votes
0
answers
48
views
How do I know what a pyqtSignal will pass to a pyqtSlot?
I am going through the Qt doc page on Mode-View architecture and while trying to reproduce the usage of model indexes in PyQt5 I got to a working script that I don't fully understand. Here's the code:
...
3
votes
1
answer
57
views
MiterJoin is ignored for single-pixel width pen
Problem
When drawing a rectangle with a line width of 1px on a QPainter with antialiasing enabled results in slightly transparent corners regardless of what JoinStyle is set. The same can be observed ...
1
vote
2
answers
33
views
How can I set the focus to an invisible button or the window itself in a QDialog (PyQt5)?
I want to have a QDialog that blocks the interaction with the MainWindow, but where initially no widget has a focus, i. e. no button has a blue border and gets pushed when hitting "Enter".
I ...
0
votes
0
answers
32
views
Pyuic5 generating file with syntax errors
Using Qt designer in order to create .ui file and then using pyuic5 to translate it to .py format yields file riddled with syntax errors because of "::" syntax.
Command used:
pyuic5 -x ...
0
votes
0
answers
57
views
PySide6 Menu Bar Actions Not Showing on macOS Sonoma 14.4.1 [duplicate]
I'm following a tutorial to create a PySide6 application with a menu bar, but I'm running into an issue on macOS Sonoma 14.4.1. The person doing the tutorial is using Windows OS, and everything works ...
0
votes
0
answers
120
views
How to print pdf file using QPrinter?
I can't print my pdf file using QPrinter, I figured it needs to be set to html to print it and now I'm getting this error on terminal:
QPrintDialog: Cannot be used on non-native printers.
And does ...
1
vote
1
answer
46
views
PyQt5 How to add a pyuic5 generated Python class into QStackedWidget?
I've this in my app.py:
from PyQt5 import QtWidgets
from screens import Ui_home, Ui_login_page
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
QtWidgets.QMainWindow.__init__(...
0
votes
1
answer
29
views
Can't have Designer to resize Qwidget inside QGridLayout in pyqt5? [duplicate]
I can run this code:
import sys
from PyQt5.QtWidgets import QApplication, QScrollArea, QWidget, QGridLayout, QVBoxLayout, QLabel
from PyQt5 import QtGui, QtCore
from PyQt5.QtGui import QDrag
class ...
0
votes
1
answer
50
views
How to properly smooth a QPainterPath?
I am working on a Path drawing tool and made a previous post about how I could achieve smoother drawing. I have done some tinkering with cubicTo() and quadTo() but these have really not been much help....
0
votes
0
answers
43
views
PyQt5 QTableView header with two lines of text, each with different font?
The minimal example code below renders the following GUI:
What I would like to achieve, instead, is this (manually edited image):
... which is to say, I would like the column (horizontal) headings ...
0
votes
0
answers
31
views
Is there a tree structure for QT widgets which allows us to access them by relative relationship?
I am developing an application using PyQt, please see attached image.
Besides the input field in the first row, I will generate more than 100 rows dynamically, each one having a large button (A1,A2,A3 ...