Commit Graph

8510 Commits

Author SHA1 Message Date
Kent Hansen
0b66f723f0 Add QStateMachine constructor that takes a ChildMode
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>
2012-07-16 10:06:54 +02:00
Oswald Buddenhagen
034b5fd02e make QMAKE_RESOLVED_TARGET use normalized path separators
Change-Id: I23433a67364a9d09fa239b2c7f2cae495d3cc6df
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-16 01:06:55 +02:00
Oswald Buddenhagen
61d67ace5f make use of new functions
makes for cleaner code

Change-Id: I1a86bc4cac3778a1df37aa3307e5a8edac246961
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-16 01:06:53 +02:00
Oswald Buddenhagen
9651738f2d automatically fix separators in QMAKE_{DIST,}CLEAN
it's a tad insane to expect the user to do that

Change-Id: I75c68f2a28656c9ba2e3fabcc79718b899b29ce7
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-16 01:06:51 +02:00
Oswald Buddenhagen
4499a911c4 fix object file name clash
under extremely rare circumstances this would have actually failed

Change-Id: I4132d0f82e9f924e92e9e96f6d34451c94a67201
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-16 01:06:32 +02:00
Stephen Kelly
adfb66d02a Test QVariant copy with a user type instead of a QtNetwork type.
Change-Id: I78acc8a843eb12a2606f491d1a29e1bcd408d60f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-15 01:23:25 +02:00
Stephen Kelly
79dddcf089 Run QIcon related crash test with the other QtGui types.
Change-Id: I475cfc5a91a046951feecb425f8235ad37f1ba44
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-14 13:25:11 +02:00
Stephen Kelly
55d90b3240 Don't declare built-in metatypes as metatypes again.
Change-Id: Iba9804299e8f6e2db10965fdc719ee26f197758e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-14 13:25:03 +02:00
Stephen Kelly
c027372b80 Fix typo qith -> with.
Change-Id: Ie9eaa016c61f929be17fd1687517540c2ae1f3d2
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-07-14 13:24:54 +02:00
Eskil Abrahamsen Blomfeldt
28826fe463 Avoid crash when getting bearings from fallback font engine
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>
2012-07-14 02:41:05 +02:00
Stephen Kelly
6f540691c4 Add some tests to note that private signals can't be overloads.
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>
2012-07-13 19:21:55 +02:00
Stephen Kelly
90657f9236 Simplify the moc code related to private signals a bit.
Change-Id: I0e9bae82c7c6d313e4161c35d0b988f633d5ae60
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-13 19:21:55 +02:00
Rafael Roquetto
c589ce1917 [QNX] Force UNIX-style separators on Windows hosts
The QNX toolchain, even on Windows, uses UNIX-style directory separators
('/').

Change-Id: I78575c9856b1700438c05ec0da81149688d85522
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-07-13 17:06:39 +02:00
Thorbjørn Lund Martsum
a187fd9fb1 Fix a few compiler warnings.
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>
2012-07-13 17:01:52 +02:00
Jan-Arve Saether
d45bc23cd5 Relax the reqirement in which order events are delivered.
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>
2012-07-13 14:18:51 +02:00
Marc Mutz
02faddca53 QNX: normalize signals/slots
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>
2012-07-13 12:09:42 +02:00
Marc Mutz
d7d9364c9c plugins/bearer: normalize signals/slots
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>
2012-07-13 12:09:42 +02:00
Marc Mutz
8c148a2eec input/evdevmouse: normalize signals/slots
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>
2012-07-13 12:09:42 +02:00
Stephen Kelly
cf5d83e56d Only create the Qt5::WinMain target if it doesn't exist yet.
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>
2012-07-13 12:09:42 +02:00
Kevin Ottens
2832aaacd4 Make sure the emulated mouse event comes last
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>
2012-07-13 12:09:42 +02:00
Kent Hansen
df9e8ab9d6 statemachine: Micro-optimization for signal transition connect
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>
2012-07-13 12:09:42 +02:00
Kent Hansen
10384778d1 statemachine: Use new Qt5 api for obtaining method parameter types
This is much faster than the string-based api.

