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. QEditText find ?

QEditText find ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 155 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    Implementing "find" puts cursor to the text found and highlights it .
    My task is to change the text color...
    Changing either background or foreground color produces unwanted color because it "conflicts" with the
    standard blue highlight color.

    I tried this , but it did not do what I need

     QTextCursor newCursor = ui->textEdit_111->textCursor();
                        //newCursor.movePosition(QTextCurso MainCodeBlockr::Right);
                        ui->textEdit_111->setTextCursor(newCursor);
                        ui->textEdit_111->setCursorWidth(10);
                        ui->textEdit_111->setTextBackgroundColor(Qt::red);
    

    Can anybody give me a hint what I need to implement in code?
    ( I do not need the code itself...)

    I am not sure how to code so only a specific text color is changed , not the entire widget .
    But there are examples how to do that - what I am missing is how to "override" the result of "find"
    highlighting the text found.

    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