El código es el siguiente:
Código
#include "formulario.h" #include "ui_formulario.h" #include <QMessageBox> #include<QString> Formulario::Formulario(QWidget *parent) : QMainWindow(parent), ui(new Ui::Formulario) { ui->setupUi(this); } Formulario::~Formulario() { delete ui; } void Formulario::on_btnEnviar_clicked() { //QMessageBox::information(this,tr("Formulario enviado"),tr("Se han enviado los datos del formulario")); QMessageBox ventana(this); ventana.setWindowTitle("Formulario enviado"); ventana.setText("Los datos enviados son: "); QString info; info = QString("Nombre: ").append(ui->txtNombre->text()).append("\n"); info.append("Apellido paterno: ").append(ui->txtApePaterno->text()).append("\n"); info.append("Apellido materno: ").append(ui->txtApeMaterno->text()).append("\n"); info.append("Dirección: ").append(ui->txtDireccion->toPlainText).append("\n"); info.append("Teléfono: ").append(ui->txtTelefono->text()).append("\n"); info.append("Sexo: "); if(ui->btnSexo->isChecked()){ info.append(ui->btnSexo->text()).append("\n"); } if(ui->btnSexo_2->isChecked()){ info.append(ui->btnSexo_2->text()).append("\n"); } info.append("Edad: ").append(ui->IsEdad->currentText()).append("\n"); ventana.setInformativeText(info); ventana.setStandardButtons(QMessageBox::Close); ventana.button(QMessageBox::Close)->setText("Cerrar"); ventana.exec(); }
Y el mensaje de error que me sale es "Mensaje de error "Class QLineEdit" has no member named "toPlainText" y no lo puedo correr.
Espero me puedan ayudar.
· Los códigos deben ir en etiquetas GeSHi
>aquí las reglas del foro
-Engel Lex