Qt World Summit: Register Today!

The question about configure Qt Creator

  • Hello,
    I used Qt Creator to create a Qt Widget project.here is my code:
    @#include <QtGui>

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    QWidget widget;
    QLineEdit *lineEdit = new QLineEdit;
    QLabel *label = new QLabel;
    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget( lineEdit );
    layout->addWidget( label );
    widget.setLayout( layout );

    return a.exec&#40;&#41;;

    When I compiled the project,nothing happened.I don't why.
    Thank you for your attention.

  • I just copy and pasted the same code in main.cpp and its working fine.

    What steps do you follow ?

  • My Qt Creator is 2.4.1.My step is as default.Now I create an empty project and compile the code,it works well.

Log in to reply