I have now like this:<div><br></div><div>QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");<br>QString name = QDir::homePath() + "/CurrencyConverter";<br>db.setDatabaseName(name);<br>return db.open();</div>
<div><br></div><div>It works fine directly from Qt Creator, but it doesn't work when installing the Debian package. Any ides?</div><div><br></div><div><br><div class="gmail_quote">On Thu, Jun 10, 2010 at 16:39, Daniil Ivanov <span dir="ltr"><<a href="mailto:daniil.ivanov@gmail.com">daniil.ivanov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> It's actually better to use getenv("HOME"), instead of /home/user.<br>
<br>
Thanks, Daniil.<br>
<div><div></div><div class="h5"><br>
On Thu, Jun 10, 2010 at 4:37 PM, Daniil Ivanov <<a href="mailto:daniil.ivanov@gmail.com">daniil.ivanov@gmail.com</a>> wrote:<br>
> Ok, no need for directory:<br>
><br>
> QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");<br>
> db.setDatabaseName("/home/user/.AppName");<br>
> if (!db.open())<br>
> qDebug() << db.lastError();<br>
><br>
> Thanks, Daniil.<br>
><br>
> On Thu, Jun 10, 2010 at 4:33 PM, Sascha Mäkelä <<a href="mailto:sascha.makela@gmail.com">sascha.makela@gmail.com</a>> wrote:<br>
>> Ehr... no. And how would I do that? Sorry for these silly questions...<br>
>> Thanks,<br>
>> Sascha<br>
>> PS. As such it didn't work in the package. But then again, I did not create<br>
>> the directory...<br>
>><br>
>> On Thu, Jun 10, 2010 at 16:31, Daniil Ivanov <<a href="mailto:daniil.ivanov@gmail.com">daniil.ivanov@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> Did you create /home/user/.somedir/?<br>
>>><br>
>>> Thanks, Daniil.<br>
>>><br>
>>> On Thu, Jun 10, 2010 at 4:28 PM, Sascha Mäkelä <<a href="mailto:sascha.makela@gmail.com">sascha.makela@gmail.com</a>><br>
>>> wrote:<br>
>>> > OK, let me try that. But at least it doesn't like it when running from<br>
>>> > Qt<br>
>>> > Creator (I'm using Nokia Qt SDK). The database stops working and behaves<br>
>>> > the<br>
>>> > same way as in the package.<br>
>>> ><br>
>>> > On Thu, Jun 10, 2010 at 16:08, Daniil Ivanov <<a href="mailto:daniil.ivanov@gmail.com">daniil.ivanov@gmail.com</a>><br>
>>> > wrote:<br>
>>> >><br>
>>> >> Hi!<br>
>>> >><br>
>>> >> You should be using something like this:<br>
>>> >><br>
>>> >> QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");<br>
>>> >> db.setDatabaseName("/home/user/.somedir/AppName");<br>
>>> >><br>
>>> >><br>
>>> >> return db.open();<br>
>>> >><br>
>>> >> Thanks, Daniil.<br>
>>> >><br>
>>> >> On Thu, Jun 10, 2010 at 4:01 PM, Sascha Mäkelä<br>
>>> >> <<a href="mailto:sascha.makela@gmail.com">sascha.makela@gmail.com</a>><br>
>>> >> wrote:<br>
>>> >> > I'm just getting:<br>
>>> >> > QSqlQuery::value: not positioned on a valid record<br>
>>> >> > It's like the app is unable to write any data to the SQLite database.<br>
>>> >> > As<br>
>>> >> > I<br>
>>> >> > said, it does work fine when running it from Qt Creator or MADDE.<br>
>>> >> ><br>
>>> >> > On Thu, Jun 10, 2010 at 15:57, David King <<a href="mailto:davidk@openismus.com">davidk@openismus.com</a>><br>
>>> >> > wrote:<br>
>>> >> >><br>
>>> >> >> On 2010-06-10 15:47, Sascha Mäkelä <<a href="mailto:sascha.makela@gmail.com">sascha.makela@gmail.com</a>> wrote:<br>
>>> >> >>><br>
>>> >> >>> This how it looks now:<br>
>>> >> >>><br>
>>> >> >>> Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-network,<br>
>>> >> >>> libqt4-sql,<br>
>>> >> >>> libqt4-sql-sqlite<br>
>>> >> >>><br>
>>> >> >>> But still it doesn't work. Am I missing something? The app works<br>
>>> >> >>> fine<br>
>>> >> >>> when I<br>
>>> >> >>> run it in N900 from Qt Creator.<br>
>>> >> >><br>
>>> >> >> Which database provider do you use, I guess SQLite? If so, your<br>
>>> >> >> Depends:<br>
>>> >> >> line looks correct. When you say that the SQL parts of the<br>
>>> >> >> application<br>
>>> >> >> do<br>
>>> >> >> not work, what is the problem? You could try starting your program<br>
>>> >> >> from<br>
>>> >> >> the<br>
>>> >> >> terminal to check for clues in the output. Either that, or report<br>
>>> >> >> any<br>
>>> >> >> error<br>
>>> >> >> messages that the application gives you.<br>
>>> >> >><br>
>>> >> >>> Thanks for all your help,<br>
>>> >> >>> Sascha<br>
>>> >> >>><br>
>>> >> >>> On Thu, Jun 10, 2010 at 15:12, David King <<a href="mailto:davidk@openismus.com">davidk@openismus.com</a>><br>
>>> >> >>> wrote:<br>
>>> >> >>><br>
>>> >> >>>> On 2010-06-10 15:01, Sascha Mäkelä <<a href="mailto:sascha.makela@gmail.com">sascha.makela@gmail.com</a>><br>
>>> >> >>>> wrote:<br>
>>> >> >>>><br>
>>> >> >>>>> Hi,<br>
>>> >> >>>>><br>
>>> >> >>>>> I just made a Debian package of my app. I'm using QtSql in it.<br>
>>> >> >>>>> But<br>
>>> >> >>>>> for<br>
>>> >> >>>>> some<br>
>>> >> >>>>> reason when I install the package, all the SQL things don't work.<br>
>>> >> >>>>> My<br>
>>> >> >>>>> guess<br>
>>> >> >>>>> is that I'm missing something in the Build-Depends line in the<br>
>>> >> >>>>> control<br>
>>> >> >>>>> file.<br>
>>> >> >>>>> How can I check what libs I need to add there and what are their<br>
>>> >> >>>>> correct<br>
>>> >> >>>>> names?<br>
>>> >> >>>>><br>
>>> >> >>>>> Cheers,<br>
>>> >> >>>>> Sascha<br>
>>> >> >>>>><br>
>>> >> >>>>> PS. Currently it's like this: Build-Depends: dephelper (>5),<br>
>>> >> >>>>> libqt4-dev,<br>
>>> >> >>>>> libqt4-network<br>
>>> >> >>>>><br>
>>> >> >>>><br>
>>> >> >>>> You need to add the relevant Qt SQL provider packages to the<br>
>>> >> >>>> ‘Depends:’<br>
>>> >> >>>> line, not the ‘Build-Depends:’ line, as the SQL providers are<br>
>>> >> >>>> plugins<br>
>>> >> >>>> that<br>
>>> >> >>>> are not required at build time, but at runtime. You probably want<br>
>>> >> >>>> libqt4-sql-mysql or libqt4-sql-sqlite in Depends, depending on<br>
>>> >> >>>> which<br>
>>> >> >>>> database provider you are using.<br>
>>> >> >><br>
>>> >> >> --<br>
>>> >> >> David King | <a href="http://amigadave.com/" target="_blank">http://amigadave.com/</a><br>
>>> >> >> _______________________________________________<br>
>>> >> >> maemo-developers mailing list<br>
>>> >> >> <a href="mailto:maemo-developers@maemo.org">maemo-developers@maemo.org</a><br>
>>> >> >> <a href="https://lists.maemo.org/mailman/listinfo/maemo-developers" target="_blank">https://lists.maemo.org/mailman/listinfo/maemo-developers</a><br>
>>> >> ><br>
>>> >> ><br>
>>> >> > _______________________________________________<br>
>>> >> > maemo-developers mailing list<br>
>>> >> > <a href="mailto:maemo-developers@maemo.org">maemo-developers@maemo.org</a><br>
>>> >> > <a href="https://lists.maemo.org/mailman/listinfo/maemo-developers" target="_blank">https://lists.maemo.org/mailman/listinfo/maemo-developers</a><br>
>>> >> ><br>
>>> >> ><br>
>>> ><br>
>>> ><br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>