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. QStateMachine Custom Events and Transitions
Forum Updated to NodeBB v4.3 + New Features

QStateMachine Custom Events and Transitions

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 724 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.
  • B Offline
    B Offline
    Belfix
    wrote on last edited by
    #1

    Hi,
    that is my first message here. Hello to everyone. :)

    I'm learning QtStateMachine Framework... i am not able to create a simple code
    that use (Custom events and transiotions) :
    machine.postEvent(new StringEvent("Hello"));
    0_1567967356107_2f640f07-2ab0-4b8d-b007-60c4eb03a935-image.png

    The code is posted in this link https://doc.qt.io/qt-5/statemachine-api.html# but it doesn't work... can you try and help me ? thanks :)

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi and welcome to the forum
      You are using all of it?
      Including the
      class StringTransition : public QAbstractTransition
      and so on?
      Also, the sample just shows
      QStateMachine machine;
      Make sure its not inside a function or other scope where it won't survive
      long enough to get any events. ( like inside a buttons click function)

      1 Reply Last reply
      1
      • B Offline
        B Offline
        Belfix
        wrote on last edited by
        #3

        @mrjj said in QStateMachine Custom Events and Transitions:

        class StringTransition : public QAbstractTransition

        Yes i use the class StringTransition : public QAbstractTransition

        Can you please provide me a simple example (2 simple state) with Custom events and transitions?
        Thanks a lot :)

        mrjjM 1 Reply Last reply
        0
        • B Belfix

          @mrjj said in QStateMachine Custom Events and Transitions:

          class StringTransition : public QAbstractTransition

          Yes i use the class StringTransition : public QAbstractTransition

          Can you please provide me a simple example (2 simple state) with Custom events and transitions?
          Thanks a lot :)

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Belfix
          Hi
          Have a look at this
          http://blackberry.github.io/Qt2Cascades-Samples/docs/statemachine-pingpong.html
          Its ping / pong so its as 2 state as it gets :)

          B 1 Reply Last reply
          1
          • mrjjM mrjj

            @Belfix
            Hi
            Have a look at this
            http://blackberry.github.io/Qt2Cascades-Samples/docs/statemachine-pingpong.html
            Its ping / pong so its as 2 state as it gets :)

            B Offline
            B Offline
            Belfix
            wrote on last edited by
            #5

            @mrjj Thanks a lot! I will study it :)

            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