Results 1 to 1 of 1

Thread: highlight an entire line in QLineEdit

  1. #1
    Join Date
    Jul 2012
    Posts
    244
    Thanks
    27
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: highlight an entire line in QLineEdit

    Is there any good way to highlight several, non consecutive lines in a QLineEdit so that they do not depend on the textcursor?

    For example, if i have a textlineedit i want to highlight the background of line 1,4 and 8, and this should not be affected by the user moving the cursor around.

    if this is not possible conventionally, where do you suggest i hook in to do it manually with a QPainter?


    Added after 21 minutes:


    i find solution with: setProperty(QTextFormat::FullWidthSelection, true) !
    Last edited by tuli; 26th July 2014 at 20:58.

Similar Threads

  1. Highlight All line in QTextBrowser
    By rz in forum Qt Programming
    Replies: 0
    Last Post: 29th June 2014, 16:38
  2. Highlight current line in textedit
    By aaditya190 in forum Newbie
    Replies: 2
    Last Post: 22nd November 2013, 16:30
  3. Highlight the full line (LineUnderCursor)
    By kuku83 in forum Qt Programming
    Replies: 1
    Last Post: 5th October 2012, 00:18
  4. QPlainTextEdit highlight selected line
    By ArkKup in forum Qt Programming
    Replies: 0
    Last Post: 2nd November 2011, 09:45
  5. Replies: 3
    Last Post: 29th November 2010, 19:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.