Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Unable to Display both time and date together using QLCDnumber

$
0
0
#include<lcdtd.h> #include<QtGui>   lcdtd::lcdtd(QLCDNumber *parent):QLCDNumber(parent) {     setWindowTitle("Time And Date");     QTimer *timer = new QTimer(this);     connect(timer,SIGNAL(timeout()),this,SLOT(showDate()));     QTimer *timex = new QTimer(this);     connect(timex,SIGNAL(timeout()),this,SLOT(showTime()));     timex->start(1000);       resize(200,200);     setDigitCount(10);   }   void lcdtd::showDate() {     QDate date = QDate::currentDate();       QString tex= date.toString("dd.MM.yyyy");     this->display(tex); } void lcdtd::showTime() {     QTime time = QTime::currentTime();       QString text= time.toString("hh:mm:ss ap");     this->display(text); }

Viewing all articles
Browse latest Browse all 18427

Trending Articles