Results 1 to 4 of 4

Thread: Semi transparent overlay with opaque child widgets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    May 2008
    Posts
    12
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Semi transparent overlay with opaque child widgets

    Thanks for your prompt reply, this issue is resolved.


    Qt Code:
    1. setAutoFillBackground(false);
    2. setWindowFlags(Qt::FramelessWindowHint);
    3. setAttribute(Qt::WA_TranslucentBackground);
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. void MyWidget::paintEvent(QPaintEvent *)
    2. {
    3. QPainter painter(this);
    4. painter.setRenderHint(QPainter::Antialiasing);
    5. painter.setPen(Qt::NoPen);
    6. painter.setBrush(QColor(100,100,100, 127));
    7.  
    8. painter.drawRect(0, 0, width(), height());
    9. }
    To copy to clipboard, switch view to plain text mode 

  2. The following 2 users say thank you to y.s.bisht for this useful post:

    basania (18th July 2019), INeedADollar (15th November 2019)

Similar Threads

  1. How to make overlapping widgets opaque ?
    By ada10 in forum Newbie
    Replies: 3
    Last Post: 9th September 2010, 10:06
  2. Replies: 0
    Last Post: 25th August 2010, 17:39
  3. Semi-Transparent Widgets over OpenGL rendering
    By ddpro in forum Qt Programming
    Replies: 2
    Last Post: 19th August 2010, 01:56
  4. Non-transparent QWidget on semi-transparent parent
    By EuroElessar in forum Qt Programming
    Replies: 0
    Last Post: 29th August 2008, 16:20
  5. qt4.3 semi-transparent widgets winxp
    By kernel_panic in forum Qt Programming
    Replies: 2
    Last Post: 19th July 2007, 06:25

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.