最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

When Qt Creator builds a project, ui_mainwindow.h always reports an type name error - Stack Overflow

programmeradmin1浏览0评论

I have a qt project, and every time it is rebuilt, it reports an error:

(Unknown type name 'controller'; did you mean 'Controller'?) in ui_mainwindow.h.

class Ui_MainWindow
{
public:
    controller *widget_3;
};

Controller is a QWidget, and I have changed its objectName to Controller in the property editor of Qt Designer.

In controller.h, it's also capitalized.

namespace Ui {
class Controller;
}

class Controller : public QWidget
{
    Q_OBJECT

public:
    explicit Controller(QWidget *parent = nullptr);
    ~Controller();

private:
    Ui::Controller *ui;
};

Every time I rebuild the project, I have to change it manually. I would like to ask on what basis does Qt Creator generate the type name 'controller'?

发布评论

评论列表(0)

  1. 暂无评论