Qt6 bindings for Python programming language. This allows programmers to make Qt6 graphical user interfaces using Python syntax.
Questions tagged [pyqt6]
739 questions
19
votes
2 answers
mach-o file, but is an incompatible architecture have 'x86_64', need 'arm64e' M1 MAC
from PyQt6.QtWidgets import *
from model.Department import Department
from view.main_window import Ui_Form
from model.Department import Department, Employee
class Homewidget(QWidget,Ui_Form):
def __init__(self):
…

MrAhmed Alhamed
- 223
- 2
- 3
- 9
7
votes
1 answer
Draw transparent image over the screen with Qt
I'm trying to draw an image with a transparent background over the entire screen.
I've done similar with Xlib, but I thought I'd try Qt so my program might work in different environments besides X11.
Before getting committed, I've honestly just…

GGG
- 295
- 1
- 9
7
votes
2 answers
Module 'PyQt6.QtWidgets' has no attribute 'QDesktopWidget'
I try to run this code, but it always get this AttributeError, I have searched for many website but there wasn't any answer.
QtWidgets.QDesktopWidget().availableGeometry().center()
AttributeError: module 'PyQt6.QtWidgets' has no attribute…

Mink Alex Vina
- 71
- 1
- 2
7
votes
2 answers
Where is the QtDesigner in PyQt6?
I find bindings/QtDesigner directory, but there are all .sip file.
In the package website on pypi, it says
The sip-install tool will also install the bindings from the sdist package but will allow you to configure many aspects of the…

ZhiyuanLck
- 191
- 1
- 1
- 5
7
votes
2 answers
How to check MouseButtonPress event in PyQt6?
In PyQt5, we can validate an event occurrence using QEvent class, for example QEvent.MouseButtonPress. In PyQt6 the statement is no longer valid. I have checked the members of both PyQt6.QtCore.QEvent and PyQt6.QtGui.QMouseEvent classes, I don't…

Jie Jenn
- 445
- 5
- 15
6
votes
6 answers
Alternative to "QMessageBox.Yes" for PyQt6
I am trying to port over a script of mine from PyQt5 to PyQt6. I have figured out how to port most of the things thanks to this answer, however, I have run into an issue.
I have figured out that PyQt6 uses QtWidgets.QMessageBox.StandardButtons.Yes…

DespawnedDiamond
- 67
- 2
- 10
6
votes
2 answers
Qt module alternative for PyQt6
I'm just migrating my application from PyQt5 to PyQt6. I understand that the Qt module has been removed in Qt6. I have stuff like 'Qt.AlignCenter', 'Qt.ToolButtonTextUnderIcon', 'Qt.LeftToolBarArea', which are no longer working. Is there any…

Vlad
- 223
- 2
- 10
5
votes
3 answers
How to fix PyQt6-tools installation error?
I want to create my small GUI app with PyQt6. I've installed PyQt6, but I also have to install PyQt6-tools. So, when I tried to get it, I got this error:
C:\Users\egorl>pip install pyqt6-tools
Collecting pyqt6-tools
Using cached…

Egor Light
- 55
- 1
- 1
- 3
5
votes
1 answer
PyQt6: AttributeError Qt
I need to translate the following code from PyQt5 (It works there) to PyQt6:
self.setWindowFlags(Qt.FramelessWindowHint)
This is the error:
AttributeError: type object 'Qt' has no attribute 'FramelessWindowHint'
I've already tried…

Giorgio
- 61
- 1
- 4
5
votes
2 answers
Create a Transparent Blur Window
I am using Python 3.9.1 and PyQt6. Now I want to create a window with blurred background, which should look something like below:
Blurred Window Background Demo
It would be helpful if anybody provide me a code for this.

Mahir Hami Abrar
- 73
- 5
4
votes
1 answer
PySide6 app crashes when using QPainter.drawLine()
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…

u2gilles
- 6,888
- 7
- 51
- 75
4
votes
4 answers
pip install PyQt6 producing "No matching distribution..." error
I've been trying to install PyQt6 on my Ubuntu machine, running Python 3.8.10.
Following the instructions on the site, I have tried the following:
I have also tried with pip3 and I have tried installing in PyCharm:
Any suggestions on how i can…

Anson Savage
- 283
- 3
- 5
- 12
4
votes
8 answers
How can resources be provided in PyQt6 (which has no pyrcc)?
The documentation for PyQt6 states that
Support for Qt’s resource system has been removed (i.e. there is no pyrcc6).
In light of this, how should one provide resources for a PyQt6 application?

biqqles
- 303
- 3
- 10
3
votes
1 answer
Creating simple video player using PyQt6
I was trying to create a simple video player using PyQt6. I found this example on the internet:
import sys
from PyQt6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QPushButton, QSlider
from PyQt6.QtMultimedia import QMediaPlayer,…

arachnoden
- 37
- 7
3
votes
0 answers
How to add .ttf fonts in PyQt6 using relative path?
I am building an app and need to add a custom font of my desire in it, I have tried multiple ways to get that font loaded with a relative path but have failed with the error:
qt.qpa.fonts: Populating font family aliases took 192 ms. Replace uses of…

Ray
- 31
- 3