public function to set lineedit in mainwindow
-
Hi
ok thats odd. looks ok from quick look.
must test in compiler to know for sureanyway, i say
void MainWindow::on_searchButton_clicked()
{
TSP tsp_run(this);
ui->Terminal_textEdit->appendPlainText("Start reading sensor");
tsp_run.can_tsp(ui->comboBox->currentText()); // Here I call the function can_tsp from the class TSP
connect(tsp_run,&TSP::readingAvailable,this,&MainWindow::tspVisualize); // Here I connected the signal readingAvailable to the visualization.
}TSP tsp_run(this); << wont this be DELETED long before it can ever say readingAvailable ?
its deleted as soon as on_searchButton_clicked ends since its local stack variable. -
Hi,
When I send the signal within my class without I have no problems at all. When I try to connect in the mainwindow I get the previous error. Now I was playing a bit with the connect in the main function. When I did the following I get no error, but the SLOT also doesn't get called.
connect(&tsp_run,SIGNAL(readingAvailable(),this,SLOT(tspVisualize());
-
-
@Pablo-J.-Rogina
Thanks for the time to make example code.
It didn't work straight away, this because I use qt4.8 and you the newer one probably.
So I changed your code to the older syntax to get it working.I would like to thank you and all others for there help!
Again I learned a lot!Thanks for helping!