Can you make the readonly-properties of widgets also writeable?

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:

  1. 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)

  2. 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?

  3. Is it correct to constrain in the x:{} scope?

  4. 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?

  5. 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!!!

  1. The new version contains a fix for the read only properties: https://s3-us-west-2.amazonaws.com/promultitouch/promultitouch_designer_1.5.1205.16.exe

  2. The block is a QML interface object, the blockData is a model for it. Always use only the blockData. Yes, blockData.x is relative to the project width. blockData.scale works with texture, not with the content.

  3. A better way to bind properties:
    import QtQuick 2.0

    Item
    {
    Connections {
    target: blockData
    onXChanged: {
    page.getBlockByName(“but_toggle_fixed”).blockData.x=blockData.x
    }
    onWidthChanged: {
    page.getBlockByName(“but_toggle_fixed”).blockData.width=blockData.width
    }
    }
    }

  4. See the updated API page for an animated actions https://docs.promultitouch.com/api/widget.html#actions and for an event using https://docs.promultitouch.com/api/widget.html#events

  5. The list of properties: https://docs.promultitouch.com/reference/inspector/widget/video_inspector.html
    blockData.delegate.autoplay = true


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.