Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bioinfo.h"
- #include "ui_bioinfo.h"
- #include "biodisplay.h"
- #include <iostream>
- using namespace std;
- BioInfo::BioInfo(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::BioInfo)
- {
- ui->setupUi(this);
- }
- BioInfo::~BioInfo()
- {
- delete ui;
- }
- void BioInfo::on_buttonBox_clicked(QAbstractButton *button)
- {
- string name = ui->nameLineEdit->text().toStdString();
- string age = ui->ageLineEdit->text().toStdString();
- cout << "your name is: " << name << endl;
- cout << "your age is: " << age << endl;
- //call on the bioDisplay widget to show user's name and age
- bioDisplay *dialog = new bioDisplay();
- /*
- the Qlabel object name that will diplay the name is called nameLabel and the
- one that will display age is called ageLabel
- i've tried ageLabel->setText(age) and nameLabel->setText(name), but my ide says
- error: ‘ageDisplay’ was not declared in this scope
- */
- dialog->setWindowTitle("Dialog");
- ageDisplay->text();
- dialog->show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement