Hi everybody ,im working on a project in wichi i have a QTimeEdit object . So i added a signal slot
The idea is to send via serial communication the data but first i want to check if the conversion QDateTimeEdit to QString is correctly being made .. but no :S .
I put a text label (QPlaintTextEdit ) so to print the QDateTimeEdit there and verify that the conversion is right.
void MainWindow::on_dateTimeEdit_editingFinished()
{
QDate aux_date;
QString str_date;
QString str_time;
QTime aux_time;
aux_date = ui->dateTimeEdit->date();
aux_date.toString(str_date);
aux_time = ui->dateTimeEdit->time();
aux_time.toString(str_time);
str_date.append(str_time); //ahora tengo todo los datos en el string str_date
ui->texto_prueba->setPlainText(str_date); // texto_prueba is a QPlaintTextEdit object
}
↧