summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7Martin Jones2010-03-252-1/+20
|\ | | | | | | | | Conflicts: src/declarative/graphicsitems/qdeclarativeitem.cpp
| * Add a function to get the transitions available from a stateKent Hansen2010-03-222-1/+20
| | | | | | | | | | | | | | | | For introspection purposes. It's nicer than having to qobject_cast the state's children(). Task-number: QTBUG-7741 Reviewed-by: Eskil Abrahamsen Blomfeldt
* | Reset history states when (re)starting state machineKent Hansen2010-03-222-0/+13
|/ | | | | | | | State saved in QHistoryState should not be persistent between state machine starts/stops. Task-number: QTBUG-8842 Reviewed-by: Eskil Abrahamsen Blomfeldt
* Update copyright year to 2010Jason McDonald2010-01-0624-24/+24
| | | | Reviewed-by: Trust Me
* doc: Removed a const from a declaration in the example.Martin Smith2010-01-041-1/+1
| | | | Task-number: QTBUG-7092
* Export QStateMachine::WrappedEvent and QStateMachine::SignalEventEskil Abrahamsen Blomfeldt2009-11-181-2/+2
| | | | | | | | 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
* Don't crash in QStateMachine when event transition listens toEskil Abrahamsen Blomfeldt2009-11-051-3/+2
| | | | | | | | | | QApplication instance We can't assert on actually watching the watched object, since we may have installed an event filter on QApplication::instance(), in which case we will filter events for all objects. Reviewed-by: Gunnar
* Merge branch 'statemachine-api-changes' into 4.6Eskil Abrahamsen Blomfeldt2009-11-036-36/+41
|\ | | | | | | | | | | Conflicts: doc/src/frameworks-technologies/statemachine.qdoc src/corelib/statemachine/qstatemachine.cpp
| * Rename QState::polished() signal to "propertiesAssigned"Eskil Abrahamsen Blomfeldt2009-11-034-11/+17
| | | | | | | | | | | | | | | | | | "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
| * Remove return type of QState::addTransition(QAbstractTransition*)Eskil Abrahamsen Blomfeldt2009-11-032-9/+8
| | | | | | | | | | | | | | | | | | 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
| * Change name of DoNotRestoreProperties enum to DontRestorePropertiesEskil Abrahamsen Blomfeldt2009-11-032-5/+5
| | | | | | | | | | | | | | Using the abbreviated "Dont" is consistent with other negated enum names in Qt. Reviewed-by: Kent Hansen
| * Change name of QStateMachine::animationsEnabled property to "animated"Eskil Abrahamsen Blomfeldt2009-11-033-11/+11
| | | | | | | | | | | | | | The name "animated" is consistent with naming in Qt otherwise, as in QTreeView::animated and QMainWindow::animated. Reviewed-by: Kent Hansen
* | Introduce internal StateType to avoid excessive qobject_castsKent Hansen2009-10-307-25/+80
|/ | | | | | | | | | The state machine algorithm frequently needs to know what type a state is, e.g. if it is atomic, final or a history state. We were using qobject_cast() to determine this, but that function is expensive. This commit introduces an internal StateType to be able to differentiate between the different types of state. This vastly improves performance. Reviewed-by: Eskil Abrahamsen Blomfeldt
* Cache a state's parent stateKent Hansen2009-10-292-2/+8
| | | | | | | | | | | | | 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
* doc: Remove \internal tag from QStateMachine::configuration()Kent Hansen2009-10-291-2/+0
| | | | | | | | This function is useful for debugging, if nothing else, and has been requested by users. We also refer to it in one of our blog posts, so there's little point in trying to hide it any longer. Reviewed-by: Eskil Abrahamsen Blomfeldt
* Make QStateMachine event posting functions thread-safeKent Hansen2009-10-292-17/+83
| | | | | | | | 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
* Cache QState's child statesKent Hansen2009-10-292-10/+17
| | | | | | | | | | | | | This is the same type of optimization as that done for transitions in commit 5d8dcd57cd13fdd9c8643fa3bdda9f197a4351ff. The idea is to avoid calling qobject_cast() because it's very expensive. Obtaining child states needs to be as fast as possible because it's in the critical path of the state machine algorithm; it's called by a ton of internal functions, like isCompound(), isAtomic(), isInFinalState(). It's also called heavily for parallel state groups. Reviewed-by: Eskil Abrahamsen Blomfeldt
* QStateMachine::event() should call QState::event()Kent Hansen2009-10-291-1/+1
| | | | | | Since QStateMachine inherits QState now. Reviewed-by: Eskil Abrahamsen Blomfeldt
* Greatly improve the performance of obtaining a state's transitionsKent Hansen2009-10-282-8/+17
| | | | | | | | | | | | | | | | | | | Transitions are children of their source state. We use QObject::children() and qobject_cast() each child to a QAbstractTransition to see if it is indeed a transition. However, calling qobject_cast() is very expensive. This commit introduces a cached list of transitions. The list is invalidated after a child object has been added or removed. In the typical case we expect the object hierarchy to remain fairly constant once the state machine has been started (states, child states and transitions are usually "static"), in other words the cached list is not likely to be invalidated much. Obtaining a state's transitions needs to be as fast as possible because it's in the critical path of the state machine algorithm. Reviewed-by: Eskil Abrahamsen Blomfeldt
* add missing includeKent Hansen2009-10-061-0/+1
| | | | Necessary since the SignalEvent class was moved to qstatemachine.h.
* Add prefix to statemachine-specific event typesKent Hansen2009-10-023-5/+5
| | | | | | "Signal" and "Wrapped" is too generic; prefix with StateMachine. Reviewed-by: Eskil Abrahamsen Blomfeldt
* Make sure delayed events are cancelled when a state machine haltsKent Hansen2009-09-292-0/+21
| | | | | | | Otherwise the events might creep into the event loop if the state machine is restarted. Reviewed-by: Eskil Abrahamsen Blomfeldt
* Introduce state machine event priority, make it possible to cancel eventsKent Hansen2009-09-292-20/+89
| | | | | | | | | | | | 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
* Do synchronous processing of events in state machine if possibleKent Hansen2009-09-292-13/+40
| | | | | | | | 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
* doc: Describe the semantics of targetless state machine transitionsKent Hansen2009-09-291-0/+4
|
* Make QSignalEvent and QWrappedEvent inner classes of QStateMachineKent Hansen2009-09-287-207/+72
| | | | | | | | | 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
* Replacing QPointer usage with QWeakPointer in statemachineLeonardo Sobral Cunha2009-09-253-7/+7
| | | | Reviewed-by: thierry
* Update license headers again.Jason McDonald2009-09-0926-104/+104
| | | | Reviewed-by: Trust Me
* Doc: Added a note that a state machine requires a running event loop.David Boddie2009-09-071-31/+11
| | | | Reviewed-by: Trust Me
* fix warnings on mingwThierry Bastian2009-09-021-8/+6
|
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-3125-325/+325
| | | | Reviewed-by: Trust Me
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
* Q_ASSERT failure in QStateMachinePrivate::handleTransitionSignal.Gabriel de Dietrich2009-08-285-1/+30
| | | | | | | | | | | | | | 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
* Merge commit 'qt/master'Jason Barron2009-08-212-6/+6
|\
| * rename QEventTransition::eventObject to eventSourceKent Hansen2009-08-212-6/+6
| | | | | | | | | | | | eventObject was a horrible name. The documentation already used the term "event source", so let's call it that. Agreed with Eskil.
* | Merge commit 'qt/master'Jason Barron2009-08-201-0/+2
|\ \ | |/ | | | | | | | | | | | | Conflicts: examples/painting/svgviewer/files/bubbles.svg src/corelib/kernel/qobject.cpp src/network/kernel/qhostinfo.cpp tests/auto/qhostinfo/tst_qhostinfo.cpp
| * Remove a few warnings when compiling Qt and unexport some functions.Thiago Macieira2009-08-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | Make some functions static that are not used anywhere but in the current file. Others that are used, add the declaration to the _p.h to ensure we don't forget about them. Finally, there's no need to enable debugging code if it's not used anywhere. Reviewed-by: TrustMe
* | Merge commit 'qt/master'Jason Barron2009-08-1326-30/+29
|\ \ | |/ | | | | | | | | | | | | | | | | | | 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
| * Update contact URL in license headers.Jason McDonald2009-08-1226-26/+26
| | | | | | | | Reviewed-by: Trust Me
| * fix issues reported by CoverityKent Hansen2009-08-103-4/+3
| |
* | Rename Q_DECLARE_SCOPED_PRIVATE back to Q_DECLARE_PRIVATEHarald Fernengel2009-08-068-8/+8
| | | | | | | | | | | | Rationale: We're using template magic now to get the private pointer in qglobal.h, so no need to have two macros. Also keeps backward compatibility with outside (KDE) code.
* | Merge commit 'origin/master'Jason Barron2009-08-048-8/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/kernel/qmetatype.cpp src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/gui/graphicsview/qgraphicssceneevent.h src/gui/itemviews/qheaderview.h src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qgesture.h src/gui/kernel/qgesturerecognizer.h src/gui/painting/qpaintengine_raster.cpp src/network/access/qhttpnetworkreply.cpp src/network/access/qnetworkcookie.h src/network/socket/qnativesocketengine_unix.cpp
| * | Squashed commit of the topic/exceptions branch.Harald Fernengel2009-08-038-8/+8
| | | | | | | | | | | | | | | Contains some smaller fixes and renaming of macros. Looks big, but isn't scary at all ;)
* | | Merge commit 'qt/master-stable'Jason Barron2009-08-0410-95/+111
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/openssl/openssl.pri demos/embedded/embedded.pro examples/itemviews/chart/chart.pro examples/network/network.pro examples/painting/painterpaths/painterpaths.pro examples/threads/mandelbrot/mandelbrot.pro qmake/project.cpp src/3rdparty/libtiff/libtiff/tif_config.h src/corelib/arch/arch.pri src/corelib/global/qglobal.cpp src/corelib/kernel/kernel.pri src/corelib/kernel/qcore_unix_p.h src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/corelib/tools/qsharedpointer_impl.h src/corelib/tools/tools.pri src/gui/kernel/qaction.h src/gui/kernel/qapplication.cpp src/gui/painting/qregion.h src/gui/widgets/qlineedit.cpp src/gui/widgets/qlineedit_p.h src/network/socket/qnativesocketengine_unix.cpp tests/auto/qdir/tst_qdir.cpp tests/auto/qdiriterator/tst_qdiriterator.cpp tests/auto/qhttp/qhttp.pro tests/auto/qline/qline.pro tests/auto/qnetworkreply/tst_qnetworkreply.cpp tests/auto/qresourceengine/qresourceengine.pro tests/auto/qsharedpointer/qsharedpointer.pro tests/auto/qstring/qstring.pro tests/auto/qtcpsocket/qtcpsocket.pro tests/auto/qtcpsocket/tst_qtcpsocket.cpp
| * | export QStateMachinePrivate symbolsKent Hansen2009-08-031-6/+2
| | | | | | | | | | | | | | | 1) it's needed for the Declarative UI integration and 2) it hopefully fixes the build on Windows.
| * | remove constructors that are not usefulKent Hansen2009-08-038-82/+8
| | | | | | | | | | | | | | | | | | | | | 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.
| * | Export symbol used in QtGui.Volker Hilsheimer2009-07-311-1/+5
| | | | | | | | | | | | Reviewed-by: Kent Hansen
| * | compileKent Hansen2009-07-311-1/+1
| | | | | | | | | | | | | | | Broke on WinCE since QStateMachinePrivate is now using Q_AUTOTEST_EXPORT.
| * | add private goToState() function to state machineKent Hansen2009-07-312-7/+97
| | | | | | | | | | | | Needed for Declarative UI integration.
| * | remove const from QSignalEvent::sender*Kent Hansen2009-07-313-6/+6
| | | | | | | | | | | | | | | QObject::sender() does not return const QObject*, so neither should this API; it just forces you to const_cast for no good reason.