QT 下拉按钮

  QMenu* menuS = new QMenu;

    connect(menuS,SIGNAL(triggered(QAction*)),this,SLOT(onRunselect(QAction*)));

    QAction* actionS = new QAction(menuS);

    menuS->addAction(actionS);

    actionS->setText("执行B");

    menuS->setStyleSheet("background-color: rgb(92, 241, 162);color:  rgb(255, 255, 255); font:9pt");

    ui->bn_Run_2->setMenu(menuS);

    ui->bn_Run->setStyleSheet("background-color:transparent;color:  rgb(255, 255, 255); font: 9pt");

你可能感兴趣的:(QT 下拉按钮)