June 22, 2012

Alcatraz Alcatraz
Lab Rat
25 posts

QML only connect to mySQL

 

is there any way to connect to mysql in QML instead of having to use C++ to connect and grab data

3 replies

June 25, 2012

alexleutgoeb alexleutgoeb
Lab Rat
29 posts

Yes, you can use some JavaScript code to connect to a local db, see the SQL Local Storage Example here: http://doc.qt.nokia.com/4.7-snapshot/declarative-sqllocalstorage-hello-qml.html

Alex

June 25, 2012

Alcatraz Alcatraz
Lab Rat
25 posts

This don’t really answer my question sorry if i was unclear.

i need to connect to an external MySQL Database that’s hosted on another server

June 25, 2012

alexleutgoeb alexleutgoeb
Lab Rat
29 posts

I see, didn’t get that from your question at first.

The linked example only works with a local database, in your case you probably can write your own QML item in C++ and reuse that every time you need QML SQL access. If this doesn’t meet your needs I’m out of ideas, sorry.

 
  ‹‹ Qt Designer - QML file creation      QML Component Components Properties not-existing ››

You must log in to post a reply. Not a member yet? Register here!