Results 1 to 15 of 15

Thread: Qt4.1 Transparent Widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    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: Qt4.1 Transparent Widget

    Override QWidget::resizeEvent(). Here's a pseudo algo:

    Qt Code:
    1. resizeEvent
    2. {
    3. // include title and frames
    4. region = frameGeometry // frameGeometry relative to the widget (not global)
    5.  
    6. // exclude the area inside frames
    7. region -= geometry // geometry relative to the widget (not global)
    8.  
    9. // include children
    10. region += childrenRegion
    11.  
    12. // apply mask
    13. setMask region
    14. }
    To copy to clipboard, switch view to plain text mode 

    PS. The indexing feature in Qt Assistant is powerful. Try entering "keywords" used in above pseudo code..
    Attached Images Attached Images
    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    djoul (18th July 2006)

Similar Threads

  1. Pin/Unpin Dock Widget
    By charlesD in forum Newbie
    Replies: 1
    Last Post: 21st June 2006, 06:57
  2. Transparent TextEdit or Widget
    By showhand in forum Qt Programming
    Replies: 8
    Last Post: 26th May 2006, 05:58
  3. Replies: 4
    Last Post: 24th March 2006, 22:50
  4. transparent widget
    By hijinks in forum Qt Programming
    Replies: 2
    Last Post: 20th February 2006, 09:43
  5. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16

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.