Questions tagged [qstatemachine]

QStateMachine is based on the concepts and notation of Statecharts. QStateMachine is part of The State Machine Framework.

A state machine manages a set of states (classes that inherit from QAbstractState) and transitions (descendants of QAbstractTransition) between those states; these states and transitions define a state graph. Once a state graph has been built, the state machine can execute it. QStateMachine's execution algorithm is based on the State Chart XML (SCXML) algorithm. The framework's overview gives several state graphs and the code to build them.

52 questions
2
votes
2 answers

QStateMachine immediate transition from dummy state

In order to set an object property depending on a transition I need two intermediate states that immediately transition further: A initial state Ta Tb different transitions Aa Ab (these are only used to set an objects property…
handle
  • 5,859
  • 3
  • 54
  • 82
2
votes
1 answer

Unable to start state and transition between states: receiving various errors

I'm having some trouble with the Qt State Machine. I'm never able to execute the states: I get various types of errors and I can't figure out what is the problem. Please see below for more information on the errors and the code that leads to…
Kiril
  • 39,672
  • 31
  • 167
  • 226
1
vote
1 answer

QStateMachine is not emitting started() signal in release mode

I am using QStateMachine framework for a device controller class. It works fine in debug mode. But, in the release mode QStateMachine::started() signal is not being emitted. A simple widget project for the problem (form is empty) is below. Qt…
Huzeyfe E.
  • 21
  • 7
1
vote
1 answer

Is there a way to pass signal arguments through QStateMachine QState transitions?

For example, let's say I have some QButtonBucket class containing some number N QPushButtons within it, and I want pushing any of those buttons to cause a transition from some state to another. This is simple enough: for button in…
Connor Spangler
  • 805
  • 2
  • 12
  • 29
1
vote
1 answer

QStateMachine procedural transition (i.e. Signal)

I need to be able to change state of a QStateMachine from a Signal (or something equivalent) that was not generated by user interaction (i.e. by a process completing). This example redirectsa user generated signal to demonstrate the idea, but…
Mark
  • 672
  • 1
  • 6
  • 19
1
vote
0 answers

QState: Change action when QPushbutton is clicked

After reading about finite state machines I found the the QState/QStateMachine API in QT. But now I can't find out how to use it to run different code based on which state I'm currently in. Let's take the following example: import sys from PySide2…
rmweiss
  • 716
  • 1
  • 6
  • 16
1
vote
1 answer

C++ type is not supported as a pyqtSignal() type argument type

I'm trying to implement a state machine in my GUI (using python3.8 and Qt5 (using PyQt5 and not PySides!)). The problem I encounter with this is when adding a transistion based on an event. Using the code below, the interpreter complains at line…
Swedgin
  • 815
  • 1
  • 11
  • 20
1
vote
0 answers

QStateMachine with dynamic transitions

I have an application where the UI is driven by a QStateMachine and some of the states can be described as "non interruptible" : once they are entered, the user has to interact with the UI and when it's done then the state can be exited but the…
Fryz
  • 2,119
  • 2
  • 25
  • 45
1
vote
1 answer

Custom PyQt signal never received by QSignalTransition subclass

Trying to learn PyQt5 QStateMachine with transitions derived from QSignalTransition following this example written for PySide. To use PyQt I just changed the definition of the signal, and the way it is referenced in QSignalTransition initializer.…
mins
  • 6,478
  • 12
  • 56
  • 75
1
vote
1 answer

Synchronise QStateMachine

I have a class whose internal state determines the layout in a QML file. Now this internal state is mostly determined by a state machine. However part of it is not determined by the state machine, but instead relies on other member variables to be…
Frank
  • 2,446
  • 7
  • 33
  • 67
1
vote
1 answer

How can I detect ignored/rejected posted QEvent to QStateMachine

I need to see if a custom posted event to the state machine was accepted or not. My approach is to subclass QStateMachine. See http://doc.qt.nokia.com/latest/statemachine-api.html section Events, Transitions and Guards I'm wondering is there is not…
Derick Schoonbee
  • 2,971
  • 1
  • 23
  • 39
1
vote
1 answer

Use QState.assignProperty with dynamic values at runtime

I have a question to using the QStateMachine-System of PyQt5 properly. Using State.assignProperty(aLineEdit, "plainText", "Some text") allows to set "Some text" to the plainText-property whenever aState is active. Question: What if "Some text" is…
user6205205
1
vote
2 answers

How to use QStatemachine to influence a ListView?

I have got this Projekt which uses a QStatemachine to manage the UI, where I want to add a customized List. The UI is supposed to be only manipulated by key events. As far as I understand I need a ListView on the qml side. The delegate of ListView…
user1997675
  • 144
  • 1
  • 10
1
vote
1 answer

QStateMachine addTransition for signals with params

What is the best and short way to inplace addTransition on signal with params (c++/c++11): QCheckBox checkBox; QStateMachine machine; QState *s1 = new QState(); QFinalState *s2 = new QFinalState(); s1->addTransition(&checkbox,…
fl-web
  • 462
  • 5
  • 16
1
vote
1 answer

QStateMachine how to show and hide QGraphicsView and QObject in different QState

this is my simple code: I've created a new scene, view and QPixmapItem QGraphicsScene *scena = new QGraphicsScene(); QGraphicsPixmapItem *object1= new QGraphicsPixmapItem(); object1->setPixmap(QPixmap(":/prova/prova.png")); QGraphicsView *view =…