This article mainly introduces the QT implementation Countdown example, the need for friends can refer to the following
The countdown procedure written in QT can be used for different purposes according to the specified time. To create a simple GUI project for QT, modify the main.cpp.
Copy code code as follows:
int main (int argc, char *argv)
Qapplication A (argc, argv);
Qlabel *label = new Qlabel;
Qdate currentdate = Qdate::currentdate ();
Qdate Kaoyanri (2015,1,7);
Qint64 Tianshui = Currentdate.daysto (Kaoyanri);
QString Tianshu = Qstring::number (Tianshui);
QString string ("away from the Postgraduate and");
QString Tian ("Tian");
String = string + Tianshu + Tian;
Label->setwindowtitle ("Grind Down the Countdown");
return A.exec ();
Note : Please pay attention to the triple programming Tutorials section for more wonderful articles .