260 views
in Embedded Wizard Studio by
Good Day to all.

You guys have been amazing answering my questions. i am going to push my luck even further and ask another question.

I was not able to create a delay type operation inside a slot or method.

For a simple example change a variable without using bool effect or int effects.

method

variable = true

wait for 10 second

variable = false

i know i can use a timer or effects but there were some specific cases where i had to do delay inside same method or wait halway into a slot.

Thank you.

1 Answer

+1 vote
by
 
Best answer
Hello,

as you already know, you can use a timer to trigger a certain action with a delay of 10 sec. This is the right approach to do that.

There is no possibility to make a delay of 10 sec within a method - and there are good reasons for that: Please consider, that a simple delay within a method would cause a blocking of the entire GUI application for that time period. No user inputs are processed during this time and all animations are blocked for that time span...

Due to the fact that the entire GUI application is running in a cooperative model, the processing of the main loop should not be blocked.

I hope this helps....

Best regards,

Manfred.
by
Hello and thank you.

yes i thought so too. even the smallest delay would block the main loop and all other stuff like animations and device communication. So that is probably not possible.

is it possible to do something like this?

my method

      do some stuff..

      postsignal Slot, wait for slot to finish and get a            variable from there

       contunie to do some other stuf in first method             and maybe use the variable from slot in my method.
by

Hello,

there are several possibilities.... You can call a method in order to process some data and to return a value or you signal a slot method and store the result in a variable. Depending on the use-case.

In case you want to trigger a certain action after the next screen update has happened, you can use idlesignal.

Best regards,

Manfred.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...