Ubuntu Pastebin

Paste from Albert Astals Cid at Tue, 10 Feb 2015 14:49:28 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
PreviewWidgetModelInterface feeds what appears in a preview, in the mocks case 
it's implemented in fake_previewwidgetmodel.cpp where we're just returning 20 
text previews.

You're going to need to add some actions in there.

So once you make the model return some actions, PreviewWidgetFactory.qml will 
create a PreviewActions.qml.

On clicking on the PreviewAction it will emit 
triggered(root.widgetId, actionData.id, actionData), where actionData just comes 
inside widgetData["actions"] where widgetData: model.properties as set in 
Preview.qml

After that you will see that triggered goes up to Preview.qml where 
previewModel.triggered(widgetId, actionId, data); is also emitted

triggered is a signal defined in PreviewModelInterface.h so from your mock 
implementation you need to connect to that signal and in the slot emit 
openScope. For that you'll need to either emit up the triggered signal so that 
Scope in fake_scope knows or pass down the Scope throught the various 
PreviewStack/PreviewModel so the slot in fake_previewmodel.cpp has a scope to 
call openScope on. Not sure which of the two is better.
Download as text