Results 1 to 5 of 5

Thread: Transparent Dialog

  1. #1
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Question Transparent Dialog

    Can I set transparent for Dialog, but not for widget ?

    I tried like this, but not work.

    Qt Code:
    1. setWindowOpacity(0.1);
    2. m_ui->lineEdit->setWindowOpacity(1.0);
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Transparent Dialog

    Wouldn't that be kind of daft? Having widgets with different opacity levels than the window itself?

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Transparent Dialog

    You will need to play around with Qt::WA_TranslucentBackground to get that effect ( semi transparent main window and opaque child widgets)

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

    wirasto (12th November 2009)

  5. #4
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Exclamation Re: Transparent Dialog

    Not work Just make dialog background is black.

    Qt Code:
    1. setWindowOpacity(0.1);
    2. setAttribute(Qt::WA_TranslucentBackground);
    3.  
    4. m_ui->lineEdit->setWindowOpacity(1.0);
    To copy to clipboard, switch view to plain text mode 

  6. #5
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Transparent Dialog

    the doc for Qt::WA_TranslucentBackground says
    Indicates that the widget should have a translucent background, i.e., any non-opaque regions of the widgets will be translucent because the widget will have an alpha channel. Setting this flag causes WA_NoSystemBackground to be set. On Windows the widget also needs the Qt::FramelessWindowHint window flag to be set. This flag is set or cleared by the widget's author.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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

    wirasto (12th November 2009)

Similar Threads

  1. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 20:11
  2. Issue with Modelless dialog on Mac
    By Satyanarayana Chebrolu in forum Qt Programming
    Replies: 0
    Last Post: 24th February 2009, 10:10
  3. Dialog is not closing
    By manmohan in forum Newbie
    Replies: 5
    Last Post: 1st December 2008, 17:04
  4. Update to 4.4.2 - Now I Have A Transparent Dialog
    By mclark in forum Qt Programming
    Replies: 10
    Last Post: 6th October 2008, 20:11
  5. Replies: 9
    Last Post: 13th August 2008, 18:07

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.