Results 1 to 1 of 1

Thread: QTextEdit changing color , after pasting some color data

  1. #1
    Join Date
    Mar 2013
    Location
    Hyderabad,Bangalore,India
    Posts
    70
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTextEdit changing color , after pasting some color data

    Hi,
    I dont know this is a strange problem , or silly but i am stumbled..

    I am using the following code to format my QTextEdit.

    whenever i paste some colored text from some other location the color is visible as it is and if i press enter
    the text "EnterHere>" also changing to same color as pasted text.
    I am using "EnterHere>" as command promt
    I tried using AutoFillFormat(None) but did not help.

    please let me now if any body faced this before.

    Qt Code:
    1. QFont font("Arial",9,QFont::Courier,FALSE);
    2. setFont(font);
    3.  
    4. setAutoFillBackground(true);
    5. pl.setColor(pl.Base,Qt::black);
    6. pl.setColor(QPalette::Text,Qt::white);
    7. setPalette(pl);
    8. mPrompt = "EnterHere>";
    9. append(mPrompt);
    To copy to clipboard, switch view to plain text mode 


    Added after 10 minutes:


    Solved by using
    Qt Code:
    1. setTextColor(Qt::white);
    To copy to clipboard, switch view to plain text mode 
    again after pressing enter.

    Please let me know if any other way to disable the same
    Last edited by PstdEr; 3rd July 2013 at 18:50.

Similar Threads

  1. Replies: 4
    Last Post: 8th September 2011, 08:22
  2. QDial changing bacground color
    By nightroad in forum Newbie
    Replies: 1
    Last Post: 4th May 2011, 19:22
  3. changing background color in qvfb
    By John Douma in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 31st March 2011, 19:30
  4. Changing color of only one tab
    By Tiansen in forum Qt Programming
    Replies: 1
    Last Post: 7th January 2011, 04:34
  5. changing color of QTable
    By aj2903 in forum Qt Programming
    Replies: 7
    Last Post: 30th October 2009, 12:52

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.