Commit Graph

8214 Commits

Author SHA1 Message Date
Kent Hansen
d281aa6936 statemachine: Support parallel root state
QStateMachine inherits from QState, so it should be possible to set
its childMode to ParallelStates, and it should behave as expected
(the machine should emit the finished() signal when all its child
states are in final states).

Task-number: QTBUG-22931
Change-Id: Ic436351be0be69e3b01ae9984561132cd9839fa7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 08:42:45 +02:00
Kent Hansen
28e9a602cb statemachine: Emit finished() signal when the initial state is final
It's legal to set a QFinalState as the initial state. The state
machine should correctly emit the finished() signal upon entering
such a state in the initial transition, and don't do any further
processing.

Change-Id: Ica8d3fadbbde604512ea1136624af54eb3b13b11
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 08:42:40 +02:00
Kent Hansen
0d8789ad30 statemachine: Small refactoring of initial transition code
In preparation of supporting parallel root states, which will make
the initial transition creation slightly more involved.

Change-Id: Iad996eb4db248842c1a2088430c13bd5c953c374
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 08:42:36 +02:00
Kent Hansen
a7d6efb6e3 statemachine: Get rid of hidden start state
The hidden start state was used as a mechanism for performing the
initial transition (to the real initial state,
QStateMachine::setInitialState()), but it mutated the state machine
in a way that causes problems when the root state is a parallel
state group (see future commit).

Change-Id: I41ac4f6bcabf3bec0a412e46282a1373928105a3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 08:42:24 +02:00
Girish Ramakrishnan
018cd808fd linuxfb: add linuxfb.json and moc main.cpp
This makes the linuxfb plugin load

Change-Id: Idbe888b5795f8ac86f1e3cf197e42c99cca04818
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-07-11 06:06:27 +02:00
Girish Ramakrishnan
58f644dbcf linuxfb: make linuxfb compile
The plugin now compiles, it is not known to work.

Change-Id: I8dd086eb7fc41c6e197debc2601eebba3404187c
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-07-11 06:06:04 +02:00
Girish Ramakrishnan
2407f4f706 linuxfb: make platformsupport convenience compile
Rename fb_base to fbconvenience in-line with the other
convenience classes.

The code only compiles, it is not known to work.

Change-Id: If51700ddf0a11ace5129af6f00f34fd895a6a4df
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-07-11 06:05:49 +02:00
Oswald Buddenhagen
503530a8fd support building tools as application bundles
qmlplugindump needs that

Change-Id: I3b6b6689a32744262184fa781fda465460a87640
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-11 05:50:55 +02:00
Jason McDonald
bb3f2cceb3 List required xcb packages for Ubuntu 12.04.
Change-Id: Ia934a9da9986f451d90053891c80ec352b939172
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-11 05:48:02 +02:00
Kent Hansen
035c933eaa statemachine: Revamp property assignments implementation
In the old implementation, property assignments
(QState::assignProperty()) were "second-class citizens".
Assignments were not really integrated into the state machine
algorithm, but rather done as a separate step
(QStateMachinePrivate::applyProperties()). While that was
convenient for SCXML spec transcription purposes, it resulted
in some pretty poor semantics on the user side:

* Properties were not assigned until _after_ both the
QAbstractState::onEntry() function had been called and the
QState::entered() signal had been emitted.

* Automatic property restoration (QStateMachine::RestoreProperties)
did not play nice with nested states (and parallel states, in
particular).

The proper fix is to refactor the implementation to make
property assignments first-class in the core state machine
algorithm (QStateMachinePrivate::microstep()).

In practice, this meant splitting some steps. Instead of calling
exitStates() straight away, we now first only compute the states
to exit (without actually exiting them), and use the resulting set
to compute which properties are candidates for restoration.
Similarly, instead of calling enterStates(), we first only compute
the states to enter (without actually entering them), and use the
resulting set to compute which properties are assigned by the
entered states.

With that in place, the rest was a matter of moving the various
chunks of the old applyProperties() logic to the place where they
belong in the per-state entry/exit.

All existing autotests pass. Added several tests that verify the
desired semantics in more detail.

Task-number: QTBUG-20362
Change-Id: I7d8c7253b66cae87bb0d09aa504303218e230c65
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 05:17:10 +02:00
Kent Hansen
016695c7c7 statemachine: Refactor {enter,exit}States() functions
Move the computation of the sets of entered/exited states to
separate functions.

This separation is done in order to facilitate the integration
of property assignments (QState::assignProperty()) into the
core state machine algorithm.

Change-Id: I5b7084e0e37037eb64909d217856746d81bf1878
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-11 05:17:06 +02:00
Sean Harmer
026503152d XCB: Use glXCreateContextAttribsARB if available
If the GLX ARB extension ARB_create_context is available use the
function glXCreateContextAttribsARB to create a context for OpenGL 3 or
newer that honours the requested profile and version.

