QMessageBox::StandardButton rb = QMessageBox::information(NULL, tr("Warnning!"),
                                    tr("The Application is running?"),
                   QMessageBox::Yes|QMessageBox::No|QMessageBox::Ok);
    if (rb == QMessageBox::Yes)
    {
        qDebug( "exitadfad");
    }
  //按钮显示中文
    int  num = QMessageBox::warning(this, tr("注意"), tr(" 是否写入??"), tr("是"), tr("否"),tr("test"));
    if(0==num)
    {
        qDebug() << num;
            //0对应“是”

            //1对应“否”

            //2对应下一个按钮,以此类推,可添加多个自定义按钮

    }

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-11-02
  • 2022-03-10
猜你喜欢
  • 2021-08-12
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案