| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
State saved in QHistoryState should not be persistent between
state machine starts/stops.
Task-number: QTBUG-8842
Reviewed-by: Eskil Abrahamsen Blomfeldt
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
| |
These two classes were missing exports. Since the accessors are inline,
the bug would only be visible when someone tried to call the
constructors of the classes.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
| |
Test for 8ec037effce7f515fffed6b05c011e385fb52593.
Reviewed-by: Gunnar
|
|
|
|
|
|
|
|
|
| |
"Polished" was never a very descriptive word, and it already has a
meaning attached in the QStyle API. Additionally, "propertiesAssigned"
has the benefit of giving the relation to the assignProperty() function
as part of the name.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
|
|
| |
Returning the input argument in a function can lead to confusion and
serves no purpose here. Instead, we'll mirror the API from
QMenu::addAction() overloads, where the overload that takes a
preconstructed object has a void return type.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
| |
Using the abbreviated "Dont" is consistent with other negated enum
names in Qt.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
| |
The name "animated" is consistent with naming in Qt otherwise, as in
QTreeView::animated and QMainWindow::animated.
Reviewed-by: Kent Hansen
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QAbstractState::parentState() is called heavily by the state machine
algorithm. The parent state is obtained by qobject_cast'ing
QObject::parent(). qobject_cast() is expensive. This commit introduces
caching of the result in order to improve performance.
We expect that the cache won't be invalidated much since the parent-child
relationship of states usually doesn't change after the state machine is
started.
Reviewed-by: Eskil Abrahamsen Blomfeldt
|
|
|
|
|
|
|
|
| |
By popular demand on the Qt Labs blog.
This makes it possible to readily use QStateMachine with e.g. worker
threads that post events to the machine.
Reviewed-by: Eskil Abrahamsen Blomfeldt
|
|
|
|
|
| |
The internal slot _q_process() should never be called if the machine is
not in the Running state.
|
|
|
|
|
| |
Now using QEventTransition with almost any type of event will
actually work, instead of causing an assert.
|
|
|
|
|
|
|
| |
Otherwise the events might creep into the event loop if the state
machine is restarted.
Reviewed-by: Eskil Abrahamsen Blomfeldt
|
|
|
|
|
|
|
|
|
|
|
|
| |
The priority specifies whether the event should be posted to what the
SCXML spec refers to as the "external" (NormalPriority) queue, or the
"internal" (HighPriority) queue.
Delayed events are now posted through a separate function,
postDelayedEvent(). That function returns an id that can be passed to
cancelDelayedEvent() to cancel it.
Reviewed-by: Eskil Abrahamsen Blomfeldt
|
|
|
|
|
|
|
|
| |
Avoid delayed scheduling in the cases where there's no need to
delay it (e.g. when the state machine intercepts a signal or event).
Task-number: QTBUG-4491
Reviewed-by: Eskil Abrahamsen Blomfeldt
|
|
|
|
|
| |
Test that the event has the right attributes.
Also improve the custom QSignalTransition test to cover all attributes.
|
|
|
|
|
|
|
|
|
| |
Those two classes are specific to the state machine framework, but
their names were so generic that we felt they were polluting the
Q-namespace. They are now QStateMachine::SignalEvent and
QStateMachine::WrappedEvent.
Reviewed-by: Eskil Abrahamsen Blomfeldt
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The signal index actually emitted was different from the signal index
registered. This was due to recent changes in the meta-object protocol, where
new indexes are being created (cloned) for signals with default parameters.
When registering the transition signal, we now look for the original (non
cloned) signal index. The transition keeps track of the user-specified signal
index, and sets it when calling onTransition.
Reviewed-by: Kent Hansen
Reviewed-by: Olivier Goffart
Task-number: 260403
|
|\ |
|
| |
| |
| |
| |
| |
| | |
eventObject was a horrible name. The documentation already used the
term "event source", so let's call it that.
Agreed with Eskil.
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
examples/opengl/samplebuffers/glwidget.cpp
src/corelib/io/qfsfileengine_unix.cpp
src/corelib/kernel/qobject.cpp
src/corelib/tools/qsharedpointer.cpp
src/gui/gui.pro
tests/auto/qhttp/tst_qhttp.cpp
tests/auto/qkeyevent/tst_qkeyevent.cpp
|
| |
| |
| |
| | |
Reviewed-by: Trust Me
|
| |
| |
| |
| |
| |
| |
| |
| | |
Apparently Nokia X86 compiler is not able to use templated qCompare
when given arguments have different different type but same base class.
This error should be isolated and reported to Nokia X86 team.
See task: 259508
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
tests/auto/qfilesystemmodel/qfilesystemmodel.pro
tests/auto/qfontdialog/tst_qfontdialog.cpp
tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp
tests/auto/qsqldriver/qsqldriver.pro
tests/auto/qsqlquery/qsqlquery.pro
tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro
tests/auto/qsqltablemodel/qsqltablemodel.pro
tests/auto/qsqlthread/qsqlthread.pro
tests/auto/qstatemachine/tst_qstatemachine.cpp
tests/auto/qtcpsocket/tst_qtcpsocket.cpp
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
The constructors that take a list of target states produce
hard-to-read code, and they're rarely useful in practice since
99% of transitions take a single target state; so it's better
to enforce that setTarget{State,States}() be used instead.
|
| |
| |
| |
| | |
Needed for Declarative UI integration.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This removes the need for a "root state" in the machine; or rather,
the machine _is_ the root state.
User code can now pass in a QStateMachine directly to the QState
constructor, instead of machine->rootState().
This also means we could get rid of the "proxying" from the machine
to the root state for things like properties (initialState et al),
finished() signal and auto-reparenting of states (the ChildAdded
event hack).
A fun little side-effect of this change is that it's now possible
to embed state machines within state machines. We can't think of
a good use case yet where you would rather embed a stand-alone
state machine (with its own event processing etc.) rather than
having just a regular nested state, but it's neat and it works.
Reviewed-by: Eskil Abrahamsen Blomfeldt
|
| | |
|
| |
| |
| |
| |
| |
| | |
It's not supported because the root state has no ancestor,
which is a requirement for the state machine's transition
selection algorithm.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
-developer-build, part 2.
Some autotests use private (unexported) code, either because they're
testing private classes or because that's the easiest way to test
the public classes. Configuring Qt with `-developer-build' is needed
for these tests.
This commit fixes the tests so configuring without `-developer-build'
only builds the tests which strictly use public API.
|
|
|
|
|
|
|
|
|
| |
Having an implicit default error state in the graph which the user
has not added is unintuitive and ugly. Rather than have a default error
state, we stop execution of the machine and print an error message when
the machine has run-time errors. If a user wishes to prevent errors
from stopping the machine, you can set one or more error states
explicitly.
|
|
|
|
|
|
| |
Formatting of pointers in sprintf() is platform dependent. Use
QString::sprintf() instead to make sure warnings match the actual
warnings emitted.
|
|
|
|
| |
Make state->addTransition(foo, SIGNAL( bar( ) ), ...) work.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
If the machine's initial state is nested, a set of states will
be entered, and we need to do the property assignments of all
of them.
|
|
|
|
|
|
| |
It's been requested by several users. Since we have
QAbstractState::{entered,exited}() signals, we should have this one
as well.
|
| |
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
| |
Just as with the QSignalTransition::signal property, this makes it
possible to use the function from language bindings (e.g. QtScript).
|
|
|
|
| |
Trying to get coverage up to 100%
|
| |
|
| |
|
|
|
|
|
|
| |
When the signal or senderObject is changed while the state is active,
the transition needs to be unregistered _before_ either property is
changed, only _then_ can it be re-registered.
|
|
|
|
|
|
| |
When the eventType or eventObject is changed while the state is active,
the transition needs to be unregistered _before_ either property is
changed, only _then_ can it be re-registered.
|
| |
|