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

Reply via email to