Answer the question
In order to leave comments, you need to log in
PyQt5 AttributeError: 'BindChanger' object has no attribute 'RadarKey'?
I created a design in Designer, converted it to a .py file, but there were problems creating an executable file. When I access KeySequenceEdit I get an error AttributeError: 'BindChanger' object has no attribute 'RadarKey' . I copied the name of the object from the designer and in the ui file itself there is a line self.RadarKey = QtWidgets.QKeySequenceEdit(self.centralwidget) .
The code:
from PyQt5.QtWidgets import QMainWindow, QApplication
import design
import sys, os
class BindChanger(QMainWindow, design.Ui_BindChanger):
def __init__(self):
super().__init__()
self.ui = design.Ui_BindChanger()
self.ui.setupUi(self)
self.RadarKey.keySequenceChanged.connect(RadarButton)
app = QApplication(sys.argv)
window = BindChanger()
window.show()
app.exec()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question