question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implementation of Behavior on

See original GitHub issue

Currently the implementation of Behavior is written as special case in generator code.

Behavior on <property> { }

However, this make it impossible to implement component like(Binding on x) in qml, instead I should

Binding {
  target: parent;
  property: "x";
  when: btn.pressed;
  value: 100;
}

It would be handy to add syntax sugar. When XX on x {} syntax, it dynamically bind parent to target and x to property and those two cannot be changed.

This is only my opinion, I still has ways to workaround though.

by the way, what do you think “supporting multiple properties at once”

Behavior on x,y,z {
  Animation { duration: 1000; }
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
whoozlecommented, Dec 2, 2019

Behavior on [property list] is perfectly fine now, consider the following example:

Item {
	anchors.fill: context;

	Rectangle {
		id: r1;
		border.width: 1;
		border.color: "black";
		color: "#0000";
		width: 10;
		height: 10;
	}

	Rectangle {
		id: r2;
		border.width: 1;
		border.color: "black";
		color: "#0000";
		width: 10;
		height: 10;
	}
	Timer {
		running: true;
		repeat: true;
		interval: 1000;
		onTriggered: {
			r1.x = r1.x !== 100? 100: 0;
			r2.y = r2.y !== 100? 100: 0;
		}
	}

	Behavior on r1.x, r2.y {
		Animation { duration: 200; }
	}
}
1reaction
tim37021commented, Dec 2, 2019

my pleasure, actually I am pretty glad when I found this project is very active.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Measuring determinants of implementation behavior ...
Measuring determinants of implementation behavior: psychometric properties of a questionnaire based on the theoretical domains framework.
Read more >
Implementing Behavioral Strategies: Considerations and ...
This set of behavioral strategies was developed for classroom teachers to use with students who may require academic and/or behavioral support. The strategies ......
Read more >
The most effective way to implement a behavior change
So what does it take to commit to real behavior change? Let's look at two of the most popular methods: social pressure and...
Read more >
On the Implementation of Behavior Trees in Robotics - arXiv
There is a growing interest in Behavior Trees (BTs) as a tool to describe and implement robot behaviors.
Read more >
Steps for Implementation: Functional Behavior Assessment
& Bogin, J. (2008). Steps for implementation: Functional behavior assessment. Chapel Hill, NC: The National Professional Development Center on Autism Spectrum.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found