I have three forms. By pressing the button on the first form, the second appears. By pressing the button on the second form, the third appears. By pressing a button on the third form, information is transmitted to the first form.
There is a problem with the transmission of the signal of the first form. The problem is as follows.
I connect the signal from the third form and the slot from the first.
connect(this, SIGNAL(send_signal_replot_R(DAG) ), this->baseClass, SLOT(replot_matrix_R(DAG) ) ); The signal is declared as follows:
signals: void send_signal_replot_R(DAG graph); The slot is declared as follows:
public slots: void replot_matrix_R(DAG graph); A slot is such a function:
void Main_Window::replot_matrix_R(DAG graph) { this->graph = graph; ui->widget->Graph() = graph; ui->widget->before_paint(); ui->widget->repaint(); return; } Call the signal like this:
emit this->send_signal_replot_R(graph); As a result, I get something like this:
QObject::connect: Cannot connect Calculate::send_signal_replot_R(DAG) to (null)::Main_Window::replot_matrix_R(DAG) I do not understand what is (null). This is a bit strange, i.e. Isn't a slot connected to a class? Or what is the bug? I tried to modify the connection with the slot for this, but did not help:
connect(this, SIGNAL(send_signal_replot_R(DAG) ), this->baseClass, SLOT(Main_Window::replot_matrix_R(DAG) ) ); Initialize this->baseClass :
Calculate::Calculate(int countMatrix, int countVertex, QWidget *baseClass, QWidget *parent) : QDialog(parent), ui(new Ui::Calculate) { ui->setupUi(this); this->countVertex = countVertex; this->countMatrix = countMatrix; this->SetNameLabel(1, countMatrix); InitMatrix(); this->matrixGraph.resize(countVertex, countVertex, 0); this->baseClass = baseClass; this->currentCountMatrix = 0; return; } connect is located inside the method:
void Calculate::on_pushButton_clicked() { ... connect(this, SIGNAL(send_signal_replot_R(DAG) ), this->baseClass, SLOT(Main_Window::replot_matrix_R(DAG) ) ); ... emit this->send_signal_replot_R(graph); ... }
baseClasshave areplot_matrix_Rslot? - gil9red