PDA

View Full Version : QMainWindow Opacity



Henry Blue Heeler
11th January 2014, 01:34
Changing a QMaindow's opacity doesn't seem to work whether changing the windowOpacity in Designer or by



AboutWin::AboutWin(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::AboutWin)
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);

this->setWindowOpacity(0.3);

}

wysota
11th January 2014, 09:19
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.

Henry Blue Heeler
11th January 2014, 10:43
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.

Henry Blue Heeler
11th January 2014, 21:25
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);