From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.


O que há de errado no meu programa?



  • Gostaria de saber o que tem de errado no meu programa:

    @#include <QtGui/QApplication>
    #include <QtGui/QPushButton>
    #include <QtGui/QHBoxLayout>
    #include <QtGui/QLabel>
    int main(int argc,char *argv[]) {
    QApplication prog (argc,argv);
    QWidget janela;
    QHBoxLayout *caixa = new QHBoxLayout(&janela);
    QPushButton *botao = new QPushButton("Sair");
    QLabel *rotulo = new QLabel(argv[1]);
    caixa->addWidget(botao,0,0);
    caixa->addWidget(rotulo,0,1);
    QObject::connect(&botao, SIGNAL(clicked()),
    &prog, SLOT(quit()));
    return prog.exec();
    };
    @

    Desde já, grato.



  • @#include <QtGui/QApplication>
    #include <QtGui/QPushButton>
    #include <QtGui/QHBoxLayout>
    #include <QtGui/QLabel>
    int main(int argc,char *argv[]) {
    QApplication prog (argc,argv);
    QWidget janela;
    QVBoxLayout *caixa = new QVBoxLayout(&janela);
    QPushButton *botao = new QPushButton("Sair");
    QLabel *rotulo = new QLabel("Alô Qt Brazil");
    caixa->addWidget(rotulo,0,Qt::AlignCenter);
    caixa->addWidget(botao,0,0);
    QObject::connect(botao, SIGNAL(clicked()),
    &prog, SLOT(quit()));
    janela.show();
    return prog.exec();
    };
    @


Log in to reply