Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3027

Adding to .Pro file (Qt)

$
0
0
I created a new project in Qt Creator, the files included are the .Pro file, and the .Cpp file.

Qt does not recognize the headers I try to reference in the .Cpp file. I am pretty sure it's because of what I don't have in my .Pro file. What do I add to it?

.Cpp

Code:

#include <QApplication>      ->No such File or Directory
#include <QPushButton>        ->No such File or Directory
#include <QHBoxLayout>          ->No such File or Directory

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QWidget *window = new QWidget;
    QPushButton *button = new QPushButton("Quit");

    QObject::connect(button, SIGNAL(clicked()),
                    &app, SLOT(quit()));

    button->show();

    QHBoxLayout *layout = new QHBoxLayout;

    window->setLayout(layout);
    window->show();

    return app.exec();


}

.Pro
Code:

SOURCES += \
    MainWindow.cpp


Viewing all articles
Browse latest Browse all 3027

Latest Images

Trending Articles



Latest Images