Questions tagged [pyqt5]

Qt 5 bindings for Python programming. This allows programmer to make Qt 5 graphical user interfaces using Python syntax.

Qt 5 bindings for Python programming language. This allows programmer to make Qt 5 graphical user interfaces using Python syntax.

14659 questions
19
votes
3 answers

Why in pyqt5 should I use pyuic5 and not uic.loadUi("my.ui")?

I've been experimenting with QT5 for Python, using pyqt5. I've noticed that most tutorials recommend using pyuic5 to convert the XML UI to Python code. I've also seen a couple of tutorials where instead they use uic.loadUi("myui.ui") to dynamical…
Frank
  • 459
  • 1
  • 5
  • 13
19
votes
2 answers

PyQt: No error msg (traceback) on exit

My PyQt application no longer prints the error (stderr?) to the console. I use QtDesigner and import the UI like this: from PyQt5 import QtCore, QtGui, QtWidgets import sys from PyQt5.uic import loadUiType Ui_MainWindow, QMainWindow =…
Jannis
  • 401
  • 1
  • 4
  • 9
19
votes
2 answers

How to apply style sheet to a custom widget in PyQt

# -*- coding: utf-8 -*- import sys from PyQt4.QtGui import * from PyQt4.QtCore import * class MainWindow(QWidget): def __init__(self): super(MainWindow, self).__init__() self.setFixedWidth(200) …
Anke_Pet
  • 354
  • 1
  • 3
  • 10
19
votes
2 answers

PyCharm 3.0 fails to find PyQt5

I've got Python 3.3.2 installed (both x86 and x64 versions) and PyQt5.1 installed on top of them. Recently I installed PyCharm 3.0 Community Edition and configured to work with these Python interpreters. The problem is that PyQt5 is not shown in the…
sukhmel
  • 1,402
  • 16
  • 29
18
votes
8 answers

Cannot install pyqt5-tools - 'Could not find a version that satisfies the requirement pyqt5-tools'

I try to install pyqt5-tools like this: pip install pyqt5-tools and the resulting out put is: ERROR: Could not find a version that satisfies the requirement pyqt5-tools (from versions: none) ERROR: No matching distribution found for pyqt5-tools I…
JSogaard
  • 393
  • 1
  • 4
  • 7
18
votes
1 answer

AttributeError: 'Ui_MainWindow' object has no attribute 'setCentralWidget'

I am still working on the GUI for my Database and now i have a different error: Traceback (most recent call last): File "G:\Python\Database Kast Thuis\PyQt Test\MainMenu_ui.py", line 84, in ex = Ui_MainWindow() File…
That One
  • 581
  • 2
  • 6
  • 17
18
votes
2 answers

Argument 1 has unexpected type 'NoneType'?

I have a problem with my PyQt button action. I would like to send a String with the Function but I got this Error: TypeError: argument 1 has unexpected type 'NoneType' import sys from PyQt5.QtWidgets import QApplication, QPushButton, QAction from…
Darkdrummer
  • 301
  • 1
  • 2
  • 8
18
votes
1 answer

qApp versus QApplication.instance()

With PyQt5, both of these return the application object: app = QtWidgets.QApplication.instance() app = QtWidgets.qApp for i in app.arguments()[1:]: ... But why does print(QtWidgets.QApplication.instance() is QtWidgets.qApp) print False?
Sir Visto
  • 683
  • 1
  • 4
  • 9
17
votes
1 answer

function of pyqtSlot

I just read a tutorial about pyqt5 button from here. And the code is as below. There is a question about button.clicked.connect(self.on_click) and @pyqtSlot(). If I delete @pyqtSlot() from the code, it still works. However, the button does not work…
Kester
  • 283
  • 2
  • 5
  • 10
17
votes
1 answer

PyQt combo box change value of a label

I'm using PyQt5 to make a UI to a project. I want to change the value of a label when the user changes the value of a combo box. Can anyone help me to find out wich method to use to 'trigger' the function that changes the value of the label ?
Mario Campos
  • 323
  • 1
  • 2
  • 8
16
votes
4 answers

Can't install PyQt5 using pip

I have tried to install PyQt5 using pip install PyQt5 and sudo -H pip install PyQt5 both of them give me the errors ERROR: Could not find a version that satisfies the requirement PyQt5 (from versions: none) ERROR: No matching distribution found…
rsaavedra
  • 378
  • 1
  • 4
  • 12
16
votes
6 answers

No module named PyQt5.sip

After upgrading to python-pyqt5 5.12-2 I get this error when I try to import from QtWidgets from PyQt5.QtWidgets import * Error: Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named…
Holderekt
  • 161
  • 1
  • 1
  • 5
16
votes
2 answers

PyQt5 and OpenCV have similar libraries; how to avoid conflict between the 2?

I have PyQt5 and OpenCV in the same conda virtual environment. opencv-python==3.4.1.15 PyQt5==5.10.1 Whenever I run my PyQt5 app, I get many warnings like these: objc[7992]: Class QCocoaPageLayoutDelegate is implemented in both…
Alex Ryan
  • 3,719
  • 5
  • 25
  • 41
16
votes
3 answers

What does "Process finished with exit code 1" mean?

I tried to develop a simple currency program but I have a problem. When I click on Çevir, the program should calculate money (like an exchange). But I can't do it. PyCharm writes Process finished with exit code 1 when I click Çevir from PyQt5 import…
buraks
  • 163
  • 1
  • 1
  • 7
16
votes
1 answer

AttributeError: module 'PyQt5.QtGui' has no attribute 'QWidget'

So, I'm trying to make a UI for a python code I have, but keep stumbling up on problems... Right now, all the code does is make a window, with 2 texteditor boxes, and one button. When the button is pressed, it prints 'Test'. I used QTDesigner to…
CandyGum
  • 461
  • 3
  • 7
  • 19