Search text in QPlainTextEdit
-
hello,
I'm developing a text editor with Python and Qt.
now i want to search for text in a QPlainTextEdit ('').
How do you program something like that? -
i found this:
https://doc.qt.io/archives/4.6/uitools-textfinder.htmlbut I can't rewrite it in Python. Can someone help please?
-
i found this:
https://doc.qt.io/archives/4.6/uitools-textfinder.htmlbut I can't rewrite it in Python. Can someone help please?
@PythonQTMarlem
If you want to copy that, you simply have to go through it line-by-line and translate the C++ into Python. Personally I don't think that's difficult, but your mileage may vary.now i want to search for text in a QPlainTextEdit ('').
This is just https://doc.qt.io/qt-5/qplaintextedit.html#find. That will exist in PySide2/PyQt5.
-
hi,
i try. but now i don't know how to convert this in python:
QTextCursor highlightCursor(document); QTextCursor cursor(document);
I would appreciate a suggestion.
-
solution:
highlightCursor = QTextCursor(self.document) cursor = QTextCursor(document)