ui->setupUi(this);//1. 使用本地文件:ui->actionasdasdas->setIcon(QIcon("本地绝对路径"));ui->actiona1->setIcon(QIcon("C:/Users/满满/Desktop/output/picture/1.jpg"));//2. 使用资源文件:ui->actionasdasdas->setIcon(QIcon(":+前缀+文件名"));ui->actiona1->setIcon(QIcon(":/picture/5.jpg"));