Results 1 to 5 of 5

Thread: QTextEdit & background colors

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2007
    Posts
    68
    Thanks
    9
    Thanked 8 Times in 8 Posts

    Default Re: QTextEdit & background colors

    how about looking into the qt documentation, or searching the forums first ???

    you would have found a solution within minutes...

    setting color:
    Qt Code:
    1. m_textEdit->setTextColor(Qt::red);
    To copy to clipboard, switch view to plain text mode 

    setting background
    Qt Code:
    1. QPalette palette;
    2. palette.setColor(QPalette::Base, QColor(0, 0, 255, 255));
    3. m_textEdit->setPalette(palette);
    To copy to clipboard, switch view to plain text mode 

    monospaced text
    Qt Code:
    1. m_textInput->setFont(QFont("Courier", 10));
    To copy to clipboard, switch view to plain text mode 

    regards

  2. The following user says thank you to darksaga for this useful post:

    marziac (23rd August 2007)

Similar Threads

  1. Qt4 - QTextEdit - background color
    By impeteperry in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2009, 07:52
  2. QTextEdit with semi-transparent background
    By ber_44 in forum Qt Programming
    Replies: 6
    Last Post: 29th April 2007, 00:01
  3. Replies: 1
    Last Post: 5th April 2006, 16:44
  4. Qt Designer 4.0.1 Preview Colors
    By jtyler in forum Qt Tools
    Replies: 2
    Last Post: 14th February 2006, 15:47
  5. Rich Text Tale Vol1 : Background colors
    By fullmetalcoder in forum Qt Programming
    Replies: 37
    Last Post: 9th February 2006, 15: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
  •  
Qt is a trademark of The Qt Company.