void MainWindow::getFormdetails()
{
fd = new formDialog();
if(fd->exec() == 1)
{
data = fd->returnFormdata();
qDebug() << data;
}
}
formDialog::formDIalog()
{
connect(okButton, SIGNAL(clicked()), this, SLOT(formFieldCheck()));
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
}
void formDialog::formFieldCheck()
{
if(formLedit[0]->text().isEmpty() || formLedit[1]->text().isEmpty())
tr("Please enter a name."));
}
else {list.append(formLedit[0]->text());
list.append(formLedit[1]->text());
list.append(age->text());
list.append(gender->currentText());
this->hide();}
}
{
return list;
}
I would really appreciate if any one can help me with this.
void MainWindow::getFormdetails()
{
fd = new formDialog();
QStringList data;
if(fd->exec() == 1)
{
data = fd->returnFormdata();
qDebug() << data;
}
}
formDialog::formDIalog()
{
connect(okButton, SIGNAL(clicked()), this, SLOT(formFieldCheck()));
connect(okButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
}
void formDialog::formFieldCheck()
{
if(formLedit[0]->text().isEmpty() || formLedit[1]->text().isEmpty())
{ QMessageBox::information(this, tr("Empty Field"),
tr("Please enter a name."));
}
else {list.append(formLedit[0]->text());
list.append(formLedit[1]->text());
list.append(age->text());
list.append(gender->currentText());
this->hide();}
}
QStringList formDialog::returnFormdata()
{
return list;
}
I would really appreciate if any one can help me with this.
To copy to clipboard, switch view to plain text mode
Bookmarks