#include #include #include #include int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow main_window; main_window.setGeometry(500, 500, 500, 300); // Make central widget for main window QWidget* central_widget = new QWidget(&main_window); central_widget->setLayout(new QVBoxLayout(central_widget)); main_window.setCentralWidget(central_widget); QWidget* inner_widget = new QWidget(central_widget); central_widget->layout()->addWidget(inner_widget); inner_widget->setLayout(new QVBoxLayout(inner_widget)); QComboBox* combobox = new QComboBox(inner_widget); combobox->addItem("a"); combobox->addItem("b"); inner_widget->layout()->addWidget(combobox); combobox->setPalette(QPalette(QColor(0, 200, 0))); central_widget->setStyleSheet("QComboBox { background-color: rgb(100, 100, 100); border: 0px; } "); main_window.show(); return app.exec(); }