Change-Id: Id7ba76aee3346dd90412ec5c8505329360aae937
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-13 12:09:42 +02:00
Kent Hansen
95b6826ed4 statemachine: Make signal transition registration thread-safe
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>
2012-07-13 12:09:42 +02:00
Kent Hansen
f9a17d7f0f statemachine: Fix signal transition handling in multi-threaded setup
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>
2012-07-13 12:09:42 +02:00
Kent Hansen
058246c537 statemachine: Small refactoring of transition registration
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>
2012-07-13 12:09:42 +02:00
Girish Ramakrishnan
08345c5dac linuxfb: fix style in QFbCursor
Fix coding style, constness, m-prefix for member variables.

Change-Id: I9d75b410b398e5c3084b086b41884f2a0ddd6e5e
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-07-13 12:09:42 +02:00
Kent Hansen
22c7a1fd9b statemachine: Fix dynamic transition registration edge cases
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>
2012-07-13 12:09:42 +02:00
Kent Hansen
58bea0b8e0 statemachine: Avoid warning when setting up signal transition
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>
2012-07-13 12:09:42 +02:00
Kent Hansen
0d56dac3bc statemachine: Set correct signal index when signal is non-normalized
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>
2012-07-13 12:09:42 +02:00
Marc Mutz
a1590325ca doc/snippets: normalize signals/slots
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>
2012-07-13 12:09:42 +02:00
Marc Mutz
a42bc1e923 QtWidgets: normalize signals/slots
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>
2012-07-13 09:55:18 +02:00
Thomas McGuire
0f49ebb4c2 QNX: Fix flushing the backing store to non-owner windows
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>
2012-07-13 09:55:18 +02:00
Thomas McGuire
11dc9ca324 QNX: Extract and move adjustBufferSize() function
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>
2012-07-13 09:55:18 +02:00
Thomas McGuire
095f2d5292 QNX: Apply state from QWindow when creating new QQnxWindow
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>
2012-07-13 09:55:18 +02:00
Friedemann Kleint
00bafafbee Improve accessibility test helpers.
- 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>
2012-07-13 09:55:18 +02:00
Gunnar Sletta
c97104f31e Analog clock and raster window examples
Change-Id: I36586fbaa7da25208bbc1964d2708f094d0d5c98
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-07-13 09:55:18 +02:00
Marc Mutz
d472db2412 QtGui: normalize signals/slots
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>
2012-07-13 04:17:37 +02:00
Marc Mutz
279893cd5f meego: normalize signals/slots
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>
2012-07-13 04:17:37 +02:00
Stephen Kelly
f108fceb2c Make it possible to connect to QAbstract{State,Transtion} private signals.
Use the same trick as used for private signals in the models.

Change-Id: I4235788490cae0e3d554565621d145652dc5b0ca
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-13 01:51:47 +02:00
Stephen Kelly
536ec793b6 Make it possible to use new syntax to connect to model signals.
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>
2012-07-13 01:51:44 +02:00
Stephen Kelly
0efa445141 Create a way to inform moc about private signals.
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>
2012-07-13 01:51:42 +02:00
Jason McDonald
a2b0ab4f57 Make it clear that stickman example animations are binary files.
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>
2012-07-13 01:51:40 +02:00
Jędrzej Nowacki
197f34bcff Test for QMetaType binary breakage.
Type traits can not be changed durring Qt5 life time.

Change-Id: If69f65ff2113c901580afee91b11ae1b11c13a4f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-13 01:51:38 +02:00
Martin Smith
8ca17ed943 qdoc: Clean path names before using them
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>
2012-07-13 01:51:37 +02:00
Christoph Schleifenbaum
770e1d30a2 Mac: Fix crash on Mac OS 10.6 with new scrollbars.
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>
2012-07-13 01:51:35 +02:00
Marc Mutz
ea6946318f tst_QMimeDatabase: use QFutureSynchronizer
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>
2012-07-13 01:51:33 +02:00
Kent Hansen
c4cef6fae9 statemachine: Fix state entry bug for parallel state groups
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>
2012-07-12 20:38:02 +02:00
Kent Hansen
b76014b8ef statemachine: Move invariant code out of loop body
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>
2012-07-12 20:38:02 +02:00
Gunnar Sletta
5b87b6eda3 Fix compilation for some glxext.h header versions
Change-Id: I62b636d9f884c225e64a653db1a5f5da822d4af2
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-07-12 20:38:02 +02:00
Thiago Macieira
d693a8914c Fix small problems with tst_QProcess
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>
2012-07-12 18:34:56 +02:00