I don't really understand where is your problem.
I think you want to have something like:
//we already have a QTextEdit called "textEdit"
//we want to have the hole current date
QString strDate
= datetime.
toString();
textEdit.setText(strDate);
//we prefer to have only the day
textEdit.clear();//clear :P
QDate dDate
= datetime.
date();
int iDay = dDate.day(); //get the day
QString strDay
= QString::number(iDay
);
//but we want it in QString, so we use the static function of QString "number" textEdit.setText(strDay);
//we already have a QTextEdit called "textEdit"
QDateTime datetime = QDateTime::currentDateTime();
//we want to have the hole current date
QString strDate = datetime.toString();
textEdit.setText(strDate);
//we prefer to have only the day
textEdit.clear();//clear :P
QDate dDate = datetime.date();
int iDay = dDate.day(); //get the day
QString strDay = QString::number(iDay); //but we want it in QString, so we use the static function of QString "number"
textEdit.setText(strDay);
To copy to clipboard, switch view to plain text mode
Hope it helps... if you have any answer or you were asking another issue just ask again
Bookmarks