Ishtar
28th April 2010, 00:16
Dear All
Please consider the following function:
void CTL_Main::useDBParamteters1(QString DB_IP, int DB_PORT, QString DB_USER, QString DB_PASS){
MySQL_DB testing_query(DB_IP, DB_PORT, DB_USER, DB_PASS);
float resultofquery = testing_query.getAIRTemperature();
QString results_string;
results_string.setNum(resultofquery);
qDebug() << results_string;
ui->lineAIRTemp->setText(results_string);
QMessageBox::information(this, "Debug Data", "Current Temperature: " + results_string);
return;
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
Please consider the following function:
void CTL_Main::useDBParamteters1(QString DB_IP, int DB_PORT, QString DB_USER, QString DB_PASS){
MySQL_DB testing_query(DB_IP, DB_PORT, DB_USER, DB_PASS);
float resultofquery = testing_query.getAIRTemperature();
QString results_string;
results_string.setNum(resultofquery);
qDebug() << results_string;
ui->lineAIRTemp->setText(results_string);
QMessageBox::information(this, "Debug Data", "Current Temperature: " + results_string);
return;
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