一段QT小程序,我需要其在LINUX下的运行结截图
#include<QApplication>#include<QLabel>#include<QDate>#include<QLayout>intmain(intargc...
#include <QApplication>
#include <QLabel>
#include <QDate>
#include <QLayout>
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("离考研还有<font color='red';><b>");
QString tian("</b></font>天");
string = string + tianshu + tian;
label->setText(string);
label->setWindowTitle("考研倒计时");
QFont font;
font.setPointSize(30);
label->setFont(font);
label->resize(300,43);
label->show();
return a.exec();
} 展开
#include <QLabel>
#include <QDate>
#include <QLayout>
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("离考研还有<font color='red';><b>");
QString tian("</b></font>天");
string = string + tianshu + tian;
label->setText(string);
label->setWindowTitle("考研倒计时");
QFont font;
font.setPointSize(30);
label->setFont(font);
label->resize(300,43);
label->show();
return a.exec();
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询