Results 1 to 6 of 6

Thread: setWindowOpacity doesn't work!

  1. #1
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face setWindowOpacity doesn't work!

    I am using this function successfully on windows XP but am not able to do the same on Linux SuSE 10. I tried using the following window managers but to no avail:


    metacity wmaker fvwm openbox blackbox kwin(kde default)
    Can anyone run the following code and confirm whether it works on your system. Please state the name and version of the underlying window manager that you are using.




    Qt Code:
    1. #include <QApplication>
    2. #include <QWidget>
    3. #include <QLabel>
    4.  
    5. using namespace Qt;
    6.  
    7. int main(int argc, char *argv[])
    8. {
    9. QApplication app(argc,argv);
    10.  
    11. QWidget *w=new QWidget(0,0);
    12.  
    13. QLabel *label=new QLabel("This is a label", w, 0);
    14.  
    15. w->setMinimumSize(100,100);
    16.  
    17. w->setWindowTitle("trial window");
    18.  
    19. w->setWindowOpacity(0.123);
    20.  
    21. w->show();
    22.  
    23. return app.exec();
    24. }
    To copy to clipboard, switch view to plain text mode 

    Thanks

    Nupul

    PS: What is the alternative to make a widget window transparent?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setWindowOpacity doesn't work!

    As the docs say:
    This feature is available on Mac OS X, X11 platforms that support the Composite extension, and Windows 2000 and later.
    Note that under X11 you need to have a composite manager running, and the X11 specific _NET_WM_WINDOW_OPACITY atom needs to be supported by the window manager you are using.

  3. #3
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setWindowOpacity doesn't work!

    i know that....I wish to know if someone is able to run the code snippet i posted and let me know the corresponding window manager and version they are using. It must be running on someone's machine atleast!

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

    Default Re: setWindowOpacity doesn't work!

    Do you have the composite extension turned on in your Xorg configuration? The window manager doesn't have to do anything with Xorg configuration, so if it doesn't run on one wm, it'll not run on any other.

  5. #5
    Join Date
    Mar 2006
    Posts
    172
    Thanks
    30
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setWindowOpacity doesn't work!

    Quote Originally Posted by wysota
    Do you have the composite extension turned on in your Xorg configuration? The window manager doesn't have to do anything with Xorg configuration, so if it doesn't run on one wm, it'll not run on any other.


    I don't know what you mean...could you tell me how to 'configure' or turn on that option?

    Thanks

    nupul

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

    Default Re: setWindowOpacity doesn't work!


Similar Threads

  1. work with web generated xml
    By emental86 in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2009, 13:51
  2. QXmlQuery problems - recipe example doesn't work
    By nhelseth in forum Qt Programming
    Replies: 0
    Last Post: 16th January 2009, 21:45
  3. Qt4 : QPainter::setRedirected doesn't work
    By Ankitha Varsha in forum Qt Programming
    Replies: 2
    Last Post: 20th June 2008, 17:52
  4. QActions don't work with menubar hidden
    By Pepe in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2007, 01:04
  5. Change work area OS
    By pakulo in forum Qt Programming
    Replies: 15
    Last Post: 15th May 2007, 07:20

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.