Back when QStateMachine was changed to inherit QState, this
constructor was conveniently left out because setting the state
machine (root state) to be a parallel state group didn't actually
work. But as of commit d281aa6936,
it does work, so add the missing constructor.
Task-number: QTBUG-15430
Change-Id: I68c599baa0ef1bfc869195140cf5daf645e75b8b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
it's a tad insane to expect the user to do that
Change-Id: I75c68f2a28656c9ba2e3fabcc79718b899b29ce7
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
under extremely rare circumstances this would have actually failed
Change-Id: I4132d0f82e9f924e92e9e96f6d34451c94a67201
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
When accessing a fallback engine, we always need to call
ensureEngineAt() to make sure it's loaded.
Change-Id: Ib27e34137cfe8a3dd2b358aef3b3296a4ca52478
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
This is just for completeness of the understanding of the limitations
of private signals. There are no private signals in Qt which have
overloads.
Change-Id: Ic34c555aea360ee34beec796e597657888573da9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
In this change:
dba22bc036
we actually do not need the sync.profile change.
The header is already in QtGui - and it caused compiler warnings
when Qt/tests are compiled. The troubled includes are of type
<qstandarditemmodel.h> where Wigets are first in the include path.
Change-Id: Iff17f6ddb6c6282d41a08b53438b7aec786f12a9
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When the pushbutton is shown, it will generate both a ShowEvent and
a StateChange with active=1 (because it is a top level window).
This patch relaxes the reqirement in which order events are delivered.
Ideally the order should also relied on, but I'm not sure if that
is feasible due to differences among window managers across all
platforms.
This got provoked by codereview.qt-project.org/#change,26014
Change-Id: I96159fbb1b64f0ca8d13833d8a4c6799c655afc2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
This is the result of running util/normalize --modify
from Qt 4.7 with manual review.
Change-Id: I9229c3c52ba785194469ad51aba0c3af0c058894
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This is the result of running util/normalize --modify
from Qt 4.7 with manual review.
Change-Id: I7c9539056a4434ed10a0255152eac1781f7833be
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This is the result of running util/normalize --modify
from Qt 4.7 with manual review.
Change-Id: I4afac23e897404ac7efb5b4a89493a2c15e3c670
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Multiple calls to find_package(Qt5Core) would otherwise attempt to
create multiple targets of the same name.
Change-Id: I5639671fec66d4dd62dcce018dea5d18dcfd3dc3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
With the recent refactoring in qtdeclarative for the handling of touch
and mouse events, QQuickCanvas automatically transforms touch events in
mouse events too.
It means that since we do something similar in the platform plugin, in
the case of QQuickCanvas the mouse event is duplicated. It it fine
except that having mouse event, touch event, mouse event in that order
is likely to mess the states of some elements. It happens to be the case
for MouseArea which will discard the second mouse event in the case of a
press, and because of that not receive the other events.
By changing the order in the plugin, we ensure getting events in the
following order: touch event, mouse event, mouse event. In the case of
MouseArea, since the press event will be accepted with nothing in
between, we'll keep receiving the other events.
Note that we can't simply remove the mouse event simulation on our side,
otherwise we'd break QWidget support.
Change-Id: If08fe0d97c6d60d0f858b228a014d94bc86dcf6f
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
It's silly to call one virtual function plus one function that
walks the inheritance chain, on every signal transition connect
and disconnect, when the method offset of the internal
QSignalEventGenerator class cannot change.
Change-Id: Ic4e83bdc6ab445ea8ca00f3d8da3031250621e2f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
This is much faster than the string-based api.
Change-Id: Id7ba76aee3346dd90412ec5c8505329360aae937
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Since Qt's connections are thread-safe, QStateMachine's plumbing
around them should be thread-safe too.
Change-Id: I8ae91c2edc2d32ca4ed4258b71e5da22de30ed91
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
By default, QStateMachine lazily registers signal transitions (i.e.,
connects to the signal) when the transition's source state is
entered. The connections are established in Qt::AutoConnection mode,
which means that if the sender object lives in a different thread,
the signal processing will be queued.
But if a sender object's signal is used in an out-going transition
of the target state of the queued transition, it's possible that a
second signal emission on the sender object's thread will be
"missed" by the state machine; before the machine gets around to
processing the first queued emission (and registering the
transitions of the new state), a sender object on the other thread
could have emitted a new signal.
The solution employed here is to eagerly register any signal
transition whose sender object is on a different thread; that is,
register it regardless of whether the transition's source state is
active.
Conversely, when a machine's transitions are unregistered (i.e.,
because the machine finished), signal transitions with sender
objects on other threads should be left as-is, in case the machine
will be run again.
This doesn't solve the case where the sender object is moved to a
different thread _after_ the transition has been initialized.
Theoretically, we could catch that by installing an event filter
on every sender object and handle the ThreadChange events, but
that would be very expensive, and likely useless in most cases.
So let's just say that that case isn't supported for now.
Task-number: QTBUG-19789
Change-Id: Ibc87bfbf2ed83217ac61ae9401fe4f179ef26c24
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Split the guts of registerTransitions() into a registerTransition()
function. This allows a particular transition to be registered,
instead of walking the source state's whole list of transitions
every time.
Move the logic for determining whether a transition should be
registered to the state machine, since that's also where the actual
registration takes place.
Change-Id: I0496dee9454cd77b62cf2768942a82a96b320744
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Fix coding style, constness, m-prefix for member variables.
Change-Id: I9d75b410b398e5c3084b086b41884f2a0ddd6e5e
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Some of the transition constructors didn't call the maybeRegister()
function, causing the transitions to be ignored if they were created
when the state machine was running and the transition's source state
was active.
Added tests that cover all possible cases.
Change-Id: If1b593b127bd719e3be4e5a2e6949a780c4e97c3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
If the sender object was set, but not the signal signature, the
registration would proceed anyway, producing a strange warning like
QSignalTransition: no such signal: MyObject::
Change-Id: If0b113bdb60dd770d60b0d38d509b673e9d8c5eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
The originalSignalIndex member was not set if the signature had to be
normalized. This caused the SignalEvent passed to onTransition() to
report a signal index of -1.
Improve the signal transition tests so they check both the event
passed to eventTest() and onTransition().
Change-Id: I5331fd1944d53310b6d11eb2fd8713b80faa53a1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
There's one in corelib that has a comment
// slower due to signature normalization at runtime
I obviously didn't change that one.
This is the result of running util/normalize --modify
from Qt 4.7 with manual review.
Change-Id: I0ffb2305800a9cb746b7f8a4eb710702d64f1b92
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
This is the result of running util/normalize --modify
from Qt 4.7 with manual review.
Change-Id: I024d48cd111ab89f3fe83d9df51b188c9ad5023c
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Debao Zhang <dbzhang800@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Multiple windows can share the same backing store, which we did not
take into account. Don't ignore the window parameter in flush() to fix
that.
Change-Id: I4f98bba34d4da9134163e478cb78cab4ca0358d2
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Change-Id: Ia1719314460b9c51d6eba04ab1c43f02be1777b6
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Otherwise things like the window position and the parent/child relation
were wrong.
Change-Id: Ibe22a54f093f187e510f9c4258db2d80abe54a81
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
- Wait for accessibility events using qWait, allowing for
event processing,
- Output a verbose message if the event cannot be found.
Change-Id: Iaadbd235c15dd12bb14724e1724dd04328532a96
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
This is the result of running util/normalize --modify
from Qt 4.7 with manual review.
Change-Id: I36e54222b27f1e71eb7d89cdfc595177c8d2bdb3
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
This is the result of running util/normalize --modify
from Qt 4.7 with manual review.
Change-Id: I9dcff4e0982be616313e9f162203a21b447df64b
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Use the same trick as used for private signals in the models.
Change-Id: I4235788490cae0e3d554565621d145652dc5b0ca
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The private signals can not be used as function pointers, as
required by the new syntax, so we introduce a parameter which
can only be created privately.
Change-Id: I3d7bb8a163e764d685e8007cba831fb77e3c6855
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Moc checks for the use of the QPrivateSignal struct, which is part of
the Q_OBJECT macro and is private to each class that uses it. Moc then
generates a name of the signal which does not include the private
struct, and generates code to invoke such signals with an instance of
the private struct.
This way we can mark private signals as such and prevent them from
being emitted from subclasses or from outside of the class entirely.
The drawback to this is that it only works if the private
signal has no default arguments. However, at least in Qt, there are
no such signals.
Change-Id: Id16eadaa8d3c36a2c3b265077877f3e1d8304c84
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Add a .bin extension to the filenames to ensure that packaging scripts
treat these files as binary instead of text.
Change-Id: Ib49e2bdb93a43ddb7590cb8fc0b542a251a786f8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Type traits can not be changed durring Qt5 life time.
Change-Id: If69f65ff2113c901580afee91b11ae1b11c13a4f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The excludedirs variable doesn't work correctly when its values have
'../' in them. The solution is to use QDir::cleanPath() on each path
name before using it.
Task Nr: QTBUG-26492
Change-Id: I2db74e79cf096c1c75ab5b10877320360c016fc7
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Add missing runtime for OS X version in constructor. This ended up in a
crash when starting a version compiled on 10.7 on 10.6.
Change-Id: I25c5562ee905317554e79d83a2f5236ce9e2a145
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Replace a list of QFuture<void>s and a loop that calls waitForFinished()
on each of them with a QFutureSynchronizer<void>, which does exactly that.
Change-Id: I1f2e90169a5b2949bd8cb9d1009a5a7af1500139
Reviewed-by: David Faure <faure@kde.org>
The SCXML spec had a bug that would cause the initial state of a
compound state within a parallel state group to be entered even if
the transition specified another (non-initial) state of the compound
state as its target. This only happened if the transition had
multiple target states.
The bug has been fixed in recent revisions of the SCXML spec. This
commit implements the fix, which is to walk the ancestors of the
transition's target states only after all the target states
themselves have been added, so that the default initial states are
correctly overridden/ignored.
Task-number: QTBUG-25958
Change-Id: Iac532047678c483a4a3996e24dacf30e00f6bbe0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
The lca variable doesn't change inside the loop. Comparing our
implementation to the algorithm in the SCXML spec reveals that this
check should indeed be done outside the loop.
Change-Id: I5e9824758fd147766e975d107a73561bd7f5a190
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Remember to register the metatype where we use it, so we don't depend
on another test being run previously.
And skip the setWorkingDirectory test completely on Unix. I don't know
why it needs to be skipped, but if we're not going to verify anything,
don't even try to do anything. This saves us one memory leak at least.
Change-Id: I22e151cc3fa7b4e976972aca8978b88b263d9bee
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>