Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. KsyntaxHighlighting::Definition and rules for tokens
Forum Update on Monday, May 27th 2025

KsyntaxHighlighting::Definition and rules for tokens

Scheduled Pinned Locked Moved Unsolved General and Desktop
kde
2 Posts 2 Posters 294 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndrzejB
    wrote on last edited by AndrzejB
    #1

    I am writing component for viewing huge files > 4 GiB, which are not loaded to memory.
    (https://github.com/siplasplas/qt-textviewer)

    I want add syntax highlighting but can’t use QTextDocument and KsyntaxHighlighting::SyntaxHighlighter due to my component from ground.
    I wanna use KsyntaxHighlighting::Repository, KsyntaxHighlighting::Definition and KSyntaxHighlighting::Format.
    Definition has methods/fields such as foldingEnabled or multiLineCommentMarker. Format has method returning at oncve text styles for thema, and I can’t find methods for rules, for example rule to detect int decimal or octal or string.
    This is question about KDE, where can I ask if not here ?

    ================

    I have cloned https://invent.kde.org/frameworks/syntax-highlighting,
    and in SyntaxHighlighter::highlightBlock is

    const auto nextBlock = currentBlock().next();
        if (nextBlock.isValid()) {
            QMetaObject::invokeMethod(this, "rehighlightBlock", Qt::QueuedConnection, Q_ARG(QTextBlock, nextBlock));
        } 
    

    but I don't find "rehighlightBlock" in any other place in whole repository.
    I found many other repositories :
    https://invent.kde.org/akselmo/syntax-highlighting
    https://invent.kde.org/ribhavkaul/syntax-highlighting
    ........
    and many, many other.
    I don't know which is used in KF5/KF6. Is possible choose code between akselmo,ribhavkaul and others?


    I see, 80 repositories are cloned from frameworks/syntax-highlighting,

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      rehighlightBlock belongs to QSyntaxHighlighter.

      Use the original repos, the clones are usually for people to do development before creating a merge request.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved