Re: QtSql and Debian package probelm
I have now like this: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); QString name = QDir::homePath() + /CurrencyConverter; db.setDatabaseName(name); return db.open(); It works fine directly from Qt Creator, but it doesn't work when installing the Debian package. Any ides? On Thu, Jun 10, 2010 at 16:39, Daniil Ivanov daniil.iva...@gmail.comwrote: It's actually better to use getenv(HOME), instead of /home/user. Thanks, Daniil. On Thu, Jun 10, 2010 at 4:37 PM, Daniil Ivanov daniil.iva...@gmail.com wrote: Ok, no need for directory: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); db.setDatabaseName(/home/user/.AppName); if (!db.open()) qDebug() db.lastError(); Thanks, Daniil. On Thu, Jun 10, 2010 at 4:33 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: Ehr... no. And how would I do that? Sorry for these silly questions... Thanks, Sascha PS. As such it didn't work in the package. But then again, I did not create the directory... On Thu, Jun 10, 2010 at 16:31, Daniil Ivanov daniil.iva...@gmail.com wrote: Did you create /home/user/.somedir/? Thanks, Daniil. On Thu, Jun 10, 2010 at 4:28 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: OK, let me try that. But at least it doesn't like it when running from Qt Creator (I'm using Nokia Qt SDK). The database stops working and behaves the same way as in the package. On Thu, Jun 10, 2010 at 16:08, Daniil Ivanov daniil.iva...@gmail.com wrote: Hi! You should be using something like this: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); db.setDatabaseName(/home/user/.somedir/AppName); return db.open(); Thanks, Daniil. On Thu, Jun 10, 2010 at 4:01 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: I'm just getting: QSqlQuery::value: not positioned on a valid record It's like the app is unable to write any data to the SQLite database. As I said, it does work fine when running it from Qt Creator or MADDE. On Thu, Jun 10, 2010 at 15:57, David King dav...@openismus.com wrote: On 2010-06-10 15:47, Sascha Mäkelä sascha.mak...@gmail.com wrote: This how it looks now: Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-network, libqt4-sql, libqt4-sql-sqlite But still it doesn't work. Am I missing something? The app works fine when I run it in N900 from Qt Creator. Which database provider do you use, I guess SQLite? If so, your Depends: line looks correct. When you say that the SQL parts of the application do not work, what is the problem? You could try starting your program from the terminal to check for clues in the output. Either that, or report any error messages that the application gives you. Thanks for all your help, Sascha On Thu, Jun 10, 2010 at 15:12, David King dav...@openismus.com wrote: On 2010-06-10 15:01, Sascha Mäkelä sascha.mak...@gmail.com wrote: Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network You need to add the relevant Qt SQL provider packages to the ‘Depends:’ line, not the ‘Build-Depends:’ line, as the SQL providers are plugins that are not required at build time, but at runtime. You probably want libqt4-sql-mysql or libqt4-sql-sqlite in Depends, depending on which database provider you are using. -- David King | http://amigadave.com/ ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: QtSql and Debian package probelm
Hi Sascha! Can you change your code like this: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); QString name = QDir::homePath() + /CurrencyConverter; db.setDatabaseName(name); if (!db.open()) { qDebug() name db.lastError(); return false; } else return true; and then run your application from the console? Thanks, Daniil. On Fri, Jun 11, 2010 at 11:11 AM, Sascha Mäkelä sascha.mak...@gmail.com wrote: I have now like this: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); QString name = QDir::homePath() + /CurrencyConverter; db.setDatabaseName(name); return db.open(); It works fine directly from Qt Creator, but it doesn't work when installing the Debian package. Any ides? On Thu, Jun 10, 2010 at 16:39, Daniil Ivanov daniil.iva...@gmail.com wrote: It's actually better to use getenv(HOME), instead of /home/user. Thanks, Daniil. On Thu, Jun 10, 2010 at 4:37 PM, Daniil Ivanov daniil.iva...@gmail.com wrote: Ok, no need for directory: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); db.setDatabaseName(/home/user/.AppName); if (!db.open()) qDebug() db.lastError(); Thanks, Daniil. On Thu, Jun 10, 2010 at 4:33 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: Ehr... no. And how would I do that? Sorry for these silly questions... Thanks, Sascha PS. As such it didn't work in the package. But then again, I did not create the directory... On Thu, Jun 10, 2010 at 16:31, Daniil Ivanov daniil.iva...@gmail.com wrote: Did you create /home/user/.somedir/? Thanks, Daniil. On Thu, Jun 10, 2010 at 4:28 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: OK, let me try that. But at least it doesn't like it when running from Qt Creator (I'm using Nokia Qt SDK). The database stops working and behaves the same way as in the package. On Thu, Jun 10, 2010 at 16:08, Daniil Ivanov daniil.iva...@gmail.com wrote: Hi! You should be using something like this: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); db.setDatabaseName(/home/user/.somedir/AppName); return db.open(); Thanks, Daniil. On Thu, Jun 10, 2010 at 4:01 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: I'm just getting: QSqlQuery::value: not positioned on a valid record It's like the app is unable to write any data to the SQLite database. As I said, it does work fine when running it from Qt Creator or MADDE. On Thu, Jun 10, 2010 at 15:57, David King dav...@openismus.com wrote: On 2010-06-10 15:47, Sascha Mäkelä sascha.mak...@gmail.com wrote: This how it looks now: Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-network, libqt4-sql, libqt4-sql-sqlite But still it doesn't work. Am I missing something? The app works fine when I run it in N900 from Qt Creator. Which database provider do you use, I guess SQLite? If so, your Depends: line looks correct. When you say that the SQL parts of the application do not work, what is the problem? You could try starting your program from the terminal to check for clues in the output. Either that, or report any error messages that the application gives you. Thanks for all your help, Sascha On Thu, Jun 10, 2010 at 15:12, David King dav...@openismus.com wrote: On 2010-06-10 15:01, Sascha Mäkelä sascha.mak...@gmail.com wrote: Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network You need to add the relevant Qt SQL provider packages to the ‘Depends:’ line, not the ‘Build-Depends:’ line, as the SQL providers are plugins that are not required at build time, but at runtime. You probably want libqt4-sql-mysql or libqt4-sql-sqlite in Depends, depending on which database provider you are using. -- David King | http://amigadave.com/ ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list
Re: QtSql and Debian package probelm
Try this? QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); QString name = QDir::homePath() + /CurrencyConverter; db.setDatabaseName(name); if (!db.open()) { qDebug() name db.lastError(); return false; } else { qDebug() name Great success!; return true; } Thanks, Daniil. On Fri, Jun 11, 2010 at 11:37 AM, Sascha Mäkelä sascha.mak...@gmail.com wrote: I get no error about that. Just the usual: QSqlQuery::value: not positioned on a valid record If there is a database, it's completely empty and I can't write anything into it. Thanks, Sascha On Fri, Jun 11, 2010 at 11:16, Daniil Ivanov daniil.iva...@gmail.com wrote: Hi Sascha! Can you change your code like this: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); QString name = QDir::homePath() + /CurrencyConverter; db.setDatabaseName(name); if (!db.open()) { qDebug() name db.lastError(); return false; } else return true; and then run your application from the console? Thanks, Daniil. On Fri, Jun 11, 2010 at 11:11 AM, Sascha Mäkelä sascha.mak...@gmail.com wrote: I have now like this: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); QString name = QDir::homePath() + /CurrencyConverter; db.setDatabaseName(name); return db.open(); It works fine directly from Qt Creator, but it doesn't work when installing the Debian package. Any ides? On Thu, Jun 10, 2010 at 16:39, Daniil Ivanov daniil.iva...@gmail.com wrote: It's actually better to use getenv(HOME), instead of /home/user. Thanks, Daniil. On Thu, Jun 10, 2010 at 4:37 PM, Daniil Ivanov daniil.iva...@gmail.com wrote: Ok, no need for directory: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); db.setDatabaseName(/home/user/.AppName); if (!db.open()) qDebug() db.lastError(); Thanks, Daniil. On Thu, Jun 10, 2010 at 4:33 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: Ehr... no. And how would I do that? Sorry for these silly questions... Thanks, Sascha PS. As such it didn't work in the package. But then again, I did not create the directory... On Thu, Jun 10, 2010 at 16:31, Daniil Ivanov daniil.iva...@gmail.com wrote: Did you create /home/user/.somedir/? Thanks, Daniil. On Thu, Jun 10, 2010 at 4:28 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: OK, let me try that. But at least it doesn't like it when running from Qt Creator (I'm using Nokia Qt SDK). The database stops working and behaves the same way as in the package. On Thu, Jun 10, 2010 at 16:08, Daniil Ivanov daniil.iva...@gmail.com wrote: Hi! You should be using something like this: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); db.setDatabaseName(/home/user/.somedir/AppName); return db.open(); Thanks, Daniil. On Thu, Jun 10, 2010 at 4:01 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: I'm just getting: QSqlQuery::value: not positioned on a valid record It's like the app is unable to write any data to the SQLite database. As I said, it does work fine when running it from Qt Creator or MADDE. On Thu, Jun 10, 2010 at 15:57, David King dav...@openismus.com wrote: On 2010-06-10 15:47, Sascha Mäkelä sascha.mak...@gmail.com wrote: This how it looks now: Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-network, libqt4-sql, libqt4-sql-sqlite But still it doesn't work. Am I missing something? The app works fine when I run it in N900 from Qt Creator. Which database provider do you use, I guess SQLite? If so, your Depends: line looks correct. When you say that the SQL parts of the application do not work, what is the problem? You could try starting your program from the terminal to check for clues in the output. Either that, or report any error messages that the application gives you. Thanks for all your help, Sascha On Thu, Jun 10, 2010 at 15:12, David King dav...@openismus.com wrote: On 2010-06-10 15:01, Sascha Mäkelä sascha.mak...@gmail.com wrote: Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network
Re: QtSql and Debian package probelm
Hmm... it doesn't print anything in the console. I've also added this before the error: qDebug() name Error!; Strange... Thanks, Sascha On Fri, Jun 11, 2010 at 11:57, Sascha Mäkelä sascha.mak...@gmail.comwrote: On Fri, Jun 11, 2010 at 11:42, Daniil Ivanov daniil.iva...@gmail.comwrote: Try this? QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); QString name = QDir::homePath() + /CurrencyConverter; db.setDatabaseName(name); if (!db.open()) { qDebug() name db.lastError(); return false; } else { qDebug() name Great success!; return true; } Thanks, Daniil. ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: QtSql and Debian package probelm
Ehm... Everything is working now. The last suggestion worked just fine with database and all. I had made just... ehr... Let us just say a very idiotic mistake in my packing and let's leave it at that. :D A very big thank you for everyone that helped me with this issue, Sascha On Fri, Jun 11, 2010 at 11:59, Sascha Mäkelä sascha.mak...@gmail.comwrote: Hmm... it doesn't print anything in the console. I've also added this before the error: qDebug() name Error!; Strange... Thanks, Sascha On Fri, Jun 11, 2010 at 11:57, Sascha Mäkelä sascha.mak...@gmail.comwrote: On Fri, Jun 11, 2010 at 11:42, Daniil Ivanov daniil.iva...@gmail.comwrote: Try this? QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); QString name = QDir::homePath() + /CurrencyConverter; db.setDatabaseName(name); if (!db.open()) { qDebug() name db.lastError(); return false; } else { qDebug() name Great success!; return true; } Thanks, Daniil. ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
QtSql and Debian package probelm
Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: QtSql and Debian package probelm
you need libqt4-sql and probably libqt4-sql-plugin ( plugin = sqlite , if you are using sqlite plugin ) - Original Message - From: Sascha Mäkelä Sent: 06/10/10 01:01 PM To: maemo-developers Subject: QtSql and Debian package probelm Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: QtSql and Debian package probelm
On 2010-06-10 15:01, Sascha Mäkelä sascha.mak...@gmail.com wrote: Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network You need to add the relevant Qt SQL provider packages to the ‘Depends:’ line, not the ‘Build-Depends:’ line, as the SQL providers are plugins that are not required at build time, but at runtime. You probably want libqt4-sql-mysql or libqt4-sql-sqlite in Depends, depending on which database provider you are using. -- David King | http://amigadave.com/ ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: QtSql and Debian package probelm
Hi Sascha! You don't have to include libqt4-network and libqt4-sql in Depends:. Where do you save your DB? Thanks, Daniil. On Thu, Jun 10, 2010 at 3:47 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: This how it looks now: Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-network, libqt4-sql, libqt4-sql-sqlite But still it doesn't work. Am I missing something? The app works fine when I run it in N900 from Qt Creator. Thanks for all your help, Sascha On Thu, Jun 10, 2010 at 15:12, David King dav...@openismus.com wrote: On 2010-06-10 15:01, Sascha Mäkelä sascha.mak...@gmail.com wrote: Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network You need to add the relevant Qt SQL provider packages to the ‘Depends:’ line, not the ‘Build-Depends:’ line, as the SQL providers are plugins that are not required at build time, but at runtime. You probably want libqt4-sql-mysql or libqt4-sql-sqlite in Depends, depending on which database provider you are using. -- David King | http://amigadave.com/ ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: QtSql and Debian package probelm
On 2010-06-10 15:47, Sascha Mäkelä sascha.mak...@gmail.com wrote: This how it looks now: Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-network, libqt4-sql, libqt4-sql-sqlite But still it doesn't work. Am I missing something? The app works fine when I run it in N900 from Qt Creator. Which database provider do you use, I guess SQLite? If so, your Depends: line looks correct. When you say that the SQL parts of the application do not work, what is the problem? You could try starting your program from the terminal to check for clues in the output. Either that, or report any error messages that the application gives you. Thanks for all your help, Sascha On Thu, Jun 10, 2010 at 15:12, David King dav...@openismus.com wrote: On 2010-06-10 15:01, Sascha Mäkelä sascha.mak...@gmail.com wrote: Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network You need to add the relevant Qt SQL provider packages to the ‘Depends:’ line, not the ‘Build-Depends:’ line, as the SQL providers are plugins that are not required at build time, but at runtime. You probably want libqt4-sql-mysql or libqt4-sql-sqlite in Depends, depending on which database provider you are using. -- David King | http://amigadave.com/ ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: QtSql and Debian package probelm
Hmm... I'm not sure what you mean by this. I simply use something like this to open the database: QSqlDatabase db = QSqlDatabase::addDatabase(QSQLITE); db.setDatabaseName(AppName); return db.open(); On Thu, Jun 10, 2010 at 15:51, Daniil Ivanov daniil.iva...@gmail.comwrote: Hi Sascha! You don't have to include libqt4-network and libqt4-sql in Depends:. Where do you save your DB? Thanks, Daniil. On Thu, Jun 10, 2010 at 3:47 PM, Sascha Mäkelä sascha.mak...@gmail.com wrote: This how it looks now: Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-network, libqt4-sql, libqt4-sql-sqlite But still it doesn't work. Am I missing something? The app works fine when I run it in N900 from Qt Creator. Thanks for all your help, Sascha On Thu, Jun 10, 2010 at 15:12, David King dav...@openismus.com wrote: On 2010-06-10 15:01, Sascha Mäkelä sascha.mak...@gmail.com wrote: Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network You need to add the relevant Qt SQL provider packages to the ‘Depends:’ line, not the ‘Build-Depends:’ line, as the SQL providers are plugins that are not required at build time, but at runtime. You probably want libqt4-sql-mysql or libqt4-sql-sqlite in Depends, depending on which database provider you are using. -- David King | http://amigadave.com/ ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: QtSql and Debian package probelm
I'm just getting: QSqlQuery::value: not positioned on a valid record It's like the app is unable to write any data to the SQLite database. As I said, it does work fine when running it from Qt Creator or MADDE. On Thu, Jun 10, 2010 at 15:57, David King dav...@openismus.com wrote: On 2010-06-10 15:47, Sascha Mäkelä sascha.mak...@gmail.com wrote: This how it looks now: Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-network, libqt4-sql, libqt4-sql-sqlite But still it doesn't work. Am I missing something? The app works fine when I run it in N900 from Qt Creator. Which database provider do you use, I guess SQLite? If so, your Depends: line looks correct. When you say that the SQL parts of the application do not work, what is the problem? You could try starting your program from the terminal to check for clues in the output. Either that, or report any error messages that the application gives you. Thanks for all your help, Sascha On Thu, Jun 10, 2010 at 15:12, David King dav...@openismus.com wrote: On 2010-06-10 15:01, Sascha Mäkelä sascha.mak...@gmail.com wrote: Hi, I just made a Debian package of my app. I'm using QtSql in it. But for some reason when I install the package, all the SQL things don't work. My guess is that I'm missing something in the Build-Depends line in the control file. How can I check what libs I need to add there and what are their correct names? Cheers, Sascha PS. Currently it's like this: Build-Depends: dephelper (5), libqt4-dev, libqt4-network You need to add the relevant Qt SQL provider packages to the ‘Depends:’ line, not the ‘Build-Depends:’ line, as the SQL providers are plugins that are not required at build time, but at runtime. You probably want libqt4-sql-mysql or libqt4-sql-sqlite in Depends, depending on which database provider you are using. -- David King | http://amigadave.com/ ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers