Results 1 to 14 of 14

Thread: Transparent windows?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Transparent windows?

    QWidget::setMask() may be able to help you, it doesn't use the composite capabilities of your graphical backend. It won't help you to achieve semi-transparency, though. You'll need composite for that (or you'll have to "emulate" it, which will be very inefficient).

  2. #2
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Transparent windows?

    Composite is what I am thinking, since months, I need. But owing to no documentation (at I could not find) I am unable to use it. Also I am pretty my uninformed about what exactly needs to be done for the task on hand.

  3. #3
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Transparent windows?

    Somewhere in my is this idea: Use composite for a screenshot of each window and blend with my window.
    This, for me, is very ugly idea (and perhaps would be slow), but I've no idea of how composite functions or what it can do or not.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Transparent windows?

    AFAIK composite works as described in the article already pointed in one of the previous posts in this thread. Search Google for composite+extension+x11+api, maybe something usefull will pop up.

  5. #5
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Transparent windows?

    QWidget::setWindowOpacity(qreal)

    Or am I misunderstanding your question? That function will set your window partially transparent (provided composite is working).

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Transparent windows?

    Quote Originally Posted by pherthyl
    QWidget::setWindowOpacity(qreal)

    Or am I misunderstanding your question? That function will set your window partially transparent (provided composite is working).
    It won't work for X11 and additionally it changes the opacity of the whole window, not parts of it.

  7. #7
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Transparent windows?

    It won't work for X11 and additionally it changes the opacity of the whole window, not parts of it.
    Indeed. But you won't get around the requirement for composite no matter what you do (unless you just want to mask, or use some very ugly screenshot hacks).

    However, at one point I remember zack rusin (Trolltech and KDE dev) releasing a short video showing what the SVG engine in Qt is capable of. In this video, he had a toplevel widget, defined in SVG, that was partially transparent (but only parts of it) and could add standard widgets on it. Now I can't find this video anymore, but it seems that it should be possible to do what the original poster wanted in this way.

  8. #8
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Transparent windows?

    Found it:

    http://www.kdedevelopers.org/node/1559

    It seems this should be possible right now? I'll have to try and get back to you.

    Update: Can't get it working here (4.1.3, Windows XP). I emailed Zack about it, see if he can provide any details.
    Last edited by pherthyl; 12th September 2006 at 00:39.

  9. The following user says thank you to pherthyl for this useful post:

    yogeshm02 (13th September 2006)

  10. #9
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Transparent windows?

    Quote Originally Posted by pherthyl
    This is exactly what I want! Looks too easy.

    Quote Originally Posted by pherthyl
    Update: Can't get it working here (4.1.3, Windows XP). I emailed Zack about it, see if he can provide any details.
    My initial attempt has also failed. I'll try different combinations and report if done.

  11. #10
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Transparent windows?

    No success here. I can't get it to work, and I haven't heard anything from Zack. I suspect this feature either never made it into Qt, or didn't make it until 4.2, or didn't make it into the Windows version at all.

Similar Threads

  1. Replies: 3
    Last Post: 8th December 2006, 18:51
  2. Replies: 2
    Last Post: 30th August 2006, 10:09
  3. qt and mingw can not run on windows 98?
    By evewei in forum Installation and Deployment
    Replies: 4
    Last Post: 26th June 2006, 09:22
  4. MDI windows without QWorkspace
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 16th June 2006, 17:15
  5. Replies: 4
    Last Post: 12th January 2006, 04: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
  •  
Qt is a trademark of The Qt Company.