Results 1 to 4 of 4

Thread: QMainWindow Opacity

  1. #1
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default QMainWindow Opacity

    Changing a QMaindow's opacity doesn't seem to work whether changing the windowOpacity in Designer or by

    Qt Code:
    1. AboutWin::AboutWin(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::AboutWin)
    4. {
    5. ui->setupUi(this);
    6. setAttribute(Qt::WA_DeleteOnClose);
    7.  
    8. this->setWindowOpacity(0.3);
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: QMainWindow Opacity

    Quoting the docs:

    This feature is available on Embedded Linux, Mac OS X, Windows, and X11 platforms that support the Composite extension.

    This feature is not available on Windows CE.

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QMainWindow Opacity

    Quote Originally Posted by wysota View Post
    Quoting the docs:

    This feature is available on Embedded Linux, Mac OS X, Windows, and X11 platforms that support the Composite extension.

    This feature is not available on Windows CE.

    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.
    Yes, I'm aware. I'm running Windows 7.

  4. #4
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QMainWindow Opacity

    This answer is not to change opacity in the constructor. Change it after the window is painted, e.g.

    AboutWin *win = new AboutWin;
    win->show();
    win->setWindowOpacity(0.75);

Similar Threads

  1. change the opacity
    By askatuak in forum Qt Quick
    Replies: 1
    Last Post: 18th September 2013, 16:20
  2. Layered Opacity
    By JeffC in forum Newbie
    Replies: 0
    Last Post: 9th June 2010, 15:42
  3. Plasmoid opacity
    By AcerExtensa in forum KDE Forum
    Replies: 3
    Last Post: 25th July 2009, 14:22
  4. Window Opacity
    By chethana in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2007, 10:45
  5. Opacity in Linux OS
    By shyam prasad in forum Qt Programming
    Replies: 2
    Last Post: 22nd May 2007, 05:59

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.