Search code examples
c++eclipseqtauto-generate

Qt in Eclipse not generate ui header file


I have Eclipse with Qt. I create new Qt Console project. When I run this project, build and run is without any problems. But when I create Qt QUI project, ui_guiapplication.h and ui_guiapplication.cpp file are not generated. This header file is require in this header file:

#ifndef GUIAPPLICATION_H
#define GUIAPPLICATION_H

#include <QtWidgets/QWidget>
#include "ui_guiapplication.h"

namespace Ui{
    class GuiApplicationClass;
}

class GuiApplication : public QWidget
{
    Q_OBJECT

public:
    GuiApplication(QWidget *parent = 0);
    ~GuiApplication();

private:
    Ui::GuiApplicationClass ui;
};

#endif // GUIAPPLICATION_H

I thing that miss two file: ui_quiapplicaton.cpp and ui_guiapplication.h. Because these files is not generated and what i must doing for obtain these? Thanks


Solution

  • I resolve this problem by change "QT" value in .pro file. Old .pro file was:

    TEMPLATE = app
    TARGET = GuiApplication2 
    
    QT        += core gui 
    
    HEADERS   += guiapplication2.h
    SOURCES   += main.cpp \
        guiapplication2.cpp
    FORMS     += guiapplication2.ui    
    RESOURCES +=
    

    and I now this file is:

    TEMPLATE = app
    TARGET = GuiApplication2 
    
    QT        += gui declarative 
    
    HEADERS   += guiapplication2.h
    SOURCES   += main.cpp \
        guiapplication2.cpp
    FORMS     += guiapplication2.ui    
    RESOURCES +=
    

    After change .pro file i run qmake, build app, and missing files was generate and app run without problems.