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
) : 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
}
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
}
To copy to clipboard, switch view to plain text mode
Bookmarks