PDA

View Full Version : setWindowOpacity() in constructor



Henry Blue Heeler
25th July 2014, 19:20
What am I missing?
Calling setWindowOpacity() in the constructor has no effect, yet calling setWindowOpacity after widget instantiation works, e.g.
(Win 7, Qt 5.1.1)



AboutWin::AboutWin(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::AboutWin)
{
ui->setupUi(this);
setWindowOpacity(0.85); // this does nothing here!
}

void MainWindow::on_actionAbout_triggered()
{
AboutWin *win = new AboutWin;
win->show();
win->setWindowOpacity(0.85); // this works here but not in constructor
}