I have a little game I'm making in qt 4.1. Right now I'm doing this part while on a windows XP machine. I have a mainwindow which basicall gets created like this
GUI::GUI() {
// setting the max/min size
setMinimumSize(350, 450);
setMaximumSize(350, 450);
// filling the background with white
//setAutoFillBackground(true);
palette.
setColor(QPalette::Background, Qt
::white);
setPalette(palette);
GUI::GUI() {
// setting the max/min size
setMinimumSize(350, 450);
setMaximumSize(350, 450);
// filling the background with white
//setAutoFillBackground(true);
QPalette palette;
palette.setColor(QPalette::Background, Qt::white);
setPalette(palette);
To copy to clipboard, switch view to plain text mode
Now when i start a new game I want to overlay like a black widget that has like a 50% transparency so you can still see the little gameboard and such. I am having no such luck getting another widget to be transparent over my mainwindow
Here is my latest attempt at trying to get it to work
blackBG->setGeometry(0,0,350,450);
blackBG->setAutoFillBackground(true);
blackBG->setWindowOpacity(.5);
blackBG->show();
QWidget *blackBG = new QWidget(this);
blackBG->setGeometry(0,0,350,450);
blackBG->setAutoFillBackground(true);
blackBG->setPalette(QPalette(QPalette::Background, Qt::black));
blackBG->setWindowOpacity(.5);
blackBG->show();
To copy to clipboard, switch view to plain text mode
any help? thanks!
Bookmarks