The Following 6 Users Say Thank You to Bundyo For This Useful Post: | ||
|
2016-05-08
, 07:22
|
|
Posts: 270 |
Thanked: 610 times |
Joined on Nov 2007
@ Leipzig/Germany
|
#3
|
The Following User Says Thank You to seiichiro0185 For This Useful Post: | ||
|
2016-05-08
, 19:25
|
|
Posts: 4,708 |
Thanked: 4,649 times |
Joined on Oct 2007
@ Bulgaria
|
#4
|
|
2016-05-08
, 22:28
|
|
Posts: 4,708 |
Thanked: 4,649 times |
Joined on Oct 2007
@ Bulgaria
|
#5
|
|
2016-05-09
, 05:50
|
|
Posts: 4,708 |
Thanked: 4,649 times |
Joined on Oct 2007
@ Bulgaria
|
#6
|
|
2016-05-09
, 13:15
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#7
|
Added sources and the Go 1.6 patch.
Btw, I have an issue with the SilicaGridView - the model changes underneath and the changes propagate to the QML, but sometimes the QML elements inside the delegate don't change their visibility until you scroll out of the view and then return. The GridView forceLayout method doesn't seem to help much and seems like a rendering bug. Any ideas?
ListModel { id: model } Connections { target: bridge onImageStatusChanged: model.setProperty(index, "status", status) // 'index' and 'status' (e.g 'Downloading' or 'Downloaded') are signal parameters }
.... model: bridge.fileList delegate: Item { someProperty: modelData.downloading otherProperty: modelData.downloaded }
The Following User Says Thank You to marxian For This Useful Post: | ||
|
2016-05-10
, 04:31
|
|
Posts: 4,708 |
Thanked: 4,649 times |
Joined on Oct 2007
@ Bulgaria
|
#8
|
Your data model is not updated when the image status changes, so these status changes will not be reflected in the delegate, and you are using a function call that depends on the index only, so the function will only be re-evaluated when the index changes.
To fix this, you could use either QAbstractItemModel or QML ListModel and either have the bridge update the model when the image status changes, or use signal/slot connections, e.g:
EDIT: Another possible solution is to use the array of images as the model, then you could bind to the 'dowloading' property via 'modelData', e.g:Code:ListModel { id: model } Connections { target: bridge onImageStatusChanged: model.setProperty(index, "status", status) // 'index' and 'status' (e.g 'Downloading' or 'Downloaded') are signal parameters }
Code:.... model: bridge.fileList delegate: Item { someProperty: modelData.downloading otherProperty: modelData.downloaded }
|
2016-05-12
, 06:36
|
|
Posts: 4,708 |
Thanked: 4,649 times |
Joined on Oct 2007
@ Bulgaria
|
#9
|
The Following User Says Thank You to Bundyo For This Useful Post: | ||
Thanks to Nekron for the Go-QML Sailfish OS port.
Warning: Test on your own responsibility.
Packages:
https://openrepos.net/content/bundyo/troll-bridge
Source:
https://github.com/bundyo/trollbridge
Warning: The app was built using Go 1.6, but with the current Nekron port it will crash on engine.AddImageProvider. To get it working, use the unsafe_ref.patch in the patches folder to patch your Go 1.6 package. Didn't test building it with Go !.5.
Pull requests are welcome.
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
Last edited by Bundyo; 2016-05-20 at 20:55.