0

meetis is my src,

class CodeEditor(QPlainTextEdit, QLineEdit):
def __init__(self, parent=None):
    QPlainTextEdit.__init__(self, parent)
    QLineEdit.__init__(self, parent)
    self.lineNumberArea = LineNumberArea(self)
    self.blockCountChanged.connect(self.updateLineNumberAreaWidth)
    self.updateRequest.connect(self.updateLineNumberArea)
    self.cursorPositionChanged.connect(self.highlightCurrentLine)
    self.returnPressed.connect(self.IndentCall)
    self.updateLineNumberAreaWidth(0)


@pyqtSlot(str, QPlainTextEdit)
def IndentCall(self):
    if self.ui.textEdit.toPlainText().endswith(':\n'):
        self.ui.textEdit.insertPlainText('    ')

Error that i get is,

File "D:\Python-Projects\CodeEditor\codeeditor.py", line 26, in __init__
self.returnPressed.connect(self.IndentCall)
TypeError: decorated slot has no signature compatible with returnPressed()

I don't want to create a event handler, all i want is to simply inherit a function into another Widget. Fellow programmer please help me with this error, if possible provide and example.

!! Thanks In Advance !!

Nikhil.Nixel
  • 555
  • 2
  • 11
  • 25

0 Answers0