class Ui MainWindow has no member named actionnew ui actionnew ssetIcon的错误解决方案

class Ui MainWindow has no member named actionnew ui actionnew ssetIcon的错误解决方案_第1张图片

C:\Users\Administrator\Desktop\untitled\mainwindow.cpp In
constructor ‘MainWindow::MainWindow(QWidget*)’:

C:\Users\Administrator\Desktop\untitled\mainwindow.cpp:12: error:
‘class Ui::MainWindow’ has no member named ‘actionnew’
ui->actionnew->setIcon(QIcon(":/Image/Frame.jpg"));
^

当看见这种错误,你应该看看你的UI的界面的按钮,双击进入
在这里插入图片描述
class Ui MainWindow has no member named actionnew ui actionnew ssetIcon的错误解决方案_第2张图片

	//与UI中的标识一一对应
    ui->actionnew_2->setIcon(QIcon(":/Image/Frame.jpg"));
    ui->actionne->setIcon(QIcon(":/Image/up.png"));

@Author: cpu_code
@Date: 2020-06-14 11:01:59
@LastEditTime:2020-06-17 21:47:53
@FilePath: \QT\source\mainWindow.cpp
@Gitee:https://gitee.com/cpu_code
@CSDN:https://blog.csdn.net/qq_44226094

你可能感兴趣的:(QT,qt,bug,错误,解决,c++)