Results 1 to 5 of 5

Thread: how QTextEdit transparent to his parent window?

  1. #1
    Join Date
    Feb 2008
    Posts
    49
    Thanks
    2
    Thanked 4 Times in 1 Post

    Default how QTextEdit transparent to his parent window?

    I am using Qtopia 4.3.2 to implement a Ui.

    on this window, there is a background image, how can i set the QTextEdit to transparent to his parent window, so that I can see the background image from the QTextEdit, like a QLable.

    thanks...

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how QTextEdit transparent to his parent window?

    Use stylesheets or QPalette to change the background.
    J-P Nurmi

  3. #3
    Join Date
    Feb 2008
    Posts
    49
    Thanks
    2
    Thanked 4 Times in 1 Post

    Default Re: how QTextEdit transparent to his parent window?

    Quote Originally Posted by jpn View Post
    Use stylesheets or QPalette to change the background.

    yeap, I had use QPalette to change the color property on designer.
    But, whatever I change, It seems not work. when I set the background to BLACK, then it will
    transparent to the desktop, not transparent to his parent window.

    Can you explain this more clear ? thanks.... ^_^

  4. #4
    Join Date
    Feb 2008
    Posts
    49
    Thanks
    2
    Thanked 4 Times in 1 Post

    Wink Re: how QTextEdit transparent to his parent window?

    ok, I had found out a way to fix this problem.

    see the code below.

    Qt Code:
    1. detailTextEdit->viewport()->setAutoFillBackground(false);
    To copy to clipboard, switch view to plain text mode 

    You should disable the viewport of text edit to auto fill background, but not text edit itself.

    thanks for all you help.

  5. The following 4 users say thank you to wesley for this useful post:

    emrares (16th September 2009), Grey Phantom (22nd December 2011), mattc (31st July 2009), stillwaiting (15th October 2010)

  6. #5
    Join Date
    Aug 2009
    Posts
    33
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how QTextEdit transparent to his parent window?

    Quote Originally Posted by wesley View Post
    ok, I had found out a way to fix this problem.

    see the code below.

    Qt Code:
    1. detailTextEdit->viewport()->setAutoFillBackground(false);
    To copy to clipboard, switch view to plain text mode 

    You should disable the viewport of text edit to auto fill background, but not text edit itself.

    thanks for all you help.

    10x alot man!!

Similar Threads

  1. Transparent window with QGLWidget
    By ultr in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2008, 07:01
  2. Regarding drawing on Transparent Window
    By Shalabh in forum Qt Programming
    Replies: 3
    Last Post: 31st May 2007, 10:32
  3. Getting a parent window from a QT/Linux library
    By nicolas44 in forum Qt Programming
    Replies: 8
    Last Post: 31st May 2007, 08:17
  4. move parent window to the front.
    By hvengel in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2007, 08:41
  5. Making some part of window transparent
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 27th March 2006, 20:36

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.