Results 1 to 4 of 4

Thread: (GUI) How to make transparent the background of a QLineEdit ?

  1. #1
    Join Date
    Feb 2014
    Posts
    15
    Thanks
    3

    Default (GUI) How to make transparent the background of a QLineEdit ?

    Having this:
    Screenshot - 25_02_2014 , 18_17_48.png

    My intention is to make a file selector, so when the file has been selected, I want to show the selected file in the QLineEdit field. I want this field to be transparent, but didn't find any method.
    Last edited by oldFox64; 25th February 2014 at 17:27.

  2. #2
    Join Date
    Apr 2008
    Posts
    45
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: (GUI) How to make transparent the background of a QLineEdit ?

    I think you have to set it to not paint the background. Look at the window flags.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: (GUI) How to make transparent the background of a QLineEdit ?

    I do not see the connection between "I want to show the selected file in the QLineEdit field" and "I want this field to be transparent".

    This seems to do the trick for me:
    Qt Code:
    1. lineedit->setStyleSheet("* { background-color: rgba(0, 0, 0, 0); }");
    To copy to clipboard, switch view to plain text mode 

  4. The following user says thank you to ChrisW67 for this useful post:

    oldFox64 (26th February 2014)

  5. #4
    Join Date
    Feb 2014
    Posts
    15
    Thanks
    3

    Default Re: (GUI) How to make transparent the background of a QLineEdit ?

    I want the background to be transparent, not the content. That's worked, ty!

Similar Threads

  1. Replies: 4
    Last Post: 27th November 2013, 15:15
  2. Mac OS: How to make pop-up menu background transparent
    By montylee in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2013, 09:49
  3. Replies: 2
    Last Post: 22nd December 2010, 14:58
  4. Transparent background on QLabel on transparent QWidget
    By codeslicer in forum Qt Programming
    Replies: 1
    Last Post: 13th February 2008, 02:10
  5. Why the background is not transparent?
    By SkripT in forum Qt Programming
    Replies: 4
    Last Post: 9th May 2006, 01:17

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.