On 23/04/2020 09:51, Michael Fuchs wrote:
> How can AlbumList access mImgDB and mNetAccess?
> 
> One solution could be to register the controller itself in qml and then write
> sth like this in qml:
> 
> ====
> AlbumList {
>   imgDB: controller.imgDB
>   netAccess: controller.netAccess
> }
> ====
> 
> but it's redundant.

This doesn't look like a bad approach to me (although passing the
controller itself might be cleaner).

An alternative might be to make Controller a singleton, that way your
AlbumList class could access it from the C++ without needing to be
explicitly passed a handle to it.

But whether you can do that depends on the how Controller is used.

David
-- 
Website: https://www.flypig.co.uk
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to