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. Format Text in TextArea and Code Completion
Forum Updated to NodeBB v4.3 + New Features

Format Text in TextArea and Code Completion

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 223 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.
  • L Offline
    L Offline
    Leon_2001
    wrote on last edited by
    #1

    Hello,

    In my application, I use the TextArea Component from QtQuick Controls 2.x. I already found out how to highlight Code written in the TextArea, so for example keywords are written in purple automatically.

    But I wonder how I could implement Code completion.

    So let's say I write { or (, then there should be added } or ) automatically.

    And If I type in { and } is added automatically and I press enter, it should be like this:
    type in "{"

    ... {
    

    automatically

    ... {}
    

    press enter

    ... {
     |
    }
    

    where "|" is the new cursor position.

    Should I do this in my extended QSyntaxHighlighter class? Or how can I achieve this behaviour?

    Thanks!

    Best regards Leon

    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