Active Topics

 


Reply
Thread Tools
Posts: 370 | Thanked: 443 times | Joined on Jan 2006 @ Italy
#1
Hi all,

I am developing a little app for accessing our planner database while on the go from the 900 in order to register on the fly the time spent on single tasks. This work is being made in the spare time while travelling, while falling asleep instead of reading some books.

True is, I took the chance to start coding again (I have some background in Fortran, Cobol, C/C++ and lot of DB when I was young. Then came Python, almost the only language I used for small coding during last year. At present I feel a little rusty since last nice code I wrote was 4+ years ago for my 770 and the at the time borning Hildon). This time I'm taking some time to learn Qt - yes, after the shocking new of Nokia going WP, I decided so anyway - obviously going through the Python route since it is more for passion than job.

Long story short (I already wrote too much!) today I lost a whole day without results trying to access our server, due to problems with Qt Sql driver.
When running the standard PyQt example, evrything works. When trying to access a mysql database using
Code:
db=QtSql.QSqlDatabase.addDatabase("QMYSQL")
instead of
Code:
db=QtSql.QSqlDatabase.addDatabase("QSQLITE")
the following error arises:
Code:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE
I think the problem resides in the fact that the libqt-sql-sqlite is for Qt4.7 where the libqt4-sql-mysql is for Qt4.6.2, but I had not been to solve the matter. I also tried to install the libqt4-experimental-sql-mysql package without success.
The current package situation on my N900 is as follows:
Code:
dpkg -l | grep qt | grep sql
ii libqt4-sql 4.7.0-git20100909-0maemo1+0m5
ii libqt4-sql-mysql 4.6.2-git20100205-1
ii libqt4-sql-sqlite 4.7.0-git20100909-0maemo1+0m5
ii python2.5-qt4-sql 4.7.5-maemo2
I saw in other threads the same problem, but there it had been solved (or at least it seems so by reading them) simply installing the libqt4-sql-mysql package (there were dependency problems to solve or simply the package was not installed at all). In my case, I have the aforementioned package installed, but from the description it looks like the version is not matching. All repositories enabled (extras, extras-testing and extras-devel).

Any clue?

Thanks in advance,
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#2
Heya... The mysql driver is apparently not configured/enabled in the default configuration of Qt, the 4.6 version you're seeing is a version in Extras, uploaded by someone (bricks ?) separately. IIUC this has little to do with PyQt, it should be able to use whatever plugin is present in the Qt install. The best I can suggest is to try to get hold of the maintainer of the qt-mysql community package and convince him to update his package... If that happens, you'll be able to use it from PyQt (or any Qt application for that matter).
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 

The Following User Says Thank You to attila77 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 05:25.