Dear All

Please consider the following function:

Qt Code:
  1. void CTL_Main::useDBParamteters1(QString DB_IP, int DB_PORT, QString DB_USER, QString DB_PASS){
  2.  
  3. MySQL_DB testing_query(DB_IP, DB_PORT, DB_USER, DB_PASS);
  4. float resultofquery = testing_query.getAIRTemperature();
  5.  
  6. QString results_string;
  7. results_string.setNum(resultofquery);
  8. qDebug() << results_string;
  9.  
  10. ui->lineAIRTemp->setText(results_string);
  11. QMessageBox::information(this, "Debug Data", "Current Temperature: " + results_string);
  12.  
  13. return;
To copy to clipboard, switch view to plain text mode 

This function instantiates a instance of the MySQL_DB class and passes the database parameters to the constructor, then runs the getAIRTemperature() method which loads the results into a float. I then do a dirty conversion into a QString.

The correct value is displayed by qDebug() and in the QMessageBox but nothing is placed into QLineEdit (lineAIRTemp at line 10).

This is driving me crazy, can anybody help?

Many thanks
Ishtar