Could you please provide an example on how to use - let´s say the event “block.scriptAdaptor.eventItemClicked()” ?
In which scopes I can use the properties of the widgets? - in an “Item{}” ?
How can I access the properties of widgets like “text” for the article or the images for the gallery, filename for a moviefile?
A while ago you sent me the “drag_widgets.pma” (see attachment) as an example for constraining widgets position. The green “Drag me”-article-widget can be moved, the others follow. This works fine in the Designer when I drag the article with the mouse (allthough with a small delay because of the TIMER).
On my Touch-Device (SUR40) this works also, but:
When I touch with ONE finger, I can see the touch-trail but nothing happens, the widget can´t be moved. With TWO fingers the widget can be moved. While moving I can release one finger and moving still happens with the one remaining finger. Why does this happen?
The next problems which emerged are: Many properties of “widget” are NOT
ACCESSIBLE!!
For example: (Script in a Gallery-Widget, Interaction-Tab, User Code)
import QtQuick 2.0
Item
{
Component.onCompleted:
{
console.log(block.width)
console.log(block.style.blockOpacity)
}
}
CONSOLE OUTPUT:
200
a591b88c896837639a45ba348590e9fd.qml:9: TypeError: Cannot read property
‘blockOpacity’ of undefined
This also happens for “blockBackgroundMedia” and many other properties!!!
ALSO currentPage.childCount is undefined!! - So I can´t iterate through the
page!
BTW: Is there a method to access a widget from an other widget (not using the
hardcoded name like page.getBlockByName(“name”) (which is not described in your
doc), but like block.GetNext() / block.GetPrev() ??
PLEASE ALSO ANSWER my questions I´ve asked in my last two mails concering
ONE/TWO-touch problem (WHICH IS A MAIN PROBLEM!!!), how to implement and to use
Events (eventItemPressed, eventItemClicked) AND to access properties like the
text of an Article-Widget, the NAME of a widget (block.name ??->undefined),
MovieFilename etc.etc. => PLEASE READ MY LAST TO MAILS BELOW!
In your last answer, you wrote “All scripts are called every time a certain
event is triggered.”
- Scripts in the Inspector (Interaction-Tab)?
- WHAT certain events, how to implement, how to use, in which scopes (“Item{}”)
???
Other important question: How can I start an animation (opacity, scale,
position) from script??