Re: [SailfishDevel] what lib is missing?

2015-11-03 Thread Alexander Ladygin
resolved

Additionally you need to add this to the harbour-.pro:
QT += dbus

This to the harbour-.yaml:
- Qt5DBus


On Tue, Nov 3, 2015 at 7:48 PM, Alexander Ladygin  wrote:

> Hello!
>
> When trying to build an app which uses QtDBus in c++, QTCreator gives an
> error
> file not found /srv/mer/targets/SailfishOS-i486/usr/lib/libQt5DBus.so.5
> error adding symbols: DSO missing from command line
>
> i;ve checked installed libs on mersdk, and everything seems to be ok,
> qt5-qtdbus is present, and also bunch of other dbus libs
>
> Any ideas? Anything else i need to specify in order to use QtDBus?
>
> Alex.
>
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

[SailfishDevel] QSqlTableModel and running several remorses

2015-11-03 Thread François K .
Hi,

I've stumbled upon something very annoying :

I have a model that inherits from QSqlTableModel. A SilicaListView shows the 
data. This is very easy to do, thanks to Qt/QML :)

Each list item has a ContextMenu with a "Delete" entry that allows the user to 
delete the item. It runs a remorse, and, at the end of the remorse, the item is 
deleted from the model (and the database).
Again, this works quite well... until you try to delete several items at the 
same time

A QSqlTableModel can have 3 different edit strategies : OnManualSubmit, 
OnRowChange or OnFieldChange.

If I set it to "OnManualSubmit", the item is deleted from the model, but it 
remains in the view and in the database until I call 
QSqlTableModel::submitAll(). This method actually commits the changes to the 
database, and resets the model by calling QSqlTableModel::select(). Since the 
model is resetted, it loses all other running remorses and causes a segfault.

If I set it to "OnFieldChanged", the item is deleted from the model and from 
the database, but it will still remain visible in the view. According to the Qt 
doc, I should call select() to update the view. But, as we've seen before, this 
destroys the other running remorses and also causes a segfault.


I've made a very small app to demonstrate the problem, you can get it here and 
try it in your emulator : git clone https://github.com/Frzk/dummy.git
You can use the PullDownMenu to switch between OnManualSubmit and 
OnFieldChanged strategies.



How should I deal with this ? This is a very simple case, yet I can't seem to 
find a solution :(



All the best,

-- 
François
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org