Results 1 to 7 of 7

Thread: CharFormat how set backgroud color ??

  1. #1
    Join Date
    Apr 2012
    Posts
    40
    Platforms
    Unix/X11 Windows

    Default CharFormat how set backgroud color ??

    hi i use QTextEdit and i want change background color on single char, i know char color can change with change
    Qt Code:
    1. QTextChaFormat::setTextOutline(QPen(QColor::Color))
    To copy to clipboard, switch view to plain text mode 
    Underline color can change
    Qt Code:
    1. QTextChaFormat::setUnderlineColor,
    To copy to clipboard, switch view to plain text mode 
    but i can't finde background color.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: CharFormat how set backgroud color ??

    How many times do we have to point you to the same solution?

    QTextCharFormat has a super class, look there.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2012
    Posts
    40
    Platforms
    Unix/X11 Windows

    Default Re: CharFormat how set backgroud color ??

    i dont see your solution , i write before "I CANT FINDE BACKGROUND COLOR" method in QTextCharFormat.
    ok i have , QTextCharForm inherits setBackground(); srry
    Last edited by Pablik; 20th July 2012 at 11:30.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: CharFormat how set backgroud color ??

    Look into the super class of that class. You do understand that term (super class), right?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Apr 2012
    Posts
    40
    Platforms
    Unix/X11 Windows

    Default Re: CharFormat how set backgroud color ??

    no, what is super class, upper class (class from who inherits)

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: CharFormat how set backgroud color ??

    http://en.wikipedia.org/wiki/Superclass

    Now please look what is the superclass of QTextCharFormat and see what methods it offers.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. The following user says thank you to wysota for this useful post:

    Vidhya (25th July 2012)

  8. #7
    Join Date
    Jul 2012
    Location
    Chennai , India
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: CharFormat how set backgroud color ??

    QTextCharFormat line3;
    line3.setFontFamily("Times New Roman");
    line3.setFontPointSize(12);
    line3.setBackground(QBrush(QColor(0,0,0)));
    line3.setForeground(QBrush(QColor(255,0,0)));


    you can try this


    Thank U

Similar Threads

  1. Replies: 3
    Last Post: 3rd February 2014, 18:04
  2. How to get CharFormat from each char
    By Pablik in forum Qt Programming
    Replies: 2
    Last Post: 16th July 2012, 23:07
  3. Replies: 3
    Last Post: 22nd January 2010, 17:46
  4. Replies: 1
    Last Post: 2nd February 2009, 11:04
  5. how to set backgroud in QTableView's title
    By catherine_98 in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2007, 11:13

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.