Skip to content

Instantly share code, notes, and snippets.

Created April 17, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/544e84fbcde5022a6878 to your computer and use it in GitHub Desktop.
Save anonymous/544e84fbcde5022a6878 to your computer and use it in GitHub Desktop.
Qt opacity
class TestWidget : public QWidget
{
public:
TestWidget(QWidget* parent = 0) : QWidget(parent)
{
this->setWindowOpacity(.5);
}
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
TestWidget widget;
QCheckBox* checkBox = new QCheckBox(&widget);
checkBox->setObjectName(QStringLiteral("checkBox"));
checkBox->setGeometry(QRect(0, 0, 89, 20));
widget.setGeometry(QRect(0, 0, 240, 320));
widget.show();
return app.exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment