我正在qscintilla窗口中搜索字符串
import sys
from PyQt5 import Qsci
from PyQt5.QtWidgets import *
app = QApplication(sys.argv)
window = Qsci.QsciScintilla()
window.show()
text = "Hello world"
window.setText(text)
scintilla = window.SendScintilla
scintilla(window.SCI_TARGETWHOLEDOCUMENT)
pos = scintilla(window.SCI_SEARCHINTARGET,len("world"),"world")
print(pos)
app.exec_()
我正在尝试使用Sendscintilla在文本字符串中搜索“世界” 当我运行此代码时,它显示此错误
pos = scintilla(window.SCI_SEARCHINTARGET,len("world"),"world")
TypeError: arguments did not match any overloaded call:
SendScintilla(self, int, wParam: int = 0, lParam: int = 0): argument 3 has unexpected type 'str'
SendScintilla(self, int, int, sip.voidptr): argument 3 has unexpected type 'str'
SendScintilla(self, int, int, bytes): argument 3 has unexpected type 'str'
SendScintilla(self, int, bytes): argument 2 has unexpected type 'int'
SendScintilla(self, int, bytes, bytes): argument 2 has unexpected type 'int'
SendScintilla(self, int, int): too many arguments
SendScintilla(self, int, int, int, bytes): argument 3 has unexpected type 'str'
SendScintilla(self, int, int, Union[QColor, Qt.GlobalColor]): argument 3 has unexpected type 'str'
SendScintilla(self, int, Union[QColor, Qt.GlobalColor]): argument 2 has unexpected type 'int'
SendScintilla(self, int, int, QPainter, QRect, int, int): argument 3 has unexpected type 'str'
SendScintilla(self, int, int, QPixmap): argument 3 has unexpected type 'str'
SendScintilla(self, int, int, QImage): argument 3 has unexpected type 'str'