If a core profile is requested we also ensure that it is forwards
compatible.

Also ensure that the stored surface format reflects the requested
version.

Change-Id: Ie4f77be19bfc400440a2f8c9b3d99240eb430925
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-07-11 02:48:45 +02:00
Jan-Arve Saether
159b28d972 Remove clipboard operations from QAccessibleEditableTextInterface
Also, remove its subclass QAccessibleSimpleEditableTextInterface

Instead of having the subclass that implements this conveniently,
we move this behaviour over to the bridge. The bridge should
check if role() == EditableText is set, and then it should try to
support the IAccessibleEditableText interface (i.e.
it should accept the calls to replaceText(), deleteText() and
insertText()) and change the text with the following operations:
1. Query the text using QAccessibleTextInterface::text() or by
   using QAccessibleInterface::text(QAccessible::Value) as a fallback
2. Do the requested delete/insert/replace manipulation
3. Update the text with setText(QAccessible::Value, newText);

Change-Id: Iee5e41faf14351951e2bfca8c9eac970a113e878
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-07-11 02:47:34 +02:00
Sergio Ahumada
825cd7b9e5 Change deprecated use of qgenericplugin_qpa.h to qgenericplugin.h
In file included from kernel/qgenericpluginfactory.cpp:46:0:
  ../../include/QtGui/qgenericplugin_qpa.h:4:4: warning:
  #warning Header <QtGui/qgenericplugin_qpa.h> is deprecated.
  Please include <QtGui/qgenericplugin.h> instead. [-Wcpp]

Change-Id: I533270e23e742e6f15ad5d480afb4901fb8541b0
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-07-11 02:47:29 +02:00
Oswald Buddenhagen
faac4c0a3c add feature file for centralized qml plugin project handling
Change-Id: I7cdce31d7ac458656cf8e8490fd7f7e5c04ca106
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-07-11 02:47:16 +02:00
Stephen Kelly
1e469bac11 Set the IMPORTED_SONAME for imported targets.
On windows this doesn't need to be set. On Mac I'm not sure yet on
the various configurations.

Change-Id: I31f191711a2ae0a1bb7221ae6e1fef377d62f1dc
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-11 02:47:14 +02:00
Stephen Kelly
8ce0ac8d0d Fix the name of _debug libraries on APPLE.
Change-Id: Id3ae730c0ce0630f8ccc222fe09e5d3da23d124d
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-11 02:47:10 +02:00
Oswald Buddenhagen
a15d674406 fix linking against installations in /usr/lib
Change-Id: I17a6a2e058f039e525461d459477329fd7090417
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 23:06:25 +02:00
Oswald Buddenhagen
9d1f44b9ce make sure that building tests implies building other parts
some tests have runtime deps on the other parts

Change-Id: Ieb2925e762e94b3c0b16884be0f59e10ce8e4878
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-10 22:44:30 +02:00
Thomas McGuire
b9bb115972 Fix showNormal() and friends for platforms with fullscreen hint
Don't call show() inside of QWidget, as that might make the window
fullscreen due to QStyleHints::showIsFullScreen().

This regression was introduced earlier when QWidget::show() gained
support for the hint. No auto test caught the problem, as the
affected platforms (EGL and QNX) are not CI-tested.

Change-Id: I647c2362ac5b53ced562f1d77848552cc122fba0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-10 22:25:01 +02:00
Friedemann Kleint
b1909fe118 qtbase: Add missing example installs and files.
Change-Id: I071fd862e001b766c9fb13106242edf23a608663
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-10 22:24:40 +02:00
Jeremy Katz
d3ff621a57 make gui compile with QT_NO_SHORTCUT
The metatype system expects operator<<(QDataStream &, QKeySequence &)
even when shortcuts are disabled. This provides empty definitions for
that case.

Task-number: QTBUG-24816

Change-Id: Ie29fd01d38178bdc31cc51f1f08662b30edfc1e4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-10 15:38:58 +02:00
Eskil Abrahamsen Blomfeldt
a620b77896 Use DirectWrite font engine for non-ttf fonts as well
DirectWrite supports different font types, not just TTF. In order
to enable e.g. CFF support, we simply remove the test for TTF
which was initially put in to be on the safe side when handling
bitmap fonts. However, using DirectWrite with bitmap fonts also
seems to work fine, so there's no reason to have the fallback.

Task-number: QTBUG-22654
Change-Id: I8572bc421ab3dd223025ea152ba9b33f7cf33a8a
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-07-10 14:23:56 +02:00
Eskil Abrahamsen Blomfeldt
e316519c0e Get font's underline position in DirectWrite font engine
Fetch the correct underline position for the font along with
other metrics.

