示例#1
0
int main(){

    StopWatch s;
    s.start();
    int tms = 1;
    std::cout << "st: " << s.seconds() << std::endl;

    try
    {
        MyClass m;
        m.show();
        m.fun();
        m.show();
        m.fun();
        m.show();
        m.fun();
    }
    catch(const std::exception &e)
    {
        std::cout << e.what() << std::endl;
    }


    std::cout << "et: " << s.seconds() << std::endl;

    system("pause");
    return 0;
}
示例#2
0
int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	MyClass w;
	w.show();
	return a.exec();
}
int main(int argc, char **argv)
{
     QApplication app(argc, argv);

     MyClass cl;
     cl.show();
     QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));

     int ret = app.exec();
     return ret;
}