Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Syntax highlighting using JS

Syntax highlighting using JS

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 255 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.
  • T Offline
    T Offline
    tzorake
    wrote on 22 Jun 2023, 12:48 last edited by
    #1

    Hello. I need to implement syntax highlighting using Qt and JS. I did it on my own, it works, but when a large amount of information comes into the lexer (10k lines of text), the lexer works slower (about 10 seconds on my machine) and the application crashes after I try to enter something new in the input field.
    Could someone tell me how it would be better to do this and the possible mistakes that I made, which leads to the crash of the program. I posted the project code on Github. It can be found at link.
    I know that there are many projects that would allow me not to write anything in JS, but unfortunately I could not find anything that would not require a lot of effort during installation (syntax highlighting from KDE and QScintilla were considered).

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SimonSchroeder
      wrote on 23 Jun 2023, 07:24 last edited by
      #2

      Qt Creator takes a long time for highlighting 10k lines as well. The only trick they seem to use is that it is done in a separate thread, so that the GUI initially does not freeze. Also, they must keep track of changes such that they don't have to recompute the entire highlight after every keypress. But highlighting (at least of C++) is not very fast inside Qt Creator.

      1 Reply Last reply
      0

      1/2

      22 Jun 2023, 12:48

      • Login

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