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. QML textedit/textarea style a text (bold, italic) without highlighting
Forum Updated to NodeBB v4.3 + New Features

QML textedit/textarea style a text (bold, italic) without highlighting

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 418 Views 1 Watching
  • 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.
  • C Offline
    C Offline
    cebuger
    wrote on last edited by
    #1

    our application needs to detect some words while user types in a textarea, and when it is detected it is converted to bold and/or italic. I can see in QML text editor example, it can be done using document Handler but it works when it is highlighted.

    I assume I will use the richtext format for text area, but I cant simply manipulate the HTML from textArea.txt because it includes headers and what not,

    How do I effectively do this?
    somewhat like the steps,
    detectwordsTyped()
    detectPositionOfWords()
    bold the words by <b> words </b>

    any idea how to do this?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Use QSyntaxHighlighter (you need to expose it to QML through a custom subclass). It will handle the highlighting part automatically, you just need to set up the rules.

      (Z(:^

      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