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. selection bgcolor in editor
Forum Updated to NodeBB v4.3 + New Features

selection bgcolor in editor

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.1k Views 2 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.
  • U Offline
    U Offline
    user4592357
    wrote on last edited by
    #1

    i have an editor (a qsciscintilla subclass) and it has lexer set on it.

    i want to set background color to the selection text in editor. i've tried:

    m_editor->lexer()->setPaper(color);
    

    but this sets the whole editor background to color. but what i need is to set background only to the selection. i didn't have an api to do this. please help

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

      Hi,

      QScintilla is not part of Qt, you should query the authors directly.

      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
      • H Offline
        H Offline
        huse
        wrote on last edited by
        #3

        m_editor->setSelectionBackgroundColor (const QColor &col) ?

        1 Reply Last reply
        1
        • U Offline
          U Offline
          user4592357
          wrote on last edited by
          #4

          that just colors the selection at the moment, i need something like text highlighting

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

            So you want to customise the syntax highlighting itself ? So QsciLexer::setColor looks like what you want.

            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
            • U Offline
              U Offline
              user4592357
              wrote on last edited by
              #6

              not the text color, but the background of the text

              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