Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Issue with string conversion

Issue with string conversion

Issue with string conversion


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());

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,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close