Advertisement
guselnikov

mainwindow.cpp

Jan 19th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent)
  5.     : QMainWindow(parent)
  6.     , ui(new Ui::MainWindow)
  7. {
  8.     ui->setupUi(this);
  9.  
  10.     tmp = new Class_2;
  11.  
  12.  
  13.  
  14.     connect(tmp, SIGNAL(send_name(QString str)), this, SLOT(name(QString str)));
  15.  
  16.     //connect(link, &Link::clicked,  mainWindow, &MainWindow::doSmth);
  17.     //connect(tmp, &tmp::send_name(QString str), this, &MainWindow::name(QString str));
  18.     //connect(SECOND_CLASS, &SECOND_CLASS_NAME::textIsChanged, this, &FIRST_CLASS_NAME::textIsChangedSlot);
  19.     connect(tmp, &tmp::send_name, this, MainWindow::name);
  20. }
  21.  
  22. MainWindow::~MainWindow()
  23. {
  24.     delete ui;
  25. }
  26.  
  27.  
  28. void MainWindow::on_pushButton_clicked()
  29. {
  30.     tmp->show();
  31. }
  32.  
  33. void MainWindow::name(QString str)
  34. {
  35.     user_name = str;
  36.     ui->statusbar->showMessage(user_name);
  37. }
  38.  
  39. void MainWindow::on_pushButton_2_clicked()
  40. {
  41.     ui->statusbar->showMessage(user_name);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement