main.cpp

来自「Linux下的qt编程示例」· C++ 代码 · 共 19 行

CPP
19
字号
#include <qapplication.h>#include "mainform.h"#include "qtimer.h"int main( int argc, char ** argv ){    QApplication a( argc, argv );    MainForm w;    w.show();    QTimer *date = new QTimer(0);    QTimer *time = new QTimer(0);    QObject::connect( date, SIGNAL(timeout()), &w, SLOT(Show_dateSlot()) );    date->start(1000,FALSE);     QObject::connect( time, SIGNAL(timeout()), &w, SLOT(Show_timeSlot()) );    time->start(500,FALSE);    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );    return a.exec();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?