How to get QSyntaxhighlighter's format outside?



  • I use QSyntaxHighlighter's subclass to highlight text, but when i use
    QTextFormat format = cursorForPosition(event->pos()).charFormat()
    in QPlainTextEdit::mousePressEvent, the format always is default.
    So I search for a way to get the format which apply in highlighter.(QSyntaxHighlighter::formatis protected...)
    help!!!


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Out of curiosity, why do you need that information like that ?



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.