QProgressBar as semi-transparent overlay
So basically, I have a QToolButton filled with a large icon of a playing card, and I want to overlay a QProgressBar over it.
Unfortunately I for the life of me, can not figure out how to make the QProgressbar Semi Transparent. I tried setstylesheet, but it doesnt have the proper constructors(?did I use that term right?), and I also tried this code:
Code:
#include <QApplication>
#include <QProgressBar>
int main(int argc, char *argv[])
{
palette.setColor(widget->backgroundRole(), Qt::green);
widget->setAutoFillBackground(true);
widget->setPalette(palette);
palette1.setColor(progress->backgroundRole(), Qt::transparent);
progress->setAutoFillBackground(true);
progress->setPalette(palette1);
widget->show();
return a.exec();
}
as someone in #qt said they got it working... I can get it to work on certain objects, but not QProgressbar.
Any ideas?