Task-number: QTBUG-22656
Change-Id: I35f6ea15ad18088033a5e7b7b83e2430c1b32a8f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 14:23:46 +02:00
Sergio Ahumada
c15e80f6ac test: subtract qurlinternal.pro when private_tests are not enabled
This test used requires(contains(QT_CONFIG,private_tests)) in its
.pro file, but did not subtract itself from its parent project
SUBDIRS when private_tests weren't enabled.

Change-Id: Idcd0893c4804a8217e4dd33ba9838ff67e996f58
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 14:16:13 +02:00
Laszlo Papp
a91e65036e Make the documentation consistent with the header and QVector* classes
Change-Id: If0c5951029beb388cf4b1b8269de7305d0556ef1
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-07-10 08:58:42 +02:00
Rohan McGovern
18ddd367b8 configure{.exe}: enable 'tools' as a default build part
Tools for each module should be enabled by default.

Prior to qt_parts.prf, they have been enabled by default, but only by
accident - the value of QT_BUILD_PARTS with respect to 'tools' was
generally not respected.

Change-Id: Icd49d6128d4050ff1c865967a563e9ab88c5a3a2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-10 08:33:49 +02:00
Kent Hansen
d219ea1ebc statemachine: Don't assign properties for transitions with no targets
If the transition has no target states, that means the current state
won't change; hence, property assignments should not be performed.
In particular, properties should not be restored to the values they
had before the state was entered.

Change-Id: I237bbb541f939c272777e70c5f26c886ec457a17
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:21:01 +02:00
Kent Hansen
d2a6f8e6dd statemachine: Tiny refactoring to avoid double lookup
Change-Id: I5040ca417dc12e1e0938ba7669b3017e414d13f9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:55 +02:00
Kent Hansen
130830e2d3 statemachine: Add some missing QT_NO_PROPERTIES guards
... and move the applyProperties() declaration to the right place.

Change-Id: Iff4f468f2e7bc0350866b737a0db02c0f74bdd4f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:48 +02:00
Kent Hansen
aa7180ca92 statemachine: Small refactoring of animation selection code
QStateMachinePrivate::applyProperties() is an epically long function.
Move the code for selecting animations to a separate function, in
preparation of a larger refactoring.

Change-Id: Ic5846db97dd0cb0d6ad01740f413b233d2a66975
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:39 +02:00
Kent Hansen
2f18e72762 statemachine: Purge restorable properties when they are restored
Previously, a registered restorable property would only be
unregistered if the property was animated (see
QStateMachinePrivate::_q_animationFinished()).
But if a property is set directly, it should also be unregistered;
otherwise, the state machine would use the previously saved (stale)
value the next time that property should be restored.

Change-Id: I5d246aa5355ddd0ba5f81b0186a9f0e4f3bbaa3f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:31 +02:00
Kent Hansen
bc5a4d28af Set compound state's initial state to 0 if it is removed/deleted
Change-Id: I45b7c15a9b3d5a1860cb9a7da8836f9eaaa0326d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:23 +02:00
Kent Hansen
5db78a077b statemachine: Let QPropertyAssignment do the property write
This allows QPropertyAssignment to be smarter (caching the
property index, for example).

Change-Id: Ib6d302f46f784219b6b3f07784e5c31dd7288c6e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:15 +02:00
Kent Hansen
ba87568655 statemachine: Don't crash if property assignment target is deleted
Do like QPropertyAnimation and store the QObject in a QPointer.
Purge the assignments list upon state entry and property restore.

Change-Id: I54a56885a2905178ab6aa5cf292b3d25c86b7a97
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 06:20:07 +02:00
Laszlo Papp
482205d847 Use Q_DECL_CONSTEXPR for the QFlag's inline constructor
Change-Id: I8f9c7bf0fddb79c6c0937e415c427a0547a5cab0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 03:26:13 +02:00
Marc Mutz
6f86fea820 QtGui: declare some classes as shared
Change-Id: I0ebb0ca8b8edcecc939021407d1755693f97e553
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-07-10 03:26:11 +02:00
Laszlo Papp
340bd0d429 Use factor and divisor wording to be consistent with the documentation and rest
Change-Id: If05bdcba8f94f4220bae4c40dc5fc3cf44ee41a0
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-07-10 03:25:28 +02:00
Laszlo Papp
f248fb58a3 Extend the sync profile with generating forward header for qnumeric.h
Change-Id: I3195758e02e26258f1a1ad888e0a069d62b66a53
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 03:25:04 +02:00
Kent Hansen
a37660ff5f statemachine: goToState() should require that the machine is running
goToState() is an internal function. Allowing both goToState() and
machine.setInitialState() to be used to set the initial state of the
machine complicates the logic of QStateMachine::start().

