Unexpected type 'QKeySequence'
Unsolved
General and Desktop
-
class EditName(Ui_MainWindow): def __init__(self, window): self.setupUi(window) QShortcut( QKeySequence('Ctrl+1'), self).activated.connect(lambda: self.ComboEditType.setCurrentIndex(0))
When I run this code it produces following error. I did search but didn't find any solution to this error.
TypeError: arguments did not match any overloaded call: QShortcut(QWidget): argument 1 has unexpected type 'QKeySequence' QShortcut(Union[QKeySequence, QKeySequence.StandardKey, str, int], QWidget, member: PYQT_SLOT = 0, ambiguousMember: PYQT_SLOT = 0, context: Qt.ShortcutContext = Qt.WindowShortcut): argument 2 has unexpected type 'EditName'
I think self (i.e EditName class) inside QSequence is causing the problem. Any suggestion on how to solve this?
-
Hi and welcome to devnet,
self is not a widget, the window parameter is.
-
As an additional note, this is a generated class, you shall not modify it.