Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Add transition state machine
Forum Updated to NodeBB v4.3 + New Features

Add transition state machine

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 800 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lukigno
    wrote on last edited by
    #1

    I implemented a three state machine and declared a function that change the current state of the machine: void changeState(s1); that contains the following command in order to change machine state:

    @s0->addTransition(s1) @

    because I don't have any sender and receiver.
    When I compile it no error appears, but when I run the application the following message appears:

    QObject::setParent: Cannot set parent, new parent is in a different thread

    Shall I necessarily connect the transition to a signal? If yes how can I do it?

    Thanks a lot for your help.

    Luca

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi Luca,

      The runtime error you show means that the new parent was created in a different thread than current one.

      Related to your code, this means that s0 was created in a Thread and the addTransition call is done in a different one.

      Could you post your code?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved