For now I want to show you what I´m planning and what my needs are, this is my
(test-)setup:
1.) A Gallery-Widget “but_toggle_fixed” with a backgroundImage, used as a
“button” for the “main”-widget (could be gallery, movie etc.)
User-Script:
import QtQuick 2.0
Item
{
Component.onCompleted: //** On Initialisation I want to read INI-Data
from a Reference-Object (in this case
//**
Backgroundmedia=Button-Image)
{
var ref=page.getBlockByName("ref_close") //** Reference widget - the
same for all "Buttons" in the project
blockData.style.blockBackgroundMedia=ref.blockData.style.blockBackgroundMedia
//** works, image is taken
}
MultiPointTouchArea { //** When this “Button” is touched:
Perform some Action with the “main”-widget
anchors.fill: parent
onReleased:{
var b_gal=page.getBlockByName(“gal”) //** The “main”-widget, in
this case another gallery with some pictures in it
//b_gal.blockData.fixed=!b_gal.blockData.fixed //** For this “button”, the
action should be to toggle the “main”-widgets-
//** fixed-property, to enable draging or
interactive sliding through
//**
the gallery. BUT THE FIXED-property IS READONLY !!!
}}}
2.) A Gallery-Widget “gal” with some Pictures in it
User-Script:
import QtQuick 2.0
Item
{
x:{
var b_t_f=page.getBlockByName(“but_toggle_fixed”) //** Reference to the
button above
b_t_f.blockData.x=blockData.x //** Constrain Position
(additional y-pos, scale, rotation)
}} //** This constrain works
better than your timer-example because of no delay
So my questions are:
-
Do you have the possibility to make the Readonly-properties (fixed for
example) of widgets also writeable? If not, how could I achieve the effect I
want? (in this case, switch between draging and interaction) -
What´s the difference between “block.x” and “blockData.x”?
Is it correct that the QML Item.x (block.x) is in pixels, blockData.x is
relative to the Project-Width? Should block.x ever be used?
Is it correct that blockData.width ist always constant, only the blockData.scale
changes? -
Is it correct to constrain in the x:{} scope?
-
With the action-methods (actionSetScale(), actionSetOpacity()) the action
comes immediately with NO animation.
How can I achieve an animation for Position, Opacity, Rotation etc.etc.?
I want to avoid the Action-Editor (every single widget has to be done extra…)
and script everything in the User-script in the Inspector. Would be a SENSATION
to have a timer-parameter for the function, e.g. actionSetOpacity(newOpacity,
timeinmsec)
How else could I achieve an animation in the User-Script?
How can I work with events in the User-Script? => eventItemPressed() instead of
MouseArea or MultiPointTouchArea, also avoiding the Action-Editor? -
What are the properties for the widget settings (movie: Autoplay, Loop, Mute,
VideoFileName / and all other widgets)??
So, if I would know the answers to all my questions above, everything would be
fine!!!