The existing tests for goToState() still pass.

Change-Id: Ie831b4c869848f7f4c3e6bd576cf298a9799eb22
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 03:25:02 +02:00
Harald Fernengel
e61fc701e4 Speed up QCoreApplication construction a bit
Remove all QString conversions during QCoreApplication construction on
Linux. Saves multiple mallocs.

Change-Id: Ia8ba071a750dd6a08dcf14ef3ecc424f70a3098d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 03:24:59 +02:00
Alexey Chernov
2d5d6c8fbc Color transparency support in html import/export
Export of color transparency component is added for cases where color
is exported to html. New static function colorValue() is added to
prepare CSS string representation of QColor. When the color is opaque,
it falls down to QColor::name() method which was used previously,
otherwise it returns 'rgba()' CSS statement or 'transparent' keyword in
case transparency is 0.
6-digit precision is used for alpha value as it's maximum which can be
processed properly by Gecko and Webkit engines
(http://lists.w3.org/Archives/Public/www-style/2009Dec/0295.html).

Import part for rgba() statement was also added to QCssParser. It
supports rgba() color values as stated in CSS Color Module Level 3
(http://www.w3.org/TR/css3-color/#rgba-color).

Import of undocumented statement 'rgba(int,int,int,int);' was also
added to preserve regression test success and to provide compatibility
with previous code relying on this behaviour.

Test cases added to QCssParser autotest for rgba(int,int,int,float)
statement and to QTextDocument autotest for rgba(int,int,int,float)
and 'transparent' statements for certain 'color', 'background-color'
and 'bgcolor' properties.

Change-Id: Id341c4e800249820d52edef8003e50f9a74d062b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-10 03:24:56 +02:00
Eskil Abrahamsen Blomfeldt
69fb70f6b3 Support fallback fonts in DirectWrite font engine
When selecting fallback fonts for a DirectWrite font, we would
cast the font engine to QWindowsFontEngine and get unpredictable
results and crashes. This change factors out getting the LOGFONT
data from the QFontDef struct and will use this to create a new
DirectWrite engine.

Task-number: QTBUG-22658

Change-Id: I743944d9a44d8742b47b1aa3354532493362cc4a
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-07-10 03:24:53 +02:00
Marc Mutz
fafc1c3dc3 QtDBus: declare some classes as shared
Change-Id: I82f8d8d02f4a5276924f579871547c0a34605424
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 03:24:27 +02:00
Marc Mutz
7c8d259231 Q_DECLARE_SHARED: mark the type movable
All implicitly shared classes are by definition movable,
so this patch adds Q_DECLARE_TYPEINFO(Type, Q_MOVABLE_TYPE)
to Q_DECLARE_SHARED.

Change-Id: Idf8989ae1a7ed6d1ac13fccb7eaef7395a875350
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-10 03:24:24 +02:00
Marc Mutz
9fb539085e QtCore: mark some classes as shared
Change-Id: I811d3eebd87c230883cc579c20f9fa4e14ff9521
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 03:24:18 +02:00
Marc Mutz
7e0562c5ff fix compilation with conforming compilers (e.g. GCC >= 4.7)
In qdbus_cast(), qMetaTypeId<QDBusArgument> as well as
qvariant_cast<QDBusArgument> are used. They don't depend
on any template argument of qdbus_cast(), so their
definitions need to be available at function template
definition instead of instantiation time.

But the necessary Q_DECLARE_METATYPE(QDBusArgument)
was at the end of the header, after the defintion of
qdbus_cast(), which is too late for conformin compilers.

Fixed by moving it up just after the QDBusArgument
definition.

Similarly, in tst_qdatetime and tst_qvector, the
Q_DECLARE_METATYPE() for Qt::DateFormat and QVector<int>,
and with it the specialisation of QMetaTypeId<>, were
issued after the first use of meta typing; too late for
conforming compilers.

Change-Id: I25ca0b06e68d5184597a22708404a8f2040b2de1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-10 03:24:15 +02:00
Laszlo Papp
c327838f67 Make the x() and y() method documentation consistent with the rest
Change-Id: I24d34fe32e2ed7673ba525db0543e705d08037c4
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-07-10 03:24:11 +02:00
Laszlo Papp
78163b7170 Add note and references to the operator*=() methods for consistency
Change-Id: Ic2681e1db39a30619d3b2a906595cdbdd0e766d6
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-07-10 03:24:01 +02:00
Konstantin Ritt
917b0df633 Optimize QFontMetrics:: boundingRect() and left/rightBearing()
by avoiding unneeded metrics calculation.
Same optimization for QFontMetricsF.

Change-Id: I7fd0caa2ddb45862ee9e9c0519a71b03bcd0cb6f
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-07-10 03:23:48 +02:00