...public slots: void free_pallet(QVector<int> to_free_pallet); signals: void take_free_pallet(); //сигнал базе данных на считывание свободных мест
#include <automatic.h>...private: Automatic *automatic_wind; signals: void send_free_pallet(QVector<int>); public slots: void search_free_pallet();
... //проверка: emit take_free_pallet(); qDebug()<<"signal on automatiic";...
DataBase::DataBase(QObject *parent) : QObject(parent){ qDebug()<<"it work"; automatic_wind = new Automatic(); connect(automatic_wind,&Automatic::take_free_pallet,this,&DataBase::search_free_pallet); connect(this,&DataBase::send_free_pallet,automatic_wind,&Automatic::free_pallet);}...void DataBase::search_free_pallet(){ qDebug()<<"search"; QVector <int> number_pallet; QSqlQuery *query = nullptr; ... emit send_free_pallet(number_pallet); qDebug()<<"signal on database";}
C++ (Qt)auto a = new A;delete a;std::cout << ''; // поставим тут точку останова
C++ (Qt)MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow){ ui->setupUi(this); autw = new Automat(); connect(this,&MainWindow::open_window,autw,&Automat::open_automat); ld=new load();}
C++ (Qt)load::load(QObject *parent) : QObject(parent){ autw = new Automat(); connect(autw,&Automat::get_load,this,&load::load_data); connect(this,&load::get_data,autw,&Automat::load_text); }
...autw = std::make_unique<Automat>();ld = std::make_unique<load>(autw);...
C++ (Qt)load::load(Automat *autw, QObject *parent) : QObject(parent){ connect(autw, &Automat::get_load, this, &load::load_data); // альтернативно: вместо этого connect и emit get_data() просто писать autw->load_text() в месте испускания сигнала connect(this, &load::get_data, autw, &Automat::load_text);}