#ifndef STUDENT_H#define STUDENT_H#include <QDialog>#include <QtSql>#include <QtGui>namespace Ui { class student;}class student : public QDialog { Q_OBJECTpublic: student(QWidget *parent = 0); ~student(); void stud(); int setttt(); int j;
#include <QDialog>namespace Ui { class Student_inform;}class Student_inform : public QDialog { Q_OBJECTpublic: Student_inform(QWidget *parent = 0); ~Student_inform(); void setData(int i);protected: void changeEvent(QEvent *e);private: Ui::Student_inform *ui;};
#include "student_inform.h"#include "ui_student_inform.h"#include "student.h"Student_inform::Student_inform(QWidget *parent) : QDialog(parent), ui(new Ui::Student_inform){ ui->setupUi(this); setData(student::setttt());}Student_inform::~Student_inform(){ delete ui;}void Student_inform::changeEvent(QEvent *e){ QDialog::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: ui->retranslateUi(this); break; default: break; }}void Student_inform::setData(int i){ int h = i; ui->label->setText(QString("%1").arg(h));}
C++ (Qt)A *a = new A;B *b = new B(a, a->id);...B::B(QWidget *parent, int id){ // делай что нужно с этим id}