信号与槽

代码:

#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton *button = new QPushButton("Quit");
    QObject::connect(button, SIGNAL(clicked()),
                     &app, SLOT(quit()));//信号与槽进行关联
    button->show();
    return app.exec();
}

posted on 2013-01-02 10:29  小风儿_xf  阅读(144)  评论(0编辑  收藏  举报

导航