Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issue with string conversion

Status
Not open for further replies.

Ogi

Technical User
Nov 9, 2001
896
GB
Hi,

I've been writing a C++ program in QT on Ubuntu and it's working ok but as I am trialling Linux, I've just copied the files from my Ubuntu system to Linux Mint 14.

I've opened the project and it loads and can see all the files but when I come to compile, I get these strange compiler issues and am stuck!

I've got the following configured in my function:-

std::string strTemp;

QSqlQuery LoadOrders;
QString querystring(strSQL.c_str());
LoadOrders.prepare(querystring);
LoadOrders.exec();

Then, I want to put the results on my table:-

strTemp = LoadOrders.value("OrderCode").toString();

BUT, I'm getting

/home/backoffice/Source/MSC Front Desk/MSCFrontDesk/mainwindow.cpp:109: error: invalid conversion from 'const char*' to 'int' [-fpermissive]

/home/backoffice/Source/MSC Front Desk/MSCFrontDesk/mainwindow.cpp:109: error: no match for 'operator=' in 'strTemp = QVariant::toString() const()'

Now, I think this might have something to do with it but again, not sure!

/usr/include/qt4/QtSql/qsqlquery.h:89: error: initializing argument 1 of 'QVariant QSqlQuery::value(int) const' [-fpermissive]

Do you think there are fundamental differences with the qsqlquery libraries between Ubuntu and Mint?

Cheers for any pointers or help,
Carl.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top