Depending on where you want to get the border of the transparent area, you will need to group the buttons into a widget (as SigTerm said), and then you can assign a color either through the palette
QPalette palette = widget->palette();
palette.setColor(QPalette::Window, QColor(100,100,100,100));
widget->setPalette(palette);
or use a stylesheet
widget->setStylesheet("QWidget{background-color: rgba(100,100,100,100);}";
Styles have the advantage that you can style your entire application from one place that is not in the code, and set the application stylesheet through QApplication::setStylesheet(QString)
source
share