Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Add link to some format text



  • https://github.com/sonichy/HTYEdit
    I am programming a QTextEdit to write c++, and use QTextBrowser for c++ debug output.
    Regular expressions is too difficult to me:
    Change
    boxkey.cpp:27:24: error: ‘stbi_load’ was not declared in this scope
    To
    <a href='boxkey.cpp:27:24: error:'>boxkey.cpp:27:24: error:</a> ‘stbi_load’ was not declared in this scope

    This has been done: then use QTextBrowser::anchorClicked to set QTextEdit::QTextCursor to the error line.


  • Lifetime Qt Champion

    Hi,

    You don't necessarily need regular expressions. Since you know the structure of the line you can split on the colon and rebuild your new string using the string list resulting from the split.


Log in to reply